constrain method

  1. @override
void constrain (Node node, double dt)

Called after update is complete, if the constraint has been added to a Node. Override this method to modify the node's property according to the constraint.

Implementation

@override
void constrain(Node node, double dt) {
  double target = targetNode.rotation + baseRotation;
  node.rotation = _dampenRotation(node.rotation, target, dampening);
}