From 2dd23c38c0bb18512d6b0752ef452a542f6c0758 Mon Sep 17 00:00:00 2001 From: Bebul Date: Wed, 5 Nov 2014 09:54:46 +0100 Subject: [PATCH] FIX: possible null getWorldBound in collideWith --- .../src/main/java/com/jme3/scene/Node.java | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/jme3-core/src/main/java/com/jme3/scene/Node.java b/jme3-core/src/main/java/com/jme3/scene/Node.java index 9ed225662..5a11dd2f2 100644 --- a/jme3-core/src/main/java/com/jme3/scene/Node.java +++ b/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 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(); + } +*/ }