2023-12-17 03:29:08 -08:00
|
|
|
#pragma once
|
|
|
|
|
2023-12-17 15:00:08 -08:00
|
|
|
#include "EHS.h"
|
|
|
|
#include "Array.h"
|
2023-12-17 03:29:08 -08:00
|
|
|
#include "Vertex.h"
|
2023-12-18 02:13:20 -08:00
|
|
|
#include "BaseObj.h"
|
2023-12-17 03:29:08 -08:00
|
|
|
|
2023-12-17 15:56:13 -08:00
|
|
|
namespace ehs
|
2023-12-17 03:29:08 -08:00
|
|
|
{
|
|
|
|
const Array<Vertex_f> 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<UInt_32> portraitGuiIndices({
|
|
|
|
0,
|
|
|
|
1,
|
|
|
|
2,
|
|
|
|
3,
|
|
|
|
2,
|
|
|
|
1
|
|
|
|
});
|
|
|
|
|
|
|
|
const Array<Vertex_f> 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<UInt_32> portraitIndices({
|
|
|
|
0,
|
|
|
|
1,
|
|
|
|
2,
|
|
|
|
3,
|
|
|
|
2,
|
|
|
|
1
|
|
|
|
});
|
|
|
|
|
2023-12-18 02:13:20 -08:00
|
|
|
class Mesh final : public BaseObj
|
2023-12-17 03:29:08 -08:00
|
|
|
{
|
|
|
|
protected:
|
2023-12-18 02:13:20 -08:00
|
|
|
UInt_64 hashId;
|
|
|
|
Str_8 id;
|
2023-12-17 03:29:08 -08:00
|
|
|
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);
|
|
|
|
|
2023-12-18 02:13:20 -08:00
|
|
|
void Release();
|
2023-12-17 03:29:08 -08:00
|
|
|
|
2023-12-18 02:13:20 -08:00
|
|
|
UInt_64 GetHashId() const;
|
2023-12-17 03:29:08 -08:00
|
|
|
|
2023-12-18 02:13:20 -08:00
|
|
|
void SetId(Str_8 newId);
|
2023-12-17 03:29:08 -08:00
|
|
|
|
2023-12-18 02:13:20 -08:00
|
|
|
Str_8 GetId() const;
|
2023-12-17 03:29:08 -08:00
|
|
|
|
|
|
|
void SetVertices(const Array<Vertex_f>& newVertices);
|
|
|
|
|
|
|
|
Array<Vertex_f> GetVertices() const;
|
|
|
|
|
|
|
|
Array<Vertex_f>& GetVertices();
|
|
|
|
|
|
|
|
void SetIndices(const Array<UInt_32>& newIndices);
|
|
|
|
|
|
|
|
bool HasIndices() 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);
|
|
|
|
};
|
|
|
|
}
|