Fast quaternion slerp

Really cool article.

2 Likes

Nice article!

I had a related issue with Urho’s inability to determine the shortest rotation between two direction vectors (which I needed to implement a basic steering behaviour).
Here’s my workaround:

/// Calculate signed angle between two vectors
float SignedAngle(Vector3 from, Vector3 to, Vector3 axis)
        {
            float unsignedAngle = from.Angle(to);
            float sign = axis.DotProduct(from.CrossProduct(to));
            if(sign<0)
                unsignedAngle = -unsignedAngle;
            return unsignedAngle;
}