1
#ifndef __C_SCENE_LOADER_IRR_H_INCLUDED__
2
#define __C_SCENE_LOADER_IRR_H_INCLUDED__
4
#include "ISceneLoader.h"
6
#include "IXMLReader.h"
21
//! Class which can load a scene into the scene manager.
22
class CSceneLoaderIrr : public virtual ISceneLoader
27
CSceneLoaderIrr(ISceneManager *smgr, io::IFileSystem* fs);
30
virtual ~CSceneLoaderIrr();
32
//! Returns true if the class might be able to load this file.
33
virtual bool isALoadableFileExtension(const io::path& filename) const;
35
//! Returns true if the class might be able to load this file.
36
virtual bool isALoadableFileFormat(io::IReadFile *file) const;
38
//! Loads the scene into the scene manager.
39
virtual bool loadScene(io::IReadFile* file, ISceneUserDataSerializer* userDataSerializer=0,
40
ISceneNode* rootNode=0);
44
//! Recursively reads nodes from the xml file
45
void readSceneNode(io::IXMLReader* reader, ISceneNode* parent,
46
ISceneUserDataSerializer* userDataSerializer);
48
//! read a node's materials
49
void readMaterials(io::IXMLReader* reader, ISceneNode* node);
51
//! read a node's animators
52
void readAnimators(io::IXMLReader* reader, ISceneNode* node);
54
//! read any other data into the user serializer
55
void readUserData(io::IXMLReader* reader, ISceneNode* node,
56
ISceneUserDataSerializer* userDataSerializer);
58
ISceneManager *SceneManager;
59
io::IFileSystem *FileSystem;
61
//! constants for reading and writing XML.
62
//! Not made static due to portability problems.
63
// TODO: move to own header
64
const core::stringw IRR_XML_FORMAT_SCENE;
65
const core::stringw IRR_XML_FORMAT_NODE;
66
const core::stringw IRR_XML_FORMAT_NODE_ATTR_TYPE;
67
const core::stringw IRR_XML_FORMAT_ATTRIBUTES;
68
const core::stringw IRR_XML_FORMAT_MATERIALS;
69
const core::stringw IRR_XML_FORMAT_ANIMATORS;
70
const core::stringw IRR_XML_FORMAT_USERDATA;
74
} // end namespace scene
75
} // end namespace irr