Exemple #1
0
        public static TSQuaternion LerpUnclamped(TSQuaternion a, TSQuaternion b, FP t)
        {
            TSQuaternion result = TSQuaternion.Multiply(a, (1 - t)) + TSQuaternion.Multiply(b, t);

            result.Normalize();

            return(result);
        }
Exemple #2
0
        public static TSQuaternion FromToRotation(FPVector3 fromVector, FPVector3 toVector)
        {
            FPVector3    w = FPVector3.Cross(fromVector, toVector);
            TSQuaternion q = new TSQuaternion(w.x, w.y, w.z, FPVector3.Dot(fromVector, toVector));

            q.w += FP.Sqrt(fromVector.sqrMagnitude * toVector.sqrMagnitude);
            q.Normalize();

            return(q);
        }