The camera's up-vector, or null/undefined when the page has no
camera to read yet.
The dominant signed axis, or FALLBACK_UP_AXIS when up is
missing or degenerate (zero-length, or carrying a NaN/infinite component).
Falling back rather than guessing matters: the >= chain would otherwise
answer 'x' for an all-zero vector, which is an arbitrary axis dressed up as
a measurement.
The SIGNED world axis a camera up-vector most nearly points along.
The rock axis has always been axis-aligned, so a non-axis-aligned up is snapped to its dominant component rather than rejected. Ties resolve x → z → y, which only matters for vectors no real scene bakes.
The DIRECTION of that component is kept, not just which axis it is: a baked up of (0,0,-1) has to stay -Z, because the orbit hard-sets
cam.upand snapping it to +Z would roll the animation 180° from the still — the exact divergence this derivation exists to remove. Onlycam.upis affected; the rock geometry is sign-invariant (the out-of-plane offset enters ascompU·U).