public class GLMatrix
extends java.lang.Object
| Constructor and Description |
|---|
GLMatrix() |
| Modifier and Type | Method and Description |
|---|---|
void |
addDepthOffset(int delta)
add some offset (similar to glDepthOffset)
|
void |
copy(GLMatrix mat)
Copy values from mat
|
void |
finalize()
Free native object
|
static void |
frustumM(float[] m,
int offset,
float left,
float right,
float bottom,
float top,
float near,
float far)
Define a projection matrix in terms of six clip planes
|
void |
get(float[] m)
Get the Matrix as float array
|
static boolean |
invertM(float[] mInv,
int mInvOffset,
float[] m,
int mOffset)
Inverts a 4 x 4 matrix.
|
void |
multiplyLhs(GLMatrix lhs)
Use this matrix as rhs, multiply it on lhs and store result.
|
void |
multiplyMM(GLMatrix lhs,
GLMatrix rhs)
Multiply rhs onto lhs and store result in Matrix.
|
void |
multiplyRhs(GLMatrix rhs)
Multiply rhs onto Matrix.
|
void |
prj(float[] vec3)
Project Vector with Matrix
|
void |
prj2D(float[] src,
int src_offset,
float[] dst,
int dst_offset,
int length)
Project Vectors with Matrix
|
void |
prj2D(float[] vec2,
int offset,
int length)
Project Vectors with Matrix
|
void |
prj3D(float[] vec3,
int offset,
int length)
Project Vectors with Matrix
|
void |
set(float[] m)
Set the Matrix from float array
|
void |
setAsUniform(int location)
Set Matrix with glUniformMatrix
|
void |
setIdentity()
Set identity matrix
|
void |
setRotation(float a,
float x,
float y,
float z)
Set rotation
|
void |
setScale(float x,
float y,
float z)
Set scale factor
|
void |
setTranslation(float x,
float y,
float z)
Set translation
|
void |
setTransScale(float tx,
float ty,
float scale)
Set translation and x,y scale
|
void |
setValue(int pos,
float value)
Set single value
|
void |
transposeM(GLMatrix mat)
Transpose mat and store result in Matrix
|
public void set(float[] m)
m - float array to copypublic void get(float[] m)
m - float array to store Matrixpublic void copy(GLMatrix mat)
mat - Matrix to copypublic void prj(float[] vec3)
vec3 - Vector to projectpublic void prj3D(float[] vec3,
int offset,
int length)
vec3 - Vector to projectpublic void prj2D(float[] vec2,
int offset,
int length)
vec2 - Vector to projectpublic void prj2D(float[] src,
int src_offset,
float[] dst,
int dst_offset,
int length)
vec2 - Vector to projectpublic void multiplyRhs(GLMatrix rhs)
rhs - right hand sidepublic void multiplyLhs(GLMatrix lhs)
lhs - right hand sidepublic void multiplyMM(GLMatrix lhs, GLMatrix rhs)
lhs - left hand siderhs - right hand sidepublic void transposeM(GLMatrix mat)
mat - to transposepublic void setRotation(float a,
float x,
float y,
float z)
a - angle in degreex - around x-axisy - around y-axisz - around z-axispublic void setTranslation(float x,
float y,
float z)
x - along x-axisy - along y-axisz - along z-axispublic void setScale(float x,
float y,
float z)
x - axisy - axisz - axispublic void setTransScale(float tx,
float ty,
float scale)
tx - translate xty - translate yscale - factor x,ypublic void setAsUniform(int location)
location - GL location idpublic void setValue(int pos,
float value)
pos - at positionvalue - value to setpublic void addDepthOffset(int delta)
delta - offsetpublic void setIdentity()
public void finalize()
finalize in class java.lang.Objectpublic static void frustumM(float[] m,
int offset,
float left,
float right,
float bottom,
float top,
float near,
float far)
m - the float array that holds the perspective matrixoffset - the offset into float array m where the perspective
matrix data is writtenpublic static boolean invertM(float[] mInv,
int mInvOffset,
float[] m,
int mOffset)
mInv - the array that holds the output inverted matrixmInvOffset - an offset into mInv where the inverted matrix is
stored.m - the input arraymOffset - an offset into m where the matrix is stored.