1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 15:49:56 +00:00
openmw-tes3mp/components/detournavigator/cachedrecastmeshmanager.hpp

34 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