Esempio n. 1
0
        /// <summary>
        /// Multiplacation of a <see cref="M44f"/> with a <see cref="Shift3f"/>.
        /// </summary>
        public static M44f Multiply(M44f matrix, Shift3f shift)
        {
            return(new M44f(
                       matrix.M00,
                       matrix.M01,
                       matrix.M02,
                       matrix.M00 * shift.X +
                       matrix.M01 * shift.Y +
                       matrix.M02 * shift.Z +
                       matrix.M03,

                       matrix.M10,
                       matrix.M11,
                       matrix.M12,
                       matrix.M10 * shift.X +
                       matrix.M11 * shift.Y +
                       matrix.M12 * shift.Z +
                       matrix.M13,

                       matrix.M20,
                       matrix.M21,
                       matrix.M22,
                       matrix.M20 * shift.X +
                       matrix.M21 * shift.Y +
                       matrix.M22 * shift.Z +
                       matrix.M23,

                       matrix.M30,
                       matrix.M31,
                       matrix.M32,
                       matrix.M33
                       ));
        }
Esempio n. 2
0
 /// <summary>
 /// Creates new Identity <see cref="M44f"/> with a <see cref="Shift3f"/> for translation.
 /// </summary>
 /// <returns>Translation matrix.</returns>
 public static M44f Translation(Shift3f s)
 {
     return(new M44f(1, 0, 0, s.X,
                     0, 1, 0, s.Y,
                     0, 0, 1, s.Z,
                     0, 0, 0, 1));
 }
Esempio n. 3
0
 public static M34f Multiply(M34f m, Shift3f t)
 {
     return(new M34f(
                m.M00, m.M01, m.M02, m.M00 * t.X + m.M01 * t.Y + m.M02 * t.Z + m.M03,
                m.M10, m.M11, m.M12, m.M10 * t.X + m.M11 * t.Y + m.M12 * t.Z + m.M13,
                m.M20, m.M21, m.M22, m.M20 * t.X + m.M21 * t.Y + m.M22 * t.Z + m.M23
                ));
 }
Esempio n. 4
0
 public override bool Equals(object obj)
 {
     if (obj is Shift3f)
     {
         Shift3f shift = (Shift3f)obj;
         return(V.X == shift.X && V.Y == shift.Y && V.Z == shift.Z);
     }
     return(false);
 }
Esempio n. 5
0
        public static M34f Multiply(Rot2f rot, Shift3f shift)
        {
            float a = (float)System.Math.Cos(rot.Angle);
            float b = (float)System.Math.Sin(rot.Angle);

            return(new M34f(a, b, 0, a * shift.X + b * shift.Y,
                            -b, a, 0, -b * shift.X + a * shift.Y,
                            0, 0, 1, shift.Z));
        }
Esempio n. 6
0
        public static M34f Multiply(M22f matrix, Shift3f shift)
        {
            return(new M34f(matrix.M00,
                            matrix.M01,
                            0,
                            matrix.M00 * shift.X +
                            matrix.M01 * shift.Y,

                            matrix.M10,
                            matrix.M11,
                            0,
                            matrix.M10 * shift.X +
                            matrix.M11 * shift.Y,

                            0,
                            0,
                            1,
                            shift.Z));
        }
Esempio n. 7
0
        /// <summary>
        /// Multiplacation of a <see cref="Shift3f"/> with a <see cref="M34f"/>.
        /// </summary>
        public static M34f Multiply(Shift3f shift, M34f m)
        {
            return(new M34f(
                       m.M00,
                       m.M01,
                       m.M02,
                       m.M03 + shift.X,

                       m.M10,
                       m.M11,
                       m.M12,
                       m.M13 + shift.Y,

                       m.M20,
                       m.M21,
                       m.M22,
                       m.M23 + shift.Z
                       ));
        }
Esempio n. 8
0
        /// <summary>
        /// Multiplacation of a <see cref="Scale3f"/> with a <see cref="Shift3f"/>.
        /// </summary>
        public static M34f Multiply(Scale3f scale, Shift3f shift)
        {
            return(new M34f(
                       scale.X,
                       0,
                       0,
                       scale.X * shift.X,

                       0,
                       scale.Y,
                       0,
                       scale.Y * shift.Y,

                       0,
                       0,
                       scale.Z,
                       scale.Z * shift.Z

                       ));
        }
Esempio n. 9
0
        /// <summary>
        /// Multiplacation of a <see cref="Shift3f"/> with a <see cref="M44f"/>.
        /// </summary>
        public static M44f Multiply(Shift3f shift, M44f m)
        {
            return(new M44f(
                       m.M00 + shift.X * m.M30,
                       m.M01 + shift.X * m.M31,
                       m.M02 + shift.X * m.M32,
                       m.M03 + shift.X * m.M33,

                       m.M10 + shift.Y * m.M30,
                       m.M11 + shift.Y * m.M31,
                       m.M12 + shift.Y * m.M32,
                       m.M13 + shift.Y * m.M33,

                       m.M20 + shift.Z * m.M30,
                       m.M21 + shift.Z * m.M31,
                       m.M22 + shift.Z * m.M32,
                       m.M23 + shift.Z * m.M33,

                       m.M30,
                       m.M31,
                       m.M32,
                       m.M33
                       ));
        }
