MPO: refresh MPOs on Spatial.deepClone()

cleanup_build_scripts
Kirill Vainer 9 years ago
parent 52487041b4
commit acda6e371c
  1. 7
      jme3-core/src/main/java/com/jme3/scene/Node.java
  2. 10
      jme3-core/src/main/java/com/jme3/scene/Spatial.java

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

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

Loading…
Cancel
Save