States

JohnBoyMan
Posts: 14
Joined: Tue Jun 28, 2011 4:11 am

States

Post by JohnBoyMan »

Hello I am using this code

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
ouch67
Posts: 17
Joined: Tue Jul 26, 2011 9:24 pm

Re: States

Post by ouch67 »

you just have to make the object active to make it come back to life. Best to set it so it doesn't go inactive in the first place though.

Glad to see someone else using ogre and btogre ;)