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 Summary

    Modifier and Type
    Method
    Description
    void
    onContactEnded(long manifoldId)
    Invoked immediately after a contact manifold is removed.
    void
    Invoked immediately after a contact point is refreshed without being removed.
    void
    onContactStarted(long manifoldId)
    Invoked immediately after a contact manifold is created.
  • Method Details

    • 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)