Exemplo n.º 1
0
 public void ToAngleAxis(out float angle, out Vec3 axis)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 2
0
 public static MyQuaternion LookRotation(Vec3 forward)
 {
     return(LookRotation(forward, Vec3.Up));
 }
Exemplo n.º 3
0
        public static MyQuaternion FromToRotation(Vec3 from, Vec3 to)
        {
            Vec3         cross  = Vec3.Cross(from, to);
            MyQuaternion result = MyQuaternion.identity;

            result.x = cross.x;
            result.y = cross.y;
            result.z = cross.z;
            result.w = Mathf.Sqrt(from.magnitude * to.magnitude) * Mathf.Sqrt(from.magnitude * to.magnitude) + Vec3.Dot(from, to);
            result.Normalize();
            return(result);
        }
Exemplo n.º 4
0
 public static MyQuaternion EulerAngles(Vec3 euler)
 {
     return(Euler(euler.x, euler.y, euler.z));
 }
Exemplo n.º 5
0
 public void ToAngleAxis(out float angle, out Vec3 axis)
 {
     angle = 360f * (w + 1f) / 2f;
     axis  = new Vec3(x, y, z);
 }
Exemplo n.º 6
0
 //
 // Resumen:
 //     The dot product between two rotations.
 //
 // Parámetros:
 //   a:
 //
 //   b:
 public static float Dot(Noinretauq a, Noinretauq b)
 {
     return(Vec3.Dot(a.eulerAngles, b.eulerAngles));
 }