java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.IndexedTriangleNoMaterial
com.github.stephengold.joltjni.IndexedTriangle
- All Implemented Interfaces:
ConstIndexedTriangle,ConstIndexedTriangleNoMaterial,ConstJoltPhysicsObject,AutoCloseable,Comparable<JoltPhysicsObject>
public final class IndexedTriangle
extends IndexedTriangleNoMaterial
implements ConstIndexedTriangle
A triangle composed of three 32-bit mesh-vertex indices and a material index.
-
Constructor Summary
ConstructorsConstructorDescriptionInstantiate a triangle with all indices zero.IndexedTriangle(int vi0, int vi1, int vi2) Instantiate a triangle with the specified indices.IndexedTriangle(int vi0, int vi1, int vi2, int materialIndex) Instantiate a triangle with the specified indices. -
Method Summary
Modifier and TypeMethodDescriptionintReturn the triangle's material index.voidsetMaterialIndex(int materialIndex) Alter the triangle's material index.Methods inherited from class com.github.stephengold.joltjni.IndexedTriangleNoMaterial
getIdx, setIdxMethods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, 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.ConstIndexedTriangleNoMaterial
getIdxMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVa
-
Constructor Details
-
IndexedTriangle
public IndexedTriangle()Instantiate a triangle with all indices zero. -
IndexedTriangle
public IndexedTriangle(int vi0, int vi1, int vi2) Instantiate a triangle with the specified indices.- Parameters:
vi0- the desired first mesh-vertex indexvi1- the desired 2nd mesh-vertex indexvi2- the desired 3rd mesh-vertex index
-
IndexedTriangle
public IndexedTriangle(int vi0, int vi1, int vi2, int materialIndex) Instantiate a triangle with the specified indices.- Parameters:
vi0- the desired first mesh-vertex indexvi1- the desired 2nd mesh-vertex indexvi2- the desired 3rd mesh-vertex indexmaterialIndex- the desired material index
-
-
Method Details
-
setMaterialIndex
public void setMaterialIndex(int materialIndex) Alter the triangle's material index. (native attribute: mMaterialIndex)- Parameters:
materialIndex- the desired material index
-
getMaterialIndex
public int getMaterialIndex()Return the triangle's material index. The triangle is unaffected. (native attribute: mMaterialIndex)- Specified by:
getMaterialIndexin interfaceConstIndexedTriangle- Returns:
- the index
-