VoronoiFracture demo question

catchyid
Posts: 15
Joined: Thu Jul 30, 2015 2:12 pm

VoronoiFracture demo question

Post by catchyid »

Hi,
I am going through the "VoronoiFracture" that ships with Bullet, and I have one question about function
void VoronoiFractureDemo::attachFixedConstraints() : the function creates constraints between colliding objects and add them to the dynamics world, HOWEVER at the end it removes these rigidbodies from the dynamics world then re-adds them again? why is that?

i.e. at line 204
for (int i=0;i<bodies.size();i++)
{
m_dynamicsWorld->removeRigidBody(bodies);
m_dynamicsWorld->addRigidBody(bodies);
}


thanks in advance,