Recast Navigation
Navigation-mesh Toolset for Games
Recast.h File Reference

Go to the source code of this file.

Classes

class  rcContext
 Provides an interface for optional logging and performance tracking of the Recast build process. More...
 
class  rcScopedTimer
 A helper to first start a timer and then stop it when this helper goes out of scope. More...
 
struct  rcConfig
 Specifies a configuration to use when performing Recast builds. More...
 
struct  rcSpan
 Represents a span in a heightfield. More...
 
struct  rcSpanPool
 A memory pool used for quick allocation of spans within a heightfield. More...
 
struct  rcHeightfield
 A dynamic heightfield representing obstructed space. More...
 
struct  rcCompactCell
 Provides information on the content of a cell column in a compact heightfield. More...
 
struct  rcCompactSpan
 Represents a span of unobstructed space within a compact heightfield. More...
 
struct  rcCompactHeightfield
 A compact, static heightfield representing unobstructed space. More...
 
struct  rcHeightfieldLayer
 Represents a heightfield layer within a layer set. More...
 
struct  rcHeightfieldLayerSet
 Represents a set of heightfield layers. More...
 
struct  rcContour
 Represents a simple, non-overlapping contour in field space. More...
 
struct  rcContourSet
 Represents a group of related contours. More...
 
struct  rcPolyMesh
 Represents a polygon mesh suitable for use in building a navigation mesh. More...
 
struct  rcPolyMeshDetail
 Contains triangle meshes that represent detailed height data associated with the polygons in its associated polygon mesh object. More...
 

Enumerations

enum  rcLogCategory { RC_LOG_PROGRESS = 1 , RC_LOG_WARNING , RC_LOG_ERROR }
 Recast log categories. More...
 
enum  rcTimerLabel {
  RC_TIMER_TOTAL , RC_TIMER_TEMP , RC_TIMER_RASTERIZE_TRIANGLES , RC_TIMER_BUILD_COMPACTHEIGHTFIELD ,
  RC_TIMER_BUILD_CONTOURS , RC_TIMER_BUILD_CONTOURS_TRACE , RC_TIMER_BUILD_CONTOURS_SIMPLIFY , RC_TIMER_FILTER_BORDER ,
  RC_TIMER_FILTER_WALKABLE , RC_TIMER_MEDIAN_AREA , RC_TIMER_FILTER_LOW_OBSTACLES , RC_TIMER_BUILD_POLYMESH ,
  RC_TIMER_MERGE_POLYMESH , RC_TIMER_ERODE_AREA , RC_TIMER_MARK_BOX_AREA , RC_TIMER_MARK_CYLINDER_AREA ,
  RC_TIMER_MARK_CONVEXPOLY_AREA , RC_TIMER_BUILD_DISTANCEFIELD , RC_TIMER_BUILD_DISTANCEFIELD_DIST , RC_TIMER_BUILD_DISTANCEFIELD_BLUR ,
  RC_TIMER_BUILD_REGIONS , RC_TIMER_BUILD_REGIONS_WATERSHED , RC_TIMER_BUILD_REGIONS_EXPAND , RC_TIMER_BUILD_REGIONS_FLOOD ,
  RC_TIMER_BUILD_REGIONS_FILTER , RC_TIMER_BUILD_LAYERS , RC_TIMER_BUILD_POLYMESHDETAIL , RC_TIMER_MERGE_POLYMESHDETAIL ,
  RC_MAX_TIMERS
}
 Recast performance timer categories. More...
 
enum  rcBuildContoursFlags { RC_CONTOUR_TESS_WALL_EDGES = 0x01 , RC_CONTOUR_TESS_AREA_EDGES = 0x02 }
 Contour build flags. More...
 

Functions

template<class T >
void rcIgnoreUnused (const T &)
 Used to ignore unused function parameters and silence any compiler warnings. More...
 
Allocation Functions

Functions used to allocate and de-allocate Recast objects.

See also
rcAllocSetCustom
rcHeightfieldrcAllocHeightfield ()
 Allocates a heightfield object using the Recast allocator. More...
 
void rcFreeHeightField (rcHeightfield *heightfield)
 Frees the specified heightfield object using the Recast allocator. More...
 
