Face.hpp
Go to the documentation of this file.
1 
6 #pragma once
7 
8 namespace ege {
12  class Face {
13  public:
14  int8_t m_nbElement;
15  int32_t m_vertex[3];
16  int32_t m_uv[3];
17  int32_t m_normal[3];
18  int32_t m_color[3];
19  public:
20  Face() :
21  m_nbElement(1) {
22  m_vertex[0] = -1;
23  m_vertex[1] = -1;
24  m_vertex[2] = -1;
25  m_uv[0] = -1;
26  m_uv[1] = -1;
27  m_uv[2] = -1;
28  m_normal[0] = -1;
29  m_normal[1] = -1;
30  m_normal[2] = -1;
31  m_color[0] = -1;
32  m_color[1] = -1;
33  m_color[2] = -1;
34  };
35  Face(int32_t _v1, int32_t _t1,
36  int32_t _v2, int32_t _t2,
37  int32_t _v3, int32_t _t3) :
38  m_nbElement(3) {
39  m_vertex[0] = _v1;
40  m_vertex[1] = _v2;
41  m_vertex[2] = _v3;
42  m_uv[0] = _t1;
43  m_uv[1] = _t2;
44  m_uv[2] = _t3;
45  m_normal[0] = -1;
46  m_normal[1] = -1;
47  m_normal[2] = -1;
48  m_color[0] = -1;
49  m_color[1] = -1;
50  m_color[2] = -1;
51  };
52  Face(int32_t _v1, int32_t _t1, int32_t _n1,
53  int32_t _v2, int32_t _t2, int32_t _n2,
54  int32_t _v3, int32_t _t3, int32_t _n3) :
55  m_nbElement(3) {
56  m_vertex[0] = _v1;
57  m_vertex[1] = _v2;
58  m_vertex[2] = _v3;
59  m_uv[0] = _t1;
60  m_uv[1] = _t2;
61  m_uv[2] = _t3;
62  m_normal[0] = _n1;
63  m_normal[1] = _n2;
64  m_normal[2] = _n3;
65  m_color[0] = -1;
66  m_color[1] = -1;
67  m_color[2] = -1;
68  };
69  void setVertex(int32_t _v1) {
70  m_nbElement = 1;
71  m_vertex[0] = _v1;
72  }
73  void setVertex(int32_t _v1, int32_t _v2) {
74  m_nbElement = 2;
75  m_vertex[0] = _v1;
76  m_vertex[1] = _v2;
77  }
78  void setVertex(int32_t _v1, int32_t _v2, int32_t _v3) {
79  m_nbElement = 3;
80  m_vertex[0] = _v1;
81  m_vertex[1] = _v2;
82  m_vertex[2] = _v3;
83  }
84  void setTexture(int32_t _t1, int32_t _t2, int32_t _t3) {
85  m_uv[0] = _t1;
86  m_uv[1] = _t2;
87  m_uv[2] = _t3;
88  }
89  void setNormal(int32_t _n1, int32_t _n2, int32_t _n3) {
90  m_normal[0] = _n1;
91  m_normal[1] = _n2;
92  m_normal[2] = _n3;
93  }
94  void setColor(int32_t _c1, int32_t _c2, int32_t _c3) {
95  m_color[0] = _c1;
96  m_color[1] = _c2;
97  m_color[2] = _c3;
98  }
99  };
100 }
101 
Definition: AudioElement.hpp:8
Definition: Face.hpp:12