|
@@ -114,6 +114,16 @@ public class Node extends Spatial implements Savable {
|
|
|
|
|
|
child.setLightListRefresh();
|
|
child.setLightListRefresh();
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ Spatial p = parent;
|
|
|
|
+ while (p != null) {
|
|
|
|
+ if (p.refreshFlags != 0) {
|
|
|
|
+ return; //any refresh flag is sufficient, as each propagates to the root Node
|
|
|
|
+ }
|
|
|
|
+ p.refreshFlags |= RF_CHILD_LIGHTLIST;
|
|
|
|
+ p = p.parent;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -154,6 +164,9 @@ public class Node extends Spatial implements Savable {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void updateGeometricState(){
|
|
public void updateGeometricState(){
|
|
|
|
+ boolean somethingToRefresh = (refreshFlags != 0);
|
|
|
|
+ if (!somethingToRefresh) return;
|
|
|
|
+
|
|
if ((refreshFlags & RF_LIGHTLIST) != 0){
|
|
if ((refreshFlags & RF_LIGHTLIST) != 0){
|
|
updateWorldLightList();
|
|
updateWorldLightList();
|
|
}
|
|
}
|
|
@@ -164,6 +177,7 @@ public class Node extends Spatial implements Savable {
|
|
updateWorldTransforms();
|
|
updateWorldTransforms();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ refreshFlags &= ~RF_CHILD_LIGHTLIST;
|
|
if (!children.isEmpty()) {
|
|
if (!children.isEmpty()) {
|
|
// the important part- make sure child geometric state is refreshed
|
|
// the important part- make sure child geometric state is refreshed
|
|
// first before updating own world bound. This saves
|
|
// first before updating own world bound. This saves
|
|
@@ -638,5 +652,4 @@ public class Node extends Spatial implements Savable {
|
|
protected void breadthFirstTraversal(SceneGraphVisitor visitor, Queue<Spatial> queue) {
|
|
protected void breadthFirstTraversal(SceneGraphVisitor visitor, Queue<Spatial> queue) {
|
|
queue.addAll(children);
|
|
queue.addAll(children);
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|