
444 Chapter 17 Putting It All Together
cyclone::CollisionDetector::sphereAndSphere(
boneSphere,
otherSphere,
&cData
);
}
}
// Check for joint violation.
for (cyclone::Joint *joint = joints; joint < joints+NUM_JOINTS;
joint++)
{
if (!cData.hasMoreContacts()) return;
unsigned added = joint->addContact(cData.contacts,
cData.contactsLeft);
cData.addContacts(added);
}
}
This is a fast and effective ragdoll model. It isn’t the most stable method, howev er. For
very large ragdolls, a lot of interpenetration resolution iterations are needed to keep
the extremities from wandering too far from their correct place.
More Complex Joints
The approach of the ragdoll demo is abo ...