#pragma once #include "EHS.h" #include "Array.h" #include "Vertex.h" #include "BaseObj.h" namespace ehs { const Array portraitGuiVerts({ {{0.0f, 0.0f, 1.0f}, {0.0f, 0.0f, -1.0f}, {0.0f, 0.0f}}, {{0.0f, 1.0f, 1.0f}, {0.0f, 0.0f, -1.0f}, {0.0f, 1.0f}}, {{1.0f, 0.0f, 1.0f}, {0.0f, 0.0f, -1.0f}, {1.0f, 0.0f}}, {{1.0f, 1.0f, 1.0f}, {0.0f, 0.0f, -1.0f}, {1.0f, 1.0f}} }); const Array portraitGuiIndices({ 0, 1, 2, 3, 2, 1 }); const Array portraitVerts({ {{-0.5f, -0.5f, 0.0f}, {0.0f, 0.0f, -1.0f}, {0.0f, 0.0f}}, {{-0.5f, 0.5f, 0.0f}, {0.0f, 0.0f, -1.0f}, {0.0f, 1.0f}}, {{0.5f, -0.5f, 0.0f}, {0.0f, 0.0f, -1.0f}, {1.0f, 0.0f}}, {{0.5f, 0.5f, 0.0f}, {0.0f, 0.0f, -1.0f}, {1.0f, 1.0f}} }); const Array portraitIndices({ 0, 1, 2, 3, 2, 1 }); class Mesh final : public BaseObj { protected: UInt_64 hashId; Str_8 id; Array vertices; Array indices; public: Mesh(); Mesh(Str_8 id, Array vertices, Array indices); Mesh(Str_8 id, Array vertices); Mesh(Mesh&& mesh) noexcept; Mesh(const Mesh& mesh); Mesh& operator=(Mesh&& mesh) noexcept; Mesh& operator=(const Mesh& mesh); void Release(); UInt_64 GetHashId() const; void SetId(Str_8 newId); Str_8 GetId() const; void SetVertices(const Array& newVertices); Array GetVertices() const; Array& GetVertices(); void SetIndices(const Array& newIndices); bool HasIndices() const; Array GetIndices() const; Array& GetIndices(); void Calculate(); private: static void Calculate(Vertex_f& vert1, Vertex_f& vert2, Vertex_f& vert3); }; }