erebus

annotate liberebus/src/scene.cc @ 1:59a72293f9bd

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