MathUtils.ShortestRotation

 avatar
unknown
csharp
4 years ago
264 B
365
Indexable
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...