-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRKOGLT.hpp
More file actions
150 lines (150 loc) · 3.97 KB
/
Copy pathRKOGLT.hpp
File metadata and controls
150 lines (150 loc) · 3.97 KB
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# ifndef RKOGLT
/**
* @file RKOGLT.hpp
* @author Ramtin Kosari (ramtinkosari@gmail.com)
* @brief Ramtin Kosari OpenGL Tools Header Library
* @def RKOGLT
* @date 2024-10-11
*/
# define RKOGLT
/**
* @brief RKOGLT Color Base
* @def RKOGLT_COLOR_BASE
*/
# define RKOGLT_COLOR_BASE 255.0f
/**
* @def COLOR2FLOAT
* @brief Method to Convert Color to Float
*/
# define COLOR2FLOAT(color) (color / RKOGLT_COLOR_BASE)
/**
* @brief RKOGLT Color Structure
* @class RKGColor
*/
class RKGColor {
public:
float r;
float g;
float b;
float a;
//-- Constructor
RKGColor(float r, float g, float b, float a) {
this->r = r;
this->g = g;
this->b = b;
this->a = a;
}
//-- Default Constructor
RKGColor() {
this->r = 0.0f;
this->g = 0.0f;
this->b = 0.0f;
this->a = 0.0f;
}
};
/**
* @brief RKOGLT Point Structure
* @class RKGPoint
*/
class RKGPoint {
public:
int x;
int y;
int z;
float size;
RKGColor color;
//-- Constructor
RKGPoint(int x, int y, int z, RKGColor color) {
this->x = x;
this->y = y;
this->z = z;
this->size = 1.0f;
this->color = color;
}
//-- Default Constructor
RKGPoint() {
this->x = 0;
this->y = 0;
this->z = 0;
this->size = 1.0f;
this->color = RKGColor();
}
};
/**
* @brief RKOGLT Degree Structure
* @class RKGDegree
*/
class RKGDegree {
public:
float degree;
float x, y, z;
//-- Constructor
RKGDegree(float degree, float x = 0.0, float y = 0.0, float z = 1.0) {
this->degree = degree;
this->x = x;
this->y = y;
this->z = z;
}
//-- Default Constructor
RKGDegree() {
this->degree = 0.0f;
this->x = 0.0f;
this->y = 0.0f;
this->z = 1.0f;
}
};
/**
* @brief RKOGLT Scale Class
* @class RKGScale
*/
class RKGScale {
public:
float x;
float y;
float z;
//-- Constructor
RKGScale(float x, float y, float z) {
this->x = x;
this->y = y;
this->z = z;
}
//-- Default Constructor
RKGScale() {
this->x = 1.0f;
this->y = 1.0f;
this->z = 1.0f;
}
};
/**
* @brief RKOGLT Section Class
* @class RKGSection
*/
class RKGSection {
public:
RKGPoint start;
RKGPoint end;
//-- Constructor
RKGSection(RKGPoint start, RKGPoint end) {
this->start = start;
this->end = end;
}
//-- Default Constructor
RKGSection() {
this->start = RKGPoint();
this->end = RKGPoint();
}
//-- Method to Check if Input Point is Inside the Section
bool isInside(RKGPoint point, bool check_height = false) {
if (check_height) {
return (
point.x >= start.x && point.x <= end.x &&
point.y >= start.y && point.y <= end.y
);
} else {
return (
point.x >= start.x && point.x <= end.x
);
}
}
};
# endif // RKOGLT