UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
RecastArea.cpp File Reference
#include "CoreMinimal.h"
#include "Recast/Recast.h"
#include "Recast/RecastAlloc.h"
#include "Recast/RecastAssert.h"

Macros

#define _USE_MATH_DEFINES
 

Functions

bool rcErodeWalkableArea (rcContext *ctx, int radius, rcCompactHeightfield &chf)
 
void SeedWalkableAreasErode (int w, int h, int lowSpanHeight, int lowSpanSeed, const rcCompactHeightfield &chf, unsigned char *dist, unsigned char *seed)
 
void SeedWalkableAreasErodeFiltered (int w, int h, int lowSpanHeight, int lowSpanSeed, const rcCompactHeightfield &chf, unsigned char *dist, unsigned char *seed)
 
void FilterLowHeightSpans (int w, int h, int lowSpanHeight, unsigned char areaId, const rcCompactHeightfield &chf)
 
bool rcErodeWalkableAndLowAreas (rcContext *ctx, int radius, unsigned int height, unsigned char areaId, unsigned char filterFlags, rcCompactHeightfield &chf)
 
bool rcMedianFilterWalkableArea (rcContext *ctx, rcCompactHeightfield &chf)
 
bool rcMarkLowAreas (rcContext *ctx, unsigned int height, unsigned char areaId, rcCompactHeightfield &chf)
 
void rcMarkBoxArea (rcContext *ctx, const rcReal *bmin, const rcReal *bmax, unsigned char areaId, rcCompactHeightfield &chf)
 
void rcMarkConvexPolyArea (rcContext *ctx, const rcReal *verts, const int nverts, const rcReal hmin, const rcReal hmax, unsigned char areaId, rcCompactHeightfield &chf)
 
int rcOffsetPoly (const rcReal *verts, const int nverts, const rcReal offset, rcReal *outVerts, const int maxOutVerts)
 
void rcMarkCylinderArea (rcContext *ctx, const rcReal *pos, const rcReal r, const rcReal h, unsigned char areaId, rcCompactHeightfield &chf)
 
void rcReplaceBoxArea (rcContext *ctx, const rcReal *bmin, const rcReal *bmax, unsigned char areaId, unsigned char filterAreaId, rcCompactHeightfield &chf)
 
void rcReplaceConvexPolyArea (rcContext *ctx, const rcReal *verts, const int nverts, const rcReal hmin, const rcReal hmax, unsigned char areaId, unsigned char filterAreaId, rcCompactHeightfield &chf)
 
void rcReplaceCylinderArea (rcContext *ctx, const rcReal *pos, const rcReal r, const rcReal h, unsigned char areaId, unsigned char filterAreaId, rcCompactHeightfield &chf)
 

Macro Definition Documentation

◆ _USE_MATH_DEFINES

#define _USE_MATH_DEFINES

Function Documentation

◆ FilterLowHeightSpans()

void FilterLowHeightSpans ( int  w,
int  h,
int  lowSpanHeight,
unsigned char  areaId,
const rcCompactHeightfield chf 
)

◆ rcErodeWalkableAndLowAreas()

bool rcErodeWalkableAndLowAreas ( rcContext ctx,
int  radius,
unsigned int  height,
unsigned char  areaId,
unsigned char  filterFlags,
rcCompactHeightfield chf 
)

Basically, any spans that are closer to a boundary or obstruction than the specified radius are marked as unwalkable.

This method is usually called immediately after the heightfield has been built.

See also
rcCompactHeightfield, rcBuildCompactHeightfield, rcConfig::walkableRadius

◆ rcErodeWalkableArea()

bool rcErodeWalkableArea ( rcContext ctx,
int  radius,
rcCompactHeightfield chf 
)

Basically, any spans that are closer to a boundary or obstruction than the specified radius are marked as unwalkable.

This method is usually called immediately after the heightfield has been built.

See also
rcCompactHeightfield, rcBuildCompactHeightfield, rcConfig::walkableRadius

◆ rcMarkBoxArea()

void rcMarkBoxArea ( rcContext ctx,
const rcReal bmin,
const rcReal bmax,
unsigned char  areaId,
rcCompactHeightfield chf 
)

The value of spacial parameters are in world units.

See also
rcCompactHeightfield, rcMedianFilterWalkableArea

◆ rcMarkConvexPolyArea()

void rcMarkConvexPolyArea ( rcContext ctx,
const rcReal verts,
const int  nverts,
const rcReal  hmin,
const rcReal  hmax,
unsigned char  areaId,
rcCompactHeightfield chf 
)

The value of spacial parameters are in world units.

The y-values of the polygon vertices are ignored. So the polygon is effectively projected onto the xz-plane at hmin, then extruded to hmax.

See also
rcCompactHeightfield, rcMedianFilterWalkableArea

◆ rcMarkCylinderArea()

void rcMarkCylinderArea ( rcContext ctx,
const rcReal pos,
const rcReal  r,
const rcReal  h,
unsigned char  areaId,
rcCompactHeightfield chf 
)

The value of spacial parameters are in world units.

See also
rcCompactHeightfield, rcMedianFilterWalkableArea

◆ rcMarkLowAreas()

bool rcMarkLowAreas ( rcContext ctx,
unsigned int  height,
unsigned char  areaId,
rcCompactHeightfield chf 
)

Marks all spans that have insufficient free space above

Parameters
[in,out]ctxThe build context to use during the operation.
[in,out]chfA populated compact heightfield.
[in]heightHeight threshold [Units: vx]
[in]areaIdThe area id to apply [Limit: <= @RC_WALKABLE_AREA]
Returns
True if the operation completed successfully.

◆ rcMedianFilterWalkableArea()

bool rcMedianFilterWalkableArea ( rcContext ctx,
rcCompactHeightfield chf 
)

This filter is usually applied after applying area id's using functions such as rcMarkBoxArea, rcMarkConvexPolyArea, and rcMarkCylinderArea.

See also
rcCompactHeightfield

◆ rcOffsetPoly()

int rcOffsetPoly ( const rcReal verts,
const int  nverts,
const rcReal  offset,
rcReal outVerts,
const int  maxOutVerts 
)

Helper function to offset voncex polygons for rcMarkConvexPolyArea.

Parameters
[in]vertsThe vertices of the polygon [Form: (x, y, z) * nverts]
[in]nvertsThe number of vertices in the polygon.
[out]outVertsThe offset vertices (should hold up to 2 * nverts) [Form: (x, y, z) * return value]
[in]maxOutVertsThe max number of vertices that can be stored to outVerts.
Returns
Number of vertices in the offset polygon or 0 if too few vertices in outVerts.

◆ rcReplaceBoxArea()

void rcReplaceBoxArea ( rcContext ctx,
const rcReal bmin,
const rcReal bmax,
unsigned char  areaId,
unsigned char  filterAreaId,
rcCompactHeightfield chf 
)

The value of spacial parameters are in world units.

See also
rcCompactHeightfield, rcMedianFilterWalkableArea

◆ rcReplaceConvexPolyArea()

void rcReplaceConvexPolyArea ( rcContext ctx,
const rcReal verts,
const int  nverts,
const rcReal  hmin,
const rcReal  hmax,
unsigned char  areaId,
unsigned char  filterAreaId,
rcCompactHeightfield chf 
)

The value of spacial parameters are in world units.

The y-values of the polygon vertices are ignored. So the polygon is effectively projected onto the xz-plane at hmin, then extruded to hmax.

See also
rcCompactHeightfield, rcMedianFilterWalkableArea

◆ rcReplaceCylinderArea()

void rcReplaceCylinderArea ( rcContext ctx,
const rcReal pos,
const rcReal  r,
const rcReal  h,
unsigned char  areaId,
unsigned char  filterAreaId,
rcCompactHeightfield chf 
)

The value of spacial parameters are in world units.

See also
rcCompactHeightfield, rcMedianFilterWalkableArea

◆ SeedWalkableAreasErode()

void SeedWalkableAreasErode ( int  w,
int  h,
int  lowSpanHeight,
int  lowSpanSeed,
const rcCompactHeightfield chf,
unsigned char dist,
unsigned char seed 
)

◆ SeedWalkableAreasErodeFiltered()

void SeedWalkableAreasErodeFiltered ( int  w,
int  h,
int  lowSpanHeight,
int  lowSpanSeed,
const rcCompactHeightfield chf,
unsigned char dist,
unsigned char seed 
)