/** * This is used to prevent connected bodies from colliding. * It may lie, depending on the collideConnected flag. * * @param other other body * @return if they should collide */ public boolean shouldCollide(Body other) { // At least one body should be dynamic. if (type != BodyType.DYNAMIC && other.type != BodyType.DYNAMIC) { return false; } // Does a joint prevent collision? for (JointEdge jn = m_jointList; jn != null; jn = jn.next) { if (jn.other == other) { if (!jn.joint.getCollideConnected()) { return false; } } } return true; }
/** * This is used to prevent connected bodies from colliding. * It may lie, depending on the collideConnected flag. * * @param other other body * @return if they should collide */ public boolean shouldCollide(Body other) { // At least one body should be dynamic. if (type != BodyType.DYNAMIC && other.type != BodyType.DYNAMIC) { return false; } // Does a joint prevent collision? for (JointEdge jn = m_jointList; jn != null; jn = jn.next) { if (jn.other == other) { if (!jn.joint.getCollideConnected()) { return false; } } } return true; }
assertNotLocked(); boolean collideConnected = j.getCollideConnected();
assertNotLocked(); boolean collideConnected = j.getCollideConnected();