rcCompactHeightfieldrcAllocCompactHeightfield ()
 Allocates a compact heightfield object using the Recast allocator. More...
 
void rcFreeCompactHeightfield (rcCompactHeightfield *compactHeightfield)
 Frees the specified compact heightfield object using the Recast allocator. More...
 
rcHeightfieldLayerSetrcAllocHeightfieldLayerSet ()
 Allocates a heightfield layer set using the Recast allocator. More...
 
void rcFreeHeightfieldLayerSet (rcHeightfieldLayerSet *layerSet)
 Frees the specified heightfield layer set using the Recast allocator. More...
 
rcContourSetrcAllocContourSet ()
 Allocates a contour set object using the Recast allocator. More...
 
void rcFreeContourSet (rcContourSet *contourSet)
 Frees the specified contour set using the Recast allocator. More...
 
rcPolyMeshrcAllocPolyMesh ()
 Allocates a polygon mesh object using the Recast allocator. More...
 
void rcFreePolyMesh (rcPolyMesh *polyMesh)
 Frees the specified polygon mesh using the Recast allocator. More...
 
rcPolyMeshDetailrcAllocPolyMeshDetail ()
 Allocates a detail mesh object using the Recast allocator. More...
 
void rcFreePolyMeshDetail (rcPolyMeshDetail *detailMesh)
 Frees the specified detail mesh using the Recast allocator. More...
 
General helper functions
template<class T >
void rcSwap (T &a, T &b)
 Swaps the values of the two parameters. More...
 
template<class T >
rcMin (T a, T b)
 Returns the minimum of two values. More...
 
template<class T >
rcMax (T a, T b)
 Returns the maximum of two values. More...
 
template<class T >
rcAbs (T a)
 Returns the absolute value. More...
 
template<class T >
rcSqr (T a)
 Returns the square of the value. More...
 
template<class T >
rcClamp (T value, T minInclusive, T maxInclusive)
 Clamps the value to the specified range. More...
 
float rcSqrt (float x)
 Returns the square root of the value. More...
 
Vector helper functions.
void rcVcross (float *dest, const float *v1, const float *v2)
 Derives the cross product of two vectors. More...
 
float rcVdot (const float *v1, const float *v2)
 Derives the dot product of two vectors. More...
 
void rcVmad (float *dest, const float *v1, const float *v2, const float s)
 Performs a scaled vector addition. More...
 
void rcVadd (float *dest, const float *v1, const float *v2)
 Performs a vector addition. More...
 
void rcVsub (float *dest, const float *v1, const float *v2)
 Performs a vector subtraction. More...
 
void rcVmin (float *mn, const float *v)
 Selects the minimum value of each element from the specified vectors. More...
 
void rcVmax (float *mx, const float *v)
 Selects the maximum value of each element from the specified vectors. More...
 
void rcVcopy (float *dest, const float *v)
 Performs a vector copy. More...
 
float rcVdist (const float *v1, const float *v2)
 Returns the distance between two points. More...
 
float rcVdistSqr (const float *v1, const float *v2)
 Returns the square of the distance between two points. More...
 
void rcVnormalize (float *v)
 Normalizes the vector. More...
 
Heightfield Functions
See also
rcHeightfield
void rcCalcBounds (const float *verts, int numVerts, float *minBounds, float *maxBounds)
 Calculates the bounding box of an array of vertices. More...
 
void rcCalcGridSize (const float *minBounds, const float *maxBounds, float cellSize, int *sizeX, int *sizeZ)
 Calculates the grid size based on the bounding box and grid cell size. More...
 
bool rcCreateHeightfield (rcContext *context, rcHeightfield &heightfield, int sizeX, int sizeZ, const float *minBounds, const float *maxBounds, float cellSize, float cellHeight)
 Initializes a new heightfield. More...
 
void rcMarkWalkableTriangles (rcContext *context, float walkableSlopeAngle, const float *verts, int numVerts, const int *tris, int numTris, unsigned char *triAreaIDs)
 Sets the area id of all triangles with a slope below the specified value to RC_WALKABLE_AREA. More...
 
void rcClearUnwalkableTriangles (rcContext *context, float walkableSlopeAngle, const float *verts, int numVerts, const int *tris, int numTris, unsigned char *triAreaIDs)
 Sets the area id of all triangles with a slope greater than or equal to the specified value to RC_NULL_AREA. More...
 
