1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-06 00:55:50 +00:00
OpenMW/components/detournavigator/cachedrecastmeshmanager.hpp

48 lines
1.5 KiB
C++
Raw Normal View History

2018-03-13 22:49:08 +00:00
#ifndef OPENMW_COMPONENTS_DETOURNAVIGATOR_CACHEDRECASTMESHMANAGER_H
#define OPENMW_COMPONENTS_DETOURNAVIGATOR_CACHEDRECASTMESHMANAGER_H
#include "recastmeshmanager.hpp"
#include "version.hpp"
#include "heightfieldshape.hpp"
2018-03-13 22:49:08 +00:00
#include <components/misc/guarded.hpp>
2018-03-13 22:49:08 +00:00
namespace DetourNavigator
{
class CachedRecastMeshManager
{
public:
2019-11-27 22:45:01 +00:00
CachedRecastMeshManager(const Settings& settings, const TileBounds& bounds, std::size_t generation);
2018-03-13 22:49:08 +00:00
bool addObject(const ObjectId id, const CollisionShape& shape, const btTransform& transform,
2018-07-18 19:09:50 +00:00
const AreaType areaType);
2018-03-13 22:49:08 +00:00
2018-09-22 15:36:57 +00:00
bool updateObject(const ObjectId id, const btTransform& transform, const AreaType areaType);
2018-05-26 14:44:25 +00:00
std::optional<RemovedRecastMeshObject> removeObject(const ObjectId id);
bool addWater(const osg::Vec2i& cellPosition, const int cellSize, const osg::Vec3f& shift);
2018-07-20 19:11:34 +00:00
2021-07-14 20:00:16 +00:00
std::optional<Cell> removeWater(const osg::Vec2i& cellPosition);
2018-07-20 19:11:34 +00:00
bool addHeightfield(const osg::Vec2i& cellPosition, int cellSize, const osg::Vec3f& shift,
const HeightfieldShape& shape);
std::optional<Cell> removeHeightfield(const osg::Vec2i& cellPosition);
2018-03-13 22:49:08 +00:00
std::shared_ptr<RecastMesh> getMesh();
2018-04-15 22:07:18 +00:00
bool isEmpty() const;
2021-06-25 19:52:02 +00:00
void reportNavMeshChange(const Version& recastMeshVersion, const Version& navMeshVersion);
Version getVersion() const;
2018-03-13 22:49:08 +00:00
private:
RecastMeshManager mImpl;
Misc::ScopeGuarded<std::shared_ptr<RecastMesh>> mCached;
2018-03-13 22:49:08 +00:00
};
}
#endif