Class GeometryTool

java.lang.Object
com.ardor3d.util.geom.GeometryTool

public class GeometryTool extends Object
This tool assists in reducing geometry information.
Note: Does not work with geometry using texcoords other than 2d coords.
TODO: Consider adding an option for "close enough" vertex matches... ie, smaller than X distance apart.
  • Constructor Details

    • GeometryTool

      public GeometryTool()
    • GeometryTool

      public GeometryTool(boolean nioBuffersAllocationOnHeapEnabled)
  • Method Details

    • minimizeVerts

      public VertMap minimizeVerts(Mesh mesh, EnumSet<GeometryTool.MatchCondition> conditions)
      Attempt to collapse duplicate vertex data in a given mesh. Vertices are considered duplicate if they occupy the same place in space and match the supplied conditions. All vertices in the mesh are considered part of the same vertex "group".
      Parameters:
      mesh - the mesh to reduce
      conditions - our match conditions.
      Returns:
      a mapping of old vertex positions to their new positions.
    • minimizeVerts

      public VertMap minimizeVerts(Mesh mesh, VertGroupData groupData)
      Attempt to collapse duplicate vertex data in a given mesh. Vertices are consider duplicate if they occupy the same place in space and match the supplied conditions. The conditions are supplied per vertex group.
      Parameters:
      mesh - the mesh to reduce
      groupData - grouping data for the vertices in this mesh.
      Returns:
      a mapping of old vertex positions to their new positions.
    • trimEmptyBranches

      public void trimEmptyBranches(Spatial spatial)
    • convertIndexedGeometryIntoNonIndexedGeometry

      public void convertIndexedGeometryIntoNonIndexedGeometry(MeshData meshData)
      Converts an indexed geometry into a non indexed geometry
      Parameters:
      meshData - mesh data