19 #ifndef DETOURNAVMESHQUERY_H 20 #define DETOURNAVMESHQUERY_H 38 unsigned short m_includeFlags;
39 unsigned short m_excludeFlags;
48 #ifdef DT_VIRTUAL_QUERYFILTER 71 #ifdef DT_VIRTUAL_QUERYFILTER 72 virtual float getCost(
const float* pa,
const float* pb,
77 float getCost(
const float* pa,
const float* pb,
89 inline float getAreaCost(
const int i)
const {
return m_areaCost[i]; }
94 inline void setAreaCost(
const int i,
const float cost) { m_areaCost[i] = cost; }
147 const float* startPos,
const float* endPos,
149 dtPolyRef* path,
int* pathCount,
const int maxPath)
const;
162 dtStatus findStraightPath(
const float* startPos,
const float* endPos,
163 const dtPolyRef* path,
const int pathSize,
164 float* straightPath,
unsigned char* straightPathFlags,
dtPolyRef* straightPathRefs,
165 int* straightPathCount,
const int maxStraightPath)
const;
183 const float* startPos,
const float* endPos,
190 dtStatus updateSlicedFindPath(
const int maxIter,
int* doneIters);
198 dtStatus finalizeSlicedFindPath(
dtPolyRef* path,
int* pathCount,
const int maxPath);
209 dtStatus finalizeSlicedFindPathPartial(
const dtPolyRef* existing,
const int existingSize,
210 dtPolyRef* path,
int* pathCount,
const int maxPath);
228 dtStatus findPolysAroundCircle(
dtPolyRef startRef,
const float* centerPos,
const float radius,
231 int* resultCount,
const int maxResult)
const;
246 dtStatus findPolysAroundShape(
dtPolyRef startRef,
const float* verts,
const int nverts,
249 int* resultCount,
const int maxResult)
const;
262 dtStatus findNearestPoly(
const float* center,
const float* extents,
264 dtPolyRef* nearestRef,
float* nearestPt)
const;
274 dtStatus queryPolygons(
const float* center,
const float* extents,
276 dtPolyRef* polys,
int* polyCount,
const int maxPolys)
const;
289 dtStatus findLocalNeighbourhood(
dtPolyRef startRef,
const float* centerPos,
const float radius,
292 int* resultCount,
const int maxResult)
const;
304 dtStatus moveAlongSurface(
dtPolyRef startRef,
const float* startPos,
const float* endPos,
306 float* resultPos,
dtPolyRef* visited,
int* visitedCount,
const int maxVisitedSize)
const;
323 float* t,
float* hitNormal,
dtPolyRef* path,
int* pathCount,
const int maxPath)
const;
335 dtStatus findDistanceToWall(
dtPolyRef startRef,
const float* centerPos,
const float maxRadius,
337 float* hitDist,
float* hitPos,
float* hitNormal)
const;
349 float* segmentVerts,
dtPolyRef* segmentRefs,
int* segmentCount,
350 const int maxSegments)
const;
360 dtPolyRef* randomRef,
float* randomPt)
const;
372 dtStatus findRandomPointAroundCircle(
dtPolyRef startRef,
const float* centerPos,
const float maxRadius,
374 dtPolyRef* randomRef,
float* randomPt)
const;
381 dtStatus closestPointOnPoly(
dtPolyRef ref,
const float* pos,
float* closest)
const;
389 dtStatus closestPointOnPolyBoundary(
dtPolyRef ref,
const float* pos,
float* closest)
const;
410 bool isInClosedList(
dtPolyRef ref)
const;
425 dtMeshTile* getNeighbourTileAt(
int x,
int y,
int side)
const;
428 int queryPolygonsInTile(
const dtMeshTile* tile,
const float* qmin,
const float* qmax,
const dtQueryFilter* filter,
429 dtPolyRef* polys,
const int maxPolys)
const;
431 dtPolyRef findNearestPolyInTile(
const dtMeshTile* tile,
const float* center,
const float* extents,
434 void closestPointOnPolyInTile(
const dtMeshTile* tile,
const dtPoly* poly,
const float* pos,
float* closest)
const;
438 unsigned char& fromType,
unsigned char& toType)
const;
441 float* left,
float* right)
const;
454 struct dtNode* lastBestNode;
455 float lastBestNodeCost;
457 float startPos[3], endPos[3];
477 #endif // DETOURNAVMESHQUERY_H void setIncludeFlags(const unsigned short flags)
Sets the include flags for the filter.
unsigned int dtPolyRef
A handle to a polygon within a navigation mesh tile.
const dtNavMesh * getAttachedNavMesh() const
Gets the navigation mesh the query object is using.
Defines polygon filtering and traversal costs for navigation mesh query operations.
A navigation mesh based on tiles of convex polygons.
float getCost(const float *pa, const float *pb, const dtPolyRef prevRef, const dtMeshTile *prevTile, const dtPoly *prevPoly, const dtPolyRef curRef, const dtMeshTile *curTile, const dtPoly *curPoly, const dtPolyRef nextRef, const dtMeshTile *nextTile, const dtPoly *nextPoly) const
Returns cost to move from the beginning to the end of a line segment that is fully contained within a...
static const int DT_MAX_AREAS
The maximum number of user defined area ids.
unsigned short getIncludeFlags() const
Returns the include flags for the filter. Any polygons that include one or more of these flags will b...
Defines a polyogn within a dtMeshTile object.
unsigned short getExcludeFlags() const
Returns the exclude flags for the filter. Any polygons that include one ore more of these flags will ...
float getAreaCost(const int i) const
Returns the traversal cost of the area.
class dtNodePool * getNodePool() const
Gets the node pool.
dtNavMeshQuery * dtAllocNavMeshQuery()
Allocates a query object using the Detour allocator.
void setAreaCost(const int i, const float cost)
Sets the traversal cost of the area.
void dtFreeNavMeshQuery(dtNavMeshQuery *query)
Frees the specified query object using the Detour allocator.
void setExcludeFlags(const unsigned short flags)
Sets the exclude flags for the filter.
Defines a navigation mesh tile.
Provides the ability to perform pathfinding related queries against a navigation mesh.
bool passFilter(const dtPolyRef ref, const dtMeshTile *tile, const dtPoly *poly) const
Returns true if the polygon can be visited. (I.e. Is traversable.)