qtopengl_prototype.cpp
Go to the documentation of this file.
1 
7 #include "qtopengl_prototype.h"
8 #include <argos3/core/utility/math/vector2.h>
9 #include <argos3/core/simulator/entity/embodied_entity.h>
10 #include <argos3/plugins/robots/prototype/simulator/prototype_entity.h>
11 #include <argos3/plugins/robots/prototype/simulator/prototype_link_equipped_entity.h>
12 #include <argos3/plugins/simulator/entities/directional_led_equipped_entity.h>
13 #include <argos3/plugins/simulator/entities/led_equipped_entity.h>
14 #include <argos3/plugins/simulator/entities/magnet_equipped_entity.h>
15 #include <argos3/plugins/simulator/entities/tag_equipped_entity.h>
16 #include <argos3/plugins/simulator/visualizations/qt-opengl/qtopengl_widget.h>
17 
18 namespace argos {
19 
20  /****************************************/
21  /****************************************/
22 
23  static const Real LED_RADIUS = 0.0025f;
24  static const Real FIELD_SCALE_FACTOR = 0.0005f;
25  const GLfloat BODY_COLOR[] = { 0.5f, 0.5f, 0.5f, 1.0f };
26  const GLfloat SPECULAR[] = { 0.0f, 0.0f, 0.0f, 1.0f };
27  const GLfloat SHININESS[] = { 0.0f };
28  const GLfloat EMISSION[] = { 0.0f, 0.0f, 0.0f, 1.0f };
29 
30  /****************************************/
31  /****************************************/
32 
34  m_unVertices(20) {
35  /* Reserve the needed display lists */
36  m_unBaseList = glGenLists(6);
37  /* References to the display lists */
38  m_unBoxList = m_unBaseList;
39  m_unCylinderList = m_unBaseList + 1;
40  m_unSphereList = m_unBaseList + 2;
41  m_unLEDList = m_unBaseList + 3;
42  m_unPoleList = m_unBaseList + 4;
43  m_unTagList = m_unBaseList + 5;
44  /* Make box list */
45  glNewList(m_unBoxList, GL_COMPILE);
46  MakeBox();
47  glEndList();
48  /* Make cylinder list */
49  glNewList(m_unCylinderList, GL_COMPILE);
50  MakeCylinder();
51  glEndList();
52  /* Make sphere list */
53  glNewList(m_unSphereList, GL_COMPILE);
54  MakeSphere();
55  glEndList();
56  /* Make LED list */
57  glNewList(m_unLEDList, GL_COMPILE);
58  MakeLED();
59  glEndList();
60  /* Make Poles list */
61  glNewList(m_unPoleList, GL_COMPILE);
62  MakePoles();
63  glEndList();
64  /* Make Tag list */
65  MakeTagTexture();
66  glNewList(m_unTagList, GL_COMPILE);
67  MakeTag();
68  glEndList();
69  }
70 
71  /****************************************/
72  /****************************************/
73 
75  glDeleteLists(m_unBaseList, 6);
76  }
77 
78  /****************************************/
79  /****************************************/
80 
81  void CQTOpenGLPrototype::MakeLED() {
82  CVector3 cNormal, cPoint;
83  CRadians cSlice(CRadians::TWO_PI / m_unVertices);
84 
85  glBegin(GL_TRIANGLE_STRIP);
86  for(CRadians cInclination; cInclination <= CRadians::PI; cInclination += cSlice) {
87  for(CRadians cAzimuth; cAzimuth <= CRadians::TWO_PI; cAzimuth += cSlice) {
88  cNormal.FromSphericalCoords(1.0f, cInclination, cAzimuth);
89  cPoint = LED_RADIUS * cNormal;
90  glNormal3f(cNormal.GetX(), cNormal.GetY(), cNormal.GetZ());
91  glVertex3f(cPoint.GetX(), cPoint.GetY(), cPoint.GetZ());
92  cNormal.FromSphericalCoords(1.0f, cInclination + cSlice, cAzimuth);
93  cPoint = LED_RADIUS * cNormal;
94  glNormal3f(cNormal.GetX(), cNormal.GetY(), cNormal.GetZ());
95  glVertex3f(cPoint.GetX(), cPoint.GetY(), cPoint.GetZ());
96  cNormal.FromSphericalCoords(1.0f, cInclination, cAzimuth + cSlice);
97  cPoint = LED_RADIUS * cNormal;
98  glNormal3f(cNormal.GetX(), cNormal.GetY(), cNormal.GetZ());
99  glVertex3f(cPoint.GetX(), cPoint.GetY(), cPoint.GetZ());
100  cNormal.FromSphericalCoords(1.0f, cInclination + cSlice, cAzimuth + cSlice);
101  cPoint = LED_RADIUS * cNormal;
102  glNormal3f(cNormal.GetX(), cNormal.GetY(), cNormal.GetZ());
103  glVertex3f(cPoint.GetX(), cPoint.GetY(), cPoint.GetZ());
104  }
105  }
106  glEnd();
107  }
108 
109  /****************************************/
110  /****************************************/
111 
113  /* Draw the links */
114  for(CPrototypeLinkEntity* pcLink : c_entity.GetLinkEquippedEntity().GetLinks()){
115  /* Configure the body material */
116  glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, BODY_COLOR);
117 //#ifndef NDEBUG
118 // glPolygonMode(GL_FRONT, GL_LINE);
119 // glPolygonMode(GL_BACK, GL_LINE);
120 //#endif
121  /* Get the position of the link */
122  const CVector3& cPosition = pcLink->GetAnchor().Position;
123  /* Get the orientation of the link */
124  const CQuaternion& cOrientation = pcLink->GetAnchor().Orientation;
125  CRadians cZAngle, cYAngle, cXAngle;
126  cOrientation.ToEulerAngles(cZAngle, cYAngle, cXAngle);
127  glPushMatrix();
128  glTranslatef(cPosition.GetX(), cPosition.GetY(), cPosition.GetZ());
129  glRotatef(ToDegrees(cXAngle).GetValue(), 1.0f, 0.0f, 0.0f);
130  glRotatef(ToDegrees(cYAngle).GetValue(), 0.0f, 1.0f, 0.0f);
131  glRotatef(ToDegrees(cZAngle).GetValue(), 0.0f, 0.0f, 1.0f);
132  glScalef(pcLink->GetExtents().GetX(),
133  pcLink->GetExtents().GetY(),
134  pcLink->GetExtents().GetZ());
135  /* Draw the link */
136  switch(pcLink->GetGeometry()) {
137  case CPrototypeLinkEntity::EGeometry::BOX:
138  glCallList(m_unBoxList);
139  break;
140  case CPrototypeLinkEntity::EGeometry::CYLINDER:
141  glCallList(m_unCylinderList);
142  break;
143  case CPrototypeLinkEntity::EGeometry::SPHERE:
144  glCallList(m_unSphereList);
145  break;
146  }
147 //#ifndef NDEBUG
148 // glPolygonMode(GL_FRONT, GL_FILL);
149 // glPolygonMode(GL_BACK, GL_FILL);
150 //#endif
151  glPopMatrix();
152  }
153  }
154 
155  /****************************************/
156  /****************************************/
157 
159  /* Draw the directional LEDs */
160  if(c_entity.HasDirectionalLEDEquippedEntity()) {
161  GLfloat pfColor[] = { 0.0f, 0.0f, 0.0f, 1.0f };
162  const GLfloat pfSpecular[] = { 0.0f, 0.0f, 0.0f, 1.0f };
163  const GLfloat pfShininess[] = { 100.0f };
164  const GLfloat pfEmission[] = { 0.0f, 0.0f, 0.0f, 1.0f };
165  glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, pfSpecular);
166  glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, pfShininess);
167  glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, pfEmission);
168  const CDirectionalLEDEquippedEntity& cDirectionalLEDEquippedEntity =
170  for(const CDirectionalLEDEquippedEntity::SInstance& s_instance :
171  cDirectionalLEDEquippedEntity.GetInstances()) {
172  glPushMatrix();
173  /* Set the material */
174  const CColor& cColor = s_instance.LED.GetColor();
175  pfColor[0] = cColor.GetRed() / 255.0f;
176  pfColor[1] = cColor.GetGreen() / 255.0f;
177  pfColor[2] = cColor.GetBlue() / 255.0f;
178  glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, pfColor);
179  /* Perform rototranslation */
180  const CVector3& cPosition = s_instance.LED.GetPosition();
181  glTranslatef(cPosition.GetX(), cPosition.GetY(), cPosition.GetZ());
182  /* Draw the LED */
183  glCallList(m_unLEDList);
184  glPopMatrix();
185  }
186  }
187  /* Draw the LEDs */
188  if(c_entity.HasLEDEquippedEntity()) {
189  GLfloat pfColor[] = { 0.0f, 0.0f, 0.0f, 1.0f };
190  const GLfloat pfSpecular[] = { 0.0f, 0.0f, 0.0f, 1.0f };
191  const GLfloat pfShininess[] = { 100.0f };
192  const GLfloat pfEmission[] = { 0.0f, 0.0f, 0.0f, 1.0f };
193  glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, pfSpecular);
194  glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, pfShininess);
195  glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, pfEmission);
196  for(const CLEDEquippedEntity::SActuator* ps_actuator :
197  c_entity.GetLEDEquippedEntity().GetLEDs()) {
198  glPushMatrix();
199  /* Set the material */
200  const CColor& cColor = ps_actuator->LED.GetColor();
201  pfColor[0] = cColor.GetRed() / 255.0f;
202  pfColor[1] = cColor.GetGreen() / 255.0f;
203  pfColor[2] = cColor.GetBlue() / 255.0f;
204  glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, pfColor);
205  /* Perform rototranslation */
206  const CVector3& cPosition = ps_actuator->LED.GetPosition();
207  glTranslatef(cPosition.GetX(), cPosition.GetY(), cPosition.GetZ());
208  /* Draw the LED */
209  glCallList(m_unLEDList);
210  glPopMatrix();
211  }
212  }
213  /* Draw the tags */
214  if(c_entity.HasTagEquippedEntity()) {
215  const CTagEquippedEntity& cTagEquippedEntity =
216  c_entity.GetTagEquippedEntity();
217  CRadians cZ, cY, cX;
218  for(const CTagEquippedEntity::SInstance& s_instance :
219  cTagEquippedEntity.GetInstances()) {
220  const CVector3& cTagPosition = s_instance.Tag.GetPosition();
221  const CQuaternion& cTagOrientation = s_instance.Tag.GetOrientation();
222  cTagOrientation.ToEulerAngles(cZ, cY, cX);
223  Real fScaling = s_instance.Tag.GetSideLength();
224  glPushMatrix();
225  glTranslatef(cTagPosition.GetX(),
226  cTagPosition.GetY(),
227  cTagPosition.GetZ());
228  glRotatef(ToDegrees(cX).GetValue(), 1.0f, 0.0f, 0.0f);
229  glRotatef(ToDegrees(cY).GetValue(), 0.0f, 1.0f, 0.0f);
230  glRotatef(ToDegrees(cZ).GetValue(), 0.0f, 0.0f, 1.0f);
231  glScalef(fScaling, fScaling, 1.0f);
232  glCallList(m_unTagList);
233  glPopMatrix();
234  }
235  }
236 #ifndef NDEBUG
237  /* Draw the magnetic poles */
238  if(c_entity.HasMagnetEquippedEntity()) {
239  CMagnetEquippedEntity& cMagnetEquippedEntity =
240  c_entity.GetMagnetEquippedEntity();
241  CVector3 cFieldOrigin;
242  CQuaternion cFieldOrientation;
243  CRadians cFieldOrientationZ, cFieldOrientationY, cFieldOrientationX;
244  for(CMagnetEquippedEntity::SInstance& s_instance :
245  cMagnetEquippedEntity.GetInstances()) {
246  cFieldOrigin = s_instance.Offset;
247  cFieldOrigin.Rotate(s_instance.Anchor.Orientation);
248  cFieldOrigin += s_instance.Anchor.Position;
249  const CVector3& cField = s_instance.Magnet.GetField();
250  cFieldOrientation = s_instance.Anchor.Orientation *
251  CQuaternion(CVector3::Z, cField);
252  cFieldOrientation.ToEulerAngles(cFieldOrientationZ,
253  cFieldOrientationY,
254  cFieldOrientationX);
255  glPushMatrix();
256  glTranslatef(cFieldOrigin.GetX(),
257  cFieldOrigin.GetY(),
258  cFieldOrigin.GetZ());
259  glRotatef(ToDegrees(cFieldOrientationX).GetValue(), 1.0f, 0.0f, 0.0f);
260  glRotatef(ToDegrees(cFieldOrientationY).GetValue(), 0.0f, 1.0f, 0.0f);
261  glRotatef(ToDegrees(cFieldOrientationZ).GetValue(), 0.0f, 0.0f, 1.0f);
262  glScalef(1.0f, 1.0f, cField.Length() * FIELD_SCALE_FACTOR);
263  glCallList(m_unPoleList);
264  glPopMatrix();
265  }
266  }
267 #endif
268  }
269 
270  /****************************************/
271  /****************************************/
272 
273  void CQTOpenGLPrototype::MakeBox() {
274  glEnable(GL_NORMALIZE);
275  /* Set the material */
276  glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, SPECULAR);
277  glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, SHININESS);
278  glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, EMISSION);
279  /* This part covers the top and bottom faces (parallel to XY) */
280  glBegin(GL_QUADS);
281  /* Bottom face */
282  glNormal3f(0.0f, 0.0f, -1.0f);
283  glVertex3f( 0.5f, 0.5f, 0.0f);
284  glVertex3f( 0.5f, -0.5f, 0.0f);
285  glVertex3f(-0.5f, -0.5f, 0.0f);
286  glVertex3f(-0.5f, 0.5f, 0.0f);
287  /* Top face */
288  glNormal3f(0.0f, 0.0f, 1.0f);
289  glVertex3f(-0.5f, -0.5f, 1.0f);
290  glVertex3f( 0.5f, -0.5f, 1.0f);
291  glVertex3f( 0.5f, 0.5f, 1.0f);
292  glVertex3f(-0.5f, 0.5f, 1.0f);
293  glEnd();
294  /* This part covers the faces (South, East, North, West) */
295  glBegin(GL_QUADS);
296  /* South face */
297  glNormal3f(0.0f, -1.0f, 0.0f);
298  glVertex3f(-0.5f, -0.5f, 1.0f);
299  glVertex3f(-0.5f, -0.5f, 0.0f);
300  glVertex3f( 0.5f, -0.5f, 0.0f);
301  glVertex3f( 0.5f, -0.5f, 1.0f);
302  /* East face */
303  glNormal3f(1.0f, 0.0f, 0.0f);
304  glVertex3f( 0.5f, -0.5f, 1.0f);
305  glVertex3f( 0.5f, -0.5f, 0.0f);
306  glVertex3f( 0.5f, 0.5f, 0.0f);
307  glVertex3f( 0.5f, 0.5f, 1.0f);
308  /* North face */
309  glNormal3f(0.0f, 1.0f, 0.0f);
310  glVertex3f( 0.5f, 0.5f, 1.0f);
311  glVertex3f( 0.5f, 0.5f, 0.0f);
312  glVertex3f(-0.5f, 0.5f, 0.0f);
313  glVertex3f(-0.5f, 0.5f, 1.0f);
314  /* West face */
315  glNormal3f(-1.0f, 0.0f, 0.0f);
316  glVertex3f(-0.5f, 0.5f, 1.0f);
317  glVertex3f(-0.5f, 0.5f, 0.0f);
318  glVertex3f(-0.5f, -0.5f, 0.0f);
319  glVertex3f(-0.5f, -0.5f, 1.0f);
320  glEnd();
321  glDisable(GL_NORMALIZE);
322  }
323 
324  /****************************************/
325  /****************************************/
326 
327  void CQTOpenGLPrototype::MakeCylinder() {
328  glEnable(GL_NORMALIZE);
329  /* Set the material */
330  glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, SPECULAR);
331  glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, SHININESS);
332  glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, EMISSION);
333  /* Side surface */
334  CVector2 cVertex(0.5f, 0.0f);
335  CRadians cAngle(CRadians::TWO_PI / m_unVertices);
336  glBegin(GL_QUAD_STRIP);
337  for(GLuint i = 0; i <= m_unVertices; i++) {
338  glNormal3f(cVertex.GetX(), cVertex.GetY(), 0.0f);
339  glVertex3f(cVertex.GetX(), cVertex.GetY(), 1.0f);
340  glVertex3f(cVertex.GetX(), cVertex.GetY(), 0.0f);
341  cVertex.Rotate(cAngle);
342  }
343  glEnd();
344  /* Top disk */
345  cVertex.Set(0.5f, 0.0f);
346  glBegin(GL_POLYGON);
347  glNormal3f(0.0f, 0.0f, 1.0f);
348  for(GLuint i = 0; i <= m_unVertices; i++) {
349  glVertex3f(cVertex.GetX(), cVertex.GetY(), 1.0f);
350  cVertex.Rotate(cAngle);
351  }
352  glEnd();
353  /* Bottom disk */
354  cVertex.Set(0.5f, 0.0f);
355  cAngle = -cAngle;
356  glBegin(GL_POLYGON);
357  glNormal3f(0.0f, 0.0f, -1.0f);
358  for(GLuint i = 0; i <= m_unVertices; i++) {
359  glVertex3f(cVertex.GetX(), cVertex.GetY(), 0.0f);
360  cVertex.Rotate(cAngle);
361  }
362  glEnd();
363  glDisable(GL_NORMALIZE);
364  }
365 
366  /****************************************/
367  /****************************************/
368 
369  void CQTOpenGLPrototype::MakeSphere() {
370  glEnable(GL_NORMALIZE);
371  glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, SPECULAR);
372  glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, SHININESS);
373  glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, EMISSION);
374  CVector3 cNormal, cPoint;
375  CRadians cSlice(CRadians::TWO_PI / m_unVertices);
376  glBegin(GL_TRIANGLE_STRIP);
377  for(CRadians cInclination; cInclination <= CRadians::PI; cInclination += cSlice) {
378  for(CRadians cAzimuth; cAzimuth <= CRadians::TWO_PI; cAzimuth += cSlice) {
379  cPoint.FromSphericalCoords(0.5f, cInclination, cAzimuth);
380  glNormal3f(cPoint.GetX(), cPoint.GetY(), cPoint.GetZ() + 0.5f);
381  glVertex3f(cPoint.GetX(), cPoint.GetY(), cPoint.GetZ() + 0.5f);
382  cPoint.FromSphericalCoords(0.5f, cInclination + cSlice, cAzimuth);
383  glNormal3f(cPoint.GetX(), cPoint.GetY(), cPoint.GetZ() + 0.5f);
384  glVertex3f(cPoint.GetX(), cPoint.GetY(), cPoint.GetZ() + 0.5f);
385  cPoint.FromSphericalCoords(0.5f, cInclination, cAzimuth + cSlice);
386  glNormal3f(cPoint.GetX(), cPoint.GetY(), cPoint.GetZ() + 0.5f);
387  glVertex3f(cPoint.GetX(), cPoint.GetY(), cPoint.GetZ() + 0.5f);
388  cPoint.FromSphericalCoords(0.5f, cInclination + cSlice, cAzimuth + cSlice);
389  glNormal3f(cPoint.GetX(), cPoint.GetY(), cPoint.GetZ() + 0.5f);
390  glVertex3f(cPoint.GetX(), cPoint.GetY(), cPoint.GetZ() + 0.5f);
391  }
392  }
393  glEnd();
394  glDisable(GL_NORMALIZE);
395  }
396 
397  /****************************************/
398  /****************************************/
399 
400  void CQTOpenGLPrototype::MakeTagTexture() {
401  glGenTextures(1, &m_unTagTex);
402  glBindTexture(GL_TEXTURE_2D, m_unTagTex);
403  glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 4, 4, 0, GL_RGB, GL_FLOAT, m_fTagTexture);
404  }
405 
406  /****************************************/
407  /****************************************/
408 
409  void CQTOpenGLPrototype::MakeTag() {
410  glEnable(GL_NORMALIZE);
411  glDisable(GL_LIGHTING);
412  glEnable(GL_TEXTURE_2D);
413  glBindTexture(GL_TEXTURE_2D, m_unTagTex);
414  glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
415  glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
416  glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
417  glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
418  glBegin(GL_QUADS);
419  glNormal3f(0.0f, 0.0f, 1.0f);
420  glTexCoord2f(1.0f, 1.0f); glVertex2f( 0.5f, 0.5f);
421  glTexCoord2f(0.03f, 1.0f); glVertex2f(-0.5f, 0.5f);
422  glTexCoord2f(0.03f, 0.03f); glVertex2f(-0.5f, -0.5f);
423  glTexCoord2f(1.0f, 0.03f); glVertex2f( 0.5f, -0.5f);
424  glEnd();
425  glDisable(GL_TEXTURE_2D);
426  glEnable(GL_LIGHTING);
427  glDisable(GL_NORMALIZE);
428  }
429 
430  /****************************************/
431  /****************************************/
432 
433  void CQTOpenGLPrototype::MakePoles() {
434  glEnable(GL_NORMALIZE);
435  glDisable(GL_LIGHTING);
436  glLineWidth(4.0f);
437  glBegin(GL_LINES);
438  /* south pole */
439  glColor3f(1.0, 0.0, 0.0);
440  glVertex3f(0.0f, 0.0f, 0.0f);
441  glVertex3f(0.0f, 0.0f, 0.5f);
442  /* north pole */
443  glColor3f(0.0, 0.0, 1.0);
444  glVertex3f(0.0f, 0.0f, 0.0f);
445  glVertex3f(0.0f, 0.0f, -0.5f);
446  glEnd();
447  glLineWidth(1.0f);
448  glEnable(GL_LIGHTING);
449  glDisable(GL_NORMALIZE);
450  }
451 
452  /****************************************/
453  /****************************************/
454 
456  public:
457  void ApplyTo(CQTOpenGLWidget& c_visualization,
458  CPrototypeEntity& c_entity) {
459  static CQTOpenGLPrototype m_cModel;
460  if(c_entity.HasControllableEntity()) {
461  c_visualization.DrawRays(c_entity.GetControllableEntity());
462  }
463  m_cModel.DrawEntity(c_entity);
464  m_cModel.DrawDevices(c_entity);
465  }
466  };
467 
468  /****************************************/
469  /****************************************/
470 
472  public:
473  void ApplyTo(CQTOpenGLWidget& c_visualization,
474  CPrototypeEntity& c_entity) {
475  c_visualization.DrawBoundingBox(c_entity.GetEmbodiedEntity());
476  }
477  };
478 
479  REGISTER_ENTITY_OPERATION(CQTOpenGLOperationDrawNormal, CQTOpenGLWidget, CQTOpenGLOperationDrawPrototypeNormal, void, CPrototypeEntity);
480 
481  REGISTER_ENTITY_OPERATION(CQTOpenGLOperationDrawSelected, CQTOpenGLWidget, CQTOpenGLOperationDrawPrototypeSelected, void, CPrototypeEntity);
482 
483  /****************************************/
484  /****************************************/
485 
486 }
SInstance::TVector & GetInstances()
Returns the tags.
const GLfloat SHININESS[]
A 3D vector class.
Definition: vector3.h:29
CDegrees ToDegrees(const CRadians &c_radians)
Converts CRadians to CDegrees.
Definition: angles.h:489
CEmbodiedEntity & GetEmbodiedEntity()
void ApplyTo(CQTOpenGLWidget &c_visualization, CPrototypeEntity &c_entity)
float Real
Collects all ARGoS code.
Definition: datatypes.h:39
Real GetX() const
Returns the x coordinate of this vector.
Definition: vector3.h:93
CVector3 & Rotate(const CQuaternion &c_quaternion)
Rotates this vector by the given quaternion.
Definition: vector3.cpp:25
virtual void DrawEntity(CPrototypeEntity &c_entity)
bool HasControllableEntity() const
REGISTER_ENTITY_OPERATION(CQTOpenGLOperationDrawNormal, CQTOpenGLWidget, CQTOpenGLOperationDrawPrototypeNormal, void, CPrototypeEntity)
Real GetY() const
Returns the y coordinate of this vector.
Definition: vector3.h:109
static const CRadians TWO_PI
Set to PI * 2.
Definition: angles.h:54
CVector3 & FromSphericalCoords(Real f_length, const CRadians &c_inclination, const CRadians &c_azimuth)
Sets the vector contents from spherical coordinates.
Definition: vector3.h:158
bool HasDirectionalLEDEquippedEntity() const
CMagnetEquippedEntity & GetMagnetEquippedEntity()
UInt8 GetGreen() const
Returns the green channel of the color.
Definition: color.h:90
CPrototypeLinkEntity::TVector & GetLinks()
bool HasLEDEquippedEntity() const
A container of CTagEntity.
const GLfloat EMISSION[]
It defines the basic type CRadians, used to store an angle value in radians.
Definition: angles.h:42
Real Length() const
Returns the length of this vector.
Definition: vector3.h:205
CDirectionalLEDEquippedEntity & GetDirectionalLEDEquippedEntity()
CControllableEntity & GetControllableEntity()
const GLfloat BODY_COLOR[]
static const CRadians PI
The PI constant.
Definition: angles.h:49
void ToEulerAngles(CRadians &c_z_angle, CRadians &c_y_angle, CRadians &c_x_angle) const
Definition: quaternion.h:172
UInt8 GetRed() const
Returns the red channel of the color.
Definition: color.h:79
CPrototypeLinkEquippedEntity & GetLinkEquippedEntity()
static const CVector3 Z
The z axis.
Definition: vector3.h:40
SActuator::TList & GetLEDs()
Returns all the LEDs.
virtual void DrawDevices(CPrototypeEntity &c_entity)
The basic color type.
Definition: color.h:25
void ApplyTo(CQTOpenGLWidget &c_visualization, CPrototypeEntity &c_entity)
bool HasMagnetEquippedEntity() const
void DrawBoundingBox(CEmbodiedEntity &c_entity)
Draws the bounding box of an embodied entity.
UInt8 GetBlue() const
Returns the blue channel of the color.
Definition: color.h:101
bool HasTagEquippedEntity() const
A container of CMagnetEntity.
void DrawRays(CControllableEntity &c_entity)
Draws a ray.
A container of CDirectionalLEDEntity.
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12
Real GetZ() const
Returns the z coordinate of this vector.
Definition: vector3.h:125
SInstance::TVector & GetInstances()
Returns all the LEDs.
CTagEquippedEntity & GetTagEquippedEntity()
CLEDEquippedEntity & GetLEDEquippedEntity()
SInstance::TVector & GetInstances()
const GLfloat SPECULAR[]