Teleporting a rigid body
-
- Posts: 9
- Joined: Fri Aug 18, 2006 7:24 pm
Teleporting a rigid body
Is there a proper way for teleporting a dynamic rigid body? I sometimes have the need to force the position of a body, and often they receive outrageous speeds after such a teleport. Forcing the velocity to 0 did not help, and I can't make it a kinematic body, as you suggested in another post. So is there some way to reset a body to its initial state?
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Teleporting can easiest be done by removing the rigidbody from the dynamics world, setting the new position, and adding it back to the world.
Alternatively, you can check how to clear contact points, when teleporting a rigidbody, in Bullet/Demos/OpenGL/DemoApplication.cpp
Hope this helps,
Erwin
Alternatively, you can check how to clear contact points, when teleporting a rigidbody, in Bullet/Demos/OpenGL/DemoApplication.cpp
Code: Select all
void DemoApplication::clientResetScene()
Erwin