syBR::Game::Scene Class Reference

Scene class. More...

#include <Scene.hpp>

List of all members.

Public Member Functions

void update (const float timeSinceLastUpdate)
 Update the scene.
const std::string & getName () const
 Get scene name.
bool load (const std::string &filename)
 Load from a file.
bool createGUI (const std::string &name, const std::string &filename, const GUIManager::RenderPosition position)
 Create a 2D GUI.
bool removeGUI (const std::string &name)
 Remove a 2D GUI and unload its data.
bool showGUI (const std::string &name)
 Show a 2D GUI.
bool hideGUI (const std::string &name)
 Hide a 2D GUI.
bool createSceneNode (const std::string &name)
 Create a scene node.
bool removeSceneNode (const std::string &name)
 Remove a scene node.
SceneNodegetSceneNode (const std::string &name)
 Get a scene node.
bool createActor (const std::string &name, const std::string &model)
 Create an actor.
bool removeActor (const std::string &name)
 Remove an actor.
ActorgetActor (const std::string &name)
 Get an actor.
bool createViewport (const std::string &name, const int zOrder, const std::string &cameraName)
 Create a viewport.
bool removeViewport (const std::string &name)
 Remove viewport.
ViewportgetViewport (const std::string &name)
 Get a viewport.
bool createCamera (const std::string &name)
 Create a camera.
bool removeCamera (const std::string &name)
 Remove camera.
CameragetCamera (const std::string &name)
 Get a camera.

Private Member Functions

 Scene (SceneManager *pManager, GUIManager *pGUIManager, const std::string &name, Ogre::SceneNode *pRootNode)
 Constructor.
 ~Scene ()
 Destructor.

Private Attributes

SceneManagerm_pManager
 Manager.
std::string m_name
 Name of the scene.
Ogre::SceneNode * m_pRootNode
 Pointer to Ogre root scene node of this scene.
GUIManagerm_pGUIManager
 GUI manager to be used.
PhysicsWorldm_pPhysicsWorld
 Physics representation of the scene.
Ogre::Entity * m_pWorldEntity
 World entity, if there is one.
std::set< std::string > m_setGUIs
 Created GUIs.
std::map
< std::string,
SceneNode * > 
m_mapSceneNodes
 Created scene nodes.
std::map
< std::string, Actor * > 
m_mapActors
 Created actors.
std::map
< std::string,
Viewport * > 
m_mapViewports
 Created viewports.
std::map
< std::string,
Camera * > 
m_mapCameras
 Created cameras.

Friends

class SceneManager


Detailed Description

Scene class.

It is the internal representation of a scene. A scene consists of 2D GUI(s), 3D objects, lights and cameras.


Constructor & Destructor Documentation

syBR::Game::Scene::Scene ( SceneManager pManager,
GUIManager pGUIManager,
const std::string &  name,
Ogre::SceneNode *  pRootNode 
) [private]

Constructor.

Parameters:
pManager Scene manager responsible of this scene
pGUIManager GUI manager to be used by this scene
name Name of the scene
pRootNode Ogre node to be used as the root node of this scene
If pGUIManager is NULL then all GUI operations are disabled.

syBR::Game::Scene::~Scene (  )  [private]

Destructor.

Release used resources.


Member Function Documentation

void syBR::Game::Scene::update ( const float  timeSinceLastUpdate  ) 

Update the scene.

Run physics simulation of the scene and update it

Parameters:
timeSinceLastUpdate Time since last update in seconds

const std::string & syBR::Game::Scene::getName (  )  const

Get scene name.

Returns:
Scene name

bool syBR::Game::Scene::load ( const std::string &  filename  ) 

Load from a file.

Parameters:
filename Filename of the scene to load
Returns:
One of these:
  • true in case of success
  • false otherwise

bool syBR::Game::Scene::createGUI ( const std::string &  name,
const std::string &  filename,
const GUIManager::RenderPosition  position 
)

Create a 2D GUI.

Parameters:
name Name of the GUI to create
filename Name of the GUI definition file
position Position of the GUI in the rendering chain
Returns:
One of these:
  • true in case of success
  • false otherwise

bool syBR::Game::Scene::removeGUI ( const std::string &  name  ) 

Remove a 2D GUI and unload its data.

Parameters:
name Name of the GUI to remove
Returns:
One of these:
  • true in case of success
  • false otherwise

bool syBR::Game::Scene::showGUI ( const std::string &  name  ) 

Show a 2D GUI.

Parameters:
name Name of the GUI to show
Returns:
One of these:
  • true in case of success
  • false otherwise

