![]() |
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.) | |
| int | height |
| The height of the heightfield. (Along the z-axis in cell units.) | |
| float | bmin [3] |
| The minimum bounds in world space. [(x, y, z)]. | |
| float | bmax [3] |
| The maximum bounds in world space. [(x, y, z)]. | |
| float | cs |
| The size of each cell. (On the xz-plane.) | |
| float | ch |
| The height of each cell. (The minimum increment along the y-axis.) | |
| rcSpan ** | spans |
| Heightfield of spans (width*height). | |
| rcSpanPool * | pools |
| Linked list of span pools. | |
| rcSpan * | freelist |
| The next free span. | |
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.)