Package org.lwjgl.util.vector
Class Matrix2f
java.lang.Object
org.lwjgl.util.vector.Matrix
org.lwjgl.util.vector.Matrix2f
- All Implemented Interfaces:
Serializable
Holds a 2x2 matrix
- Version:
- $Revision$ $Id$
- Author:
- cix_foo invalid input: '<'cix_foo@users.sourceforge.net>
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Matrix2fAdd two matrices together and place the result in a third matrix.floatinvert()Invert this matrixstatic Matrix2fInvert the source matrix and place the result in the destination matrix.load(FloatBuffer buf) Load from a float buffer.Load from another matrixstatic Matrix2fCopy the source matrix to the destination matrix.loadTranspose(FloatBuffer buf) Load from a float buffer.static Matrix2fMultiply the right matrix by the left and place the result in a third matrix.negate()Negate this matrixNegate this matrix and stash the result in another matrix.static Matrix2fNegate the source matrix and stash the result in the destination matrix.Set this matrix to be the identity matrix.static Matrix2fsetIdentity(Matrix2f src) Set the source matrix to be the identity matrix.setZero()Set this matrix to 0.static Matrix2fstore(FloatBuffer buf) Store this matrix in a float buffer.Store this matrix in a float buffer.static Matrix2fSubtract the right matrix from the left and place the result in a third matrix.toString()Returns a string representation of this matrixstatic Vector2fTransform a Vector by a matrix and return the result in a destination vector.Transpose this matrixTranspose this matrix and place the result in another matrix.static Matrix2fTranspose the source matrix and place the result in the destination matrix.
-
Field Details
-
m00
public float m00 -
m01
public float m01 -
m10
public float m10 -
m11
public float m11
-
-
Constructor Details
-
Matrix2f
public Matrix2f()Constructor for Matrix2f. The matrix is initialised to the identity. -
Matrix2f
Constructor
-
-
Method Details
-
load
Load from another matrix- Parameters:
src- The source matrix- Returns:
- this
-
load
Copy the source matrix to the destination matrix.- Parameters:
src- The source matrixdest- The destination matrix, or null if a new one should be created.- Returns:
- The copied matrix
-
load
Load from a float buffer. The buffer stores the matrix in column major (OpenGL) order. -
loadTranspose
Load from a float buffer. The buffer stores the matrix in row major (mathematical) order.- Specified by:
loadTransposein classMatrix- Parameters:
buf- A float buffer to read from- Returns:
- this
-
store
Store this matrix in a float buffer. The matrix is stored in column major (openGL) order. -
storeTranspose
Store this matrix in a float buffer. The matrix is stored in row major (maths) order.- Specified by:
storeTransposein classMatrix- Parameters:
buf- The buffer to store this matrix in- Returns:
- this
-
add
Add two matrices together and place the result in a third matrix.- Parameters:
left- The left source matrixright- The right source matrixdest- The destination matrix, or null if a new one is to be created- Returns:
- the destination matrix
-
sub
Subtract the right matrix from the left and place the result in a third matrix.- Parameters:
left- The left source matrixright- The right source matrixdest- The destination matrix, or null if a new one is to be created- Returns:
- the destination matrix
-
mul
Multiply the right matrix by the left and place the result in a third matrix.- Parameters:
left- The left source matrixright- The right source matrixdest- The destination matrix, or null if a new one is to be created- Returns:
- the destination matrix
-
transform
Transform a Vector by a matrix and return the result in a destination vector.- Parameters:
left- The left matrixright- The right vectordest- The destination vector, or null if a new one is to be created- Returns:
- the destination vector
-
transpose
Transpose this matrix -
transpose
Transpose this matrix and place the result in another matrix.- Parameters:
dest- The destination matrix or null if a new matrix is to be created- Returns:
- the transposed matrix
-
transpose
Transpose the source matrix and place the result in the destination matrix.- Parameters:
src- The source matrix or null if a new matrix is to be createddest- The destination matrix or null if a new matrix is to be created- Returns:
- the transposed matrix
-
invert
Invert this matrix -
invert
Invert the source matrix and place the result in the destination matrix.- Parameters:
src- The source matrix to be inverteddest- The destination matrix or null if a new matrix is to be created- Returns:
- The inverted matrix, or null if source can't be reverted.
-
toString
Returns a string representation of this matrix -
negate
Negate this matrix -
negate
Negate this matrix and stash the result in another matrix.- Parameters:
dest- The destination matrix, or null if a new matrix is to be created- Returns:
- the negated matrix
-
negate
Negate the source matrix and stash the result in the destination matrix.- Parameters:
src- The source matrix to be negateddest- The destination matrix, or null if a new matrix is to be created- Returns:
- the negated matrix
-
setIdentity
Set this matrix to be the identity matrix.- Specified by:
setIdentityin classMatrix- Returns:
- this
-
setIdentity
Set the source matrix to be the identity matrix.- Parameters:
src- The matrix to set to the identity.- Returns:
- The source matrix
-
setZero
Set this matrix to 0. -
setZero
-
determinant
public float determinant()- Specified by:
determinantin classMatrix- Returns:
- the determinant of the matrix
-