com.aspose.threed

Interfaces

Classes

Enums

Exceptions

com.aspose.threed

Class Matrix4

    • Field Detail

      • m00

        public double m00
        The m00.
      • m01

        public double m01
        The m01.
      • m02

        public double m02
        The m02.
      • m03

        public double m03
        The m03.
      • m10

        public double m10
        The m10.
      • m11

        public double m11
        The m11.
      • m12

        public double m12
        The m12.
      • m13

        public double m13
        The m13.
      • m20

        public double m20
        The m20.
      • m21

        public double m21
        The m21.
      • m22

        public double m22
        The m22.
      • m23

        public double m23
        The m23.
      • m30

        public double m30
        The m30.
      • m31

        public double m31
        The m31.
      • m32

        public double m32
        The m32.
      • m33

        public double m33
        The m33.
    • Constructor Detail

      • Matrix4

        public Matrix4(Vector4 r0,
                       Vector4 r1,
                       Vector4 r2,
                       Vector4 r3)
        Constructs matrix from 4 rows.
        Parameters:
        r0 - R0.
        r1 - R1.
        r2 - R2.
        r3 - R3.
      • Matrix4

        public Matrix4(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)
        Initializes a new instance of the Matrix4 struct.
        Parameters:
        m00 - M00.
        m01 - M01.
        m02 - M02.
        m03 - M03.
        m10 - M10.
        m11 - M11.
        m12 - M12.
        m13 - M13.
        m20 - M20.
        m21 - M21.
        m22 - M22.
        m23 - M23.
        m30 - M30.
        m31 - M31.
        m32 - M32.
        m33 - M33.
      • Matrix4

        public Matrix4(double[] m)
        Initializes a new instance of the Matrix4 struct.
        Parameters:
        m - M.
      • Matrix4

        public Matrix4()
    • Method Detail

      • getIdentity

        public static Matrix4 getIdentity()
        Gets the identity matrix.
      • concatenate

        public Matrix4 concatenate(Matrix4 m2)
        Concatenates the two matrices
        Parameters:
        m2 - M2.
        Returns:
        New matrix4
      • transpose

        public Matrix4 transpose()
        Transposes this instance.
        Returns:
        The transposed matrix.
      • normalize

        public Matrix4 normalize()
        Normalizes this instance.
        Returns:
        Normalize matrix4
      • inverse

        public Matrix4 inverse()
        Inverses this instance.
        Returns:
        Inverse matrix4
      • getDeterminant

        public double getDeterminant()
        Gets the determinant of the matrix.
      • mul

        public static Matrix4 mul(Matrix4 lhs,
                                  Matrix4 rhs)
        Multiply the two matrices
        Parameters:
        lhs - Lhs.
        rhs - Rhs.
        Returns:
        Result matrix
      • mul

        public static Vector3 mul(Matrix4 lhs,
                                  Vector3 v)
        Multiply the matrix and vector3
        Parameters:
        lhs - Lhs.
        v - V.
        Returns:
        Result matrix
      • setTRS

        public void setTRS(Vector3 translation,
                           Vector3 rotation,
                           Vector3 scale)
        Initializes the matrix with translation/rotation/scale
        Parameters:
        translation - Translation.
        rotation - Euler angles for rotation, fields are in degree.
        scale - Scale.
      • mul

        public static Vector4 mul(Matrix4 lhs,
                                  Vector4 v)
        Multiply the matrix and vector4
        Parameters:
        lhs - Lhs.
        v - V.
        Returns:
        Result matrix
      • mul

        public static Matrix4 mul(Matrix4 lhs,
                                  double v)
        Multiply the matrix and double value
        Parameters:
        lhs - Lhs.
        v - V.
        Returns:
        Result matrix
      • toArray

        public double[] toArray()
        Converts matrix to array.
        Returns:
        The array.
      • decompose

        public boolean decompose(Vector3 translation,
                                 Vector3 scaling,
                                 Quaternion rotation)
        Decompose the transformation matrix.
        Parameters:
        translation - The translation.
        scaling - The scaling.
        rotation - The rotation.
        Returns:
        True if successed.
      • translate

        public static Matrix4 translate(Vector3 t)
        Creates a matrix that translates along the x-axis, the y-axis and the z-axis
        Parameters:
        t - Translate offset
      • translate

        public static Matrix4 translate(double tx,
                                        double ty,
                                        double tz)
        Creates a matrix that translates along the x-axis, the y-axis and the z-axis
        Parameters:
        tx - X-coordinate offset
        ty - Y-coordinate offset
        tz - Z-coordinate offset
      • scale

        public static Matrix4 scale(Vector3 s)
        Creates a matrix that scales along the x-axis, the y-axis and the z-axis.
        Parameters:
        s - Scaling factories applies to the x-axis, the y-axis and the z-axis
      • scale

        public static Matrix4 scale(double s)
        Creates a matrix that scales along the x-axis, the y-axis and the z-axis.
        Parameters:
        s - Scaling factories applies to all axises
      • scale

        public static Matrix4 scale(double sx,
                                    double sy,
                                    double sz)
        Creates a matrix that scales along the x-axis, the y-axis and the z-axis.
        Parameters:
        sx - Scaling factories applies to the x-axis
        sy - Scaling factories applies to the y-axis
        sz - Scaling factories applies to the z-axis
      • rotateFromEuler

        public static Matrix4 rotateFromEuler(Vector3 eul)
        Create a rotation matrix from euler angle
        Parameters:
        eul - Rotation in radian
      • rotateFromEuler

        public static Matrix4 rotateFromEuler(double rx,
                                              double ry,
                                              double rz)
        Create a rotation matrix from euler angle
        Parameters:
        rx - Rotation in x axis in radian
        ry - Rotation in y axis in radian
        rz - Rotation in z axis in radian
      • rotate

        public static Matrix4 rotate(double angle,
                                     Vector3 axis)
        Create a rotation matrix by rotation angle and axis
        Parameters:
        angle - Rotate angle in radian
        axis - Rotation axis
      • rotate

        public static Matrix4 rotate(Quaternion q)
        Create a rotation matrix from a quaternion
        Parameters:
        q - Rotation quaternion
      • clone

        public Matrix4 clone()
        Specified by:
        clone in interface com.aspose.threed.Struct<Matrix4>
        Overrides:
        clone in class Object
      • copyFrom

        public void copyFrom(Matrix4 src)
        Specified by:
        copyFrom in interface com.aspose.threed.Struct<Matrix4>
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object