Example #1
0
        public static Matrix33 CreateScale(Vector3 s)
        {
            var matrix = new Matrix33();

            matrix.SetScale(s);

            return(matrix);
        }
Example #2
0
        public static Matrix33 CreateRotationAA(float c, float s, Vector3 axis)
        {
            var matrix = new Matrix33();

            matrix.SetRotationAA(c, s, axis);

            return(matrix);
        }
Example #3
0
        public static Matrix33 CreateIdentity()
        {
            var matrix = new Matrix33();

            matrix.SetIdentity();

            return(matrix);
        }
Example #4
0
        public static Matrix33 CreateFromVectors(Vector3 vx, Vector3 vy, Vector3 vz)
        {
            var matrix = new Matrix33();

            matrix.SetFromVectors(vx, vy, vz);

            return(matrix);
        }
Example #5
0
        public static Matrix33 operator *(Matrix33 left, Matrix33 right)
        {
            var m = new Matrix33();

            m.M00 = left.M00 * right.M00 + left.M01 * right.M10 + left.M02 * right.M20;
            m.M01 = left.M00 * right.M01 + left.M01 * right.M11 + left.M02 * right.M21;
            m.M02 = left.M00 * right.M02 + left.M01 * right.M12 + left.M02 * right.M22;
            m.M10 = left.M10 * right.M00 + left.M11 * right.M10 + left.M12 * right.M20;
            m.M11 = left.M10 * right.M01 + left.M11 * right.M11 + left.M12 * right.M21;
            m.M12 = left.M10 * right.M02 + left.M11 * right.M12 + left.M12 * right.M22;
            m.M20 = left.M20 * right.M00 + left.M21 * right.M10 + left.M22 * right.M20;
            m.M21 = left.M20 * right.M01 + left.M21 * right.M11 + left.M22 * right.M21;
            m.M22 = left.M20 * right.M02 + left.M21 * right.M12 + left.M22 * right.M22;
            return(m);
        }
Example #6
0
        public void SetScale(Vector3 s, Vector3 t = default(Vector3))
        {
            this = new Matrix34(Matrix33.CreateScale(s));

            SetTranslation(t);
        }
Example #7
0
        /*!
         *  Create a rotation matrix around an arbitrary axis (Eulers Theorem).
         *  The axis is specified as an normalized Vector3. The angle is assumed to be in radians.
         *  This function also assumes a translation-vector and stores it in the right column.
         *
         *  Example:
         *        Matrix34 m34;
         *        Vector3 axis=GetNormalized( Vector3(-1.0f,-0.3f,0.0f) );
         *        m34.SetRotationAA( 3.14314f, axis, Vector3(5,5,5) );
         */

        public void SetRotationAA(float c, float s, Vector3 axis, Vector3 t = default(Vector3))
        {
            this = new Matrix34(Matrix33.CreateRotationAA(c, s, axis));
            M03  = t.X; M13 = t.Y; M23 = t.Z;
        }
Example #8
0
 public void SetRotation33(Matrix33 m33)
 {
     M00 = m33.M00; M01 = m33.M01; M02 = m33.M02;
     M10 = m33.M10; M11 = m33.M11; M12 = m33.M12;
     M20 = m33.M20; M21 = m33.M21; M22 = m33.M22;
 }
Example #9
0
 public Matrix34(Matrix33 m33)
     : this()
 {
 }