bool rcAddSpan (rcContext *context, rcHeightfield &heightfield, int x, int z, unsigned short spanMin, unsigned short spanMax, unsigned char areaID, int flagMergeThreshold)
 Adds a span to the specified heightfield. More...
 
bool rcRasterizeTriangle (rcContext *context, const float *v0, const float *v1, const float *v2, unsigned char areaID, rcHeightfield &heightfield, int flagMergeThreshold=1)
 Rasterizes a single triangle into the specified heightfield. More...
 
bool rcRasterizeTriangles (rcContext *context, const float *verts, int numVerts, const int *tris, const unsigned char *triAreaIDs, int numTris, rcHeightfield &heightfield, int flagMergeThreshold=1)
 Rasterizes an indexed triangle mesh into the specified heightfield. More...
 
bool rcRasterizeTriangles (rcContext *context, const float *verts, int numVerts, const unsigned short *tris, const unsigned char *triAreaIDs, int numTris, rcHeightfield &heightfield, int flagMergeThreshold=1)
 Rasterizes an indexed triangle mesh into the specified heightfield. More...
 
bool rcRasterizeTriangles (rcContext *context, const float *verts, const unsigned char *triAreaIDs, int numTris, rcHeightfield &heightfield, int flagMergeThreshold=1)
 Rasterizes a triangle list into the specified heightfield. More...
 
void rcFilterLowHangingWalkableObstacles (rcContext *context, int walkableClimb, rcHeightfield &heightfield)
 Marks non-walkable spans as walkable if their maximum is within walkableClimb of the span below them. More...
 
void rcFilterLedgeSpans (rcContext *context, int walkableHeight, int walkableClimb, rcHeightfield &heightfield)
 Marks spans that are ledges as not-walkable. More...
 
void rcFilterWalkableLowHeightSpans (rcContext *context, int walkableHeight, rcHeightfield &heightfield)
 Marks walkable spans as not walkable if the clearance above the span is less than the specified walkableHeight. More...
 
int rcGetHeightFieldSpanCount (rcContext *context, const rcHeightfield &heightfield)
 Returns the number of spans contained in the specified heightfield. More...
 
Compact Heightfield Functions
bool rcBuildCompactHeightfield (rcContext *context, int walkableHeight, int walkableClimb, const rcHeightfield &heightfield, rcCompactHeightfield &compactHeightfield)
 Builds a compact heightfield representing open space, from a heightfield representing solid space. More...
 
bool rcErodeWalkableArea (rcContext *context, int erosionRadius, rcCompactHeightfield &compactHeightfield)
 Erodes the walkable area within the heightfield by the specified radius. More...
 
bool rcMedianFilterWalkableArea (rcContext *context, rcCompactHeightfield &compactHeightfield)
 Applies a median filter to walkable area types (based on area id), removing noise. More...
 
void rcMarkBoxArea (rcContext *context, const float *boxMinBounds, const float *boxMaxBounds, unsigned char areaId, rcCompactHeightfield &compactHeightfield)
 Applies an area id to all spans within the specified bounding box. More...
 
void rcMarkConvexPolyArea (rcContext *context, const float *verts, int numVerts, float minY, float maxY, unsigned char areaId, rcCompactHeightfield &compactHeightfield)
 Applies the area id to the all spans within the specified convex polygon. More...
 
int rcOffsetPoly (const float *verts, int numVerts, float offset, float *outVerts, int maxOutVerts)
 Expands a convex polygon along its vertex normals by the given offset amount. More...
 
void rcMarkCylinderArea (rcContext *context, const float *position, float radius, float height, unsigned char areaId, rcCompactHeightfield &compactHeightfield)
 Applies the area id to all spans within the specified y-axis-aligned cylinder. More...
 
bool rcBuildDistanceField (rcContext *ctx, rcCompactHeightfield &chf)
 Builds the distance field for the specified compact heightfield. More...
 
bool rcBuildRegions (rcContext *ctx, rcCompactHeightfield &chf, int borderSize, int minRegionArea, int mergeRegionArea)
 Builds region data for the heightfield using watershed partitioning. More...
 
