Package jme3tools.optimize
Class GeometryBatchFactory
java.lang.Object
jme3tools.optimize.GeometryBatchFactory
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Options to align the buffers of geometries' meshes of a sub graph -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
alignBuffers
(Node n, GeometryBatchFactory.AlignOption option) Will ensure that all the geometries' meshes of the n sub graph have the same types of buffersstatic void
gatherGeoms
(Spatial scene, List<Geometry> geoms) static void
makeBatches
(Collection<Geometry> geometries) makeBatches
(Collection<Geometry> geometries, boolean useLods) Batches a collection of Geometries so that all with the same material get combined.static void
makeLods
(Collection<Geometry> geometries, Mesh outMesh) static void
mergeGeometries
(Collection<Geometry> geometries, Mesh outMesh) Merges all geometries in the collection into the output mesh.static Spatial
Optimizes a scene by combining Geometry with the same material.static Node
Optimizes a scene by combining Geometry with the same material.static void
-
Constructor Details
-
GeometryBatchFactory
public GeometryBatchFactory()
-
-
Method Details
-
mergeGeometries
Merges all geometries in the collection into the output mesh. Creates a new material using the TextureAtlas.- Parameters:
geometries
- the geometries to mergeoutMesh
- a Mesh to receive the geometries
-
makeLods
-
makeBatches
-
makeBatches
Batches a collection of Geometries so that all with the same material get combined.- Parameters:
geometries
- The Geometries to combineuseLods
- true→generate levels of detail, false→don't generate them- Returns:
- A List of newly created Geometries, each with a distinct material
-
gatherGeoms
-
optimize
Optimizes a scene by combining Geometry with the same material. All Geometries found in the scene are detached from their parent and a new Node containing the optimized Geometries is attached.- Parameters:
scene
- The scene to optimize- Returns:
- The newly created optimized geometries attached to a node
-
optimize
Optimizes a scene by combining Geometry with the same material. All Geometries found in the scene are detached from their parent and a new Node containing the optimized Geometries is attached.- Parameters:
scene
- The scene to optimizeuseLods
- true if you want the resulting geometry to keep lod information- Returns:
- The newly created optimized geometries attached to a node
-
printMesh
-
main
-
alignBuffers
Will ensure that all the geometries' meshes of the n sub graph have the same types of buffers- Parameters:
n
- the node to gather geometries fromoption
- the align options- See Also:
-