From 798ec94b11252bdb20d82aa7661b0d544858a72f Mon Sep 17 00:00:00 2001 From: shadowislord Date: Fri, 5 Dec 2014 21:09:55 -0500 Subject: [PATCH] Minor cleanup for previous merge --- jme3-core/src/main/java/com/jme3/scene/Node.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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 14b837011..3934b3e13 100644 --- a/jme3-core/src/main/java/com/jme3/scene/Node.java +++ b/jme3-core/src/main/java/com/jme3/scene/Node.java @@ -115,15 +115,18 @@ public class Node extends Spatial implements Savable { child.setLightListRefresh(); } + // Make sure next updateGeometricState() visits this branch + // to update lights. Spatial p = parent; while (p != null) { if (p.refreshFlags != 0) { - return; //any refresh flag is sufficient, as each propagates to the root Node + // any refresh flag is sufficient, + // as each propagates to the root Node + return; } p.refreshFlags |= RF_CHILD_LIGHTLIST; p = p.parent; } - } @Override @@ -164,8 +167,10 @@ public class Node extends Spatial implements Savable { @Override public void updateGeometricState(){ - boolean somethingToRefresh = (refreshFlags != 0); - if (!somethingToRefresh) return; + if (refreshFlags == 0) { + // This branch has no geometric state that requires updates. + return; + } if ((refreshFlags & RF_LIGHTLIST) != 0){ updateWorldLightList(); @@ -178,6 +183,7 @@ public class Node extends Spatial implements Savable { } refreshFlags &= ~RF_CHILD_LIGHTLIST; + if (!children.isEmpty()) { // the important part- make sure child geometric state is refreshed // first before updating own world bound. This saves