Recast Navigation
Navigation-mesh Toolset for Games
|
A compact, static heightfield representing unobstructed space. More...
#include <Recast.h>
Public Member Functions | |
rcCompactHeightfield () | |
~rcCompactHeightfield () | |
Public Attributes | |
int | width |
The width of the heightfield. (Along the x-axis in cell units.) More... | |
int | height |
The height of the heightfield. (Along the z-axis in cell units.) More... | |
int | spanCount |
The number of spans in the heightfield. More... | |
int | walkableHeight |
The walkable height used during the build of the field. (See: rcConfig::walkableHeight) More... | |
int | walkableClimb |
The walkable climb used during the build of the field. (See: rcConfig::walkableClimb) More... | |
int | borderSize |
The AABB border size used during the build of the field. (See: rcConfig::borderSize) More... | |
unsigned short | maxDistance |
The maximum distance value of any span within the field. More... | |
unsigned short | maxRegions |
The maximum region id of any span within the field. More... | |
float | bmin [3] |
The minimum bounds in world space. [(x, y, z)]. More... | |
float | bmax [3] |
The maximum bounds in world space. [(x, y, z)]. More... | |
float | cs |
The size of each cell. (On the xz-plane.) More... | |
float | ch |
The height of each cell. (The minimum increment along the y-axis.) More... | |
rcCompactCell * | cells |
Array of cells. [Size: width*height]. More... | |
rcCompactSpan * | spans |
Array of spans. [Size: spanCount]. More... | |
unsigned short * | dist |
Array containing border distance data. [Size: spanCount]. More... | |
unsigned char * | areas |
Array containing area id data. [Size: spanCount]. More... | |
A compact, static heightfield representing unobstructed space.
For this type of heightfield, the spans represent the open (unobstructed) space above the solid surfaces of a voxel field. It is usually created from a rcHeightfield object. Data is stored in a compact, efficient manner,
but the structure is not condusive to adding and removing spans.
The standard process for buidling a compact heightfield is to allocate it using rcAllocCompactHeightfield, build it using rcBuildCompactHeightfield, then run it through the various helper functions to generate neighbor and region data.
Connected neighbor spans form non-overlapping surfaces. When neighbor information is generated, spans will include data that can be used to locate axis-neighbors. Axis-neighbors are connected spans that are offset from the current cell column as follows:
Direction 0 = (-1, 0) Direction 1 = (0, 1) Direction 2 = (1, 0) Direction 3 = (0, -1)
Example of iterating and inspecting spans, including connected neighbors:
rcCompactHeightfield::rcCompactHeightfield | ( | ) |
rcCompactHeightfield::~rcCompactHeightfield | ( | ) |
unsigned char* rcCompactHeightfield::areas |
Array containing area id data. [Size: spanCount].
float rcCompactHeightfield::bmax[3] |
The maximum bounds in world space. [(x, y, z)].
float rcCompactHeightfield::bmin[3] |
The minimum bounds in world space. [(x, y, z)].
int rcCompactHeightfield::borderSize |
The AABB border size used during the build of the field. (See: rcConfig::borderSize)
rcCompactCell* rcCompactHeightfield::cells |
float rcCompactHeightfield::ch |
The height of each cell. (The minimum increment along the y-axis.)
float rcCompactHeightfield::cs |
The size of each cell. (On the xz-plane.)
unsigned short* rcCompactHeightfield::dist |
Array containing border distance data. [Size: spanCount].
int rcCompactHeightfield::height |
The height of the heightfield. (Along the z-axis in cell units.)
unsigned short rcCompactHeightfield::maxDistance |
The maximum distance value of any span within the field.
unsigned short rcCompactHeightfield::maxRegions |
The maximum region id of any span within the field.
int rcCompactHeightfield::spanCount |
The number of spans in the heightfield.
rcCompactSpan* rcCompactHeightfield::spans |
Array of spans. [Size: spanCount].
int rcCompactHeightfield::walkableClimb |
The walkable climb used during the build of the field. (See: rcConfig::walkableClimb)
int rcCompactHeightfield::walkableHeight |
The walkable height used during the build of the field. (See: rcConfig::walkableHeight)
int rcCompactHeightfield::width |
The width of the heightfield. (Along the x-axis in cell units.)