Skip to content

Instantly share code, notes, and snippets.

@usefulslug
Created September 11, 2015 16:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save usefulslug/10efd36075ad6050d8c5 to your computer and use it in GitHub Desktop.
Save usefulslug/10efd36075ad6050d8c5 to your computer and use it in GitHub Desktop.
// Returns a smooth approximation between q1 and q2 using t1 and t2 as 'tangents'
def SQUAD(q1 as Quaternion, t1 as Quaternion, t2 as Quaternion, q2 as Quaternion, t as single):
slerpT as single = 2.0 * t * (1.0 - t)
slerp1 as Quaternion = QuaternionExtensions.SlerpNoInvert(q1, q2, t)
slerp2 as Quaternion = QuaternionExtensions.SlerpNoInvert(t1, t2, t)
return QuaternionExtensions.SlerpNoInvert(slerp1, slerp2, slerpT)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment