Hi.
I'm trying to destroy (delete, remove from the world) dynamic body. How to do that?
(I tried RigidBody.destroy(), but it doesn't do the trick)
Thank you.
how to destroy
-
- Posts: 39
- Joined: Fri May 08, 2009 9:27 pm
Re: how to destroy
Hi,
Well, what is usually done is simply to call removeCollisionObject on your btDiscreteDynamicsWorld instance to remove the btRigidBody pointer from the physic world, and then to delete this btRigidBody pointer.
That`s what I do in my integration of bullet.
Also, take a look at the bullet demos, you will see plenty of example to help you figure those details.
Verbo
Well, what is usually done is simply to call removeCollisionObject on your btDiscreteDynamicsWorld instance to remove the btRigidBody pointer from the physic world, and then to delete this btRigidBody pointer.
That`s what I do in my integration of bullet.
Also, take a look at the bullet demos, you will see plenty of example to help you figure those details.
Verbo