RapidXML Dotscene Loader
This is going to be it's support forum topic.


Better memory allocation, less bugs, etc. => rapidXML is much more "production ready".RapidXML is very similar to TinyXML in use, but it's only a single header - and thus extremely lightweight.




Er, what dotscene format?soravis wrote:Hi! I'm learning ogre now; and sadly recognized, that there is a big mess around this dotScene format.

Code: Select all
void TestAug25No2::createScene(void)
{
Ogre::Entity* ogreHead = mSceneMgr->createEntity("Head", "ogrehead.mesh");
Ogre::SceneNode* headNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
headNode->attachObject(ogreHead);
// Set ambient light
mSceneMgr->setAmbientLight(Ogre::ColourValue(0.5, 0.5, 0.5));
// Create a light
Ogre::Light* l = mSceneMgr->createLight("MainLight");
l->setPosition(20,80,50);
[i]Ogre::DotSceneLoader loader;
loader.parseDotScene("SampleScene2.xml","General", mSceneMgr);[/i]}Code: Select all
1>------ Build started: Project: TestAug25No2, Configuration: Debug Win32 ------
1>Compiling...
1>TestAug25No2.cpp
1>g:\documents and settings\david\my documents\visual studio 2008\projects\testaug25no2\testaug25no2\src\testaug25no2.cpp(48) : error C2039: 'DotSceneLoader' : is not a member of 'Ogre'
1>Build log was saved at "file://g:\Documents and Settings\David\My Documents\Visual Studio 2008\Projects\TestAug25No2\TestAug25No2\obj\Debug\BuildLog.htm"
1>TestAug25No2 - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========]Yes.Whitebear wrote:Have you added the line:
#include "thefile.h" (where thefile.h - is the name of the header file of DotSceneLoader class - I don't know its exact name) in the beginning of your TestAug25No2.cpp file?
Code: Select all
/*
-----------------------------------------------------------------------------
Filename: TestAug25No2.cpp
-----------------------------------------------------------------------------
This source file is generated by the
___ _ __ __ _ _
/___\__ _ _ __ ___ /_\ _ __ _ __/ / /\ \ (_)______ _ _ __ __| |
// // _` | '__/ _ \ //_\\| '_ \| '_ \ \/ \/ / |_ / _` | '__/ _` |
/ \_// (_| | | | __/ / _ \ |_) | |_) \ /\ /| |/ / (_| | | | (_| |
\___/ \__, |_| \___| \_/ \_/ .__/| .__/ \/ \/ |_/___\__,_|_| \__,_|
|___/ |_| |_|
Ogre 1.7.x Application Wizard for VC9 (June 2010)
http://code.google.com/p/ogreappwizards/
-----------------------------------------------------------------------------
*/
#include "TestAug25No2.h"
#include "G:\Documents and Settings\David\My Documents\Visual Studio 2008\Projects\TestAug25No2\TestAug25No2\DotSceneLoader.h"
//-------------------------------------------------------------------------------------
TestAug25No2::TestAug25No2(void)
{
}
//-------------------------------------------------------------------------------------
TestAug25No2::~TestAug25No2(void)
{
}
//-------------------------------------------------------------------------------------
void TestAug25No2::createScene(void)
{
Ogre::Entity* ogreHead = mSceneMgr->createEntity("Head", "ogrehead.mesh");
Ogre::SceneNode* headNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
headNode->attachObject(ogreHead);
// Set ambient light
mSceneMgr->setAmbientLight(Ogre::ColourValue(0.5, 0.5, 0.5));
// Create a light
Ogre::Light* l = mSceneMgr->createLight("MainLight");
l->setPosition(20,80,50);
Ogre::DotSceneLoader loader;
loader.parseDotScene("SampleScene2.xml","General", mSceneMgr);
}
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
#define WIN32_LEAN_AND_MEAN
#include "windows.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
#else
int main(int argc, char *argv[])
#endif
{
// Create application object
TestAug25No2 app;
try {
app.go();
} catch( Ogre::Exception& e ) {
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
#else
std::cerr << "An exception has occured: " <<
e.getFullDescription().c_str() << std::endl;
#endif
}
return 0;
}
#ifdef __cplusplus
}
#endif
Removing the OGRE:: allows the code to compile but then there are linking errors in reference to the Terrain:MaTTze wrote:DotSceneLoader is not part of the Ogre namespace, so just delete the "Ogre::" in front of DotSceneLoader and it should work.
Seems to be wrong in the wiki.
MaTTze
Code: Select all
1>------ Build started: Project: TestAug25No2, Configuration: Debug Win32 ------
1>Linking...
1>DotSceneLoader.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall Ogre::TerrainGlobalOptions::TerrainGlobalOptions(void)" (__imp_??0TerrainGlobalOptions@Ogre@@QAE@XZ) referenced in function "public: __thiscall DotSceneLoader::DotSceneLoader(void)" (??0DotSceneLoader@@QAE@XZ)
1>DotSceneLoader.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall Ogre::TerrainGlobalOptions::~TerrainGlobalOptions(void)" (__imp_??1TerrainGlobalOptions@Ogre@@UAE@XZ) referenced in function "public: virtual void * __thiscall Ogre::TerrainGlobalOptions::`scalar deleting destructor'(unsigned int)" (??_GTerrainGlobalOptions@Ogre@@UAEPAXI@Z)
1>DotSceneLoader.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall Ogre::TerrainGroup::freeTemporaryResources(void)" (__imp_?freeTemporaryResources@TerrainGroup@Ogre@@QAEXXZ) referenced in function "protected: void __thiscall DotSceneLoader::processTerrain(class rapidxml::xml_node<char> *)" (?processTerrain@DotSceneLoader@@IAEXPAV?$xml_node@D@rapidxml@@@Z)
1>DotSceneLoader.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall Ogre::TerrainGroup::setResourceGroup(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_?setResourceGroup@TerrainGroup@Ogre@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "protected: void __thiscall DotSceneLoader::processTerrain(class rapidxml::xml_node<char> *)" (?processTerrain@DotSceneLoader@@IAEXPAV?$xml_node@D@rapidxml@@@Z)
1>DotSceneLoader.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall Ogre::TerrainGroup::TerrainGroup(class Ogre::SceneManager *,enum Ogre::Terrain::Alignment,unsigned short,float)" (__imp_??0TerrainGroup@Ogre@@QAE@PAVSceneManager@1@W4Alignment@Terrain@1@GM@Z) referenced in function "protected: void __thiscall DotSceneLoader::processTerrain(class rapidxml::xml_node<char> *)" (?processTerrain@DotSceneLoader@@IAEXPAV?$xml_node@D@rapidxml@@@Z)
1>DotSceneLoader.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall Ogre::TerrainGlobalOptions::setCompositeMapDiffuse(class Ogre::ColourValue const &)" (__imp_?setCompositeMapDiffuse@TerrainGlobalOptions@Ogre@@QAEXABVColourValue@2@@Z) referenced in function "protected: void __thiscall DotSceneLoader::processTerrain(class rapidxml::xml_node<char> *)" (?processTerrain@DotSceneLoader@@IAEXPAV?$xml_node@D@rapidxml@@@Z)
1>DotSceneLoader.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall Ogre::TerrainGlobalOptions::setCompositeMapAmbient(class Ogre::ColourValue const &)" (__imp_?setCompositeMapAmbient@TerrainGlobalOptions@Ogre@@QAEXABVColourValue@2@@Z) referenced in function "protected: void __thiscall DotSceneLoader::processTerrain(class rapidxml::xml_node<char> *)" (?processTerrain@DotSceneLoader@@IAEXPAV?$xml_node@D@rapidxml@@@Z)
1>DotSceneLoader.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall Ogre::TerrainGlobalOptions::setLightMapDirection(class Ogre::Vector3 const &)" (__imp_?setLightMapDirection@TerrainGlobalOptions@Ogre@@QAEXABVVector3@2@@Z) referenced in function "protected: void __thiscall DotSceneLoader::processTerrain(class rapidxml::xml_node<char> *)" (?processTerrain@DotSceneLoader@@IAEXPAV?$xml_node@D@rapidxml@@@Z)
1>DotSceneLoader.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall Ogre::TerrainGlobalOptions::setCompositeMapDistance(float)" (__imp_?setCompositeMapDistance@TerrainGlobalOptions@Ogre@@QAEXM@Z) referenced in function "protected: void __thiscall DotSceneLoader::processTerrain(class rapidxml::xml_node<char> *)" (?processTerrain@DotSceneLoader@@IAEXPAV?$xml_node@D@rapidxml@@@Z)
1>DotSceneLoader.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall Ogre::TerrainGlobalOptions::setMaxPixelError(float)" (__imp_?setMaxPixelError@TerrainGlobalOptions@Ogre@@QAEXM@Z) referenced in function "protected: void __thiscall DotSceneLoader::processTerrain(class rapidxml::xml_node<char> *)" (?processTerrain@DotSceneLoader@@IAEXPAV?$xml_node@D@rapidxml@@@Z)
1>DotSceneLoader.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall Ogre::TerrainGroup::canHandleRequest(class Ogre::WorkQueue::Request const *,class Ogre::WorkQueue const *)" (?canHandleRequest@TerrainGroup@Ogre@@UAE_NPBVRequest@WorkQueue@2@PBV42@@Z)
1>DotSceneLoader.obj : error LNK2001: unresolved external symbol "public: virtual struct Ogre::WorkQueue::Response * __thiscall Ogre::TerrainGroup::handleRequest(class Ogre::WorkQueue::Request const *,class Ogre::WorkQueue const *)" (?handleRequest@TerrainGroup@Ogre@@UAEPAUResponse@WorkQueue@2@PBVRequest@42@PBV42@@Z)
1>DotSceneLoader.obj : error LNK2001: unresolved external symbol "public: virtual struct Ogre::Terrain::ImportData & __thiscall Ogre::TerrainGroup::getDefaultImportSettings(void)" (?getDefaultImportSettings@TerrainGroup@Ogre@@UAEAAUImportData@Terrain@2@XZ)
1>DotSceneLoader.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Ogre::TerrainGroup::setOrigin(class Ogre::Vector3 const &)" (?setOrigin@TerrainGroup@Ogre@@UAEXABVVector3@2@@Z)
1>DotSceneLoader.obj : error LNK2001: unresolved external symbol "public: virtual class Ogre::Vector3 const & __thiscall Ogre::TerrainGroup::getOrigin(void)const " (?getOrigin@TerrainGroup@Ogre@@UBEABVVector3@2@XZ)
1>DotSceneLoader.obj : error LNK2001: unresolved external symbol "public: virtual enum Ogre::Terrain::Alignment __thiscall Ogre::TerrainGroup::getAlignment(void)const " (?getAlignment@TerrainGroup@Ogre@@UBE?AW4Alignment@Terrain@2@XZ)
1>DotSceneLoader.obj : error LNK2001: unresolved external symbol "public: virtual float __thiscall Ogre::TerrainGroup::getTerrainWorldSize(void)const " (?getTerrainWorldSize@TerrainGroup@Ogre@@UBEMXZ)
1>DotSceneLoader.obj : error LNK2001: unresolved external symbol "public: virtual class Ogre::SceneManager * __thiscall Ogre::TerrainGroup::getSceneManager(void)const " (?getSceneManager@TerrainGroup@Ogre@@UBEPAVSceneManager@2@XZ)
1>DotSceneLoader.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Ogre::TerrainGroup::defineTerrain(long,long,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?defineTerrain@TerrainGroup@Ogre@@UAEXJJABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>DotSceneLoader.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Ogre::TerrainGroup::defineTerrain(long,long,float const *,class std::vector<struct Ogre::Terrain::LayerInstance,class Ogre::STLAllocator<struct Ogre::Terrain::LayerInstance,class Ogre::CategorisedAllocPolicy<0> > > const *)" (?defineTerrain@TerrainGroup@Ogre@@UAEXJJPBMPBV?$vector@ULayerInstance@Terrain@Ogre@@V?$STLAllocator@ULayerInstance@Terrain@Ogre@@V?$CategorisedAllocPolicy@$0A@@3@@3@@std@@@Z)
1>DotSceneLoader.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Ogre::TerrainGroup::defineTerrain(long,long,class Ogre::Image const *,class std::vector<struct Ogre::Terrain::LayerInstance,class Ogre::STLAllocator<struct Ogre::Terrain::LayerInstance,class Ogre::CategorisedAllocPolicy<0> > > const *)" (?defineTerrain@TerrainGroup@Ogre@@UAEXJJPBVImage@2@PBV?$vector@ULayerInstance@Terrain@Ogre@@V?$STLAllocator@ULayerInstance@Terrain@Ogre@@V?$CategorisedAllocPolicy@$0A@@3@@3@@std@@@Z)
1>DotSceneLoader.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Ogre::TerrainGroup::defineTerrain(long,long,struct Ogre::Terrain::ImportData const *)" (?defineTerrain@TerrainGroup@Ogre@@UAEXJJPBUImportData@Terrain@2@@Z)
1>DotSceneLoader.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Ogre::TerrainGroup::defineTerrain(long,long,float)" (?defineTerrain@TerrainGroup@Ogre@@UAEXJJM@Z)
1>DotSceneLoader.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Ogre::TerrainGroup::defineTerrain(long,long)" (?defineTerrain@TerrainGroup@Ogre@@UAEXJJ@Z)
1>DotSceneLoader.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Ogre::TerrainGroup::loadAllTerrains(bool)" (?loadAllTerrains@TerrainGroup@Ogre@@UAEX_N@Z)
1>DotSceneLoader.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Ogre::TerrainGroup::loadTerrain(long,long,bool)" (?loadTerrain@TerrainGroup@Ogre@@UAEXJJ_N@Z)
1>DotSceneLoader.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Ogre::TerrainGroup::unloadTerrain(long,long)" (?unloadTerrain@TerrainGroup@Ogre@@UAEXJJ@Z)
1>DotSceneLoader.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Ogre::TerrainGroup::removeTerrain(long,long)" (?removeTerrain@TerrainGroup@Ogre@@UAEXJJ@Z)
1>DotSceneLoader.obj : error LNK2001: unresolved external symbol "public: virtual struct Ogre::TerrainGroup::TerrainSlotDefinition * __thiscall Ogre::TerrainGroup::getTerrainDefinition(long,long)const " (?getTerrainDefinition@TerrainGroup@Ogre@@UBEPAUTerrainSlotDefinition@12@JJ@Z)
1>DotSceneLoader.obj : error LNK2001: unresolved external symbol "public: virtual class Ogre::Terrain * __thiscall Ogre::TerrainGroup::getTerrain(long,long)const " (?getTerrain@TerrainGroup@Ogre@@UBEPAVTerrain@2@JJ@Z)
1>DotSceneLoader.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall Ogre::TerrainGroup::canHandleResponse(struct Ogre::WorkQueue::Response const *,class Ogre::WorkQueue const *)" (?canHandleResponse@TerrainGroup@Ogre@@UAE_NPBUResponse@WorkQueue@2@PBV42@@Z)
1>DotSceneLoader.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Ogre::TerrainGroup::handleResponse(struct Ogre::WorkQueue::Response const *,class Ogre::WorkQueue const *)" (?handleResponse@TerrainGroup@Ogre@@UAEXPBUResponse@WorkQueue@2@PBV42@@Z)
1>DotSceneLoader.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall Ogre::TerrainGroup::~TerrainGroup(void)" (__imp_??1TerrainGroup@Ogre@@UAE@XZ) referenced in function "public: virtual void * __thiscall Ogre::TerrainGroup::`scalar deleting destructor'(unsigned int)" (??_GTerrainGroup@Ogre@@UAEPAXI@Z)
1>DotSceneLoader.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const & __thiscall Ogre::TerrainGroup::getResourceGroup(void)const " (__imp_?getResourceGroup@TerrainGroup@Ogre@@QBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) referenced in function "protected: void __thiscall DotSceneLoader::processTerrainPage(class rapidxml::xml_node<char> *)" (?processTerrainPage@DotSceneLoader@@IAEXPAV?$xml_node@D@rapidxml@@@Z)
1>bin\Debug\TestAug25No2.exe : fatal error LNK1120: 34 unresolved externals
1>Build log was saved at "file://g:\Documents and Settings\David\My Documents\Visual Studio 2008\Projects\TestAug25No2\TestAug25No2\obj\Debug\BuildLog.htm"
1>TestAug25No2 - 35 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Thanks, that sorted that out. (Don't have the release version though, so didn't add OgreTerrain.lib)MaTTze wrote:Is OgreTerrain.lib/OgreTerrain_d.lib added to the additional Dependencies?
MaTTze
Code: Select all
Ogre::DotSceneLoader loader;
loader.parseDotScene("SampleScene2.xml","General", mSceneMgr);Code: Select all
Ogre::TerrainGroup* takeTerrainGroup() { mWeOwnTerrainGroup = false; return mTerrainGroup; }Thanks!
Do you know why the DotSceneLoader does this?it will kill the terrain because the DotSceneLoader maintains an instance of the Ogre::TerrainGroup which it deletes upon destruction...
Ogitor 0.4.2 has a Dotscene exporter. Under File: Export=>DotScene Serializer.peacemaker wrote:Hmmm, I feel like I'm missing some vital information here...
I feel like this process (of getting Ogitor scenes into Ogre) should be a lot simpler so perhaps I'm missing something??
No idea why this design decision was made.Rhynedahll wrote:Do you know why the DotSceneLoader does this?
