Package com.github.stephengold.joltjni
Class RMat44
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.RMat44
- All Implemented Interfaces:
ConstJoltPhysicsObject,RMat44Arg,AutoCloseable,Comparable<ConstJoltPhysicsObject>
A 4x4 matrix composed of 16
Real elements, used to represent
transformations of 3-D coordinates.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublegetElement(int row, int column) Return the specified element in double precision.Return the translation component.voidsetElement(int row, int column, double value) Alter the specified element in double precision.static RMat44Create an identity matrix.static RMat44sRotationTranslation(QuatArg rotation, RVec3Arg offset) Create a translation-and-rotation matrix.static RMat44sTranslation(RVec3Arg offset) Create a pure translation matrix.static RMat44sZero()Create an all-zero matrix.toString()Return a string representation of the matrix, which is unaffected.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, startCleaner, vaMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, va
-
Constructor Details
-
RMat44
public RMat44()Instantiate an uninitialized matrix. -
RMat44
Instantiate from a single-precision matrix.- Parameters:
spMatrix- the matrix to copy (not null, unaffected)
-
-
Method Details
-
setElement
public void setElement(int row, int column, double value) Alter the specified element in double precision.- Parameters:
row- the zero-origin index of the row (≥0, <4)column- the zero-origin index of the column (≥0, <4)value- the desired value
-
sIdentity
Create an identity matrix.- Returns:
- a new instance
-
sRotationTranslation
Create a translation-and-rotation matrix.- Parameters:
rotation- the amount to rotate (not null, unaffected)offset- the amount to translate (not null, unaffected)- Returns:
- a new instance
-
sTranslation
Create a pure translation matrix.- Parameters:
offset- the amount to translate (not null, unaffected)- Returns:
- a new instance
-
sZero
Create an all-zero matrix.- Returns:
- a new instance
-
getElement
public double getElement(int row, int column) Return the specified element in double precision. The matrix is unaffected.- Specified by:
getElementin interfaceRMat44Arg- Parameters:
row- the zero-origin index of the row (≥0, <4)column- the zero-origin index of the column (≥0, <4)- Returns:
- the element's value
-
getTranslation
Return the translation component. The matrix is unaffected.- Specified by:
getTranslationin interfaceRMat44Arg- Returns:
- a new vector
-
toString
Return a string representation of the matrix, which is unaffected. For example, an identity matrix is represented by:RMat44[ 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 ]
- Overrides:
toStringin classJoltPhysicsObject- Returns:
- the string representation (not null, not empty)
-