initialize method
void
initialize()
Initialize the bodies, anchors, lengths, max lengths, and ratio using the world anchors.
Implementation
void initialize(
A b1,
B b2,
Vector2 ga1,
Vector2 ga2,
Vector2 anchor1,
Vector2 anchor2,
double r,
) {
bodyA = b1;
bodyB = b2;
groundAnchorA = ga1;
groundAnchorB = ga2;
localAnchorA.setFrom(bodyA.localPoint(anchor1));
localAnchorB.setFrom(bodyB.localPoint(anchor2));
final d1 = anchor1 - ga1;
lengthA = d1.length;
final d2 = anchor2 - ga2;
lengthB = d2.length;
ratio = r;
assert(ratio > settings.epsilon);
}