Each of the possible lights of a 3D scene.
#include <mrpt/opengl/CLight.h>
Public Member Functions | |
CLight () | |
Default constructor, sets default values. More... | |
void | setPosition (float x, float y, float z, float w) |
void | setDirection (float dx, float dy, float dz) |
void | writeToStream (mrpt::utils::CStream &out) const |
void | readFromStream (mrpt::utils::CStream &in) |
void | sendToOpenGL () const |
Define the light in the current OpenGL rendering context (users normally don't need to call this explicitly, it's done from within a. More... | |
Public Attributes | |
uint8_t | light_ID |
OpenGL ID (typical range: 0-7) More... | |
float | color_ambient [4] |
float | color_diffuse [4] |
float | color_specular [4] |
float | position [4] |
[x,y,z,w]: w=0 means directional light, w=1 means a light at a real 3D position. More... | |
float | direction [3] |
[x,y,z] More... | |
float | constant_attenuation |
float | linear_attenuation |
float | quadratic_attenuation |
float | spot_exponent |
float | spot_cutoff |
CLight::CLight | ( | ) |
Default constructor, sets default values.
Definition at line 24 of file CLight.cpp.
References color_ambient, color_diffuse, color_specular, setDirection(), and setPosition().
void CLight::readFromStream | ( | mrpt::utils::CStream & | in | ) |
Definition at line 66 of file CLight.cpp.
References color_ambient, color_diffuse, color_specular, constant_attenuation, direction, light_ID, linear_attenuation, MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION, position, quadratic_attenuation, spot_cutoff, and spot_exponent.
Referenced by mrpt::opengl::operator>>().
void CLight::sendToOpenGL | ( | ) | const |
Define the light in the current OpenGL rendering context (users normally don't need to call this explicitly, it's done from within a.
Definition at line 88 of file CLight.cpp.
References color_ambient, color_diffuse, color_specular, constant_attenuation, direction, GL_AMBIENT, GL_CONSTANT_ATTENUATION, GL_DIFFUSE, GL_LIGHT0, GL_LINEAR_ATTENUATION, GL_POSITION, GL_QUADRATIC_ATTENUATION, GL_SPECULAR, GL_SPOT_CUTOFF, GL_SPOT_DIRECTION, GL_SPOT_EXPONENT, glEnable(), glLightf(), glLightfv(), light_ID, linear_attenuation, position, quadratic_attenuation, spot_cutoff, and spot_exponent.
void CLight::setDirection | ( | float | dx, |
float | dy, | ||
float | dz | ||
) |
Definition at line 115 of file CLight.cpp.
References direction.
Referenced by CLight().
void CLight::setPosition | ( | float | x, |
float | y, | ||
float | z, | ||
float | w | ||
) |
Definition at line 108 of file CLight.cpp.
References position.
Referenced by CLight().
void CLight::writeToStream | ( | mrpt::utils::CStream & | out | ) | const |
Definition at line 51 of file CLight.cpp.
References color_ambient, color_diffuse, color_specular, constant_attenuation, direction, light_ID, linear_attenuation, position, quadratic_attenuation, spot_cutoff, and spot_exponent.
Referenced by mrpt::opengl::operator<<().
float mrpt::opengl::CLight::color_ambient[4] |
Definition at line 43 of file CLight.h.
Referenced by CLight(), readFromStream(), sendToOpenGL(), and writeToStream().
float mrpt::opengl::CLight::color_diffuse[4] |
Definition at line 44 of file CLight.h.
Referenced by CLight(), readFromStream(), sendToOpenGL(), and writeToStream().
float mrpt::opengl::CLight::color_specular[4] |
Definition at line 45 of file CLight.h.
Referenced by CLight(), readFromStream(), sendToOpenGL(), and writeToStream().
float mrpt::opengl::CLight::constant_attenuation |
Definition at line 52 of file CLight.h.
Referenced by readFromStream(), sendToOpenGL(), and writeToStream().
float mrpt::opengl::CLight::direction[3] |
[x,y,z]
Definition at line 51 of file CLight.h.
Referenced by readFromStream(), sendToOpenGL(), setDirection(), and writeToStream().
uint8_t mrpt::opengl::CLight::light_ID |
OpenGL ID (typical range: 0-7)
Definition at line 41 of file CLight.h.
Referenced by readFromStream(), sendToOpenGL(), and writeToStream().
float mrpt::opengl::CLight::linear_attenuation |
Definition at line 53 of file CLight.h.
Referenced by readFromStream(), sendToOpenGL(), and writeToStream().
float mrpt::opengl::CLight::position[4] |
[x,y,z,w]: w=0 means directional light, w=1 means a light at a real 3D position.
Definition at line 49 of file CLight.h.
Referenced by readFromStream(), sendToOpenGL(), setPosition(), and writeToStream().
float mrpt::opengl::CLight::quadratic_attenuation |
Definition at line 54 of file CLight.h.
Referenced by readFromStream(), sendToOpenGL(), and writeToStream().
float mrpt::opengl::CLight::spot_cutoff |
Definition at line 56 of file CLight.h.
Referenced by readFromStream(), sendToOpenGL(), and writeToStream().
float mrpt::opengl::CLight::spot_exponent |
Definition at line 55 of file CLight.h.
Referenced by readFromStream(), sendToOpenGL(), and writeToStream().
Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019 |