80 lines
1.7 KiB
C++
80 lines
1.7 KiB
C++
#pragma once
|
|
|
|
#include "ehs/EHS.h"
|
|
#include "ehs/Array.h"
|
|
#include "Vertex.h"
|
|
#include "ehs/BaseObj.h"
|
|
|
|
namespace ehs
|
|
{
|
|
class EHS_LIB_IO Mesh final : public BaseObj
|
|
{
|
|
protected:
|
|
UInt_64 hashId;
|
|
Str_8 id;
|
|
Array<Vertex_f> vertices;
|
|
Array<UInt_32> indices;
|
|
|
|
public:
|
|
Mesh();
|
|
|
|
Mesh(Str_8 id, Array<Vertex_f> vertices, Array<UInt_32> indices);
|
|
|
|
Mesh(Str_8 id, Array<Vertex_f> 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<Vertex_f>& newVertices);
|
|
|
|
const Array<Vertex_f>& GetVertices() const;
|
|
|
|
Array<Vertex_f>& GetVertices();
|
|
|
|
void SetIndices(const Array<UInt_32>& newIndices);
|
|
|
|
bool HasIndices() const;
|
|
|
|
const Array<UInt_32>& GetIndices() const;
|
|
|
|
Array<UInt_32>& GetIndices();
|
|
|
|
void Calculate();
|
|
|
|
private:
|
|
static void Calculate(Vertex_f& vert1, Vertex_f& vert2, Vertex_f& vert3);
|
|
};
|
|
|
|
const Mesh portraitGui("PortraitGui",
|
|
{
|
|
{{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}}
|
|
},
|
|
{0, 1, 2, 3, 2, 1}
|
|
);
|
|
|
|
const Mesh portrait("Portrait",
|
|
{
|
|
{{-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}}
|
|
},
|
|
{0, 1, 2, 3, 2, 1}
|
|
);
|
|
} |