Most visited

Recently visited

Matrix3f

public class Matrix3f
extends Object

java.lang.Object
   ↳ android.support.v8.renderscript.Matrix3f


Class for exposing the native RenderScript rs_matrix3x3 type back to the Android system.

Summary

Public constructors

Matrix3f()

Creates a new identity 3x3 matrix

Matrix3f(float[] dataArray)

Creates a new matrix and sets its values from the given parameter

Public methods

float get(int x, int y)

Returns the value for a given row and column

float[] getArray()

Return a reference to the internal array representing matrix values.

void load(Matrix3f src)

Sets the values of the matrix to those of the parameter

void loadIdentity()

Sets the matrix values to identity

void loadMultiply(Matrix3f lhs, Matrix3f rhs)

Sets current values to be the result of multiplying two given matrices

void loadRotate(float rot, float x, float y, float z)

Sets current values to be a rotation matrix of certain angle about a given axis

void loadRotate(float rot)

Makes the upper 2x2 a rotation matrix of the given angle

void loadScale(float x, float y)

Makes the upper 2x2 a scale matrix of given dimensions

void loadScale(float x, float y, float z)

Sets current values to be a scale matrix of given dimensions

void loadTranslate(float x, float y)

Sets current values to be a translation matrix of given dimensions

void multiply(Matrix3f rhs)

Post-multiplies the current matrix by a given parameter

void rotate(float rot)

Modifies the upper 2x2 of the current matrix by post-multiplying it with a rotation matrix of given angle

void rotate(float rot, float x, float y, float z)

Modifies the current matrix by post-multiplying it with a rotation matrix of certain angle about a given axis

void scale(float x, float y)

Modifies the upper 2x2 of the current matrix by post-multiplying it with a scale matrix of given dimensions

void scale(float x, float y, float z)

Modifies the current matrix by post-multiplying it with a scale matrix of given dimensions

void set(int x, int y, float v)

Sets the value for a given row and column

void translate(float x, float y)

Modifies the current matrix by post-multiplying it with a translation matrix of given dimensions

void transpose()

Sets the current matrix to its transpose

Inherited methods

From class java.lang.Object

Public constructors

Matrix3f

Matrix3f ()

Creates a new identity 3x3 matrix

Matrix3f

Matrix3f (float[] dataArray)

Creates a new matrix and sets its values from the given parameter

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

Public methods

get

float get (int x, 
                int y)

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
Returns
float value in the yth row and xth column

getArray

float[] getArray ()

Return a reference to the internal array representing matrix values. Modifying this array will also change the matrix

Returns
float[] internal array representing the matrix

load

void load (Matrix3f src)

Sets the values of the matrix to those of the parameter

Parameters
src Matrix3f: matrix to load the values from

loadIdentity

void loadIdentity ()

Sets the matrix values to identity

loadMultiply

void loadMultiply (Matrix3f lhs, 
                Matrix3f rhs)

Sets current values to be the result of multiplying two given matrices

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

loadRotate

void loadRotate (float rot, 
                float x, 
                float y, 
                float z)

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

loadRotate

void loadRotate (float rot)

Makes the upper 2x2 a rotation matrix of the given angle

Parameters
rot float: rotation angle

loadScale

void loadScale (float x, 
                float y)

Makes the upper 2x2 a scale matrix of given dimensions

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

loadScale

void loadScale (float x, 
                float y, 
                float z)

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

void loadTranslate (float x, 
                float y)

Sets current values to be a translation matrix of given dimensions

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

multiply

void multiply (Matrix3f rhs)

Post-multiplies the current matrix by a given parameter

Parameters
rhs Matrix3f: right hand side to multiply by

rotate

void rotate (float rot)

Modifies the upper 2x2 of the current matrix by post-multiplying it with a rotation matrix of given angle

Parameters
rot float: angle of rotation

rotate

void rotate (float rot, 
                float x, 
                float y, 
                float z)

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

void scale (float x, 
                float y)

Modifies the upper 2x2 of 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

scale

void scale (float x, 
                float y, 
                float z)

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

void set (int x, 
                int y, 
                float v)

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
v float

translate

void translate (float x, 
                float y)

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

transpose

void transpose ()

Sets the current matrix to its transpose

Hooray!