cf_quat_from_to¶
Category: math
GitHub: cute_math3d.h
Returns the shortest rotation taking direction from onto direction to.
| Parameters | Description |
|---|---|
from |
The starting direction. Need not be unit length. |
to |
The ending direction. Need not be unit length. |
Remarks¶
The workhorse of aiming: point a turret at a target, align a decal to a surface normal, tilt a character to a slope. Exactly-opposed directions have no unique answer, so a perpendicular axis is chosen arbitrarily.
Related Pages¶
CF_Quat
cf_quat_from_axis_angle
cf_quat_slerp
cf_quat_from_basis