3#include <cgv/math/fvec.h>
4#include <cgv/media/color.h>
13enum LightType { LT_DIRECTIONAL, LT_POINT, LT_SPOT };
49 LightType get_type()
const {
return type; }
51 LightType& ref_type() {
return type; }
54 void set_local_to_eye(
bool l) { local_to_eye_coordinates = l; }
56 bool is_local_to_eye()
const {
return local_to_eye_coordinates; }
58 bool& ref_local_to_eye() {
return local_to_eye_coordinates; }
61 void set_position(
const vec3& loc) { position = loc; }
63 const vec3& get_position()
const {
return position; }
65 vec3& ref_position() {
return position; }
68 void set_emission(
const rgb& c) { emission = c; }
70 const rgb& get_emission()
const {
return emission; }
72 rgb& ref_emission() {
return emission; }
75 void set_ambient_scale(
float c) { ambient_scale = c; }
77 float get_ambient_scale()
const {
return ambient_scale; }
79 float& ref_ambient_scale() {
return ambient_scale; }
82 void set_constant_attenuation(
float c) { constant_attenuation = c; }
84 float get_constant_attenuation()
const {
return constant_attenuation; }
86 float& ref_constant_attenuation() {
return constant_attenuation; }
89 void set_linear_attenuation(
float c) { linear_attenuation = c; }
91 float get_linear_attenuation()
const {
return linear_attenuation; }
93 float& ref_linear_attenuation() {
return linear_attenuation; }
96 void set_quadratic_attenuation(
float c) { quadratic_attenuation = c; }
98 float get_quadratic_attenuation()
const {
return quadratic_attenuation; }
100 float& ref_quadratic_attenuation() {
return quadratic_attenuation; }
103 void set_spot_direction(
const vec3& d) { spot_direction = d; }
105 const vec3& get_spot_direction()
const {
return spot_direction; }
107 vec3& ref_spot_direction() {
return spot_direction; }
110 void set_spot_exponent(
float e) { spot_exponent = e; }
112 float get_spot_exponent()
const {
return spot_exponent; }
114 float& ref_spot_exponent() {
return spot_exponent; }
117 void set_spot_cutoff(
float c) { spot_cutoff = c; }
119 float get_spot_cutoff()
const {
return spot_cutoff; }
121 float& ref_spot_cutoff() {
return spot_cutoff; }
129#include <cgv/type/info/type_name.h>
138 static const char*
get_name() {
return "light_source"; }
145#include <cgv/config/lib_end.h>
cgv::media::color< float, cgv::media::RGB > rgb
declare rgb color type with 32 bit components
cgv::math::fvec< float, 3 > vec3
declare type of 3d single precision floating point vectors
traits class with a static function get_name() of type const char* that returns the type name of the ...
static const char * get_name()
return special name for standard types or type name from RTTI cleaned from keywords for all other typ...