cgv
Loading...
Searching...
No Matches
cgv::media::illum::light_source Class Reference

>simple class to hold the properties of a light source More...

#include <light_source.h>

Public Member Functions

 light_source (LightType _t=LT_DIRECTIONAL)
 init with default values
 
void set_type (LightType t)
 name getter and setters for members
 
LightType get_type () const
 
LightType & ref_type ()
 
void set_local_to_eye (bool l)
 
bool is_local_to_eye () const
 
bool & ref_local_to_eye ()
 
void set_position (const vec3 &loc)
 
const vec3get_position () const
 
vec3ref_position ()
 
void set_emission (const rgb &c)
 
const rgbget_emission () const
 
rgbref_emission ()
 
void set_ambient_scale (float c)
 
float get_ambient_scale () const
 
float & ref_ambient_scale ()
 
void set_constant_attenuation (float c)
 
float get_constant_attenuation () const
 
float & ref_constant_attenuation ()
 
void set_linear_attenuation (float c)
 
float get_linear_attenuation () const
 
float & ref_linear_attenuation ()
 
void set_quadratic_attenuation (float c)
 
float get_quadratic_attenuation () const
 
float & ref_quadratic_attenuation ()
 
void set_spot_direction (const vec3 &d)
 
const vec3get_spot_direction () const
 
vec3ref_spot_direction ()
 
void set_spot_exponent (float e)
 
float get_spot_exponent () const
 
float & ref_spot_exponent ()
 
void set_spot_cutoff (float c)
 
float get_spot_cutoff () const
 
float & ref_spot_cutoff ()
 

Protected Attributes

LightType type
 >type of light source
 
bool local_to_eye_coordinates
 >whether location is relative to eye coordinate system, i.e. model view is identity
 
vec3 position
 > direction to light source for directional light sources and location of light source for point or spot light sources
 
rgb emission
 > radiance for directional light sources and intensity for point light sources
 
float ambient_scale
 > scale to use on emission to retrieve ambient illumination caused by light source
 
float constant_attenuation
 >constant attenuation coefficients used for positional light sources only
 
float linear_attenuation
 >linear attenuation coefficients used for positional light sources only
 
float quadratic_attenuation
 >quadratic attenuation coefficients used for positional light sources only
 
vec3 spot_direction
 >direction of spot light
 
float spot_exponent
 >spot exponent
 
float spot_cutoff
 >spot cutoff in degrees
 

Detailed Description

>simple class to hold the properties of a light source

Definition at line 16 of file light_source.h.

Constructor & Destructor Documentation

◆ light_source()

cgv::media::illum::light_source::light_source ( LightType  _t = LT_DIRECTIONAL)

init with default values

Definition at line 7 of file light_source.cxx.

Member Function Documentation

◆ get_ambient_scale()

float cgv::media::illum::light_source::get_ambient_scale ( ) const
inline

Definition at line 77 of file light_source.h.

◆ get_constant_attenuation()

float cgv::media::illum::light_source::get_constant_attenuation ( ) const
inline

Definition at line 84 of file light_source.h.

◆ get_emission()

const rgb & cgv::media::illum::light_source::get_emission ( ) const
inline

Definition at line 70 of file light_source.h.

◆ get_linear_attenuation()

float cgv::media::illum::light_source::get_linear_attenuation ( ) const
inline

Definition at line 91 of file light_source.h.

◆ get_position()

const vec3 & cgv::media::illum::light_source::get_position ( ) const
inline

Definition at line 63 of file light_source.h.

◆ get_quadratic_attenuation()

float cgv::media::illum::light_source::get_quadratic_attenuation ( ) const
inline

Definition at line 98 of file light_source.h.

◆ get_spot_cutoff()

float cgv::media::illum::light_source::get_spot_cutoff ( ) const
inline

Definition at line 119 of file light_source.h.

◆ get_spot_direction()

const vec3 & cgv::media::illum::light_source::get_spot_direction ( ) const
inline

Definition at line 105 of file light_source.h.

◆ get_spot_exponent()

float cgv::media::illum::light_source::get_spot_exponent ( ) const
inline

Definition at line 112 of file light_source.h.

◆ get_type()

LightType cgv::media::illum::light_source::get_type ( ) const
inline

Definition at line 49 of file light_source.h.

◆ is_local_to_eye()

bool cgv::media::illum::light_source::is_local_to_eye ( ) const
inline

Definition at line 56 of file light_source.h.

◆ ref_ambient_scale()

float & cgv::media::illum::light_source::ref_ambient_scale ( )
inline

Definition at line 79 of file light_source.h.

◆ ref_constant_attenuation()

float & cgv::media::illum::light_source::ref_constant_attenuation ( )
inline

Definition at line 86 of file light_source.h.

◆ ref_emission()

rgb & cgv::media::illum::light_source::ref_emission ( )
inline

Definition at line 72 of file light_source.h.