bool rcBuildLayerRegions (rcContext *ctx, rcCompactHeightfield &chf, int borderSize, int minRegionArea)
 Builds region data for the heightfield by partitioning the heightfield in non-overlapping layers. More...
 
bool rcBuildRegionsMonotone (rcContext *ctx, rcCompactHeightfield &chf, int borderSize, int minRegionArea, int mergeRegionArea)
 Builds region data for the heightfield using simple monotone partitioning. More...
 
void rcSetCon (rcCompactSpan &span, int direction, int neighborIndex)
 Sets the neighbor connection data for the specified direction. More...
 
int rcGetCon (const rcCompactSpan &span, int direction)
 Gets neighbor connection data for the specified direction. More...
 
int rcGetDirOffsetX (int direction)
 Gets the standard width (x-axis) offset for the specified direction. More...
 
int rcGetDirOffsetY (int direction)
 Gets the standard height (z-axis) offset for the specified direction. More...
 
int rcGetDirForOffset (int offsetX, int offsetZ)
 Gets the direction for the specified offset. More...
 
Layer, Contour, Polymesh, and Detail Mesh Functions
bool rcBuildHeightfieldLayers (rcContext *ctx, const rcCompactHeightfield &chf, int borderSize, int walkableHeight, rcHeightfieldLayerSet &lset)
 Builds a layer set from the specified compact heightfield. More...
 
bool rcBuildContours (rcContext *ctx, const rcCompactHeightfield &chf, float maxError, int maxEdgeLen, rcContourSet &cset, int buildFlags=RC_CONTOUR_TESS_WALL_EDGES)
 Builds a contour set from the region outlines in the provided compact heightfield. More...
 
bool rcBuildPolyMesh (rcContext *ctx, const rcContourSet &cset, const int nvp, rcPolyMesh &mesh)
 Builds a polygon mesh from the provided contours. More...
 
bool rcMergePolyMeshes (rcContext *ctx, rcPolyMesh **meshes, const int nmeshes, rcPolyMesh &mesh)
 Merges multiple polygon meshes into a single mesh. More...
 
bool rcBuildPolyMeshDetail (rcContext *ctx, const rcPolyMesh &mesh, const rcCompactHeightfield &chf, float sampleDist, float sampleMaxError, rcPolyMeshDetail &dmesh)
 Builds a detail mesh from the provided polygon mesh. More...
 
bool rcCopyPolyMesh (rcContext *ctx, const rcPolyMesh &src, rcPolyMesh &dst)
 Copies the poly mesh data from src to dst. More...
 
bool rcMergePolyMeshDetails (rcContext *ctx, rcPolyMeshDetail **meshes, const int nmeshes, rcPolyMeshDetail &mesh)
 Merges multiple detail meshes into a single detail mesh. More...
 

Variables

static const float RC_PI = 3.14159265f
 The value of PI used by Recast. More...
 
static const int RC_SPAN_HEIGHT_BITS = 13
 Defines the number of bits allocated to rcSpan::smin and rcSpan::smax. More...
 
static const int RC_SPAN_MAX_HEIGHT = (1 << RC_SPAN_HEIGHT_BITS) - 1
 Defines the maximum value for rcSpan::smin and rcSpan::smax. More...
 
static const int RC_SPANS_PER_POOL = 2048
 The number of spans allocated per span spool. More...
 
static const unsigned short RC_BORDER_REG = 0x8000
 Heightfield border flag. More...
 
static const unsigned short RC_MULTIPLE_REGS = 0
 Polygon touches multiple regions. More...
 
static const int RC_BORDER_VERTEX = 0x10000
 Border vertex flag. More...
 
static const int RC_AREA_BORDER = 0x20000
 Area border flag. More...
 
static const int RC_CONTOUR_REG_MASK = 0xffff
 Applied to the region id field of contour vertices in order to extract the region id. More...
 
static const unsigned short RC_MESH_NULL_IDX = 0xffff
 An value which indicates an invalid index within a mesh. More...
 
static const unsigned char RC_NULL_AREA = 0
 Represents the null area. More...
 
static const unsigned char RC_WALKABLE_AREA = 63
 The default area id used to indicate a walkable polygon. More...
 
