java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.SoftBodyManifold
- All Implemented Interfaces:
ConstJoltPhysicsObject
,AutoCloseable
,Comparable<JoltPhysicsObject>
The vertices of a soft body that are colliding with other bodies.
-
Constructor Summary
ConstructorsConstructorDescriptionSoftBodyManifold
(long manifoldVa) Instantiate a manifold with the specified native object assigned but not owned. -
Method Summary
Modifier and TypeMethodDescriptionint
getContactBodyId
(ConstSoftBodyVertex vertex) Return the ID of the body with which the specified vertex collided.getContactNormal
(ConstSoftBodyVertex vertex) Copy the contact normal direction for the specified vertex.Copy the location of the contact point for the specified vertex.int
Count how many sensors are in contact with the soft body.int
getSensorContactBodyId
(int index) Return the ID of the specified sensor contact.Enumerate all vertices of the soft body.boolean
hasContact
(ConstSoftBodyVertex vertex) Test whether the specified vertex collided with something in this update.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
-
Constructor Details
-
SoftBodyManifold
public SoftBodyManifold(long manifoldVa) Instantiate a manifold with the specified native object assigned but not owned.For use in custom contact listeners.
- Parameters:
manifoldVa
- the virtual address of the native object to assign (not zero)
-
-
Method Details
-
getContactBodyId
Return the ID of the body with which the specified vertex collided. The manifold is unaffected. (native method: GetContactBodyID)- Parameters:
vertex
- the vertex to query (not null, unaffected)- Returns:
- the
BodyID
value
-
getContactNormal
Copy the contact normal direction for the specified vertex. The manifold is unaffected.- Parameters:
vertex
- the vertex to query (not null, unaffected)- Returns:
- a new vector
-
getLocalContactPoint
Copy the location of the contact point for the specified vertex. The manifold is unaffected.- Parameters:
vertex
- the vertex to query (not null, unaffected)- Returns:
- a new location vector (in local coordinates)
-
getNumSensorContacts
public int getNumSensorContacts()Count how many sensors are in contact with the soft body. The manifold is unaffected.- Returns:
- the count (≥0)
-
getSensorContactBodyId
public int getSensorContactBodyId(int index) Return the ID of the specified sensor contact. The manifold is unaffected. (native method: GetSensorContactBodyID)- Parameters:
index
- among the sensor contacts (≥0)- Returns:
- the
BodyID
value
-
getVertices
Enumerate all vertices of the soft body. The manifold is unaffected.- Returns:
- a new array of new JVM objects with pre-existing native objects assigned
-
hasContact
Test whether the specified vertex collided with something in this update. The manifold is unaffected.- Parameters:
vertex
- the vertex to query (not null, unaffected)- Returns:
true
if it collided, otherwisefalse
-