8 #include <argos3/core/utility/math/vector3.h>
9 #include <argos3/plugins/simulator/entities/light_entity.h>
10 #include <argos3/plugins/simulator/visualizations/qt-opengl/qtopengl_widget.h>
21 m_unList = glGenLists(1);
24 glNewList(m_unList, GL_COMPILE);
30 glBegin(GL_TRIANGLE_STRIP);
35 cPoint = m_fRadius * cNormal;
36 glNormal3d(cNormal.GetX(), cNormal.GetY(), cNormal.GetZ());
39 cNormal.FromSphericalCoords(1.0f, cInclination + cSlice, cAzimuth);
40 cPoint = m_fRadius * cNormal;
41 glNormal3d(cNormal.GetX(), cNormal.GetY(), cNormal.GetZ());
44 cNormal.FromSphericalCoords(1.0f, cInclination, cAzimuth + cSlice);
45 cPoint = m_fRadius * cNormal;
46 glNormal3d(cNormal.GetX(), cNormal.GetY(), cNormal.GetZ());
49 cNormal.FromSphericalCoords(1.0f, cInclination + cSlice, cAzimuth + cSlice);
50 cPoint = m_fRadius * cNormal;
51 glNormal3d(cNormal.GetX(), cNormal.GetY(), cNormal.GetZ());
66 glDeleteLists(m_unList, 1);
75 const GLfloat pfColor[] = { cColor.
GetRed() / 255.0f,
79 const GLfloat pfSpecular[] = { 0.0f, 0.0f, 0.0f, 1.0f };
80 const GLfloat pfShininess[] = { 100.0f };
81 const GLfloat pfEmission[] = { 0.0f, 0.0f, 0.0f, 1.0f };
82 glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, pfColor);
83 glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, pfSpecular);
84 glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, pfShininess);
85 glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, pfEmission);
99 m_cModel.
Draw(c_entity);
108 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
110 glScaled(1.1, 1.1, 1.1);
111 m_cModel.
Draw(c_entity);
112 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
The namespace containing all the ARGoS related code.
REGISTER_QTOPENGL_ENTITY_OPERATION(CQTOpenGLOperationDrawNormal, CQTOpenGLOperationDrawEPuckNormal, CEPuckEntity)
UInt8 GetBlue() const
Returns the blue channel of the color.
UInt8 GetGreen() const
Returns the green channel of the color.
UInt8 GetRed() const
Returns the red channel of the color.
It defines the basic type CRadians, used to store an angle value in radians.
static const CRadians PI
The PI constant.
static const CRadians TWO_PI
Set to PI * 2.
Real GetX() const
Returns the x coordinate of this vector.
CVector3 & FromSphericalCoords(Real f_length, const CRadians &c_inclination, const CRadians &c_azimuth)
Sets the vector contents from spherical coordinates.
Real GetY() const
Returns the y coordinate of this vector.
Real GetZ() const
Returns the z coordinate of this vector.
const CColor & GetColor() const
Returns the current color of the LED.
void ApplyTo(CQTOpenGLWidget &c_visualization, CLightEntity &c_entity)
void ApplyTo(CQTOpenGLWidget &c_visualization, CLightEntity &c_entity)
virtual void Draw(CLightEntity &c_entity)
virtual ~CQTOpenGLLight()
void DrawEntity(CPositionalEntity &c_entity)
Draws a positional entity.