23 #include <AtomsUtils/Globals.h>
32 static const float RC_PI = 3.14159265f;
118 inline rcContext(
bool state =
true) : m_logEnabled(state), m_timerEnabled(state) {}
123 inline void enableLog(
bool state) { m_logEnabled = state; }
126 inline void resetLog() {
if (m_logEnabled) doResetLog(); }
138 inline void resetTimers() {
if (m_timerEnabled) doResetTimers(); }
272 static const int RC_SPAN_HEIGHT_BITS = 13;
274 static const int RC_SPAN_MAX_HEIGHT = (1<<RC_SPAN_HEIGHT_BITS)-1;
278 static const int RC_SPANS_PER_POOL = 2048;
284 unsigned int smin : RC_SPAN_HEIGHT_BITS;
285 unsigned int smax : RC_SPAN_HEIGHT_BITS;
313 #define EPIC_ADDITION_USE_NEW_RECAST_RASTERIZER 1
315 #if EPIC_ADDITION_USE_NEW_RECAST_RASTERIZER
323 unsigned char Hits[2];
345 #if EPIC_ADDITION_USE_NEW_RECAST_RASTERIZER
585 static const unsigned short RC_BORDER_REG = 0x8000;
594 static const int RC_BORDER_VERTEX = 0x10000;
601 static const int RC_AREA_BORDER = 0x20000;
628 static const int RC_CONTOUR_REG_MASK = 0xffff;
633 static const unsigned short RC_MESH_NULL_IDX = 0xffff;
638 static const unsigned char RC_NULL_AREA = 0;
643 static const unsigned char RC_WALKABLE_AREA = 63;
647 static const int RC_NOT_CONNECTED = 0xff;
655 template<
class T>
inline void rcSwap(T& a, T& b) { T t = a; a = b; b = t; }
661 template<
class T>
inline T
rcMin(T a, T b) {
return a < b ? a : b; }
667 template<
class T>
inline T
rcMax(T a, T b) {
return a > b ? a : b; }
672 template<
class T>
inline T
rcAbs(T a) {
return a < 0 ? -a : a; }
677 template<
class T>
inline T
rcSqr(T a) {
return a*a; }
684 template<
class T>
inline T
rcClamp(T v, T mn, T mx) {
return v < mn ? mn : (v > mx ? mx : v); }
699 inline void rcVcross(
float* dest,
const float* v1,
const float* v2)
701 dest[0] = v1[1]*v2[2] - v1[2]*v2[1];
702 dest[1] = v1[2]*v2[0] - v1[0]*v2[2];
703 dest[2] = v1[0]*v2[1] - v1[1]*v2[0];
710 inline float rcVdot(
const float* v1,
const float* v2)
712 return v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2];
720 inline void rcVmad(
float* dest,
const float* v1,
const float* v2,
const float s)
722 dest[0] = v1[0]+v2[0]*s;
723 dest[1] = v1[1]+v2[1]*s;
724 dest[2] = v1[2]+v2[2]*s;
731 inline void rcVadd(
float* dest,
const float* v1,
const float* v2)
733 dest[0] = v1[0]+v2[0];
734 dest[1] = v1[1]+v2[1];
735 dest[2] = v1[2]+v2[2];
742 inline void rcVsub(
float* dest,
const float* v1,
const float* v2)
744 dest[0] = v1[0]-v2[0];
745 dest[1] = v1[1]-v2[1];
746 dest[2] = v1[2]-v2[2];
752 inline void rcVmin(
float* mn,
const float* v)
754 mn[0] =
rcMin(mn[0], v[0]);
755 mn[1] =
rcMin(mn[1], v[1]);
756 mn[2] =
rcMin(mn[2], v[2]);
762 inline void rcVmax(
float* mx,
const float* v)
764 mx[0] =
rcMax(mx[0], v[0]);
765 mx[1] =
rcMax(mx[1], v[1]);
766 mx[2] =
rcMax(mx[2], v[2]);
772 inline void rcVcopy(
float* dest,
const float* v)
783 inline float rcVdist(
const float* v1,
const float* v2)
785 float dx = v2[0] - v1[0];
786 float dy = v2[1] - v1[1];
787 float dz = v2[2] - v1[2];
788 return rcSqrt(dx*dx + dy*dy + dz*dz);
797 float dx = v2[0] - v1[0];
798 float dy = v2[1] - v1[1];
799 float dz = v2[2] - v1[2];
800 return dx*dx + dy*dy + dz*dz;
824 ATOMSUTILS_EXPORT
void rcCalcBounds(
const float* verts,
int nv,
float* bmin,
float* bmax);
833 ATOMSUTILS_EXPORT
void rcCalcGridSize(
const float* bmin,
const float* bmax,
float cs,
int* w,
int* h);
846 const float* bmin,
const float* bmax,
869 const int* tris,
int nt,
unsigned char* areas);
883 const int* tris,
int nt,
unsigned char* areas);
896 const int* tris,
int nt,
unsigned char* areas);
911 const unsigned short smin,
const unsigned short smax,
912 const unsigned char area,
const int flagMergeThr);
932 const int flagMergeThr = 1);
947 const int* tris,
const unsigned char* areas,
const int nt,
948 rcHeightfield& solid,
const int flagMergeThr = 1,
const int rasterizationFlags = 0 );
963 const unsigned short* tris,
const unsigned char* areas,
const int nt,
964 rcHeightfield& solid,
const int flagMergeThr = 1,
const int rasterizationFlags = 0 );
1004 ATOMSUTILS_EXPORT
void rcFilterWalkableLowHeightSpansSequences(
rcContext* ctx,
int walkableHeight,
rcHeightfield& solid);
1050 unsigned char areaId,
unsigned char filterFlags,
1089 const float hmin,
const float hmax,
unsigned char areaId,
1099 ATOMSUTILS_EXPORT
int rcOffsetPoly(
const float* verts,
const int nverts,
const float offset,
1100 float* outVerts,
const int maxOutVerts);
1111 const float r,
const float h,
unsigned char areaId,
1122 unsigned char areaId,
unsigned char filterAreaId,
1135 const float hmin,
const float hmax,
unsigned char areaId,
unsigned char filterAreaId,
1147 const float r,
const float h,
unsigned char areaId,
unsigned char filterAreaId,
1169 const int borderSize,
const int minRegionArea,
const int mergeRegionArea);
1183 const int borderSize,
const int minRegionArea,
const int mergeRegionArea);
1198 const int borderSize,
const int minRegionArea,
const int mergeRegionArea,
1199 const int chunkSize);
1207 const unsigned int shift = (
unsigned int)dir * 8;
1208 unsigned int con = s.
con;
1209 s.
con = (con & ~(0xff << shift)) | (((
unsigned int)i & 0xff) << shift);
1219 const unsigned int shift = (
unsigned int)dir * 8;
1220 return (s.
con >> shift) & 0xff;
1229 const int offset[4] = { -1, 0, 1, 0, };
1230 return offset[dir&0x03];
1239 const int offset[4] = { 0, 1, 0, -1 };
1240 return offset[dir&0x03];
1261 const int borderSize,
const int walkableHeight,
1275 const int borderSize,
const int walkableHeight,
1290 const int borderSize,
const int walkableHeight,
1291 const int chunkSize,
1307 const float maxError,
const int maxEdgeLen,
1347 const float sampleDist,
const float sampleMaxError,
virtual void doResetLog()
Clears all log entries.
Definition: Recast.h:156
void startTimer(const rcTimerLabel label)
Definition: Recast.h:142
rcContext(bool state=true)
Definition: Recast.h:118
void resetTimers()
Clears all peformance timers. (Resets all to unused.)
Definition: Recast.h:138
virtual void doResetTimers()
Clears all timers. (Resets all to unused.)
Definition: Recast.h:165
void enableTimer(bool state)
Definition: Recast.h:135
virtual void doStopTimer(const rcTimerLabel)
Definition: Recast.h:173
bool m_timerEnabled
True if the performance timers are enabled.
Definition: Recast.h:184
virtual void doStartTimer(const rcTimerLabel)
Definition: Recast.h:169
void enableLog(bool state)
Definition: Recast.h:123
virtual void doLog(const rcLogCategory, const char *, const int)
Definition: Recast.h:162
void log(const rcLogCategory category, const char *format,...)
virtual int doGetAccumulatedTime(const rcTimerLabel) const
Definition: Recast.h:178
int getAccumulatedTime(const rcTimerLabel label) const
Definition: Recast.h:151
bool m_logEnabled
True if logging is enabled.
Definition: Recast.h:181
void resetLog()
Clears all log entries.
Definition: Recast.h:126
void stopTimer(const rcTimerLabel label)
Definition: Recast.h:146
AtomsCore namespace.
Definition: Base64.h:13
rcTimerLabel
Definition: Recast.h:46
@ RC_TIMER_BUILD_CONTOURS_SIMPLIFY
The time to simplify the contours. (See: rcBuildContours)
Definition: Recast.h:60
@ RC_TIMER_FILTER_LOW_OBSTACLES
The time to filter low obstacles. (See: rcFilterLowHangingWalkableObstacles)
Definition: Recast.h:70
@ RC_TIMER_BUILD_POLYMESHDETAIL
The time to build the polygon mesh detail. (See: rcBuildPolyMeshDetail)
Definition: Recast.h:102
@ RC_TIMER_BUILD_DISTANCEFIELD_DIST
The time to build the distances of the distance field. (See: rcBuildDistanceField)
Definition: Recast.h:86
@ RC_TIMER_BUILD_REGIONS
The total time to build the regions. (See: rcBuildRegions, rcBuildRegionsMonotone)
Definition: Recast.h:90
@ RC_TIMER_ERODE_AREA
The time to erode the walkable area. (See: rcErodeWalkableArea)
Definition: Recast.h:76
@ RC_TIMER_BUILD_REGIONS_FLOOD
The time to flood regions while applying the watershed algorithm. (See: rcBuildRegions)
Definition: Recast.h:96
@ RC_TIMER_FILTER_WALKABLE
The time to filter low height spans. (See: rcFilterWalkableLowHeightSpans)
Definition: Recast.h:66
@ RC_TIMER_BUILD_DISTANCEFIELD_BLUR
The time to blur the distance field. (See: rcBuildDistanceField)
Definition: Recast.h:88
@ RC_TIMER_FILTER_BORDER
The time to filter ledge spans. (See: rcFilterLedgeSpans)
Definition: Recast.h:64
@ RC_TIMER_MARK_CONVEXPOLY_AREA
The time to mark a convex polygon area. (See: rcMarkConvexPolyArea)
Definition: Recast.h:82
@ RC_MAX_TIMERS
The maximum number of timers. (Used for iterating timers.)
Definition: Recast.h:106
@ RC_TIMER_TEMP
A user defined build time.
Definition: Recast.h:50
@ RC_TIMER_BUILD_COMPACTHEIGHTFIELD
The time to build the compact heightfield. (See: rcBuildCompactHeightfield)
Definition: Recast.h:54
@ RC_TIMER_BUILD_REGIONS_FILTER
The time to filter out small regions. (See: rcBuildRegions, rcBuildRegionsMonotone)
Definition: Recast.h:98
@ RC_TIMER_MARK_BOX_AREA
The time to mark a box area. (See: rcMarkBoxArea)
Definition: Recast.h:78
@ RC_TIMER_TOTAL
The user defined total time of the build.
Definition: Recast.h:48
@ RC_TIMER_BUILD_POLYMESH
The time to build the polygon mesh. (See: rcBuildPolyMesh)
Definition: Recast.h:72
@ RC_TIMER_RASTERIZE_TRIANGLES
The time to rasterize the triangles. (See: rcRasterizeTriangle)
Definition: Recast.h:52
@ RC_TIMER_MARK_CYLINDER_AREA
The time to mark a cylinder area. (See: rcMarkCylinderArea)
Definition: Recast.h:80
@ RC_TIMER_MERGE_POLYMESHDETAIL
The time to merge polygon mesh details. (See: rcMergePolyMeshDetails)
Definition: Recast.h:104
@ RC_TIMER_MEDIAN_AREA
The time to apply the median filter. (See: rcMedianFilterWalkableArea)
Definition: Recast.h:68
@ RC_TIMER_BUILD_REGIONS_WATERSHED
The total time to apply the watershed algorithm. (See: rcBuildRegions)
Definition: Recast.h:92
@ RC_TIMER_MERGE_POLYMESH
The time to merge polygon meshes. (See: rcMergePolyMeshes)
Definition: Recast.h:74
@ RC_TIMER_BUILD_CONTOURS
The total time to build the contours. (See: rcBuildContours)
Definition: Recast.h:56
@ RC_TIMER_BUILD_CONTOURS_TRACE
The time to trace the boundaries of the contours. (See: rcBuildContours)
Definition: Recast.h:58
@ RC_TIMER_BUILD_LAYERS
The time to build heightfield layers. (See: rcBuildHeightfieldLayers)
Definition: Recast.h:100
@ RC_TIMER_BUILD_DISTANCEFIELD
The total time to build the distance field. (See: rcBuildDistanceField)
Definition: Recast.h:84
@ RC_TIMER_BUILD_REGIONS_EXPAND
The time to expand regions while applying the watershed algorithm. (See: rcBuildRegions)
Definition: Recast.h:94
@ RC_TIMER_BUILD_CLUSTERS
The time to link clusters from contours. (See: rcBuildClusters)
Definition: Recast.h:62
void rcVmin(float *mn, const float *v)
Definition: Recast.h:752
ATOMSUTILS_EXPORT void rcFreeCompactHeightfield(rcCompactHeightfield *chf)
ATOMSUTILS_EXPORT bool rcErodeWalkableAndLowAreas(rcContext *ctx, int radius, unsigned int height, unsigned char areaId, unsigned char filterFlags, rcCompactHeightfield &chf)
ATOMSUTILS_EXPORT void rcFreeClusterSet(rcClusterSet *clset)
T rcMin(T a, T b)
Definition: Recast.h:661
ATOMSUTILS_EXPORT void rcMarkCylinderArea(rcContext *ctx, const float *pos, const float r, const float h, unsigned char areaId, rcCompactHeightfield &chf)
ATOMSUTILS_EXPORT void rcMarkBoxArea(rcContext *ctx, const float *bmin, const float *bmax, unsigned char areaId, rcCompactHeightfield &chf)
ATOMSUTILS_EXPORT rcCompactHeightfield * rcAllocCompactHeightfield()
ATOMSUTILS_EXPORT rcHeightfield * rcAllocHeightfield()
float rcVdistSqr(const float *v1, const float *v2)
Definition: Recast.h:795
ATOMSUTILS_EXPORT bool rcBuildRegionsMonotone(rcContext *ctx, rcCompactHeightfield &chf, const int borderSize, const int minRegionArea, const int mergeRegionArea)
void rcVnormalize(float *v)
Definition: Recast.h:805
T rcSqr(T a)
Definition: Recast.h:677
ATOMSUTILS_EXPORT bool rcMergePolyMeshDetails(rcContext *ctx, rcPolyMeshDetail **meshes, const int nmeshes, rcPolyMeshDetail &mesh)
float rcVdist(const float *v1, const float *v2)
Definition: Recast.h:783
ATOMSUTILS_EXPORT bool rcBuildClusters(rcContext *ctx, rcContourSet &cset, rcClusterSet &clusters)
ATOMSUTILS_EXPORT rcClusterSet * rcAllocClusterSet()
ATOMSUTILS_EXPORT void rcFilterLowHangingWalkableObstacles(rcContext *ctx, const int walkableClimb, rcHeightfield &solid)
ATOMSUTILS_EXPORT bool rcCopyPolyMesh(rcContext *ctx, const rcPolyMesh &src, rcPolyMesh &dst)
float rcVdot(const float *v1, const float *v2)
Definition: Recast.h:710
rcFilterLowAreaFlags
Definition: Recast.h:613
@ RC_LOW_FILTER_SEED_SPANS
initial seeding on spans
Definition: Recast.h:614
@ RC_LOW_FILTER_POST_PROCESS
additional filtering at the end
Definition: Recast.h:615
ATOMSUTILS_EXPORT void rcFreeContourSet(rcContourSet *cset)
ATOMSUTILS_EXPORT bool rcBuildPolyMeshDetail(rcContext *ctx, const rcPolyMesh &mesh, const rcCompactHeightfield &chf, const float sampleDist, const float sampleMaxError, rcPolyMeshDetail &dmesh)
T rcAbs(T a)
Definition: Recast.h:672
ATOMSUTILS_EXPORT void rcClearUnwalkableTriangles(rcContext *ctx, const float walkableSlopeAngle, const float *verts, int nv, const int *tris, int nt, unsigned char *areas)
ATOMSUTILS_EXPORT void rcCalcGridSize(const float *bmin, const float *bmax, float cs, int *w, int *h)
void rcVmax(float *mx, const float *v)
Definition: Recast.h:762
ATOMSUTILS_EXPORT void rcReplaceConvexPolyArea(rcContext *ctx, const float *verts, const int nverts, const float hmin, const float hmax, unsigned char areaId, unsigned char filterAreaId, rcCompactHeightfield &chf)
ATOMSUTILS_EXPORT void rcResetHeightfield(rcHeightfield &hf)
rcRasterizationFlags
Definition: Recast.h:620
@ RC_PROJECT_TO_BOTTOM
Will create spans from the triangle surface to the bottom of the heightfield.
Definition: Recast.h:621
ATOMSUTILS_EXPORT void rcReplaceBoxArea(rcContext *ctx, const float *bmin, const float *bmax, unsigned char areaId, unsigned char filterAreaId, rcCompactHeightfield &chf)
ATOMSUTILS_EXPORT void rcFilterLedgeSpans(rcContext *ctx, const int walkableHeight, const int walkableClimb, rcHeightfield &solid)
ATOMSUTILS_EXPORT bool rcMedianFilterWalkableArea(rcContext *ctx, rcCompactHeightfield &chf)
ATOMSUTILS_EXPORT void rcMarkConvexPolyArea(rcContext *ctx, const float *verts, const int nverts, const float hmin, const float hmax, unsigned char areaId, rcCompactHeightfield &chf)
ATOMSUTILS_EXPORT void rcCalcBounds(const float *verts, int nv, float *bmin, float *bmax)
ATOMSUTILS_EXPORT void rcRasterizeTriangle(rcContext *ctx, const float *v0, const float *v1, const float *v2, const unsigned char area, rcHeightfield &solid, const int flagMergeThr=1)
ATOMSUTILS_EXPORT void rcMarkWalkableTrianglesCos(rcContext *ctx, const float walkableSlopeCos, const float *verts, int nv, const int *tris, int nt, unsigned char *areas)
void rcVcross(float *dest, const float *v1, const float *v2)
Definition: Recast.h:699
ATOMSUTILS_EXPORT bool rcBuildHeightfieldLayersChunky(rcContext *ctx, rcCompactHeightfield &chf, const int borderSize, const int walkableHeight, const int chunkSize, rcHeightfieldLayerSet &lset)
ATOMSUTILS_EXPORT rcPolyMesh * rcAllocPolyMesh()
ATOMSUTILS_EXPORT bool rcMergePolyMeshes(rcContext *ctx, rcPolyMesh **meshes, const int nmeshes, rcPolyMesh &mesh)
ATOMSUTILS_EXPORT void rcFreePolyMeshDetail(rcPolyMeshDetail *dmesh)
ATOMSUTILS_EXPORT void rcMarkWalkableTriangles(rcContext *ctx, const float walkableSlopeAngle, const float *verts, int nv, const int *tris, int nt, unsigned char *areas)
ATOMSUTILS_EXPORT bool rcBuildHeightfieldLayersMonotone(rcContext *ctx, rcCompactHeightfield &chf, const int borderSize, const int walkableHeight, rcHeightfieldLayerSet &lset)
ATOMSUTILS_EXPORT bool rcMarkLowAreas(rcContext *ctx, unsigned int height, unsigned char areaId, rcCompactHeightfield &chf)
ATOMSUTILS_EXPORT bool rcBuildCompactHeightfield(rcContext *ctx, const int walkableHeight, const int walkableClimb, rcHeightfield &hf, rcCompactHeightfield &chf)
ATOMSUTILS_EXPORT bool rcBuildDistanceField(rcContext *ctx, rcCompactHeightfield &chf)
void rcVmad(float *dest, const float *v1, const float *v2, const float s)
Definition: Recast.h:720
void rcVcopy(float *dest, const float *v)
Definition: Recast.h:772
ATOMSUTILS_EXPORT bool rcBuildRegions(rcContext *ctx, rcCompactHeightfield &chf, const int borderSize, const int minRegionArea, const int mergeRegionArea)
ATOMSUTILS_EXPORT rcContourSet * rcAllocContourSet()
ATOMSUTILS_EXPORT void rcFreePolyMesh(rcPolyMesh *pmesh)
rcBuildContoursFlags
Definition: Recast.h:606
@ RC_CONTOUR_TESS_AREA_EDGES
Tessellate edges between areas during contour simplification.
Definition: Recast.h:608
@ RC_CONTOUR_TESS_WALL_EDGES
Tessellate solid (impassable) edges during contour simplification.
Definition: Recast.h:607
ATOMSUTILS_EXPORT 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)
ATOMSUTILS_EXPORT bool rcBuildContours(rcContext *ctx, rcCompactHeightfield &chf, const float maxError, const int maxEdgeLen, rcContourSet &cset, const int flags=RC_CONTOUR_TESS_WALL_EDGES)
T rcClamp(T v, T mn, T mx)
Definition: Recast.h:684
int rcGetDirOffsetX(int dir)
Definition: Recast.h:1227
ATOMSUTILS_EXPORT rcPolyMeshDetail * rcAllocPolyMeshDetail()
ATOMSUTILS_EXPORT void rcFilterWalkableLowHeightSpans(rcContext *ctx, int walkableHeight, rcHeightfield &solid)
void rcSwap(T &a, T &b)
Definition: Recast.h:655
ATOMSUTILS_EXPORT int rcGetHeightFieldSpanCount(rcContext *ctx, rcHeightfield &hf)
ATOMSUTILS_EXPORT bool rcBuildPolyMesh(rcContext *ctx, rcContourSet &cset, const int nvp, rcPolyMesh &mesh)
void rcSetCon(rcCompactSpan &s, int dir, int i)
Definition: Recast.h:1205
ATOMSUTILS_EXPORT void rcFreeHeightfieldLayerSet(rcHeightfieldLayerSet *lset)
void rcVadd(float *dest, const float *v1, const float *v2)
Definition: Recast.h:731
rcLogCategory
Definition: Recast.h:37
@ RC_LOG_WARNING
A warning log entry.
Definition: Recast.h:39
@ RC_LOG_ERROR
An error log entry.
Definition: Recast.h:40
@ RC_LOG_PROGRESS
A progress log entry.
Definition: Recast.h:38
ATOMSUTILS_EXPORT void rcFreeHeightField(rcHeightfield *hf)
ATOMSUTILS_EXPORT bool rcBuildRegionsChunky(rcContext *ctx, rcCompactHeightfield &chf, const int borderSize, const int minRegionArea, const int mergeRegionArea, const int chunkSize)
T rcMax(T a, T b)
Definition: Recast.h:667
int rcGetCon(const rcCompactSpan &s, int dir)
Definition: Recast.h:1217
ATOMSUTILS_EXPORT bool rcCreateHeightfield(rcContext *ctx, rcHeightfield &hf, int width, int height, const float *bmin, const float *bmax, float cs, float ch)
ATOMSUTILS_EXPORT bool rcErodeWalkableArea(rcContext *ctx, int radius, rcCompactHeightfield &chf)
ATOMSUTILS_EXPORT rcHeightfieldLayerSet * rcAllocHeightfieldLayerSet()
ATOMSUTILS_EXPORT 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=1, const int rasterizationFlags=0)
rcRegionPartitioning
Definition: Recast.h:190
@ RC_REGION_WATERSHED
watershed partitioning
Definition: Recast.h:192
@ RC_REGION_CHUNKY
monotone partitioning on small chunks
Definition: Recast.h:193
@ RC_REGION_MONOTONE
monotone partitioning
Definition: Recast.h:191
ATOMSUTILS_EXPORT bool rcBuildHeightfieldLayers(rcContext *ctx, rcCompactHeightfield &chf, const int borderSize, const int walkableHeight, rcHeightfieldLayerSet &lset)
void rcVsub(float *dest, const float *v1, const float *v2)
Definition: Recast.h:742
ATOMSUTILS_EXPORT void rcReplaceCylinderArea(rcContext *ctx, const float *pos, const float r, const float h, unsigned char areaId, unsigned char filterAreaId, rcCompactHeightfield &chf)
int rcGetDirOffsetY(int dir)
Definition: Recast.h:1237
ATOMSUTILS_EXPORT int rcOffsetPoly(const float *verts, const int nverts, const float offset, float *outVerts, const int maxOutVerts)
float * center
Center points per clusters [Size: 3 * nclusters].
Definition: Recast.h:451
int nclusters
The number of clusters.
Definition: Recast.h:450
unsigned short * nlinks
Number of links per cluster [Size: nclusters].
Definition: Recast.h:452
unsigned short * links
Neighbor Ids per cluster [Size: sum of nlinks].
Definition: Recast.h:453
Provides information on the content of a cell column in a compact heightfield.
Definition: Recast.h:354
unsigned int index
Index to the first span in the column.
Definition: Recast.h:355
unsigned int count
Number of spans in the column.
Definition: Recast.h:356
unsigned char * areas
Array containing area id data. [Size: spanCount].
Definition: Recast.h:387
unsigned short maxRegions
The maximum region id of any span within the field.
Definition: Recast.h:379
int spanCount
The number of spans in the heightfield.
Definition: Recast.h:374
int walkableClimb
The walkable climb used during the build of the field. (See: rcConfig::walkableClimb)
Definition: Recast.h:376
int borderSize
The AABB border size used during the build of the field. (See: rcConfig::borderSize)
Definition: Recast.h:377
rcCompactCell * cells
Array of cells. [Size: width*height].
Definition: Recast.h:384
float cs
The size of each cell. (On the xz-plane.)
Definition: Recast.h:382
float bmax[3]
The maximum bounds in world space. [(x, y, z)].
Definition: Recast.h:381
rcCompactSpan * spans
Array of spans. [Size: spanCount].
Definition: Recast.h:385
float ch
The height of each cell. (The minimum increment along the y-axis.)
Definition: Recast.h:383
float bmin[3]
The minimum bounds in world space. [(x, y, z)].
Definition: Recast.h:380
int walkableHeight
The walkable height used during the build of the field. (See: rcConfig::walkableHeight)
Definition: Recast.h:375
unsigned short maxDistance
The maximum distance value of any span within the field.
Definition: Recast.h:378
int width
The width of the heightfield. (Along the x-axis in cell units.)
Definition: Recast.h:372
int height
The height of the heightfield. (Along the z-axis in cell units.)
Definition: Recast.h:373
unsigned short * dist
Array containing border distance data. [Size: spanCount].
Definition: Recast.h:386
Represents a span of unobstructed space within a compact heightfield.
Definition: Recast.h:361
unsigned char h
The height of the span. (Measured from y.)
Definition: Recast.h:365
unsigned short y
The lower extent of the span. (Measured from the heightfield's base.)
Definition: Recast.h:362
unsigned short reg
The id of the region the span belongs to. (Or zero if not in a region.)
Definition: Recast.h:363
unsigned int con
Packed neighbor connection data.
Definition: Recast.h:364
int maxEdgeLen
The maximum allowed length for contour edges along the border of the mesh. [Limit: >=0] [Units: vx].
Definition: Recast.h:239
int walkableClimb
Maximum ledge height that is considered to still be traversable. [Limit: >=0] [Units: vx].
Definition: Recast.h:232
float detailSampleDist
Definition: Recast.h:264
int minRegionArea
The minimum number of cells allowed to form isolated island areas. [Limit: >=0] [Units: vx].
Definition: Recast.h:246
float bmin[3]
The minimum bounds of the field's AABB. [(x, y, z)] [Units: wu].
Definition: Recast.h:219
int width
The width of the field along the x-axis. [Limit: >= 0] [Units: vx].
Definition: Recast.h:201
int regionPartitioning
Region partitioning method: creating poly mesh.
Definition: Recast.h:256
float maxSimplificationError
Definition: Recast.h:243
int walkableHeight
Definition: Recast.h:229
float bmax[3]
The maximum bounds of the field's AABB. [(x, y, z)] [Units: wu].
Definition: Recast.h:222
float cs
The xz-plane cell size to use for fields. [Limit: > 0] [Units: wu].
Definition: Recast.h:213
int height
The height of the field along the z-axis. [Limit: >= 0] [Units: vx].
Definition: Recast.h:204
int borderSize
The size of the non-navigable border around the heightfield. [Limit: >=0] [Units: vx].
Definition: Recast.h:210
int walkableRadius
Definition: Recast.h:236
int regionChunkSize
Size of region chunk [Units: vx].
Definition: Recast.h:253
int mergeRegionArea
Definition: Recast.h:250
int tileSize
The width/height size of tile's on the xz-plane. [Limit: >= 0] [Units: vx].
Definition: Recast.h:207
float ch
The y-axis cell size to use for fields. [Limit: > 0] [Units: wu].
Definition: Recast.h:216
float detailSampleMaxError
Definition: Recast.h:268
int maxVertsPerPoly
Definition: Recast.h:260
float walkableSlopeAngle
The maximum slope that is considered walkable. [Limits: 0 <= value < 90] [Units: Degrees].
Definition: Recast.h:225
Represents a simple, non-overlapping contour in field space.
Definition: Recast.h:422
unsigned short reg
The region id of the contour.
Definition: Recast.h:427
int nrverts
The number of vertices in the raw contour.
Definition: Recast.h:426
unsigned char area
The area id of the contour.
Definition: Recast.h:428
int * rverts
Raw contour vertex and connection data. [Size: 4 * nrverts].
Definition: Recast.h:425
int nverts
The number of vertices in the simplified contour.
Definition: Recast.h:424
int * verts
Simplified contour vertex and connection data. [Size: 4 * nverts].
Definition: Recast.h:423
int borderSize
The AABB border size used to generate the source data from which the contours were derived.
Definition: Recast.h:443
int height
The height of the set. (Along the z-axis in cell units.)
Definition: Recast.h:442
float bmax[3]
The maximum bounds in world space. [(x, y, z)].
Definition: Recast.h:438
int nconts
The number of contours in the set.
Definition: Recast.h:436
int width
The width of the set. (Along the x-axis in cell units.)
Definition: Recast.h:441
rcContour * conts
An array of the contours in the set. [Size: nconts].
Definition: Recast.h:435
float bmin[3]
The minimum bounds in world space. [(x, y, z)].
Definition: Recast.h:437
float ch
The height of each cell. (The minimum increment along the y-axis.)
Definition: Recast.h:440
float cs
The size of each cell. (On the xz-plane.)
Definition: Recast.h:439
float bmin[3]
The minimum bounds in world space. [(x, y, z)].
Definition: Recast.h:337
rcTempSpan * tempspans
Heightfield of temp spans (width*height).
Definition: Recast.h:348
rcRowExt * RowExt
h structs that give the current x range for this z row
Definition: Recast.h:347
rcEdgeHit * EdgeHits
h + 1 bit flags that indicate what edges cross the z cell boundaries
Definition: Recast.h:346
int width
The width of the heightfield. (Along the x-axis in cell units.)
Definition: Recast.h:335
int height
The height of the heightfield. (Along the z-axis in cell units.)
Definition: Recast.h:336
float cs
The size of each cell. (On the xz-plane.)
Definition: Recast.h:339
float ch
The height of each cell. (The minimum increment along the y-axis.)
Definition: Recast.h:340
rcSpan ** spans
Heightfield of spans (width*height).
Definition: Recast.h:341
rcSpanPool * pools
Linked list of span pools.
Definition: Recast.h:342
float bmax[3]
The maximum bounds in world space. [(x, y, z)].
Definition: Recast.h:338
rcSpan * freelist
The next free span.
Definition: Recast.h:343
int minx
The minimum x-bounds of usable data.
Definition: Recast.h:400
unsigned char * areas
Area ids. [Size: Same as heights].
Definition: Recast.h:407
int width
The width of the heightfield. (Along the x-axis in cell units.)
Definition: Recast.h:398
unsigned short * heights
The heightfield. [Size: (width - borderSize*2) * (h - borderSize*2)].
Definition: Recast.h:406
float ch
The height of each cell. (The minimum increment along the y-axis.)
Definition: Recast.h:397
int maxx
The maximum x-bounds of usable data.
Definition: Recast.h:401
float bmin[3]
The minimum bounds in world space. [(x, y, z)].
Definition: Recast.h:394
int height
The height of the heightfield. (Along the z-axis in cell units.)
Definition: Recast.h:399
int hmax
The maximum height bounds of usable data. (Along the y-axis.)
Definition: Recast.h:405
int maxy
The maximum y-bounds of usable data. (Along the z-axis.)
Definition: Recast.h:403
float cs
The size of each cell. (On the xz-plane.)
Definition: Recast.h:396
unsigned char * cons
Packed neighbor connection information. [Size: Same as heights].
Definition: Recast.h:408
int hmin
The minimum height bounds of usable data. (Along the y-axis.)
Definition: Recast.h:404
int miny
The minimum y-bounds of usable data. (Along the z-axis.)
Definition: Recast.h:402
float bmax[3]
The maximum bounds in world space. [(x, y, z)].
Definition: Recast.h:395
rcHeightfieldLayer * layers
The layers in the set. [Size: nlayers].
Definition: Recast.h:416
int nlayers
The number of layers in the set.
Definition: Recast.h:417
float * verts
The mesh vertices. [Size: 3*nverts].
Definition: Recast.h:482
unsigned int * meshes
The sub-mesh data. [Size: 4*nmeshes].
Definition: Recast.h:481
int nmeshes
The number of sub-meshes defined by meshes.
Definition: Recast.h:484
unsigned char * tris
The mesh triangles. [Size: 4*ntris].
Definition: Recast.h:483
int ntris
The number of triangles in tris.
Definition: Recast.h:486
int nverts
The number of vertices in verts.
Definition: Recast.h:485
float cs
The size of each cell. (On the xz-plane.)
Definition: Recast.h:471
unsigned short * flags
The user defined flags for each polygon. [Length: maxpolys].
Definition: Recast.h:463
unsigned char * areas
The area id assigned to each polygon. [Length: maxpolys].
Definition: Recast.h:464
unsigned short * verts
The mesh vertices. [Form: (x, y, z) * nverts].
Definition: Recast.h:460
int nverts
The number of vertices.
Definition: Recast.h:465
float bmax[3]
The maximum bounds in world space. [(x, y, z)].
Definition: Recast.h:470
int borderSize
The AABB border size used to generate the source data from which the mesh was derived.
Definition: Recast.h:473
int npolys
The number of polygons.
Definition: Recast.h:466
unsigned short * polys
Polygon and neighbor data. [Length: maxpolys * 2 * nvp].
Definition: Recast.h:461
int maxpolys
The number of allocated polygons.
Definition: Recast.h:467
float ch
The height of each cell. (The minimum increment along the y-axis.)
Definition: Recast.h:472
int nvp
The maximum number of vertices per polygon.
Definition: Recast.h:468
float bmin[3]
The minimum bounds in world space. [(x, y, z)].
Definition: Recast.h:469
unsigned short * regs
The region id assigned to each polygon. [Length: maxpolys].
Definition: Recast.h:462
unsigned int area
The area id assigned to the span.
Definition: Recast.h:286
unsigned int smin
The lower limit of the span. [Limit: < smax].
Definition: Recast.h:284
unsigned int smax
The upper limit of the span. [Limit: <= #RC_SPAN_MAX_HEIGHT].
Definition: Recast.h:285
rcSpanData data
Span data.
Definition: Recast.h:300
rcSpan * next
The next span higher up in column.
Definition: Recast.h:301
rcSpan items[RC_SPANS_PER_POOL]
Array of spans in the pool.
Definition: Recast.h:309
rcSpanPool * next
The next span pool.
Definition: Recast.h:308
short int sminmax[2]
The lower and upper limit of the span. [Limit: < #smax].
Definition: Recast.h:327