Package com.jme3.bullet
Interface ContactManager
- All Superinterfaces:
ContactListener
- All Known Implementing Classes:
DefaultContactManager
Manage notifications when collision objects in a specific PhysicsSpace come
into contact.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addCollisionListener
(PhysicsCollisionListener listener) Register the specified listener for new contacts.void
addContactListener
(ContactListener listener, boolean doEnded, boolean doProcessed, boolean doStarted) Register the specified listener for immediate contact notifications.void
Register the specified listener for ongoing contacts.int
Count how many collision listeners are registered.void
Distribute queued collision events to registered listeners.void
De-register the specified listener for new contacts.void
removeContactListener
(ContactListener listener) De-register the specified listener for immediate contact notifications.void
De-register the specified listener for ongoing contacts.void
update
(float timeInterval, int maxSteps) Update the associated PhysicsSpace.Methods inherited from interface com.jme3.bullet.collision.ContactListener
onContactEnded, onContactProcessed, onContactStarted
-
Method Details
-
addCollisionListener
Register the specified listener for new contacts.During distributeEvents(), registered listeners are notified of all new contacts since the previous distributeEvents().
- Parameters:
listener
- the listener to register (not null, alias created)
-
addContactListener
void addContactListener(ContactListener listener, boolean doEnded, boolean doProcessed, boolean doStarted) Register the specified listener for immediate contact notifications.- Parameters:
listener
- the listener to register (not null, alias created)doEnded
- true to enableonContactEnded()
callbacks for the listener, false to skip themdoProcessed
- true to enableonContactProcessed()
callbacks for the listener, false to skip themdoStarted
- true to enableonContactStarted()
callbacks for the listener, false to skip them
-
addOngoingCollisionListener
Register the specified listener for ongoing contacts.During distributeEvents(), registered listeners are notified of all ongoing contacts EXCEPT Sphere-Sphere contacts.
- Parameters:
listener
- the listener to register (not null, alias created)
-
countCollisionListeners
int countCollisionListeners()Count how many collision listeners are registered.- Returns:
- the count (≥0)
-
distributeEvents
void distributeEvents()Distribute queued collision events to registered listeners. -
removeCollisionListener
De-register the specified listener for new contacts.- Parameters:
listener
- the listener to de-register (not null)
-
removeContactListener
De-register the specified listener for immediate contact notifications.- Parameters:
listener
- the listener to de-register (not null)
-
removeOngoingCollisionListener
De-register the specified listener for ongoing contacts.- Parameters:
listener
- the listener to de-register (not null)
-
update
void update(float timeInterval, int maxSteps) Update the associated PhysicsSpace. This method should be invoked from the thread that created the space.- Parameters:
timeInterval
- the time interval to simulate (in seconds, ≥0)maxSteps
- the maximum number of simulation steps of sizeaccuracy
(≥1) or 0 for a single simulation step of sizetimeInterval
-