|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.math.Matrix4f
public class Matrix4f
Defines a 4 x 4 floating point matrix representing a 3D transformation.
Vectors are treated as columns, resulting in a matrix that is represented as follows, where x, y and z are the translation components of the matrix:
1 0 0 x 0 1 0 y 0 0 1 z 0 0 0 1
This matrix class is directly compatible with OpenGL since its elements are laid out in memory exactly as they are expected by OpenGL. The matrix uses column-major format such that array indices increase down column first.
Since matrix multiplication is not commutative, multiplication must be done
in the correct order when combining transformations. Suppose we have a translation
matrix T and a rotation matrix R. To first rotate an object around
the origin and then translate it, you would multiply the two matrices as TR.
Likewise, to first translate the object and then rotate it you would do RT.
So generally, matrices must be multiplied in the reverse order in which you want
the transformations to take place (this also applies to the scale, rotate,
and translate
methods below; these methods are convenience methods for
post-multiplying by a matrix representing a scale, rotation, or translation).
Passing a matrix to OpenGL is a simple and efficient operation since the underlying array for the matrix is stored in a format that is directly compatible with OpenGL.
// Create a matrix to translate by (10, 2, -20)
Matrix4f translation =new
Matrix4f(); translation.set(1, 0, 0, 10, 0, 1, 0, 2, 0, 0, 1, -20, 0, 0, 0, 1 );// Pass our matrix to OpenGL
gl.glLoadMatrixf(translation.getArray());
Note: In the case of repeated local transformations (i.e. rotate around the Z-axis by 0.76 radians,
then translate by 2.1 along the X-axis, then ...), it is better to use Transform3D
(which is optimized for that kind of usage).
Transform3D
Constructor Summary | ||
---|---|---|
Matrix4f()
Constructs a matrix initialized to the identity matrix. |
||
Matrix4f(float m00,
float m01,
float m02,
float m03,
float m10,
float m11,
float m12,
float m13,
float m20,
float m21,
float m22,
float m23,
float m30,
float m31,
float m32,
float m33)
Constructs a matrix initialized to the specified values. |
||
Matrix4f(float[] m)
Constructs a matrix initialized to the specified column-major array. |
||
Matrix4f(float[] m,
int offset)
Constructs a matrix initialized to the specified column-major array. |
||
Matrix4f(Matrix4f m)
Constructs a new matrix by copying the values from the specified matrix. |
Method Summary | ||
---|---|---|
void |
add(float scalar)
Adds a scalar value to each component of this matrix. |
|
void |
add(float scalar,
Matrix4f dst)
Adds a scalar value to this matrix and stores the result in dst. |
|
void |
add(Matrix4f m)
Adds the specified matrix to this matrix. |
|
static void |
add(Matrix4f m1,
Matrix4f m2,
Matrix4f dst)
Adds the specified matrices and stores the result in dst . |
|
static void |
createBillboard(Vector3f object,
Vector3f cameraPos,
Vector3f cameraUpVector,
Vector3f cameraForwardVector,
Matrix4f dst)
Creates a spherical billboard that rotates around a specified object position. |
|
static void |
createLookAt(float eyeX,
float eyeY,
float eyeZ,
float centerX,
float centerY,
float centerZ,
float upX,
float upY,
float upZ,
float[] dst)
Creates a view matrix based on the specified input parameters. |
|
static void |
createLookAt(Vector3f cameraPos,
Vector3f cameraTarget,
Vector3f cameraUpVector,
Matrix4f dst)
Creates a view matrix based on the specified input parameters. |
|
static void |
createOrthographic(float left,
float right,
float bottom,
float top,
float near,
float far,
Matrix4f dst)
Creates an orthographic projection matrix. |
|
static void |
createPerspective(float fovy,
float aspect,
float zNear,
float zFar,
Matrix4f dst)
Creates a perspective projection matrix. |
|
static void |
createReflection(Plane plane,
Matrix4f dst)
Creates a matrix that reflects the coordinate system about a plane. |
|
static void |
createRotation(Quaternion4f quat,
Matrix4f dst)
Creates a rotation matrix from the specified quaternion. |
|
static void |
createRotation(Vector3f axis,
float angle,
Matrix4f dst)
Creates a rotation matrix from the specified axis and angle. |
|
static void |
createRotationX(float angle,
Matrix4f dst)
Creates a matrix describing a rotation around the x-axis. |
|
static void |
createRotationY(float angle,
Matrix4f dst)
Creates a matrix describing a rotation around the y-axis. |
|
static void |
createRotationZ(float angle,
Matrix4f dst)
Creates a matrix describing a rotation around the z-axis. |
|
static void |
createScale(float xScale,
float yScale,
float zScale,
Matrix4f dst)
Creates a scale matrix. |
|
static void |
createTranslation(float xTrans,
float yTrans,
float zTrans,
Matrix4f dst)
Creates a translation matrix. |
|
boolean |
decompose(Vector3f scale,
Quaternion4f rotation,
Vector3f translation)
Decomposes the scale, rotation and translation components of this matrix. |
|
float |
determinant()
Computes the determinant of this matrix. |
|
boolean |
equals(Object obj)
Determines if this matrix is equal to the specified object. |
|
boolean |
equals(Matrix4f m)
Determines if this matrix is equal to the specified one. |
|
void |
get(float[] m)
Copies the values of this matrix into the given array in column-major order. |
|
float |
get(int index)
Gets the matrix element at the specified position. |
|
float |
get(int row,
int column)
Gets the matrix element at the specified row and column. |
|
float[] |
getArray()
Returns the underlying array for this matrix in column-major order. |
|
void |
getColumn(int column,
float[] v)
Gets the four elements of the specified column into v . |
|
void |
getColumn(int column,
Vector3f v)
Gets the first three elements of the specified column into v . |
|
boolean |
getRotation(Quaternion4f rotation)
Gets the rotational component of this matrix in the specified quaternion. |
|
void |
getRow(int row,
float[] v)
Gets the four elements of the specified row into v . |
|
void |
getRow(int row,
Vector3f v)
Gets the first three elements of the specified row into v . |
|
void |
getScale(Vector3f scale)
Gets the scalar component of this matrix in the specified vector. |
|
void |
getTranslation(Vector3f translation)
Gets the translational component of this matrix in the specified vector. |
|
int |
hashCode()
Returns the hash code of the matrix, based on the values stored in it. |
|
boolean |
invert()
Inverts this matrix. |
|
boolean |
invert(Matrix4f dst)
Inverts this matrix and stores the result in dst. |
|
boolean |
isIdentity()
Determines if this matrix is equal to the identity matrix. |
|
void |
multiply(float scalar)
Multiplies the components of this matrix by the specified scalar. |
|
void |
multiply(float scalar,
Matrix4f dst)
Multiplies the components of this matrix by a scalar and stores the result in dst. |
|
void |
multiply(Matrix4f m)
Multiplies this matrix by the specified one. |
|
static void |
multiply(Matrix4f m1,
Matrix4f m2,
Matrix4f dst)
Multiplies m1 by m2 and stores the result in dst. |
|
void |
negate()
Negates this matrix. |
|
void |
negate(Matrix4f dst)
Gets the negate of this matrix in dst. |
|
void |
rotate(Quaternion4f q)
Post-multiplies this matrix by the matrix corresponding to the specified quaternion rotation. |
|
void |
rotate(Quaternion4f q,
Matrix4f dst)
Post-multiplies this matrix by the matrix corresponding to the specified quaternion rotation and stores the result in dst . |
|
void |
rotate(Vector3f axis,
float angle)
Post-multiplies this matrix by the matrix corresponding to the specified rotation about the specified axis. |
|
void |
rotate(Vector3f axis,
float angle,
Matrix4f dst)
Post-multiplies this matrix by the matrix corresponding to the specified rotation about the specified axis and stores the result in dst . |
|
void |
rotateX(float angle)
Post-multiplies this matrix by the matrix corresponding to the specified rotation around the x-axis. |
|
void |
rotateX(float angle,
Matrix4f dst)
Post-multiplies this matrix by the matrix corresponding to the specified rotation around the x-axis and stores the result in dst . |
|
void |
rotateY(float angle)
Post-multiplies this matrix by the matrix corresponding to the specified rotation around the y-axis. |
|
void |
rotateY(float angle,
Matrix4f dst)
Post-multiplies this matrix by the matrix corresponding to the specified rotation around the y-axis and stores the result in dst . |
|
void |
rotateZ(float angle)
Post-multiplies this matrix by the matrix corresponding to the specified rotation around the z-axis. |
|
void |
rotateZ(float angle,
Matrix4f dst)
Post-multiplies this matrix by the matrix corresponding to the specified rotation around the z-axis and stores the result in dst . |
|
void |
scale(float value)
Post-multiplies this matrix by the matrix corresponding to the specified scale transformation. |
|
void |
scale(float xScale,
float yScale,
float zScale)
Post-multiplies this matrix by the matrix corresponding to the specified scale transformation. |
|
void |
scale(float xScale,
float yScale,
float zScale,
Matrix4f dst)
Post-multiplies this matrix by the matrix corresponding to the specified scale transformation and stores the result in dst . |
|
void |
scale(float value,
Matrix4f dst)
Post-multiplies this matrix by the matrix corresponding to the specified scale transformation and stores the result in dst . |
|
void |
set(float m00,
float m01,
float m02,
float m03,
float m10,
float m11,
float m12,
float m13,
float m20,
float m21,
float m22,
float m23,
float m30,
float m31,
float m32,
float m33)
Sets the values of this matrix. |
|
void |
set(float[] m)
Sets the values of this matrix to those in the specified column-major array. |
|
void |
set(float[] m,
int offset)
Sets the values of this matrix to those in the specified column-major array. |
|
void |
set(int index,
float value)
Sets the specified element of this matrix to the specified value. |
|
void |
set(int row,
int column,
float value)
Sets the specified element of this matrix to the specified value. |
|
void |
set(Matrix4f m)
Sets the values of this matrix to those of the specified matrix. |
|
void |
setIdentity()
Sets this matrix to the identity matrix. |
|
void |
setZero()
Sets all elements of the current matrix to zero. |
|
void |
subtract(Matrix4f m)
Subtracts the specified matrix from the current matrix. |
|
static void |
subtract(Matrix4f m1,
Matrix4f m2,
Matrix4f dst)
Subtracts the specified matrices and stores the result in dst . |
|
String |
toString()
Returns a string representation of this matrix. |
|
void |
transformNormal(Vector3f normal)
Transforms the specified normal vector by this matrix by treating the fourth (w) coordinate as zero. |
|
void |
transformNormal(Vector3f normal,
Vector3f dst)
Transforms the specified normal vector by this matrix by treating the fourth (w) coordinate as zero, and stores the result in dst . |
|
void |
transformPoint(Vector3f point)
Transforms the specified point by this matrix. |
|
void |
transformPoint(Vector3f point,
Vector3f dst)
Transforms the specified point by this matrix, and stores the result in dst . |
|
void |
transformVector(Vector3f vector)
Transforms the specified vector by this matrix. |
|
void |
transformVector(Vector3f vector,
Vector3f dst)
Transforms the specified vector by this matrix, and stores the result in dst . |
|
void |
translate(float x,
float y,
float z)
Post-multiplies this matrix by the matrix corresponding to the specified translation. |
|
void |
translate(float x,
float y,
float z,
Matrix4f dst)
Post-multiplies this matrix by the matrix corresponding to the specified translation and stores the result in dst . |
|
void |
transpose()
Transposes this matrix. |
|
void |
transpose(Matrix4f dst)
Gets the transpose of this matrix in dst . |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Matrix4f()
public Matrix4f(float[] m)
The passed in array is in column-major order, so the memory layout of the array is as follows:
0 4 8 12 1 5 9 13 2 6 10 14 3 7 11 15
m
- a 16-element array, stored in column-major order
IllegalArgumentException
- If m.length is less than 16.
NullPointerException
- If m
is null
.- Since:
- BlackBerry API 5.0.0
public Matrix4f(float[] m, int offset)
The passed in array is in column-major order, so the memory layout of the array is as follows:
0 4 8 12 1 5 9 13 2 6 10 14 3 7 11 15
m
- An array containing 16 elements in column-major order.offset
- The offset into the array to begin reading at.
IllegalArgumentException
- If offset
is less than zero or
offset + 15
is greater than or equal to m.length
.
NullPointerException
- If m
is null
.public Matrix4f(float m00, float m01, float m02, float m03, float m10, float m11, float m12, float m13, float m20, float m21, float m22, float m23, float m30, float m31, float m32, float m33)
m00
- the first element of the first rowm01
- the second element of the first rowm02
- the third element of the first rowm03
- the fourth element of the first rowm10
- the first element of the second rowm11
- the second element of the second rowm12
- the third element of the second rowm13
- the fourth element of the second rowm20
- the first element of the third rowm21
- the second element of the third rowm22
- the third element of the third rowm23
- the fourth element of the third rowm30
- the first element of the fourth rowm31
- the second element of the fourth rowm32
- the third element of the fourth rowm33
- the fourth element of the fourth rowpublic Matrix4f(Matrix4f m)
m
- the source matrix
NullPointerException
- If m
is null
.Method Detail |
---|
public final void add(float scalar)
scalar
- the scalar to addpublic final void add(float scalar, Matrix4f dst)
scalar
- the scalar value to adddst
- a matrix to store the result in
NullPointerException
- If dst
is null
.public final void add(Matrix4f m)
m
- the matrix to add
NullPointerException
- If m
is null
.public static void add(Matrix4f m1, Matrix4f m2, Matrix4f dst)
dst
.
m1
- the first matrixm2
- the second matrixdst
- a matrix to store the result in
NullPointerException
- If m1
, m2
, or dst
is null
.public final boolean decompose(Vector3f scale, Quaternion4f rotation, Vector3f translation)
scale
- a vector to store the decomposed scale values inrotation
- a quaternion to store the decomposed rotation intranslation
- a vector to store the decomposed translation in
NullPointerException
- If scale
, rotation
, or translation
is null
.public final float determinant()
public final void get(float[] m)
m
- a 16-element array to populate with the values from this matrix
IllegalArgumentException
- If m.length
is less than 16.
NullPointerException
- If m
is null
.public final float get(int index)
This method indexes the internal array in column-major order. See the description of this class for more information on this topic.
index
- the zero-based index of the element to retrieve
IllegalArgumentException
- If index
is less than zero or greater than 15.public final float get(int row, int column)
row
- the zero-based row of the element to retrievecolumn
- the zero-based column of the element to retrieve
IllegalArgumentException
- If row
or column
is less than zero or greater than 3.public final float[] getArray()
The returned array is in column-major order and therefore compatible with systems such as OpenGL that expect data in this order. The memory layout of the array is therefore as follows:
0 4 8 12 1 5 9 13 2 6 10 14 3 7 11 15
Note that modifying the elements of the returned array will modify the matrix itself.
public final void getColumn(int column, float[] v)
v
.
column
- the index of the column to retrieve (zero-based)v
- a four-element array to store the column in
IllegalArgumentException
- If column
is less than zero or greater than 3.
IllegalArgumentException
- If v.length
is less than 4.
NullPointerException
- If v
is null
.public final void getColumn(int column, Vector3f v)
v
.
column
- the index of the column to retrieve (zero-based)v
- a vector to store the column in
IllegalArgumentException
- If column
is less than zero or greater than 3.
NullPointerException
- If v
is null
.public final void getRow(int row, float[] v)
v
.
row
- the index of the row to retrieve (zero-based)v
- a four-element array to store the row in
IllegalArgumentException
- If row
is less than zero or greater than 3.
IllegalArgumentException
- If v.length
is less than 4.
NullPointerException
- If v
is null
.public final void getRow(int row, Vector3f v)
v
.
row
- the index of the row to retrieve (zero-based)v
- a vector to store the row in
IllegalArgumentException
- If row
is less than zero or greater than 3.
NullPointerException
- If v
is null
.public final void getScale(Vector3f scale)
Note: If the scalar component of this matrix has negative parts, it is not possible to always extract the exact scalar component; instead, a scale vector that is mathematically equivalent to the original scale vector is extracted and returned.
scale
- a vector to receive the scale
NullPointerException
- If scale
is null
.public final boolean getRotation(Quaternion4f rotation)
rotation
- a quaternion to receive the rotation
NullPointerException
- If rotation
is null
.public final void getTranslation(Vector3f translation)
translation
- a vector to receive the translation
NullPointerException
- If translation
is null
.public final boolean invert()
public final boolean invert(Matrix4f dst)
dst
- a matrix to store the invert of this matrix in
NullPointerException
- If dst
is null
.public final boolean isIdentity()
public final void multiply(float scalar)
scalar
- the scalar valuepublic final void multiply(float scalar, Matrix4f dst)
scalar
- the scalar valuedst
- a matrix to store the result in
NullPointerException
- If dst
is null
.public final void multiply(Matrix4f m)
m
- the matrix to multiply
NullPointerException
- If m
is null
.public static void multiply(Matrix4f m1, Matrix4f m2, Matrix4f dst)
m1
- the first matrix to multiplym2
- the second matrix to multiplydst
- a matrix to store the result in
NullPointerException
- If m1
, m2
, or dst
is null
.public final void negate()
public final void negate(Matrix4f dst)
dst
- a matrix to store the result in
NullPointerException
- If dst
is null
.public final void rotate(Quaternion4f q)
q
- the quaternion to rotate by
NullPointerException
- If q
is null
.public final void rotate(Quaternion4f q, Matrix4f dst)
dst
.
q
- the quaternion to rotate bydst
- a matrix to store the result in
NullPointerException
- If q
or dst
is null
.public final void rotate(Vector3f axis, float angle)
axis
- the axis to rotate aboutangle
- the angle, in radians
NullPointerException
- If axis
is null
.public final void rotate(Vector3f axis, float angle, Matrix4f dst)
dst
.
axis
- the axis to rotate aboutangle
- the angle, in radiansdst
- a matrix to store the result in
NullPointerException
- If axis
or dst
is null
.public final void rotateX(float angle)
angle
- the angle to rotate by, in radianspublic final void rotateX(float angle, Matrix4f dst)
dst
.
angle
- the angle to rotate by, in radiansdst
- a matrix to store the result in
NullPointerException
- If dst
is null
.public final void rotateY(float angle)
angle
- the angle to rotate by, in radianspublic final void rotateY(float angle, Matrix4f dst)
dst
.
angle
- the angle to rotate by, in radiansdst
- a matrix to store the result in
NullPointerException
- If dst
is null
.public final void rotateZ(float angle)
angle
- the angle to rotate by, in radianspublic final void rotateZ(float angle, Matrix4f dst)
dst
.
angle
- the angle to rotate by, in radiansdst
- a matrix to store the result in
NullPointerException
- If dst
is null
.public final void scale(float value)
value
- the amount to scale along all axespublic final void scale(float value, Matrix4f dst)
dst
.
value
- the amount to scale along all axesdst
- a matrix to store the result in
NullPointerException
- If dst
is null
.public final void scale(float xScale, float yScale, float zScale)
xScale
- the amount to scale along the x-axisyScale
- the amount to scale along the y-axiszScale
- the amount to scale along the z-axispublic final void scale(float xScale, float yScale, float zScale, Matrix4f dst)
dst
.
xScale
- the amount to scale along the x-axisyScale
- the amount to scale along the y-axiszScale
- the amount to scale along the z-axisdst
- a matrix to store the result in
NullPointerException
- If dst
is null
.public final void set(float[] m)
m
- a 16-element array, stored in column-major format
IllegalArgumentException
- If m.length is less than 16.
NullPointerException
- If m
is null
.- Since:
- BlackBerry API 5.0.0
public final void set(float[] m, int offset)
m
- An array containing 16 elements in column-major format.offset
- The offset into the array to begin reading at.
IllegalArgumentException
- If offset
is less than zero or
offset + 15
is greater than or equal to m.length
.
NullPointerException
- If m
is null
.public final void set(float m00, float m01, float m02, float m03, float m10, float m11, float m12, float m13, float m20, float m21, float m22, float m23, float m30, float m31, float m32, float m33)
m00
- the first element of the first rowm01
- the second element of the first rowm02
- the third element of the first rowm03
- the fourth element of the first rowm10
- the first element of the second rowm11
- the second element of the second rowm12
- the third element of the second rowm13
- the fourth element of the second rowm20
- the first element of the third rowm21
- the second element of the third rowm22
- the third element of the third rowm23
- the fourth element of the third rowm30
- the first element of the fourth rowm31
- the second element of the fourth rowm32
- the third element of the fourth rowm33
- the fourth element of the fourth rowpublic final void set(Matrix4f m)
m
- the source matrix
NullPointerException
- If m
is null
.public final void set(int index, float value)
index
- the index of the element to set (0-15)value
- the value to set
IllegalArgumentException
- If index
is less than zero or greater than 15.public final void set(int row, int column, float value)
row
- the row of the element (0-3)column
- the column of the element (0-3)value
- the value to set
IllegalArgumentException
- If row
or column
is less than zero or greater than 3.public final void setIdentity()
public final void setZero()
public final void subtract(Matrix4f m)
m
- the matrix to subtract
NullPointerException
- If m
is null
.public static void subtract(Matrix4f m1, Matrix4f m2, Matrix4f dst)
dst
.
m1
- the first matrixm2
- the second matrixdst
- a matrix to store the result in
NullPointerException
- If m1
, m2
, or dst
is null
.public final void transformNormal(Vector3f normal)
The result of the transformation is stored directly into normal
.
normal
- the normal vector to transform
NullPointerException
- If normal
is null
.public final void transformNormal(Vector3f normal, Vector3f dst)
dst
.
normal
- the normal vector to transformdst
- a vector to store the transformed normal in
NullPointerException
- If normal
or dst
is null
.public final void transformPoint(Vector3f point)
The result of the transformation is stored directly into point
.
point
- the point to transform
NullPointerException
- If point
is null
.public final void transformPoint(Vector3f point, Vector3f dst)
dst
.
point
- the point to transformdst
- a point to store the transformed point in
NullPointerException
- If point
or dst
is null
.public final void transformVector(Vector3f vector)
The result of the transformation is stored directly into point
.
vector
- the vector to transform
NullPointerException
- If vector
is null
.public final void transformVector(Vector3f vector, Vector3f dst)
dst
.
vector
- the vector to transformdst
- a vector to store the transformed vector in
NullPointerException
- If vector
or dst
is null
.public final void translate(float x, float y, float z)
x
- amount to translate along the x-axisy
- amount to translate along the y-axisz
- amount to translate along the z-axispublic final void translate(float x, float y, float z, Matrix4f dst)
dst
.
x
- amount to translate along the x-axisy
- amount to translate along the y-axisz
- amount to translate along the z-axisdst
- a matrix to store the result in
NullPointerException
- If dst
is null
.public final void transpose()
public final void transpose(Matrix4f dst)
dst
.
dst
- a matrix to store the transpose in
NullPointerException
- If dst
is null
.public static void createBillboard(Vector3f object, Vector3f cameraPos, Vector3f cameraUpVector, Vector3f cameraForwardVector, Matrix4f dst)
object
- The position of the objectcameraPos
- The position of the cameracameraUpVector
- The vector describing the "up" direction of the cameracameraForwardVector
- The optional forward vector of the camera. May be null.dst
- A matrix to store the result in
NullPointerException
- If object
, cameraPos
, cameraUpVector
or dst
is null
.public static void createScale(float xScale, float yScale, float zScale, Matrix4f dst)
xScale
- the scale on the x-axisyScale
- the scale on the y-axiszScale
- the scale on the z-axisdst
- a matrix to store the result in
NullPointerException
- If dst
is null
.public static void createTranslation(float xTrans, float yTrans, float zTrans, Matrix4f dst)
xTrans
- the translation on the x-axisyTrans
- the translation on the y-axiszTrans
- the translation on the z-axisdst
- a matrix to store the result in
NullPointerException
- If dst
is null
.public static void createRotation(Quaternion4f quat, Matrix4f dst)
quat
- a quaternion describing a 3D orientationdst
- a matrix to store the result in
NullPointerException
- If dst
is null
.public static void createRotation(Vector3f axis, float angle, Matrix4f dst)
axis
- a vector describing the axis to rotate aboutangle
- the angle, in radiansdst
- a matrix to store the result in
NullPointerException
- If dst
is null
.public static void createRotationX(float angle, Matrix4f dst)
angle
- the angle of rotation, in radiansdst
- a matrix to store the result in
NullPointerException
- If dst
is null
.public static void createRotationY(float angle, Matrix4f dst)
angle
- the angle of rotation, in radiansdst
- a matrix to store the result in
NullPointerException
- If dst
is null
.public static void createRotationZ(float angle, Matrix4f dst)
angle
- the angle of rotation, in radiansdst
- a matrix to store the result in
NullPointerException
- If dst
is null
.public static void createLookAt(Vector3f cameraPos, Vector3f cameraTarget, Vector3f cameraUpVector, Matrix4f dst)
cameraPos
- the position of the cameracameraTarget
- the position of the target that the camera is pointing atcameraUpVector
- a vector describing the "up" direction of the cameradst
- a matrix to store the result in
NullPointerException
- If cameraPos
, cameraTarget
, cameraUpVector
, or dst
is null
.public static void createLookAt(float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ, float[] dst)
eyeX
- Eye X coordinateeyeY
- Eye Y coordinateeyeZ
- Eye Z coordinatecenterX
- Center X coordinatecenterY
- Center Y coordinatecenterZ
- Center Z coordinateupX
- Up vector X valueupY
- Up vector Y valueupZ
- Up vector Z valuedst
- A matrix to store the result in
NullPointerException
- If dst
is null
.public static void createOrthographic(float left, float right, float bottom, float top, float near, float far, Matrix4f dst)
left
- The coordinate for the left vertical clipping planeright
- The coordinate for the right vertical clipping planebottom
- The coordinate for the bottom horizontal clipping planetop
- The coordinate for the top horizontal clipping planenear
- The distance to the near clipping planefar
- The distance to the far clipping planedst
- A matrix to store the result in
NullPointerException
- If dst
is null
.public static void createPerspective(float fovy, float aspect, float zNear, float zFar, Matrix4f dst)
fovy
- Field of view angle in the y direction, in degreesaspect
- Aspect ratio that determines the field of view in the x direction (usually width/height)zNear
- Distance to the near clipping planezFar
- Distance to the far clipping planedst
- A matrix to store the result in
NullPointerException
- If dst
is null
.public static void createReflection(Plane plane, Matrix4f dst)
plane
- The plane to reflect aboutdst
- A matrix to store the result in
NullPointerException
- If plane
or dst
is null
.public boolean equals(Object obj)
equals
in class Object
obj
- the matrix to compare
NullPointerException
- If obj
is null
.Boolean.hashCode()
,
Hashtable
public boolean equals(Matrix4f m)
m
- the matrix to compare
NullPointerException
- If m
is null
.public int hashCode()
hashCode
in class Object
Object.equals(java.lang.Object)
,
Hashtable
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal