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 TypeMethodDescriptionint
Return the triangle's material index.void
setMaterialIndex
(int materialIndex) Alter the triangle's material index.Methods inherited from class com.github.stephengold.joltjni.IndexedTriangleNoMaterial
getIdx, setIdx
Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface com.github.stephengold.joltjni.readonly.ConstIndexedTriangleNoMaterial
getIdx
Methods 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:
getMaterialIndex
in interfaceConstIndexedTriangle
- Returns:
- the index
-