Documentation
    Preparing search index...

    Class CameraShake

    §44's shake rig: an additive world-space position offset (and an optional local rotation offset) sampled from interpolated value noise.

    Placement is additive, never a replacement: OrbitRig and FollowRig write the clean pose, then this component layers the kick. Rotation, when requested, is composed on the right of the current quaternion (q' = q · Δ) so a look-at that ran this step is preserved and then shaken.

    Implements

    Index
    amplitude: Vector3 = ...

    Peak positional offset, in metres. Written in place — the instance is the component's own copy of what the constructor was given.

    frequency: number

    Value-noise frequency in hertz. Fixed at construction.

    host: ComponentHost | null = null

    The node this component is attached to, or null. Written by the ComponentRegistry alone (§6a); never assign it.

    rotationAmplitude: Vector3 = ...

    Peak rotational offset, in radians about world +X/+Y/+Z. Written in place. (0, 0, 0) disables the rotational channel.

    seed: number

    Hash salt, reduced to a uint32. Two shakes with this seed and the same simulationTime produce bit-identical offsets.

    skippedSteps: number = 0

    Steps on which a non-zero offset could not be written — a singular parent, the same refusal OrbitRig.apply counts.

    traumaDecay: number

    Trauma drop per second. Fixed at construction.

    typeName: "CameraShake"

    Component key (plan D2) and §79 serialization name. PascalCase is the published spelling for this component — the kebab-case names on the placement rigs predate it and stay as they are.

    • get trauma(): number

      Unitless 0–1 envelope. The sampled offset is scaled by trauma². Assignment clamps; a non-finite value is refused (§85).

      Returns number

    • set trauma(value: number): void

      Parameters

      • value: number

      Returns void

    • Adds the shake offset to node. Called by ConstraintSystem once per fixed step, after the §42 authority check and after the placement / aim components.

      Parameters

      • node: Node

        the node being shaken

      • deltaSeconds: number

        the fixed step, in seconds (§7a) — used only to decay trauma

      • OptionalsimulationTime: number

        the §9 physics clock, in seconds. The noise is sampled here so two steps that share a time (or two shakes that share a seed and a time) agree bit for bit. Omitted, the component accumulates deltaSeconds itself — a convenience for tests that do not have a TimeState.

      Returns boolean

      true when the offset was applied or was a no-op (zero amplitude, zero trauma). false — and a bumped CameraShake.skippedSteps — when a non-zero positional write was refused by a singular parent.

    • Raises CameraShake.trauma by amount and clamps to [0, 1]. A negative amount lowers it; that is still a clamp, not a second API.

      Parameters

      • amount: number

      Returns void

      RangeError if amount is not finite (§85).