53 #ifndef ACG_LIGHT_NODE_HH 54 #define ACG_LIGHT_NODE_HH 59 #include <ACG/Scenegraph/BaseNode.hh> 62 #include <ACG/GL/gl.hh> 63 #include <ACG/GL/GLPrimitives.hh> 102 void position(
Vec3d _pos);
109 Vec3d position()
const;
116 bool directional()
const;
122 Vec3d direction()
const;
129 void direction(
Vec3d _pos);
138 bool enabled()
const;
144 void spotDirection(
Vec3d _pos);
150 Vec3d spotDirection( )
const;
153 void ambientColor(
Vec4f _color);
156 Vec4f ambientColor()
const;
159 void diffuseColor(
Vec4f _color);
162 Vec4f diffuseColor()
const;
165 void specularColor(
Vec4f _color);
168 Vec4f specularColor()
const;
170 void setColor(
const Vec4f& _ambient,
const Vec4f& _diffuse,
const Vec4f& _specular);
173 void fixedPosition(
bool _state);
175 bool fixedPosition()
const;
177 void spotExponent(
float _exponent);
179 float spotExponent()
const;
181 void spotCutoff(
float _cutoff);
183 float spotCutoff()
const;
185 void constantAttenuation(
float _constantAttenuation);
187 float constantAttenuation()
const;
189 void linearAttenuation(
float _linearAttenuation);
191 float linearAttenuation()
const;
193 void quadraticAttenuation(
float _quadraticAttenuation);
195 float quadraticAttenuation()
const;
197 void brightness(
const float _brightness);
199 float brightness()
const;
213 void radius(
const float _radius) { radius_ = _radius; }
224 Vec4f specularColor_;
226 Vec3d spotDirection_;
227 Vec3d realSpotDirection_;
230 Vec4f initialPosition_;
231 Vec3d initialSpotDirection_;
232 bool initialPositionInit_;
236 float constantAttenuation_;
237 float linearAttenuation_;
238 float quadraticAttenuation_;
256 const std::string& _name =
"<LightNode>");
269 void getLightSourceViewSpace(
LightSource* _light)
const;
293 void visualize(
bool _visualize) { visualize_ = _visualize; }
343 if (OpenFlipper::Options::gui() && !OpenFlipper::Options::coreProfile())
344 glGetIntegerv(GL_MAX_LIGHTS, &maxLights);
348 for(
int i = 0; i < maxLights; ++i) {
349 lights_.insert(std::pair<GLenum, LightNode*>(GL_LIGHT0 + i, (
LightNode*)0 ));
354 GLenum light = GL_INVALID_ENUM;
355 for(std::map<GLenum, LightNode*>::iterator it = lights_.begin();
356 it != lights_.end(); ++it) {
358 if(it->second == 0) {
359 lights_[it->first] = _node;
368 for(std::map<GLenum, LightNode*>::iterator it = lights_.begin();
369 it != lights_.end(); ++it) {
371 if(it->second == _node) {
372 lights_[it->first] = 0;
379 std::map<GLenum, LightNode*> lights_;
386 #endif // ACG_LIGHT_NODE_HH defined Namespace providing different geometric functions concerning angles.
LightSource light_
store LightSources of this node
bool visualize()
Should node be visualized?
LightSource transformedLight_
pretransformed light position and direction in view space
void visualize(bool _visualize)
Set whether node should be visualized.
LightSource lightSave_
save old LightSources
Structure to hold options for one LightSource.
GLenum lightId_
Internal light id.
bool visualize_
Indicates whether light node should be visualized or not.
PickTarget
What target to use for picking.
ACG::SceneGraph::LightSource LightSource
Simple Name for the LightSource.
ACG::SceneGraph::LightNode LightNode
Simple Name for PlaneNode.
void radius(const float _radius)
Set light source radius.
void setLightSource(LightSource _light)
Set the light source parameters.
float radius() const
Get light source radius.