Package jme3tools.optimize
Class GeometryBatchFactory
java.lang.Object
jme3tools.optimize.GeometryBatchFactory
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumOptions to align the buffers of geometries' meshes of a sub graph -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidalignBuffers(Node n, GeometryBatchFactory.AlignOption option) Will ensure that all the geometries' meshes of the n sub graph have the same types of buffersstatic voidgatherGeoms(Spatial scene, List<Geometry> geoms) static voidmakeBatches(Collection<Geometry> geometries) makeBatches(Collection<Geometry> geometries, boolean useLods) Batches a collection of Geometries so that all with the same material get combined.static voidmakeLods(Collection<Geometry> geometries, Mesh outMesh) static voidmergeGeometries(Collection<Geometry> geometries, Mesh outMesh) Merges all geometries in the collection into the output mesh.static SpatialOptimizes a scene by combining Geometry with the same material.static NodeOptimizes 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:
-