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/branches/gradle-restructure@11031 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
experimental
rem..om 11 years ago
parent cf389fc84c
commit 00eacd3b66
  1. 20
      jme3-core/src/main/java/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