-
Notifications
You must be signed in to change notification settings - Fork 0
/
Elements.h
80 lines (71 loc) · 846 Bytes
/
Elements.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
//çäåñü íàõîäÿòñÿ ýëåìåíòàðíûå òèïû äàííûõ, ñëóæàùèå äëÿ ïîñòðîåíèÿ áîëåå ñëîæíûõ îáúåêòîâ
#pragma once
typedef unsigned char u8;
class cRGBA_Byte_Pixel
{
public:
cRGBA_Byte_Pixel()
{
r = 255;
g = 255;
b = 255;
a = 255;
};
union
{
struct
{
u8 r;
u8 g;
u8 b;
u8 a;
};
u8 rgb[4];
};
};
class cVector4f
{
public:
cVector4f() : x(0.0f), y(0.0f), z(0.0f), w(1.0f) { }
union
{
struct
{
float x;
float y;
float z;
float w;
};
struct
{
float r;
float g;
float b;
float a;
};
float v[4];
};
};
class cTextCoord
{
public:
cTextCoord() : u(0.0f), v(0.0f) { }
union
{
struct
{
float u;
float v;
};
float texCoord[2];
};
};
class cVertex
{
public:
cVertex() {}
cVector4f m_position;
cVector4f m_normal;
cVector4f m_color;
cTextCoord m_uv;
};