示例#1
0
 public static Fix64 LengthSqr(Fix64Quat a)
 {
     return(Fix64.FromRaw(NativeFixedMath.Mul64(a.RawX, a.RawX)
                          + NativeFixedMath.Mul64(a.RawY, a.RawY)
                          + NativeFixedMath.Mul64(a.RawZ, a.RawZ)
                          + NativeFixedMath.Mul64(a.RawW, a.RawW)));
 }
示例#2
0
        public static Fix64Vec3 operator *(Fix64Vec3 a, Fix64Vec3 b)
        {
            long      x = NativeFixedMath.Mul64(a.RawX, b.RawX);
            long      y = NativeFixedMath.Mul64(a.RawY, b.RawY);
            long      z = NativeFixedMath.Mul64(a.RawZ, b.RawZ);
            Fix64Vec3 r = Make(x, y, z);

            return(r);
        }
示例#3
0
        public static Fix64Vec2 operator *(Fix64Vec2 a, Fix64Vec2 b)
        {
            long x = NativeFixedMath.Mul64(a.RawX, b.RawX);
            long y = NativeFixedMath.Mul64(a.RawY, b.RawY);

            Fix64Vec2 r = Make(x, y);

            return(r);
        }
示例#4
0
        public static Fix64Quat Inverse(Fix64Quat a)
        {
            long inv_norm = NativeFixedMath.Rcp64(LengthSqr(a).Raw);

            return(Make(
                       -NativeFixedMath.Mul64(a.RawX, inv_norm),
                       -NativeFixedMath.Mul64(a.RawY, inv_norm),
                       -NativeFixedMath.Mul64(a.RawZ, inv_norm),
                       NativeFixedMath.Mul64(a.RawW, inv_norm)));
        }
示例#5
0
        public static Fix64Quat Normalize(Fix64Quat a)
        {
            long  inv_norm = NativeFixedMath.Rcp64(LengthFastest(a).Raw);
            Fix64 x        = Fix64.FromRaw(NativeFixedMath.Mul64(a.RawX, inv_norm));
            Fix64 y        = Fix64.FromRaw(NativeFixedMath.Mul64(a.RawY, inv_norm));
            Fix64 z        = Fix64.FromRaw(NativeFixedMath.Mul64(a.RawZ, inv_norm));
            Fix64 w        = Fix64.FromRaw(NativeFixedMath.Mul64(a.RawW, inv_norm));

            return(new Fix64Quat(x, y, z, w));
        }
示例#6
0
 public static Fix64Vec4 operator *(Fix64 a, Fix64Vec4 b)
 {
     return(Make(NativeFixedMath.Mul64(a.Raw, b.RawX), NativeFixedMath.Mul64(a.Raw, b.RawY), NativeFixedMath.Mul64(a.Raw, b.RawZ), NativeFixedMath.Mul64(a.Raw, b.RawW)));
 }
示例#7
0
 public static Fix64Vec4 operator *(Fix64Vec4 a, Fix64 b)
 {
     return(Make(NativeFixedMath.Mul64(a.RawX, b.Raw), NativeFixedMath.Mul64(a.RawY, b.Raw), NativeFixedMath.Mul64(a.RawZ, b.Raw), NativeFixedMath.Mul64(a.RawW, b.Raw)));
 }
示例#8
0
 public static Fix64 operator *(Fix64 a, Fix64 b)
 {
     return(FromRaw(NativeFixedMath.Mul64(a.Raw, b.Raw)));
 }
示例#9
0
 public static Fix64 DegToRad(Fix64 a)
 {
     return(FromRaw(NativeFixedMath.Mul64(a.Raw, FixedConstants64.DEGREE_TO_RAD)));
 }
示例#10
0
 public static Fix64 RadToDeg(Fix64 a)
 {
     return(FromRaw(NativeFixedMath.Mul64(a.Raw, FixedConstants64.RAD_TO_DEGREE)));
 }