/
robot.hpp
252 lines (195 loc) · 6.02 KB
/
robot.hpp
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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
#ifndef _ROBOT_HPP_
#define _ROBOT_HPP_
#include "keycontrols.hpp"
#include "shading.hpp"
class point
{
public:
double x;
double y;
double z;
point()
{
x=0; y=0; z=0;
}
point(double a,double b,double c)
{
x=a; y=b; z=c;
}
};
class Robot
{
private:
point HeadNeckJoint;
point NeckBustJoint;
point LeftShoulder_LeftUpperArmFront_Joint;
point RightShoulder_RightUpperArmFront_Joint;
point Bust_Hip_Joint;
point Hip_LeftUpperLeg_Joint;
point Hip_RightUpperLeg_Joint;
point LeftShoulder_Bust_Joint;
point RightShoulder_Bust_Joint;
point LeftUpperArmFront_LeftLowerArmFront_Joint;
point RightUpperArmFront_RightLowerArmFront_Joint;
point LeftLowerArmFront_LeftFrontHand_Joint;
point RightLowerArmFront_RightFrontHand_Joint;
point LeftFrontHand_LeftBehindHand_Joint;
point RightFrontHand_RightBehindHand_Joint;
point LeftUpperArmFront_LeftUpperArmBehind_Joint;
point LeftLowerArmFront_LeftLowerArmBehind_Joint;
point RightUpperArmFront_RightUpperArmBehind_Joint;
point RightLowerArmFront_RightLowerArmBehind_Joint;
point LeftUpperLeg_LeftLowerLeg_Joint;
point RightUpperLeg_RightLowerLeg_Joint;
point LeftLowerLeg_LeftFoot_Joint;
point RightLowerLeg_RightFoot_Joint;
point Bust_Lower_Point;
point Neck_Lower_Point;
point Head_Lower_Point;
point Left_Shoulder_Lower_Point;
point Right_Shoulder_Lower_Point;
point LeftUpperArmFront_Upper_Point;
point LeftLowerArmFront_Upper_Point;
point RightUpperArmFront_Upper_Point;
point RightLowerArmFront_Upper_Point;
point LeftUpperArmBehind_Right_Point;
point LeftLowerArmBehind_Right_Point;
point RightUpperArmBehind_Left_Point;
point RightLowerArmBehind_Left_Point;
point LeftFrontHand_Upper_Point;
point RightFrontHand_Upper_Point;
point LeftBehindHand_Upper_Point;
point RightBehindHand_Upper_Point;
point LeftUpperLeg_Upper_Point;
point LeftLowerLeg_Upper_Point;
point RightUpperLeg_Upper_Point;
point RightLowerLeg_Upper_Point;
point LeftFoot_Behind_Point;
point RightFoot_Behind_Point;
int behindArmAngle;
//Some more structural constraints and structural parameters.
GLuint Hip;
GLuint Bust;
GLuint Neck;
GLuint Head;
GLuint LeftShoulder;
GLuint RightShoulder;
GLuint LeftUpperArmFront;
GLuint LeftLowerArmFront;
GLuint RightUpperArmFront;
GLuint RightLowerArmFront;
GLuint LeftUpperArmBehind;
GLuint LeftLowerArmBehind;
GLuint RightUpperArmBehind;
GLuint RightLowerArmBehind;
GLuint LeftFrontHand;
GLuint RightFrontHand;
GLuint LeftBehindHand;
GLuint RightBehindHand;
GLuint LeftUpperLeg;
GLuint RightUpperLeg;
GLuint LeftLowerLeg;
GLuint RightLowerLeg;
GLuint LeftFoot;
GLuint RightFoot;
GLuint* texture;
enum {LOGO,BLUE,RED,HEAD,WHEEL,HIP,BUST_LEFT,
RIGHT_FOOT_RIGHT};
public:
SpotLight Head_light1;
SpotLight Head_light2;
KeyControls keys;
Robot()
{
initStructuralConstraints();
initTexture();
initLights();
initHip();
initBust();
initNeck();
initHead();
initLeftShoulder();
initRightShoulder();
initLeftUpperArmFront();
initLeftLowerArmFront();
initRightUpperArmFront();
initRightLowerArmFront();
initLeftUpperArmBehind();
initLeftLowerArmBehind();
initRightUpperArmBehind();
initRightLowerArmBehind();
initLeftFrontHand();
initRightFrontHand();
initLeftBehindHand();
initRightBehindHand();
initLeftUpperLeg();
initLeftLowerLeg();
initRightUpperLeg();
initRightLowerLeg();
initLeftFoot();
initRightFoot();
behindArmAngle=0;
keys = KeyControls();
}
void initTexture();
void initLights();
void setLights();
void setRobotProperties();
void initStructuralConstraints();
//initilize Hip structure
void initHip();
//initilize Bust structure
void initBust();
void initNeck();
void initHead();
void initLeftShoulder();
void initRightShoulder();
void initLeftUpperArmFront();
void initLeftLowerArmFront();
void initRightUpperArmFront();
void initRightLowerArmFront();
void initLeftUpperArmBehind();
void initLeftLowerArmBehind();
void initRightUpperArmBehind();
void initRightLowerArmBehind();
void initLeftFrontHand();
void initRightFrontHand();
void initLeftBehindHand();
void initRightBehindHand();
void initLeftUpperLeg();
void initLeftLowerLeg();
void initRightUpperLeg();
void initRightLowerLeg();
void initLeftFoot();
void initRightFoot();
void makeHip(double tx,double ty,double tz,double angle_x,double angle_y,double angle_z);
void makeBust(double angle_x,double angle_y,double angle_z);
void makeNeck(void);
void makeHead(double angle_x,double angle_y,double angle_z);
void makeLeftShoulder();
void makeRightShoulder();
void makeLeftUpperArmFront(double angle_x,double angle_y,double angle_z);
void makeLeftLowerArmFront(double angle_x);
void makeRightUpperArmFront(double angle_x,double angle_y,double angle_z);
void makeRightLowerArmFront(double angle_x);
void makeLeftUpperArmBehind(double angle_y);
void makeLeftLowerArmBehind(double angle_y);
void makeRightUpperArmBehind(double angle_y);
void makeRightLowerArmBehind(double angle_y);
void makeLeftFrontHand(double angle_x);
void makeRightFrontHand(double angle_x);
void makeLeftBehindHand(double angle_y);
void makeRightBehindHand(double angle_y);
void makeLeftUpperLeg(double angle_x,double angle_y,double angle_z);
void makeLeftLowerLeg(double angle_x);
void makeRightUpperLeg(double angle_x,double angle_y,double angle_z);
void makeRightLowerLeg(double angle_x);
void makeLeftFoot(double angle_x);
void makeRightFoot(double angle_x);
void makeRobot(void);
void setFrameConstraints();
void transform();
std::string getHeadLightVector();
void setHeadLightVector(std::string);
};
#endif