Code: Select all
btVector3 inertia;
capsule->calculateLocalInertia(mass, localInertia);
//Create BtOgre MotionState (connects Ogre and Bullet).
BtOgre::RigidBodyState *state = new BtOgre::RigidBodyState(name);
//Create the Body.
body4 = new btRigidBody(mass, state, capsule, localInertia);
/*btDynamicsWorld*/
dynamicsWorld->addRigidBody(body4);
In my game When my entity stops moving, I can no longer control it. so im now trying to reset its state. when i do this the object is shot around at random.I dont understand , i cant figure out how to reset motion states. please help