[This is preliminary documentation and is subject to change.]

Common configuration parameters used during the NMGen build process.

Namespace: org.critterai.nmgen
Assembly: cai-nmgen (in cai-nmgen.dll) Version: 0.4.0.0 (0.4.0.0)

Syntax

         
 C#  Visual Basic  Visual C++ 
[SerializableAttribute]
public sealed class NMGenParams
<SerializableAttribute> _
Public NotInheritable Class NMGenParams
[SerializableAttribute]
public ref class NMGenParams sealed

Members

               
 All Members  Constructors   Fields   Properties   Methods  
 Public

 Protected
 Instance

 Static 
 Declared

 Inherited
 XNA Framework Only 

 .NET Compact Framework Only 

 MemberDescription
NMGenParams()()()()
Initializes a new instance of the NMGenParams class
borderSize
Border size.
BorderSize
The closest the mesh should come to the xz-plane AABB of the source geometry. [Limit: >=0] [Units: XZCellSize]
Clean()()()()
Clamps all parameters to the mandatory limits.
Clone()()()()
Clones the object.
contourOptions
Options to use when building the contour set.
ContourOptions
Options to use when building the contour set.
DeriveBorderSize(NMGenParams)
Derives the recommended border size for tiled mesh builds.
detailMaxDeviation
Detail maximum deviation.
DetailMaxDeviation
The maximum distance the mesh surface should deviate from the surface of the source geometry. (For height detail only.) [Limit: >=0] [Units: World]
detailSampleDistance
Detail sample distance.
DetailSampleDistance
Sets the sample distance to use when matching the detail mesh surface to the source geometry. (Height detail only.) [Limits: 0 or >= 0.9] [Units: World]
edgeMaxDeviation
Maximum edge deviation.
EdgeMaxDeviation
The maximum distance the edges of the mesh should deviate from the source geometry. [Limit: >=0] [Units: World]
IsValid()()()()
Validates the parameter values.
maxEdgeLength
Maximum edge length.
MaxEdgeLength
The maximum allowed length for edges on the border of the mesh. [Limit: >=0] [Units: XZCellSize]
maxVertsPerPoly
Maximum vertices per polygon.
MaxVertsPerPoly
The maximum number of vertices allowed for polygons generated during the contour to polygon conversion process. [Limits: 3 <= value < MaxAllowedVertsPerPoly]
mergeRegionArea
Merge region area.
MergeRegionArea
Any regions with an cell count smaller than this value will, if possible, be merged with larger regions. [Limit: >=0] [Units: XZCellSize]
minRegionArea
Minimum region area.
MinRegionArea
The minimum number of cells allowed to form isolated island meshes. [Limit: >=0] [Units: XZCellSize]
SetMaxEdgeLength(Single)
Derives the WalkableStep from a world units value.
SetMergeRegionArea(Single)
Derives the MergeRegionArea from a world units value.
SetMinRegionArea(Single)
Derives the MinRegionArea from a world units value.
SetWalkableHeight(Single)
Derives WalkableHeight from a world units value.
SetWalkableRadius(Single)
Derives the WalkableRadius from a world units value.
SetWalkableStep(Single)
Derives the WalkableStep from a world units value.
tileSize
Tile size.
TileSize
The width/depth size of the tile on the xz-plane. [Limit: >=0] [Units: XZCellSize]
TileWorldSize
The tile size in world units.
useMonotone
If true, use monotone region generation.
UseMonotone
If true, use monotone region generation. Otherwise use watershed partitioning.
walkableHeight
Walkable height.
WalkableHeight
Minimum floor to 'ceiling' height that will still allow the floor area to be considered walkable. [Limit: >= MinWalkableHeight] [Units: YCellSize]
walkableRadius
Walkable radius.
WalkableRadius
Represents the closest any part of a mesh should get to an obstruction in the source geometry. [Limit: >=0] [Units: XZCellSize]
walkableSlope
Maximum walkable slope.
WalkableSlope
The maximum slope that is considered walkable. [Limits: 0 <= value <= MaxAllowedSlope] [Units: Degrees]
walkableStep
Walkable step.
WalkableStep
Maximum ledge height that is considered to be traversable. [Limit: >=0] [Units: YCellSize]
WorldMaxEdgeLength
The maximum edge length in world units.
WorldMergeRegionArea
The merge region area in world units.
WorldMinRegionArea
The minimum region area in world units.
WorldWalkableHeight
The walkable height in world units.
WorldWalkableRadius
The walkable radius in world units.
WorldWalkableStep
The walkable set in world units.
xzCellSize
XZ-plane cell size.
XZCellSize
The xz-plane voxel size to use when sampling the source geometry. [Limit: >= MinCellSize] [Units: World]
yCellSize
Y-axis cell size.
YCellSize
The y-axis voxel size to use when sampling the source geometry. [Limit >= MinCellSize]

Remarks

This class represents an aggregation of parameters used at different stages in the build process. Not all parameters are used in all builds.

There is no such thing as a 'one size fits all' configuration. The default constructor initializes all values for a normal human sized agent. You will usually discover configurations that work well for categories of source geometry. E.g. A configuration for interior environments and another for outdoor environments.

In general, derive and set parameter values as follows:

  1. Determine the agent values in world units. (Agent height, step, radius.)
  2. Derive XZCellSize and YCellSize from the agent values.
  3. Derive and set the agent based parameters in cell units.
  4. Derive and set the TileSize and BorderSize parameters.
  5. Set the rest of the parameters.

All properties and methods will auto-clamp fields to valid values. For example, if the TileSize property is set to -1, the value will be clamped to 0.

Fields are minimally documented. See the property documentation for details.

Implemented as a class with public fields in order to support Unity serialization. Care must be taken not to set the fields to invalid values.

Inheritance Hierarchy

System..::..Object
  org.critterai.nmgen..::..NMGenParams

See Also