Documentation
    Preparing search index...

    Class OrbitRig

    §44's orbit rig: a node placed on a sphere around a target, by yaw, pitch and distance.

    position = target + distance · (cos pitch · sin yaw, sin pitch, cos pitch · cos yaw)
    

    so yaw = 0, pitch = 0 puts the node on the target's +Z side, facing it along −Z once a LookAtConstraint aims it — the §7a right-handed, +Y-up world, with yaw measured about +Y from +Z towards +X and pitch the elevation above the horizontal plane.

    Placement only. This rig writes a position and never a rotation, because §42 allows one owner per transform and aiming is a separate, optional component: pair it with a LookAtConstraint on the same node (the usual orbit camera) or leave it unaimed (a node that circles while keeping its orientation).

    minPitch/maxPitch/minDistance/maxDistance are fixed at construction — SpringDamper's rule, for the same reason: they are the rig's shape, a retuned rig is a new one, and a limit that could change under a live value would make "is this rig inside its limits?" a question with a time-dependent answer. OrbitRig.pitch and OrbitRig.distance clamp on assignment, so the rig is never in an illegal state and the per-step path carries no clamping branch at all; OrbitRig.pitchLimitHits counts how often a clamp actually bit, which is how a test proves the pole guard was exercised rather than merely present.

    Non-finite assignments are refused (§85) rather than clamped: NaN is not a value at the end of a range, and a rig that quietly swallowed one would place its camera at NaN on some later step instead of at the mistake.

    Implements

    Index
    • Parameters

      Returns OrbitRig

      RangeError if any angle or distance is not finite, if a distance is not positive, or if a lower bound exceeds its upper bound (§85).

    host: ComponentHost | null

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

    maxDistance: number

    Furthest the rig may retreat, in metres. Infinity means unbounded.

    maxPitch: number

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

    minDistance: number

    Closest the rig may come to its target, in metres. Finite and > 0.

    minPitch: number

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

    pitchLimitHits: number

    Times a pitch assignment was clamped by OrbitRig.minPitch/maxPitch.

    skippedSteps: number

    Steps on which the rig declined to place its node — see OrbitRig.apply.

    target: RigTarget | null

    What the rig orbits, or null for an idle rig — one that writes nothing, and therefore raises no §42 conflict on a node it does not own.

    Assignable at any time: a Node target is held by reference (dropped by §79, re-bound by the application), a Vector3 target is held, not copied.

    typeName: "orbit-rig"

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

    • get distance(): number

      Distance from the target, in metres (§7a), clamped to [minDistance, maxDistance] on assignment.

      Returns number

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

    • set distance(value: number): void

      Parameters

      • value: number

      Returns void

    • get pitch(): number

      Elevation above the horizontal plane, in radians (§7a), clamped to [minPitch, maxPitch] on assignment — a clamp bumps OrbitRig.pitchLimitHits.

      Returns number

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

    • set pitch(value: number): void

      Parameters

      • value: number

      Returns void

    • get yaw(): number

      Rotation about +Y, in radians (§7a), measured from +Z towards +X. Unbounded — a camera may be spun any number of turns, and wrapping it would make orbit discontinuous at the seam.

      Returns number

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

    • set yaw(value: number): void

      Parameters

      • value: number

      Returns void

    • Places node on its orbit around the target. Called by ConstraintSystem once per fixed step, after the §42 authority check.

      Parameters

      Returns boolean

      true when the node was placed. false — and a bumped OrbitRig.skippedSteps — when the target's world position is not finite or the node's parent has no invertible world matrix; a target of null is idle, so it returns false without counting a skip.

    • Adds delta metres to OrbitRig.distance: positive pulls back, negative moves in. Clamped like any other assignment, so a wheel spun to the stop leaves the rig sitting exactly on its limit.

      Parameters

      • delta: number

      Returns void

    • Adds yawDelta and pitchDelta radians to the rig's angles — the input surface an application maps a pointer drag onto.

      Both go through the property setters, so the pitch clamp and its counter apply and a non-finite delta is refused rather than stored.

      Parameters

      • yawDelta: number
      • pitchDelta: number

      Returns void