UGDK  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
scene3d.h
Go to the documentation of this file.
1 #ifndef UGDK_ACTION_3D_OGRESCENE_H_
2 #define UGDK_ACTION_3D_OGRESCENE_H_
3 
4 #include <ugdk/action/scene.h>
6 #include <unordered_set>
7 #include <forward_list>
8 
9 class btVector3;
10 
11 namespace Ogre {
12 class SceneManager;
13 class Viewport;
14 class Overlay;
15 class OverlaySystem;
16 }
17 
18 namespace ugdk {
19 namespace action {
20 namespace mode3d {
21 
22 class Camera;
23 class Element;
24 
32 class Scene3D : public ugdk::action::Scene {
33 //TODO: this does not allow showing at the same time multiple cameras from the same scene (splitscreen coop for example).
34 public:
35  Scene3D(const btVector3& gravity);
36  virtual ~Scene3D();
37 
39  virtual void OnPushed(int index);
40 
41  void ShowFrameStats();
42  bool IsFrameStatsVisible();
43  void UpdateFrameStats();
44  void HideFrameStats();
45 
47  const std::shared_ptr<Element>& AddElement(const std::string& name="");
49  void DestroyAndRemoveElement(const std::shared_ptr<Element>& element);
50 
51  const std::unique_ptr<Physics>& physics() const {
52  return physics_;
53  }
54  Ogre::SceneManager* manager() const { return scene_mgr_; }
55  Camera* camera() const { return camera_; }
56 
57 protected:
58  Ogre::SceneManager* scene_mgr_;
59  Ogre::OverlaySystem* overlay_system_;
61  int z_order_;
62  Ogre::Viewport* viewport_;
63  Ogre::Overlay* fps_stats_;
64 
65  std::unique_ptr<Physics> physics_;
66  std::unordered_set<std::shared_ptr<Element>> elements_;
67  std::forward_list<std::shared_ptr<Element>> to_be_removed_;
68 
69 }; // class Scene3D.
70 
71 
72 } // namespace 3D
73 } /* namespace action */
74 } /* namespace ugdk */
75 
76 #endif /* UGDK_ACTION_3D_SCENE3D_H_ */
A game scene, or screen.
Definition: scene.h:29
std::unordered_set< std::shared_ptr< Element > > elements_
Definition: scene3d.h:66
Ogre::Viewport * viewport_
Definition: scene3d.h:62
Ogre::SceneManager * manager() const
Definition: scene3d.h:54
Definition: animation.h:11
const std::shared_ptr< Element > & AddElement(const std::string &name="")
Camera * camera_
Definition: scene3d.h:60
std::unique_ptr< Physics > physics_
Definition: scene3d.h:65
int z_order_
Definition: scene3d.h:61
Ogre::OverlaySystem * overlay_system_
Definition: scene3d.h:59
virtual void OnPushed(int index)
Method called when this scene is pushed to the Engine's Scene stack.
Camera * camera() const
Definition: scene3d.h:55
Ogre::SceneManager * scene_mgr_
Definition: scene3d.h:58
Definition: camera.h:19
const std::unique_ptr< Physics > & physics() const
Definition: scene3d.h:51
Ogre::Overlay * fps_stats_
Definition: scene3d.h:63
void DestroyAndRemoveElement(const std::shared_ptr< Element > &element)
std::forward_list< std::shared_ptr< Element > > to_be_removed_
Definition: scene3d.h:67
Definition: camera.h:8
Scene3D(const btVector3 &gravity)
A 3D game scene, or screen.
Definition: scene3d.h:32