|
|
|
@ -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
|
|
|
|
|