

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object org.critterai.nmgen.SolidHeightfieldBuilder
public final class SolidHeightfieldBuilder
A class used to build solid heightfields from source geometry using a given configuration. The solid heightfield represents the space obstructed by the source geometry.
Each triangle in the source geometry is voxelized using conservative voxelization and added to the field. Conservative voxelization is an algorithm that ensures that polygon surfaces are completely encompassed by the the generated voxels.
At the end of the process, spans with the SpanFlags.WALKABLE
flag have survived the following tests:
Constructor Summary  

SolidHeightfieldBuilder(float cellSize,
float cellHeight,
int minTraversableHeight,
int maxTraversableStep,
float maxTraversableSlope,
boolean clipLedges)
Constructor 
Method Summary  

SolidHeightfield 
build(float[] vertices,
int[] indices)
Generates a solid heightfield from the provided source geometry. 
Methods inherited from class java.lang.Object 

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
Constructor Detail 

public SolidHeightfieldBuilder(float cellSize, float cellHeight, int minTraversableHeight, int maxTraversableStep, float maxTraversableSlope, boolean clipLedges)
cellSize
 The size of the cells. (The grid that forms the base
of the field.)
This value represents the x and zaxis sampling resolution to use when generating voxels.
cellHeight
 The height increment of the field.
This value represents the yaxis sampling resolution to use when generating voxels.
minTraversableHeight
 Represents the minimum floor to ceiling
height that will still allow a floor area to be considered traversable.
Permits detection of overhangs in the geometry which make the geometry below become unwalkable.
Constraints: > 0
maxTraversableStep
 Represents the maximum ledge height that
is considered to still be traversable.
Prevents minor deviations in height from improperly showing as obstructions. Permits detection of stairlike structures, curbs, etc.
Constraints: >= 0
maxTraversableSlope
 The maximum slope that is considered
traversable. (Degrees)
Spans that are at or above this slope have the
SpanFlags.WALKABLE
flag removed.
Constraints: 0 <= value <= 85
clipLedges
 Indicates whether ledges should be marked as
unwalkable. I.e. The SpanFlags.WALKABLE
flag will be removed.
A ledge is a normally traversable span that has one or more accessible neighbors with a an unsteppable drop from span top to span top.
E.g. If an agent using the navmesh were to travel down from the ledge span to its neighbor span, it would result in the maximum traversable step distance being violated. The agent cannot legally "step down" from a ledge to its neighbor.
Method Detail 

public SolidHeightfield build(float[] vertices, int[] indices)
The SpanFlags.WALKABLE
will be applied to spans whose top
surface is considered traversable. See the class description for
details.
vertices
 Source geometry vertices in the form (x, y, z).indices
 Source geometry indices in the form (VertA, VertB, VertC).
Wrapped: Clockwise.


PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
Copyright 2010 Stephen Pratt. All rights reserved. Use is subject to license terms.