|
|
@ -68,7 +68,7 @@ class Flipper extends BodyComponent with KeyboardHandler, InitialPosition {
|
|
|
|
anchor: anchor,
|
|
|
|
anchor: anchor,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
final joint = _FlipperJoint(jointDef);
|
|
|
|
final joint = _FlipperJoint(jointDef);
|
|
|
|
world.createJoint2(joint);
|
|
|
|
world.createJoint(joint);
|
|
|
|
unawaited(mounted.whenComplete(joint.unlock));
|
|
|
|
unawaited(mounted.whenComplete(joint.unlock));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -219,15 +219,3 @@ class _FlipperJoint extends RevoluteJoint {
|
|
|
|
setLimits(-angle, angle);
|
|
|
|
setLimits(-angle, angle);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// TODO(alestiago): Remove once Forge2D supports custom joints.
|
|
|
|
|
|
|
|
extension on World {
|
|
|
|
|
|
|
|
void createJoint2(Joint joint) {
|
|
|
|
|
|
|
|
assert(!isLocked, '');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
joints.add(joint);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
joint.bodyA.joints.add(joint);
|
|
|
|
|
|
|
|
joint.bodyB.joints.add(joint);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|