- add JavaDoc to GeometryBatchFactory
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7213 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
345986fb70
commit
0dacbb77e1
@ -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<Geometry> makeBatches(Collection<Geometry> geometries){
|
public static List<Geometry> makeBatches(Collection<Geometry> geometries){
|
||||||
ArrayList<Geometry> retVal = new ArrayList<Geometry>();
|
ArrayList<Geometry> retVal = new ArrayList<Geometry>();
|
||||||
HashMap<Material, List<Geometry>> matToGeom = new HashMap<Material, List<Geometry>>();
|
HashMap<Material, List<Geometry>> matToGeom = new HashMap<Material, List<Geometry>>();
|
||||||
@ -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){
|
public static Spatial optimize(Spatial scene){
|
||||||
ArrayList<Geometry> geoms = new ArrayList<Geometry>();
|
ArrayList<Geometry> geoms = new ArrayList<Geometry>();
|
||||||
gatherGeoms(scene, geoms);
|
gatherGeoms(scene, geoms);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user