static const int RC_NOT_CONNECTED = 0x3f
 The value returned by rcGetCon if the specified direction is not connected to another span. More...
 

Enumeration Type Documentation

◆ rcBuildContoursFlags

Contour build flags.

See also
rcBuildContours
Enumerator
RC_CONTOUR_TESS_WALL_EDGES 

Tessellate solid (impassable) edges during contour simplification.

RC_CONTOUR_TESS_AREA_EDGES 

Tessellate edges between areas during contour simplification.

◆ rcLogCategory

Recast log categories.

See also
rcContext
Enumerator
RC_LOG_PROGRESS 

A progress log entry.

RC_LOG_WARNING 

A warning log entry.

RC_LOG_ERROR 

An error log entry.

◆ rcTimerLabel

Recast performance timer categories.

See also
rcContext
Enumerator
RC_TIMER_TOTAL 

The user defined total time of the build.

RC_TIMER_TEMP 

A user defined build time.

RC_TIMER_RASTERIZE_TRIANGLES 

The time to rasterize the triangles. (See: rcRasterizeTriangle)

RC_TIMER_BUILD_COMPACTHEIGHTFIELD 

The time to build the compact heightfield. (See: rcBuildCompactHeightfield)

RC_TIMER_BUILD_CONTOURS 

The total time to build the contours. (See: rcBuildContours)

RC_TIMER_BUILD_CONTOURS_TRACE 

The time to trace the boundaries of the contours. (See: rcBuildContours)

RC_TIMER_BUILD_CONTOURS_SIMPLIFY 

The time to simplify the contours. (See: rcBuildContours)

RC_TIMER_FILTER_BORDER 

The time to filter ledge spans. (See: rcFilterLedgeSpans)

RC_TIMER_FILTER_WALKABLE 

The time to filter low height spans. (See: rcFilterWalkableLowHeightSpans)

RC_TIMER_MEDIAN_AREA 

The time to apply the median filter. (See: rcMedianFilterWalkableArea)

RC_TIMER_FILTER_LOW_OBSTACLES 

The time to filter low obstacles. (See: rcFilterLowHangingWalkableObstacles)

RC_TIMER_BUILD_POLYMESH 

The time to build the polygon mesh. (See: rcBuildPolyMesh)

RC_TIMER_MERGE_POLYMESH 

The time to merge polygon meshes. (See: rcMergePolyMeshes)

RC_TIMER_ERODE_AREA 

The time to erode the walkable area. (See: rcErodeWalkableArea)

RC_TIMER_MARK_BOX_AREA 

The time to mark a box area. (See: rcMarkBoxArea)

RC_TIMER_MARK_CYLINDER_AREA 

The time to mark a cylinder area. (See: rcMarkCylinderArea)

RC_TIMER_MARK_CONVEXPOLY_AREA 

The time to mark a convex polygon area. (See: rcMarkConvexPolyArea)

RC_TIMER_BUILD_DISTANCEFIELD 

The total time to build the distance field. (See: rcBuildDistanceField)

RC_TIMER_BUILD_DISTANCEFIELD_DIST 

The time to build the distances of the distance field. (See: rcBuildDistanceField)

RC_TIMER_BUILD_DISTANCEFIELD_BLUR 

The time to blur the distance field. (See: rcBuildDistanceField)

RC_TIMER_BUILD_REGIONS 

The total time to build the regions. (See: rcBuildRegions, rcBuildRegionsMonotone)

RC_TIMER_BUILD_REGIONS_WATERSHED 

The total time to apply the watershed algorithm. (See: rcBuildRegions)

RC_TIMER_BUILD_REGIONS_EXPAND 

The time to expand regions while applying the watershed algorithm. (See: rcBuildRegions)

RC_TIMER_BUILD_REGIONS_FLOOD 

The time to flood regions while applying the watershed algorithm. (See: rcBuildRegions)

RC_TIMER_BUILD_REGIONS_FILTER 

The time to filter out small regions. (See: rcBuildRegions, rcBuildRegionsMonotone)

RC_TIMER_BUILD_LAYERS 

The time to build heightfield layers. (See: rcBuildHeightfieldLayers)

RC_TIMER_BUILD_POLYMESHDETAIL 

The time to build the polygon mesh detail. (See: rcBuildPolyMeshDetail)

