Package com.ardor3d.util.geom
Class MeshCombiner
java.lang.Object
com.ardor3d.util.geom.MeshCombiner
Utility for combining multiple Meshes into a single Mesh. Note that you generally will want to combine Mesh objects
that have the same render states.
XXX: should add in a way to combine only meshes with similar renderstates
XXX: Might be able to reduce memory usage in the singular case where all sources do not have indices defined (arrays).
XXX: combining of triangle strips may not work properly?
XXX: Could be smarter about texcoords and have a tuple size per channel.
XXX: Might be able to reduce memory usage in the singular case where all sources do not have indices defined (arrays).
XXX: combining of triangle strips may not work properly?
XXX: Could be smarter about texcoords and have a tuple size per channel.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final float[]
static final float[]
static final float[]
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic final Mesh
Combine the given array of Mesh objects into a single Mesh.static final Mesh
Combine all mesh objects that fall under the scene graph the given source node.static final Mesh
combine
(Spatial source, MeshCombiner.MeshCombineLogic logic) static final Mesh
combine
(Collection<Mesh> sources) Combine the given collection of Mesh objects into a single Mesh.static final Mesh
combine
(Collection<Mesh> sources, MeshCombiner.MeshCombineLogic logic)
-
Field Details
-
DEFAULT_COLOR
public static final float[] DEFAULT_COLOR -
DEFAULT_NORMAL
public static final float[] DEFAULT_NORMAL -
DEFAULT_TEXCOORD
public static final float[] DEFAULT_TEXCOORD
-
-
Constructor Details
-
MeshCombiner
public MeshCombiner()
-
-
Method Details
-
combine
Combine all mesh objects that fall under the scene graph the given source node. All Mesh objects must have vertices and texcoords that have the same tuple width. It is possible to merge Mesh objects together that have mismatched normals/colors/etc. (eg. one with colors and one without.)
- Parameters:
source
- our source node- Returns:
- the combined Mesh.
-
combine
-
combine
Combine the given array of Mesh objects into a single Mesh. All Mesh objects must have vertices and texcoords that have the same tuple width. It is possible to merge Mesh objects together that have mismatched normals/colors/etc. (eg. one with colors and one without.)- Parameters:
sources
- our Mesh objects to combine.- Returns:
- the combined Mesh.
-
combine
Combine the given collection of Mesh objects into a single Mesh. All Mesh objects must have vertices and texcoords that have the same tuple width. It is possible to merge Mesh objects together that have mismatched normals/colors/etc. (eg. one with colors and one without.)- Parameters:
sources
- our collection of Mesh objects to combine.- Returns:
- the combined Mesh.
-
combine
-