Loading...
Searching...
No Matches
BALL::VIEW::LightSource Class Reference
Visualisation » Kernel » Setup of the Stage, Camera and LightSources

`#include <BALL/VIEW/KERNEL/stage.h>`

## Public Types

enum | Types { AMBIENT = 0 , POSITIONAL , DIRECTIONAL }
| Enumeration of different types of lights. More...

## Public Member Functions

Constructors and Destructors
| LightSource ()
| LightSource (const LightSource &light_source)
virtual | ~LightSource ()
Accessors
const Vector3 & | getPosition () const
| Get position.
void | setPosition (const Vector3 &position)
| Set position.
const Vector3 & | getDirection () const
| Get the direction vector of the light.
void | setDirection (const Vector3 &direction)
| Set the direction vector of the light.
const Vector3 & | getAttenuation () const
| Get the attenuation parameters of the light.
void | setAttenuation (const Vector3 &attenuation)
| Set the attenuation parameters of the light.
const Angle & | getAngle () const
| Get the angle of the light cone.
void | setAngle (const Angle &angle)
| Set the angle of the light cone.
float | getIntensity () const
void | setIntensity (float intensity)
const ColorRGBA & | getColor () const
void | setColor (const ColorRGBA &color)
Index | getType () const
void | setType (Types type)
void | setRelativeToCamera (bool state)
| If set to true, the LightSource will move with the Camera.
bool | isRelativeToCamera () const
| Test if a LightSource will move with the Camera.
LightSource & | operator= (const LightSource &light)
bool | operator< (const LightSource &light) const
| needed for MSVC, dont use it otherwise!

## Predicates

Vector3 | position_
Vector3 | direction_
Vector3 | attenuation_
Vector3 | r_position_
Vector3 | r_direction_
Angle | angle_
float | intensity_
ColorRGBA | color_
Index | type_
bool | relative_
bool | operator== (const LightSource &light_source) const
virtual void | dump (std::ostream &s=std::cout, Size depth=0) const

## Detailed Description

Light source is mainly used for Renderer classes (e.g. OpenGL and POVRay). Currently we support ambient, positional and directional light sources. The Position and direction of lights can be stored twofold:

- Either with absolute room coordinates and a direction vector or \
- Relative to a Camera. In this case, the position and direction vector are stored as multiples of look right, look up and view vector.

Definition at line 53 of file stage.h.

## Member Enumeration Documentation

## Types

enum BALL::VIEW::LightSource::Types

Enumeration of different types of lights.

Enumerator
AMBIENT | Ambient light doesn't come from any particular direction. All the objects in the scene will be lit up by the ambient light.
POSITIONAL | Diffuse light is created the light source and is reflected off the surface of any object in the scene. Any surface of an object that the light hits directly will be very bright, and areas the light barely gets to will be darker.
DIRECTIONAL |

Definition at line 58 of file stage.h.

## Constructor & Destructor Documentation

## LightSource() [1/2]

BALL::VIEW::LightSource::LightSource | ( |  | ) |

Constructor

## LightSource() [2/2]

BALL::VIEW::LightSource::LightSource | ( | const LightSource & | light_source | ) |

Copy Constructor

## ~LightSource()

virtual BALL::VIEW::LightSource::~LightSource | ( |  | ) |

inline virtual

Destructor

Definition at line 91 of file stage.h.

## Member Function Documentation

## dump()

virtual void BALL::VIEW::LightSource::dump | ( | std::ostream & | s = std::cout,
|  | Size | depth = 0 ) const

virtual

Internal value dump. Dump the current state of this instance to the output ostream s with dumping depth depth.

Parameters

  s | output stream
  depth | the dumping depth

## getAngle()

const Angle & BALL::VIEW::LightSource::getAngle | ( |  | ) | const

inline

Get the angle of the light cone.

Definition at line 124 of file stage.h.

## getAttenuation()

const Vector3 & BALL::VIEW::LightSource::getAttenuation | ( |  | ) | const

inline

Get the attenuation parameters of the light.

Definition at line 115 of file stage.h.

## getColor()

const ColorRGBA & BALL::VIEW::LightSource::getColor | ( |  | ) | const

inline

Get the color of the light. The alpha channel of the color is ignored.