◆ ref_linear_attenuation()

float & cgv::media::illum::light_source::ref_linear_attenuation ( )
inline

Definition at line 93 of file light_source.h.

◆ ref_local_to_eye()

bool & cgv::media::illum::light_source::ref_local_to_eye ( )
inline

Definition at line 58 of file light_source.h.

◆ ref_position()

vec3 & cgv::media::illum::light_source::ref_position ( )
inline

Definition at line 65 of file light_source.h.

◆ ref_quadratic_attenuation()

float & cgv::media::illum::light_source::ref_quadratic_attenuation ( )
inline

Definition at line 100 of file light_source.h.

◆ ref_spot_cutoff()

float & cgv::media::illum::light_source::ref_spot_cutoff ( )
inline

Definition at line 121 of file light_source.h.

◆ ref_spot_direction()

vec3 & cgv::media::illum::light_source::ref_spot_direction ( )
inline

Definition at line 107 of file light_source.h.

◆ ref_spot_exponent()

float & cgv::media::illum::light_source::ref_spot_exponent ( )
inline

Definition at line 114 of file light_source.h.

◆ ref_type()

LightType & cgv::media::illum::light_source::ref_type ( )
inline

Definition at line 51 of file light_source.h.

◆ set_ambient_scale()

void cgv::media::illum::light_source::set_ambient_scale ( float  c)
inline

Definition at line 75 of file light_source.h.

◆ set_constant_attenuation()

void cgv::media::illum::light_source::set_constant_attenuation ( float  c)
inline

Definition at line 82 of file light_source.h.

◆ set_emission()

void cgv::media::illum::light_source::set_emission ( const rgb c)
inline

Definition at line 68 of file light_source.h.

◆ set_linear_attenuation()

void cgv::media::illum::light_source::set_linear_attenuation ( float  c)
inline

Definition at line 89 of file light_source.h.

◆ set_local_to_eye()

void cgv::media::illum::light_source::set_local_to_eye ( bool  l)
inline

Definition at line 54 of file light_source.h.

◆ set_position()

void cgv::media::illum::light_source::set_position ( const vec3 loc)
inline

Definition at line 61 of file light_source.h.

◆ set_quadratic_attenuation()

void cgv::media::illum::light_source::set_quadratic_attenuation ( float  c)
inline

Definition at line 96 of file light_source.h.

◆ set_spot_cutoff()

void cgv::media::illum::light_source::set_spot_cutoff ( float  c)
inline

Definition at line 117 of file light_source.h.

◆ set_spot_direction()

void cgv::media::illum::light_source::set_spot_direction ( const vec3 d)
inline

Definition at line 103 of file light_source.h.

◆ set_spot_exponent()

void cgv::media::illum::light_source::set_spot_exponent ( float  e)
inline

Definition at line 110 of file light_source.h.

◆ set_type()

void cgv::media::illum::light_source::set_type ( LightType  t)
inline

name getter and setters for members

Definition at line 47 of file light_source.h.

Member Data Documentation

◆ ambient_scale

float cgv::media::illum::light_source::ambient_scale
protected

> scale to use on emission to retrieve ambient illumination caused by light source

Definition at line 28 of file light_source.h.

◆ constant_attenuation

float cgv::media::illum::light_source::constant_attenuation
protected

>constant attenuation coefficients used for positional light sources only

Definition at line 30 of file light_source.h.

◆ emission

rgb cgv::media::illum::light_source::emission
protected

> radiance for directional light sources and intensity for point light sources

Definition at line 26 of file light_source.h.

◆ linear_attenuation

float cgv::media::illum::light_source::linear_attenuation
protected

>linear attenuation coefficients used for positional light sources only

Definition at line 32 of file light_source.h.

◆ local_to_eye_coordinates

bool cgv::media::illum::light_source::local_to_eye_coordinates
protected

>whether location is relative to eye coordinate system, i.e. model view is identity

Definition at line 22 of file light_source.h.

◆ position

vec3 cgv::media::illum::light_source::position
protected

> direction to light source for directional light sources and location of light source for point or spot light sources

Definition at line 24 of file light_source.h.

◆ quadratic_attenuation

float cgv::media::illum::light_source::quadratic_attenuation
protected

>quadratic attenuation coefficients used for positional light sources only

Definition at line 34 of file light_source.h.

◆ spot_cutoff

float cgv::media::illum::light_source::spot_cutoff
protected

>spot cutoff in degrees

Definition at line 40 of file light_source.h.

◆ spot_direction

vec3 cgv::media::illum::light_source::spot_direction
protected

>direction of spot light

Definition at line 36 of file light_source.h.

◆ spot_exponent

float cgv::media::illum::light_source::spot_exponent
protected

>spot exponent

Definition at line 38 of file light_source.h.

◆ type

LightType cgv::media::illum::light_source::type
protected

>type of light source

Definition at line 20 of file light_source.h.


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