Package com.google.ar.sceneform.math
Class Matrix
- java.lang.Object
-
- com.google.ar.sceneform.math.Matrix
-
public class Matrix extends java.lang.Object
4x4 Matrix representing translation, scale, and rotation. Column major, right handed [0, 4, 8, 12] [1, 5, 9, 13] [2, 6, 10, 14] [3, 7, 11, 15]
-
-
Field Summary
Fields Modifier and Type Field Description float[]
data
static float[]
IDENTITY_DATA
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
decomposeRotation(Vector3 decomposedScale, Matrix destMatrix)
void
decomposeRotation(Vector3 decomposedScale, Quaternion destRotation)
void
decomposeScale(Vector3 destScale)
void
decomposeTranslation(Vector3 destTranslation)
static boolean
equals(Matrix lhs, Matrix rhs)
Compares Matrix valuesvoid
extractQuaternion(Quaternion destQuaternion)
static boolean
invert(Matrix matrix, Matrix dest)
void
makeRotation(Quaternion rotation)
void
makeScale(float scale)
void
makeScale(Vector3 scale)
void
makeTranslation(Vector3 translation)
void
makeTrs(Vector3 translation, Quaternion rotation, Vector3 scale)
static void
multiply(Matrix lhs, Matrix rhs, Matrix dest)
void
set(float[] data)
void
set(Matrix m)
void
setTranslation(Vector3 translation)
Vector3
transformDirection(Vector3 vector)
Transforms a direction by ignoring any translation.Vector3
transformPoint(Vector3 vector)
-
-
-
Method Detail
-
set
public void set(float[] data)
-
set
public void set(Matrix m)
-
decomposeTranslation
public void decomposeTranslation(Vector3 destTranslation)
-
decomposeScale
public void decomposeScale(Vector3 destScale)
-
decomposeRotation
public void decomposeRotation(Vector3 decomposedScale, Quaternion destRotation)
-
extractQuaternion
public void extractQuaternion(Quaternion destQuaternion)
-
makeTranslation
public void makeTranslation(Vector3 translation)
-
setTranslation
public void setTranslation(Vector3 translation)
-
makeRotation
public void makeRotation(Quaternion rotation)
-
makeScale
public void makeScale(float scale)
-
makeScale
public void makeScale(Vector3 scale)
-
makeTrs
public void makeTrs(Vector3 translation, Quaternion rotation, Vector3 scale)
-
transformDirection
public Vector3 transformDirection(Vector3 vector)
Transforms a direction by ignoring any translation.If the matrix is uniformly (positively) scaled, then the resulting direction will be correct but scaled by the same factor. If a unit direction is required then the result should be normalized.
If the scale is non-uniform or negative then the result vector will be distorted. In this case the matrix used should be the inverse transpose of the incoming matrix.
-
-