Ocular Engine
ISceneTree.hpp
1 
17 #pragma once
18 #ifndef __H__OCULAR_CORE_SCENE_ASCENE_TREE__H__
19 #define __H__OCULAR_CORE_SCENE_ASCENE_TREE__H__
20 
21 #include "SceneNode.hpp"
22 #include "SceneTreeType.hpp"
23 #include "UUID.hpp"
24 
25 #include "Math/Bounds/Ray.hpp"
26 #include "Math/Bounds/BoundsSphere.hpp"
27 #include "Math/Bounds/BoundsAABB.hpp"
28 #include "Math/Bounds/BoundsOBB.hpp"
29 #include "Math/Geometry/Frustum.hpp"
30 
31 #include <vector>
32 #include <memory>
33 
34 //------------------------------------------------------------------------------------------
35 
40 namespace Ocular
41 {
46  namespace Core
47  {
51  class ISceneTree
52  {
53  public:
54 
59  virtual void restructure() = 0;
60 
64  virtual void destroy() = 0;
65 
76  virtual void addObject(SceneObject* object) = 0;
77 
88  virtual void addObjects(std::vector<SceneObject*> const& objects) = 0;
89 
99  virtual bool removeObject(SceneObject* object) = 0;
100 
110  virtual void removeObjects(std::vector<SceneObject*> const& objects) = 0;
111 
118  virtual void getAllObjects(std::vector<SceneObject*>& objects) const = 0;
119 
127  virtual void getAllVisibleObjects(Math::Frustum const& frustum, std::vector<SceneObject*>& objects) const = 0;
128 
140  virtual void getIntersections(Math::Ray const& ray, std::vector<SceneObject*>& objects) const = 0;
141 
149  virtual void getIntersections(Math::BoundsSphere const& bounds, std::vector<SceneObject*>& objects) const = 0;
150 
158  virtual void getIntersections(Math::BoundsAABB const& bounds, std::vector<SceneObject*>& objects) const = 0;
159 
167  virtual void getIntersections(Math::BoundsOBB const& bounds, std::vector<SceneObject*>& objects) const = 0;
168 
172  virtual SceneTreeType getType() const = 0;
173 
177  virtual void setDirty(UUID const& uuid) = 0;
178 
179  protected:
180 
181  std::vector<SceneObject*> m_NewObjects;
182 
183  private:
184  };
185  }
189 }
194 //------------------------------------------------------------------------------------------
195 
196 #endif
virtual void getAllVisibleObjects(Math::Frustum const &frustum, std::vector< SceneObject * > &objects) const =0
virtual void addObjects(std::vector< SceneObject * > const &objects)=0
virtual void destroy()=0
virtual void getAllObjects(std::vector< SceneObject * > &objects) const =0
Definition: Ray.hpp:47
virtual bool removeObject(SceneObject *object)=0
virtual void restructure()=0
Definition: Frustum.hpp:57
Note: Once this library is made dynamic, this will no longer be needed.
Definition: Common.hpp:70
Definition: BoundsOBB.hpp:56
virtual void addObject(SceneObject *object)=0
virtual SceneTreeType getType() const =0
virtual void removeObjects(std::vector< SceneObject * > const &objects)=0
Definition: SceneObject.hpp:93
Definition: UUID.hpp:45
std::vector< SceneObject * > m_NewObjects
Newly added objects that are waiting to be added to the tree.
Definition: ISceneTree.hpp:181
virtual void getIntersections(Math::Ray const &ray, std::vector< SceneObject * > &objects) const =0
virtual void setDirty(UUID const &uuid)=0
Definition: BoundsAABB.hpp:63
Definition: BoundsSphere.hpp:52
Definition: ISceneTree.hpp:51