Recast

Windows
MacOS
Linux

Classes

Name

Description

Public struct

rcClusterSet

Represents group of clusters

Public struct

rcCompactCell

Provides information on the content of a cell column in a compact heightfield.

Public struct

rcCompactHeightfield

A compact, static heightfield representing unobstructed space.

Public struct

rcCompactSpan

Represents a span of unobstructed space within a compact heightfield.

Public struct

rcConfig

Specifies a configuration to use when performing Recast builds.

Public class

rcContext

Provides an interface for optional logging and performance tracking of the Recast build process.

Public struct

rcContour

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

Public struct

rcContourSet

Represents a group of related contours.

Public struct

rcEdgeHit

Public struct

rcHeightfield

A dynamic heightfield representing obstructed space.

Public struct

rcHeightfieldLayer

Represents a heightfield layer within a layer set.

Public struct

rcHeightfieldLayerSet

Represents a set of heightfield layers.

Public class

rcIntArray

A simple dynamic array of integers.

Public struct

rcPolyMesh

Represents a polygon mesh suitable for use in building a navigation mesh.

Public struct

rcPolyMeshDetail

Contains triangle meshes that represent detailed height data associated with the polygons in its associated polygon mesh object.

Public struct

rcRowExt

Public class

rcScopedDelete

A simple helper class used to delete an array when it goes out of scope.

Public class

rcScopedStructArrayDelete

A simple helper class used to delete an array of instances of structs, that require cleaning up by calling destructor on every instance before release.

Public struct

rcSpan

Represents a span in a heightfield.

Public struct

rcSpanCache

Public struct

rcSpanData

Represents data of span in a heightfield.

Public struct

rcSpanPool

A memory pool used for quick allocation of spans within a heightfield.

Public struct

rcTempSpan

Constants

Name

Description

RC_AREA_BORDER

Area border flag.

RC_BORDER_REG

Heighfield border flag.

RC_BORDER_VERTEX

Border vertex flag.

RC_CONTOUR_REG_MASK

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

RC_MESH_NULL_IDX

An value which indicates an invalid index within a mesh.

RC_NOT_CONNECTED

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

RC_NULL_AREA

Represents the null area.

RC_PI

The value of PI used by Recast.

RC_SPAN_HEIGHT_BITS

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

RC_SPAN_MAX_HEIGHT

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

RC_SPANS_PER_POOL

The number of spans allocated per span spool.

RC_WALKABLE_AREA

The default area id used to indicate a walkable polygon.

Typedefs

Name

Description

rcAllocFunc

A memory allocation function.

rcFreeFunc

A memory deallocation function.

Enums

Name

Description

Public enum

rcAllocHint

Copyright (c) 2009-2010 Mikko Mononen memon@inside.org

Public enum

rcBuildContoursFlags

Contour build flags.

Public enum

rcFilterLowAreaFlags

UE4.

Public enum

rcLogCategory

Recast log categories.

Public enum

rcRegionPartitioning

Region partitioning methods

Public enum

rcTimerLabel

Recast performance timer categories.

Functions

Name Description

Public function

T

 

rcAbs

(
    T a
)

Returns the absolute value.

Public function

void

 

rcAddSpan

(
    rcContext* ctx,
    rcHeightfield& hf,
    const int x,
    const int y,
    const unsigned short smin,
    const unsigned short smax,
    const unsigned char area,
    const int flagMergeThr
)

Adds a span to the specified heightfield.

Public function

void

 

rcAddSpans

(
    rcContext* ctx,
    rcHeightfield& hf,
    const int flagMergeThr,
    const rcSpanCache* cachedSpans,
    const int nspans
)

Public function

void *

 

rcAlloc

(
    int size,
    rcAllocHint hint
)

Allocates a memory block.

Public function

rcClusterSet *

 

rcAllocClusterSet()

Allocates a cluster set object using the Recast allocator.

Public function

rcCompactHeightfield *

 

rcAllocCompactHeightfield()

