Top Description Fields Constructors Methods
org.lwjgl.util.vector

public Class Matrix2f

extends Matrix
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.io.Serializable, java.nio.FloatBuffer

Holds a 2x2 matrix
Author
cix_foo
Version
$Revision$ $Id$

Field Summary

Modifier and TypeField and Description
public float
public float
public float
public float
private static final long

Constructor Summary

AccessConstructor and Description
public
Matrix2f()

Constructor for Matrix2f.

public
Matrix2f(Matrix2f src)

Constructor

Method Summary

Modifier and TypeMethod and Description
public static Matrix2f

Returns:

the destination matrix
add
(Matrix2f
The left source matrix
left
,
Matrix2f
The right source matrix
right
,
Matrix2f
The destination matrix, or null if a new one is to be created
dest
)

Add two matrices together and place the result in a third matrix.

public float
public Matrix

Returns:

this if successful, null otherwise
invert
()

Implements abstract org.lwjgl.util.vector.Matrix.invert.

Invert this matrix
public static Matrix2f

Returns:

The inverted matrix, or null if source can't be reverted.
invert
(Matrix2f
The source matrix to be inverted
src
,
Matrix2f
The destination matrix or null if a new matrix is to be created
dest
)

Invert the source matrix and place the result in the destination matrix.

public Matrix2f

Returns:

this
load
(Matrix2f
The source matrix
src
)

Load from another matrix

public static Matrix2f

Returns:

The copied matrix
load
(Matrix2f
The source matrix
src
,
Matrix2f
The destination matrix, or null if a new one should be created.
dest
)

Copy the source matrix to the destination matrix.

public Matrix

Returns:

this
load
(FloatBuffer
A float buffer to read from
buf
)

Implements abstract org.lwjgl.util.vector.Matrix.load.

Load from a float buffer.
public Matrix

Returns:

this
loadTranspose
(FloatBuffer
A float buffer to read from
buf
)

Implements abstract org.lwjgl.util.vector.Matrix.loadTranspose.

Load from a float buffer.
public static Matrix2f

Returns:

the destination matrix
mul
(Matrix2f
The left source matrix
left
,
Matrix2f
The right source matrix
right
,
Matrix2f
The destination matrix, or null if a new one is to be created
dest
)

Multiply the right matrix by the left and place the result in a third matrix.

public Matrix

Returns:

this
negate
()

Implements abstract org.lwjgl.util.vector.Matrix.negate.

Negate this matrix
public Matrix2f

Returns:

the negated matrix
negate
(Matrix2f
The destination matrix, or null if a new matrix is to be created
dest
)

Negate this matrix and stash the result in another matrix.

public static Matrix2f

Returns:

the negated matrix
negate
(Matrix2f
The source matrix to be negated
src
,
Matrix2f
The destination matrix, or null if a new matrix is to be created
dest
)

Negate the source matrix and stash the result in the destination matrix.

public Matrix

Returns:

this
setIdentity
()

Implements abstract org.lwjgl.util.vector.Matrix.setIdentity.

Set this matrix to be the identity matrix.
public static Matrix2f

Returns:

The source matrix
setIdentity
(Matrix2f
The matrix to set to the identity.
src
)

Set the source matrix to be the identity matrix.

public Matrix

Returns:

this
setZero
()

Implements abstract org.lwjgl.util.vector.Matrix.setZero.

Set this matrix to 0.
public static Matrix2f
public Matrix
store(FloatBuffer
The buffer to store this matrix in
buf
)

Implements abstract org.lwjgl.util.vector.Matrix.store.

Store this matrix in a float buffer.
public Matrix
storeTranspose(FloatBuffer
The buffer to store this matrix in
buf
)

Implements abstract org.lwjgl.util.vector.Matrix.storeTranspose.

Store this matrix in a float buffer.
public static Matrix2f

Returns:

