public class Matrix4f
extends Object
| java.lang.Object | |
| android.renderscript.Matrix4f | |
用于将本机RenderScript rs_matrix4x4类型公开到Android系统的类。
Public constructors |
|
|---|---|
Matrix4f() 创建一个新的身份4x4矩阵 |
|
Matrix4f(float[] dataArray) 创建一个新的矩阵,并根据给定的参数设置它的值 |
|
公共方法(Public methods) |
|
|---|---|
float |
get(int x, int y) 返回给定行和列的值 |
float[] |
getArray() 返回表示矩阵值的内部数组的引用。 |
boolean |
inverse() 将当前矩阵设置为其逆 |
boolean |
inverseTranspose() 将当前矩阵设置为其逆转置 |
void |
load(Matrix4f src) 将矩阵的值设置为参数的值 |
void |
loadFrustum(float l, float r, float b, float t, float n, float f) 将当前值设置为透视投影矩阵 |
void |
loadIdentity() 将矩阵值设置为标识 |
void |
loadMultiply(Matrix4f lhs, Matrix4f rhs) 将当前值设置为乘以两个给定矩阵的结果 |
void |
loadOrtho(float l, float r, float b, float t, float n, float f) 将当前值设置为正交投影矩阵 |
void |
loadOrthoWindow(int w, int h) 将当前值设置为正投影矩阵,并将右和底部剪裁平面设置为给定值。 |
void |
loadPerspective(float fovy, float aspect, float near, float far) 将当前值设置为透视投影矩阵 |
void |
loadProjectionNormalized(int w, int h) Helper函数将当前值设置为一个透视投影矩阵,该矩阵的纵横比由参数和(near,far),(bottom,top)映射到z = 0时的(-1,1) |
void |
loadRotate(float rot, float x, float y, float z) 将当前值设置为关于给定轴的特定角度的旋转矩阵 |
void |
loadScale(float x, float y, float z) 将当前值设置为给定维度的比例矩阵 |
void |
loadTranslate(float x, float y, float z) 将当前值设置为给定尺寸的平移矩阵 |
void |
multiply(Matrix4f rhs) 将当前矩阵乘以给定参数 |
void |
rotate(float rot, float x, float y, float z) 通过将它与一个关于给定轴的特定角度的旋转矩阵进行后乘,来修改当前矩阵 |
void |
scale(float x, float y, float z) 通过将其与给定维度的比例矩阵进行后乘,修改当前矩阵 |
void |
set(int x, int y, float v) 设置给定行和列的值 |
void |
translate(float x, float y, float z) 通过与给定维度的平移矩阵进行后乘,修改当前矩阵 |
void |
transpose() 将当前矩阵设置为其转置 |
继承方法(Inherited methods) |
|
|---|---|
java.lang.Object
|
|
Matrix4f (float[] dataArray)
创建一个新的矩阵,并根据给定的参数设置它的值
| 参数(Parameters) | |
|---|---|
dataArray |
float: values to set the matrix to, must be 16 floats long |
float get (int x,
int y)
返回给定行和列的值
| 参数(Parameters) | |
|---|---|
x |
int: column of the value to return |
y |
int: row of the value to return |
| 返回(Returns) | |
|---|---|
float |
value in the yth row and xth column |
float[] getArray ()
返回表示矩阵值的内部数组的引用。 修改这个数组也会改变矩阵
| 返回(Returns) | |
|---|---|
float[] |
internal array representing the matrix |
void load (Matrix4f src)
将矩阵的值设置为参数的值
| 参数(Parameters) | |
|---|---|
src |
Matrix4f: matrix to load the values from |
void loadFrustum (float l,
float r,
float b,
float t,
float n,
float f)
将当前值设置为透视投影矩阵
| 参数(Parameters) | |
|---|---|
l |
float: location of the left vertical clipping plane |
r |
float: location of the right vertical clipping plane |
b |
float: location of the bottom horizontal clipping plane |
t |
float: location of the top horizontal clipping plane |
n |
float: location of the near clipping plane, must be positive |
f |
float: location of the far clipping plane, must be positive |
void loadMultiply (Matrix4f lhs, Matrix4f rhs)
将当前值设置为乘以两个给定矩阵的结果
| 参数(Parameters) | |
|---|---|
lhs |
Matrix4f: left hand side matrix |
rhs |
Matrix4f: right hand side matrix |
void loadOrtho (float l,
float r,
float b,
float t,
float n,
float f)
将当前值设置为正交投影矩阵
| 参数(Parameters) | |
|---|---|
l |
float: location of the left vertical clipping plane |
r |
float: location of the right vertical clipping plane |
b |
float: location of the bottom horizontal clipping plane |
t |
float: location of the top horizontal clipping plane |
n |
float: location of the near clipping plane |
f |
float: location of the far clipping plane |
void loadOrthoWindow (int w,
int h)
将当前值设置为正投影矩阵,并将右和底部剪裁平面设置为给定值。 左和上剪裁平面设置为0.近和远分别设置为-1,1
| 参数(Parameters) | |
|---|---|
w |
int: location of the right vertical clipping plane |
h |
int: location of the bottom horizontal clipping plane |
void loadPerspective (float fovy,
float aspect,
float near,
float far)
将当前值设置为透视投影矩阵
| 参数(Parameters) | |
|---|---|
fovy |
float: vertical field of view angle in degrees |
aspect |
float: aspect ratio of the screen |
near |
float: near cliping plane, must be positive |
far |
float: far clipping plane, must be positive |
void loadProjectionNormalized (int w,
int h)
Helper函数将当前值设置为一个透视投影矩阵,该矩阵的纵横比由参数和(near,far),(bottom,top)映射到z = 0时的(-1,1)
| 参数(Parameters) | |
|---|---|
w |
int: screen width |
h |
int: screen height |
void loadRotate (float rot,
float x,
float y,
float z)
将当前值设置为关于给定轴的特定角度的旋转矩阵
| 参数(Parameters) | |
|---|---|
rot |
float: angle of rotation |
x |
float: rotation axis x |
y |
float: rotation axis y |
z |
float: rotation axis z |
void loadScale (float x,
float y,
float z)
将当前值设置为给定维度的比例矩阵
| 参数(Parameters) | |
|---|---|
x |
float: scale component x |
y |
float: scale component y |
z |
float: scale component z |
void loadTranslate (float x,
float y,
float z)
将当前值设置为给定尺寸的平移矩阵
| 参数(Parameters) | |
|---|---|
x |
float: translation component x |
y |
float: translation component y |
z |
float: translation component z |
void multiply (Matrix4f rhs)
将当前矩阵乘以给定参数
| 参数(Parameters) | |
|---|---|
rhs |
Matrix4f: right hand side to multiply by |
void rotate (float rot,
float x,
float y,
float z)
通过将它与一个关于给定轴的特定角度的旋转矩阵进行后乘,来修改当前矩阵
| 参数(Parameters) | |
|---|---|
rot |
float: angle of rotation |
x |
float: rotation axis x |
y |
float: rotation axis y |
z |
float: rotation axis z |
void scale (float x,
float y,
float z)
通过将其与给定维度的比例矩阵进行后乘,修改当前矩阵
| 参数(Parameters) | |
|---|---|
x |
float: scale component x |
y |
float: scale component y |
z |
float: scale component z |
void set (int x,
int y,
float v)
设置给定行和列的值
| 参数(Parameters) | |
|---|---|
x |
int: column of the value to set |
y |
int: row of the value to set |
v |
float
|
void translate (float x,
float y,
float z)
通过与给定维度的平移矩阵进行后乘,修改当前矩阵
| 参数(Parameters) | |
|---|---|
x |
float: translation component x |
y |
float: translation component y |
z |
float: translation component z |