RC_TIMER_MERGE_POLYMESHDETAIL 

The time to merge polygon mesh details. (See: rcMergePolyMeshDetails)

RC_MAX_TIMERS 

The maximum number of timers. (Used for iterating timers.)

Function Documentation

◆ rcAbs()

template<class T >
T rcAbs ( a)
inline

Returns the absolute value.

Parameters
[in]aThe value.
Returns
The absolute value of the specified value.

◆ rcClamp()

template<class T >
T rcClamp ( value,
minInclusive,
maxInclusive 
)
inline

Clamps the value to the specified range.

Parameters
[in]valueThe value to clamp.
[in]minInclusiveThe minimum permitted return value.
[in]maxInclusiveThe maximum permitted return value.
Returns
The value, clamped to the specified range.

◆ rcIgnoreUnused()

template<class T >
void rcIgnoreUnused ( const T &  )

Used to ignore unused function parameters and silence any compiler warnings.

◆ rcMax()

template<class T >
T rcMax ( a,
b 
)
inline

Returns the maximum of two values.

Parameters
[in]aValue A
[in]bValue B
Returns
The maximum of the two values.

◆ rcMin()

template<class T >
T rcMin ( a,
b 
)
inline

Returns the minimum of two values.

Parameters
[in]aValue A
[in]bValue B
Returns
The minimum of the two values.

◆ rcSqr()

template<class T >
T rcSqr ( a)
inline

Returns the square of the value.

Parameters
[in]aThe value.
Returns
The square of the value.

◆ rcSqrt()

float rcSqrt ( float  x)

Returns the square root of the value.

Parameters
[in]xThe value.
Returns
The square root of the vlaue.

◆ rcSwap()

template<class T >
void rcSwap ( T &  a,
T &  b 
)
inline

Swaps the values of the two parameters.

Parameters
[in,out]aValue A
[in,out]bValue B

◆ rcVadd()

void rcVadd ( float *  dest,
const float *  v1,
const float *  v2 
)
inline

Performs a vector addition.

(v1 + v2)

Parameters
[out]destThe result vector. [(x, y, z)]
[in]v1The base vector. [(x, y, z)]
[in]v2The vector to add to v1. [(x, y, z)]

◆ rcVcopy()

void rcVcopy ( float *  dest,
const float *  v 
)
inline

Performs a vector copy.

Parameters
[out]destThe result. [(x, y, z)]
[in]vThe vector to copy. [(x, y, z)]

◆ rcVcross()

void rcVcross ( float *  dest,
const float *  v1,
const float *  v2 
)
inline

Derives the cross product of two vectors.

(v1 x v2)

Parameters
[out]destThe cross product. [(x, y, z)]
[in]v1A Vector [(x, y, z)]
[in]v2A vector [(x, y, z)]

◆ rcVdist()

float rcVdist ( const float *  v1,
const float *  v2 
)
inline

Returns the distance between two points.

Parameters
[in]v1A point. [(x, y, z)]
[in]v2A point. [(x, y, z)]
Returns
The distance between the two points.

◆ rcVdistSqr()

float rcVdistSqr ( const float *  v1,
const float *  v2 
)
inline

Returns the square of the distance between two points.

Parameters
[in]v1A point. [(x, y, z)]
[in]v2A point. [(x, y, z)]
Returns
The square of the distance between the two points.

◆ rcVdot()

float rcVdot ( const float *  v1,
const float *  v2 
)
inline

Derives the dot product of two vectors.

(v1 . v2)

Parameters
[in]v1A Vector [(x, y, z)]
[in]v2A vector [(x, y, z)]
Returns
The dot product.

◆ rcVmad()

void rcVmad ( float *  dest,
const float *  v1,
const float *  v2,
const float  s 
)
inline

Performs a scaled vector addition.

(v1 + (v2 * s))

Parameters
[out]destThe result vector. [(x, y, z)]
[in]v1The base vector. [(x, y, z)]
[in]v2The vector to scale and add to v1. [(x, y, z)]
[in]sThe amount to scale v2 by before adding to v1.

◆ rcVmax()

void rcVmax ( float *  mx,
const float *  v 
)
inline

Selects the maximum value of each element from the specified vectors.

