Developer Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
ACG::SceneGraph::LightSource Class Reference

Structure to hold options for one LightSource. More...

#include <ObjectTypes/Light/LightNode.hh>

Public Member Functions

 LightSource ()
 Default Constructor.
 
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
 
void disable ()
 disable LightSource
 
bool enabled () const
 Get light source status.
 
void spotDirection (Vec3d _pos)
 Set spot direction. More...
 
Vec3d spotDirection () const
 get spot direction More...
 
void ambientColor (Vec4f _color)
 set Ambient color for LightSource
 
Vec4f ambientColor () const
 get Ambient color for LightSource
 
void diffuseColor (Vec4f _color)
 set Diffuse color for LightSource
 
Vec4f diffuseColor () const
 get Diffuse color for LightSource
 
void specularColor (Vec4f _color)
 set Specular color for LightSource
 
Vec4f specularColor () const
 get Specular color for LightSource
 
void setColor (const Vec4f &_ambient, const Vec4f &_diffuse, const Vec4f &_specular)
 
void fixedPosition (bool _state)
 make LightSource fixed or moveable with ModelViewMatrix
 
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.
 

Detailed Description

Structure to hold options for one LightSource.

Definition at line 91 of file LightNode.hh.

Member Function Documentation

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

Get direction of the light source.

Get direction of light.

Definition at line 129 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 123 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 133 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 114 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 119 of file LightNode.cc.

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 212 of file LightNode.hh.

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 219 of file LightNode.hh.

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

Set spot direction.

Todo:
Improve documentation

Definition at line 147 of file LightNode.cc.

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

get spot direction

Todo:
Improve documentation

Definition at line 150 of file LightNode.cc.

Member Data Documentation

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 251 of file LightNode.hh.


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