Shortest-arc rotation from finite vector a to finite vector b, using
atan2 without a near-parallel identity deadzone. Iterative world-driver IK
and analytic two-bone aiming share this direction and collinearity convention.
The predecessor (quatFromTo) snapped cos > 0.999999 to the identity,
which put a ~1.9e-3 m convergence floor under the iterative IK solvers and
made the aim/reach path ignore its last ~0.08°. Sub-0.1° corrections are
the moves a late solver sweep, a foot plant, or a slow camera track needs.
Representable nonzero cross products stay active, subject to binary64
precision in normalization and quaternion conversion (#643).
Both inputs are normalized before computing sine and cosine, avoiding
overflow from their original magnitudes. The cross-product axis is normalized
by fromAxisAngle. Callers needing named finite-input refusal validate first
(see aimRotation). A degenerate
input (zero vector, exact parallel) degrades to the identity; exact
antiparallel takes a deterministic 180° flip about a perpendicular (the
|a.x| < 0.9 axis split).
Shortest-arc rotation from finite vector
ato finite vectorb, using atan2 without a near-parallel identity deadzone. Iterative world-driver IK and analytic two-bone aiming share this direction and collinearity convention.The predecessor (
quatFromTo) snappedcos > 0.999999to the identity, which put a ~1.9e-3 m convergence floor under the iterative IK solvers and made the aim/reach path ignore its last ~0.08°. Sub-0.1° corrections are the moves a late solver sweep, a foot plant, or a slow camera track needs. Representable nonzero cross products stay active, subject to binary64 precision in normalization and quaternion conversion (#643).Both inputs are normalized before computing sine and cosine, avoiding overflow from their original magnitudes. The cross-product axis is normalized by
fromAxisAngle. Callers needing named finite-input refusal validate first (seeaimRotation). A degenerate input (zero vector, exact parallel) degrades to the identity; exact antiparallel takes a deterministic 180° flip about a perpendicular (the|a.x| < 0.9axis split).