org.firstinspires.ftc.robotcore.external.matrices

## Class OpenGLMatrix

- java.lang.Object
- - org.firstinspires.ftc.robotcore.external.matrices.MatrixF
  - - org.firstinspires.ftc.robotcore.external.matrices.DenseMatrixF
    - - org.firstinspires.ftc.robotcore.external.matrices.ColumnMajorMatrixF
      - - org.firstinspires.ftc.robotcore.external.matrices.OpenGLMatrix

-     public class OpenGLMatrix
      extends ColumnMajorMatrixF

  An `OpenGLMatrix` is a 4x4 matrix commonly used as a transformation matrix for 3D homogeneous coordinates. The data layout of an `OpenGLMatrix` is used heavily in the OpenGL high performance graphics standard.
  See Also:
    Homogenous coordinates, Transformation Matrix, `android.opengl.Matrix`, `Matrix`

- - ### Field Summary

    - ### Fields inherited from class org.firstinspires.ftc.robotcore.external.matrices.MatrixF

      `numCols, numRows`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `OpenGLMatrix()`
    `OpenGLMatrix(float[] data)`
    `OpenGLMatrix(Matrix44F matrix)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `MatrixF` | `emptyMatrix(int numRows, int numCols)` Returns a new empty matrix of the indicated dimensions.
    `float[]` | `getData()` Returns the contiguous array of floats which is the storage for this matrix
    `static OpenGLMatrix` | `identityMatrix()`
    `OpenGLMatrix` | `inverted()` Returns a matrix which is the matrix-multiplication inverse of the receiver.
    `MatrixF` | `multiplied(MatrixF him)` Returns a matrix which is the multiplication of the recevier with another matrix.
    `OpenGLMatrix` | `multiplied(OpenGLMatrix him)`
    `void` | `multiply(MatrixF him)` Updates the receiver to be the product of itself and another matrix.
    `void` | `multiply(OpenGLMatrix him)` Updates the receiver to be the product of itself and another matrix.
    `void` | `rotate(AngleUnit angleUnit, float angle, float dx, float dy, float dz)`
    `void` | `rotate(AxesReference axesReference, AxesOrder axesOrder, AngleUnit angleUnit, float first, float second, float third)`
    `OpenGLMatrix` | `rotated(AngleUnit angleUnit, float angle, float dx, float dy, float dz)`
    `OpenGLMatrix` | `rotated(AxesReference axesReference, AxesOrder axesOrder, AngleUnit angleUnit, float first, float second, float third)`
    `static OpenGLMatrix` | `rotation(AngleUnit angleUnit, float angle, float dx, float dy, float dz)` Creates a matrix for rotation by the indicated angle around the indicated vector.
    `static OpenGLMatrix` | `rotation(AxesReference axesReference, AxesOrder axesOrder, AngleUnit angleUnit, float first, float second, float third)` Creates a matrix for a rotation specified by three successive rotation angles.
    `void` | `scale(float scale)`
    `void` | `scale(float scaleX, float scaleY, float scaleZ)`
    `OpenGLMatrix` | `scaled(float scale)`
    `OpenGLMatrix` | `scaled(float scaleX, float scaleY, float scaleZ)`
    `void` | `translate(float dx, float dy, float dz)`
    `OpenGLMatrix` | `translated(float dx, float dy, float dz)`
    `static OpenGLMatrix` | `translation(float dx, float dy, float dz)`
    `OpenGLMatrix` | `transposed()` Returns a matrix which is the transposition of the receiver matrix.

    - ### Methods inherited from class org.firstinspires.ftc.robotcore.external.matrices.ColumnMajorMatrixF

      `indexFromRowCol, toVector`

    - ### Methods inherited from class org.firstinspires.ftc.robotcore.external.matrices.DenseMatrixF

      `get, put`

    - ### Methods inherited from class org.firstinspires.ftc.robotcore.external.matrices.MatrixF

      `adaptHomogeneous, add, add, add, added, added, added, diagonalMatrix, diagonalMatrix, dimensionsError, dimensionsError, formatAsTransform, formatAsTransform, getColumn, getRow, getTranslation, identityMatrix, multiplied, multiplied, multiplied, multiply, multiply, multiply, numCols, numRows, slice, slice, subtract, subtract, subtract, subtracted, subtracted, subtracted, toString, transform`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### OpenGLMatrix

          public OpenGLMatrix()

    - #### OpenGLMatrix

          public OpenGLMatrix(float[] data)

    - #### OpenGLMatrix

          public OpenGLMatrix(Matrix44F matrix)

  - ### Method Detail

    - #### emptyMatrix

          public MatrixF emptyMatrix(int numRows,
                                     int numCols)

      Description copied from class: `MatrixF`
      Returns a new empty matrix of the indicated dimensions. If a specific implementation associated with the receiver can be used with these dimensions, then such is used; otherwise a general matrix implementation will be used.
      Specified by:
        `emptyMatrix` in class `MatrixF`
      Returns:
        a new empty matrix of the indicated dimensions
      See Also:
        `emptyMatrix(int, int)`

    - #### rotation

          public static OpenGLMatrix rotation(AngleUnit angleUnit,
                                              float angle,
                                              float dx,
                                              float dy,
                                              float dz)

      Creates a matrix for rotation by the indicated angle around the indicated vector.

    - #### rotation

          public static OpenGLMatrix rotation(AxesReference axesReference,
                                              AxesOrder axesOrder,
                                              AngleUnit angleUnit,
                                              float first,
                                              float second,
                                              float third)

      Creates a matrix for a rotation specified by three successive rotation angles.
      See Also:
        `Orientation.getRotationMatrix(AxesReference, AxesOrder, AngleUnit, float, float, float)`

    - #### translation

          public static OpenGLMatrix translation(float dx,
                                                 float dy,
                                                 float dz)

    - #### identityMatrix

          public static OpenGLMatrix identityMatrix()

    - #### getData

          public float[] getData()

      Description copied from class: `DenseMatrixF`
      Returns the contiguous array of floats which is the storage for this matrix
      Specified by:
        `getData` in class `DenseMatrixF`
      Returns:
        the contiguous array of floats which is the storage for this matrix

    - #### scale

          @NonConst
          public void scale(float scaleX,
                                      float scaleY,
                                      float scaleZ)

    - #### scale

          @NonConst
          public void scale(float scale)

    - #### translate

          @NonConst
          public void translate(float dx,
                                          float dy,
                                          float dz)

    - #### rotate

          @NonConst
          public void rotate(AngleUnit angleUnit,
                                       float angle,
                                       float dx,
                                       float dy,
                                       float dz)

    - #### rotate

          @NonConst
          public void rotate(AxesReference axesReference,
                                       AxesOrder axesOrder,
                                       AngleUnit angleUnit,
                                       float first,
                                       float second,
                                       float third)

    - #### scaled

          @Const
          public OpenGLMatrix scaled(float scaleX,
                                            float scaleY,
                                            float scaleZ)

    - #### scaled

          @Const
          public OpenGLMatrix scaled(float scale)

    - #### translated

          @Const
          public OpenGLMatrix translated(float dx,
                                                float dy,
                                                float dz)

    - #### rotated

          @Const
          public OpenGLMatrix rotated(AngleUnit angleUnit,
                                             float angle,
                                             float dx,
                                             float dy,
                                             float dz)

    - #### rotated

          @Const
          public OpenGLMatrix rotated(AxesReference axesReference,
                                             AxesOrder axesOrder,
                                             AngleUnit angleUnit,
                                             float first,
                                             float second,
                                             float third)

    - #### inverted

          @Const
          public OpenGLMatrix inverted()

      Description copied from class: `MatrixF`
      Returns a matrix which is the matrix-multiplication inverse of the receiver.
      Overrides:
        `inverted` in class `MatrixF`
      Returns:
        a matrix which is the matrix-multiplication inverse of the receiver

    - #### transposed

          @Const
          public OpenGLMatrix transposed()

      Description copied from class: `MatrixF`
      Returns a matrix which is the transposition of the receiver matrix.
      Overrides:
        `transposed` in class `MatrixF`
      Returns:
        a matrix which is the transposition of the receiver matrix.

    - #### multiplied

          @Const
          public OpenGLMatrix multiplied(OpenGLMatrix him)

    - #### multiplied

          @Const
          public MatrixF multiplied(MatrixF him)

      Description copied from class: `MatrixF`
      Returns a matrix which is the multiplication of the recevier with another matrix.
      Overrides:
        `multiplied` in class `MatrixF`
      Parameters:
        `him` - the matrix with which the receiver is to be multiplied.
      Returns:
        a matrix which is the product of the two matrices

    - #### multiply

          @NonConst
          public void multiply(OpenGLMatrix him)

      Updates the receiver to be the product of itself and another matrix.
      Parameters:
        `him` - the matrix with which the receiver is to be multiplied.

    - #### multiply

          @NonConst
          public void multiply(MatrixF him)

      Updates the receiver to be the product of itself and another matrix.
      Overrides:
        `multiply` in class `MatrixF`
      Parameters:
        `him` - the matrix with which the receiver is to be multiplied.