#include <Scene.hpp>
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. | |
SceneNode * | getSceneNode (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. | |
Actor * | getActor (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. | |
Viewport * | getViewport (const std::string &name) |
Get a viewport. | |
bool | createCamera (const std::string &name) |
Create a camera. | |
bool | removeCamera (const std::string &name) |
Remove camera. | |
Camera * | getCamera (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 | |
SceneManager * | m_pManager |
Manager. | |
std::string | m_name |
Name of the scene. | |
Ogre::SceneNode * | m_pRootNode |
Pointer to Ogre root scene node of this scene. | |
GUIManager * | m_pGUIManager |
GUI manager to be used. | |
PhysicsWorld * | m_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 |
It is the internal representation of a scene. A scene consists of 2D GUI(s), 3D objects, lights and cameras.
syBR::Game::Scene::Scene | ( | SceneManager * | pManager, | |
GUIManager * | pGUIManager, | |||
const std::string & | name, | |||
Ogre::SceneNode * | pRootNode | |||
) | [private] |
syBR::Game::Scene::~Scene | ( | ) | [private] |
Destructor.
Release used resources.
void syBR::Game::Scene::update | ( | const float | timeSinceLastUpdate | ) |
Update the scene.
Run physics simulation of the scene and update it
timeSinceLastUpdate | Time since last update in seconds |
const std::string & syBR::Game::Scene::getName | ( | ) | const |
bool syBR::Game::Scene::load | ( | const std::string & | filename | ) |
Load from a file.
filename | Filename of the scene to load |
bool syBR::Game::Scene::createGUI | ( | const std::string & | name, | |
const std::string & | filename, | |||
const GUIManager::RenderPosition | position | |||
) |
Create a 2D GUI.
name | Name of the GUI to create | |
filename | Name of the GUI definition file | |
position | Position of the GUI in the rendering chain |
bool syBR::Game::Scene::removeGUI | ( | const std::string & | name | ) |
Remove a 2D GUI and unload its data.
name | Name of the GUI to remove |
bool syBR::Game::Scene::showGUI | ( | const std::string & | name | ) |
Show a 2D GUI.
name | Name of the GUI to show |
bool syBR::Game::Scene::hideGUI | ( | const std::string & | name | ) |
Hide a 2D GUI.
name | Name of the GUI to hide |
bool syBR::Game::Scene::createSceneNode | ( | const std::string & | name | ) |
Create a scene node.
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) |
bool syBR::Game::Scene::removeSceneNode | ( | const std::string & | name | ) |
Remove a scene node.
name | Name of the scene node to remove |
SceneNode * syBR::Game::Scene::getSceneNode | ( | const std::string & | name | ) |
Get a scene node.
name | Name of the scene node to retrieve |
bool syBR::Game::Scene::createActor | ( | const std::string & | name, | |
const std::string & | model | |||
) |
Create an actor.
name | Name of the actor to create | |
model | Name of the model to use for the actor, empty if none |
bool syBR::Game::Scene::removeActor | ( | const std::string & | name | ) |
Remove an actor.
name | Name of the actor to remove |
Actor * syBR::Game::Scene::getActor | ( | const std::string & | name | ) |
Get an actor.
name | Name of the actor to retrieve |
bool syBR::Game::Scene::createViewport | ( | const std::string & | name, | |
const int | zOrder, | |||
const std::string & | cameraName | |||
) |
Create a viewport.
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 |
bool syBR::Game::Scene::removeViewport | ( | const std::string & | name | ) |
Remove viewport.
name | Name of the viewport to remove |
Viewport * syBR::Game::Scene::getViewport | ( | const std::string & | name | ) |
Get a viewport.
name | Name of the viewport to retrieve |
bool syBR::Game::Scene::createCamera | ( | const std::string & | name | ) |
Create a camera.
name | Name of the camera to create |
bool syBR::Game::Scene::removeCamera | ( | const std::string & | name | ) |
Remove camera.
name | Name of the camera to remove |
Camera * syBR::Game::Scene::getCamera | ( | const std::string & | name | ) |
Get a camera.
name | Name of the camera to retrieve |
friend class SceneManager [friend] |
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.
Copyright © 2008 by Sebastien Frippiat
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License.
Last modified Tue Dec 30 17:57:34 2008