1 | #ifndef _DotLoader_H_ |
---|
2 | #define _DotLoader_H_ |
---|
3 | |
---|
4 | #include "OgreOde_Loader.h" |
---|
5 | |
---|
6 | class TiXmlNode; |
---|
7 | class TiXmlDocument; |
---|
8 | |
---|
9 | namespace OgreOde_Loader |
---|
10 | { |
---|
11 | |
---|
12 | class _OgreOdeExport_Loader DotLoader |
---|
13 | { |
---|
14 | public: |
---|
15 | DotLoader(OgreOde::World * world = 0, OgreOde::Space * space = 0); |
---|
16 | ~DotLoader(){}; |
---|
17 | |
---|
18 | void setWorld(OgreOde::World * world) {_world = world;}; |
---|
19 | void setSpace(OgreOde::Space * space) {_space = space;}; |
---|
20 | |
---|
21 | ObjectList *load(const Ogre::String &filename, const Ogre::StringVector &objects_names, const Ogre::StringVector &instance_names); |
---|
22 | void save(const Ogre::String &filename, const Ogre::StringVector &objects_names, ObjectList *objects); |
---|
23 | |
---|
24 | OgreOde_Prefab::Object *loadObject(const Ogre::String &filename, const Ogre::String &object_name, const Ogre::String &instance_name = Ogre::StringUtil::BLANK); |
---|
25 | void saveObject(const Ogre::String &filename, const Ogre::String &object_name, OgreOde_Prefab::Object *object); |
---|
26 | |
---|
27 | |
---|
28 | private: |
---|
29 | |
---|
30 | void serializeObject(const Ogre::String &filename, const Ogre::String &object_name, OgreOde_Prefab::Object *object); |
---|
31 | void serializeVehicle(const Ogre::String &filename, const Ogre::String &vehicle_name, OgreOde_Prefab::Vehicle *vehicle); |
---|
32 | void serializeRagdoll(const Ogre::String &filename, const Ogre::String &ragdoll_name, OgreOde_Prefab::Ragdoll *ragdoll); |
---|
33 | |
---|
34 | OgreOde_Prefab::Object *parseObject (const TiXmlNode *child, const Ogre::String &object_name, const Ogre::String &instance_name = Ogre::StringUtil::BLANK); |
---|
35 | OgreOde_Prefab::Object *parseCompositeObject (const TiXmlNode *child, const Ogre::String &object_name, const Ogre::String &instance_name = Ogre::StringUtil::BLANK); |
---|
36 | OgreOde_Prefab::Object *parseSingleObject (const TiXmlNode *child, const Ogre::String &object_name, const Ogre::String &instance_name = Ogre::StringUtil::BLANK); |
---|
37 | OgreOde_Prefab::Vehicle *parseVehicle (const TiXmlNode *child, const Ogre::String &vehicle_name, const Ogre::String &instance_name = Ogre::StringUtil::BLANK); |
---|
38 | OgreOde_Prefab::Ragdoll *parseRagdoll (const TiXmlNode *child, const Ogre::String &ragdoll_name, const Ogre::String &instance_name = Ogre::StringUtil::BLANK); |
---|
39 | |
---|
40 | |
---|
41 | |
---|
42 | void parseRagdollSettings(OgreOde_Prefab::Ragdoll::BoneSettings *bone_settings, const void *tag) const; |
---|
43 | |
---|
44 | protected: |
---|
45 | // load and check file |
---|
46 | TiXmlDocument * loadFile(const Ogre::String &filename); |
---|
47 | |
---|
48 | OgreOde::World * _world; |
---|
49 | OgreOde::Space * _space; |
---|
50 | }; |
---|
51 | } |
---|
52 | |
---|
53 | #endif //DotLoader |
---|