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);
Structure to hold options for one LightSource.
Namespace providing different geometric functions concerning angles.
static void disable(GLenum _cap, bool _warnRemoved=true)
replaces glDisable, but supports locking
std::vector< LightSource > lightsSave_
save old LightSources
Scalar * data()
access to Scalar array
void get_parameters(GLenum _index, LightSource &_light)
get _light Options in OpenGL for GL_LIGHT::_index
const GLMatrixd & inverse_modelview() const
get inverse modelview matrix
void enter(GLState &_state, const DrawModes::DrawMode &_drawmode) override
set current Light Sources
void leave(GLState &_state, const DrawModes::DrawMode &_drawmode) override
restores original Light Sources
std::vector< LightSource > lights_
store LightSources of this node
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
LightSourceNode(BaseNode *_parent=0, const std::string &_name="<LightSourceNode>")
Default constructor. Applies all properties.
GLenum index2gl(int _nr)
return GL_LIGHT* for light _nr
void enable(GLenum _nr)
enable LightSource _nr