Developer Documentation
|
Structure to hold options for one LightSource. More...
#include <Type-Light/ObjectTypes/Light/LightNode.hh>
Public Member Functions | |
LightSource () | |
Default Constructor. More... | |
void | position (Vec3d _pos) |
Set position for LightSource. More... | |
Vec3d | position () const |
Get the position of the LightSource. More... | |
bool | directional () const |
Check if the light source is a directional light source. More... | |
Vec3d | direction () const |
Get direction of the light source. More... | |
void | direction (Vec3d _pos) |
Set the direction of the light source. More... | |
void | enable () |
enable LightSource More... | |
void | disable () |
disable LightSource More... | |
bool | enabled () const |
Get light source status. More... | |
void | spotDirection (Vec3d _pos) |
Set spot direction. More... | |
Vec3d | spotDirection () const |
get spot direction More... | |
void | ambientColor (Vec4f _color) |
set Ambient color for LightSource More... | |
Vec4f | ambientColor () const |
get Ambient color for LightSource More... | |
void | diffuseColor (Vec4f _color) |
set Diffuse color for LightSource More... | |
Vec4f | diffuseColor () const |
get Diffuse color for LightSource More... | |
void | specularColor (Vec4f _color) |
set Specular color for LightSource More... | |
Vec4f | specularColor () const |
get Specular color for LightSource More... | |
void | setColor (const Vec4f &_ambient, const Vec4f &_diffuse, const Vec4f &_specular) |
void | fixedPosition (bool _state) |
make LightSource fixed or moveable with ModelViewMatrix More... | |
bool | fixedPosition () const |
void | spotExponent (float _exponent) |
float | spotExponent () const |
void | spotCutoff (float _cutoff) |
float | spotCutoff () const |
void | constantAttenuation (float _constantAttenuation) |
float | constantAttenuation () const |
void | linearAttenuation (float _linearAttenuation) |
float | linearAttenuation () const |
void | quadraticAttenuation (float _quadraticAttenuation) |
float | quadraticAttenuation () const |
void | brightness (const float _brightness) |
float | brightness () const |
float | radius () const |
Get light source radius. More... | |
void | radius (const float _radius) |
Set light source radius. More... | |
Protected Attributes | |
Vec4f | position_ |
Vec4f | realPosition_ |
bool | enabled_ |
bool | fixedPosition_ |
Vec4f | ambientColor_ |
Vec4f | diffuseColor_ |
Vec4f | specularColor_ |
Vec3d | spotDirection_ |
Vec3d | realSpotDirection_ |
Vec4f | initialPosition_ |
Vec3d | initialSpotDirection_ |
bool | initialPositionInit_ |
float | spotExponent_ |
float | spotCutoff_ |
float | constantAttenuation_ |
float | linearAttenuation_ |
float | quadraticAttenuation_ |
float | brightness_ |
float | radius_ |
Friends | |
class | LightNode |
Simple Name for PlaneNode. More... | |
Structure to hold options for one LightSource.
Definition at line 85 of file LightNode.hh.
ACG::SceneGraph::LightSource::LightSource | ( | ) |
Default Constructor.
Definition at line 74 of file LightNode.cc.
Vec4f ACG::SceneGraph::LightSource::ambientColor | ( | ) | const |
get Ambient color for LightSource
Definition at line 151 of file LightNode.cc.
void ACG::SceneGraph::LightSource::ambientColor | ( | Vec4f | _color | ) |
set Ambient color for LightSource
Definition at line 148 of file LightNode.cc.
float ACG::SceneGraph::LightSource::brightness | ( | ) | const |
Definition at line 223 of file LightNode.cc.
void ACG::SceneGraph::LightSource::brightness | ( | const float | _brightness | ) |
Definition at line 219 of file LightNode.cc.
float ACG::SceneGraph::LightSource::constantAttenuation | ( | ) | const |
Definition at line 199 of file LightNode.cc.
void ACG::SceneGraph::LightSource::constantAttenuation | ( | float | _constantAttenuation | ) |
Definition at line 195 of file LightNode.cc.
Vec4f ACG::SceneGraph::LightSource::diffuseColor | ( | ) | const |
get Diffuse color for LightSource
Definition at line 157 of file LightNode.cc.
void ACG::SceneGraph::LightSource::diffuseColor | ( | Vec4f | _color | ) |
set Diffuse color for LightSource
Definition at line 154 of file LightNode.cc.
Vec3d ACG::SceneGraph::LightSource::direction | ( | ) | const |
Get direction of the light source.
Get direction of light.
Definition at line 123 of file LightNode.cc.
void ACG::SceneGraph::LightSource::direction | ( | Vec3d | _pos | ) |
Set the direction of the light source.
This function creates a directional light source. The position is not used by OpenGL. Internally the positions homogeneous coordinate is set to 0.0.
Definition at line 117 of file LightNode.cc.
bool ACG::SceneGraph::LightSource::directional | ( | ) | const |
Check if the light source is a directional light source.
If this light Source is a directional light source the function will return true. Otherwise false as the light source has a position.
Definition at line 127 of file LightNode.cc.
void ACG::SceneGraph::LightSource::disable | ( | ) |
disable LightSource
Definition at line 134 of file LightNode.cc.
void ACG::SceneGraph::LightSource::enable | ( | ) |
enable LightSource
Definition at line 131 of file LightNode.cc.
bool ACG::SceneGraph::LightSource::enabled | ( | ) | const |
Get light source status.
Definition at line 137 of file LightNode.cc.
bool ACG::SceneGraph::LightSource::fixedPosition | ( | ) | const |
Definition at line 175 of file LightNode.cc.
void ACG::SceneGraph::LightSource::fixedPosition | ( | bool | _state | ) |
make LightSource fixed or moveable with ModelViewMatrix
Definition at line 172 of file LightNode.cc.
float ACG::SceneGraph::LightSource::linearAttenuation | ( | ) | const |
Definition at line 207 of file LightNode.cc.
void ACG::SceneGraph::LightSource::linearAttenuation | ( | float | _linearAttenuation | ) |
Definition at line 203 of file LightNode.cc.
Vec3d ACG::SceneGraph::LightSource::position | ( | ) | const |
Get the position of the LightSource.
Be careful with this function. Check if the light source is not directional with the directional() function
Definition at line 113 of file LightNode.cc.
void ACG::SceneGraph::LightSource::position | ( | Vec3d | _pos | ) |
Set position for LightSource.
This function sets the position of a light source. OpenGL handles a position for a light source if the homogeneous coordinate is 1.0. If it is 0.0 the light source will be directional. So a 1.0 is set in this function to get a positioned light source.
Definition at line 108 of file LightNode.cc.
float ACG::SceneGraph::LightSource::quadraticAttenuation | ( | ) | const |
Definition at line 215 of file LightNode.cc.
void ACG::SceneGraph::LightSource::quadraticAttenuation | ( | float | _quadraticAttenuation | ) |
Definition at line 211 of file LightNode.cc.
|
inline |
Get light source radius.
The light radius is the size of the lightsource. In OpenGL rendering this value is ignored. You can use it for example in raytracers to implement soft shadows.
Definition at line 206 of file LightNode.hh.
|
inline |
Set light source radius.
The light radius is the size of the lightsource. In OpenGL rendering this value is ignored. You can use it for example in raytracers to implement soft shadows.
Definition at line 213 of file LightNode.hh.
void ACG::SceneGraph::LightSource::setColor | ( | const Vec4f & | _ambient, |
const Vec4f & | _diffuse, | ||
const Vec4f & | _specular | ||
) |
Definition at line 166 of file LightNode.cc.
Vec4f ACG::SceneGraph::LightSource::specularColor | ( | ) | const |
get Specular color for LightSource
Definition at line 163 of file LightNode.cc.
void ACG::SceneGraph::LightSource::specularColor | ( | Vec4f | _color | ) |
set Specular color for LightSource
Definition at line 160 of file LightNode.cc.
float ACG::SceneGraph::LightSource::spotCutoff | ( | ) | const |
Definition at line 191 of file LightNode.cc.
void ACG::SceneGraph::LightSource::spotCutoff | ( | float | _cutoff | ) |
Definition at line 187 of file LightNode.cc.
Vec3d ACG::SceneGraph::LightSource::spotDirection | ( | ) | const |
void ACG::SceneGraph::LightSource::spotDirection | ( | Vec3d | _pos | ) |
float ACG::SceneGraph::LightSource::spotExponent | ( | ) | const |
Definition at line 183 of file LightNode.cc.
void ACG::SceneGraph::LightSource::spotExponent | ( | float | _exponent | ) |
Definition at line 179 of file LightNode.cc.
|
friend |
Simple Name for PlaneNode.
Definition at line 88 of file LightNode.hh.
|
protected |
Definition at line 222 of file LightNode.hh.
|
protected |
Definition at line 240 of file LightNode.hh.
|
protected |
Definition at line 236 of file LightNode.hh.
|
protected |
Definition at line 223 of file LightNode.hh.
|
protected |
Definition at line 220 of file LightNode.hh.
|
protected |
Definition at line 221 of file LightNode.hh.
|
protected |
Definition at line 230 of file LightNode.hh.
|
protected |
Definition at line 232 of file LightNode.hh.
|
protected |
Definition at line 231 of file LightNode.hh.
|
protected |
Definition at line 237 of file LightNode.hh.
|
protected |
Definition at line 217 of file LightNode.hh.
|
protected |
Definition at line 238 of file LightNode.hh.
|
protected |
When using ray tracing, light sources can have extent. We simplify to spherical light sources with radius radius_.
Definition at line 245 of file LightNode.hh.
|
protected |
Definition at line 218 of file LightNode.hh.
|
protected |
Definition at line 227 of file LightNode.hh.
|
protected |
Definition at line 224 of file LightNode.hh.
|
protected |
Definition at line 235 of file LightNode.hh.
|
protected |
Definition at line 226 of file LightNode.hh.
|
protected |
Definition at line 234 of file LightNode.hh.