nuclear@1: #include "scene.h" nuclear@1: nuclear@1: Scene::Scene() nuclear@1: { nuclear@1: active_cam = 0; nuclear@1: } nuclear@1: nuclear@1: Scene::~Scene() nuclear@1: { nuclear@1: for(auto obj : objects) { nuclear@1: delete obj; nuclear@1: } nuclear@1: for(auto node : nodes) { nuclear@1: delete node; nuclear@1: } nuclear@1: } nuclear@1: nuclear@1: void Scene::add_object(Object *obj) nuclear@1: { nuclear@1: objects.push_back(obj); nuclear@1: } nuclear@1: nuclear@1: int Scene::get_object_count() const nuclear@1: { nuclear@1: return (int)objects.size(); nuclear@1: } nuclear@1: nuclear@1: Object *Scene::get_object(int idx) const nuclear@1: { nuclear@1: return objects[idx]; nuclear@1: } nuclear@1: nuclear@1: void Scene::add_node(SceneNode *node) nuclear@1: { nuclear@1: nodes.push_back(node); nuclear@1: } nuclear@1: nuclear@1: int Scene::get_node_count() const nuclear@1: { nuclear@1: return (int)nodes.size(); nuclear@1: } nuclear@1: nuclear@1: SceneNode *Scene::get_node(int idx) const nuclear@1: { nuclear@1: return nodes[idx]; nuclear@1: } nuclear@1: nuclear@1: bool Scene::intersect(const Ray &ray, RayHit *hit) const nuclear@1: { nuclear@1: nuclear@1: }