Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fu5ha/ccbullet3d
An easy-to-use wrapper in the Cocos/Objective-C style to integrate the robust, C++ physics library "Bullet" with Cocos3D.
https://github.com/fu5ha/ccbullet3d
Last synced: 9 days ago
JSON representation
An easy-to-use wrapper in the Cocos/Objective-C style to integrate the robust, C++ physics library "Bullet" with Cocos3D.
- Host: GitHub
- URL: https://github.com/fu5ha/ccbullet3d
- Owner: fu5ha
- Created: 2011-07-01T02:11:50.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2014-09-04T05:09:20.000Z (about 10 years ago)
- Last Synced: 2024-10-16T05:58:51.415Z (21 days ago)
- Language: C++
- Homepage:
- Size: 1 MB
- Stars: 16
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
Bullet Cocos3D Wrapper
IMPORTANT!!
You need to edit your build settings and add a NOT recursive header search path "./Bullet\ Wrapping/src/" WITH the quotes to the "Header Search Paths" and "User Header Search Paths".create an instance of CC3PhysicsWorld (contains a btDiscreteDynamicsWorld)
CC3PhysicsWorld *_physicsWorld = [[CC3PhysicsWorld alloc] init];
and set it's gravity
[_physicsWorld setGravity:0 y:-9.8 z:0];create a physics object
//for a box that is 1 x 1 x 1
CC3MeshNode *boxNode;
btCollisionShape *boxCollisionShape = btBoxCollisionShape(btVector3(1,1,1));//I might provide a wrapper sometime in the future.
CC3PhysicsObject3D *boxObject = [_physicsWorld createPhysicsObject:node shape:boxCollisionShape mass:1 restitution:0.3 position:boxNode.location];apply force/impulse
[boxObject applyForce:cc3v(0,1,0) position:boxObject.node.position];
[boxObject applyImpulse:cc3v(0,1,0) position:boxObject.node.position];you need to call this in an update method:
[_physicsWorld synchTransformation];to set the location of a physics object you need to delete the object then re-make it