Recast Navigation  1.0.35
rcContour Struct Reference

Represents a simple, non-overlapping contour in field space. More...

#include <Recast.h>

Public Attributes

int * verts
 Simplified contour vertex and connection data. [Size: 4 * nverts]. More...
 
int nverts
 The number of vertices in the simplified contour. More...
 
int * rverts
 Raw contour vertex and connection data. [Size: 4 * nrverts]. More...
 
int nrverts
 The number of vertices in the raw contour. More...
 
unsigned short reg
 The region id of the contour. More...
 
navAreaMask areaMask
 The area id of the contour. More...
 

Description

Represents a simple, non-overlapping contour in field space.

A contour only exists within the context of a rcContourSet object.

While the height of the contour's border may vary, the contour will always form a simple polygon when projected onto the xz-plane.

Example of converting vertices into world space:

// Where cset is the rcContourSet object to which the contour belongs.
float worldX = cset.bmin[0] + vertX * cset.cs;
float worldY = cset.bmin[1] + vertY * cset.ch;
float worldZ = cset.bmin[2] + vertZ * cset.cs;
See also
rcContourSet

Member Data Documentation

navAreaMask rcContour::areaMask

The area id of the contour.

int rcContour::nrverts

The number of vertices in the raw contour.

int rcContour::nverts

The number of vertices in the simplified contour.

unsigned short rcContour::reg

The region id of the contour.

rcContour::rverts

Raw contour vertex and connection data. [Size: 4 * nrverts].

See verts for information on element layout.

rcContour::verts

Simplified contour vertex and connection data. [Size: 4 * nverts].

The simplified contour is a version of the raw contour with all 'unnecessary' vertices removed. Whether a vertex is considered unnecessary depends on the contour build process.

The data format is as follows: (x, y, z, r) * nverts

A contour edge is formed by the current and next vertex. The r-value represents region and connection information for the edge. For example:

int r = verts[i*4+3];
int regionId = r & RC_CONTOUR_REG_MASK;
{
// The edge represents a solid border.
}
{
// The edge represents a transition between different areas.
}

The documentation for this struct was generated from the following files: