How to remove a OgreNewt::Body object?

FireSoul

18-08-2006 02:51:31

Hi, I am at the moment trying to create a bullet class, and was wondering how you delete the 'OgreNewt::Body' representing the bullet. I have looked at the available functions for OgreNewt::Body and can see that I need to remove the force callbacks and the collision callbacks aswell, trouble is I dont know if that is just it, or there is something else to do.
Could someone explain how you are supposed to delete a OgreNewt::Body aswell as the callbacks assigned to it?
Any help is much appreciated. Thanks.

Ryan.

walaber

18-08-2006 08:24:06

you can just call "delete" on the pointer to the body. it will be removed from the physics world automatically.

if the callbacks are in seperate classes, and you want to remove them, delete them at the same time.