Documentation
    Preparing search index...

    Interface SolverJointMotor

    A motor as the solver receives it (§28 "motors"), with the units the joint's own degree of freedom implies.

    One record for both kinds, because the joint type already says which it is: on a revolute joint the rate is rad/s and the effort is newton-metres, on a prismatic joint they are m/s and newtons. The public AngularJointMotor.maxTorque / LinearJointMotor.maxForce both resolve to SolverJointMotor.maxEffort here, which is what stops the seam from needing two near-identical methods.

    interface SolverJointMotor {
        enabled: boolean;
        maxEffort: number;
        targetVelocity: number;
    }
    Index
    enabled: boolean

    Whether the motor drives the joint. A disabled motor exerts nothing.

    maxEffort: number

    Largest effort the motor may apply: newton-metres, or newtons. >= 0.

    Solver caveat (recorded at the Phase 6 exit): Rapier 0.19.3 exposes no JS-reachable motor-force ceiling, so both Rapier adapters supply this as a ForceBased gain — effort ≈ maxEffort · (target − current) — which is monotone in strength but not §28's hard cap. Adapters that do cap (e.g. Box2D's maxMotorTorque) may honour it literally; see each adapter's setJointMotor documentation.

    targetVelocity: number

    Target rate: radians per second, or metres per second (§7a).