Documentation
    Preparing search index...

    Class FirstPersonLook

    §44's first-person look: the pitch-only channel that rides on a CharacterController's yaw.

    Attach it to a child of the character — the eye — and give that child "kinematic" authority of its own. The component writes exactly one thing: the child's local rotation, a half-angle quaternion about +X. Positive pitch looks up (−Z rotated about +X by +p is (0, sin p, −cos p)).

    See the module note for why this is a second node rather than a second writer on the character's transform. In one line: yaw is the character's and pitch is not the character's, and §42 counts writers per node.

    Limits are readonly and the value clamps on assignment — OrbitRig's rule, for the same reasons: a retuned rig is a new rig, the component is never in an illegal state, and the per-step path carries no clamping branch. FirstPersonLook.pitchLimitHits counts how often the clamp bit, which is how a test proves the guard was exercised rather than merely present.

    Implements

    Index
    host: ComponentHost | null

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

    maxPitch: number

    Upper bound on FirstPersonLook.pitch, in radians (§7a).

    minPitch: number

    Lower bound on FirstPersonLook.pitch, in radians (§7a).

    pitchLimitHits: number

    Times a pitch assignment was clamped by the limits.

    typeName: "first-person-look"

    Component key (plan D2) and §79 serialization name.

    • get active(): boolean

      Whether the next step would write anything. See CharacterController.active.

      Returns boolean

    • get pitch(): number

      Elevation of the eye, in radians (§7a), clamped to [minPitch, maxPitch] on assignment — a clamp bumps FirstPersonLook.pitchLimitHits.

      Returns number

      RangeError if the value is not finite (§85).

    • set pitch(value: number): void

      Parameters

      • value: number

      Returns void

    • Adds delta radians to FirstPersonLook.pitch — the input surface an application maps a pointer's vertical motion onto. Clamped like any other assignment, so a pointer dragged to the stop leaves the eye sitting exactly on its limit.

      Parameters

      • delta: number

      Returns void

    • Writes the pitch into transform's local rotation. Called by KinematicSystem once per fixed step, after the §42 authority check.

      Parameters

      Returns boolean

      true — a clamped pitch is always a finite rotation, so unlike CharacterController.step there is no transient to survive here. The boolean exists so both components read the same way at the call site.