HingeConstraint constructor
HingeConstraint(})
Implementation
HingeConstraint(
Body bodyA,
Body bodyB,
{
Vec3? pivotA,
Vec3? pivotB,
Vec3? axisA,
Vec3? axisB,
bool? collideConnected,
double maxForce = 1e6
}
):super(bodyA, bodyB, pivotA, pivotB, maxForce) {
this.axisA = axisA ?? Vec3(1, 0, 0);
this.axisA.normalize();
this.axisB = axisB ?? Vec3(1, 0, 0);
this.axisB.normalize();
this.collideConnected = collideConnected ?? true;
rotationalEquation1 = RotationalEquation(bodyA, bodyB, axisA: this.axisA,axisB: this.axisB, maxForce: maxForce);
final rotational1 = rotationalEquation1;
rotationalEquation2 = RotationalEquation(bodyA, bodyB, axisA: this.axisA,axisB: this.axisB, maxForce: maxForce);
final rotational2 = rotationalEquation2;
motorEquation = RotationalMotorEquation(bodyA, bodyB, maxForce);
final motor = motorEquation;
motor.enabled = false; // Not enabled by default
// Equations to be fed to the solver
equations.addAll([rotational1,rotational2,motor]);
}