Documentation
    Preparing search index...

    Function revoluteAxisSignZ

    • The sign a §28 revolute joint's axis gives the plane's one rotational degree of freedom (§21, plan P6-1, WP-6.2).

      Rapier 2D's JointData.revolute(anchor1, anchor2) takes no axis — a plane turns about +Z and about nothing else — while the engine's RevoluteJointDescriptor.axis may name ±Z (validation rejects everything else, and an omitted axis means +Z). The two are reconciled here rather than by dropping the sign: a hinge about −Z is the same pin with the positive sense reversed, so its limits and its motor are mirrored.

      revoluteAxisSignZ(undefined);                // +1 (the §21 default, +Z)
      revoluteAxisSignZ(new Vector3(0, 0, -2)); // -1

      A caller applies the sign as [-max, -min] to a limit range and as -targetVelocity to a motor rate — the mirror of the axis, not a reinterpretation of the numbers.

      Parameters

      Returns -1 | 1