nlerp, it is less accurate but is much faster, only needing a single sqrt instead of 4 transcendal trig functions. (FYI you can get the slerp using a half dozen nlerps by binary searching into the range using slerp(q1, q2, 0.5) == nlerp(q1, q2, 0.5))
slerp should fall back to nlerp when cosAlpha > 0.95 to avoid instability. The error between nlerp and slerp will decrease as cosAlpha goes to 1.
Getting a quaternion representing the rotation between 2 vectors can be calculated using the cross and dot product directly instead of having to go through glusQuaternionRotatef.
nlerp, it is less accurate but is much faster, only needing a single sqrt instead of 4 transcendal trig functions. (FYI you can get the slerp using a half dozen nlerps by binary searching into the range using
slerp(q1, q2, 0.5) == nlerp(q1, q2, 0.5)
)slerp should fall back to nlerp when
cosAlpha > 0.95
to avoid instability. The error between nlerp and slerp will decrease ascosAlpha
goes to 1.Getting a quaternion representing the rotation between 2 vectors can be calculated using the cross and dot product directly instead of having to go through glusQuaternionRotatef.