2018-03-13 22:49:08 +00:00
|
|
|
#ifndef OPENMW_COMPONENTS_DETOURNAVIGATOR_RECASTMESHBUILDER_H
|
|
|
|
#define OPENMW_COMPONENTS_DETOURNAVIGATOR_RECASTMESHBUILDER_H
|
|
|
|
|
|
|
|
#include "recastmesh.hpp"
|
2018-04-15 22:07:18 +00:00
|
|
|
#include "tilebounds.hpp"
|
2018-03-13 22:49:08 +00:00
|
|
|
|
2018-07-20 19:11:34 +00:00
|
|
|
#include <LinearMath/btTransform.h>
|
|
|
|
|
2018-04-07 20:09:42 +00:00
|
|
|
class btBoxShape;
|
2018-04-02 21:04:19 +00:00
|
|
|
class btCollisionShape;
|
|
|
|
class btCompoundShape;
|
2018-03-13 22:49:08 +00:00
|
|
|
class btConcaveShape;
|
|
|
|
class btHeightfieldTerrainShape;
|
|
|
|
class btTriangleCallback;
|
|
|
|
|
|
|
|
namespace DetourNavigator
|
|
|
|
{
|
2018-09-30 22:33:25 +00:00
|
|
|
struct Settings;
|
|
|
|
|
2018-03-13 22:49:08 +00:00
|
|
|
class RecastMeshBuilder
|
|
|
|
{
|
|
|
|
public:
|
2018-04-15 22:07:18 +00:00
|
|
|
RecastMeshBuilder(const Settings& settings, const TileBounds& bounds);
|
2018-03-13 22:49:08 +00:00
|
|
|
|
2018-07-18 19:09:50 +00:00
|
|
|
void addObject(const btCollisionShape& shape, const btTransform& transform, const AreaType areaType);
|
2018-04-02 21:04:19 +00:00
|
|
|
|
2018-07-18 19:09:50 +00:00
|
|
|
void addObject(const btCompoundShape& shape, const btTransform& transform, const AreaType areaType);
|
2018-04-02 21:04:19 +00:00
|
|
|
|
2018-07-18 19:09:50 +00:00
|
|
|
void addObject(const btConcaveShape& shape, const btTransform& transform, const AreaType areaType);
|
2018-03-13 22:49:08 +00:00
|
|
|
|
2018-07-18 19:09:50 +00:00
|
|
|
void addObject(const btHeightfieldTerrainShape& shape, const btTransform& transform, const AreaType areaType);
|
2018-03-13 22:49:08 +00:00
|
|
|
|
2018-07-18 19:09:50 +00:00
|
|
|
void addObject(const btBoxShape& shape, const btTransform& transform, const AreaType areaType);
|
2018-04-07 20:09:42 +00:00
|
|
|
|
2018-07-20 19:11:34 +00:00
|
|
|
void addWater(const int mCellSize, const btTransform& transform);
|
|
|
|
|
2020-06-15 21:53:22 +00:00
|
|
|
std::shared_ptr<RecastMesh> create(std::size_t generation, std::size_t revision);
|
2018-03-13 22:49:08 +00:00
|
|
|
|
|
|
|
void reset();
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::reference_wrapper<const Settings> mSettings;
|
2018-04-15 22:07:18 +00:00
|
|
|
TileBounds mBounds;
|
2018-03-13 22:49:08 +00:00
|
|
|
std::vector<int> mIndices;
|
|
|
|
std::vector<float> mVertices;
|
2018-07-18 19:09:50 +00:00
|
|
|
std::vector<AreaType> mAreaTypes;
|
2018-07-20 19:11:34 +00:00
|
|
|
std::vector<RecastMesh::Water> mWater;
|
2018-03-13 22:49:08 +00:00
|
|
|
|
2018-04-15 22:07:18 +00:00
|
|
|
void addObject(const btConcaveShape& shape, const btTransform& transform, btTriangleCallback&& callback);
|
2018-03-13 22:49:08 +00:00
|
|
|
|
2019-11-29 20:17:52 +00:00
|
|
|
void addObject(const btHeightfieldTerrainShape& shape, const btTransform& transform, btTriangleCallback&& callback);
|
|
|
|
|
2018-04-07 20:09:42 +00:00
|
|
|
void addTriangleVertex(const btVector3& worldPosition);
|
|
|
|
|
2018-03-13 22:49:08 +00:00
|
|
|
void addVertex(const btVector3& worldPosition);
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|