Optionaloptions: FollowRigOptionsReadonlyframeWhich frame FollowRig.offset is read in. Fixed at construction.
The node this component is attached to, or null. Written by the
ComponentRegistry alone (§6a); never assign it.
ReadonlyoffsetOffset from the target, in the frame FollowRig.frame names. Written
in place — the instance is the rig's own copy of what the constructor was
given, so moving a camera's boom is rig.offset.set(...).
Steps on which the rig declined to place its node — see FollowRig.apply.
ReadonlyspringThe smoother, or null for a rig that snaps. Fixed at construction.
What the rig follows, or null for an idle rig. See OrbitRig.target.
Static ReadonlytypeComponent key (plan D2) and §79 serialization name.
Whether the smoother holds state, i.e. at least one step has been written.
Places node at its offset from the target, smoothing when the rig has a
spring. Called by ConstraintSystem once per fixed step, after the §42
authority check.
the node being placed
the fixed step, in seconds (§7a)
true when the node was placed. false — and a bumped
FollowRig.skippedSteps — when the target's world position is not
finite, when a "target" frame has a collapsed basis, or when the node's
parent has no invertible world matrix; an idle rig returns false without
counting a skip.
Drops the smoother's captured state, so the next step starts from the node's position then instead of springing across the gap.
What a teleport needs: moving a followed target by kilometres would otherwise send the camera sailing after it for a second.
§44's follow rig and spring arm: a node held at an offset from a target, optionally smoothed.
One class, two §44 rows (decision, R-36 rig half)
§44 names "follow rigs" and "spring arms" separately, and they differ in exactly two independent bits: which frame the offset is read in, and whether the result is smoothed. Two classes would have shared every line and forced an application that wanted a smoothed world-axis follow (an isometric camera) or an unsmoothed target-frame arm (a rigid boom) to pick the wrong one and fight it.
frame: "world"reads the offset along the world axes, so the camera keeps its bearing while the target turns — the isometric/side-on follow.frame: "target"reads it in the target's own frame, so it swings around behind the target as the target turns — the third-person boom. The basis is the target's world matrix columns normalized, so an ancestor's scale moves the arm's anchor without stretching the arm. AVector3target has no orientation, so it falls back to the world axes.springomitted snaps to the goal every step; supplied, the placement is the exact exponential step ofSpringDampertowards it, integrated in world space so the smoothing does not change when the rig is reparented.The smoother's state is captured lazily, on the first step that writes: a rig starts from wherever its node actually is rather than easing in from the origin. It keeps advancing on a step whose write is refused by a degenerate parent — the goal is a property of the target, not of the write — but not on a step the §42 check refuses, because that step never reaches this component at all (
ConstraintSystemfreezes a refused node, exactly asKinematicSystemfreezes a refused command).