Esempio n. 10
0
 public static M34f Multiply(Shift3f shift, Scale3f scale)
 {
     return(new M34f(scale.X, 0, 0, shift.X,
                     0, scale.Y, 0, shift.Y,
                     0, 0, scale.Z, shift.Z));
 }
Esempio n. 11
0
 /// <summary>
 /// Division of a <see cref="Shift3f"/> instance with a float scalar.
 /// </summary>
 public static Shift3f Divide(Shift3f shift, float val)
 {
     return(Multiply(shift, 1 / val));
 }
Esempio n. 12
0
 public static M34f Translation(Shift3f shift)
 {
     return(new M34f(1, 0, 0, shift.X,
                     0, 1, 0, shift.Y,
                     0, 0, 1, shift.Z));
 }
Esempio n. 13
0
 /// <summary>
 /// Calculates the division of a float scalar with a <see cref="Shift3f"/>.
 /// </summary>
 public static Shift3f operator /(float val, Shift3f shift)
 {
     return(Shift3f.Divide(val, shift));
 }
Esempio n. 14
0
 /// <summary>
 /// Division of a float scalar with a <see cref="Shift3f"/>.
 /// </summary>
 public static Shift3f Divide(float value, Shift3f shift)
 {
     return(Multiply(Reciprocal(shift), value));
 }
Esempio n. 15
0
 /// <summary>
 /// Calculates the multiplacation of a <see cref="Shift3f"/> with a <see cref="M34f"/>.
 /// </summary>
 public static M34f operator *(Shift3f shift, M34f mat)
 {
     return(Shift3f.Multiply(shift, mat));
 }
Esempio n. 16
0
 /// <summary>
 /// Calculates the reciprocal of a <see cref="Shift3f"/>.
 /// </summary>
 public static Shift3f Reciprocal(Shift3f shift)
 {
     return(new Shift3f(1 / shift.X, 1 / shift.Y, 1 / shift.Z));
 }
Esempio n. 17
0
 /// <summary>
 /// Calculates the multiplacation of a <see cref="Shift3f"/> with a <see cref="Shift3f"/>.
 /// </summary>
 public static Shift3f operator *(Shift3f shift0, Shift3f shift1)
 {
     return(Shift3f.Multiply(shift0, shift1));
 }
Esempio n. 18
0
 /// <summary>
 /// Calculates the multiplacation of a <see cref="Shift3f"/> with a <see cref="Scale3f"/>.
 /// </summary>
 public static M34f operator *(Shift3f shift, Scale3f scale)
 {
     return(Shift3f.Multiply(shift, scale));
 }
Esempio n. 19
0
        //different calculations for shift vectors

        /// <summary>
        /// Multiplacation of a float scalar with a <see cref="Shift3f"/>.
        /// </summary>
        public static Shift3f Multiply(Shift3f shift, float value)
        {
            return(new Shift3f(shift.X * value,
                               shift.Y * value,
                               shift.Z * value));
        }
Esempio n. 20
0
 /// <summary>
 /// </summary>
 public static M34f operator *(Shift3f shift, Rot3f rot)
 {
     return(Shift3f.Multiply(shift, (M34f)rot));
 }
Esempio n. 21
0
 /// <summary>
 /// Negates the values of a <see cref="Shift3f"/> instance.
 /// </summary>
 public static Shift3f operator -(Shift3f shift)
 {
     return(Shift3f.Negate(shift));
 }
Esempio n. 22
0
 /// <summary>
 /// Multiplication of two <see cref="Shift3f"/>s.
 /// </summary>
 public static Shift3f Multiply(Shift3f shift0, Shift3f shift1)
 {
     return(new Shift3f(shift0.X + shift1.X,
                        shift0.Y + shift1.Y,
                        shift0.Z + shift1.Z));
 }
Esempio n. 23
0
 /// <summary>
 /// Calculates the division of a <see cref="Shift3f"/> with a float scalar.
 /// </summary>
 public static Shift3f operator /(Shift3f shift, float val)
 {
     return(Shift3f.Divide(shift, val));
 }
Esempio n. 24
0
 /// <summary>
 /// Calculates the multiplacation of a <see cref="Shift3f"/> with a float scalar.
 /// </summary>
 public static Shift3f operator *(float value, Shift3f shift)
 {
     return(Shift3f.Multiply(shift, value));
 }
Esempio n. 25
0
 /// <summary>
 /// Negates all values of a <see cref="Shift3f"/>.
 /// </summary>
 public static Shift3f Negate(Shift3f shift)
 {
     return(new Shift3f(-shift.X, -shift.Y, -shift.Z));
 }