Documentation
    Preparing search index...

    Interface BodyControlModeOptions

    How PhysicsWorld.setBodyControlMode performs a §19 control-mode transition (plan P7-3).

    Every field is optional: the bare call re-types the body, wakes it, and seeds nothing.

    interface BodyControlModeOptions {
        fixedDeltaSeconds?: number;
        inheritVelocityFrom?: PoseTarget;
        wake?: boolean;
    }
    Index
    fixedDeltaSeconds?: number

    The fixed step, in seconds (§7a, §10), that the inherited difference is divided by.

    Omit it and the world uses the deltaSeconds of its last PhysicsWorld.step, which is the fixed delta the target history was actually captured across. It is only needed when no step has run yet — a body activated before the first step of the simulation — or when a caller knows the application's fixed delta better than the world does. Ignored entirely without BodyControlModeOptions.inheritVelocityFrom.

    inheritVelocityFrom?: PoseTarget

    A PoseTarget (§19, plan P7-1) whose one-step history seeds the body's velocities as part of the switch — "the ragdoll keeps the motion the animation had".

    The component's position/previousPosition and rotation/previousRotation pair is finite-differenced over the fixed step; see PhysicsWorld.setBodyControlMode for the exact formula and for which target types accept it.

    wake?: boolean

    Whether the switch wakes a sleeping body (§32). Defaults to true, which is what activating a body means; pass false to re-type without disturbing the sleep state.