2019-11-27 22:45:01 +00:00
|
|
|
#ifndef OPENMW_MWRENDER_RECASTMESH_H
|
|
|
|
#define OPENMW_MWRENDER_RECASTMESH_H
|
|
|
|
|
2021-11-05 23:48:39 +00:00
|
|
|
#include <components/detournavigator/recastmeshtiles.hpp>
|
2022-08-29 22:11:34 +00:00
|
|
|
#include <components/detournavigator/version.hpp>
|
2019-11-27 22:45:01 +00:00
|
|
|
|
|
|
|
#include <osg/ref_ptr>
|
|
|
|
|
|
|
|
namespace osg
|
|
|
|
{
|
|
|
|
class Group;
|
|
|
|
class Geometry;
|
2024-05-18 12:09:51 +00:00
|
|
|
class StateSet;
|
2019-11-27 22:45:01 +00:00
|
|
|
}
|
|
|
|
|
2021-11-05 23:48:39 +00:00
|
|
|
namespace DetourNavigator
|
|
|
|
{
|
|
|
|
struct Settings;
|
|
|
|
}
|
|
|
|
|
2019-11-27 22:45:01 +00: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
|
|
|
|
{
|
2022-08-29 22:11:34 +00:00
|
|
|
DetourNavigator::Version mVersion;
|
2019-11-27 22:45:01 +00:00
|
|
|
osg::ref_ptr<osg::Group> mValue;
|
|
|
|
};
|
|
|
|
|
|
|
|
osg::ref_ptr<osg::Group> mRootNode;
|
|
|
|
bool mEnabled;
|
|
|
|
std::map<DetourNavigator::TilePosition, Group> mGroups;
|
2024-05-18 12:09:51 +00:00
|
|
|
osg::ref_ptr<osg::StateSet> mGroupStateSet;
|
|
|
|
osg::ref_ptr<osg::StateSet> mDebugDrawStateSet;
|
2019-11-27 22:45:01 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|