Skip to content

Commit 543c158

Browse files
committed
add a 4-argument addContactListener() method (addresses issue #37)
1 parent bba4c54 commit 543c158

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

MinieLibrary/src/main/java/com/jme3/bullet/PhysicsSpace.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,23 @@ public void addContactListener(ContactListener listener) {
331331
manager.addContactListener(listener, true, true, true);
332332
}
333333

334+
/**
335+
* Register the specified listener for immediate contact notifications.
336+
*
337+
* @param listener the listener to register (not null, alias created)
338+
* @param doEnded true to enable {@code onContactEnded()} callbacks for the
339+
* listener, false to skip them (default=true)
340+
* @param doProcessed true to enable {@code onContactProcessed()} callbacks
341+
* for the listener, false to skip them (default=true)
342+
* @param doStarted true to enable {@code onContactStarted()} callbacks for
343+
* the listener, false to skip them (default=true)
344+
*/
345+
public void addContactListener(ContactListener listener, boolean doEnded,
346+
boolean doProcessed, boolean doStarted) {
347+
Validate.nonNull(listener, "listener");
348+
manager.addContactListener(listener, doEnded, doProcessed, doStarted);
349+
}
350+
334351
/**
335352
* Add the specified PhysicsJoint to this space.
336353
*

0 commit comments

Comments
 (0)