1 | /**********************************************************************
|
---|
2 | *<
|
---|
3 | oExporter plugin Private Beta (see License.txt)
|
---|
4 |
|
---|
5 | FILE: ogreAnimationCompiler.h
|
---|
6 |
|
---|
7 | DESCRIPTION: OE_XMLScene reader (oe_scene) include header
|
---|
8 |
|
---|
9 | IMPLEMENTED BY: Lioric
|
---|
10 |
|
---|
11 | HISTORY:
|
---|
12 |
|
---|
13 | Original implementation by Lasse Tassing (Channex)
|
---|
14 | 2005 ITE ApS, Lasse Tassing
|
---|
15 |
|
---|
16 | *> Copyright (c) 2005, All Rights Reserved.
|
---|
17 | **********************************************************************/
|
---|
18 |
|
---|
19 |
|
---|
20 | #ifndef __OGRE_XML_SCENE__
|
---|
21 | #define __OGRE_XML_SCENE__
|
---|
22 |
|
---|
23 |
|
---|
24 | #include "Ogre.h"
|
---|
25 | #include "OgreSharedPtr.h"
|
---|
26 | #include "..\TinyXML\tinyxml.h"
|
---|
27 |
|
---|
28 | #include "IOSMSceneCallbacks.h"
|
---|
29 |
|
---|
30 | class TiXmlDocumentPtr : public Ogre::SharedPtr<TiXmlDocument> {
|
---|
31 | public:
|
---|
32 | TiXmlDocumentPtr() : Ogre::SharedPtr<TiXmlDocument>() {}
|
---|
33 | explicit TiXmlDocumentPtr(TiXmlDocument* rep) : Ogre::SharedPtr<TiXmlDocument>(rep) {}
|
---|
34 |
|
---|
35 | };
|
---|
36 |
|
---|
37 | class OSMScene
|
---|
38 | {
|
---|
39 | public:
|
---|
40 |
|
---|
41 | typedef std::vector<Ogre::Camera*> CameraList;
|
---|
42 | typedef std::vector<Ogre::Light*> LightList;
|
---|
43 | typedef std::vector<Ogre::Entity*> EntityList;
|
---|
44 |
|
---|
45 | OSMScene(Ogre::SceneManager* pSceneMgr = 0, Ogre::RenderWindow* win = 0);
|
---|
46 | ~OSMScene(void);
|
---|
47 |
|
---|
48 | // Initialise
|
---|
49 | bool initialise(const char *pszXMLFile, OSMSceneCallbacks* pCallbacks = NULL);
|
---|
50 |
|
---|
51 | // Declare all resources used in the scene
|
---|
52 | void declareResources(void);
|
---|
53 |
|
---|
54 | // Create scene, optionally attaching it to a parent node
|
---|
55 | bool createScene(Ogre::SceneNode *pParent = NULL);
|
---|
56 |
|
---|
57 | // Get list of cameras in this scene
|
---|
58 | CameraList& getCameraList(void);
|
---|
59 |
|
---|
60 | // Get list of lights in this scene
|
---|
61 | LightList& getLightList(void);
|
---|
62 |
|
---|
63 | // Get list of lights in this scene
|
---|
64 | EntityList& getEntityList(void);
|
---|
65 |
|
---|
66 | // Get created scene manager
|
---|
67 | Ogre::SceneManager* getSceneManager(void) { return mSceneMgr; }
|
---|
68 |
|
---|
69 | private:
|
---|
70 | // Create node from information
|
---|
71 | Ogre::SceneNode* createNode(TiXmlElement* pElem, Ogre::SceneNode *pSceneRoot);
|
---|
72 |
|
---|
73 | // Creation helpers
|
---|
74 | void setSceneProperties(TiXmlElement* sceneProp);
|
---|
75 | void createEntities(TiXmlElement* pEntityNode, Ogre::SceneNode *pSceneRoot);
|
---|
76 | void createLights(TiXmlElement* pLightNode, Ogre::SceneNode *pSceneRoot);
|
---|
77 | void createCameras(TiXmlElement* pCameraNode, Ogre::SceneNode *pSceneRoot);
|
---|
78 |
|
---|
79 | // Created objects
|
---|
80 | CameraList mCameras;
|
---|
81 | LightList mLights;
|
---|
82 | EntityList mEntities;
|
---|
83 |
|
---|
84 | // Callback interface
|
---|
85 | OSMSceneCallbacks* mCallbacks;
|
---|
86 |
|
---|
87 | // Scene manager
|
---|
88 | Ogre::SceneManager* mSceneMgr;
|
---|
89 | Ogre::RenderWindow* mWindow;
|
---|
90 |
|
---|
91 | // Scene XML document
|
---|
92 | TiXmlDocumentPtr mXMLDoc;
|
---|
93 | };
|
---|
94 |
|
---|
95 | #endif |
---|