Developer Documentation
ACG::SceneGraph::LightSource Class Reference

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...
 

Detailed Description

Structure to hold options for one LightSource.

Definition at line 85 of file LightNode.hh.

Constructor & Destructor Documentation

◆ LightSource()

ACG::SceneGraph::LightSource::LightSource ( )

Default Constructor.

Definition at line 74 of file LightNode.cc.

Member Function Documentation

◆ ambientColor() [1/2]

Vec4f ACG::SceneGraph::LightSource::ambientColor ( ) const

get Ambient color for LightSource

Definition at line 151 of file LightNode.cc.

◆ ambientColor() [2/2]

void ACG::SceneGraph::LightSource::ambientColor ( Vec4f  _color)

set Ambient color for LightSource

Definition at line 148 of file LightNode.cc.

◆ brightness() [1/2]

float ACG::SceneGraph::LightSource::brightness ( ) const

Definition at line 223 of file LightNode.cc.

◆ brightness() [2/2]

void ACG::SceneGraph::LightSource::brightness ( const float  _brightness)

Definition at line 219 of file LightNode.cc.

◆ constantAttenuation() [1/2]

float ACG::SceneGraph::LightSource::constantAttenuation ( ) const

Definition at line 199 of file LightNode.cc.

◆ constantAttenuation() [2/2]

void ACG::SceneGraph::LightSource::constantAttenuation ( float  _constantAttenuation)

Definition at line 195 of file LightNode.cc.

◆ diffuseColor() [1/2]

Vec4f ACG::SceneGraph::LightSource::diffuseColor ( ) const

get Diffuse color for LightSource

Definition at line 157 of file LightNode.cc.

◆ diffuseColor() [2/2]

void ACG::SceneGraph::LightSource::diffuseColor ( Vec4f  _color)

set Diffuse color for LightSource

Definition at line 154 of file LightNode.cc.

◆ direction() [1/2]

Vec3d ACG::SceneGraph::LightSource::direction ( ) const

Get direction of the light source.

Get direction of light.

Definition at line 123 of file LightNode.cc.

◆ direction() [2/2]

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.

◆ directional()

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.

◆ disable()

void ACG::SceneGraph::LightSource::disable ( )

disable LightSource

Definition at line 134 of file LightNode.cc.

◆ enable()

void ACG::SceneGraph::LightSource::enable ( )

enable LightSource

Definition at line 131 of file LightNode.cc.

◆ enabled()

bool ACG::SceneGraph::LightSource::enabled ( ) const

Get light source status.

Definition at line 137 of file LightNode.cc.

◆ fixedPosition() [1/2]

bool ACG::SceneGraph::LightSource::fixedPosition ( ) const

Definition at line 175 of file LightNode.cc.

◆ fixedPosition() [2/2]

void ACG::SceneGraph::LightSource::fixedPosition ( bool  _state)

make LightSource fixed or moveable with ModelViewMatrix

Definition at line 172 of file LightNode.cc.

◆ linearAttenuation() [1/2]

float ACG::SceneGraph::LightSource::linearAttenuation ( ) const

Definition at line 207 of file LightNode.cc.

◆ linearAttenuation() [2/2]

void ACG::SceneGraph::LightSource::linearAttenuation ( float  _linearAttenuation)

Definition at line 203 of file LightNode.cc.

◆ position() [1/2]

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.

◆ position() [2/2]

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.

◆ quadraticAttenuation() [1/2]

float ACG::SceneGraph::LightSource::quadraticAttenuation ( ) const

Definition at line 215 of file LightNode.cc.

◆ quadraticAttenuation() [2/2]

void ACG::SceneGraph::LightSource::quadraticAttenuation ( float  _quadraticAttenuation)

Definition at line 211 of file LightNode.cc.

◆ radius() [1/2]

float ACG::SceneGraph::LightSource::radius ( ) const
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.

◆ radius() [2/2]

void ACG::SceneGraph::LightSource::radius ( const float  _radius)
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.

◆ setColor()

void ACG::SceneGraph::LightSource::setColor ( const Vec4f _ambient,
const Vec4f _diffuse,
const Vec4f _specular 
)

Definition at line 166 of file LightNode.cc.

◆ specularColor() [1/2]

Vec4f ACG::SceneGraph::LightSource::specularColor ( ) const

get Specular color for LightSource

