diff --git a/engine/src/tools/jme3tools/optimize/GeometryBatchFactory.java b/engine/src/tools/jme3tools/optimize/GeometryBatchFactory.java index efbba910c..33203c493 100644 --- a/engine/src/tools/jme3tools/optimize/GeometryBatchFactory.java +++ b/engine/src/tools/jme3tools/optimize/GeometryBatchFactory.java @@ -207,6 +207,11 @@ public class GeometryBatchFactory { } + /** + * Batches a collection of Geometries so that all with the same material get combined. + * @param geometries The Geometries to combine + * @return A List of newly created Geometries, each with a distinct material + */ public static List makeBatches(Collection geometries){ ArrayList retVal = new ArrayList(); HashMap> matToGeom = new HashMap>(); @@ -248,6 +253,13 @@ public class GeometryBatchFactory { } } + /** + * Optimizes a scene by combining Geometry with the same material. If the + * given spatial has a parent it is removed from the parent and the newly + * generated scene is attached instead. + * @param scene The scene to optimize + * @return The newly created optimized scene + */ public static Spatial optimize(Spatial scene){ ArrayList geoms = new ArrayList(); gatherGeoms(scene, geoms);