Recast Navigation  1.0.35
CompactHeightfield.h
Go to the documentation of this file.
1 //
2 // CompactHeightfield.h
3 // Recast
4 //
5 // Created by Graham Pentheny on 7/31/15.
6 //
7 //
8 
9 #ifndef Recast_CompactHeightfield_h
10 #define Recast_CompactHeightfield_h
11 
16 
27 bool rcBuildCompactHeightfield(rcContext* ctx, const int walkableHeight, const int walkableClimb, rcHeightfield& hf, rcCompactHeightfield& chf);
28 
35 
47 bool rcBuildRegions(rcContext* ctx, rcCompactHeightfield& chf, const int borderSize, const int minRegionArea, const int mergeRegionArea);
48 
58 bool rcBuildLayerRegions(rcContext* ctx, rcCompactHeightfield& chf, const int borderSize, const int minRegionArea);
59 
71 bool rcBuildRegionsMonotone(rcContext* ctx, rcCompactHeightfield& chf, const int borderSize, const int minRegionArea, const int mergeRegionArea);
72 
77 inline void rcSetCon(rcCompactSpan& s, int dir, int i)
78 {
79  const unsigned int shift = (unsigned int)dir*6;
80  unsigned int con = s.connectionData;
81  s.connectionData = (con & ~(0x3f << shift)) | (((unsigned int)i & 0x3f) << shift);
82 }
83 
89 inline int rcGetCon(const rcCompactSpan& s, int dir)
90 {
91  const unsigned int shift = (unsigned int)dir*6;
92  return (s.connectionData >> shift) & 0x3f;
93 }
94 
99 inline int rcGetDirOffsetX(int dir)
100 {
101  const int offset[4] = { -1, 0, 1, 0, };
102  return offset[dir&0x03];
103 }
104 
109 inline int rcGetDirOffsetY(int dir)
110 {
111  const int offset[4] = { 0, 1, 0, -1 };
112  return offset[dir&0x03];
113 }
114 
115 
116 #endif
A dynamic heightfield representing obstructed space.
Definition: Recast.h:275
Represents a span of unobstructed space within a compact heightfield.
Definition: Recast.h:296
Provides an interface for optional logging and performance tracking of the Recast build process...
Definition: Recast.h:103
bool rcBuildDistanceField(rcContext *ctx, rcCompactHeightfield &chf)
Builds the distance field for the specified compact heightfield.
Definition: CompactHeightfield.cpp:382
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.
Definition: RecastRegion.cpp:1292
bool rcBuildLayerRegions(rcContext *ctx, rcCompactHeightfield &chf, const int borderSize, const int minRegionArea)
Builds region data for the heightfield by partitioning the heightfield in non-overlapping layers...
Definition: RecastRegion.cpp:1604
bool rcBuildRegions(rcContext *ctx, rcCompactHeightfield &chf, const int borderSize, const int minRegionArea, const int mergeRegionArea)
Builds region data for the heightfield using watershed partitioning.
Definition: RecastRegion.cpp:1466
A compact, static heightfield representing unobstructed space.
Definition: Recast.h:306
int rcGetDirOffsetX(int dir)
Gets the standard width (x-axis) offset for the specified direction.
Definition: CompactHeightfield.h:99
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...
Definition: CompactHeightfield.cpp:236
int rcGetCon(const rcCompactSpan &s, int dir)
Gets neighbor connection data for the specified direction.
Definition: CompactHeightfield.h:89
int rcGetDirOffsetY(int dir)
Gets the standard height (z-axis) offset for the specified direction.
Definition: CompactHeightfield.h:109
void rcSetCon(rcCompactSpan &s, int dir, int i)
Sets the neighbor connection data for the specified direction.
Definition: CompactHeightfield.h:77
unsigned int connectionData
Packed neighbor connection data.
Definition: Recast.h:300