to top
Android APIs
public class

Matrix3f

extends Object
java.lang.Object
   ↳ android.renderscript.Matrix3f

Class Overview

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)
Makes the upper 2x2 a rotation matrix of the given angle
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 loadScale(float x, float y, float z)
Sets current values to be a scale matrix of given dimensions
void loadScale(float x, float y)
Makes the upper 2x2 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
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Matrix3f ()

Added in API level 11

Creates a new identity 3x3 matrix

public Matrix3f (float[] dataArray)

Added in API level 11

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

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

Public Methods

public float get (int x, int y)

Added in API level 11

Returns the value for a given row and column

Parameters
x column of the value to return
y row of the value to return
Returns
  • value in the yth row and xth column

public float[] getArray ()

Added in API level 11

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

Returns
  • internal array representing the matrix

public void load (Matrix3f src)

Added in API level 11

Sets the values of the matrix to those of the parameter

Parameters
src matrix to load the values from

public void loadIdentity ()

Added in API level 11

Sets the matrix values to identity

public void loadMultiply (Matrix3f lhs, Matrix3f rhs)

Added in API level 11

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

Parameters
lhs left hand side matrix
rhs right hand side matrix

public void loadRotate (float rot)

Added in API level 11

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

Parameters
rot rotation angle

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

Added in API level 11

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

Parameters
rot angle of rotation
x rotation axis x
y rotation axis y
z rotation axis z

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

Added in API level 11

Sets current values to be a scale matrix of given dimensions

Parameters
x scale component x
y scale component y
z scale component z

public void loadScale (float x, float y)

Added in API level 11

Makes the upper 2x2 a scale matrix of given dimensions

Parameters
x scale component x
y scale component y

public void loadTranslate (float x, float y)

Added in API level 11

Sets current values to be a translation matrix of given dimensions

Parameters
x translation component x
y translation component y

public void multiply (Matrix3f rhs)

Added in API level 11

Post-multiplies the current matrix by a given parameter

Parameters
rhs right hand side to multiply by

public void rotate (float rot)

Added in API level 11

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

Parameters
rot angle of rotation

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

Added in API level 11

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

Parameters
rot angle of rotation
x rotation axis x
y rotation axis y
z rotation axis z

public void scale (float x, float y)

Added in API level 11

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

Parameters
x scale component x
y scale component y

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

Added in API level 11

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

Parameters
x scale component x
y scale component y
z scale component z

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

Added in API level 11

Sets the value for a given row and column

Parameters
x column of the value to set
y row of the value to set

public void translate (float x, float y)

Added in API level 11

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

Parameters
x translation component x
y translation component y

public void transpose ()

Added in API level 11

Sets the current matrix to its transpose