Resource Management with Bullet?

Please don't post Bullet support questions here, use the above forums instead.
Post Reply
Mars_999
Posts: 25
Joined: Tue Dec 04, 2007 7:48 pm

Resource Management with Bullet?

Post by Mars_999 »

I am wondering about btRigidBody and when you dynamically allocate these objects will Bullet delete them once you add them to btDiscreteDynamicsWorld?

e.g.
btRigidBody* groundRigidBody = new btRigidBody(groundRigidBodyCI);
dynamicsWorld->addRigidBody(groundRigidBody);

since I added it to dynamicsWorld will bullet delete it, or am I still responsible for deleting all my new'd objects?

So why do I need to do this if I even need to at all?

for(int i = dynamicsWorld->getNumCollisionObjects(); ++i)
{
btCollisionObject* p = dynamicWorld->getCollsionObjectArray();
delete p;
}

Thanks!
Post Reply