erebus
diff liberebus/src/scene.cc @ 8:e2d9bf168a41
semi-works ...
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 24 May 2014 06:12:57 +0300 |
parents | 93894c232d65 |
children | 6204e4d3f445 |
line diff
1.1 --- a/liberebus/src/scene.cc Sat May 24 02:27:08 2014 +0300 1.2 +++ b/liberebus/src/scene.cc Sat May 24 06:12:57 2014 +0300 1.3 @@ -1,5 +1,11 @@ 1.4 #include "scene.h" 1.5 1.6 +// default enviromental parameters 1.7 +Environment::Environment() 1.8 + : bgcolor(0.05, 0.05, 0.05), ambient(0.05, 0.05, 0.05) 1.9 +{ 1.10 +} 1.11 + 1.12 Scene::Scene() 1.13 { 1.14 active_cam = 0; 1.15 @@ -17,6 +23,32 @@ 1.16 delete root; 1.17 } 1.18 1.19 +void Scene::set_env(const Environment &env) 1.20 +{ 1.21 + this->env = env; 1.22 +} 1.23 + 1.24 +Environment &Scene::get_env() 1.25 +{ 1.26 + return env; 1.27 +} 1.28 + 1.29 +const Environment &Scene::get_env() const 1.30 +{ 1.31 + return env; 1.32 +} 1.33 + 1.34 +Color Scene::get_env_color() const 1.35 +{ 1.36 + return env.bgcolor; 1.37 +} 1.38 + 1.39 +Color Scene::get_env_color(const Ray &ray) const 1.40 +{ 1.41 + // TODO 1.42 + return get_env_color(); 1.43 +} 1.44 + 1.45 void Scene::add_object(Object *obj) 1.46 { 1.47 objects.push_back(obj);