Deleting RigidBodies

Post Reply
trying
Posts: 15
Joined: Sat May 16, 2015 4:32 pm

Deleting RigidBodies

Post by trying » Fri Nov 06, 2015 4:27 pm

Hello,

I have been trying deleting rigid bodies during simulation and it always crashes my application. I followed the below code.

Code: Select all

void destroyBodies(btDiscreteDynamicsWorld* dynamicsWorld, btRigidBody* body)
{
    dynamicsWorld->removeRigidBody(body);
    delete body->getMotionState();
    delete body;
}

xexuxjy
Posts: 225
Joined: Wed Jan 07, 2009 11:43 am
Location: London

Re: Deleting RigidBodies

Post by xexuxjy » Fri Nov 06, 2015 5:26 pm

Where about's does it crash exactly? do you always have a motionstate on the bodies?

trying
Posts: 15
Joined: Sat May 16, 2015 4:32 pm

Re: Deleting RigidBodies

Post by trying » Fri Nov 06, 2015 5:39 pm

Solved it, there was a mistake on my side related with structs.

Post Reply