1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-21 18:40:01 +00:00
OpenMW/apps/openmw/mwrender/navmesh.hpp

69 lines
1.3 KiB
C++
Raw Normal View History

#ifndef OPENMW_MWRENDER_NAVMESH_H
#define OPENMW_MWRENDER_NAVMESH_H
#include <components/detournavigator/version.hpp>
2021-11-01 20:05:34 +01:00
#include <components/detournavigator/tileposition.hpp>
#include <osg/ref_ptr>
#include <cstddef>
2021-11-01 20:05:34 +01:00
#include <map>
class dtNavMesh;
namespace osg
{
class Group;
class Geometry;
class StateSet;
}
namespace DetourNavigator
{
2021-11-01 20:05:34 +01:00
class NavMeshCacheItem;
struct Settings;
}
namespace MWRender
{
class NavMesh
{
public:
NavMesh(const osg::ref_ptr<osg::Group>& root, bool enabled);
~NavMesh();
bool toggle();
2021-11-01 20:05:34 +01:00
void update(const DetourNavigator::NavMeshCacheItem& navMesh, std::size_t id,
const DetourNavigator::Settings& settings);
void reset();
void enable();
void disable();
bool isEnabled() const
{
return mEnabled;
}
private:
2021-11-01 20:05:34 +01:00
struct Tile
{
DetourNavigator::Version mVersion;
osg::ref_ptr<osg::Group> mGroup;
};
osg::ref_ptr<osg::Group> mRootNode;
osg::ref_ptr<osg::StateSet> mGroupStateSet;
osg::ref_ptr<osg::StateSet> mDebugDrawStateSet;
bool mEnabled;
std::size_t mId;
DetourNavigator::Version mVersion;
2021-11-01 20:05:34 +01:00
std::map<DetourNavigator::TilePosition, Tile> mTiles;
};
}
#endif