Class Matrix3f
java.lang.Object
dev.prozilla.pine.common.math.matrix.Matrix3f
Represents a 3x3-Matrix. GLSL equivalent to mat3.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds this matrix to another matrix.multiply
(float scalar) Multiplies this matrix with a scalar.Multiplies this matrix to another matrix.Multiplies this matrix to a vector.negate()
Negates this matrix.final void
Sets this matrix to the identity matrix.Subtracts this matrix from another matrix.void
toBuffer
(FloatBuffer buffer) Stores the matrix in a given Buffer.Transposes this matrix.
-
Constructor Details
-
Matrix3f
public Matrix3f()Creates a 3x3 identity matrix. -
Matrix3f
Creates a 3x3 matrix with specified columns.- Parameters:
col1
- Vector with values of the first columncol2
- Vector with values of the second columncol3
- Vector with values of the third column
-
-
Method Details
-
setIdentity
public final void setIdentity()Sets this matrix to the identity matrix. -
add
Adds this matrix to another matrix.- Parameters:
other
- The other matrix- Returns:
- Sum of this + other
-
negate
Negates this matrix.- Returns:
- Negated matrix
-
subtract
Subtracts this matrix from another matrix.- Parameters:
other
- The other matrix- Returns:
- Difference of this - other
-
multiply
Multiplies this matrix with a scalar.- Parameters:
scalar
- The scalar- Returns:
- Scalar product of this * scalar
-
multiply
Multiplies this matrix to a vector.- Parameters:
vector
- The vector- Returns:
- Vector product of this * other
-
multiply
Multiplies this matrix to another matrix.- Parameters:
other
- The other matrix- Returns:
- Matrix product of this * other
-
transpose
Transposes this matrix.- Returns:
- Transposed matrix
-
toBuffer
Stores the matrix in a given Buffer.- Parameters:
buffer
- The buffer to store the matrix data
-