How to modify the position of a dynamic btRigidBody object?

Post Reply
daedalic
Posts: 1
Joined: Fri Mar 09, 2012 3:06 am

How to modify the position of a dynamic btRigidBody object?

Post 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!
davidc538
Posts: 7
Joined: Mon Nov 08, 2010 2:00 am

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

Post by davidc538 »

try calling btRigidBody::setMotionState or btRigidBody::setWorldTransform directly
jauthu
Posts: 12
Joined: Tue Feb 28, 2012 7:34 pm

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

Post by jauthu »

What is the methods you're using?

try btRigidBody::proceedToTransform (const btTransform & newTrans)

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