MathUtils.ShortestRotation

Anonymous
C#
05/14/2021 12:24 AM
264 B
436
Indexable
Never
public static Quaternion ShortestRotation(Quaternion to, Quaternion from)
{
    if (Quaternion.Dot(to, from) < 0)
    {
        return to * Quaternion.Inverse(Multiply(from, -1));
    }
    else
    {
        return to * Quaternion.Inverse(from);
    }
}
Editor is loading...