Browse Source

Minor cleanup for previous merge

shadowislord 10 years ago
parent
commit
798ec94b11
1 changed files with 10 additions and 4 deletions
  1. 10 4
      jme3-core/src/main/java/com/jme3/scene/Node.java

+ 10 - 4
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