示例#1
0
        public static Fixed64Quaternion LerpUnclamped(Fixed64Quaternion a, Fixed64Quaternion b, Fixed64 t)
        {
            Fixed64Quaternion result = Multiply(a, (1 - t)) + Multiply(b, t);

            result.Normalize();

            return(result);
        }
示例#2
0
        public static Fixed64Quaternion FromToRotation(Fixed64Vector3 fromVector, Fixed64Vector3 toVector)
        {
            Fixed64Vector3    w = Fixed64Vector3.Cross(fromVector, toVector);
            Fixed64Quaternion q = new Fixed64Quaternion(w.x, w.y, w.z, Fixed64Vector3.Dot(fromVector, toVector));

            q.w += Fixed64.Sqrt(fromVector.SqrMagnitude * toVector.SqrMagnitude);
            q.Normalize();

            return(q);
        }