the destination matrix
sub
(Matrix2f
The left source matrix
left
,
Matrix2f
The right source matrix
right
,
Matrix2f
The destination matrix, or null if a new one is to be created
dest
)

Subtract the right matrix from the left and place the result in a third matrix.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of this matrix
public static Vector2f

Returns:

the destination vector
transform
(Matrix2f
The left matrix
left
,
Vector2f
The right vector
right
,
Vector2f
The destination vector, or null if a new one is to be created
dest
)

Transform a Vector by a matrix and return the result in a destination vector.

public Matrix

Returns:

this
transpose
()

Implements abstract org.lwjgl.util.vector.Matrix.transpose.

Transpose this matrix
public Matrix2f

Returns:

the transposed matrix
transpose
(Matrix2f
The destination matrix or null if a new matrix is to be created
dest
)

Transpose this matrix and place the result in another matrix.

public static Matrix2f

Returns:

the transposed matrix
transpose
(Matrix2f
The source matrix or null if a new matrix is to be created
src
,
Matrix2f
The destination matrix or null if a new matrix is to be created
dest
)

Transpose the source matrix and place the result in the destination matrix.

Field Detail

m00back to summary
public float m00
m01back to summary
public float m01
m10back to summary
public float m10
m11back to summary
public float m11
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

Matrix2fback to summary
public Matrix2f()

Constructor for Matrix2f. The matrix is initialised to the identity.

Matrix2fback to summary
public Matrix2f(Matrix2f src)

Constructor

Method Detail

addback to summary
public static Matrix2f add(Matrix2f left, Matrix2f right, Matrix2f dest)

Add two matrices together and place the result in a third matrix.

Parameters
left:Matrix2f

The left source matrix

right:Matrix2f

The right source matrix

dest:Matrix2f

The destination matrix, or null if a new one is to be created

Returns:Matrix2f

the destination matrix

determinantback to summary
public float determinant()

Implements abstract org.lwjgl.util.vector.Matrix.determinant.

Returns:float

Doc from org.lwjgl.util.vector.Matrix.determinant.

the determinant of the matrix

invertback to summary
public Matrix invert()

Implements abstract org.lwjgl.util.vector.Matrix.invert.

Invert this matrix

Returns:Matrix

this if successful, null otherwise

invertback to summary
public static Matrix2f invert(Matrix2f src, Matrix2f dest)

Invert the source matrix and place the result in the destination matrix.

Parameters
src:Matrix2f

The source matrix to be inverted

dest:Matrix2f

The destination matrix or null if a new matrix is to be created

Returns:Matrix2f

The inverted matrix, or null if source can't be reverted.

loadback to summary
public Matrix2f load(Matrix2f src)

Load from another matrix

Parameters
src:Matrix2f

The source matrix

Returns:Matrix2f

this

loadback to summary
public static Matrix2f load(Matrix2f src, Matrix2f dest)

Copy the source matrix to the destination matrix.

Parameters
src:Matrix2f

The source matrix

dest:Matrix2f

The destination matrix, or null if a new one should be created.

Returns:Matrix2f

The copied matrix

loadback to summary
public Matrix load(FloatBuffer buf)

Implements abstract org.lwjgl.util.vector.Matrix.load.

Load from a float buffer. The buffer stores the matrix in column major (OpenGL) order.

Parameters
buf:FloatBuffer

A float buffer to read from

Returns:Matrix

this

loadTransposeback to summary
public Matrix loadTranspose(FloatBuffer buf)

Implements abstract org.lwjgl.util.vector.Matrix.loadTranspose.

Load from a float buffer. The buffer stores the matrix in row major (mathematical) order.

Parameters
buf:FloatBuffer

A float buffer to read from

Returns:Matrix

this

mulback to summary
public static Matrix2f mul(Matrix2f left, Matrix2f right, Matrix2f dest)

Multiply the right matrix by the left and place the result in a third matrix.

Parameters
left:Matrix2f

The left source matrix

