Class Matrix4


  • public class Matrix4
    extends Object
    Simple float array-backed float 4x4 matrix exposing FloatUtil matrix functionality in an object oriented manner.

    Unlike PMVMatrix, this class only represents one single matrix without a complete GLMatrixFunc implementation, allowing this class to be more lightweight.

    Implementation is not mature - WIP and subject to change.

    • Constructor Detail

      • Matrix4

        public Matrix4()
    • Method Detail

      • getMatrix

        public final float[] getMatrix()
      • loadIdentity

        public final void loadIdentity()
      • multMatrix

        public final void multMatrix​(float[] m,
                                     int m_offset)
        Multiply matrix: [this] = [this] x [m]
        Parameters:
        m - 4x4 matrix in column-major order
      • multMatrix

        public final void multMatrix​(float[] m)
        Multiply matrix: [this] = [this] x [m]
        Parameters:
        m - 4x4 matrix in column-major order
      • multMatrix

        public final void multMatrix​(Matrix4 m)
        Multiply matrix: [this] = [this] x [m]
        Parameters:
        m - 4x4 matrix in column-major order
      • multVec

        public final void multVec​(float[] v_in,
                                  float[] v_out)
        Parameters:
        v_in - 4-component column-vector
        v_out - this * v_in
      • multVec

        public final void multVec​(float[] v_in,
                                  int v_in_offset,
                                  float[] v_out,
                                  int v_out_offset)
        Parameters:
        v_in - 4-component column-vector
        v_out - this * v_in
      • translate

        public final void translate​(float x,
                                    float y,
                                    float z)
      • scale

        public final void scale​(float x,
                                float y,
                                float z)
      • rotate

        public final void rotate​(float angrad,
                                 float x,
                                 float y,
                                 float z)
      • transpose

        public final void transpose()
      • determinant

        public final float determinant()
      • invert

        public final boolean invert()
      • makeOrtho

        public final void makeOrtho​(float left,
                                    float right,
                                    float bottom,
                                    float top,
                                    float zNear,
                                    float zFar)