deleting btRigidBody

kg
Posts: 1
Joined: Fri Aug 17, 2007 2:45 pm

deleting btRigidBody

Post by kg »

How to delete btRigidBody properly? I use following code, that sometimes creates exception:


for (int c = 0; c < item->getNumConstraintRefs(); c++)
{
item->removeConstraintRef(item->getConstraintRef(c));
}

delete item;
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Post by Erwin Coumans »

You shouldn't need to manually remove the constraint refs. Instead, remove and delete the constraints that refer to this rigidbody, before deleting the rigidbody.

Hope this helps,
Erwin