Optionaloptions: TrackballRigOptionsDrags whose two points mapped to the same sphere point, so nothing was rotated.
Distance from TrackballRig.target, in world units.
Drags that produced a rotation.
Viewport height in pixels.
How TrackballRig.drag's coordinates are measured.
ReadonlyradiusVirtual sphere radius as a fraction of half the shorter side. Immutable — retuning is a new rig.
ReadonlyrotationThe accumulated orientation, as a unit quaternion. Live and mutable — read it, or write into it to snap the trackball somewhere; the instance is never replaced, so a caller that captured it keeps a valid view.
ReadonlytargetThe point TrackballRig.applyTo places a node around, in that node's
parent space. Live and mutable, like rotation.
Parent space rather than world space, deliberately: a trackball camera is
authored as a top-level node or under a single rig parent, and writing the
local transform keeps this rig free of world-matrix inversion — the machinery
@fourjs/motion's placeAtWorldPosition exists for, which a rig driven from a
pointer event does not need. A trackball under a moving parent orbits the
parent's frame, which is the useful reading of it.
Viewport width in pixels. Assign a new one on resize (validated on use).
Writes the rig's orientation onto node, and — when
TrackballRig.distance places it — its position: target plus the
rotated +Z offset, so the node looks down its own −Z at the target (§7a,
the convention Node.lookAt and Camera.updateViewMatrix share).
The write is the application's, under §42's default "manual"
authority, because no system drives this rig (see the module
documentation). A node owned by any other authority is refused and warned
about once, like every other refused write in §42.
true when the node was written; false when §42 refused it.
Turns a drag from one viewport point to another into a rotation and composes it onto TrackballRig.rotation.
Call it per pointer-move with the previous and current positions; a whole gesture is the composition of its moves, and composing per move is what makes the response continuous rather than snapping from the gesture's origin.
true when the rig rotated. false — and a bumped
TrackballRig.degenerateDrags — when the two points map to the same
sphere point (a drag of zero length, or two points diametrically related by
the sheet), which has no defined axis.
Maps a viewport point to a point on the virtual sphere, into out (§7b's
out convention).
Public because it is the whole mapping, and a caller who wants to draw the trackball's silhouette, unit-test a gesture, or build a different gesture on the same sphere should not have to re-derive it.
Returns the rig to the identity orientation. Counters are left alone.
A virtual-sphere trackball (§44, §47) — see the module documentation for the mapping, the placement decision, and why this is not a component.
The rig holds an orientation and, optionally, a pivot and a distance. Used for its TrackballRig.rotation alone it is a pure "spin this object" control; given a
targetand adistanceit is a camera rig, and TrackballRig.applyTo places and aims a camera in one call.