#ifndef OPENMW_COMPONENTS_DETOURNAVIGATOR_NAVMESHMANAGER_H #define OPENMW_COMPONENTS_DETOURNAVIGATOR_NAVMESHMANAGER_H #include "asyncnavmeshupdater.hpp" #include "cachedrecastmeshmanager.hpp" #include "sharednavmesh.hpp" #include #include #include #include #include class dtNavMesh; namespace DetourNavigator { class NavMeshManager { public: NavMeshManager(const Settings& settings); bool addObject(std::size_t id, const btCollisionShape& shape, const btTransform& transform); bool removeObject(std::size_t id); void addAgent(const osg::Vec3f& agentHalfExtents); void reset(const osg::Vec3f& agentHalfExtents); void update(osg::Vec3f playerPosition, const osg::Vec3f& agentHalfExtents); void wait(); SharedNavMesh getNavMesh(const osg::Vec3f& agentHalfExtents) const; std::map> getNavMeshes() const; private: std::size_t mRevision = 0; const Settings& mSettings; CachedRecastMeshManager mRecastMeshManager; std::map> mCache; std::map> mChangedTiles; AsyncNavMeshUpdater mAsyncNavMeshUpdater; void addChangedTiles(const btCollisionShape& shape, const btTransform& transform); const std::shared_ptr& getCached(const osg::Vec3f& agentHalfExtents) const; }; } #endif