Class SoftBodyManifold

java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.SoftBodyManifold
All Implemented Interfaces:
ConstJoltPhysicsObject, AutoCloseable, Comparable<JoltPhysicsObject>

public final class SoftBodyManifold extends JoltPhysicsObject
The vertices of a soft body that are colliding with other bodies.
  • 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

      public int getContactBodyId(ConstSoftBodyVertex vertex)
      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

      public Vec3 getContactNormal(ConstSoftBodyVertex vertex)
      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

      public Vec3 getLocalContactPoint(ConstSoftBodyVertex vertex)
      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

      public ConstSoftBodyVertex[] 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

      public boolean hasContact(ConstSoftBodyVertex vertex)
      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, otherwise false