2019-11-27 23:45:01 +01:00
|
|
|
#ifndef OPENMW_MWRENDER_RECASTMESH_H
|
|
|
|
#define OPENMW_MWRENDER_RECASTMESH_H
|
|
|
|
|
2021-11-06 00:48:39 +01:00
|
|
|
#include <components/detournavigator/recastmeshtiles.hpp>
|
2019-11-27 23:45:01 +01:00
|
|
|
|
|
|
|
#include <osg/ref_ptr>
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace osg
|
|
|
|
{
|
|
|
|
class Group;
|
|
|
|
class Geometry;
|
|
|
|
}
|
|
|
|
|
2021-11-06 00:48:39 +01:00
|
|
|
namespace DetourNavigator
|
|
|
|
{
|
|
|
|
struct Settings;
|
|
|
|
}
|
|
|
|
|
2019-11-27 23:45:01 +01:00
|
|
|
namespace MWRender
|
|
|
|
{
|
|
|
|
class RecastMesh
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
RecastMesh(const osg::ref_ptr<osg::Group>& root, bool enabled);
|
|
|
|
~RecastMesh();
|
|
|
|
|
|
|
|
bool toggle();
|
|
|
|
|
|
|
|
void update(const DetourNavigator::RecastMeshTiles& recastMeshTiles, const DetourNavigator::Settings& settings);
|
|
|
|
|
|
|
|
void reset();
|
|
|
|
|
|
|
|
void enable();
|
|
|
|
|
|
|
|
void disable();
|
|
|
|
|
|
|
|
bool isEnabled() const
|
|
|
|
{
|
|
|
|
return mEnabled;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
struct Group
|
|
|
|
{
|
|
|
|
std::size_t mGeneration;
|
|
|
|
std::size_t mRevision;
|
|
|
|
osg::ref_ptr<osg::Group> mValue;
|
|
|
|
};
|
|
|
|
|
|
|
|
osg::ref_ptr<osg::Group> mRootNode;
|
|
|
|
bool mEnabled;
|
|
|
|
std::map<DetourNavigator::TilePosition, Group> mGroups;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|