Rig
<Rig> opts its descendant shapes into pointer gestures and draws a gizmo for
them.
<Rig drag> <Box position={[0, 0, 0]} size={1} /></Rig>Each gesture is its own prop, so one <Rig> can enable several at once.
drag is the only one wired today; scale and rotate would land as further
props on the same component.
How it claims its children
Section titled “How it claims its children”Like the other composers, <Rig> pushes a frame while its children render. It
does not wrap or modify the shapes themselves.
When a descendant shape mints its ID during that render window, the active frame’s callback fires and the rig collects the ID. So the rig knows which shapes it owns without shape components knowing a rig exists.
Dragging
Section titled “Dragging”A drag on an axis handle moves the shape along that world axis. The drag plane is chosen to contain the axis line while facing the camera as much as possible, so cursor motion projects cleanly onto the axis. When the camera looks straight down an axis, it falls back to a stable choice rather than degenerating.
A drag on the body moves the shape on a camera-facing plane.
Picking uses the same ray and shape-picking path as pointer events.
Multiple rigs
Section titled “Multiple rigs”Several <Rig> wrappers can coexist. Each publishes its gizmo and claims
ownership; a rig only clears the gizmo on unmount if it still owns it, so
unmounting one does not erase another’s.
It costs nothing when unused
Section titled “It costs nothing when unused”The rig is the most aggressively stripped feature in fabric. With no <Rig> tag
anywhere in your source, the build removes the rig regions — down to the type
definitions — and the gizmo module is never emitted.
Drag-only helpers live inside the rig file rather than in fabric’s core, so nothing in the core carries code that only dragging needs.