public class GeometryBatchFactory
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
GeometryBatchFactory.AlignOption
Options to align the buffers of geometries' meshes of a sub graph
|
Constructor and Description |
---|
GeometryBatchFactory() |
Modifier and Type | Method and Description |
---|---|
static void |
alignBuffers(Node n,
GeometryBatchFactory.AlignOption option)
Will ensure that all the geometries' meshes of the n sub graph have the
same types of buffers
|
static void |
gatherGeoms(Spatial scene,
java.util.List<Geometry> geoms) |
static void |
main(java.lang.String[] args) |
static java.util.List<Geometry> |
makeBatches(java.util.Collection<Geometry> geometries) |
static java.util.List<Geometry> |
makeBatches(java.util.Collection<Geometry> geometries,
boolean useLods)
Batches a collection of Geometries so that all with the same material get combined.
|
static void |
makeLods(java.util.Collection<Geometry> geometries,
Mesh outMesh) |
static void |
mergeGeometries(java.util.Collection<Geometry> geometries,
Mesh outMesh)
Merges all geometries in the collection into
the output mesh.
|
static Spatial |
optimize(Node scene)
Optimizes a scene by combining Geometry with the same material.
|
static Node |
optimize(Node scene,
boolean useLods)
Optimizes a scene by combining Geometry with the same material.
|
static void |
printMesh(Mesh mesh) |
public static void mergeGeometries(java.util.Collection<Geometry> geometries, Mesh outMesh)
geometries
- the geometries to mergeoutMesh
- a Mesh to receive the geometriespublic static java.util.List<Geometry> makeBatches(java.util.Collection<Geometry> geometries)
public static java.util.List<Geometry> makeBatches(java.util.Collection<Geometry> geometries, boolean useLods)
geometries
- The Geometries to combineuseLods
- true→generate levels of detail, false→don't
generate thempublic static Spatial optimize(Node scene)
scene
- The scene to optimizepublic static Node optimize(Node scene, boolean useLods)
scene
- The scene to optimizeuseLods
- true if you want the resulting geometry to keep lod informationpublic static void printMesh(Mesh mesh)
public static void main(java.lang.String[] args)
public static void alignBuffers(Node n, GeometryBatchFactory.AlignOption option)
n
- the node to gather geometries fromoption
- the align optionsVery experimental for now.