19#ifndef DETOURNAVMESHQUERY_H
20#define DETOURNAVMESHQUERY_H
22#include "DetourNavMesh.h"
23#include "DetourStatus.h"
37 float m_areaCost[DT_MAX_AREAS];
38 unsigned short m_includeFlags;
39 unsigned short m_excludeFlags;
44#ifdef DT_VIRTUAL_QUERYFILTER
52#ifdef DT_VIRTUAL_QUERYFILTER
75#ifdef DT_VIRTUAL_QUERYFILTER
76 virtual float getCost(
const float* pa,
const float* pb,
81 float getCost(
const float* pa,
const float* pb,
93 inline float getAreaCost(
const int i)
const {
return m_areaCost[i]; }
98 inline void setAreaCost(
const int i,
const float cost) { m_areaCost[i] = cost; }
191 const float* startPos,
const float* endPos,
193 dtPolyRef* path,
int* pathCount,
const int maxPath)
const;
208 const dtPolyRef* path,
const int pathSize,
209 float* straightPath,
unsigned char* straightPathFlags,
dtPolyRef* straightPathRefs,
210 int* straightPathCount,
const int maxStraightPath,
const int options = 0)
const;
229 const float* startPos,
const float* endPos,
230 const dtQueryFilter* filter,
const unsigned int options = 0);
256 dtPolyRef* path,
int* pathCount,
const int maxPath);
277 int* resultCount,
const int maxResult)
const;
295 int* resultCount,
const int maxResult)
const;
322 dtStatus
findNearestPoly(
const float* center,
const float* halfExtents,
324 dtPolyRef* nearestRef,
float* nearestPt)
const;
334 dtStatus
queryPolygons(
const float* center,
const float* halfExtents,
336 dtPolyRef* polys,
int* polyCount,
const int maxPolys)
const;
343 dtStatus
queryPolygons(
const float* center,
const float* halfExtents,
360 int* resultCount,
const int maxResult)
const;
374 float* resultPos,
dtPolyRef* visited,
int* visitedCount,
const int maxVisitedSize)
const;
390 dtStatus
raycast(
dtPolyRef startRef,
const float* startPos,
const float* endPos,
392 float* t,
float* hitNormal,
dtPolyRef* path,
int* pathCount,
const int maxPath)
const;
405 dtStatus
raycast(
dtPolyRef startRef,
const float* startPos,
const float* endPos,
422 float* hitDist,
float* hitPos,
float* hitNormal)
const;
434 float* segmentVerts,
dtPolyRef* segmentRefs,
int* segmentCount,
435 const int maxSegments)
const;
445 dtPolyRef* randomRef,
float* randomPt)
const;
459 dtPolyRef* randomRef,
float* randomPt)
const;
514 void queryPolygonsInTile(
const dtMeshTile* tile,
const float* qmin,
const float* qmax,
519 unsigned char& fromType,
unsigned char& toType)
const;
522 float* left,
float* right)
const;
531 dtStatus appendVertex(
const float* pos,
const unsigned char flags,
const dtPolyRef ref,
532 float* straightPath,
unsigned char* straightPathFlags,
dtPolyRef* straightPathRefs,
533 int* straightPathCount,
const int maxStraightPath)
const;
536 dtStatus appendPortals(
const int startIdx,
const int endIdx,
const float* endPos,
const dtPolyRef* path,
537 float* straightPath,
unsigned char* straightPathFlags,
dtPolyRef* straightPathRefs,
538 int* straightPathCount,
const int maxStraightPath,
const int options)
const;
541 dtStatus getPathToNode(
struct dtNode* endNode,
dtPolyRef* path,
int* pathCount,
int maxPath)
const;
548 struct dtNode* lastBestNode;
549 float lastBestNodeCost;
551 float startPos[3], endPos[3];
553 unsigned int options;
554 float raycastLimitSqr;
Definition DetourNavMeshQuery.h:166
dtStatus finalizeSlicedFindPathPartial(const dtPolyRef *existing, const int existingSize, dtPolyRef *path, int *pathCount, const int maxPath)
Definition DetourNavMeshQuery.cpp:1560
dtStatus queryPolygons(const float *center, const float *halfExtents, const dtQueryFilter *filter, dtPolyRef *polys, int *polyCount, const int maxPolys) const
Definition DetourNavMeshQuery.cpp:872
dtStatus closestPointOnPoly(dtPolyRef ref, const float *pos, float *closest, bool *posOverPoly) const
Definition DetourNavMeshQuery.cpp:514
dtStatus findPolysAroundCircle(dtPolyRef startRef, const float *centerPos, const float radius, const dtQueryFilter *filter, dtPolyRef *resultRef, dtPolyRef *resultParent, float *resultCost, int *resultCount, const int maxResult) const
Definition DetourNavMeshQuery.cpp:2693
dtStatus findDistanceToWall(dtPolyRef startRef, const float *centerPos, const float maxRadius, const dtQueryFilter *filter, float *hitDist, float *hitPos, float *hitNormal) const
Definition DetourNavMeshQuery.cpp:3443
dtStatus getPolyWallSegments(dtPolyRef ref, const dtQueryFilter *filter, float *segmentVerts, dtPolyRef *segmentRefs, int *segmentCount, const int maxSegments) const
Definition DetourNavMeshQuery.cpp:3287
dtStatus findNearestPoly(const float *center, const float *halfExtents, const dtQueryFilter *filter, dtPolyRef *nearestRef, float *nearestPt) const
Definition DetourNavMeshQuery.cpp:686
dtStatus raycast(dtPolyRef startRef, const float *startPos, const float *endPos, const dtQueryFilter *filter, float *t, float *hitNormal, dtPolyRef *path, int *pathCount, const int maxPath) const
Definition DetourNavMeshQuery.cpp:2381
dtStatus moveAlongSurface(dtPolyRef startRef, const float *startPos, const float *endPos, const dtQueryFilter *filter, float *resultPos, dtPolyRef *visited, int *visitedCount, const int maxVisitedSize) const
Definition DetourNavMeshQuery.cpp:2017
dtStatus findLocalNeighbourhood(dtPolyRef startRef, const float *centerPos, const float radius, const dtQueryFilter *filter, dtPolyRef *resultRef, dtPolyRef *resultParent, int *resultCount, const int maxResult) const
Definition DetourNavMeshQuery.cpp:3065
dtStatus finalizeSlicedFindPath(dtPolyRef *path, int *pathCount, const int maxPath)
Definition DetourNavMeshQuery.cpp:1470
dtStatus findPath(dtPolyRef startRef, dtPolyRef endRef, const float *startPos, const float *endPos, const dtQueryFilter *filter, dtPolyRef *path, int *pathCount, const int maxPath) const
Definition DetourNavMeshQuery.cpp:946
dtStatus updateSlicedFindPath(const int maxIter, int *doneIters)
Definition DetourNavMeshQuery.cpp:1253
dtStatus findPolysAroundShape(dtPolyRef startRef, const float *verts, const int nverts, const dtQueryFilter *filter, dtPolyRef *resultRef, dtPolyRef *resultParent, float *resultCost, int *resultCount, const int maxResult) const
Definition DetourNavMeshQuery.cpp:2867
dtStatus closestPointOnPolyBoundary(dtPolyRef ref, const float *pos, float *closest) const
Definition DetourNavMeshQuery.cpp:539
const dtNavMesh * getAttachedNavMesh() const
Definition DetourNavMeshQuery.h:504
dtStatus findRandomPointAroundCircle(dtPolyRef startRef, const float *centerPos, const float maxRadius, const dtQueryFilter *filter, float(*frand)(), dtPolyRef *randomRef, float *randomPt) const
Definition DetourNavMeshQuery.cpp:316
dtStatus findStraightPath(const float *startPos, const float *endPos, const dtPolyRef *path, const int pathSize, float *straightPath, unsigned char *straightPathFlags, dtPolyRef *straightPathRefs, int *straightPathCount, const int maxStraightPath, const int options=0) const
Definition DetourNavMeshQuery.cpp:1766
class dtNodePool * getNodePool() const
Definition DetourNavMeshQuery.h:500
bool isValidPolyRef(dtPolyRef ref, const dtQueryFilter *filter) const
Definition DetourNavMeshQuery.cpp:3630
dtStatus init(const dtNavMesh *nav, const int maxNodes)
Definition DetourNavMeshQuery.cpp:166
bool isInClosedList(dtPolyRef ref) const
Definition DetourNavMeshQuery.cpp:3649
dtStatus initSlicedFindPath(dtPolyRef startRef, dtPolyRef endRef, const float *startPos, const float *endPos, const dtQueryFilter *filter, const unsigned int options=0)
Definition DetourNavMeshQuery.cpp:1189
dtStatus getPathFromDijkstraSearch(dtPolyRef endRef, dtPolyRef *path, int *pathCount, int maxPath) const
Definition DetourNavMeshQuery.cpp:3028
dtStatus getPolyHeight(dtPolyRef ref, const float *pos, float *height) const
Definition DetourNavMeshQuery.cpp:594
dtStatus findRandomPoint(const dtQueryFilter *filter, float(*frand)(), dtPolyRef *randomRef, float *randomPt) const
Definition DetourNavMeshQuery.cpp:221
Definition DetourNavMesh.h:339
Definition DetourNode.h:50
Definition DetourNode.h:109
Definition DetourNavMeshQuery.h:153
virtual void process(const dtMeshTile *tile, dtPoly **polys, dtPolyRef *refs, int count)=0
Definition DetourNavMeshQuery.h:36
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
Definition DetourNavMeshQuery.cpp:94
void setExcludeFlags(const unsigned short flags)
Definition DetourNavMeshQuery.h:116
float getAreaCost(const int i) const
Definition DetourNavMeshQuery.h:93
void setAreaCost(const int i, const float cost)
Definition DetourNavMeshQuery.h:98
unsigned short getIncludeFlags() const
Definition DetourNavMeshQuery.h:103
bool passFilter(const dtPolyRef ref, const dtMeshTile *tile, const dtPoly *poly) const
Definition DetourNavMeshQuery.cpp:87
void setIncludeFlags(const unsigned short flags)
Definition DetourNavMeshQuery.h:107
unsigned short getExcludeFlags() const
Definition DetourNavMeshQuery.h:112
void dtFreeNavMeshQuery(dtNavMeshQuery *query)
Definition DetourNavMeshQuery.cpp:113
dtNavMeshQuery * dtAllocNavMeshQuery()
Definition DetourNavMeshQuery.cpp:106
unsigned int dtPolyRef
Definition DetourNavMesh.h:48
Definition DetourNavMesh.h:282
Definition DetourNode.h:37
Definition DetourNavMesh.h:156
Definition DetourNavMeshQuery.h:126
int hitEdgeIndex
The index of the edge on the final polygon where the wall was hit.
Definition DetourNavMeshQuery.h:134
float hitNormal[3]
hitNormal The normal of the nearest wall hit. [(x, y, z)]
Definition DetourNavMeshQuery.h:131
int maxPath
The maximum number of polygons the path array can hold.
Definition DetourNavMeshQuery.h:143
float t
The hit parameter. (FLT_MAX if no wall hit.)
Definition DetourNavMeshQuery.h:128
float pathCost
The cost of the path until hit.
Definition DetourNavMeshQuery.h:146
int pathCount
The number of visited polygons. [opt].
Definition DetourNavMeshQuery.h:140
dtPolyRef * path
Pointer to an array of reference ids of the visited polygons. [opt].
Definition DetourNavMeshQuery.h:137