But I'm having difficulty with lack of documentation, I want to make some objects static to use for the background, some I want to just turn off the gravity so they'll float there but still react to applyforce (like the camera), and of course character capsules for the player and NPCs.
I'm implementing bodies based on the hello-world tutorial
Code: Select all
btMotionState* fallMotionState =
new OgreBulletMotionState(btTransform(btQuaternion(0,0,0,1),btVector3(0,0,0)), (Ogre::SceneNode*)OgreNode);
btRigidBody::btRigidBodyConstructionInfo fallRigidBodyCI(mass,fallMotionState,Shape,fallInertia);
Body = new btRigidBody(fallRigidBodyCI);
Body->setUserPointer(this);
Body->setCollisionFlags(btCollisionObject::CF_STATIC_OBJECT);
dynamicsWorld->addRigidBody(Body);
What am I doing wrong? Is the code bad or have I failed to grasp some basic concepts?
Edit:
I've found the problem with the static objects. I have to force the graphic nodes to synchronize with the static body because they're never called otherwise.
Body->getMotionState()->setWorldTransform(Body->getWorldTransform());
EditEdit: Found the manual - it answered the rest of the above. They really should make it more visible than a small link to a PDF file!