FIX: possible null getWorldBound in collideWith

experimental
Bebul 10 years ago
parent 67fe2c4047
commit 2dd23c38c0
  1. 24
      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();
}
*/
}

Loading…
Cancel
Save