Matrix4f
open classMatrix4f
kotlin.Any | |
↳ | android.renderscript.Matrix4f |
Class for exposing the native RenderScript rs_matrix4x4 type back to the Android system.
Summary
Public constructors | |
---|---|
Matrix4f() Creates a new identity 4x4 matrix |
|
Matrix4f(dataArray: FloatArray!) Creates a new matrix and sets its values from the given parameter |
Public methods | |
---|---|
open Float |
Returns the value for a given row and column |
open FloatArray! |
getArray() Return a reference to the internal array representing matrix values. |
open Boolean |
inverse() Sets the current matrix to its inverse |
open Boolean |
Sets the current matrix to its inverse transpose |
open Unit |
Sets the values of the matrix to those of the parameter |
open Unit |
Sets current values to be a perspective projection matrix |
open Unit |
Sets the matrix values to identity |
open Unit |
loadMultiply(lhs: Matrix4f!, rhs: Matrix4f!) Sets current values to be the result of multiplying two given matrices |
open Unit |
Set current values to be an orthographic projection matrix |
open Unit |
loadOrthoWindow(w: Int, h: Int) Set current values to be an orthographic projection matrix with the right and bottom clipping planes set to the given values. |
open Unit |
loadPerspective(fovy: Float, aspect: Float, near: Float, far: Float) Sets current values to be a perspective projection matrix |
open Unit |
loadProjectionNormalized(w: Int, h: Int) Helper function to set the current values to a perspective projection matrix with aspect ratio defined by the parameters and (near, far), (bottom, top) mapping to (-1, 1) at z = 0 |
open Unit |
loadRotate(rot: Float, x: Float, y: Float, z: Float) Sets current values to be a rotation matrix of certain angle about a given axis |
open Unit |
Sets current values to be a scale matrix of given dimensions |
open Unit |
loadTranslate(x: Float, y: Float, z: Float) Sets current values to be a translation matrix of given dimensions |
open Unit |
Post-multiplies the current matrix by a given parameter |
open Unit |
Modifies the current matrix by post-multiplying it with a rotation matrix of certain angle about a given axis |
open Unit |
Modifies the current matrix by post-multiplying it with a scale matrix of given dimensions |
open Unit |
Sets the value for a given row and column |
open Unit |
Modifies the current matrix by post-multiplying it with a translation matrix of given dimensions |
open Unit |
Sets the current matrix to its transpose |
Public constructors
Matrix4f
Matrix4f(dataArray: FloatArray!)
Creates a new matrix and sets its values from the given parameter
Parameters | |
---|---|
dataArray |
FloatArray!: values to set the matrix to, must be 16 floats long |
Public methods
get
open funget(
x: Int,
y: Int
): Float
Deprecated: Deprecated in Java.
Returns the value for a given row and column
Parameters | |
---|---|
x |
Int: column of the value to return |
y |
Int: row of the value to return |
Return | |
---|---|
Float |
value in the yth row and xth column |
getArray
open fungetArray(): FloatArray!
Deprecated: Deprecated in Java.
Return a reference to the internal array representing matrix values. Modifying this array will also change the matrix
Return | |
---|---|
FloatArray! |
internal array representing the matrix |
inverse
open funinverse(): Boolean
Deprecated: Deprecated in Java.
Sets the current matrix to its inverse
inverseTranspose
open funinverseTranspose(): Boolean
Deprecated: Deprecated in Java.
Sets the current matrix to its inverse transpose
load
open funload(src: Matrix4f!): Unit
Deprecated: Deprecated in Java.
Sets the values of the matrix to those of the parameter
Parameters | |
---|---|
src |
Matrix4f!: matrix to load the values from |
loadFrustum
open funloadFrustum(
l: Float,
r: Float,
b: Float,
t: Float,
n: Float,
f: Float
): Unit
Deprecated: Deprecated in Java.
Sets current values to be a perspective projection matrix
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
open funloadIdentity(): Unit
Deprecated: Deprecated in Java.
Sets the matrix values to identity
loadMultiply
open funloadMultiply(
lhs: Matrix4f!,
rhs: Matrix4f!
): Unit
Deprecated: Deprecated in Java.
Sets current values to be the result of multiplying two given matrices
Parameters | |
---|---|
lhs |
Matrix4f!: left hand side matrix |
rhs |
Matrix4f!: right hand side matrix |
loadOrtho
open funloadOrtho(
l: Float,
r: Float,
b: Float,
t: Float,
n: Float,
f: Float
): Unit
Deprecated: Deprecated in Java.
Set current values to be an orthographic projection matrix
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
open funloadOrthoWindow(
w: Int,
h: Int
): Unit
Deprecated: Deprecated in Java.
Set current values to be an orthographic projection matrix with the right and bottom clipping planes set to the given values. Left and top clipping planes are set to 0. Near and far are set to -1, 1 respectively
Parameters | |
---|---|
w |
Int: location of the right vertical clipping plane |
h |
Int: location of the bottom horizontal clipping plane |
loadPerspective
open funloadPerspective(
fovy: Float,
aspect: Float,
near: Float,
far: Float
): Unit
Deprecated: Deprecated in Java.
Sets current values to be a perspective projection matrix
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
open funloadProjectionNormalized(
w: Int,
h: Int
): Unit
Deprecated: Deprecated in Java.
Helper function to set the current values to a perspective projection matrix with aspect ratio defined by the parameters and (near, far), (bottom, top) mapping to (-1, 1) at z = 0
Parameters | |
---|---|
w |
Int: screen width |
h |
Int: screen height |
loadRotate
open funloadRotate(
rot: Float,
x: Float,
y: Float,
z: Float
): Unit
Deprecated: Deprecated in Java.
Sets current values to be a rotation matrix of certain angle about a given axis
Parameters | |
---|---|
rot |
Float: angle of rotation |
x |
Float: rotation axis x |
y |
Float: rotation axis y |
z |
Float: rotation axis z |
loadScale
open funloadScale(
x: Float,
y: Float,
z: Float
): Unit
Deprecated: Deprecated in Java.
Sets current values to be a scale matrix of given dimensions
Parameters | |
---|---|
x |
Float: scale component x |
y |
Float: scale component y |
z |
Float: scale component z |
loadTranslate
open funloadTranslate(
x: Float,
y: Float,
z: Float
): Unit
Deprecated: Deprecated in Java.
Sets current values to be a translation matrix of given dimensions
Parameters | |
---|---|
x |
Float: translation component x |
y |
Float: translation component y |
z |
Float: translation component z |
multiply
open funmultiply(rhs: Matrix4f!): Unit
Deprecated: Deprecated in Java.
Post-multiplies the current matrix by a given parameter
Parameters | |
---|---|
rhs |
Matrix4f!: right hand side to multiply by |
rotate
open funrotate(
rot: Float,
x: Float,
y: Float,
z: Float
): Unit
Deprecated: Deprecated in Java.
Modifies the current matrix by post-multiplying it with a rotation matrix of certain angle about a given axis
Parameters | |
---|---|
rot |
Float: angle of rotation |
x |
Float: rotation axis x |
y |
Float: rotation axis y |
z |
Float: rotation axis z |
scale
open funscale(
x: Float,
y: Float,
z: Float
): Unit
Deprecated: Deprecated in Java.
Modifies the current matrix by post-multiplying it with a scale matrix of given dimensions
Parameters | |
---|---|
x |
Float: scale component x |
y |
Float: scale component y |
z |
Float: scale component z |
set
open funset(
x: Int,
y: Int,
v: Float
): Unit
Deprecated: Deprecated in Java.
Sets the value for a given row and column
Parameters | |
---|---|
x |
Int: column of the value to set |
y |
Int: row of the value to set |
translate
open funtranslate(
x: Float,
y: Float,
z: Float
): Unit
Deprecated: Deprecated in Java.
Modifies the current matrix by post-multiplying it with a translation matrix of given dimensions
Parameters | |
---|---|
x |
Float: translation component x |
y |
Float: translation component y |
z |
Float: translation component z |
transpose
open funtranspose(): Unit
Deprecated: Deprecated in Java.
Sets the current matrix to its transpose