rayzor
diff src/light.cc @ 0:2a5340a6eee4
rayzor first commit
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 05 Apr 2014 08:46:27 +0300 |
parents | |
children | a826bf0fb169 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/light.cc Sat Apr 05 08:46:27 2014 +0300 1.3 @@ -0,0 +1,41 @@ 1.4 +#include "light.h" 1.5 + 1.6 +Light::Light() 1.7 +{ 1.8 + color.x = color.y = color.z = 1.0; 1.9 + atten.x = 1.0; 1.10 + atten.y = 0.0; 1.11 + atten.z = 0.0; 1.12 +} 1.13 + 1.14 +void Light::set_position(const Vector3 &pos) 1.15 +{ 1.16 + this->pos = pos; 1.17 +} 1.18 + 1.19 +const Vector3 &Light::get_position() const 1.20 +{ 1.21 + return pos; 1.22 +} 1.23 + 1.24 + 1.25 +void Light::set_color(const Vector3 &color) 1.26 +{ 1.27 + this->color = color; 1.28 +} 1.29 + 1.30 +const Vector3 &Light::get_color() const 1.31 +{ 1.32 + return color; 1.33 +} 1.34 + 1.35 + 1.36 +void Light::set_attenuation(const Vector3 &atten) 1.37 +{ 1.38 + this->atten = atten; 1.39 +} 1.40 + 1.41 +const Vector3 &Light::get_attenuation() const 1.42 +{ 1.43 + return atten; 1.44 +}