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
This commit is contained in:
parent
4b02c8a952
commit
2cc64abfa9
@ -754,4 +754,24 @@ public class BatchNode extends Node implements Savable {
|
||||
public int getOffsetIndex(Geometry batchedGeometry) {
|
||||
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…
x
Reference in New Issue
Block a user