Page 1 of 1

How to modify the position of a dynamic btRigidBody object?

Posted: Fri Mar 09, 2012 3:19 am
by daedalic
I'm trying to modify the position of a btRigidBody object in between calls to stepSimulation.

I am using a discrete dynamics world to step the simulation. I can modify the position of a rigid body object fine before I register it to the dynamics world. However once I have registered it to the dynamics world, an initial call to stepSimulation after modifying the position will reset the position of the object to its original position. Any further calls to stepSimulation will set the object to where it would have been, completely ignoring any manual position changes.

I am setting the position like this:

rigidBodyObject->getMotionState()->setWorldTransform(positionChangeTransformation);

Any help with how to do this would be much appreciated. Thanks!

Re: How to modify the position of a dynamic btRigidBody obje

Posted: Fri Mar 09, 2012 8:27 pm
by davidc538
try calling btRigidBody::setMotionState or btRigidBody::setWorldTransform directly

Re: How to modify the position of a dynamic btRigidBody obje

Posted: Mon Mar 12, 2012 3:23 am
by jauthu
What is the methods you're using?

try btRigidBody::proceedToTransform (const btTransform & newTrans)

or setCenterOfMassTransform (const btTransform& xform)
which is the same