UGDK  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ugdk::action::mode3d::Scene3D Class Reference

A 3D game scene, or screen. More...

#include <ugdk/action/3D/scene3d.h>

Inheritance diagram for ugdk::action::mode3d::Scene3D:
Collaboration diagram for ugdk::action::mode3d::Scene3D:

Public Member Functions

 Scene3D (const btVector3 &gravity)
 
virtual ~Scene3D ()
 
virtual void OnPushed (int index)
 Method called when this scene is pushed to the Engine's Scene stack. More...
 
void ShowFrameStats ()
 
bool IsFrameStatsVisible ()
 
void UpdateFrameStats ()
 
void HideFrameStats ()
 
const std::shared_ptr< Element > & AddElement (const std::string &name="")
 
void DestroyAndRemoveElement (const std::shared_ptr< Element > &element)
 
const std::unique_ptr< Physics > & physics () const
 
Ogre::SceneManager * manager () const
 
Cameracamera () const
 
- Public Member Functions inherited from ugdk::action::Scene
 Scene ()
 
virtual ~Scene ()
 
virtual void Focus ()
 Method called when this Scene arrives on the top of the Scene stack. More...
 
virtual void DeFocus ()
 Method called when this Scene leaves the top of the Scene stack. More...
 
void Finish ()
 Finishes the scene. More...
 
void StopsPreviousMusic (bool set)
 Whether this scene stops the previous music even if wont play any music. More...
 
void Update (double delta_t)
 Logical update of the scene. More...
 
void Render (graphic::Canvas &) const
 Renders the scene to the given canvas if the scene is visible. More...
 
void set_render_function (const std::function< void(graphic::Canvas &canvas)> &render_function)
 
const std::string & identifier () const
 
void set_identifier (const std::string &new_identifier)
 
bool finished () const
 
bool active () const
 
void set_active (bool is_active)
 
bool visible () const
 
void set_visible (bool is_visible)
 
MediaManagermedia_manager ()
 
const MediaManagermedia_manager () const
 
system::EventHandlerevent_handler ()
 
const system::EventHandlerevent_handler () const
 
audio::Musicbackground_music () const
 
void set_background_music (audio::Music *music)
 
- Public Member Functions inherited from ugdk::system::TaskPlayer
 TaskPlayer ()
 
virtual ~TaskPlayer ()
 
void AddTask (const Task &task)
 Adds a task to the scene. More...
 
void Update (double delta_t)
 Executes all tasks held. More...
 

Protected Attributes

Ogre::SceneManager * scene_mgr_
 
Ogre::OverlaySystem * overlay_system_
 
Cameracamera_
 
int z_order_
 
Ogre::Viewport * viewport_
 
Ogre::Overlay * fps_stats_
 
std::unique_ptr< Physicsphysics_
 
std::unordered_set
< std::shared_ptr< Element > > 
elements_
 
std::forward_list
< std::shared_ptr< Element > > 
to_be_removed_
 

Additional Inherited Members

- Protected Member Functions inherited from ugdk::action::Scene
virtual void End ()
 Ends the scene activity. More...
 

Detailed Description

A 3D game scene, or screen.

Represents a Ogre 3D scene, which contains a tree of nodes (entities) to render, the associated camera and viewport, and Physics manager object.

Constructor & Destructor Documentation

ugdk::action::mode3d::Scene3D::Scene3D ( const btVector3 &  gravity)
virtual ugdk::action::mode3d::Scene3D::~Scene3D ( )
virtual

Member Function Documentation

const std::shared_ptr<Element>& ugdk::action::mode3d::Scene3D::AddElement ( const std::string &  name = "")

Creates and returns a new Element in this scene.

Camera* ugdk::action::mode3d::Scene3D::camera ( ) const
inline
void ugdk::action::mode3d::Scene3D::DestroyAndRemoveElement ( const std::shared_ptr< Element > &  element)

Marks an element to be destroyed and removed from this scene at the end of the frame.

void ugdk::action::mode3d::Scene3D::HideFrameStats ( )
bool ugdk::action::mode3d::Scene3D::IsFrameStatsVisible ( )
Ogre::SceneManager* ugdk::action::mode3d::Scene3D::manager ( ) const
inline
virtual void ugdk::action::mode3d::Scene3D::OnPushed ( int  index)
virtual

Method called when this scene is pushed to the Engine's Scene stack.

Reimplemented from ugdk::action::Scene.

const std::unique_ptr<Physics>& ugdk::action::mode3d::Scene3D::physics ( ) const
inline
void ugdk::action::mode3d::Scene3D::ShowFrameStats ( )
void ugdk::action::mode3d::Scene3D::UpdateFrameStats ( )

Member Data Documentation

Camera* ugdk::action::mode3d::Scene3D::camera_
protected
std::unordered_set<std::shared_ptr<Element> > ugdk::action::mode3d::Scene3D::elements_
protected
Ogre::Overlay* ugdk::action::mode3d::Scene3D::fps_stats_
protected
Ogre::OverlaySystem* ugdk::action::mode3d::Scene3D::overlay_system_
protected
std::unique_ptr<Physics> ugdk::action::mode3d::Scene3D::physics_
protected
Ogre::SceneManager* ugdk::action::mode3d::Scene3D::scene_mgr_
protected
std::forward_list<std::shared_ptr<Element> > ugdk::action::mode3d::Scene3D::to_be_removed_
protected
Ogre::Viewport* ugdk::action::mode3d::Scene3D::viewport_
protected
int ugdk::action::mode3d::Scene3D::z_order_
protected

The documentation for this class was generated from the following file: