java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.Face
- All Implemented Interfaces:
ConstFace
,ConstJoltPhysicsObject
,AutoCloseable
,Comparable<JoltPhysicsObject>
A triangular element on the surface of a soft body. (native type:
SoftBodySharedSettings::Face
)-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Return the material index.int
getVertex
(int indexInFace) Return the mesh vertex at the specified corner.boolean
Test whether the face is degenerate.void
setMaterialIndex
(int material) Assign the specified material to the face.void
setVertex
(int indexInFace, int indexInMesh) Assign the specified mesh vertex to the face.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, 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.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVa
-
Constructor Details
-
Face
public Face()Instantiate a default face.
-
-
Method Details
-
setMaterialIndex
public void setMaterialIndex(int material) Assign the specified material to the face. (native attribute: mMaterialIndex)- Parameters:
material
- the index of the desired material (≥0, default=0)
-
setVertex
public void setVertex(int indexInFace, int indexInMesh) Assign the specified mesh vertex to the face. (native attribute: mVertex)- Parameters:
indexInFace
- which corner of the triangle (0 or 1 or 2)indexInMesh
- the index of the vertex to assign (≥0)
-
getMaterialIndex
public int getMaterialIndex()Return the material index. The face is unaffected. (native attribute: mMaterialIndex)- Specified by:
getMaterialIndex
in interfaceConstFace
- Returns:
- the index of the material in the body's shared settings (≥0)
-
getVertex
public int getVertex(int indexInFace) Return the mesh vertex at the specified corner. The face is unaffected. (native attribute: mVertex) -
isDegenerate
public boolean isDegenerate()Test whether the face is degenerate. The face is unaffected.- Specified by:
isDegenerate
in interfaceConstFace
- Returns:
true
if degenerate, otherwisefalse
-