1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-22 15:53:54 +00:00
openmw/components/detournavigator/recastmeshmanager.hpp

45 lines
982 B
C++
Raw Normal View History

2018-03-13 22:49:08 +00:00
#ifndef OPENMW_COMPONENTS_DETOURNAVIGATOR_RECASTMESHMANAGER_H
#define OPENMW_COMPONENTS_DETOURNAVIGATOR_RECASTMESHMANAGER_H
#include "recastmeshbuilder.hpp"
#include <LinearMath/btTransform.h>
#include <boost/optional.hpp>
2018-03-13 22:49:08 +00:00
#include <unordered_map>
class btCollisionShape;
namespace DetourNavigator
{
class RecastMeshManager
{
public:
struct Object
{
const btCollisionShape* mShape;
btTransform mTransform;
};
2018-04-15 22:07:18 +00:00
RecastMeshManager(const Settings& settings, const TileBounds& bounds);
2018-03-13 22:49:08 +00:00
2018-04-02 21:04:19 +00:00
bool addObject(std::size_t id, const btCollisionShape& shape, const btTransform& transform);
2018-03-13 22:49:08 +00:00
boost::optional<Object> removeObject(std::size_t id);
2018-03-13 22:49:08 +00:00
std::shared_ptr<RecastMesh> getMesh();
2018-04-15 22:07:18 +00:00
bool isEmpty() const;
2018-03-13 22:49:08 +00:00
private:
bool mShouldRebuild;
RecastMeshBuilder mMeshBuilder;
std::unordered_map<std::size_t, Object> mObjects;
void rebuild();
};
}
#endif