-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dimensions.cpp
205 lines (158 loc) · 2.09 KB
/
Dimensions.cpp
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
#include "Dimensions.h"
/////////////////
////// Size Class
/////////////////
// Size 2I
Size2I::Size2I()
{
w = 0;
h = 0;
}
Size2I::Size2I( int w, int h )
{
this->w = w;
this->h = h;
}
// Size 2F
Size2F::Size2F()
{
w = 0.f;
h = 0.f;
}
Size2F::Size2F( float w, float h )
{
this->w = w;
this->h = h;
}
// Size 2D
Size2D::Size2D()
{
w = 0.0;
h = 0.0;
}
Size2D::Size2D( double w, double h )
{
this->w = w;
this->h = h;
}
// Size 3F
Size3F::Size3F()
{
w = 0.f;
h = 0.f;
d = 0.f;
}
Size3F::Size3F( float w, float h, float d )
{
this->w = w;
this->h = h;
this->d = d;
}
// Size 3D
Size3D::Size3D()
{
w = 0.0;
h = 0.0;
d = 0.0;
}
Size3D::Size3D( double w, double h, double d )
{
this->w = w;
this->h = h;
this->d = d;
}
/////////////////
///Rotation Class
/////////////////
//Rotation 2F
Rotation2F::Rotation2F()
{
x = 0.f;
y = 0.f;
}
Rotation2F::Rotation2F( float x, float y )
{
this->x = x;
this->y = y;
}
void Rotation2F::keepInRange()
{
while( x > 360.f )
x-= 360.f;
while( y > 360.f )
y-= 360.f;
}
//Rotation 2D
Rotation2D::Rotation2D()
{
x = 0.0;
y = 0.0;
}
Rotation2D::Rotation2D( double x, double y )
{
this->x = x;
this->y = y;
}
void Rotation2D::keepInRange()
{
while( x > 360.0 )
x-= 360.0;
while( y > 360.0 )
y-= 360.0;
}
//Rotation 3F
Rotation3F::Rotation3F()
{
x = 0.f;
y = 0.f;
z = 0.f;
}
Rotation3F::Rotation3F( float x, float y, float z )
{
this->x = x;
this->y = y;
this->z = z;
}
void Rotation3F::keepInRange()
{
while( x > 360.f )
x-= 360.f;
while( y > 360.f )
y-= 360.f;
while( z > 360.f )
z-= 360.f;
while( x < -360.f )
x += 360.f;
while( y < -360.f )
y += 360.f;
while( z < -360.f )
z += 360.f;
}
//Rotation 3D
Rotation3D::Rotation3D()
{
x = 0.0;
y = 0.0;
z = 0.0;
}
Rotation3D::Rotation3D( double x, double y, double z )
{
this->x = x;
this->y = y;
this->z = z;
}
void Rotation3D::keepInRange()
{
while( x > 360.0 )
x-= 360.0;
while( y > 360.0 )
y-= 360.0;
while( z > 360.0 )
z-= 360.0;
while( x < -360.0 )
x += 360.0;
while( y < -360.0 )
y += 360.0;
while( z < -360.0 )
z += 360.0;
}