예제 #1
0
 /// <summary>
 /// Creates new Identity <see cref="M44f"/> with <see cref="Scale3f"/> for scaling.
 /// </summary>
 /// <param name="scale"></param>
 /// <returns>A <see cref="M44f"/> scaling matrix.</returns>
 public static M44f Scale(Scale3f scale)
 {
     return(new M44f(scale.X, 0, 0, 0,
                     0, scale.Y, 0, 0,
                     0, 0, scale.Z, 0,
                     0, 0, 0, 1));
 }
예제 #2
0
 /// <summary>
 /// Multiplacation of a <see cref="Scale3f"/> with a <see cref="V4f"/>.
 /// </summary>
 public static V4f Multiply(Scale3f scale, V4f vec)
 {
     return(new V4f(scale.X * vec.X,
                    scale.Y * vec.Y,
                    scale.Z * vec.Z,
                    vec.W));
 }
예제 #3
0
 public static M34f Multiply(M34f m, Scale3f s)
 {
     return(new M34f(
                m.M00 * s.X, m.M01 * s.Y, m.M02 * s.Z, m.M03,
                m.M10 * s.X, m.M11 * s.Y, m.M12 * s.Z, m.M13,
                m.M20 * s.X, m.M21 * s.Y, m.M22 * s.Z, m.M23
                ));
 }
예제 #4
0
 public override bool Equals(object obj)
 {
     if (obj is Scale3f)
     {
         Scale3f scalingVector = (Scale3f)obj;
         return((X == scalingVector.X) && (Y == scalingVector.Y) && (Z == scalingVector.Z));
     }
     return(false);
 }
예제 #5
0
        /// <summary>
        /// Multiplacation of a <see cref="Scale3f"/> with a <see cref="M22f"/>.
        /// </summary>
        public static M33f Multiply(Scale3f scale, M22f mat)
        {
            return(new M33f(scale.X * mat.M00,
                            scale.X * mat.M01,
                            0,

                            scale.Y * mat.M10,
                            scale.Y * mat.M11,
                            0,

                            0,
                            0,
                            scale.Z));
        }
예제 #6
0
        /// <summary>
        /// Multiplacation of a <see cref="Scale3f"/> with a <see cref="M33f"/>.
        /// </summary>
        public static M33f Multiply(Scale3f scale, M33f mat)
        {
            return(new M33f(scale.X * mat.M00,
                            scale.X * mat.M01,
                            scale.X * mat.M02,

                            scale.Y * mat.M10,
                            scale.Y * mat.M11,
                            scale.Y * mat.M12,

                            scale.Z * mat.M20,
                            scale.Z * mat.M21,
                            scale.Z * mat.M22));
        }
예제 #7
0
        public static M33f Multiply(M22f matrix, Scale3f scale)
        {
            return(new M33f(matrix.M00 * scale.X,
                            matrix.M01 * scale.Y,
                            0,

                            matrix.M10 * scale.X,
                            matrix.M11 * scale.Y,
                            0,

                            0,
                            0,
                            scale.Z));
        }
예제 #8
0
        public static M33f Multiply(Rot2f rot, Scale3f scale)
        {
            float a = (float)System.Math.Cos(rot.Angle);
            float b = (float)System.Math.Sin(rot.Angle);

            return(new M33f(a * scale.X,
                            b * scale.Y,
                            0,

                            -b * scale.X,
                            a * scale.Y,
                            0,

                            0,
                            0,
                            scale.Z));
        }
예제 #9
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

                       ));
        }
예제 #10
0
        /// <summary>
        /// Multiplacation of a <see cref="M44f"/> with a <see cref="Scale3f"/>.
        /// </summary>
        public static M44f Multiply(M44f matrix, Scale3f scale)
        {
            return(new M44f(
                       matrix.M00 * scale.X,
                       matrix.M01 * scale.Y,
                       matrix.M02 * scale.Z,
                       matrix.M03,

                       matrix.M10 * scale.X,
                       matrix.M11 * scale.Y,
                       matrix.M12 * scale.Z,
                       matrix.M13,

                       matrix.M20 * scale.X,
                       matrix.M21 * scale.Y,
                       matrix.M22 * scale.Z,
                       matrix.M23,

                       matrix.M30 * scale.X,
                       matrix.M31 * scale.Y,
                       matrix.M32 * scale.Z,
                       matrix.M33
                       ));
        }
예제 #11
0
        /// <summary>
        /// Multiplacation of a <see cref="Scale3f"/> with a <see cref="M44f"/>.
        /// </summary>
        public static M44f Multiply(Scale3f scale, M44f mat)
        {
            return(new M44f(
                       scale.X * mat.M00,
                       scale.X * mat.M01,
                       scale.X * mat.M02,
                       scale.X * mat.M03,

                       scale.Y * mat.M10,
                       scale.Y * mat.M11,
                       scale.Y * mat.M12,
                       scale.Y * mat.M13,

                       scale.Z * mat.M20,
                       scale.Z * mat.M21,
                       scale.Z * mat.M22,
                       scale.Z * mat.M23,

                       mat.M30,
                       mat.M31,
                       mat.M32,
                       mat.M33
                       ));
        }
