int jointIndex = joint.getJoints(i);
if (!jointMap.containsKey(jointIndex)) {
throw new IllegalArgumentException("Index " + jointIndex
+ " is not present in the joint map");
}
Joint djoint = jointMap.get(jointIndex);
if (!(djoint instanceof DistanceJoint)) {
throw new IllegalArgumentException(
"Joints for constant volume joint must be distance joints");
}
def.addBodyAndJoint(argBodyMap.get(body), (DistanceJoint) djoint);
}
break;
}
case LINE: {
UnsupportedObjectException e =
new UnsupportedObjectException("Line joint no longer supported.", Type.JOINT);
if (ulistener == null || ulistener.isUnsupported(e)) {
throw e;
}
return null;
}
default: {
UnsupportedObjectException e =
new UnsupportedObjectException("Unknown joint type: " + joint.getType(), Type.JOINT);
if (ulistener == null || ulistener.isUnsupported(e)) {
throw e;
}
return null;
}
}
jd.collideConnected = joint.getCollideConnected();
if (!argBodyMap.containsKey(joint.getBodyA())) {
throw new IllegalArgumentException("Index " + joint.getBodyA()
+ " is not present in the body map");
}
jd.bodyA = argBodyMap.get(joint.getBodyA());
if (!argBodyMap.containsKey(joint.getBodyB())) {
throw new IllegalArgumentException("Index " + joint.getBodyB()
+ " is not present in the body map");
}
jd.bodyB = argBodyMap.get(joint.getBodyB());
Joint realJoint = argWorld.createJoint(jd);
if (listener != null && joint.hasTag()) {
listener.processJoint(realJoint, joint.getTag());
}
return realJoint;