How to modify the position of a dynamic btRigidBody object?
Posted: Fri Mar 09, 2012 3:19 am
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!
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!