SDK:
- fix possible double-attach in external data update git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10327 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
90e91f3d0b
commit
86c873bbb8
@ -31,6 +31,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.jme3.gde.core.util;
|
package com.jme3.gde.core.util;
|
||||||
|
|
||||||
|
import com.jme3.animation.AnimControl;
|
||||||
import com.jme3.gde.core.scene.ApplicationLogHandler.LogLevel;
|
import com.jme3.gde.core.scene.ApplicationLogHandler.LogLevel;
|
||||||
import com.jme3.scene.Geometry;
|
import com.jme3.scene.Geometry;
|
||||||
import com.jme3.scene.Node;
|
import com.jme3.scene.Node;
|
||||||
@ -190,10 +191,12 @@ public class SpatialUtil {
|
|||||||
* Updates the mesh data of existing objects from an original file, adds new
|
* Updates the mesh data of existing objects from an original file, adds new
|
||||||
* nonexisting geometry objects to the root, including their parents if they
|
* nonexisting geometry objects to the root, including their parents if they
|
||||||
* don't exist.
|
* don't exist.
|
||||||
|
*
|
||||||
* @param root
|
* @param root
|
||||||
* @param original
|
* @param original
|
||||||
*/
|
*/
|
||||||
public static void updateMeshDataFromOriginal(final Spatial root, final Spatial original) {
|
public static void updateMeshDataFromOriginal(final Spatial root, final Spatial original) {
|
||||||
|
//loop through original to also find new geometry
|
||||||
original.depthFirstTraversal(new SceneGraphVisitorAdapter() {
|
original.depthFirstTraversal(new SceneGraphVisitorAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void visit(Geometry geom) {
|
public void visit(Geometry geom) {
|
||||||
@ -207,7 +210,6 @@ public class SpatialUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -235,6 +237,7 @@ public class SpatialUtil {
|
|||||||
leaf.setUserData(ORIGINAL_NAME, leaf.getName());
|
leaf.setUserData(ORIGINAL_NAME, leaf.getName());
|
||||||
leaf.setUserData(ORIGINAL_PATH, getSpatialPath(leaf));
|
leaf.setUserData(ORIGINAL_PATH, getSpatialPath(leaf));
|
||||||
logger.log(LogLevel.USERINFO, "Attached Node {0} with leaf {0}", new Object[]{other, leaf});
|
logger.log(LogLevel.USERINFO, "Attached Node {0} with leaf {0}", new Object[]{other, leaf});
|
||||||
|
return;
|
||||||
} else {
|
} else {
|
||||||
logger.log(Level.WARNING, "Cannot attach leaf {0} to found spatial {1} in root {2}, not a node.", new Object[]{leaf, other, root});
|
logger.log(Level.WARNING, "Cannot attach leaf {0} to found spatial {1} in root {2}, not a node.", new Object[]{leaf, other, root});
|
||||||
}
|
}
|
||||||
@ -242,7 +245,7 @@ public class SpatialUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void clearRemovedOriginals(final Spatial root, final Spatial original) {
|
public static void clearRemovedOriginals(final Spatial root, final Spatial original) {
|
||||||
//TODO
|
//TODO: Clear old stuff at all?
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user