MouseJoint constructor

MouseJoint(
  1. MouseJointDef<Body, Body> def
)

Implementation

MouseJoint(MouseJointDef def)
    : assert(!def.target.isInfinite && !def.target.isNaN),
      assert(def.maxForce >= 0),
      assert(def.frequencyHz >= 0),
      assert(def.dampingRatio >= 0),
      super(def) {
  _targetA.setFrom(def.target);
  localAnchorB.setFrom(Transform.mulTransVec2(bodyB.transform, _targetA));

  _maxForce = def.maxForce;
  _impulse.setZero();

  _frequencyHz = def.frequencyHz;
  _dampingRatio = def.dampingRatio;
}