#ifndef OPENMW_COMPONENTS_DETOURNAVIGATOR_RECASTMESH_H #define OPENMW_COMPONENTS_DETOURNAVIGATOR_RECASTMESH_H #include "areatype.hpp" #include "bounds.hpp" #include #include #include #include #include #include namespace DetourNavigator { class RecastMesh { public: struct Water { int mCellSize; btTransform mTransform; }; RecastMesh(std::size_t generation, std::size_t revision, std::vector indices, std::vector vertices, std::vector areaTypes, std::vector water); std::size_t getGeneration() const { return mGeneration; } std::size_t getRevision() const { return mRevision; } const std::vector& getIndices() const { return mIndices; } const std::vector& getVertices() const { return mVertices; } const std::vector& getAreaTypes() const { return mAreaTypes; } const std::vector& getWater() const { return mWater; } std::size_t getVerticesCount() const { return mVertices.size() / 3; } std::size_t getTrianglesCount() const { return mIndices.size() / 3; } const Bounds& getBounds() const { return mBounds; } private: std::size_t mGeneration; std::size_t mRevision; std::vector mIndices; std::vector mVertices; std::vector mAreaTypes; std::vector mWater; Bounds mBounds; }; inline bool operator<(const RecastMesh::Water& lhs, const RecastMesh::Water& rhs) { return std::tie(lhs.mCellSize, lhs.mTransform) < std::tie(rhs.mCellSize, rhs.mTransform); } inline bool operator <(const RecastMesh& lhs, const RecastMesh& rhs) { return std::tie(lhs.getIndices(), lhs.getVertices(), lhs.getAreaTypes(), lhs.getWater()) < std::tie(rhs.getIndices(), rhs.getVertices(), rhs.getAreaTypes(), rhs.getWater()); } } #endif