From 7628b0f9e34447d81ab9f21f2467762b3675350f Mon Sep 17 00:00:00 2001 From: Fadorico <> Date: Wed, 9 Mar 2016 15:08:56 -0500 Subject: [PATCH] Fixed collision group listeners not being notified --- .../src/main/java/com/jme3/bullet/PhysicsSpace.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/jme3-bullet/src/main/java/com/jme3/bullet/PhysicsSpace.java b/jme3-bullet/src/main/java/com/jme3/bullet/PhysicsSpace.java index edea485ef..51fa0fcea 100644 --- a/jme3-bullet/src/main/java/com/jme3/bullet/PhysicsSpace.java +++ b/jme3-bullet/src/main/java/com/jme3/bullet/PhysicsSpace.java @@ -334,6 +334,19 @@ public class PhysicsSpace { private void addCollisionEvent_native(PhysicsCollisionObject node, PhysicsCollisionObject node1, long manifoldPointObjectId) { // System.out.println("addCollisionEvent:"+node.getObjectId()+" "+ node1.getObjectId()); collisionEvents.add(eventFactory.getEvent(PhysicsCollisionEvent.TYPE_PROCESSED, node, node1, manifoldPointObjectId)); + + // Notify group listeners + if((node.getCollideWithGroups() & node1.getCollisionGroup()) > 0 + || (node1.getCollideWithGroups() & node.getCollisionGroup()) > 0){ + PhysicsCollisionGroupListener listener = collisionGroupListeners.get(node.getCollisionGroup()); + PhysicsCollisionGroupListener listener1 = collisionGroupListeners.get(node1.getCollisionGroup()); + if(listener != null){ + listener.collide(node, node1); + } + if(listener1 != null && node.getCollisionGroup() != node1.getCollisionGroup()){ + listener1.collide(node, node1); + } + } } /**