Recast Navigation
Navigation-mesh Toolset for Games
|
A dynamic heightfield representing obstructed space. More...
#include <Recast.h>
Public Member Functions | |
rcHeightfield () | |
~rcHeightfield () | |
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... | |
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... | |
rcSpan ** | spans |
Heightfield of spans (width*height). More... | |
rcSpanPool * | pools |
Linked list of span pools. More... | |
rcSpan * | freelist |
The next free span. More... | |
A dynamic heightfield representing obstructed space.
The grid of a heightfield is layed out on the xz-plane based on the value of cs. Spans exist within the grid columns with the span min/max values at increments of ch from the base of the grid. The smallest possible span size is (cs width) * (cs depth) * (ch height)
. (Which is a single voxel.)
The standard process for buidling a heightfield is to allocate it using rcAllocHeightfield, initialize it using rcCreateHeightfield, then add spans using the various helper functions such as rcRasterizeTriangle.
Building a heightfield is one of the first steps in creating a polygon mesh from source geometry. After it is populated, it is used to build a rcCompactHeightfield.
Example of iterating the spans in a heightfield:
rcHeightfield::rcHeightfield | ( | ) |
rcHeightfield::~rcHeightfield | ( | ) |
float rcHeightfield::bmax[3] |
The maximum bounds in world space. [(x, y, z)].
float rcHeightfield::bmin[3] |
The minimum bounds in world space. [(x, y, z)].
float rcHeightfield::ch |
The height of each cell. (The minimum increment along the y-axis.)
float rcHeightfield::cs |
The size of each cell. (On the xz-plane.)
rcSpan* rcHeightfield::freelist |
The next free span.
int rcHeightfield::height |
The height of the heightfield. (Along the z-axis in cell units.)
rcSpanPool* rcHeightfield::pools |
Linked list of span pools.
rcSpan** rcHeightfield::spans |
Heightfield of spans (width*height).
int rcHeightfield::width |
The width of the heightfield. (Along the x-axis in cell units.)