Applied abies patch so that the BatchNode.clone properly works.

see http://hub.jmonkeyengine.org/forum/topic/batchnode-broken-on-clone/#post-258248

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@11032 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
experimental
rem..om 11 years ago
parent 4b02c8a952
commit 2cc64abfa9
  1. 20
      engine/src/core/com/jme3/scene/BatchNode.java

@ -754,4 +754,24 @@ public class BatchNode extends Node implements Savable {
public int getOffsetIndex(Geometry batchedGeometry) { public int getOffsetIndex(Geometry batchedGeometry) {
return batchedGeometry.startIndex; return batchedGeometry.startIndex;
} }
@Override
public Node clone(boolean cloneMaterials) {
BatchNode clone = (BatchNode)super.clone(cloneMaterials);
if ( batches.size() > 0) {
for ( Batch b : batches ) {
for ( int i =0; i < clone.children.size(); i++ ) {
if ( clone.children.get(i).getName().equals(b.geometry.getName())) {
clone.children.remove(i);
break;
}
}
}
clone.needsFullRebatch = true;
clone.batches.clear();
clone.batchesByGeom.clear();
clone.batch();
}
return clone;
}
} }

Loading…
Cancel
Save