initialize method

void initialize(
  1. A b1,
  2. B b2,
  3. Vector2 anchor,
  4. Vector2 axis,
)

Initialize the bodies, anchors, axis, and reference angle using the world anchor and world axis.

Implementation

void initialize(A b1, B b2, Vector2 anchor, Vector2 axis) {
  bodyA = b1;
  bodyB = b2;
  localAnchorA.setFrom(bodyA.localPoint(anchor));
  localAnchorB.setFrom(bodyB.localPoint(anchor));
  localAxisA.setFrom(bodyA.localVector(axis));
  referenceAngle = bodyB.angle - bodyA.angle;
}