#pragma once #include #include "DetourTileCache.h" class dtTileCache; class dtNavMesh; class dtNavMeshQuery; namespace f8 { typedef dtObstacleRef ObstacleRef; class NavMeshLayer { public: int FindStraightPath(const a8::Vec3& start, const a8::Vec3& end, std::vector& path_list); int FindRandomPointAroundCircle(const a8::Vec3& center_pos, std::vector& points, int max_points, float max_radius); int Raycast(const a8::Vec3& start, const a8::Vec3& end, std::vector& hit_points); bool AddObstacle(a8::Vec3& pos, const float radius, const float height, ObstacleRef* obstacle_ref); bool AddBoxObstacle(a8::Vec3& bmin, a8::Vec3& bmax, ObstacleRef* obstacle_ref); bool RemoveObstacle(const ObstacleRef& obstacle_ref); void WaitRebuildOk(); bool Update(); private: dtNavMesh* navmesh_ = nullptr; dtTileCache* tile_cache_ = nullptr; dtNavMeshQuery* navmesh_query_ = nullptr; }; class NavigationHandle { public: NavigationHandle() {}; ~NavigationHandle() {}; NavMeshLayer* GetLayer(int layer); void WaitRebuildOk(); bool Update(); private: std::map navmesh_layers_; }; }