Exemple #1
0
        public static Quaternion16 InterpolateQuaternion16(this AnimInterpolator ap, Quaternion16 v1, Quaternion16 v2, float pct)
        {
            short d1 = (short)(v2.x - v1.x);
            short d2 = (short)(v2.y - v1.y);
            short d3 = (short)(v2.z - v1.z);
            short d4 = (short)(v2.w - v1.w);

            Quaternion16 ret = new Quaternion16();

            ret.x = (short)(v1.x + (short)(d1 * pct));
            ret.y = (short)(v1.y + (short)(d2 * pct));
            ret.z = (short)(v1.z + (short)(d3 * pct));
            ret.w = (short)(v1.w + (short)(d4 * pct));

            return(ret);
        }
Exemple #2
0
 public static Vector3 InterpolateVector3(this AnimInterpolator ap, Vector3 v1, Vector3 v2, float pct)
 {
     return(Vector3.Lerp(v1, v2, pct));
 }
Exemple #3
0
 public static Quaternion InterpolateQuaternion(this AnimInterpolator ap, Quaternion v1, Quaternion v2, float pct)
 {
     return(Quaternion.Slerp(v1, v2, pct));
 }