1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 16:19:54 +00:00
openmw-tes3mp/components/detournavigator/cachedrecastmeshmanager.hpp
elsid d122e184cc
Report navmesh change for not posted tiles
Corresponding recast mesh tiles can be updated but navmesh tiles may never
appear for them. Report back zero navmesh version to allow oscillating recast
objects detection to work. This version is always less than any generated
navmesh tile version so any report for generated navmesh will override it.
If zero navmesh version is reported after recast mesh tile got report about
generated navmesh tile it is a no-op since generated version is always greater
than zero.
2021-05-27 12:40:00 +02:00

39 lines
1.2 KiB
C++

#ifndef OPENMW_COMPONENTS_DETOURNAVIGATOR_CACHEDRECASTMESHMANAGER_H
#define OPENMW_COMPONENTS_DETOURNAVIGATOR_CACHEDRECASTMESHMANAGER_H
#include "recastmeshmanager.hpp"
#include "version.hpp"
namespace DetourNavigator
{
class CachedRecastMeshManager
{
public:
CachedRecastMeshManager(const Settings& settings, const TileBounds& bounds, std::size_t generation);
bool addObject(const ObjectId id, const btCollisionShape& shape, const btTransform& transform,
const AreaType areaType);
bool updateObject(const ObjectId id, const btTransform& transform, const AreaType areaType);
bool addWater(const osg::Vec2i& cellPosition, const int cellSize, const btTransform& transform);
std::optional<RecastMeshManager::Water> removeWater(const osg::Vec2i& cellPosition);
std::optional<RemovedRecastMeshObject> removeObject(const ObjectId id);
std::shared_ptr<RecastMesh> getMesh();
bool isEmpty() const;
void reportNavMeshChange(Version recastMeshVersion, Version navMeshVersion);
Version getVersion() const;
private:
RecastMeshManager mImpl;
std::shared_ptr<RecastMesh> mCached;
};
}
#endif