123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- #ifndef DETOURPATHQUEUE_H
- #define DETOURPATHQUEUE_H
- #include "recast/Detour/DetourNavMesh.h"
- #include "recast/Detour/DetourNavMeshQuery.h"
- static const unsigned int DT_PATHQ_INVALID = 0;
- typedef unsigned int dtPathQueueRef;
- class dtPathQueue
- {
- struct PathQuery
- {
- dtPathQueueRef ref;
-
- float startPos[3], endPos[3];
- dtPolyRef startRef, endRef;
-
- dtPolyRef* path;
- int npath;
-
- dtStatus status;
- int keepAlive;
- const dtQueryFilter* filter;
- };
-
- static const int MAX_QUEUE = 8;
- PathQuery m_queue[MAX_QUEUE];
- dtPathQueueRef m_nextHandle;
- int m_maxPathSize;
- int m_queueHead;
- dtNavMeshQuery* m_navquery;
-
- void purge();
-
- public:
- dtPathQueue();
- ~dtPathQueue();
-
- bool init(const int maxPathSize, const int maxSearchNodeCount, dtNavMesh* nav);
-
- void update(const int maxIters);
-
- dtPathQueueRef request(dtPolyRef startRef, dtPolyRef endRef,
- const float* startPos, const float* endPos,
- const dtQueryFilter* filter);
-
- dtStatus getRequestStatus(dtPathQueueRef ref) const;
-
- dtStatus getPathResult(dtPathQueueRef ref, dtPolyRef* path, int* pathSize, const int maxPath);
-
- inline const dtNavMeshQuery* getNavQuery() const { return m_navquery; }
- };
- #endif
|