StaticcrossStaticdotDot product
StaticidentityCreate identity matrix
StaticinvertStaticlookCreate look-at view matrix.
Degenerate inputs are absorbed rather than propagated (#2441): a view
direction parallel to up (a plan/soffit pose, a Y-dominant auto-fit,
an externally authored BCF viewpoint) leaves cross(up, viewDir) at
zero length, and normalizing that used to write NaN into all sixteen
components — the viewport then drew nothing at all. The same held for
a zero-length up, for eye === target, and for a non-finite
coordinate in any of the three inputs. All of them now fall back to a
stable basis, so this function always returns a finite matrix.
The basis itself lives in viewBasis; see there for why it is shared rather than inlined.
StaticmultiplyStaticnormalizeNormalize a vector, degrading to the zero vector. Total: the result
is always finite, which the bare len < 1e-10 floor this used to carry
was not (#2479). That floor is a magnitude test, so NaN divided instead
of falling back, and an infinite component over an infinite length gave
{NaN, 0, 0} — neither finite nor the zero vector a caller tests for.
Reachable with nothing malformed anywhere: an inverse component past the
Float32Array limit MathUtils.invert writes into saturates to
Infinity, and unprojectToRay handed that back as a picking ray.
StaticorthographicCreate orthographic projection matrix (reverse-Z) Uses same reverse-Z convention as perspective for consistent depth buffer behavior. Depth range: near=1.0, far=0.0 (inverted)
StaticperspectiveCreate perspective projection matrix
StaticperspectiveCreate reverse-Z perspective projection matrix Reverse-Z distributes depth precision more evenly, eliminating Z-fighting at far distances. Depth range: near=1.0, far=0.0 (inverted)
StaticsubtractSubtract vectors
Statictransform
Cross product