Interface MMatrix4d

  • All Superinterfaces:
    Matrix4d

    public interface MMatrix4d
    extends Matrix4d
    Interface for 4x4 matrices. Allows modifying the matrix.
    Since:
    9.10.2
    • Field Summary

      • Fields inherited from interface com.solibri.geometry.linearalgebra.Matrix4d

        IDENTITY
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addInPlace​(double scalar)
      Adds a scalar to each component of this matrix.
      void addInPlace​(Matrix4d matrix)
      Sets the value of this matrix to sum of itself and the given matrix.
      static MMatrix4d create()
      Returns a new identity matrix.
      static MMatrix4d create​(double[] elements)
      Constructs a matrix with the given array of 16 elements or 12 elements.
      static MMatrix4d create​(double m00, double m01, double m02, double m03, double m10, double m11, double m12, double m13, double m20, double m21, double m22, double m23, double m30, double m31, double m32, double m33)
      Constructs a matrix with the given 16 elements.
      static MMatrix4d create​(Matrix4d matrix)
      Returns a new matrix with the values of the given matrix.
      void invert()
      Inverts this matrix in place.
      void multiplyInPlace​(Matrix4d matrix)
      Sets the value of this matrix to the result of multiplying itself with the given matrix.
      void normalize()
      Normalizes the axis of the matrix.
      void set​(Matrix4d matrix)
      Sets the values of this matrix to the values of the given matrix.
      void setByDoubleArray​(double[] numbers)
      Sets the matrix values to the values given in the numbers array.
      void setColumn​(int column, double firstRow, double secondRow, double thirdRow, double fourthRow)
      Sets the specified column of this matrix to the four values provided.
      void setColumn​(int column, Vector3d vector)
      Sets the specified column with the x,y,z values received from the vector.
      void setEuler​(Vector3d euler)
      Sets the rotational component (upper 3x3) of this transform to the rotation matrix converted from the Euler angles provided; the other non-rotational elements are set as if this were an identity matrix.
      void setIdentity()
      Sets this matrix to an identity matrix.
      void setM00​(double m00)
      Set the first element of the first row in the matrix.
      void setM01​(double m01)
      Set the second element of the first row in the matrix.
      void setM02​(double m02)
      Set the third element of the first row in the matrix.
      void setM03​(double m03)
      Set the fourth element of the first row in the matrix.
      void setM10​(double m10)
      Sets the first value of the second row in the matrix.
      void setM11​(double m11)
      Sets the second value of the second row in the matrix.
      void setM12​(double m12)
      Sets the third value of the second row in the matrix.
      void setM13​(double m13)
      Sets the fourth value of the second row in the matrix.
      void setM20​(double m20)
      Sets the first value of the third row in the matrix.
      void setM21​(double m21)
      Sets the second value of the third row in the matrix.
      void setM22​(double m22)
      Sets the third value of the third row in the matrix.
      void setM23​(double m23)
      Sets the fourth value of the third row in the matrix.
      void setM30​(double m30)
      Sets the first value of the fourth row in the matrix.
      void setM31​(double m31)
      Sets the second value of the fourth row in the matrix.
      void setM32​(double m32)
      Sets the third value of the fourth row in the matrix.
      void setM33​(double m33)
      Sets the fourth value of the fourth row in the matrix.
      void setRotation​(Vector3d x, Vector3d y, Vector3d z)
      Sets the rotation (and scaling) based on the vectors given.
      void setRotationX​(double angle)
      Sets the rotation about the X axis of this matrix.
      void setRotationY​(double angle)
      Sets the rotation about the Y axis of this matrix.
      void setRotationZ​(double angle)
      Sets the rotation about the Z axis of this matrix.
      void setScale​(double scale)
      Sets the scale component of the current matrix by factoring out the current scale (by doing an SVD) from the rotational component and multiplying by the new scale.
      void setTranslation​(Vector3d translationComponent)
      Sets the translation component of this matrix based on a vector.
      void subtractInPlace​(Matrix4d matrix)
      Sets the value of this matrix to the matrix difference of itself and the given matrix.
      void transpose()
      Transposes this matrix.
    • Method Detail

      • create

        static MMatrix4d create()
        Returns a new identity matrix.
        Returns:
        a new identity matrix
        Since:
        9.10.2
      • create

        static MMatrix4d create​(Matrix4d matrix)
        Returns a new matrix with the values of the given matrix.
        Parameters:
        matrix - the matrix that is inputed to create another matrix
        Returns:
        a new matrix with the values of the given matrix
        Since:
        9.10.2
      • create

        static MMatrix4d create​(double[] elements)
        Constructs a matrix with the given array of 16 elements or 12 elements. The first four elements are the first row of the matrix. The second four elements are the second row of the matrix. The third four elements are the third row of the matrix. The fourth four elements, if present, are the fourth row of the matrix, and if not present they are set to (0, 0, 0, 1). Example: M00 = elements[0], M01 = elements[1] etc...
        Parameters:
        elements - the elements array
        Returns:
        returns a new matrix with the contents from elements
        Throws:
        IllegalArgumentException - if the given array does not contain 12 or 16 elements
        Since:
        9.10.2
      • create

        static MMatrix4d create​(double m00,
                                double m01,
                                double m02,
                                double m03,
                                double m10,
                                double m11,
                                double m12,
                                double m13,
                                double m20,
                                double m21,
                                double m22,
                                double m23,
                                double m30,
                                double m31,
                                double m32,
                                double m33)
        Constructs a matrix with the given 16 elements. The first four elements are the first row of the matrix. The second four elements are the second row of the matrix. The third four elements are the third row of the matrix. The fourth four elements are the fourth row of the matrix.
        Parameters:
        m00 - first element in first row
        m01 - second element in first row
        m02 - third element in first row
        m03 - fourth element in first row
        m10 - first element in second row
        m11 - second element in second row
        m12 - third element in second row
        m13 - fourth element in second row
        m20 - first element in third row
        m21 - second element in third row
        m22 - third element in third row
        m23 - fourth element in third row
        m30 - first element in fourth row
        m31 - second element in fourth row
        m32 - third element in fourth row
        m33 - fourth element in fourth row
        Returns:
        a new matrix with the given 16 elements
        Since:
        9.10.2
      • addInPlace

        void addInPlace​(double scalar)
        Adds a scalar to each component of this matrix.
        Parameters:
        scalar - the scalar that is added to each component
        Since:
        9.10.2
      • addInPlace

        void addInPlace​(Matrix4d matrix)
        Sets the value of this matrix to sum of itself and the given matrix.
        Parameters:
        matrix - the matrix which is added to this
        Since:
        9.10.2
      • subtractInPlace

        void subtractInPlace​(Matrix4d matrix)
        Sets the value of this matrix to the matrix difference of itself and the given matrix.
        Parameters:
        matrix - the matrix by which this is subtracted
        Since:
        9.10.2
      • invert

        void invert()
        Inverts this matrix in place.
        Since:
        9.10.2
      • transpose

        void transpose()
        Transposes this matrix.
        Since:
        9.10.2
      • multiplyInPlace

        void multiplyInPlace​(Matrix4d matrix)
        Sets the value of this matrix to the result of multiplying itself with the given matrix.
        Parameters:
        matrix - the matrix by which this is multiplied
        Since:
        9.10.2
      • setRotationX

        void setRotationX​(double angle)
        Sets the rotation about the X axis of this matrix.
        Parameters:
        angle - the angle to rotate on the X axis in radians
        Since:
        9.10.2
      • setRotationY

        void setRotationY​(double angle)
        Sets the rotation about the Y axis of this matrix.
        Parameters:
        angle - the angle to rotate on the Y axis in radians
        Since:
        9.10.2
      • setRotationZ

        void setRotationZ​(double angle)
        Sets the rotation about the Z axis of this matrix.
        Parameters:
        angle - the angle to rotate on the Z axis in radians
        Since:
        9.10.2
      • set

        void set​(Matrix4d matrix)
        Sets the values of this matrix to the values of the given matrix.
        Parameters:
        matrix - the matrix from which values are copied to this
        Since:
        9.10.2
      • setColumn

        void setColumn​(int column,
                       Vector3d vector)
        Sets the specified column with the x,y,z values received from the vector.
        Parameters:
        column - the index of the column
        vector - the vector that is set to the column
        Since:
        9.10.2
      • setColumn

        void setColumn​(int column,
                       double firstRow,
                       double secondRow,
                       double thirdRow,
                       double fourthRow)
        Sets the specified column of this matrix to the four values provided.
        Parameters:
        column - index of the column
        firstRow - first row element
        secondRow - second row element
        thirdRow - third row element
        fourthRow - fourth row element
        Since:
        9.10.2
      • setIdentity

        void setIdentity()
        Sets this matrix to an identity matrix.
        Since:
        9.10.2
      • setM00

        void setM00​(double m00)
        Set the first element of the first row in the matrix.
        Parameters:
        m00 - value that is set
        Since:
        9.10.2
      • setM01

        void setM01​(double m01)
        Set the second element of the first row in the matrix.
        Parameters:
        m01 - value that is set
      • setM02

        void setM02​(double m02)
        Set the third element of the first row in the matrix.
        Parameters:
        m02 - the value that is set
        Since:
        9.10.2
      • setM03

        void setM03​(double m03)
        Set the fourth element of the first row in the matrix.
        Parameters:
        m03 - value that is set
        Since:
        9.10.2
      • setM10

        void setM10​(double m10)
        Sets the first value of the second row in the matrix.
        Parameters:
        m10 - value that is set
        Since:
        9.10.2
      • setM11

        void setM11​(double m11)
        Sets the second value of the second row in the matrix.
        Parameters:
        m11 - value that is set
        Since:
        9.10.2
      • setM12

        void setM12​(double m12)
        Sets the third value of the second row in the matrix.
        Parameters:
        m12 - value that is set
        Since:
        9.10.2
      • setM13

        void setM13​(double m13)
        Sets the fourth value of the second row in the matrix.
        Parameters:
        m13 - value that is set
        Since:
        9.10.2
      • setM20

        void setM20​(double m20)
        Sets the first value of the third row in the matrix.
        Parameters:
        m20 - value that is set
        Since:
        9.10.2
      • setM21

        void setM21​(double m21)
        Sets the second value of the third row in the matrix.
        Parameters:
        m21 - value that is set
        Since:
        9.10.2
      • setM22

        void setM22​(double m22)
        Sets the third value of the third row in the matrix.
        Parameters:
        m22 - value that is set
        Since:
        9.10.2
      • setM23

        void setM23​(double m23)
        Sets the fourth value of the third row in the matrix.
        Parameters:
        m23 - value that is set
        Since:
        9.10.2
      • setM30

        void setM30​(double m30)
        Sets the first value of the fourth row in the matrix.
        Parameters:
        m30 - value that is set
        Since:
        9.10.2
      • setM31

        void setM31​(double m31)
        Sets the second value of the fourth row in the matrix.
        Parameters:
        m31 - value that is set
        Since:
        9.10.2
      • setM32

        void setM32​(double m32)
        Sets the third value of the fourth row in the matrix.
        Parameters:
        m32 - value that is set
        Since:
        9.10.2
      • setM33

        void setM33​(double m33)
        Sets the fourth value of the fourth row in the matrix.
        Parameters:
        m33 - value that is set
        Since:
        9.10.2
      • setTranslation

        void setTranslation​(Vector3d translationComponent)
        Sets the translation component of this matrix based on a vector.
        Parameters:
        translationComponent - the position
        Since:
        9.10.2
      • setRotation

        void setRotation​(Vector3d x,
                         Vector3d y,
                         Vector3d z)
        Sets the rotation (and scaling) based on the vectors given.
        Parameters:
        x - The first three cells of the first column of this matrix
        y - The first three cells of the second column of this matrix
        z - The first three cells of the third column of this matrix
      • setScale

        void setScale​(double scale)
        Sets the scale component of the current matrix by factoring out the current scale (by doing an SVD) from the rotational component and multiplying by the new scale.
        Parameters:
        scale - scaling factor
      • setByDoubleArray

        void setByDoubleArray​(double[] numbers)
        Sets the matrix values to the values given in the numbers array. The array must be of 12 or 16 elements.
        Parameters:
        numbers - the elements of the matrix
        Throws:
        IllegalArgumentException - if another size besides 12 or 16 is given
      • setEuler

        void setEuler​(Vector3d euler)
        Sets the rotational component (upper 3x3) of this transform to the rotation matrix converted from the Euler angles provided; the other non-rotational elements are set as if this were an identity matrix. The euler parameter is a Vector3d consisting of three rotation angles applied first about the X, then Y then Z axis. These rotations are applied using a static frame of reference. In other words, the orientation of the Y rotation axis is not affected by the X rotation and the orientation of the Z rotation axis is not affected by the X or Y rotation.
        Parameters:
        euler - the Vector3d consisting of three rotation angles about X,Y,Z
        Since:
        9.10.2
      • normalize

        void normalize()
        Normalizes the axis of the matrix.
        Since:
        9.10.2