right:Matrix2f

The right source matrix

dest:Matrix2f

The destination matrix, or null if a new one is to be created

Returns:Matrix2f

the destination matrix

negateback to summary
public Matrix negate()

Implements abstract org.lwjgl.util.vector.Matrix.negate.

Negate this matrix

Returns:Matrix

this

negateback to summary
public Matrix2f negate(Matrix2f dest)

Negate this matrix and stash the result in another matrix.

Parameters
dest:Matrix2f

The destination matrix, or null if a new matrix is to be created

Returns:Matrix2f

the negated matrix

negateback to summary
public static Matrix2f negate(Matrix2f src, Matrix2f dest)

Negate the source matrix and stash the result in the destination matrix.

Parameters
src:Matrix2f

The source matrix to be negated

dest:Matrix2f

The destination matrix, or null if a new matrix is to be created

Returns:Matrix2f

the negated matrix

setIdentityback to summary
public Matrix setIdentity()

Implements abstract org.lwjgl.util.vector.Matrix.setIdentity.

Set this matrix to be the identity matrix.

Returns:Matrix

this

setIdentityback to summary
public static Matrix2f setIdentity(Matrix2f src)

Set the source matrix to be the identity matrix.

Parameters
src:Matrix2f

The matrix to set to the identity.

Returns:Matrix2f

The source matrix

setZeroback to summary
public Matrix setZero()

Implements abstract org.lwjgl.util.vector.Matrix.setZero.

Set this matrix to 0.

Returns:Matrix

this

setZeroback to summary
public static Matrix2f setZero(Matrix2f src)
storeback to summary
public Matrix store(FloatBuffer buf)

Implements abstract org.lwjgl.util.vector.Matrix.store.

Store this matrix in a float buffer. The matrix is stored in column major (openGL) order.

Parameters
buf:FloatBuffer

The buffer to store this matrix in

Returns:Matrix

Doc from org.lwjgl.util.vector.Matrix.store.

this

storeTransposeback to summary
public Matrix storeTranspose(FloatBuffer buf)

Implements abstract org.lwjgl.util.vector.Matrix.storeTranspose.

Store this matrix in a float buffer. The matrix is stored in row major (maths) order.

Parameters
buf:FloatBuffer

The buffer to store this matrix in

Returns:Matrix

Doc from org.lwjgl.util.vector.Matrix.storeTranspose.

this

subback to summary
public static Matrix2f sub(Matrix2f left, Matrix2f right, Matrix2f dest)

Subtract the right matrix from the left and place the result in a third matrix.

Parameters
left:Matrix2f

The left source matrix

right:Matrix2f

The right source matrix

dest:Matrix2f

The destination matrix, or null if a new one is to be created

Returns:Matrix2f

the destination matrix

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a string representation of this matrix

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object

transformback to summary
public static Vector2f transform(Matrix2f left, Vector2f right, Vector2f dest)

Transform a Vector by a matrix and return the result in a destination vector.

Parameters
left:Matrix2f

The left matrix

right:Vector2f

The right vector

dest:Vector2f

The destination vector, or null if a new one is to be created

Returns:Vector2f

the destination vector

transposeback to summary
public Matrix transpose()

Implements abstract org.lwjgl.util.vector.Matrix.transpose.

Transpose this matrix

Returns:Matrix

this

transposeback to summary
public Matrix2f transpose(Matrix2f dest)

Transpose this matrix and place the result in another matrix.

Parameters
dest:Matrix2f

The destination matrix or null if a new matrix is to be created

Returns:Matrix2f

the transposed matrix

transposeback to summary
public static Matrix2f transpose(Matrix2f src, Matrix2f dest)

Transpose the source matrix and place the result in the destination matrix.

Parameters
src:Matrix2f

The source matrix or null if a new matrix is to be created

dest:Matrix2f

The destination matrix or null if a new matrix is to be created

Returns:Matrix2f

the transposed matrix