MPO: refresh MPOs on Spatial.deepClone()

This commit is contained in:
Kirill Vainer 2016-04-03 16:44:47 -04:00
parent 52487041b4
commit acda6e371c
2 changed files with 8 additions and 9 deletions

View File

@ -251,15 +251,14 @@ public class Node extends Spatial {
if ((refreshFlags & RF_LIGHTLIST) != 0){
updateWorldLightList();
}
if ((refreshFlags & RF_MATPARAM_OVERRIDE) != 0) {
updateMatParamOverrides();
}
if ((refreshFlags & RF_TRANSFORM) != 0){
// combine with parent transforms- same for all spatial
// subclasses.
updateWorldTransforms();
}
if ((refreshFlags & RF_MATPARAM_OVERRIDE) != 0) {
updateMatParamOverrides();
}
refreshFlags &= ~RF_CHILD_LIGHTLIST;
if (!children.isEmpty()) {

View File

@ -207,9 +207,8 @@ public abstract class Spatial implements Savable, Cloneable, Collidable, Cloneab
localLights = new LightList(this);
worldLights = new LightList(this);
localOverrides = new ArrayList<MatParamOverride>();
worldOverrides = new ArrayList<MatParamOverride>();
localOverrides = new ArrayList<>();
worldOverrides = new ArrayList<>();
refreshFlags |= RF_BOUND;
}
@ -1469,6 +1468,7 @@ public abstract class Spatial implements Savable, Cloneable, Collidable, Cloneab
// the transforms and stuff get refreshed.
clone.setTransformRefresh();
clone.setLightListRefresh();
clone.setMatParamOverrideRefresh();
return clone;
}
@ -1624,9 +1624,9 @@ public abstract class Spatial implements Savable, Cloneable, Collidable, Cloneab
localOverrides = ic.readSavableArrayList("overrides", null);
if (localOverrides == null) {
localOverrides = new ArrayList<MatParamOverride>();
localOverrides = new ArrayList<>();
}
worldOverrides = new ArrayList<MatParamOverride>();
worldOverrides = new ArrayList<>();
//changed for backward compatibility with j3o files generated before the AnimControl/SkeletonControl split
//the AnimControl creates the SkeletonControl for old files and add it to the spatial.