Selaa lähdekoodia

FIX: possible null getWorldBound in collideWith

Bebul 11 vuotta sitten
vanhempi
commit
2dd23c38c0
1 muutettua tiedostoa jossa 23 lisäystä ja 1 poistoa
  1. 23 1
      jme3-core/src/main/java/com/jme3/scene/Node.java

+ 23 - 1
jme3-core/src/main/java/com/jme3/scene/Node.java

@@ -494,6 +494,9 @@ public class Node extends Spatial implements Savable {
         if (children.size() > 4)
         {
           BoundingVolume bv = this.getWorldBound();
+          if (bv==null) 
+            return 0;
+
           CollisionResults bvColRes = new CollisionResults();
           if (bv.collideWith(other, bvColRes) == 0) 
           {
@@ -650,5 +653,24 @@ public class Node extends Spatial implements Savable {
     protected void breadthFirstTraversal(SceneGraphVisitor visitor, Queue<Spatial> queue) {
         queue.addAll(children);
     }
-
+/*    
+    @Override
+    void checkDoBoundUpdate() {
+        if ((refreshFlags & RF_BOUND) == 0) {
+            return;
+        }
+    
+        checkDoTransformUpdate();
+    
+        // Go to children recursively and update their bound
+        int len = getQuantity();
+        for (int i = 0; i < len; i++) {
+            Spatial child = getChild(i);
+            child.checkDoBoundUpdate();
+        }
+    
+        // All children's bounds have been updated. Update my own now.
+        updateWorldBound();
+    }
+*/
 }