Recast Navigation
Navigation-mesh Toolset for Games
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...
 
unsigned char area
 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

◆ area

unsigned char rcContour::area

The area id of the contour.

◆ nrverts

int rcContour::nrverts

The number of vertices in the raw contour.

◆ nverts

int rcContour::nverts

The number of vertices in the simplified contour.

◆ reg

unsigned short rcContour::reg

The region id of the contour.

◆ rverts

rcContour::rverts

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

See verts for information on element layout.

◆ verts

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.
}
static const int RC_AREA_BORDER
Area border flag.
Definition: Recast.h:611
static const int RC_CONTOUR_REG_MASK
Applied to the region id field of contour vertices in order to extract the region id.
Definition: Recast.h:625
static const int RC_BORDER_VERTEX
Border vertex flag.
Definition: Recast.h:604
int * verts
Simplified contour vertex and connection data. [Size: 4 * nverts].
Definition: Recast.h:422

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