Lugdunum  0.1.0
Scene.cpp
Go to the documentation of this file.
4 
5 namespace lug {
6 namespace Graphics {
7 namespace Scene {
8 
9 Scene::Scene(const std::string& name) : Resource(Resource::Type::Scene, name), _root{*this, "root"} {}
10 
11 Node* Scene::createSceneNode(const std::string& name) {
12  _nodes.emplace_back(*this, name);
13 
14  Node* node = &_nodes.back();
15 
16  return node;
17 }
18 
19 Node* Scene::getSceneNode(const std::string& name) {
20  return _root.getNode(name);
21 }
22 
23 const Node* Scene::getSceneNode(const std::string& name) const {
24  return _root.getNode(name);
25 }
26 
27 void Scene::fetchVisibleObjects(const Renderer& renderer, const Render::View& renderView, const Render::Camera::Camera& camera, Render::Queue& renderQueue) const {
28  renderQueue.addSkyBox(_skyBox);
29  _root.fetchVisibleObjects(renderer, renderView, camera, renderQueue);
30 }
31 
32 } // Scene
33 } // Graphics
34 } // lug
Node * createSceneNode(const std::string &name)
Definition: Scene.cpp:11
Class for resource.
Definition: Resource.hpp:17
Node * getSceneNode(const std::string &name)
Definition: Scene.cpp:19
void fetchVisibleObjects(const Renderer &renderer, const Render::View &renderView, const Render::Camera::Camera &camera, Render::Queue &renderQueue) const
Definition: Node.cpp:38
Node * getNode(const std::string &name)
Definition: Node.inl:1
Type
Type of the resource.
Definition: Resource.hpp:24
std::list< Node > _nodes
Definition: Scene.hpp:65
Resource::SharedPtr< Render::SkyBox > _skyBox
Definition: Scene.hpp:63
virtual void addSkyBox(Resource::SharedPtr< Render::SkyBox > skyBox)=0
void fetchVisibleObjects(const Renderer &renderer, const Render::View &renderView, const Render::Camera::Camera &camera, Render::Queue &renderQueue) const
Definition: Scene.cpp:27