Im new in this forum and new to irrlicht ( ....playing since 6 months with this engine )....
Okay, i have written an simple editor, he can add meshes, lights etc, change his properties and moving items with mouse etc. like IrrEdit.
I use my own fileformat to save the scene-data.
All works fine, but when i export my scene into *.irr format per saveScene(...), i have no RootSceneNode (?)
Output in my generated irrfile:
Code: Select all
<?xml version="1.0"?>
<irr_scene>
<attributes>
<string name="Name" value="" />
<int name="Id" value="-1" />
<colorf name="AmbientLight" value="0.000000, 0.000000, 0.000000, 0.000000" />
</attributes>
<node type="">
<attributes>
<string name="Name" value="" />
<int name="Id" value="0815" />
<vector3d name="Position" value="0.000000, 0.000000, 0.000000" />
<vector3d name="Rotation" value="0.000000, 0.000000, 0.000000" />
<vector3d name="Scale" value="1.000000, 1.000000, 1.000000" />
......
Code: Select all
<?xml version="1.0"?>
<irr_scene>
<attributes>
<string name="Name" value="root" />
<int name="Id" value="-1" />
<colorf name="AmbientLight" value="0.000000, 0.000000, 0.000000, 0.000000" />
</attributes>
<node type="mesh">
<attributes>
<string name="Name" value="" />
<int name="Id" value="0815" />
<vector3d name="Position" value="3.333332, 1.666666, -3.333332" />
<vector3d name="Rotation" value="0.000000, 0.000000, 0.000000" />
<vector3d name="Scale" value="1.000000, 1.000000, 1.000000" />
Code: Select all
// test irrfile, save
void CEditorApp::OnExportIrr()
{
CFileDialog fd(FALSE, _T(""), NULL, OFN_FILEMUSTEXIST | OFN_HIDEREADONLY,_T("All Files (*.*)|*.*||"));
if ( fd.DoModal() != IDOK )
{
return;
}
else
{
smgr->saveScene( (CStringA)fd.GetFileName() );
};
}
PS: SceneManager at all are defined in CWinApp like this:
Code: Select all
#include <irrlicht.h>
#pragma comment(lib,"irrext.lib")
using namespace irr;
irr::IrrlichtDevice* device;
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
irr::scene::ICameraSceneNode* camera;