Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func s_v3 slerp(s_v3 start, s_v3 end, float t)
- {
- float dot = v3_dot(start, end);
- dot = clamp(dot, -1.0f, 1.0f);
- float theta = acosf(dot) * t;
- // nocheckin parenthesis?
- s_v3 relative_vec = v3_normalized(end - start * dot);
- return ((start * cosf(theta)) + (relative_vec * sinf(theta)));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement