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

Classes

struct  rcLayerRegionMonotone
 
struct  rcLayerSweepSpan
 
struct  rcLayerRegion
 

Macros

#define _USE_MATH_DEFINES
 

Functions

bool overlapRange (const rcSpanUInt amin, const rcSpanUInt amax, const rcSpanUInt bmin, const rcSpanUInt bmax)
 
bool rcBuildHeightfieldLayersMonotone (rcContext *ctx, rcCompactHeightfield &chf, const rcBorderSize borderSize, const int walkableHeight, rcHeightfieldLayerSet &lset)
 
bool rcBuildHeightfieldLayersChunky (rcContext *ctx, rcCompactHeightfield &chf, const rcBorderSize borderSize, const int walkableHeight, const int chunkSize, rcHeightfieldLayerSet &lset)
 
bool rcGatherRegionsNoFilter (rcContext *ctx, rcCompactHeightfield &chf, const rcBorderSize borderSize, unsigned short *spanBuf4)
 helper function from RecastRegion.cpp, requires distance data in compact height field
 
bool rcBuildHeightfieldLayers (rcContext *ctx, rcCompactHeightfield &chf, const rcBorderSize borderSize, const int walkableHeight, rcHeightfieldLayerSet &lset)
 

Macro Definition Documentation

◆ _USE_MATH_DEFINES

#define _USE_MATH_DEFINES

Function Documentation

◆ overlapRange()

bool overlapRange ( const rcSpanUInt  amin,
const rcSpanUInt  amax,
const rcSpanUInt  bmin,
const rcSpanUInt  bmax 
)
inline

◆ rcBuildHeightfieldLayers()

bool rcBuildHeightfieldLayers ( rcContext ctx,
rcCompactHeightfield chf,
const rcBorderSize  borderSize,
const int  walkableHeight,
rcHeightfieldLayerSet lset 
)

See the rcConfig documentation for more information on the configuration parameters.

See also
rcAllocHeightfieldLayerSet, rcCompactHeightfield, rcHeightfieldLayerSet, rcConfig

◆ rcBuildHeightfieldLayersChunky()

bool rcBuildHeightfieldLayersChunky ( rcContext ctx,
rcCompactHeightfield chf,
const rcBorderSize  borderSize,
const int  walkableHeight,
const int  chunkSize,
rcHeightfieldLayerSet lset 
)

Builds a layer set from the specified compact heightfield.

Parameters
[in,out]ctxThe build context to use during the operation.
[in]chfA fully built compact heightfield.
[in]borderSizeThe size of the non-navigable border around the heightfield. [Limit: >=0] [Units: vx]
[in]walkableHeightMinimum floor to 'ceiling' height that will still allow the floor area to be considered walkable. [Limit: >= 3] [Units: vx]
[in]chunkSizeSize of chunk of subregion [Units: vx]
[out]lsetThe resulting layer set. (Must be pre-allocated.)
Returns
True if the operation completed successfully.

◆ rcBuildHeightfieldLayersMonotone()

bool rcBuildHeightfieldLayersMonotone ( rcContext ctx,
rcCompactHeightfield chf,
const rcBorderSize  borderSize,
const int  walkableHeight,
rcHeightfieldLayerSet lset 
)

See the rcConfig documentation for more information on the configuration parameters.

See also
rcAllocHeightfieldLayerSet, rcCompactHeightfield, rcHeightfieldLayerSet, rcConfig

◆ rcGatherRegionsNoFilter()

bool rcGatherRegionsNoFilter ( rcContext ctx,
rcCompactHeightfield chf,
const rcBorderSize  borderSize,
unsigned short spanBuf4 
)

helper function from RecastRegion.cpp, requires distance data in compact height field

@UE: rcBuildRegions is now split into two functions: gathering regions and merging them it allows reusing existing code for building layer set (flood fill based partitioning)

spanBuf4 is temporary buffer, allocated and freed by caller (size = chf.spanCount * 4)