The shortest-arc rotation that turns the direction of from onto the
direction of to.
It is the core of an aim or look-at driver, such as a light aimed along its
direction or a projectile turned along its velocity, and of the analytic
two-bone solves (twoBoneChainArticulation, hingedArmArticulation). Pass
the bone's rest forward axis as from and target - bonePosition as to,
and the result orients the bone at the target.
Inputs are validated as finite, normalized, and passed to the engine's
single shortest-arc primitive rotationBetween, the same deadzone-free
atan2 helper the world-driver IK path uses, so the analytic and iterative
IK families use the same turn. Representable nonzero cross products remain
active, subject to binary64 precision in the normalized directions and result.
Aligned inputs return the identity, and antiparallel inputs a 180 degree
turn about a deterministic perpendicular. A zero-length input has no
direction and also returns the identity, which keeps a projectile at rest
facing its authored forward axis.
The shortest-arc rotation that turns the direction of
fromonto the direction ofto.It is the core of an aim or look-at driver, such as a light aimed along its direction or a projectile turned along its velocity, and of the analytic two-bone solves (
twoBoneChainArticulation,hingedArmArticulation). Pass the bone's rest forward axis asfromandtarget - bonePositionasto, and the result orients the bone at the target.Inputs are validated as finite, normalized, and passed to the engine's single shortest-arc primitive rotationBetween, the same deadzone-free
atan2helper the world-driver IK path uses, so the analytic and iterative IK families use the same turn. Representable nonzero cross products remain active, subject to binary64 precision in the normalized directions and result.Aligned inputs return the identity, and antiparallel inputs a 180 degree turn about a deterministic perpendicular. A zero-length input has no direction and also returns the identity, which keeps a projectile at rest facing its authored forward axis.