MRPT
1.9.9
|
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::serialization::CArchive &out) const |
void | readFromStream (mrpt::serialization::CArchive &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 {0} |
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 {1.f} |
float | linear_attenuation {0.f} |
float | quadratic_attenuation {0.f} |
float | spot_exponent {0.f} |
float | spot_cutoff {180.f} |
CLight::CLight | ( | ) |
Default constructor, sets default values.
Definition at line 22 of file CLight.cpp.
void CLight::readFromStream | ( | mrpt::serialization::CArchive & | in | ) |
Definition at line 59 of file CLight.cpp.
References MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION.
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 81 of file CLight.cpp.
References 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(), and glLightfv().
void CLight::setDirection | ( | float | dx, |
float | dy, | ||
float | dz | ||
) |
Definition at line 108 of file CLight.cpp.
void CLight::setPosition | ( | float | x, |
float | y, | ||
float | z, | ||
float | w | ||
) |
Definition at line 101 of file CLight.cpp.
void CLight::writeToStream | ( | mrpt::serialization::CArchive & | out | ) | const |
Definition at line 44 of file CLight.cpp.
Referenced by mrpt::opengl::operator<<().
uint8_t mrpt::opengl::CLight::light_ID {0} |
float mrpt::opengl::CLight::position[4] |
Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 8fe78517f Sun Jul 14 19:43:28 2019 +0200 at lun oct 28 02:10:00 CET 2019 |