assertNotLocked(); Joint j = Joint.create(this, def); j.m_edgeA.other = j.getBodyB(); j.m_edgeA.prev = null; j.m_edgeA.next = j.getBodyA().m_jointList; if (j.getBodyA().m_jointList != null) { j.getBodyA().m_jointList.prev = j.m_edgeA; j.getBodyA().m_jointList = j.m_edgeA; j.m_edgeB.other = j.getBodyA(); j.m_edgeB.prev = null; j.m_edgeB.next = j.getBodyB().m_jointList; if (j.getBodyB().m_jointList != null) { j.getBodyB().m_jointList.prev = j.m_edgeB; j.getBodyB().m_jointList = j.m_edgeB;
public static void destroy(Joint joint) { joint.destructor(); }
/** * 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(); Body bodyA = j.getBodyA(); Body bodyB = j.getBodyB(); j.m_edgeB.next = null; Joint.destroy(j);
m_joints[i].initVelocityConstraints(solverData); m_joints[j].solveVelocityConstraints(solverData); boolean jointOkay = m_joints[j].solvePositionConstraints(solverData); jointsOkay = jointsOkay && jointOkay;
assertNotLocked(); boolean collideConnected = j.getCollideConnected(); Body bodyA = j.getBodyA(); Body bodyB = j.getBodyB(); j.m_edgeB.next = null; Joint.destroy(j);
m_joints[i].initVelocityConstraints(solverData); m_joints[j].solveVelocityConstraints(solverData); boolean jointOkay = m_joints[j].solvePositionConstraints(solverData); jointsOkay = jointsOkay && jointOkay;
assertNotLocked(); Joint j = Joint.create(this, def); j.m_edgeA.other = j.getBodyB(); j.m_edgeA.prev = null; j.m_edgeA.next = j.getBodyA().m_jointList; if (j.getBodyA().m_jointList != null) { j.getBodyA().m_jointList.prev = j.m_edgeA; j.getBodyA().m_jointList = j.m_edgeA; j.m_edgeB.other = j.getBodyA(); j.m_edgeB.prev = null; j.m_edgeB.next = j.getBodyB().m_jointList; if (j.getBodyB().m_jointList != null) { j.getBodyB().m_jointList.prev = j.m_edgeB; j.getBodyB().m_jointList = j.m_edgeB;
public static void destroy(Joint joint) { joint.destructor(); }
/** * 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; }