BatchNode : fixed an issue when a geometry was not unbatched when removed with sometihing else than removeFromParent

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9462 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
rem..om 13 years ago
parent 233627de72
commit b97f8c1271
  1. 18
      engine/src/core/com/jme3/scene/Geometry.java

@ -329,15 +329,19 @@ public class Geometry extends Spatial {
}
@Override
public boolean removeFromParent() {
boolean removed = super.removeFromParent();
//if the geometry is batched we also have to unbatch it
if (isBatched()) {
unBatch();
}
return removed;
public boolean removeFromParent() {
return super.removeFromParent();
}
@Override
protected void setParent(Node parent) {
super.setParent(parent);
//if the geometry is batched we also have to unbatch it
if(parent==null && isBatched()){
unBatch();
}
}
/**
* Recomputes the cached offset matrix used when the geometry is batched *
*/

Loading…
Cancel
Save