RavEngine
Loading...
Searching...
No Matches
Recast.h
1//
2// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org
3//
4// This software is provided 'as-is', without any express or implied
5// warranty. In no event will the authors be held liable for any damages
6// arising from the use of this software.
7// Permission is granted to anyone to use this software for any purpose,
8// including commercial applications, and to alter it and redistribute it
9// freely, subject to the following restrictions:
10// 1. The origin of this software must not be misrepresented; you must not
11// claim that you wrote the original software. If you use this software
12// in a product, an acknowledgment in the product documentation would be
13// appreciated but is not required.
14// 2. Altered source versions must be plainly marked as such, and must not be
15// misrepresented as being the original software.
16// 3. This notice may not be removed or altered from any source distribution.
17//
18
19#ifndef RECAST_H
20#define RECAST_H
21
23static const float RC_PI = 3.14159265f;
24
27enum rcLogCategory
28{
29 RC_LOG_PROGRESS = 1,
30 RC_LOG_WARNING,
31 RC_LOG_ERROR,
32};
33
36enum rcTimerLabel
37{
39 RC_TIMER_TOTAL,
41 RC_TIMER_TEMP,
43 RC_TIMER_RASTERIZE_TRIANGLES,
45 RC_TIMER_BUILD_COMPACTHEIGHTFIELD,
47 RC_TIMER_BUILD_CONTOURS,
49 RC_TIMER_BUILD_CONTOURS_TRACE,
51 RC_TIMER_BUILD_CONTOURS_SIMPLIFY,
53 RC_TIMER_FILTER_BORDER,
55 RC_TIMER_FILTER_WALKABLE,
57 RC_TIMER_MEDIAN_AREA,
59 RC_TIMER_FILTER_LOW_OBSTACLES,
61 RC_TIMER_BUILD_POLYMESH,
63 RC_TIMER_MERGE_POLYMESH,
65 RC_TIMER_ERODE_AREA,
67 RC_TIMER_MARK_BOX_AREA,
69 RC_TIMER_MARK_CYLINDER_AREA,
71 RC_TIMER_MARK_CONVEXPOLY_AREA,
73 RC_TIMER_BUILD_DISTANCEFIELD,
75 RC_TIMER_BUILD_DISTANCEFIELD_DIST,
77 RC_TIMER_BUILD_DISTANCEFIELD_BLUR,
79 RC_TIMER_BUILD_REGIONS,
81 RC_TIMER_BUILD_REGIONS_WATERSHED,
83 RC_TIMER_BUILD_REGIONS_EXPAND,
85 RC_TIMER_BUILD_REGIONS_FLOOD,
87 RC_TIMER_BUILD_REGIONS_FILTER,
89 RC_TIMER_BUILD_LAYERS,
91 RC_TIMER_BUILD_POLYMESHDETAIL,
93 RC_TIMER_MERGE_POLYMESHDETAIL,
95 RC_MAX_TIMERS
96};
97
102{
103public:
104
107 inline rcContext(bool state = true) : m_logEnabled(state), m_timerEnabled(state) {}
108 virtual ~rcContext() {}
109
112 inline void enableLog(bool state) { m_logEnabled = state; }
113
115 inline void resetLog() { if (m_logEnabled) doResetLog(); }
116
120 void log(const rcLogCategory category, const char* format, ...);
121
124 inline void enableTimer(bool state) { m_timerEnabled = state; }
125
127 inline void resetTimers() { if (m_timerEnabled) doResetTimers(); }
128
131 inline void startTimer(const rcTimerLabel label) { if (m_timerEnabled) doStartTimer(label); }
132
135 inline void stopTimer(const rcTimerLabel label) { if (m_timerEnabled) doStopTimer(label); }
136
140 inline int getAccumulatedTime(const rcTimerLabel label) const { return m_timerEnabled ? doGetAccumulatedTime(label) : -1; }
141
142protected:
143
145 virtual void doResetLog() {}
146
151 virtual void doLog(const rcLogCategory /*category*/, const char* /*msg*/, const int /*len*/) {}
152
154 virtual void doResetTimers() {}
155
158 virtual void doStartTimer(const rcTimerLabel /*label*/) {}
159
162 virtual void doStopTimer(const rcTimerLabel /*label*/) {}
163
167 virtual int doGetAccumulatedTime(const rcTimerLabel /*label*/) const { return -1; }
168
171
174};
175
179{
180public:
184 inline rcScopedTimer(rcContext* ctx, const rcTimerLabel label) : m_ctx(ctx), m_label(label) { m_ctx->startTimer(m_label); }
185 inline ~rcScopedTimer() { m_ctx->stopTimer(m_label); }
186
187private:
188 // Explicitly disabled copy constructor and copy assignment operator.
190 rcScopedTimer& operator=(const rcScopedTimer&);
191
192 rcContext* const m_ctx;
193 const rcTimerLabel m_label;
194};
195
199{
201 int width;
202
205
208
211
213 float cs;
214
216 float ch;
217
219 float bmin[3];
220
222 float bmax[3];
223
226
230
233
237
240
244
247
251
255
259
263};
264
266static const int RC_SPAN_HEIGHT_BITS = 13;
268static const int RC_SPAN_MAX_HEIGHT = (1 << RC_SPAN_HEIGHT_BITS) - 1;
269
272static const int RC_SPANS_PER_POOL = 2048;
273
276struct rcSpan
277{
278 unsigned int smin : RC_SPAN_HEIGHT_BITS;
279 unsigned int smax : RC_SPAN_HEIGHT_BITS;
280 unsigned int area : 6;
282};
283
287{
289 rcSpan items[RC_SPANS_PER_POOL];
290};
291
295{
298
299 int width;
300 int height;
301 float bmin[3];
302 float bmax[3];
303 float cs;
304 float ch;
308
309private:
310 // Explicitly-disabled copy constructor and copy assignment operator.
312 rcHeightfield& operator=(const rcHeightfield&);
313};
314
317{
318 unsigned int index : 24;
319 unsigned int count : 8;
320};
321
324{
325 unsigned short y;
326 unsigned short reg;
327 unsigned int con : 24;
328 unsigned int h : 8;
329};
330
334{
337 int width;
338 int height;
343 unsigned short maxDistance;
344 unsigned short maxRegions;
345 float bmin[3];
346 float bmax[3];
347 float cs;
348 float ch;
351 unsigned short* dist;
352 unsigned char* areas;
353};
354
358{
359 float bmin[3];
360 float bmax[3];
361 float cs;
362 float ch;
363 int width;
364 int height;
365 int minx;
366 int maxx;
367 int miny;
368 int maxy;
369 int hmin;
370 int hmax;
371 unsigned char* heights;
372 unsigned char* areas;
373 unsigned char* cons;
374};
375
386
389{
390 int* verts;
391 int nverts;
392 int* rverts;
394 unsigned short reg;
395 unsigned char area;
396};
397
401{
402 rcContourSet();
405 int nconts;
406 float bmin[3];
407 float bmax[3];
408 float cs;
409 float ch;
410 int width;
411 int height;
413 float maxError;
414};
415
419{
420 rcPolyMesh();
421 ~rcPolyMesh();
422 unsigned short* verts;
423 unsigned short* polys;
424 unsigned short* regs;
425 unsigned short* flags;
426 unsigned char* areas;
427 int nverts;
428 int npolys;
430 int nvp;
431 float bmin[3];
432 float bmax[3];
433 float cs;
434 float ch;
437};
438
443{
444 unsigned int* meshes;
445 float* verts;
446 unsigned char* tris;
448 int nverts;
449 int ntris;
450};
451
456
461rcHeightfield* rcAllocHeightfield();
462
467void rcFreeHeightField(rcHeightfield* hf);
468
473rcCompactHeightfield* rcAllocCompactHeightfield();
474
479void rcFreeCompactHeightfield(rcCompactHeightfield* chf);
480
485rcHeightfieldLayerSet* rcAllocHeightfieldLayerSet();
486
491void rcFreeHeightfieldLayerSet(rcHeightfieldLayerSet* lset);
492
497rcContourSet* rcAllocContourSet();
498
503void rcFreeContourSet(rcContourSet* cset);
504
509rcPolyMesh* rcAllocPolyMesh();
510
515void rcFreePolyMesh(rcPolyMesh* pmesh);
516
521rcPolyMeshDetail* rcAllocPolyMeshDetail();
522
527void rcFreePolyMeshDetail(rcPolyMeshDetail* dmesh);
528
530
536static const unsigned short RC_BORDER_REG = 0x8000;
537
544static const unsigned short RC_MULTIPLE_REGS = 0;
545
553static const int RC_BORDER_VERTEX = 0x10000;
554
560static const int RC_AREA_BORDER = 0x20000;
561
564enum rcBuildContoursFlags
565{
566 RC_CONTOUR_TESS_WALL_EDGES = 0x01,
567 RC_CONTOUR_TESS_AREA_EDGES = 0x02,
568};
569
574static const int RC_CONTOUR_REG_MASK = 0xffff;
575
579static const unsigned short RC_MESH_NULL_IDX = 0xffff;
580
584static const unsigned char RC_NULL_AREA = 0;
585
589static const unsigned char RC_WALKABLE_AREA = 63;
590
593static const int RC_NOT_CONNECTED = 0x3f;
594
597
601template<class T> void rcIgnoreUnused(const T&) { }
602
606template<class T> inline void rcSwap(T& a, T& b) { T t = a; a = b; b = t; }
607
612template<class T> inline T rcMin(T a, T b) { return a < b ? a : b; }
613
618template<class T> inline T rcMax(T a, T b) { return a > b ? a : b; }
619
623template<class T> inline T rcAbs(T a) { return a < 0 ? -a : a; }
624
628template<class T> inline T rcSqr(T a) { return a*a; }
629
635template<class T> inline T rcClamp(T v, T mn, T mx) { return v < mn ? mn : (v > mx ? mx : v); }
636
640float rcSqrt(float x);
641
645
650inline void rcVcross(float* dest, const float* v1, const float* v2)
651{
652 dest[0] = v1[1]*v2[2] - v1[2]*v2[1];
653 dest[1] = v1[2]*v2[0] - v1[0]*v2[2];
654 dest[2] = v1[0]*v2[1] - v1[1]*v2[0];
655}
656
661inline float rcVdot(const float* v1, const float* v2)
662{
663 return v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2];
664}
665
671inline void rcVmad(float* dest, const float* v1, const float* v2, const float s)
672{
673 dest[0] = v1[0]+v2[0]*s;
674 dest[1] = v1[1]+v2[1]*s;
675 dest[2] = v1[2]+v2[2]*s;
676}
677
682inline void rcVadd(float* dest, const float* v1, const float* v2)
683{
684 dest[0] = v1[0]+v2[0];
685 dest[1] = v1[1]+v2[1];
686 dest[2] = v1[2]+v2[2];
687}
688
693inline void rcVsub(float* dest, const float* v1, const float* v2)
694{
695 dest[0] = v1[0]-v2[0];
696 dest[1] = v1[1]-v2[1];
697 dest[2] = v1[2]-v2[2];
698}
699
703inline void rcVmin(float* mn, const float* v)
704{
705 mn[0] = rcMin(mn[0], v[0]);
706 mn[1] = rcMin(mn[1], v[1]);
707 mn[2] = rcMin(mn[2], v[2]);
708}
709
713inline void rcVmax(float* mx, const float* v)
714{
715 mx[0] = rcMax(mx[0], v[0]);
716 mx[1] = rcMax(mx[1], v[1]);
717 mx[2] = rcMax(mx[2], v[2]);
718}
719
723inline void rcVcopy(float* dest, const float* v)
724{
725 dest[0] = v[0];
726 dest[1] = v[1];
727 dest[2] = v[2];
728}
729
734inline float rcVdist(const float* v1, const float* v2)
735{
736 float dx = v2[0] - v1[0];
737 float dy = v2[1] - v1[1];
738 float dz = v2[2] - v1[2];
739 return rcSqrt(dx*dx + dy*dy + dz*dz);
740}
741
746inline float rcVdistSqr(const float* v1, const float* v2)
747{
748 float dx = v2[0] - v1[0];
749 float dy = v2[1] - v1[1];
750 float dz = v2[2] - v1[2];
751 return dx*dx + dy*dy + dz*dz;
752}
753
756inline void rcVnormalize(float* v)
757{
758 float d = 1.0f / rcSqrt(rcSqr(v[0]) + rcSqr(v[1]) + rcSqr(v[2]));
759 v[0] *= d;
760 v[1] *= d;
761 v[2] *= d;
762}
763
768
775void rcCalcBounds(const float* verts, int nv, float* bmin, float* bmax);
776
784void rcCalcGridSize(const float* bmin, const float* bmax, float cs, int* w, int* h);
785
797bool rcCreateHeightfield(rcContext* ctx, rcHeightfield& hf, int width, int height,
798 const float* bmin, const float* bmax,
799 float cs, float ch);
800
812void rcMarkWalkableTriangles(rcContext* ctx, const float walkableSlopeAngle, const float* verts, int nv,
813 const int* tris, int nt, unsigned char* areas);
814
825void rcClearUnwalkableTriangles(rcContext* ctx, const float walkableSlopeAngle, const float* verts, int nv,
826 const int* tris, int nt, unsigned char* areas);
827
841bool rcAddSpan(rcContext* ctx, rcHeightfield& hf, const int x, const int y,
842 const unsigned short smin, const unsigned short smax,
843 const unsigned char area, const int flagMergeThr);
844
856bool rcRasterizeTriangle(rcContext* ctx, const float* v0, const float* v1, const float* v2,
857 const unsigned char area, rcHeightfield& solid,
858 const int flagMergeThr = 1);
859
872bool rcRasterizeTriangles(rcContext* ctx, const float* verts, const int nv,
873 const int* tris, const unsigned char* areas, const int nt,
874 rcHeightfield& solid, const int flagMergeThr = 1);
875
888bool rcRasterizeTriangles(rcContext* ctx, const float* verts, const int nv,
889 const unsigned short* tris, const unsigned char* areas, const int nt,
890 rcHeightfield& solid, const int flagMergeThr = 1);
891
902bool rcRasterizeTriangles(rcContext* ctx, const float* verts, const unsigned char* areas, const int nt,
903 rcHeightfield& solid, const int flagMergeThr = 1);
904
911void rcFilterLowHangingWalkableObstacles(rcContext* ctx, const int walkableClimb, rcHeightfield& solid);
912
921void rcFilterLedgeSpans(rcContext* ctx, const int walkableHeight,
922 const int walkableClimb, rcHeightfield& solid);
923
930void rcFilterWalkableLowHeightSpans(rcContext* ctx, int walkableHeight, rcHeightfield& solid);
931
937int rcGetHeightFieldSpanCount(rcContext* ctx, rcHeightfield& hf);
938
943
954bool rcBuildCompactHeightfield(rcContext* ctx, const int walkableHeight, const int walkableClimb,
956
963bool rcErodeWalkableArea(rcContext* ctx, int radius, rcCompactHeightfield& chf);
964
970bool rcMedianFilterWalkableArea(rcContext* ctx, rcCompactHeightfield& chf);
971
979void rcMarkBoxArea(rcContext* ctx, const float* bmin, const float* bmax, unsigned char areaId,
981
991void rcMarkConvexPolyArea(rcContext* ctx, const float* verts, const int nverts,
992 const float hmin, const float hmax, unsigned char areaId,
994
1002int rcOffsetPoly(const float* verts, const int nverts, const float offset,
1003 float* outVerts, const int maxOutVerts);
1004
1013void rcMarkCylinderArea(rcContext* ctx, const float* pos,
1014 const float r, const float h, unsigned char areaId,
1016
1022bool rcBuildDistanceField(rcContext* ctx, rcCompactHeightfield& chf);
1023
1035bool rcBuildRegions(rcContext* ctx, rcCompactHeightfield& chf,
1036 const int borderSize, const int minRegionArea, const int mergeRegionArea);
1037
1047bool rcBuildLayerRegions(rcContext* ctx, rcCompactHeightfield& chf,
1048 const int borderSize, const int minRegionArea);
1049
1061bool rcBuildRegionsMonotone(rcContext* ctx, rcCompactHeightfield& chf,
1062 const int borderSize, const int minRegionArea, const int mergeRegionArea);
1063
1068inline void rcSetCon(rcCompactSpan& s, int dir, int i)
1069{
1070 const unsigned int shift = (unsigned int)dir*6;
1071 unsigned int con = s.con;
1072 s.con = (con & ~(0x3f << shift)) | (((unsigned int)i & 0x3f) << shift);
1073}
1074
1080inline int rcGetCon(const rcCompactSpan& s, int dir)
1081{
1082 const unsigned int shift = (unsigned int)dir*6;
1083 return (s.con >> shift) & 0x3f;
1084}
1085
1090inline int rcGetDirOffsetX(int dir)
1091{
1092 static const int offset[4] = { -1, 0, 1, 0, };
1093 return offset[dir&0x03];
1094}
1095
1100inline int rcGetDirOffsetY(int dir)
1101{
1102 static const int offset[4] = { 0, 1, 0, -1 };
1103 return offset[dir&0x03];
1104}
1105
1110inline int rcGetDirForOffset(int x, int y)
1111{
1112 static const int dirs[5] = { 3, 0, -1, 2, 1 };
1113 return dirs[((y+1)<<1)+x];
1114}
1115
1120
1131bool rcBuildHeightfieldLayers(rcContext* ctx, rcCompactHeightfield& chf,
1132 const int borderSize, const int walkableHeight,
1133 rcHeightfieldLayerSet& lset);
1134
1146bool rcBuildContours(rcContext* ctx, rcCompactHeightfield& chf,
1147 const float maxError, const int maxEdgeLen,
1148 rcContourSet& cset, const int buildFlags = RC_CONTOUR_TESS_WALL_EDGES);
1149
1158bool rcBuildPolyMesh(rcContext* ctx, rcContourSet& cset, const int nvp, rcPolyMesh& mesh);
1159
1167bool rcMergePolyMeshes(rcContext* ctx, rcPolyMesh** meshes, const int nmeshes, rcPolyMesh& mesh);
1168
1179bool rcBuildPolyMeshDetail(rcContext* ctx, const rcPolyMesh& mesh, const rcCompactHeightfield& chf,
1180 const float sampleDist, const float sampleMaxError,
1181 rcPolyMeshDetail& dmesh);
1182
1189bool rcCopyPolyMesh(rcContext* ctx, const rcPolyMesh& src, rcPolyMesh& dst);
1190
1198bool rcMergePolyMeshDetails(rcContext* ctx, rcPolyMeshDetail** meshes, const int nmeshes, rcPolyMeshDetail& mesh);
1199
1201
1202#endif // RECAST_H
1203
1205
1206// Due to the large amount of detail documentation for this file,
1207// the content normally located at the end of the header file has been separated
1208// out to a file in /Docs/Extern.
Definition Recast.h:102
void enableLog(bool state)
Definition Recast.h:112
int getAccumulatedTime(const rcTimerLabel label) const
Definition Recast.h:140
void resetTimers()
Clears all peformance timers. (Resets all to unused.)
Definition Recast.h:127
void startTimer(const rcTimerLabel label)
Definition Recast.h:131
void stopTimer(const rcTimerLabel label)
Definition Recast.h:135
virtual void doResetTimers()
Clears all timers. (Resets all to unused.)
Definition Recast.h:154
void resetLog()
Clears all log entries.
Definition Recast.h:115
virtual void doStopTimer(const rcTimerLabel)
Definition Recast.h:162
bool m_timerEnabled
True if the performance timers are enabled.
Definition Recast.h:173
virtual void doStartTimer(const rcTimerLabel)
Definition Recast.h:158
void enableTimer(bool state)
Definition Recast.h:124
virtual int doGetAccumulatedTime(const rcTimerLabel) const
Definition Recast.h:167
virtual void doLog(const rcLogCategory, const char *, const int)
Definition Recast.h:151
rcContext(bool state=true)
Definition Recast.h:107
virtual void doResetLog()
Clears all log entries.
Definition Recast.h:145
bool m_logEnabled
True if logging is enabled.
Definition Recast.h:170
Definition Recast.h:179
rcScopedTimer(rcContext *ctx, const rcTimerLabel label)
Definition Recast.h:184
Provides information on the content of a cell column in a compact heightfield.
Definition Recast.h:317
unsigned int count
Number of spans in the column.
Definition Recast.h:319
unsigned int index
Index to the first span in the column.
Definition Recast.h:318
Definition Recast.h:334
int walkableHeight
The walkable height used during the build of the field. (See: rcConfig::walkableHeight)
Definition Recast.h:340
rcCompactSpan * spans
Array of spans. [Size: spanCount].
Definition Recast.h:350
int height
The height of the heightfield. (Along the z-axis in cell units.)
Definition Recast.h:338
unsigned short maxDistance
The maximum distance value of any span within the field.
Definition Recast.h:343
float ch
The height of each cell. (The minimum increment along the y-axis.)
Definition Recast.h:348
float bmax[3]
The maximum bounds in world space. [(x, y, z)].
Definition Recast.h:346
int borderSize
The AABB border size used during the build of the field. (See: rcConfig::borderSize)
Definition Recast.h:342
unsigned short maxRegions
The maximum region id of any span within the field.
Definition Recast.h:344
int spanCount
The number of spans in the heightfield.
Definition Recast.h:339
float cs
The size of each cell. (On the xz-plane.)
Definition Recast.h:347
int width
The width of the heightfield. (Along the x-axis in cell units.)
Definition Recast.h:337
rcCompactCell * cells
Array of cells. [Size: width*height].
Definition Recast.h:349
unsigned char * areas
Array containing area id data. [Size: spanCount].
Definition Recast.h:352
int walkableClimb
The walkable climb used during the build of the field. (See: rcConfig::walkableClimb)
Definition Recast.h:341
float bmin[3]
The minimum bounds in world space. [(x, y, z)].
Definition Recast.h:345
unsigned short * dist
Array containing border distance data. [Size: spanCount].
Definition Recast.h:351
Represents a span of unobstructed space within a compact heightfield.
Definition Recast.h:324
unsigned short y
The lower extent of the span. (Measured from the heightfield's base.)
Definition Recast.h:325
unsigned int h
The height of the span. (Measured from y.)
Definition Recast.h:328
unsigned int con
Packed neighbor connection data.
Definition Recast.h:327
unsigned short reg
The id of the region the span belongs to. (Or zero if not in a region.)
Definition Recast.h:326
Definition Recast.h:199
int minRegionArea
The minimum number of cells allowed to form isolated island areas. [Limit: >=0] [Units: vx].
Definition Recast.h:246
int maxVertsPerPoly
Definition Recast.h:254
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
float cs
The xz-plane cell size to use for fields. [Limit: > 0] [Units: wu].
Definition Recast.h:213
int tileSize
The width/height size of tile's on the xz-plane. [Limit: >= 0] [Units: vx].
Definition Recast.h:207
int walkableRadius
Definition Recast.h:236
int width
The width of the field along the x-axis. [Limit: >= 0] [Units: vx].
Definition Recast.h:201
float maxSimplificationError
Definition Recast.h:243
int mergeRegionArea
Definition Recast.h:250
float bmax[3]
The maximum bounds of the field's AABB. [(x, y, z)] [Units: wu].
Definition Recast.h:222
int walkableHeight
Definition Recast.h:229
float detailSampleDist
Definition Recast.h:258
int maxEdgeLen
The maximum allowed length for contour edges along the border of the mesh. [Limit: >=0] [Units: vx].
Definition Recast.h:239
float ch
The y-axis cell size to use for fields. [Limit: > 0] [Units: wu].
Definition Recast.h:216
int walkableClimb
Maximum ledge height that is considered to still be traversable. [Limit: >=0] [Units: vx].
Definition Recast.h:232
float walkableSlopeAngle
The maximum slope that is considered walkable. [Limits: 0 <= value < 90] [Units: Degrees].
Definition Recast.h:225
float detailSampleMaxError
Definition Recast.h:262
float bmin[3]
The minimum bounds of the field's AABB. [(x, y, z)] [Units: wu].
Definition Recast.h:219
Definition Recast.h:401
int height
The height of the set. (Along the z-axis in cell units.)
Definition Recast.h:411
float cs
The size of each cell. (On the xz-plane.)
Definition Recast.h:408
float bmin[3]
The minimum bounds in world space. [(x, y, z)].
Definition Recast.h:406
int nconts
The number of contours in the set.
Definition Recast.h:405
rcContour * conts
An array of the contours in the set. [Size: nconts].
Definition Recast.h:404
float ch
The height of each cell. (The minimum increment along the y-axis.)
Definition Recast.h:409
int borderSize
The AABB border size used to generate the source data from which the contours were derived.
Definition Recast.h:412
float bmax[3]
The maximum bounds in world space. [(x, y, z)].
Definition Recast.h:407
int width
The width of the set. (Along the x-axis in cell units.)
Definition Recast.h:410
float maxError
The max edge error that this contour set was simplified with.
Definition Recast.h:413
Represents a simple, non-overlapping contour in field space.
Definition Recast.h:389
int nrverts
The number of vertices in the raw contour.
Definition Recast.h:393
unsigned char area
The area id of the contour.
Definition Recast.h:395
int * rverts
Raw contour vertex and connection data. [Size: 4 * nrverts].
Definition Recast.h:392
unsigned short reg
The region id of the contour.
Definition Recast.h:394
int * verts
Simplified contour vertex and connection data. [Size: 4 * nverts].
Definition Recast.h:390
int nverts
The number of vertices in the simplified contour.
Definition Recast.h:391
Definition Recast.h:380
rcHeightfieldLayer * layers
The layers in the set. [Size: nlayers].
Definition Recast.h:383
int nlayers
The number of layers in the set.
Definition Recast.h:384
Definition Recast.h:358
float bmax[3]
The maximum bounds in world space. [(x, y, z)].
Definition Recast.h:360
unsigned char * cons
Packed neighbor connection information. [Size: Same as heights].
Definition Recast.h:373
float ch
The height of each cell. (The minimum increment along the y-axis.)
Definition Recast.h:362
int height
The height of the heightfield. (Along the z-axis in cell units.)
Definition Recast.h:364
int width
The width of the heightfield. (Along the x-axis in cell units.)
Definition Recast.h:363
int hmin
The minimum height bounds of usable data. (Along the y-axis.)
Definition Recast.h:369
unsigned char * areas
Area ids. [Size: Same as heights].
Definition Recast.h:372
int hmax
The maximum height bounds of usable data. (Along the y-axis.)
Definition Recast.h:370
float bmin[3]
The minimum bounds in world space. [(x, y, z)].
Definition Recast.h:359
int maxx
The maximum x-bounds of usable data.
Definition Recast.h:366
unsigned char * heights
The heightfield. [Size: width * height].
Definition Recast.h:371
int maxy
The maximum y-bounds of usable data. (Along the z-axis.)
Definition Recast.h:368
int minx
The minimum x-bounds of usable data.
Definition Recast.h:365
float cs
The size of each cell. (On the xz-plane.)
Definition Recast.h:361
int miny
The minimum y-bounds of usable data. (Along the z-axis.)
Definition Recast.h:367
Definition Recast.h:295
float bmin[3]
The minimum bounds in world space. [(x, y, z)].
Definition Recast.h:301
rcSpan * freelist
The next free span.
Definition Recast.h:307
rcSpan ** spans
Heightfield of spans (width*height).
Definition Recast.h:305
float ch
The height of each cell. (The minimum increment along the y-axis.)
Definition Recast.h:304
float cs
The size of each cell. (On the xz-plane.)
Definition Recast.h:303
float bmax[3]
The maximum bounds in world space. [(x, y, z)].
Definition Recast.h:302
int height
The height of the heightfield. (Along the z-axis in cell units.)
Definition Recast.h:300
rcSpanPool * pools
Linked list of span pools.
Definition Recast.h:306
int width
The width of the heightfield. (Along the x-axis in cell units.)
Definition Recast.h:299
Definition Recast.h:443
unsigned char * tris
The mesh triangles. [Size: 4*ntris].
Definition Recast.h:446
float * verts
The mesh vertices. [Size: 3*nverts].
Definition Recast.h:445
int nverts
The number of vertices in verts.
Definition Recast.h:448
int ntris
The number of triangles in tris.
Definition Recast.h:449
unsigned int * meshes
The sub-mesh data. [Size: 4*nmeshes].
Definition Recast.h:444
int nmeshes
The number of sub-meshes defined by meshes.
Definition Recast.h:447
Definition Recast.h:419
unsigned short * verts
The mesh vertices. [Form: (x, y, z) * nverts].
Definition Recast.h:422
float cs
The size of each cell. (On the xz-plane.)
Definition Recast.h:433
float bmin[3]
The minimum bounds in world space. [(x, y, z)].
Definition Recast.h:431
unsigned char * areas
The area id assigned to each polygon. [Length: maxpolys].
Definition Recast.h:426
unsigned short * regs
The region id assigned to each polygon. [Length: maxpolys].
Definition Recast.h:424
int borderSize
The AABB border size used to generate the source data from which the mesh was derived.
Definition Recast.h:435
float ch
The height of each cell. (The minimum increment along the y-axis.)
Definition Recast.h:434
float bmax[3]
The maximum bounds in world space. [(x, y, z)].
Definition Recast.h:432
int nvp
The maximum number of vertices per polygon.
Definition Recast.h:430
float maxEdgeError
The max error of the polygon edges in the mesh.
Definition Recast.h:436
unsigned short * polys
Polygon and neighbor data. [Length: maxpolys * 2 * nvp].
Definition Recast.h:423
unsigned short * flags
The user defined flags for each polygon. [Length: maxpolys].
Definition Recast.h:425
int npolys
The number of polygons.
Definition Recast.h:428
int nverts
The number of vertices.
Definition Recast.h:427
int maxpolys
The number of allocated polygons.
Definition Recast.h:429
Definition Recast.h:287
rcSpan items[RC_SPANS_PER_POOL]
Array of spans in the pool.
Definition Recast.h:289
rcSpanPool * next
The next span pool.
Definition Recast.h:288
Definition Recast.h:277
rcSpan * next
The next span higher up in column.
Definition Recast.h:281
unsigned int smax
The upper limit of the span. [Limit: <= RC_SPAN_MAX_HEIGHT].
Definition Recast.h:279
unsigned int area
The area id assigned to the span.
Definition Recast.h:280
unsigned int smin
The lower limit of the span. [Limit: < smax].
Definition Recast.h:278