Combine result of both listeners to determine if the collision should occur

cleanup_build_scripts
Fadorico 9 years ago
parent ef626b0959
commit 83b26be45a
  1. 11
      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;
}
/**

Loading…
Cancel
Save