public class Matrix2f extends Object
Constructor and Description |
---|
Matrix2f()
Creates a new identity 2x2 matrix
|
Matrix2f(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(Matrix2f src)
Sets the values of the matrix to those of the parameter
|
void |
loadIdentity()
Sets the matrix values to identity
|
void |
loadMultiply(Matrix2f lhs,
Matrix2f rhs)
Sets current values to be the result of multiplying two given
matrices
|
void |
loadRotate(float rot)
Sets current values to be a rotation matrix of given angle
|
void |
loadScale(float x,
float y)
Sets current values to be a scale matrix of given dimensions
|
void |
multiply(Matrix2f rhs)
Post-multiplies the current matrix by a given parameter
|
void |
rotate(float rot)
Modifies the current matrix by post-multiplying it with a
rotation matrix of given angle
|
void |
scale(float x,
float y)
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 |
transpose()
Sets the current matrix to its transpose
|
public Matrix2f()
public Matrix2f(float[] dataArray)
dataArray
- values to set the matrix to, must be 4
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(Matrix2f src)
src
- matrix to load the values frompublic void loadRotate(float rot)
rot
- rotation anglepublic void loadScale(float x, float y)
x
- scale component xy
- scale component ypublic void loadMultiply(Matrix2f lhs, Matrix2f rhs)
lhs
- left hand side matrixrhs
- right hand side matrixpublic void multiply(Matrix2f rhs)
rhs
- right hand side to multiply bypublic void rotate(float rot)
rot
- angle of rotationpublic void scale(float x, float y)
x
- scale component xy
- scale component ypublic void transpose()