Definition at line 146 of file stage.h.

## getDirection()

const Vector3 & BALL::VIEW::LightSource::getDirection | ( |  | ) | const

inline

Get the direction vector of the light.

Definition at line 107 of file stage.h.

## getIntensity()

float BALL::VIEW::LightSource::getIntensity | ( |  | ) | const

inline

Get the light intensity. 0 is the minumum, 1 is the maximum.

Definition at line 134 of file stage.h.

## getPosition()

const Vector3 & BALL::VIEW::LightSource::getPosition | ( |  | ) | const

inline

Get position.

Definition at line 99 of file stage.h.

## getType()

Index BALL::VIEW::LightSource::getType | ( |  | ) | const

inline

Get the type of the light.

See also
  Types

Definition at line 158 of file stage.h.

## isRelativeToCamera()

bool BALL::VIEW::LightSource::isRelativeToCamera | ( |  | ) | const

inline

Test if a LightSource will move with the Camera.

Definition at line 172 of file stage.h.

## operator<()

bool BALL::VIEW::LightSource::operator< | ( | const LightSource & | light | ) | const

needed for MSVC, dont use it otherwise!

## operator=()

LightSource & BALL::VIEW::LightSource::operator= | ( | const LightSource & | light | ) |

## operator==()

bool BALL::VIEW::LightSource::operator== | ( | const LightSource & | light_source | ) | const

## setAngle()

void BALL::VIEW::LightSource::setAngle | ( | const Angle & | angle | ) |

inline

Set the angle of the light cone.

Definition at line 128 of file stage.h.

## setAttenuation()

void BALL::VIEW::LightSource::setAttenuation | ( | const Vector3 & | attenuation | ) |

inline

Set the attenuation parameters of the light.

Definition at line 119 of file stage.h.

## setColor()

void BALL::VIEW::LightSource::setColor | ( | const ColorRGBA & | color | ) |

inline

Set the color of the light. The alpha channel of the color is ignored.

Definition at line 152 of file stage.h.

## setDirection()

void BALL::VIEW::LightSource::setDirection | ( | const Vector3 & | direction | ) |

inline

Set the direction vector of the light.

Definition at line 111 of file stage.h.

## setIntensity()

void BALL::VIEW::LightSource::setIntensity | ( | float | intensity | ) |

inline

Set the intensity. 0 is the minumum, 1 is the maximum.

Definition at line 140 of file stage.h.

## setPosition()

void BALL::VIEW::LightSource::setPosition | ( | const Vector3 & | position | ) |

inline

Set position.

Definition at line 103 of file stage.h.

## setRelativeToCamera()

void BALL::VIEW::LightSource::setRelativeToCamera | ( | bool | state | ) |

inline

If set to true, the LightSource will move with the Camera.

Definition at line 168 of file stage.h.

## setType()

void BALL::VIEW::LightSource::setType | ( | Types | type | ) |

inline

Set the type of the light.

See also
  Types

Definition at line 164 of file stage.h.

## Member Data Documentation

## angle_

Angle BALL::VIEW::LightSource::angle_

protected

Definition at line 217 of file stage.h.

## attenuation_

Vector3 BALL::VIEW::LightSource::attenuation_

protected

Definition at line 208 of file stage.h.

## color_

ColorRGBA BALL::VIEW::LightSource::color_

protected

Definition at line 223 of file stage.h.

## direction_

Vector3 BALL::VIEW::LightSource::direction_

protected

Definition at line 205 of file stage.h.

## intensity_

float BALL::VIEW::LightSource::intensity_

protected

Definition at line 220 of file stage.h.

## position_

Vector3 BALL::VIEW::LightSource::position_

protected

Definition at line 202 of file stage.h.

## r_direction_

Vector3 BALL::VIEW::LightSource::r_direction_

protected

Definition at line 214 of file stage.h.

## r_position_

Vector3 BALL::VIEW::LightSource::r_position_

protected

Definition at line 211 of file stage.h.

## relative_

bool BALL::VIEW::LightSource::relative_

protected

Definition at line 229 of file stage.h.

## type_

Index BALL::VIEW::LightSource::type_

protected

Definition at line 226 of file stage.h.