You can see it in the video (select hd since the debug boxes are difficult to see), the blue moving platforms and objects.
https://www.youtube.com/watch?v=daAFLZj ... e=youtu.be
Im using the same motionstate as here http://www.bulletphysics.org/mediawiki- ... tionStates since im using ogre too, and then on each update of the platforms/objects I do:
Code: Select all
m_pMotionState->setKinematicPos(btTransform(
BtOgre::Convert::toBullet(m_pNode->_getDerivedOrientation()),
BtOgre::Convert::toBullet(m_pNode->_getDerivedPosition()) ) );
I create the rigidbody like this:
Code: Select all
//my motion state
BtOgre::RigidBodyState* motionState = new BtOgre::RigidBodyState
(pNode, btTransform(BtOgre::Convert::toBullet(rotation),
BtOgre::Convert::toBullet(position)) );
btRigidBody *rigidbody;
btRigidBody::btRigidBodyConstructionInfo rigidbodyCI(
0,
motionState,
collShape,
btVector3(0,0,0)
);
rigidbody = new btRigidBody(rigidbodyCI);
rigidbody->setFriction(0);
rigidbody->setRestitution(0);
rigidbody->setActivationState(DISABLE_DEACTIVATION);
rigidbody->setCollisionFlags(rigidbody->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT);