update method

  1. @override
void update()
override

Update all the equations with data.

Implementation

@override
void update() {
  final bodyA = this.bodyA;
  final bodyB = this.bodyB;
  final cone = coneEquation;
  final twist = twistEquation;

  super.update();

  // Update the axes to the cone constraint
  bodyA.vectorToWorldFrame(axisA, cone.axisA);
  bodyB.vectorToWorldFrame(axisB, cone.axisB);

  // Update the world axes in the twist constraint
  axisA.tangents(twist.axisA, twist.axisA);
  bodyA.vectorToWorldFrame(twist.axisA, twist.axisA);

  axisB.tangents(twist.axisB, twist.axisB);
  bodyB.vectorToWorldFrame(twist.axisB, twist.axisB);

}