Allocates a compact heightfield object using the Recast allocator.

Public function

rcContourSet *

 

rcAllocContourSet()

Allocates a contour set object using the Recast allocator.

Public function

rcHeightfield *

 

rcAllocHeightfield()

Allocates a heightfield object using the Recast allocator.

Public function

rcHeightfieldLayerSet *

 

rcAllocHeightfieldLayerSet()

Allocates a heightfield layer set using the Recast allocator.

Public function

rcPolyMesh *

 

rcAllocPolyMesh()

Allocates a polygon mesh object using the Recast allocator.

Public function

rcPolyMeshDetail *

 

rcAllocPolyMeshDetail()

Allocates a detail mesh object using the Recast allocator.

Public function

void

 

rcAllocSetCustom

(
    rcAllocFunc* allocFunc,
    rcFreeFunc* freeFunc
)

Sets the base custom allocation functions to be used by Recast.

Public function

bool

 

rcBuildClusters

(
    rcContext* ctx,
    rcContourSet& cset,
    rcClusterSet& clusters
)

Builds a cluster set from contours

Public function

bool

 

rcBuildCompactHeightfield

(
    rcContext* ctx,
    const int walkableHeight,
    const int walkableClimb,
    rcHeightfield& hf,
    rcCompactHeightfield& chf
)

Builds a compact heightfield representing open space, from a heightfield representing solid space.

Public function

bool

 

rcBuildContours

(
    rcContext* ctx,
    rcCompactHeightfield& chf,
    const float maxError,
    const int maxEdgeLen,
    rcContourSet& cset,
    const int flags
)

Builds a contour set from the region outlines in the provided compact heightfield.

Public function

bool

 

rcBuildDistanceField

(
    rcContext* ctx,
    rcCompactHeightfield& chf
)

Builds the distance field for the specified compact heightfield.

Public function

bool

 

rcBuildHeightfieldLayers

(
    rcContext* ctx,
    rcCompactHeightfield& chf,
    const int borderSize,
    const int walkableHeight,
    rcHeightfieldLayerSet& lset
)

Builds a layer set from the specified compact heightfield.

Public function

bool

 

rcBuildHeightfieldLayersChunky

(
    rcContext* ctx,
    rcCompactHeightfield& chf,
    const int borderSize,
    const int walkableHeight,
    const int chunkSize,
    rcHeightfieldLayerSet& lset
)

Builds a layer set from the specified compact heightfield.

Public function

bool

 

rcBuildHeightfieldLayersMonotone

(
    rcContext* ctx,
    rcCompactHeightfield& chf,
    const int borderSize,
    const int walkableHeight,
    rcHeightfieldLayerSet& lset
)

Builds a layer set from the specified compact heightfield.

Public function

bool

 

rcBuildPolyMesh

(
    rcContext* ctx,
    rcContourSet& cset,
    const int nvp,
    rcPolyMesh& mesh
)

Builds a polygon mesh from the provided contours.

Public function

bool

 

rcBuildPolyMeshDetail

(
    rcContext* ctx,
    const rcPolyMesh& mesh,
    const rcCompactHeightfield& chf,
    const float sampleDist,
    const float sampleMaxError,
    rcPolyMeshDetail& dmesh
)

Builds a detail mesh from the provided polygon mesh.

Public function

bool

 

rcBuildRegions

(
    rcContext* ctx,
    rcCompactHeightfield& chf,
    const int borderSize,
    const int minRegionArea,
    const int mergeRegionArea
)

Builds region data for the heightfield using watershed partitioning.

Public function

bool

 

rcBuildRegionsChunky

(
    rcContext* ctx,
    rcCompactHeightfield& chf,
    const int borderSize,
    const int minRegionArea,
    const int mergeRegionArea,
    const int chunkSize
)

Builds region data for the heightfield using simple monotone partitioning.

Public function

bool

 

rcBuildRegionsMonotone

