Class Matrix3f

java.lang.Object
dev.prozilla.pine.common.math.matrix.Matrix3f

public class Matrix3f extends Object
Represents a 3x3-Matrix. GLSL equivalent to mat3.
  • Constructor Details

    • Matrix3f

      public Matrix3f()
      Creates a 3x3 identity matrix.
    • Matrix3f

      public Matrix3f(Vector3f col1, Vector3f col2, Vector3f col3)
      Creates a 3x3 matrix with specified columns.
      Parameters:
      col1 - Vector with values of the first column
      col2 - Vector with values of the second column
      col3 - Vector with values of the third column
  • Method Details

    • setIdentity

      public final void setIdentity()
      Sets this matrix to the identity matrix.
    • add

      public Matrix3f add(Matrix3f other)
      Adds this matrix to another matrix.
      Parameters:
      other - The other matrix
      Returns:
      Sum of this + other
    • negate

      public Matrix3f negate()
      Negates this matrix.
      Returns:
      Negated matrix
    • subtract

      public Matrix3f subtract(Matrix3f other)
      Subtracts this matrix from another matrix.
      Parameters:
      other - The other matrix
      Returns:
      Difference of this - other
    • multiply

      public Matrix3f multiply(float scalar)
      Multiplies this matrix with a scalar.
      Parameters:
      scalar - The scalar
      Returns:
      Scalar product of this * scalar
    • multiply

      public Vector3f multiply(Vector3f vector)
      Multiplies this matrix to a vector.
      Parameters:
      vector - The vector
      Returns:
      Vector product of this * other
    • multiply

      public Matrix3f multiply(Matrix3f other)
      Multiplies this matrix to another matrix.
      Parameters:
      other - The other matrix
      Returns:
      Matrix product of this * other
    • transpose

      public Matrix3f transpose()
      Transposes this matrix.
      Returns:
      Transposed matrix
    • toBuffer

      public void toBuffer(FloatBuffer buffer)
      Stores the matrix in a given Buffer.
      Parameters:
      buffer - The buffer to store the matrix data