#ifndef OPENMW_MWRENDER_NAVMESH_H #define OPENMW_MWRENDER_NAVMESH_H #include #include #include #include #include #include #include #include class dtNavMesh; namespace osg { class Group; class Geometry; class StateSet; } namespace DetourNavigator { class NavMeshCacheItem; struct Settings; } namespace SceneUtil { class WorkQueue; } namespace MWRender { class NavMesh { public: explicit NavMesh(const osg::ref_ptr& root, const osg::ref_ptr& workQueue, bool enabled); ~NavMesh(); bool toggle(); void update(const std::shared_ptr>& navMesh, std::size_t id, const DetourNavigator::Settings& settings); void reset(); void enable(); void disable(); bool isEnabled() const { return mEnabled; } private: struct Tile { DetourNavigator::Version mVersion; osg::ref_ptr mGroup; }; struct LessByTilePosition; struct CreateNavMeshTileGroups; struct DeallocateCreateNavMeshTileGroups; osg::ref_ptr mRootNode; osg::ref_ptr mWorkQueue; osg::ref_ptr mGroupStateSet; osg::ref_ptr mDebugDrawStateSet; bool mEnabled; std::size_t mId; DetourNavigator::Version mVersion; std::map mTiles; std::vector> mWorkItems; }; } #endif