EHS
Loading...
Searching...
No Matches
Mesh.h
Go to the documentation of this file.
1#pragma once
2
3#include "ehs/EHS.h"
4#include "ehs/Array.h"
5#include "Vertex.h"
6#include "ehs/BaseObj.h"
7
8namespace ehs
9{
10 class EHS_LIB_IO Mesh final : public BaseObj
11 {
12 protected:
13 UInt_64 hashId;
17
18 public:
19 Mesh();
20
22
24
25 Mesh(Mesh&& mesh) noexcept;
26
27 Mesh(const Mesh& mesh);
28
29 Mesh& operator=(Mesh&& mesh) noexcept;
30
31 Mesh& operator=(const Mesh& mesh);
32
33 void Release();
34
35 UInt_64 GetHashId() const;
36
37 void SetId(Str_8 newId);
38
39 Str_8 GetId() const;
40
41 void SetVertices(const Array<Vertex_f>& newVertices);
42
43 const Array<Vertex_f>& GetVertices() const;
44
46
47 void SetIndices(const Array<UInt_32>& newIndices);
48
49 bool HasIndices() const;
50
51 const Array<UInt_32>& GetIndices() const;
52
54
55 void Calculate();
56
57 private:
58 static void Calculate(Vertex_f& vert1, Vertex_f& vert2, Vertex_f& vert3);
59 };
60
61 const Mesh portraitGui("PortraitGui",
62 {
63 {{0.0f, 0.0f, 1.0f}, {0.0f, 0.0f, -1.0f}, {0.0f, 0.0f}},
64 {{0.0f, 1.0f, 1.0f}, {0.0f, 0.0f, -1.0f}, {0.0f, 1.0f}},
65 {{1.0f, 0.0f, 1.0f}, {0.0f, 0.0f, -1.0f}, {1.0f, 0.0f}},
66 {{1.0f, 1.0f, 1.0f}, {0.0f, 0.0f, -1.0f}, {1.0f, 1.0f}}
67 },
68 {0, 1, 2, 3, 2, 1}
69 );
70
71 const Mesh portrait("Portrait",
72 {
73 {{-0.5f, -0.5f, 0.0f}, {0.0f, 0.0f, -1.0f}, {0.0f, 0.0f}},
74 {{-0.5f, 0.5f, 0.0f}, {0.0f, 0.0f, -1.0f}, {0.0f, 1.0f}},
75 {{0.5f, -0.5f, 0.0f}, {0.0f, 0.0f, -1.0f}, {1.0f, 0.0f}},
76 {{0.5f, 0.5f, 0.0f}, {0.0f, 0.0f, -1.0f}, {1.0f, 1.0f}}
77 },
78 {0, 1, 2, 3, 2, 1}
79 );
80}
Definition Array.h:16
BaseObj()
Definition BaseObj.cpp:10
Definition Mesh.h:11
void Calculate()
Definition Mesh.cpp:125
const Array< UInt_32 > & GetIndices() const
Definition Mesh.cpp:115
Str_8 GetId() const
Definition Mesh.cpp:85
Mesh()
Definition Mesh.cpp:5
void SetId(Str_8 newId)
Definition Mesh.cpp:79
UInt_64 hashId
Definition Mesh.h:13
void SetVertices(const Array< Vertex_f > &newVertices)
Definition Mesh.cpp:90
Mesh & operator=(Mesh &&mesh) noexcept
Definition Mesh.cpp:36
bool HasIndices() const
Definition Mesh.cpp:110
Array< UInt_32 > indices
Definition Mesh.h:16
void SetIndices(const Array< UInt_32 > &newIndices)
Definition Mesh.cpp:105
UInt_64 GetHashId() const
Definition Mesh.cpp:74
const Array< Vertex_f > & GetVertices() const
Definition Mesh.cpp:95
Array< Vertex_f > vertices
Definition Mesh.h:15
Str_8 id
Definition Mesh.h:14
void Release()
Definition Mesh.cpp:68
Definition Anchor.h:6
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})
Vertex< float > Vertex_f
Definition Vertex.h:49
Str< Char_8, UInt_64 > Str_8
Definition Str.h:1953