Dungeon Architect
17.0.0
|
A more memory-compact heightfield that stores open spans of voxels instead of closed ones. More...
Public Member Functions | |
CompactHeightfield (Heightfield field, NavMeshGenerationSettings settings) | |
Initializes a new instance of the CompactHeightfield class. More... | |
CompactHeightfield (Heightfield field, int walkableHeight, int walkableClimb) | |
Initializes a new instance of the CompactHeightfield class. More... | |
void | BuildDistanceField () |
Builds a distance field, or the distance to the nearest unwalkable area. More... | |
void | Erode (int radius) |
Erodes the walkable areas in the map. More... | |
void | BuildRegions (int borderSize, int minRegionArea, int mergeRegionArea) |
The central method for building regions, which consists of connected, non-overlapping walkable spans. More... | |
ContourSet | BuildContourSet (NavMeshGenerationSettings settings) |
Builds a set of Contours around the generated regions. Must be called after regions are generated. More... | |
ContourSet | BuildContourSet (float maxError, int maxEdgeLength, ContourBuildFlags buildFlags) |
Builds a set of Contours around the generated regions. Must be called after regions are generated. More... | |
Properties | |
int | Width [get] |
Gets the width of the CompactHeightfield in voxel units. More... | |
int | Height [get] |
Gets the height of the CompactHeightfield in voxel units. More... | |
int | Length [get] |
Gets the length of the CompactHeightfield in voxel units. More... | |
BBox3 | Bounds [get] |
Gets the world-space bounding box. More... | |
float | CellSize [get] |
Gets the world-space size of a cell in the XZ plane. More... | |
float | CellHeight [get] |
Gets the world-space size of a cell in the Y direction. More... | |
int | MaxDistance [get] |
Gets the maximum distance to a border based on the distance field. This value is undefined prior to calling BuildDistanceField. More... | |
int[] | Distances [get] |
Gets an array of distances from a span to the nearest border. This value is undefined prior to calling BuildDistanceField. More... | |
int | BorderSize [get] |
Gets the size of the border. More... | |
int | MaxRegions [get] |
Gets the maximum number of allowed regions. More... | |
CompactCell[] | Cells [get] |
Gets the cells. More... | |
CompactSpan[] | Spans [get] |
Gets the spans. More... | |
Area[] | Areas [get] |
Gets the area flags. More... | |
IEnumerable< CompactSpan > | this[int x, int y] [get] |
Gets an IEnumerable<T> of CompactSpan of the spans at a specified coordiante. More... | |
IEnumerable< CompactSpan > | this[int i] [get] |
Gets an IEnumerable<T> of CompactSpans at a specified index. More... | |
CompactSpan | this[CompactSpanReference spanRef] [get] |
Gets the CompactSpan specified by the reference. More... | |
A more memory-compact heightfield that stores open spans of voxels instead of closed ones.
Definition at line 14 of file CompactHeightfield.cs.
SharpNav.CompactHeightfield.CompactHeightfield | ( | Heightfield | field, |
NavMeshGenerationSettings | settings | ||
) |
Initializes a new instance of the CompactHeightfield class.
field | A Heightfield to build from. |
settings | The settings to build with. |
Definition at line 38 of file CompactHeightfield.cs.
SharpNav.CompactHeightfield.CompactHeightfield | ( | Heightfield | field, |
int | walkableHeight, | ||
int | walkableClimb | ||
) |
Initializes a new instance of the CompactHeightfield class.
field | A Heightfield to build from. |
walkableHeight | The maximum difference in height to filter. |
walkableClimb | The maximum difference in slope to filter. |
Definition at line 49 of file CompactHeightfield.cs.
ContourSet SharpNav.CompactHeightfield.BuildContourSet | ( | float | maxError, |
int | maxEdgeLength, | ||
ContourBuildFlags | buildFlags | ||
) |
Builds a set of Contours around the generated regions. Must be called after regions are generated.
maxError | The maximum allowed deviation in a simplified contour from a raw one. |
maxEdgeLength | The maximum edge length. |
buildFlags | Flags that change settings for the build process. |
Definition at line 1390 of file CompactHeightfield.cs.
ContourSet SharpNav.CompactHeightfield.BuildContourSet | ( | NavMeshGenerationSettings | settings | ) |
Builds a set of Contours around the generated regions. Must be called after regions are generated.
settings | Settings for building the ContourSet. |
Definition at line 1378 of file CompactHeightfield.cs.
void SharpNav.CompactHeightfield.BuildDistanceField | ( | ) |
Builds a distance field, or the distance to the nearest unwalkable area.
Definition at line 341 of file CompactHeightfield.cs.
void SharpNav.CompactHeightfield.BuildRegions | ( | int | borderSize, |
int | minRegionArea, | ||
int | mergeRegionArea | ||
) |
The central method for building regions, which consists of connected, non-overlapping walkable spans.
borderSize | The border size |
minRegionArea | If smaller than this value, region will be null |
mergeRegionArea | Reduce unneccesarily small regions |
Definition at line 390 of file CompactHeightfield.cs.
void SharpNav.CompactHeightfield.Erode | ( | int | radius | ) |
Erodes the walkable areas in the map.
If you have already called BuildDistanceField, it will automatically be called again after erosion because it needs to be recalculated.
radius | The radius to erode from unwalkable areas. |
Definition at line 366 of file CompactHeightfield.cs.
|
get |
Gets the area flags.
Definition at line 279 of file CompactHeightfield.cs.
|
get |
Gets the size of the border.
Definition at line 235 of file CompactHeightfield.cs.
|
get |
Gets the world-space bounding box.
Definition at line 178 of file CompactHeightfield.cs.
|
get |
Gets the world-space size of a cell in the Y direction.
Definition at line 200 of file CompactHeightfield.cs.
|
get |
Gets the cells.
Definition at line 257 of file CompactHeightfield.cs.
|
get |
Gets the world-space size of a cell in the XZ plane.
Definition at line 189 of file CompactHeightfield.cs.
|
get |
Gets an array of distances from a span to the nearest border. This value is undefined prior to calling BuildDistanceField.
Definition at line 224 of file CompactHeightfield.cs.
|
get |
Gets the height of the CompactHeightfield in voxel units.
Definition at line 156 of file CompactHeightfield.cs.
|
get |
Gets the length of the CompactHeightfield in voxel units.
Definition at line 167 of file CompactHeightfield.cs.
|
get |
Gets the maximum distance to a border based on the distance field. This value is undefined prior to calling BuildDistanceField.
Definition at line 212 of file CompactHeightfield.cs.
|
get |
Gets the maximum number of allowed regions.
Definition at line 246 of file CompactHeightfield.cs.
|
get |
Gets the spans.
Definition at line 268 of file CompactHeightfield.cs.
|
get |
Gets the CompactSpan specified by the reference.
spanRef | A reference to a span in this CompactHeightfield. |
Definition at line 330 of file CompactHeightfield.cs.
|
get |
Gets an IEnumerable<T> of CompactSpans at a specified index.
i | The index. |
Definition at line 313 of file CompactHeightfield.cs.
|
get |
Gets an IEnumerable<T> of CompactSpan of the spans at a specified coordiante.
x | The X coordinate. |
y | The Y coordinate. |
Definition at line 293 of file CompactHeightfield.cs.
|
get |
Gets the width of the CompactHeightfield in voxel units.
Definition at line 145 of file CompactHeightfield.cs.