Class ContactManifold

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

public final class ContactManifold extends JoltPhysicsObject implements ConstContactManifold
The contact surface between two bodies.
  • Constructor Details

    • ContactManifold

      public ContactManifold(long manifoldVa)
      Instantiate a manifold with the specified native object assigned but not owned.
      Parameters:
      manifoldVa - the virtual address of the native object to assign (not zero)
  • Method Details

    • getBaseOffset

      public RVec3 getBaseOffset()
      Copy the location from which all contact points are measured. The manifold is unaffected. (native attribute: mBaseOffset)
      Specified by:
      getBaseOffset in interface ConstContactManifold
      Returns:
      a new location vector
    • getPenetrationDepth

      public float getPenetrationDepth()
      Return the penetration depth: the distance to move body 2 out of collision. The manifold is unaffected. (native attribute: mPenetrationDepth)
      Specified by:
      getPenetrationDepth in interface ConstContactManifold
      Returns:
      the signed distance (negative for a speculative contact)
    • getSubShapeId1

      public int getSubShapeId1()
      Return the ID of the first sub-shape that formed the manifold. The manifold is unaffected. (native attribute: mSubShapeID1)
      Specified by:
      getSubShapeId1 in interface ConstContactManifold
      Returns:
      a SubShapeID value
    • getSubShapeId2

      public int getSubShapeId2()
      Return the ID of the 2nd sub-shape that formed the manifold. The manifold is unaffected. (native attribute: mSubShapeID2)
      Specified by:
      getSubShapeId2 in interface ConstContactManifold
      Returns:
      a SubShapeID value
    • getWorldSpaceNormal

      public Vec3 getWorldSpaceNormal()
      Copy the normal vector: the direction to move body 2 out of collision. The manifold is unaffected. (native attribute: mWorldSpaceNormal)
      Specified by:
      getWorldSpaceNormal in interface ConstContactManifold
      Returns:
      a new direction vector (in system coordinates)