goat3dgfx

diff src/light.cc @ 30:07c08d970cb4

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