[ODE] Telling contact joints from "every other joint" for the purposes of proper non-collision between jointed bodies?

Megan Fox shalinor at gmail.com
Tue Aug 16 15:11:18 MST 2005


My problem is thus - if I walk up next to another character, such that
we're colliding, and I then swing my sword, the sword's collision gets
ignored.  This is because, when the entities are in contact, a contact
joint is generated between them - and my code to ditch any collisions
between jointed bodies, catches this, and ignores ALL collisions until
that joint is resolved (this includes the weapon collision).

The solution is to take that bit of code out of my collision callback,
and allow jointed bodies to collide, but this will most certainly
cause problems when I get back to ragdolls and their proper
implementation.  If I allow collision between ragdoll limbs, it'll
screw up their flexibility and stability (blah blah blah, well known
topic, and so on).



The method to fix this that I've come up with is:

1.) Detect if two bodies are jointed
2.) Grab the number of joints
3.) Check all joints for a non-dContactJoint type
4.) If there is a non dContactJoint joint between these bodies, it's a
"real" jointed body set, so don't collide.
4.5.) If there are only dContactJoint's between the bodies, it isn't
jointed, continue


But that seems a trifle overkill for what seems like a simple problem.
 Does anyone have a better solution?


Thanks,
-Megan Fox
Lead Dev, Elium Project
http://www.elium.tk



More information about the ODE mailing list