erebus

diff 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
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/liberebus/src/scene.cc	Mon Apr 28 05:58:22 2014 +0300
     1.3 @@ -0,0 +1,51 @@
     1.4 +#include "scene.h"
     1.5 +
     1.6 +Scene::Scene()
     1.7 +{
     1.8 +	active_cam = 0;
     1.9 +}
    1.10 +
    1.11 +Scene::~Scene()
    1.12 +{
    1.13 +	for(auto obj : objects) {
    1.14 +		delete obj;
    1.15 +	}
    1.16 +	for(auto node : nodes) {
    1.17 +		delete node;
    1.18 +	}
    1.19 +}
    1.20 +
    1.21 +void Scene::add_object(Object *obj)
    1.22 +{
    1.23 +	objects.push_back(obj);
    1.24 +}
    1.25 +
    1.26 +int Scene::get_object_count() const
    1.27 +{
    1.28 +	return (int)objects.size();
    1.29 +}
    1.30 +
    1.31 +Object *Scene::get_object(int idx) const
    1.32 +{
    1.33 +	return objects[idx];
    1.34 +}
    1.35 +
    1.36 +void Scene::add_node(SceneNode *node)
    1.37 +{
    1.38 +	nodes.push_back(node);
    1.39 +}
    1.40 +
    1.41 +int Scene::get_node_count() const
    1.42 +{
    1.43 +	return (int)nodes.size();
    1.44 +}
    1.45 +
    1.46 +SceneNode *Scene::get_node(int idx) const
    1.47 +{
    1.48 +	return nodes[idx];
    1.49 +}
    1.50 +
    1.51 +bool Scene::intersect(const Ray &ray, RayHit *hit) const
    1.52 +{
    1.53 +
    1.54 +}
    1.55 \ No newline at end of file