conworlds

diff src/light.cc @ 13:283cdfa7dda2

added a crapload of code from goat3dgfx
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 24 Aug 2014 09:41:24 +0300
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/light.cc	Sun Aug 24 09:41:24 2014 +0300
     1.3 @@ -0,0 +1,36 @@
     1.4 +#include "light.h"
     1.5 +
     1.6 +Light::Light()
     1.7 +{
     1.8 +	cast_shadows = false;
     1.9 +}
    1.10 +
    1.11 +void Light::set_color(const Vector3 &color)
    1.12 +{
    1.13 +	this->color = color;
    1.14 +}
    1.15 +
    1.16 +const Vector3 &Light::get_color() const
    1.17 +{
    1.18 +	return color;
    1.19 +}
    1.20 +
    1.21 +void Light::set_attenuation(const Vector3 &att)
    1.22 +{
    1.23 +	attenuation = att;
    1.24 +}
    1.25 +
    1.26 +const Vector3 &Light::get_attenuation() const
    1.27 +{
    1.28 +	return attenuation;
    1.29 +}
    1.30 +
    1.31 +void Light::set_shadow_caster(bool s)
    1.32 +{
    1.33 +	cast_shadows = s;
    1.34 +}
    1.35 +
    1.36 +bool Light::is_shadow_caster() const
    1.37 +{
    1.38 +	return cast_shadows;
    1.39 +}