Interface ContactListener

All Known Subinterfaces:
ContactManager
All Known Implementing Classes:
DefaultContactManager, DeformableSpace, MultiBodySpace, PhysicsSoftSpace, PhysicsSpace

public interface ContactListener
Interface to receive immediate notifications when 2 collision objects come into contact.

Bullet implements persistent contacts, so manifold IDs and point IDs are sometimes reused from step to step.

  • Method Details

    • onContactConceived

      boolean onContactConceived(long pointId, long manifoldId, PhysicsCollisionObject pcoA, PhysicsCollisionObject pcoB)
      Invoked immediately before a contact point is added to a manifold.
      Parameters:
      pointId - the native ID of the btManifoldPoint (not zero)
      manifoldId - the native ID of the btPersistentManifold (not zero)
      pcoA - the "A" collision object (not null)
      pcoB - the "B" collision object (not null)
      Returns:
      true to accept the contact, or false to reject it
    • onContactEnded

      void onContactEnded(long manifoldId)
      Invoked immediately after a contact manifold is removed.
      Parameters:
      manifoldId - the native ID of the btPersistentManifold (not zero)
    • onContactProcessed

      void onContactProcessed(PhysicsCollisionObject pcoA, PhysicsCollisionObject pcoB, long manifoldPointId)
      Invoked immediately after a contact point is refreshed without being removed. Skipped for Sphere-Sphere contacts.
      Parameters:
      pcoA - the first involved object (not null)
      pcoB - the 2nd involved object (not null)
      manifoldPointId - the native ID of the btManifoldPoint (not zero)
    • onContactStarted

      void onContactStarted(long manifoldId)
      Invoked immediately after a contact manifold is created.
      Parameters:
      manifoldId - the native ID of the btPersistentManifold (not zero)