I've tried removing the rigid body from the dynamics world, moving it, and then adding it back again as described in this post, which works fine unless the object i'm teleporting has reached a rest state.
If i teleport a falling object it will teleport no worries, and maintain it's velocity, etc. However if i teleport the object once it has hit the ground and come to a complete stop it moves to it's new location but is no longer affected by gravity.
This is the method i'm using to remove the object from the world and move it to a new location:
Code: Select all
//remove
dynamicsWorld->removeRigidBody( body );
//move
btTransform newTrans = body->getWorldTransform();
newTrans.setOrigin( newLocation );
newTrans.setRotation( newRotation );
body->setWorldTransform( newTrans );
//add again
dynamicsWorld->addRigidBody( body );
Any help is appreciated..
Cheers