57 #include "LightSourceNode.hh" 70 const std::string& _name)
98 for(
unsigned int i=0; i<
lights_.size(); i++)
123 for(
unsigned int i=0; i<
lights_.size(); i++)
140 glLightfv(_index, GL_AMBIENT, (GLfloat *)_light.ambientColor.
data());
141 glLightfv(_index, GL_DIFFUSE, (GLfloat *)_light.diffuseColor.
data());
142 glLightfv(_index, GL_SPECULAR, (GLfloat *)_light.specularColor.
data());
144 glLightfv(_index, GL_POSITION, (GLfloat *)_light.realPosition.
data());
145 glLightfv(_index, GL_SPOT_DIRECTION, (GLfloat *)_light.spotDirection.
data());
147 glLightf(_index, GL_SPOT_EXPONENT, _light.spotExponent);
148 glLightf(_index, GL_SPOT_CUTOFF, _light.spotCutoff);
149 glLightf(_index, GL_CONSTANT_ATTENUATION, _light.constantAttenuation);
150 glLightf(_index, GL_LINEAR_ATTENUATION, _light.linearAttenuation);
151 glLightf(_index, GL_QUADRATIC_ATTENUATION, _light.quadraticAttenuation);
159 glGetLightfv(_index, GL_AMBIENT, (GLfloat *)_light.ambientColor.
data());
160 glGetLightfv(_index, GL_DIFFUSE, (GLfloat *)_light.diffuseColor.
data());
161 glGetLightfv(_index, GL_SPECULAR, (GLfloat *)_light.specularColor.
data());
162 glGetLightfv(_index, GL_POSITION, (GLfloat *)_light.position.
data());
163 glGetLightfv(_index, GL_SPOT_DIRECTION, (GLfloat *)_light.spotDirection.
data());
165 glGetLightfv(_index, GL_SPOT_EXPONENT, &_light.spotExponent);
166 glGetLightfv(_index, GL_SPOT_CUTOFF, &_light.spotCutoff);
167 glGetLightfv(_index, GL_CONSTANT_ATTENUATION, &_light.constantAttenuation);
168 glGetLightfv(_index, GL_LINEAR_ATTENUATION, &_light.linearAttenuation);
169 glGetLightfv(_index, GL_QUADRATIC_ATTENUATION, &_light.quadraticAttenuation);
Namespace providing different geometric functions concerning angles.
const GLMatrixd & inverse_modelview() const
get inverse modelview matrix
void set_parameters(GLenum _index, LightSource &_light)
set _light Options in OpenGL for GL_LIGHT::_index
static void enable(GLenum _cap, bool _warnRemoved=true)
replaces glEnable, but supports locking
void get_parameters(GLenum _index, LightSource &_light)
get _light Options in OpenGL for GL_LIGHT::_index
static void disable(GLenum _cap, bool _warnRemoved=true)
replaces glDisable, but supports locking
Scalar * data()
access to Scalar array
GLenum index2gl(int _nr)
return GL_LIGHT* for light _nr
void leave(GLState &_state, const DrawModes::DrawMode &_drawmode)
restores original Light Sources
std::vector< LightSource > lightsSave_
save old LightSources
Structure to hold options for one LightSource.
void enable(GLenum _nr)
enable LightSource _nr
void enter(GLState &_state, const DrawModes::DrawMode &_drawmode)
set current Light Sources
LightSourceNode(BaseNode *_parent=0, const std::string &_name="<LightSourceNode>")
Default constructor. Applies all properties.
std::vector< LightSource > lights_
store LightSources of this node