public class Matrix3f extends Object
Constructor and Description |
---|
Matrix3f()
Creates a new identity 3x3 matrix
|
Matrix3f(float[] dataArray)
Creates a new matrix and sets its values from the given
parameter
|
Modifier and Type | Method and Description |
---|---|
float |
get(int x,
int y)
Returns the value for a given row and column
|
float[] |
getArray()
Return a reference to the internal array representing matrix
values.
|
void |
load(Matrix3f src)
Sets the values of the matrix to those of the parameter
|
void |
loadIdentity()
Sets the matrix values to identity
|
void |
loadMultiply(Matrix3f lhs,
Matrix3f rhs)
Sets current values to be the result of multiplying two given
matrices
|
void |
loadRotate(float rot)
Makes the upper 2x2 a rotation matrix of the given angle
|
void |
loadRotate(float rot,
float x,
float y,
float z)
Sets current values to be a rotation matrix of certain angle
about a given axis
|
void |
loadScale(float x,
float y)
Makes the upper 2x2 a scale matrix of given dimensions
|
void |
loadScale(float x,
float y,
float z)
Sets current values to be a scale matrix of given dimensions
|
void |
loadTranslate(float x,
float y)
Sets current values to be a translation matrix of given
dimensions
|
void |
multiply(Matrix3f rhs)
Post-multiplies the current matrix by a given parameter
|
void |
rotate(float rot)
Modifies the upper 2x2 of the current matrix by
post-multiplying it with a rotation matrix of given angle
|
void |
rotate(float rot,
float x,
float y,
float z)
Modifies the current matrix by post-multiplying it with a
rotation matrix of certain angle about a given axis
|
void |
scale(float x,
float y)
Modifies the upper 2x2 of the current matrix by
post-multiplying it with a scale matrix of given dimensions
|
void |
scale(float x,
float y,
float z)
Modifies the current matrix by post-multiplying it with a
scale matrix of given dimensions
|
void |
set(int x,
int y,
float v)
Sets the value for a given row and column
|
void |
translate(float x,
float y)
Modifies the current matrix by post-multiplying it with a
translation matrix of given dimensions
|
void |
transpose()
Sets the current matrix to its transpose
|
public Matrix3f()
public Matrix3f(float[] dataArray)
dataArray
- values to set the matrix to, must be 9
floats longpublic float[] getArray()
public float get(int x, int y)
x
- column of the value to returny
- row of the value to returnpublic void set(int x, int y, float v)
x
- column of the value to sety
- row of the value to setpublic void loadIdentity()
public void load(Matrix3f src)
src
- matrix to load the values frompublic void loadRotate(float rot, float x, float y, float z)
rot
- angle of rotationx
- rotation axis xy
- rotation axis yz
- rotation axis zpublic void loadRotate(float rot)
rot
- rotation anglepublic void loadScale(float x, float y)
x
- scale component xy
- scale component ypublic void loadScale(float x, float y, float z)
x
- scale component xy
- scale component yz
- scale component zpublic void loadTranslate(float x, float y)
x
- translation component xy
- translation component ypublic void loadMultiply(Matrix3f lhs, Matrix3f rhs)
lhs
- left hand side matrixrhs
- right hand side matrixpublic void multiply(Matrix3f rhs)
rhs
- right hand side to multiply bypublic void rotate(float rot, float x, float y, float z)
rot
- angle of rotationx
- rotation axis xy
- rotation axis yz
- rotation axis zpublic void rotate(float rot)
rot
- angle of rotationpublic void scale(float x, float y)
x
- scale component xy
- scale component ypublic void scale(float x, float y, float z)
x
- scale component xy
- scale component yz
- scale component zpublic void translate(float x, float y)
x
- translation component xy
- translation component ypublic void transpose()