java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.Volume
- All Implemented Interfaces:
ConstJoltPhysicsObject
,AutoCloseable
,Comparable<JoltPhysicsObject>
Join 4 soft-body vertices into a tetrahedron with a preferred volume. (native
type:
SoftBodySharedSettings::Volume
)-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloat
Return the inverse of the volume's stiffness.float
Return the rest size of the volume.int
getVertex
(int indexInVolume) Return the mesh vertex at the specified corner.void
setCompliance
(float compliance) Alter the stiffness of the volume.void
setSixRestVolume
(float sixVolume) Alter the rest size of the volume.void
setVertex
(int indexInVolume, int indexInMesh) Assign the specified mesh vertex to the volume.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
-
Constructor Details
-
Volume
public Volume()Instantiate a default volume constraint.
-
-
Method Details
-
getCompliance
public float getCompliance()Return the inverse of the volume's stiffness. The volume is unaffected. (native attribute: mCompliance)- Returns:
- the compliance value
-
getSixRestVolume
public float getSixRestVolume()Return the rest size of the volume. The volume is unaffected. (native attribute: mSixRestVolume)- Returns:
- 6 times the rest volume of the tetrahedron (in cubic meters)
-
getVertex
public int getVertex(int indexInVolume) Return the mesh vertex at the specified corner. The volume is unaffected. (native attribute: mVertex)- Parameters:
indexInVolume
- which corner of the volume (0 or 1 or 2 or 3)- Returns:
- the mesh index of the vertex (≥0)
-
setCompliance
public void setCompliance(float compliance) Alter the stiffness of the volume. (native attribute: mCompliance)- Parameters:
compliance
- the inverse of the desired stiffness (default=0)
-
setSixRestVolume
public void setSixRestVolume(float sixVolume) Alter the rest size of the volume. (native attribute: mSixRestVolume)- Parameters:
sixVolume
- 6 times the desired rest volume (in cubic meters)
-
setVertex
public void setVertex(int indexInVolume, int indexInMesh) Assign the specified mesh vertex to the volume. (native attribute: mVertex)- Parameters:
indexInVolume
- which corner of the tetrahedron (0 or 1 or 2 or 3)indexInMesh
- the index of the vertex to assign (≥0)
-