/** * Initialize the bodies, anchors, axis, and reference angle using the world anchor and world * axis. */ public void initialize(Body bA, Body bB, Vec2 anchor) { bodyA = bA; bodyB = bB; bA.getLocalPointToOut(anchor, localAnchorA); bB.getLocalPointToOut(anchor, localAnchorB); } }
public void initialize(Body b1, Body b2, Vec2 anchor, Vec2 axis) { bodyA = b1; bodyB = b2; b1.getLocalPointToOut(anchor, localAnchorA); b2.getLocalPointToOut(anchor, localAnchorB); bodyA.getLocalVectorToOut(axis, localAxisA); } }
/** * Gets a local point relative to the body's origin given a world point. * * @param a point in world coordinates. * @return the corresponding local point relative to the body's origin. */ public final Vec2 getLocalPoint(Vec2 worldPoint) { Vec2 out = new Vec2(); getLocalPointToOut(worldPoint, out); return out; }
/** * Initialize the bodies, anchors, and reference angle using the world anchor. * * @param b1 * @param b2 * @param anchor */ public void initialize(final Body b1, final Body b2, final Vec2 anchor) { bodyA = b1; bodyB = b2; bodyA.getLocalPointToOut(anchor, localAnchorA); bodyB.getLocalPointToOut(anchor, localAnchorB); referenceAngle = bodyB.getAngle() - bodyA.getAngle(); } }
/** * Initialize the bodies, anchors, and reference angle using a world anchor point. * * @param bA * @param bB * @param anchor */ public void initialize(Body bA, Body bB, Vec2 anchor) { bodyA = bA; bodyB = bB; bodyA.getLocalPointToOut(anchor, localAnchorA); bodyB.getLocalPointToOut(anchor, localAnchorB); referenceAngle = bodyB.getAngle() - bodyA.getAngle(); } }
/** * Initialize the bodies, anchors, axis, and reference angle using the world anchor and world * axis. */ public void initialize(Body b1, Body b2, Vec2 anchor, Vec2 axis) { bodyA = b1; bodyB = b2; bodyA.getLocalPointToOut(anchor, localAnchorA); bodyB.getLocalPointToOut(anchor, localAnchorB); bodyA.getLocalVectorToOut(axis, localAxisA); referenceAngle = bodyB.getAngle() - bodyA.getAngle(); } }
public void initialize(Body bA, Body bB) { bodyA = bA; bodyB = bB; Vec2 xB = bodyB.getPosition(); bodyA.getLocalPointToOut(xB, linearOffset); float angleA = bodyA.getAngle(); float angleB = bodyB.getAngle(); angularOffset = angleB - angleA; } }
/** * Initialize the bodies, anchors, axis, and reference angle using the world anchor and world * axis. */ public void initialize(Body bA, Body bB, Vec2 anchor) { bodyA = bA; bodyB = bB; bA.getLocalPointToOut(anchor, localAnchorA); bB.getLocalPointToOut(anchor, localAnchorB); } }
public void initialize(Body b1, Body b2, Vec2 anchor, Vec2 axis) { bodyA = b1; bodyB = b2; b1.getLocalPointToOut(anchor, localAnchorA); b2.getLocalPointToOut(anchor, localAnchorB); bodyA.getLocalVectorToOut(axis, localAxisA); } }
/** * Gets a local point relative to the body's origin given a world point. * * @param a point in world coordinates. * @return the corresponding local point relative to the body's origin. */ public final Vec2 getLocalPoint(Vec2 worldPoint) { Vec2 out = new Vec2(); getLocalPointToOut(worldPoint, out); return out; }
/** * Initialize the bodies, anchors, and reference angle using a world anchor point. * * @param bA * @param bB * @param anchor */ public void initialize(Body bA, Body bB, Vec2 anchor) { bodyA = bA; bodyB = bB; bodyA.getLocalPointToOut(anchor, localAnchorA); bodyB.getLocalPointToOut(anchor, localAnchorB); referenceAngle = bodyB.getAngle() - bodyA.getAngle(); } }
/** * Initialize the bodies, anchors, and reference angle using the world anchor. * * @param b1 * @param b2 * @param anchor */ public void initialize(final Body b1, final Body b2, final Vec2 anchor) { bodyA = b1; bodyB = b2; bodyA.getLocalPointToOut(anchor, localAnchorA); bodyB.getLocalPointToOut(anchor, localAnchorB); referenceAngle = bodyB.getAngle() - bodyA.getAngle(); } }
/** * Initialize the bodies, anchors, axis, and reference angle using the world anchor and world * axis. */ public void initialize(Body b1, Body b2, Vec2 anchor, Vec2 axis) { bodyA = b1; bodyB = b2; bodyA.getLocalPointToOut(anchor, localAnchorA); bodyB.getLocalPointToOut(anchor, localAnchorB); bodyA.getLocalVectorToOut(axis, localAxisA); referenceAngle = bodyB.getAngle() - bodyA.getAngle(); } }
public void initialize(Body bA, Body bB) { bodyA = bA; bodyB = bB; Vec2 xB = bodyB.getPosition(); bodyA.getLocalPointToOut(xB, linearOffset); float angleA = bodyA.getAngle(); float angleB = bodyB.getAngle(); angularOffset = angleB - angleA; } }
/** * Initialize the bodies, anchors, axis, and reference angle using the world anchor and world * axis. */ public void initialize(Body bA, Body bB, Vec2 anchor) { bodyA = bA; bodyB = bB; bA.getLocalPointToOut(anchor, localAnchorA); bB.getLocalPointToOut(anchor, localAnchorB); } }
/** * Initialize the bodies, anchors, axis, and reference angle using the world * anchor and world axis. */ public void initialize(Body bA, Body bB, Vec2 anchor){ bodyA = bA; bodyB = bB; bA.getLocalPointToOut(anchor, localAnchorA); bB.getLocalPointToOut(anchor, localAnchorB); } }
public void initialize(Body b1, Body b2, Vec2 anchor, Vec2 axis) { bodyA = b1; bodyB = b2; b1.getLocalPointToOut(anchor, localAnchorA); b2.getLocalPointToOut(anchor, localAnchorB); bodyA.getLocalVectorToOut(axis, localAxisA); } }
public void initialize(Body b1, Body b2, Vec2 anchor, Vec2 axis) { bodyA = b1; bodyB = b2; b1.getLocalPointToOut(anchor, localAnchorA); b2.getLocalPointToOut(anchor, localAnchorB); bodyA.getLocalVectorToOut(axis, localAxisA); } }
/** * Gets a local point relative to the body's origin given a world point. * * @param worldPoint point in world coordinates. * @return the corresponding local point relative to the body's origin. */ public final Vec2 getLocalPoint(Vec2 worldPoint) { Vec2 out = new Vec2(); getLocalPointToOut(worldPoint, out); return out; }
jd1.bodyA = ground; jd1.bodyB = body1; ground.getLocalPointToOut(bd1.position, jd1.localAnchorA); body1.getLocalPointToOut(bd1.position, jd1.localAnchorB); jd1.referenceAngle = body1.getAngle() - ground.getAngle(); m_joint1 = (RevoluteJoint) m_world.createJoint(jd1);