private void addJoint(PhysicsJoint joint) { if (physicsJoints.containsKey(joint.getObjectId())) { logger.log(Level.WARNING, "Joint {0} already exists in PhysicsSpace, cannot add.", joint); return; } logger.log( Level.FINE, "Adding Joint {0} to physics space.", Long.toHexString(joint.getObjectId())); physicsJoints.put(joint.getObjectId(), joint); addConstraintC(physicsSpaceId, joint.getObjectId(), !joint.isCollisionBetweenLinkedBodys()); // dynamicsWorld.addConstraint(joint.getObjectId(), // !joint.isCollisionBetweenLinkedBodys()); }
private void removeJoint(PhysicsJoint joint) { if (!physicsJoints.containsKey(joint.getObjectId())) { logger.log(Level.WARNING, "Joint {0} does not exist in PhysicsSpace, cannot remove.", joint); return; } logger.log( Level.FINE, "Removing Joint {0} from physics space.", Long.toHexString(joint.getObjectId())); physicsJoints.remove(joint.getObjectId()); removeConstraint(physicsSpaceId, joint.getObjectId()); // dynamicsWorld.removeConstraint(joint.getObjectId()); }