Parameters
[in,out]mxA vector. (Will be updated with the result.) [(x, y, z)]
[in]vA vector. [(x, y, z)]

◆ rcVmin()

void rcVmin ( float *  mn,
const float *  v 
)
inline

Selects the minimum value of each element from the specified vectors.

Parameters
[in,out]mnA vector. (Will be updated with the result.) [(x, y, z)]
[in]vA vector. [(x, y, z)]

◆ rcVnormalize()

void rcVnormalize ( float *  v)
inline

Normalizes the vector.

Parameters
[in,out]vThe vector to normalize. [(x, y, z)]

◆ rcVsub()

void rcVsub ( float *  dest,
const float *  v1,
const float *  v2 
)
inline

Performs a vector subtraction.

(v1 - v2)

Parameters
[out]destThe result vector. [(x, y, z)]
[in]v1The base vector. [(x, y, z)]
[in]v2The vector to subtract from v1. [(x, y, z)]

Variable Documentation

◆ RC_AREA_BORDER

const int RC_AREA_BORDER = 0x20000
static

Area border flag.

If a region ID has this bit set, then the associated element lies on the border of an area. (Used during the region and contour build process.)

See also
rcCompactSpan::reg, rcContour::verts, rcContour::rverts

◆ RC_BORDER_REG

const unsigned short RC_BORDER_REG = 0x8000
static

Heightfield border flag.

If a heightfield region ID has this bit set, then the region is a border region and its spans are considered un-walkable. (Used during the region and contour build process.)

See also
rcCompactSpan::reg

◆ RC_BORDER_VERTEX

const int RC_BORDER_VERTEX = 0x10000
static

Border vertex flag.

If a region ID has this bit set, then the associated element lies on a tile border. If a contour vertex's region ID has this bit set, the vertex will later be removed in order to match the segments and vertices at tile boundaries. (Used during the build process.)

See also
rcCompactSpan::reg, rcContour::verts, rcContour::rverts

◆ RC_CONTOUR_REG_MASK

const int RC_CONTOUR_REG_MASK = 0xffff
static

Applied to the region id field of contour vertices in order to extract the region id.

The region id field of a vertex may have several flags applied to it. So the fields value can't be used directly.

See also
rcContour::verts, rcContour::rverts

◆ RC_MESH_NULL_IDX

const unsigned short RC_MESH_NULL_IDX = 0xffff
static

An value which indicates an invalid index within a mesh.

Note
This does not necessarily indicate an error.
See also
rcPolyMesh::polys

◆ RC_MULTIPLE_REGS

const unsigned short RC_MULTIPLE_REGS = 0
static

Polygon touches multiple regions.

If a polygon has this region ID it was merged with or created from polygons of different regions during the polymesh build step that removes redundant border vertices. (Used during the polymesh and detail polymesh build processes)

See also
rcPolyMesh::regs

◆ RC_NOT_CONNECTED

const int RC_NOT_CONNECTED = 0x3f
static

The value returned by rcGetCon if the specified direction is not connected to another span.

(Has no neighbor.)

◆ RC_NULL_AREA

const unsigned char RC_NULL_AREA = 0
static

Represents the null area.

When a data element is given this value it is considered to no longer be assigned to a usable area. (E.g. It is un-walkable.)

◆ RC_PI

const float RC_PI = 3.14159265f
static

The value of PI used by Recast.

◆ RC_SPAN_HEIGHT_BITS

const int RC_SPAN_HEIGHT_BITS = 13
static

Defines the number of bits allocated to rcSpan::smin and rcSpan::smax.

◆ RC_SPAN_MAX_HEIGHT

const int RC_SPAN_MAX_HEIGHT = (1 << RC_SPAN_HEIGHT_BITS) - 1
static

Defines the maximum value for rcSpan::smin and rcSpan::smax.

◆ RC_SPANS_PER_POOL

const int RC_SPANS_PER_POOL = 2048
static

The number of spans allocated per span spool.

See also
rcSpanPool

◆ RC_WALKABLE_AREA

const unsigned char RC_WALKABLE_AREA = 63
static

The default area id used to indicate a walkable polygon.

This is also the maximum allowed area id, and the only non-null area id recognized by some steps in the build process.