org.critterai.nmgen
Class PolyMeshFieldBuilder

java.lang.Object
  extended by org.critterai.nmgen.PolyMeshFieldBuilder

public final class PolyMeshFieldBuilder
extends Object

Builds an convex polygon mesh consisting of variable sized polygons. The mesh is generated from contour data contained by a ContourSet object.

See Also:
Convex Polygon Generation, PolyMeshField

Constructor Summary
PolyMeshFieldBuilder(int maxVertsPerPoly)
          Constructor.
 
Method Summary
 PolyMeshField build(ContourSet contours)
          Builds a convex polygon mesh from the provided contour set.
 int maxVertsPerPoly()
          The maximum vertices per polygon.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PolyMeshFieldBuilder

public PolyMeshFieldBuilder(int maxVertsPerPoly)
Constructor.

Parameters:
maxVertsPerPoly - The maximum vertices per polygon. The builder will not create polygons with more than this number of vertices.
Method Detail

build

public PolyMeshField build(ContourSet contours)
Builds a convex polygon mesh from the provided contour set.

This build algorithm will fail and return null if the ContourSet contains any single contour with more than 0x0fffffff vertices.

Parameters:
contours - A properly populated contour set.
Returns:
The result of the build operation.

maxVertsPerPoly

public int maxVertsPerPoly()
The maximum vertices per polygon. The builder will not create polygons with more than this number of vertices.

Returns:
The maximum vertices per polygon.


Project Home and Source Code

Copyright 2010 Stephen Pratt. All rights reserved. Use is subject to license terms.