1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 06:35:30 +00:00
OpenMW/components/detournavigator/recastmeshbuilder.hpp

58 lines
1.9 KiB
C++
Raw Normal View History

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