예제 #1
0
 public static Transform Interpolate(Transform t1, Transform t2, float blendFactor)
 {
     return new Transform(
         Quaternion.Slerp(t1.Rotation, t2.Rotation, blendFactor),
         Vector3.Lerp(t1.Translation, t2.Translation, blendFactor)
         );
 }
예제 #2
0
 public static void Invert(ref Transform t)
 {
     Vector3 v;
     Quaternion.Conjugate(ref t.Rotation, out t.Rotation);
     Vector3.Transform(ref t.Translation, ref t.Rotation, out v);
     t.Translation = -v;
 }
예제 #3
0
 public static void Multiply(ref Transform t1, ref Transform t2, out Transform t)
 {
     Vector3 temp;
     Vector3.Transform(ref t2.Translation, ref t1.Rotation, out temp);
     Vector3.Add(ref temp, ref t1.Translation, out t.Translation);
     Quaternion.Multiply(ref t1.Rotation, ref t2.Rotation, out t.Rotation);
     Quaternion.Normalize(ref t.Rotation, out t.Rotation);
 }