1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-08 09:37:53 +00:00
OpenMW/components/detournavigator/cachedrecastmeshmanager.hpp

35 lines
853 B
C++

#ifndef OPENMW_COMPONENTS_DETOURNAVIGATOR_CACHEDRECASTMESHMANAGER_H
#define OPENMW_COMPONENTS_DETOURNAVIGATOR_CACHEDRECASTMESHMANAGER_H
#include "recastmeshmanager.hpp"
#include <boost/optional.hpp>
namespace DetourNavigator
{
class CachedRecastMeshManager
{
public:
CachedRecastMeshManager(const Settings& settings);
template <class T>
bool addObject(std::size_t id, const T& shape, const btTransform& transform)
{
if (!mImpl.addObject(id, shape, transform))
return false;
mCached.reset();
return true;
}
boost::optional<RecastMeshManager::Object> removeObject(std::size_t id);
std::shared_ptr<RecastMesh> getMesh();
private:
RecastMeshManager mImpl;
std::shared_ptr<RecastMesh> mCached;
};
}
#endif