(
    rcContext* ctx,
    rcCompactHeightfield& chf,
    const int borderSize,
    const int minRegionArea,
    const int mergeRegionArea
)

Builds region data for the heightfield using simple monotone partitioning.

Public function

void

 

rcCacheSpans

(
    rcContext* ctx,
    rcHeightfield& hf,
    rcSpanCache* cachedSpans
)

Public function

void

 

rcCalcBounds

(
    const float* verts,
    int nv,
    float* bmin,
    float* bmax
)

Calculates the bounding box of an array of vertices.

Public function

void

 

rcCalcGridSize

(
    const float* bmin,
    const float* bmax,
    float cs,
    int* w,
    int* h
)

Calculates the grid size based on the bounding box and grid cell size.

Public function

T

 

rcClamp

(
    T v,
    T mn,
    T mx
)

Clamps the value to the specified range.

Public function

void

 

rcClearUnwalkableTriangles

(
    rcContext* ctx,
    const float walkableSlopeAngle,
    const float* verts,
    int nv,
    const int* tris,
    int nt,
    unsigned char* areas
)

Sets the area id of all triangles with a slope greater than or equal to the specified value to #RC_NULL_AREA.

Public function

bool

 

rcCopyPolyMesh

(
    rcContext* ctx,
    const rcPolyMesh& src,
    rcPolyMesh& dst
)

Copies the poly mesh data from src to dst.

Public function

int

 

rcCountSpans

(
    rcContext* ctx,
    rcHeightfield& hf
)

Public function

bool

 

rcCreateHeightfield

(
    rcContext* ctx,
    rcHeightfield& hf,
    int width,
    int height,
    const float* bmin,
    const float* bmax,
    float cs,
    float ch
)

Initializes a new heightfield.

Public function

bool

 

rcErodeWalkableAndLowAreas

(
    rcContext* ctx,
    int radius,
    unsigned int height,
    unsigned char areaId,
    unsigned char filterFlags,
    rcCompactHeightfield& chf
)

Erodes the walkable area within the heightfield by the specified radius.

Public function

bool

 

rcErodeWalkableArea

(
    rcContext* ctx,
    int radius,
    rcCompactHeightfield& chf
)

Erodes the walkable area within the heightfield by the specified radius.

Public function

void

 

rcFilterLedgeSpans

(
    rcContext* ctx,
    const int walkableHeight,
    const int walkableClimb,
    rcHeightfield& solid
)

Marks spans that are ledges as not-walkable.

Public function

void

 

rcFilterLowHangingWalkableObstacles

(
    rcContext* ctx,
    const int walkableClimb,
    rcHeightfield& solid
)

