erebus

view liberebus/src/scene.cc @ 3:a932848de652

foo
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 28 Apr 2014 15:44:59 +0300
parents
children 93894c232d65
line source
1 #include "scene.h"
3 Scene::Scene()
4 {
5 active_cam = 0;
6 }
8 Scene::~Scene()
9 {
10 for(auto obj : objects) {
11 delete obj;
12 }
13 for(auto node : nodes) {
14 delete node;
15 }
16 }
18 void Scene::add_object(Object *obj)
19 {
20 objects.push_back(obj);
21 }
23 int Scene::get_object_count() const
24 {
25 return (int)objects.size();
26 }
28 Object *Scene::get_object(int idx) const
29 {
30 return objects[idx];
31 }
33 void Scene::add_node(SceneNode *node)
34 {
35 nodes.push_back(node);
36 }
38 int Scene::get_node_count() const
39 {
40 return (int)nodes.size();
41 }
43 SceneNode *Scene::get_node(int idx) const
44 {
45 return nodes[idx];
46 }
48 bool Scene::intersect(const Ray &ray, RayHit *hit) const
49 {
51 }