예제 #12
0
 /// <summary>
 /// Calculates the multiplacation of a <see cref="Scale3f"/> with a float scalar.
 /// </summary>
 public static Scale3f operator *(float scalar, Scale3f scale)
 {
     return(Scale3f.Multiply(scale, scalar));
 }
예제 #13
0
 /// <summary>
 /// </summary>
 public static M33f operator *(Scale3f scale, Rot2f rotation)
 {
     return(Scale3f.Multiply(scale, rotation));
 }
예제 #14
0
 /// <summary>
 /// </summary>
 public static M33f operator *(Scale3f scale, Rot3f quaternion)
 {
     return(Scale3f.Multiply(scale, quaternion));
 }
예제 #15
0
 /// <summary>
 /// Calculates the multiplacation of a <see cref="Scale3f"/> with a <see cref="M44f"/>.
 /// </summary>
 public static M44f operator *(Scale3f scale, M44f matrix)
 {
     return(Scale3f.Multiply(scale, matrix));
 }
예제 #16
0
 /// <summary>
 /// Multiplacation of a <see cref="Scale3f"/> with a <see cref="V2f"/>.
 /// </summary>
 public static V2f Multiply(Scale3f scale, V2f v)
 {
     return(new V2f(v.X * scale.X, v.Y * scale.Y));
 }
예제 #17
0
 /// <summary>
 /// Calculates the division of a float scalar with a <see cref="Scale3f"/>.
 /// </summary>
 public static Scale3f operator /(float value, Scale3f scale)
 {
     return(Scale3f.Divide(value, scale));
 }
예제 #18
0
 /// <summary>
 /// Calculates the multiplacation of a <see cref="Scale3f"/> with a <see cref="Shift3f"/>.
 /// </summary>
 public static M34f operator *(Scale3f scale, Shift3f shift)
 {
     return(Scale3f.Multiply(scale, shift));
 }
예제 #19
0
 /// <summary>
 /// Negates all values of a <see cref="Scale3f"/>.
 /// </summary>
 public static Scale3f Negate(Scale3f scale)
 {
     return(new Scale3f(-scale.X, -scale.Y, -scale.Z));
 }
예제 #20
0
 /// <summary>
 /// Division of a <see cref="Scale3f"/> instance with a float scalar.
 /// </summary>
 public static Scale3f Divide(Scale3f scale, float val)
 {
     return(Multiply(scale, 1 / val));
 }
예제 #21
0
 public static M33f Multiply(Scale3f scale, Rot2f rot)
 {
     return(Scale3f.Multiply(scale, (M22f)rot));
 }
예제 #22
0
 /// <summary>
 /// Multiplication of two <see cref="Scale3f"/>s.
 /// </summary>
 public static Scale3f Multiply(Scale3f scale0, Scale3f scale1)
 {
     return(new Scale3f(scale0.X * scale1.X, scale0.Y * scale1.Y, scale0.Z * scale1.Z));
 }
예제 #23
0
 /// <summary>
 /// Calculates the multiplacation of a <see cref="Scale3f"/> with a <see cref="Scale3f"/>.
 /// </summary>
 public static Scale3f operator *(Scale3f scale1, Scale3f scale2)
 {
     return(Scale3f.Multiply(scale1, scale2));
 }
예제 #24
0
 /// <summary>
 /// Calculates the reciprocal of a <see cref="Scale3f"/>.
 /// </summary>
 public static Scale3f Reciprocal(Scale3f scale)
 {
     return(new Scale3f(1 / scale.X, 1 / scale.Y, 1 / scale.Z));
 }
예제 #25
0
 /// <summary>
 /// Calculates the multiplacation of a <see cref="V3f"/> with a <see cref="Scale3f"/>.
 /// </summary>
 public static V3f operator *(V3f vector, Scale3f scale)
 {
     return(Scale3f.Multiply(scale, vector));
 }
예제 #26
0
 /// <summary>
 /// Negates the values of a <see cref="Scale3f"/> instance.
 /// </summary>
 public static Scale3f operator -(Scale3f scalingVector)
 {
     return(Scale3f.Negate(scalingVector));
 }
예제 #27
0
 /// <summary>
 /// Calculates the division of a <see cref="Scale3f"/> with a float scalar.
 /// </summary>
 public static Scale3f operator /(Scale3f scale, float value)
 {
     return(Scale3f.Divide(scale, value));
 }
예제 #28
0
 /// <summary>
 /// Calculates the multiplacation of a <see cref="Scale3f"/> with a <see cref="V4f"/>.
 /// </summary>
 public static V4f operator *(Scale3f scale, V4f vector)
 {
     return(Scale3f.Multiply(scale, vector));
 }
예제 #29
0
 /// <summary>
 /// Division of a float scalar with a <see cref="Scale3f"/>.
 /// </summary>
 public static Scale3f Divide(float val, Scale3f scale)
 {
     return(Multiply(Reciprocal(scale), val));
 }
예제 #30
0
 /// <summary>
 /// Multiplacation of a <see cref="Scale3f"/> with a <see cref="V3f"/>.
 /// </summary>
 public static V3f Multiply(Scale3f scale, V3f v)
 {
     return(new V3f(scale.X * v.X, scale.Y * v.Y, scale.Z * v.Z));
 }