java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.SoftBodyManifold
- All Implemented Interfaces:
ConstJoltPhysicsObject,ConstSoftBodyManifold,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 TypeMethodDescriptionintgetContactBodyId(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.intCount how many sensors are in contact with the soft body.intgetSensorContactBodyId(int index) Return the ID of the specified sensor contact.Enumerate all vertices of the soft body.booleanhasContact(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, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, vaMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVa
-
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 function: GetContactBodyID)- Specified by:
getContactBodyIdin interfaceConstSoftBodyManifold- Parameters:
vertex- the vertex to query (not null, unaffected)- Returns:
- the
BodyIDvalue
-
getContactNormal
Copy the contact normal direction for the specified vertex. The manifold is unaffected.- Specified by:
getContactNormalin interfaceConstSoftBodyManifold- 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.- Specified by:
getLocalContactPointin interfaceConstSoftBodyManifold- 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.- Specified by:
getNumSensorContactsin interfaceConstSoftBodyManifold- Returns:
- the count (≥0)
-
getSensorContactBodyId
public int getSensorContactBodyId(int index) Return the ID of the specified sensor contact. The manifold is unaffected. (native function: GetSensorContactBodyID)- Specified by:
getSensorContactBodyIdin interfaceConstSoftBodyManifold- Parameters:
index- among the sensor contacts (≥0)- Returns:
- the
BodyIDvalue
-
getVertices
Enumerate all vertices of the soft body. The manifold is unaffected.- Specified by:
getVerticesin interfaceConstSoftBodyManifold- 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.- Specified by:
hasContactin interfaceConstSoftBodyManifold- Parameters:
vertex- the vertex to query (not null, unaffected)- Returns:
trueif it collided, otherwisefalse
-