https://github.com/psigen/node-bulletphysics
Node.js bindings to Bullet Physics through node-ffi
https://github.com/psigen/node-bulletphysics
Last synced: about 1 year ago
JSON representation
Node.js bindings to Bullet Physics through node-ffi
- Host: GitHub
- URL: https://github.com/psigen/node-bulletphysics
- Owner: psigen
- License: bsd-3-clause
- Created: 2013-11-24T00:50:40.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2013-11-24T17:20:12.000Z (over 12 years ago)
- Last Synced: 2023-04-08T04:47:46.233Z (about 3 years ago)
- Language: JavaScript
- Size: 15 MB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
node-bullet
===========
Node.js bindings to Bullet Physics through [node-ffi].
These bindings are automatically generated via [node-ffi-generate] from the Bullet C API header file (`Bullet-C-Api.h`). They have a 1:1 mapping with the existing Bullet C API documentation.
* [Documentation for the Bullet C API]
Installing this library via NPM
-------------------------------
Currently, this library is not published to `npm`. However, you can use it in npm projects by adding it to your `package.json` using a git url:
```javascript
"dependencies": {
"bulletphysics": "git://github.com/psigen/node-bulletphysics.git"
}
```
Example Usage
-------------
```javascript
var bullet = require('bulletphysics').bullet;
var sdk = bullet.plNewBulletSdk();
...
console.log('Doing Bullet stuff...');
...
bullet.plDeletePhysicsSdk(sdk);
```
Compilation notes
-----------------
* By default, `BT_DOUBLE_PRECISION` is enabled, because I need it. It can be disabled by editing the `defines` in (binding.gyp)[binding.gyp].
* During node-gyp, the tarball in [src](src) is extracted to `src/bullet`. If you want to mess with the bullet source before compiling, just put your own source code in that directory.
* Some functions from the C API were removed, as they had no actual implementation in the source code. They are commented out in [bulletphysics.js](lib/bulletphysics.js)
* GPU accelerated functions were not compiled, since they add a dependency on OpenCL that I didn't want to handle.
[node-ffi]: https://github.com/rbranson/node-ffi
[node-ffi-generate]: https://github.com/tjfontaine/node-ffi-generate
[Documentation for the Bullet C API]: http://bulletphysics.org/Bullet/BulletFull/Bullet-C-Api_8h.html