Definition at line 163 of file LightNode.cc.

◆ specularColor() [2/2]

void ACG::SceneGraph::LightSource::specularColor ( Vec4f  _color)

set Specular color for LightSource

Definition at line 160 of file LightNode.cc.

◆ spotCutoff() [1/2]

float ACG::SceneGraph::LightSource::spotCutoff ( ) const

Definition at line 191 of file LightNode.cc.

◆ spotCutoff() [2/2]

void ACG::SceneGraph::LightSource::spotCutoff ( float  _cutoff)

Definition at line 187 of file LightNode.cc.

◆ spotDirection() [1/2]

Vec3d ACG::SceneGraph::LightSource::spotDirection ( ) const

get spot direction

Todo:
Improve documentation

Definition at line 144 of file LightNode.cc.

◆ spotDirection() [2/2]

void ACG::SceneGraph::LightSource::spotDirection ( Vec3d  _pos)

Set spot direction.

Todo:
Improve documentation

Definition at line 141 of file LightNode.cc.

◆ spotExponent() [1/2]

float ACG::SceneGraph::LightSource::spotExponent ( ) const

Definition at line 183 of file LightNode.cc.

◆ spotExponent() [2/2]

void ACG::SceneGraph::LightSource::spotExponent ( float  _exponent)

Definition at line 179 of file LightNode.cc.

Friends And Related Function Documentation

◆ LightNode

friend class LightNode
friend

Simple Name for PlaneNode.

Definition at line 88 of file LightNode.hh.

Member Data Documentation

◆ ambientColor_

Vec4f ACG::SceneGraph::LightSource::ambientColor_
protected

Definition at line 222 of file LightNode.hh.

◆ brightness_

float ACG::SceneGraph::LightSource::brightness_
protected

Definition at line 240 of file LightNode.hh.

◆ constantAttenuation_

float ACG::SceneGraph::LightSource::constantAttenuation_
protected

Definition at line 236 of file LightNode.hh.

◆ diffuseColor_

Vec4f ACG::SceneGraph::LightSource::diffuseColor_
protected

Definition at line 223 of file LightNode.hh.

◆ enabled_

bool ACG::SceneGraph::LightSource::enabled_
protected

Definition at line 220 of file LightNode.hh.

◆ fixedPosition_

bool ACG::SceneGraph::LightSource::fixedPosition_
protected

Definition at line 221 of file LightNode.hh.

◆ initialPosition_

Vec4f ACG::SceneGraph::LightSource::initialPosition_
protected

Definition at line 230 of file LightNode.hh.

◆ initialPositionInit_

bool ACG::SceneGraph::LightSource::initialPositionInit_
protected

Definition at line 232 of file LightNode.hh.

◆ initialSpotDirection_

Vec3d ACG::SceneGraph::LightSource::initialSpotDirection_
protected

Definition at line 231 of file LightNode.hh.

◆ linearAttenuation_

float ACG::SceneGraph::LightSource::linearAttenuation_
protected

Definition at line 237 of file LightNode.hh.

◆ position_

Vec4f ACG::SceneGraph::LightSource::position_
protected

Definition at line 217 of file LightNode.hh.

◆ quadraticAttenuation_

float ACG::SceneGraph::LightSource::quadraticAttenuation_
protected

Definition at line 238 of file LightNode.hh.

◆ radius_

float ACG::SceneGraph::LightSource::radius_
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.

◆ realPosition_

Vec4f ACG::SceneGraph::LightSource::realPosition_
protected

Definition at line 218 of file LightNode.hh.

◆ realSpotDirection_

Vec3d ACG::SceneGraph::LightSource::realSpotDirection_
protected

Definition at line 227 of file LightNode.hh.

◆ specularColor_

Vec4f ACG::SceneGraph::LightSource::specularColor_
protected

Definition at line 224 of file LightNode.hh.

◆ spotCutoff_

float ACG::SceneGraph::LightSource::spotCutoff_
protected

Definition at line 235 of file LightNode.hh.

◆ spotDirection_

Vec3d ACG::SceneGraph::LightSource::spotDirection_
protected

Definition at line 226 of file LightNode.hh.

◆ spotExponent_

float ACG::SceneGraph::LightSource::spotExponent_
protected

Definition at line 234 of file LightNode.hh.


The documentation for this class was generated from the following files: