Most visited

Recently visited

Added in API level 11

Matrix4f

public class Matrix4f
extends Object

java.lang.Object
   ↳ android.renderscript.Matrix4f


用于将本机RenderScript rs_matrix4x4类型公开到Android系统的类。

Summary

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

From class java.lang.Object

Public constructors

Matrix4f

Added in API level 11
Matrix4f ()

创建一个新的身份4x4矩阵

Matrix4f

Added in API level 11
Matrix4f (float[] dataArray)

创建一个新的矩阵,并根据给定的参数设置它的值

Parameters
dataArray float: values to set the matrix to, must be 16 floats long

Public methods

get

Added in API level 11
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

getArray

Added in API level 11
float[] getArray ()

返回表示矩阵值的内部数组的引用。 修改这个数组也会改变矩阵

Returns
float[] internal array representing the matrix

inverse

Added in API level 11
boolean inverse ()

将当前矩阵设置为其逆

Returns
boolean

inverseTranspose

Added in API level 11
boolean inverseTranspose ()

将当前矩阵设置为其逆转置

Returns
boolean

load

Added in API level 11
void load (Matrix4f src)

将矩阵的值设置为参数的值

Parameters
src Matrix4f: matrix to load the values from

loadFrustum

Added in API level 11
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

loadIdentity

Added in API level 11
void loadIdentity ()

将矩阵值设置为标识

loadMultiply

Added in API level 11
void loadMultiply (Matrix4f lhs, 
                Matrix4f rhs)

将当前值设置为乘以两个给定矩阵的结果

Parameters
lhs Matrix4f: left hand side matrix
rhs Matrix4f: right hand side matrix

loadOrtho

Added in API level 11
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

loadOrthoWindow

Added in API level 11
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

loadPerspective

Added in API level 11
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

loadProjectionNormalized

Added in API level 11
void loadProjectionNormalized (int w, 
                int h)

Helper函数将当前值设置为一个透视投影矩阵,该矩阵的纵横比由参数和(near,far),(bottom,top)映射到z = 0时的(-1,1)

Parameters
w int: screen width
h int: screen height

loadRotate

Added in API level 11
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

loadScale

Added in API level 11
void loadScale (float x, 
                float y, 
                float z)

将当前值设置为给定维度的比例矩阵

Parameters
x float: scale component x
y float: scale component y
z float: scale component z

loadTranslate

Added in API level 11
void loadTranslate (float x, 
                float y, 
                float z)

将当前值设置为给定尺寸的平移矩阵

Parameters
x float: translation component x
y float: translation component y
z float: translation component z

multiply

Added in API level 11
void multiply (Matrix4f rhs)

将当前矩阵乘以给定参数

Parameters
rhs Matrix4f: right hand side to multiply by

rotate

Added in API level 11
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

scale

Added in API level 11
void scale (float x, 
                float y, 
                float z)

通过将其与给定维度的比例矩阵进行后乘,修改当前矩阵

Parameters
x float: scale component x
y float: scale component y
z float: scale component z

set

Added in API level 11
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

translate

Added in API level 11
void translate (float x, 
                float y, 
                float z)

通过与给定维度的平移矩阵进行后乘,修改当前矩阵

Parameters
x float: translation component x
y float: translation component y
z float: translation component z

transpose

Added in API level 11
void transpose ()

将当前矩阵设置为其转置

Hooray!