bool syBR::Game::Scene::hideGUI ( const std::string &  name  ) 

Hide a 2D GUI.

Parameters:
name Name of the GUI to hide
Returns:
One of these:
  • true in case of success
  • false otherwise

bool syBR::Game::Scene::createSceneNode ( const std::string &  name  ) 

Create a scene node.

Parameters:
name Name of the scene node to create, it must be unique within the scene (two nodes of the same scene cannot have the same name)
Returns:
One of these:
  • true in case of success
  • false otherwise

bool syBR::Game::Scene::removeSceneNode ( const std::string &  name  ) 

Remove a scene node.

Parameters:
name Name of the scene node to remove
Returns:
One of these:
  • true in case of success
  • false otherwise

SceneNode * syBR::Game::Scene::getSceneNode ( const std::string &  name  ) 

Get a scene node.

Parameters:
name Name of the scene node to retrieve
Returns:
One of these:
  • Pointer to the requested scene node if it exists
  • NULL otherwise

bool syBR::Game::Scene::createActor ( const std::string &  name,
const std::string &  model 
)

Create an actor.

Parameters:
name Name of the actor to create
model Name of the model to use for the actor, empty if none
Returns:
One of these:
  • true in case of success
  • false otherwise

bool syBR::Game::Scene::removeActor ( const std::string &  name  ) 

Remove an actor.

Parameters:
name Name of the actor to remove
Returns:
One of these:
  • true in case of success
  • false otherwise

Actor * syBR::Game::Scene::getActor ( const std::string &  name  ) 

Get an actor.

Parameters:
name Name of the actor to retrieve
Returns:
One of these:
  • Pointer to the requested actor if it exists
  • NULL otherwise

bool syBR::Game::Scene::createViewport ( const std::string &  name,
const int  zOrder,
const std::string &  cameraName 
)

Create a viewport.

Parameters:
name Name of the viewport to create
zOrder Z-order of the viewport, viewport with the lowest z-order will be rendered in front of the others
cameraName Name of the camera to be initially used to render to the viewport
Returns:
One of these:
  • true in case of success
  • false otherwise

bool syBR::Game::Scene::removeViewport ( const std::string &  name  ) 

Remove viewport.

Parameters:
name Name of the viewport to remove
Returns:
One of these:
  • true in case of success
  • false otherwise

Viewport * syBR::Game::Scene::getViewport ( const std::string &  name  ) 

Get a viewport.

Parameters:
name Name of the viewport to retrieve
Returns:
One of these:
  • Pointer to the requested viewport if it exists
  • NULL otherwise

bool syBR::Game::Scene::createCamera ( const std::string &  name  ) 

Create a camera.

Parameters:
name Name of the camera to create
Returns:
One of these:
  • true in case of success
  • false otherwise

bool syBR::Game::Scene::removeCamera ( const std::string &  name  ) 

Remove camera.

Parameters:
name Name of the camera to remove
Returns:
One of these:
  • true in case of success
  • false otherwise

Camera * syBR::Game::Scene::getCamera ( const std::string &  name  ) 

Get a camera.

Parameters:
name Name of the camera to retrieve
Returns:
One of these:
  • Pointer to the requested camera if it exists
  • NULL otherwise


Friends And Related Function Documentation

friend class SceneManager [friend]


Member Data Documentation

SceneManager* syBR::Game::Scene::m_pManager [private]

Manager.

std::string syBR::Game::Scene::m_name [private]

Name of the scene.

Ogre::SceneNode* syBR::Game::Scene::m_pRootNode [private]

Pointer to Ogre root scene node of this scene.

GUIManager* syBR::Game::Scene::m_pGUIManager [private]

GUI manager to be used.

PhysicsWorld* syBR::Game::Scene::m_pPhysicsWorld [private]

Physics representation of the scene.

Ogre::Entity* syBR::Game::Scene::m_pWorldEntity [private]

World entity, if there is one.

std::set<std::string> syBR::Game::Scene::m_setGUIs [private]

Created GUIs.

std::map<std::string, SceneNode *> syBR::Game::Scene::m_mapSceneNodes [private]

Created scene nodes.

std::map<std::string, Actor *> syBR::Game::Scene::m_mapActors [private]

Created actors.

std::map<std::string, Viewport *> syBR::Game::Scene::m_mapViewports [private]

Created viewports.

std::map<std::string, Camera *> syBR::Game::Scene::m_mapCameras [private]

Created cameras.


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

Copyright © 2008 by Sebastien Frippiat
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License.
Last modified Tue Dec 30 17:57:34 2008