Package com.google.ar.sceneform.math
Class Matrix
- java.lang.Object
-
- com.google.ar.sceneform.math.Matrix
-
public class Matrix extends java.lang.Object4x4 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[]datastatic float[]IDENTITY_DATA
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddecomposeRotation(Vector3 decomposedScale, Matrix destMatrix)voiddecomposeRotation(Vector3 decomposedScale, Quaternion destRotation)voiddecomposeScale(Vector3 destScale)voiddecomposeTranslation(Vector3 destTranslation)static booleanequals(Matrix lhs, Matrix rhs)Compares Matrix valuesvoidextractQuaternion(Quaternion destQuaternion)static booleaninvert(Matrix matrix, Matrix dest)voidmakeRotation(Quaternion rotation)voidmakeScale(float scale)voidmakeScale(Vector3 scale)voidmakeTranslation(Vector3 translation)voidmakeTrs(Vector3 translation, Quaternion rotation, Vector3 scale)static voidmultiply(Matrix lhs, Matrix rhs, Matrix dest)voidset(float[] data)voidset(Matrix m)voidsetTranslation(Vector3 translation)Vector3transformDirection(Vector3 vector)Transforms a direction by ignoring any translation.Vector3transformPoint(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.
-
-