-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDotSceneLoader.h
98 lines (80 loc) · 3.34 KB
/
DotSceneLoader.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*
* OpenHMD - Free and Open Source API and drivers for immersive technology.
* Copyright (C) 2013 Fredrik Hultin.
* Copyright (C) 2013 Jakob Bornecrantz.
* OpenHMDDemo is designed and written by Joey Ferwerda from Thorworks game development studio.
* Dotsceneloader contributed by the Ogre community
* Distributed under the Boost 1.0 licence, see LICENSE for full text.
*/
#ifndef DOT_SCENELOADER_H
#define DOT_SCENELOADER_H
// Includes
#include <OgreString.h>
#include <OgreVector3.h>
#include <OgreQuaternion.h>
#include <vector>
// Forward declarations
class TiXmlElement;
namespace Ogre
{
// Forward declarations
class SceneManager;
class SceneNode;
class nodeProperty
{
public:
String nodeName;
String propertyNm;
String valueName;
String typeName;
nodeProperty(const String &node, const String &propertyName, const String &value, const String &type)
: nodeName(node), propertyNm(propertyName), valueName(value), typeName(type) {}
};
class DotSceneLoader
{
public:
DotSceneLoader() : mSceneMgr(0) {}
virtual ~DotSceneLoader() {}
void parseDotScene(const String &SceneName, const String &groupName, SceneManager *yourSceneMgr, SceneNode *pAttachNode = NULL, const String &sPrependNode = "");
String getProperty(const String &ndNm, const String &prop);
std::vector<nodeProperty> nodeProperties;
std::vector<String> staticObjects;
std::vector<String> dynamicObjects;
protected:
void processScene(TiXmlElement *XMLRoot);
void processNodes(TiXmlElement *XMLNode);
void processExternals(TiXmlElement *XMLNode);
void processEnvironment(TiXmlElement *XMLNode);
void processTerrain(TiXmlElement *XMLNode);
void processUserDataReference(TiXmlElement *XMLNode, SceneNode *pParent = 0);
void processUserDataReference(TiXmlElement *XMLNode, Entity *pEntity);
void processOctree(TiXmlElement *XMLNode);
void processLight(TiXmlElement *XMLNode, SceneNode *pParent = 0);
void processCamera(TiXmlElement *XMLNode, SceneNode *pParent = 0);
void processNode(TiXmlElement *XMLNode, SceneNode *pParent = 0);
void processLookTarget(TiXmlElement *XMLNode, SceneNode *pParent);
void processTrackTarget(TiXmlElement *XMLNode, SceneNode *pParent);
void processEntity(TiXmlElement *XMLNode, SceneNode *pParent);
void processParticleSystem(TiXmlElement *XMLNode, SceneNode *pParent);
void processBillboardSet(TiXmlElement *XMLNode, SceneNode *pParent);
void processPlane(TiXmlElement *XMLNode, SceneNode *pParent);
void processFog(TiXmlElement *XMLNode);
void processSkyBox(TiXmlElement *XMLNode);
void processSkyDome(TiXmlElement *XMLNode);
void processSkyPlane(TiXmlElement *XMLNode);
void processClipping(TiXmlElement *XMLNode);
void processLightRange(TiXmlElement *XMLNode, Light *pLight);
void processLightAttenuation(TiXmlElement *XMLNode, Light *pLight);
String getAttrib(TiXmlElement *XMLNode, const String ¶meter, const String &defaultValue = "");
Real getAttribReal(TiXmlElement *XMLNode, const String ¶meter, Real defaultValue = 0);
bool getAttribBool(TiXmlElement *XMLNode, const String ¶meter, bool defaultValue = false);
Vector3 parseVector3(TiXmlElement *XMLNode);
Quaternion parseQuaternion(TiXmlElement *XMLNode);
ColourValue parseColour(TiXmlElement *XMLNode);
SceneManager *mSceneMgr;
SceneNode *mAttachNode;
String m_sGroupName;
String m_sPrependNode;
};
}
#endif // DOT_SCENELOADER_H