java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.IndexedTriangleNoMaterial
com.github.stephengold.joltjni.IndexedTriangle
- All Implemented Interfaces:
ConstJoltPhysicsObject
,AutoCloseable
,Comparable<JoltPhysicsObject>
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, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
-
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
-
getMaterialIndex
public int getMaterialIndex()Return the triangle's material index. The triangle is unaffected. (native attribute: mMaterialIndex)- Returns:
- the index
-
setMaterialIndex
public void setMaterialIndex(int materialIndex) Alter the triangle's material index. (native attribute: mMaterialIndex)- Parameters:
materialIndex
- the desired material index
-