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 TypeMethodDescriptionvoidaddCollisionListener(PhysicsCollisionListener listener) Register the specified listener for new contacts.voidaddContactListener(ContactListener listener, int stepFlags) Register the specified listener for immediate contact notifications.voidRegister the specified listener for ongoing contacts.intCount how many collision listeners are registered.voidDistribute queued collision events to registered listeners.voidDe-register the specified listener for new contacts.voidremoveContactListener(ContactListener listener) De-register the specified listener for immediate contact notifications.voidDe-register the specified listener for ongoing contacts.voidupdate(float timeInterval, int maxSteps, int stepFlags) Update the associated PhysicsSpace, enabling the specified callbacks.Methods inherited from interface com.jme3.bullet.collision.ContactListener
onContactConceived, 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
Register the specified listener for immediate contact notifications.- Parameters:
listener- the listener to register (not null, alias created)stepFlags- the desired flags, ORed together- See Also:
-
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)- See Also:
-
removeContactListener
De-register the specified listener for immediate contact notifications.- Parameters:
listener- the listener to de-register (not null)- See Also:
-
removeOngoingCollisionListener
De-register the specified listener for ongoing contacts.- Parameters:
listener- the listener to de-register (not null)- See Also:
-
update
void update(float timeInterval, int maxSteps, int stepFlags) Update the associated PhysicsSpace, enabling the specified callbacks. 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 sizetimeIntervalstepFlags- flags indicating the desired callbacks, ORed together (default=0x0)- See Also:
-