Tactics: Western Philosophers Vs. Musicians  0.12
A turn-based tactical game combining rules and gameplay elements inspired by Final Fantasy Tactics and the Mayfair Exponential Game System. Unlike most games of this type, motion is in full, grid-less 3D.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
OpenSkyNet::Graphics::OgreApp Class Reference

#include <GOgreApp.h>

Inheritance diagram for OpenSkyNet::Graphics::OgreApp:
OpenSkyNet::Graphics::UI OpenSkyNet::CoreDesigner3DViewer::App Tactics3D::App

Public Member Functions

 OgreApp ()
 
virtual ~OgreApp ()
 
Ogre::SceneNode * getSceneNode (const char *name_) const
 
Ogre::SceneManager * getSceneManager () const
 
const Ogre::Camera * getCam () const
 
Ogre::RenderWindow * getWindow () const
 
const std::vector
< Ogre::SceneNode * > & 
getNonPersistentNodes () const
 
virtual bool setup (bool restoreOgreConfig_)
 
virtual void createScene (const char *sceneGraphXML_)
 
Ogre::SceneNode * createSceneNode (const char *name_, bool isPersistent_, Ogre::SceneNode *parent_)
 
virtual void destroyScene (bool doDestroyPersistentData_)
 
virtual void go ()
 
void serializeSceneGraph (const char *sceneGraphXML_)
 

Protected Member Functions

virtual void setupResources ()
 
virtual bool configure (bool restoreOgreConfig_)
 
virtual void chooseSceneManager ()
 
virtual void createCamera ()
 
virtual void createViewports ()
 
virtual void createResourceListener ()
 
virtual void loadResources ()
 
void processSceneGraphXML (TiXmlElement *element_, Ogre::SceneNode *parentSceneNode_)
 
void serialize (TiXmlElement *element_, Ogre::SceneNode *parentSceneNode_)
 

Protected Attributes

Ogre::Root * _root
 
Ogre::Camera * _camera
 
Ogre::SceneManager * _sceneMgr
 
Ogre::RenderWindow * _window
 
std::map< std::string,
Ogre::SceneNode * > 
_namesToSerializableNodes
 
std::vector< Ogre::SceneNode * > _nonPersistentNodes
 
std::map< std::string,
Ogre::Light * > 
_namesToSerializableLights
 
std::vector< Ogre::Light * > _nonPersistentLights
 

Detailed Description

Wraps the Ogre scene manager, cameras, and other basic graphical elements.

Constructor & Destructor Documentation

OpenSkyNet::Graphics::OgreApp::OgreApp ( )
inline
virtual OpenSkyNet::Graphics::OgreApp::~OgreApp ( )
inlinevirtual

Member Function Documentation

void OgreApp::chooseSceneManager ( )
protectedvirtual
bool OgreApp::configure ( bool  restoreOgreConfig_)
protectedvirtual

Configures the application - returns false if the user chooses to abandon configuration.

Reimplemented in Tactics3D::App.

void OgreApp::createCamera ( )
protectedvirtual
virtual void OpenSkyNet::Graphics::OgreApp::createResourceListener ( )
inlineprotectedvirtual

Optional override method where you can create resource listeners (e.g. for loading screens).

void OgreApp::createScene ( const char *  sceneGraphXML_)
virtual

Load application elements from an XML file.

Todo:
Don't hack attenuation
SceneNode * OgreApp::createSceneNode ( const char *  name_,
bool  isPersistent_,
Ogre::SceneNode *  parent_ 
)
void OgreApp::createViewports ( )
protectedvirtual
void OgreApp::destroyScene ( bool  doDestroyPersistentData_)
virtual

Free memory used by application elements.

Reimplemented in OpenSkyNet::Graphics::UI, and OpenSkyNet::CoreDesigner3DViewer::App.

const Ogre::Camera* OpenSkyNet::Graphics::OgreApp::getCam ( ) const
inline
const std::vector<Ogre::SceneNode*>& OpenSkyNet::Graphics::OgreApp::getNonPersistentNodes ( ) const
inline
Ogre::SceneManager* OpenSkyNet::Graphics::OgreApp::getSceneManager ( ) const
inline
Ogre::SceneNode* OpenSkyNet::Graphics::OgreApp::getSceneNode ( const char *  name_) const
inline
Ogre::RenderWindow* OpenSkyNet::Graphics::OgreApp::getWindow ( ) const
inline
virtual void OpenSkyNet::Graphics::OgreApp::go ( )
inlinevirtual
void OgreApp::loadResources ( )
protectedvirtual

Optional override method where you can perform resource group loading. Must at least do ResourceGroupManager::getSingleton().initialiseAllResourceGroups();

void OgreApp::processSceneGraphXML ( TiXmlElement *  element_,
Ogre::SceneNode *  parentSceneNode_ 
)
protected

This method loads SceneGraph.xml. Here's a brief description of the linked schema SceneGraph.xsd: This schema populates the Ogre scene w/ SceneNodes, Lights, and Entities.

<xs:element name="SceneGraph">

A scene may contain an ambient light and any number of point lights.
<xs:element name="Light" minOccurs="0" maxOccurs="unbounded">

Every node may contain any number of subnodes, may contain 
rotation and translation properties, and may have any number 
of entities attached. All nodes must have a name.
<xs:element name="Node">
    <xs:element ref="Node" minOccurs="0" maxOccurs="unbounded" />
    <xs:element name="Property" minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Entity" minOccurs="0" maxOccurs="unbounded">
void OgreApp::serialize ( TiXmlElement *  element_,
Ogre::SceneNode *  parentSceneNode_ 
)
protected
void OgreApp::serializeSceneGraph ( const char *  sceneGraphXML_)

Saves the current state of the scene graph to an XML file.

Parameters
sceneGraphXML_the filename to save
Todo:
allow other light types than ambient and point
bool OgreApp::setup ( bool  restoreOgreConfig_)
virtual

Sets up the application - returns false if the user chooses to abandon configuration.

Reimplemented in OpenSkyNet::Graphics::UI, and OpenSkyNet::CoreDesigner3DViewer::App.

void OgreApp::setupResources ( )
protectedvirtual

Method which will define the source of resources (other than current folder).

Member Data Documentation

Ogre::Camera* OpenSkyNet::Graphics::OgreApp::_camera
protected
std::map<std::string, Ogre::Light*> OpenSkyNet::Graphics::OgreApp::_namesToSerializableLights
protected
std::map<std::string, Ogre::SceneNode*> OpenSkyNet::Graphics::OgreApp::_namesToSerializableNodes
protected
std::vector<Ogre::Light*> OpenSkyNet::Graphics::OgreApp::_nonPersistentLights
protected
std::vector<Ogre::SceneNode*> OpenSkyNet::Graphics::OgreApp::_nonPersistentNodes
protected
Ogre::Root* OpenSkyNet::Graphics::OgreApp::_root
protected
Ogre::SceneManager* OpenSkyNet::Graphics::OgreApp::_sceneMgr
protected
Ogre::RenderWindow* OpenSkyNet::Graphics::OgreApp::_window
protected

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