Marks non-walkable spans as walkable if their maximum is within `walkableClimp_ of a walkable neihbor.

Public function

void

 

rcFilterWalkableLowHeightSpans

(
    rcContext* ctx,
    int walkableHeight,
    rcHeightfield& solid
)

Marks walkable spans as not walkable if the clearence above the span is less than the specified height.

Public function

void

 

rcFilterWalkableLowHeightSpansSequences

(
    rcContext* ctx,
    int walkableHeight,
    rcHeightfield& solid
)

Marks walkable spans as not walkable if the clearence above the span is less than the specified height.

Public function

void

 

rcFree

(
    void* ptr
)

Deallocates a memory block.

Public function

void

 

rcFreeClusterSet

(
    rcClusterSet* clset
)

Frees the specified cluster set using the Recast allocator.

Public function

void

 

rcFreeCompactHeightfield

(
    rcCompactHeightfield* chf
)

Frees the specified compact heightfield object using the Recast allocator.

Public function

void

 

rcFreeContourSet

(
    rcContourSet* cset
)

Frees the specified contour set using the Recast allocator.

Public function

void

 

rcFreeHeightField

(
    rcHeightfield* hf
)

Frees the specified heightfield object using the Recast allocator.

Public function

void

 

rcFreeHeightfieldLayerSet

(
    rcHeightfieldLayerSet* lset
)

Frees the specified heightfield layer set using the Recast allocator.

Public function

void

 

rcFreePolyMesh

(
    rcPolyMesh* pmesh
)

Frees the specified polygon mesh using the Recast allocator.

Public function

void

 

rcFreePolyMeshDetail

(
    rcPolyMeshDetail* dmesh
)

Frees the specified detail mesh using the Recast allocator.

Public function

int

 

rcGetCon

(
    const rcCompactSpan& s,
    int dir
)

Gets neighbor connection data for the specified direction.

Public function

int

 

rcGetDirOffsetX

(
    int dir
)

Gets the standard width (x-axis) offset for the specified direction.

Public function

int

 

rcGetDirOffsetY

(
    int dir
)

Gets the standard height (z-axis) offset for the specified direction.

Public function

int

 

rcGetHeightFieldSpanCount

(
    rcContext* ctx,
    rcHeightfield& hf
)

Returns the number of spans contained in the specified heightfield.

Public function

void

 

rcMarkBoxArea

(
    rcContext* ctx,
    const float* bmin,
    const float* bmax,
    unsigned char areaId,
    rcCompactHeightfield& chf
)

Applies an area id to all spans within the specified bounding box.

Public function

void

 

rcMarkConvexPolyArea

(
    rcContext* ctx,
    const float* verts,
    const int nverts,
    const float hmin,
    const float hmax,
    unsigned char areaId,
    rcCompactHeightfield& chf
)

Applies the area id to the all spans within the specified convex polygon.

Public function

void

 

rcMarkCylinderArea

(
    rcContext* ctx,
    const float* pos,
    const float r,
    const float h,
    unsigned char areaId,
    rcCompactHeightfield& chf
)

Applies the area id to all spans within the specified cylinder.

Public function

bool

 

rcMarkLowAreas

(
    rcContext* ctx,
    unsigned int height,
    unsigned char areaId,
    rcCompactHeightfield& chf
)

Marks all spans that have insufficient free space above

Public function

void

 

rcMarkWalkableTriangles

(
    rcContext* ctx,
    const float walkableSlopeAngle,
    const float* verts,
    int nv,
    const int* tris,
    int nt,
    unsigned char* areas
)

Sets the area id of all triangles with a slope below the specified value to #RC_WALKABLE_AREA.

Public function

void

 

rcMarkWalkableTrianglesCos

(
    rcContext* ctx,
    const float walkableSlopeCos,
    const float* verts,
    int nv,
    const int* tris,
    int nt,
    unsigned char* areas
)

Sets the area id of all triangles with a slope below the specified value to #RC_WALKABLE_AREA.

Public function

T

 

rcMax

(
    T a,
    T b
)

Returns the maximum of two values.

Public function

bool

 

rcMedianFilterWalkableArea

(
    rcContext* ctx,
    rcCompactHeightfield& chf
)

Applies a median filter to walkable area types (based on area id), removing noise.

Public function

void

 

rcMemCpy

(
    void* dst,
    void* src,
    int size
)

Public function

bool

 

rcMergePolyMeshDetails

(
    rcContext* ctx,
    rcPolyMeshDetail** meshes,
    const int nmeshes,
    rcPolyMeshDetail& mesh
)

Merges multiple detail meshes into a single detail mesh.

Public function

bool

 

rcMergePolyMeshes

(
    rcContext* ctx,
    rcPolyMesh** meshes,
    const int nmeshes,
    rcPolyMesh& mesh
)

Merges multiple polygon meshes into a single mesh.

Public function

T

 

rcMin

(
    T a,
    T b
)

Returns the minimum of two values.

Public function

int

 

rcOffsetPoly

(
    const float* verts,
    const int nverts,
    const float offset,
    float* outVerts,
    const int maxOutVerts
)

Helper function to offset voncex polygons for rcMarkConvexPolyArea.

Public function

void

 

rcRasterizeTriangle

(
    rcContext* ctx,
    const float* v0,
    const float* v1,
    const float* v2,
    const unsigned char area,
    rcHeightfield& solid,
    const int flagMergeThr
)

Rasterizes a triangle into the specified heightfield.

Public function

void

 

rcRasterizeTriangles

(
    rcContext* ctx,
    const float* verts,
    const unsigned char* areas,
    const int nt,
    rcHeightfield& solid,
    const int flagMergeThr
)

Rasterizes triangles into the specified heightfield.

Public function

void

 

rcRasterizeTriangles

(
    rcContext* ctx,
    const float* verts,
    const int nv,
    const unsigned short* tris,
    const unsigned char* areas,
    const int nt,
    rcHeightfield& solid,
    const int flagMergeThr
)

Rasterizes an indexed triangle mesh into the specified heightfield.

Public function

void

 

rcRasterizeTriangles

(
    rcContext* ctx,
    const float* verts,
    const int nv,
    const int* tris,
    const unsigned char* areas,
    const int nt,
    rcHeightfield& solid,
    const int flagMergeThr
)

Rasterizes an indexed triangle mesh into the specified heightfield.

Public function

void

 

rcReplaceBoxArea

(
    rcContext* ctx,
    const float* bmin,
    const float* bmax,
    unsigned char areaId,
    unsigned char filterAreaId,
    rcCompactHeightfield& chf
)

Replaces an area id in spans with matching filter area within the specified bounding box.

Public function

void

 

rcReplaceConvexPolyArea

(
    rcContext* ctx,
    const float* verts,
    const int nverts,
    const float hmin,
    const float hmax,
    unsigned char areaId,
    unsigned char filterAreaId,
    rcCompactHeightfield& chf
)

Replaces an area id in spans with matching filter area within the specified convex polygon.

Public function

void

 

rcReplaceCylinderArea

(
    rcContext* ctx,
    const float* pos,
    const float r,
    const float h,
    unsigned char areaId,
    unsigned char filterAreaId,
    rcCompactHeightfield& chf
)

Replaces an area id in spans with matching filter area within the specified cylinder.

Public function

void

 

rcResetHeightfield

(
    rcHeightfield& hf
)

Resets all spans of heightfield.

Public function

void

 

rcSetCon

(
    rcCompactSpan& s,
    int dir,
    int i
)

Sets the neighbor connection data for the specified direction.

Public function

T

 

rcSqr

(
    T a
)

Returns the square of the value.

Public function

float

 

rcSqrt

(
    float x
)

Returns the square root of the value.

Public function

void

 

rcSwap

(
    T& a,
    T& b
)

Swaps the values of the two parameters.

Public function

void

 

rcVadd

(
    float* dest,
    const float* v1,
    const float* v2
)

Performs a vector addition. (v1_ +v2_)

Public function

void

 

rcVcopy

(
    float* dest,
    const float* v
)

Performs a vector copy.

Public function

void

 

rcVcross

(
    float* dest,
    const float* v1,
    const float* v2
)

Derives the cross product of two vectors. (v1_ xv2_)

Public function

float

 

rcVdist

(
    const float* v1,
    const float* v2
)

Returns the distance between two points.

Public function

float

 

rcVdistSqr

(
    const float* v1,
    const float* v2
)

Returns the square of the distance between two points.

Public function

float

 

rcVdot

(
    const float* v1,
    const float* v2
)

Derives the dot product of two vectors. (v1_ .v2_)

Public function

void

 

rcVmad

(
    float* dest,
    const float* v1,
    const float* v2,
    const float s
)

Performs a scaled vector addition. (v1_ + (v2 * `s))

Public function

void

 

rcVmax

(
    float* mx,
    const float* v
)

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

Public function

void

 

rcVmin

(
    float* mn,
    const float* v
)

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

Public function

void

 

rcVnormalize

(
    float* v
)

Normalizes the vector.

Public function

void

 

rcVsub

(
    float* dest,
    const float* v1,
    const float* v2
)

Performs a vector subtraction. (v1_ -v2_)

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback