Răsfoiți Sursa

* Fix issue where BatchNode.clone() would still re-use the previous BatchNode's data structures

shadowislord 11 ani în urmă
părinte
comite
5b7a408bcc
1 a modificat fișierele cu 2 adăugiri și 6 ștergeri
  1. 2 6
      jme3-core/src/main/java/com/jme3/scene/BatchNode.java

+ 2 - 6
jme3-core/src/main/java/com/jme3/scene/BatchNode.java

@@ -773,10 +773,6 @@ public class BatchNode extends GeometryGroupNode implements Savable {
         this.needsFullRebatch = needsFullRebatch;
     }
 
-    public int getOffsetIndex(Geometry batchedGeometry) {
-        return batchedGeometry.startIndex;
-    }
-        
     @Override
     public Node clone(boolean cloneMaterials) {
         BatchNode clone = (BatchNode)super.clone(cloneMaterials);
@@ -790,8 +786,8 @@ public class BatchNode extends GeometryGroupNode implements Savable {
                 }
             }
             clone.needsFullRebatch = true;
-            clone.batches.clear();
-            clone.batchesByGeom.clear();
+            clone.batches = new SafeArrayList<Batch>(Batch.class);
+            clone.batchesByGeom = new HashMap<Geometry, Batch>();
             clone.batch();
         }
         return clone;