From 83b26be45afdf7699fc48d2783b88b55bdcf4514 Mon Sep 17 00:00:00 2001 From: Fadorico Date: Thu, 31 Mar 2016 01:39:54 -0400 Subject: [PATCH] Combine result of both listeners to determine if the collision should occur --- .../src/main/java/com/jme3/bullet/PhysicsSpace.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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 9122e1bc6..f3575bcdf 100644 --- a/jme3-bullet/src/main/java/com/jme3/bullet/PhysicsSpace.java +++ b/jme3-bullet/src/main/java/com/jme3/bullet/PhysicsSpace.java @@ -339,15 +339,16 @@ public class PhysicsSpace { private boolean notifyCollisionGroupListeners_native(PhysicsCollisionObject node, PhysicsCollisionObject node1){ PhysicsCollisionGroupListener listener = collisionGroupListeners.get(node.getCollisionGroup()); PhysicsCollisionGroupListener listener1 = collisionGroupListeners.get(node1.getCollisionGroup()); + boolean result = true; + if(listener != null){ - if(!listener.collide(node, node1)){ - return false; - } + result = listener.collide(node, node1); } if(listener1 != null && node.getCollisionGroup() != node1.getCollisionGroup()){ - return listener1.collide(node, node1); + result = listener1.collide(node, node1) && result; } - return true; + + return result; } /**