1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-28 19:15:32 +00:00
openmw-tes3mp/components/detournavigator/recastmeshmanager.hpp
2018-10-13 22:16:25 +03:00

42 lines
984 B
C++

#ifndef OPENMW_COMPONENTS_DETOURNAVIGATOR_RECASTMESHMANAGER_H
#define OPENMW_COMPONENTS_DETOURNAVIGATOR_RECASTMESHMANAGER_H
#include "recastmeshbuilder.hpp"
#include <LinearMath/btTransform.h>
#include <unordered_map>
class btCollisionShape;
namespace DetourNavigator
{
class RecastMeshManager
{
public:
RecastMeshManager(const Settings& settings);
bool addObject(std::size_t id, const btHeightfieldTerrainShape& shape, const btTransform& transform);
bool addObject(std::size_t id, const btConcaveShape& shape, const btTransform& transform);
bool removeObject(std::size_t id);
std::shared_ptr<RecastMesh> getMesh();
private:
struct Object
{
const btCollisionShape* mShape;
btTransform mTransform;
};
bool mShouldRebuild;
RecastMeshBuilder mMeshBuilder;
std::unordered_map<std::size_t, Object> mObjects;
void rebuild();
};
}
#endif