Hi,
I've modified loadScene adding a ISceneNode* as parameter.
It's useful to create ripetitive scenes.
This is the patch:
https://sourceforge.net/tracker/?func=d ... tid=540679
[PATCH] loadScene and saveScene with parent (loadSubScene)
[PATCH] loadScene and saveScene with parent (loadSubScene)
Last edited by wts on Sat Jan 02, 2010 6:30 pm, edited 2 times in total.
Thanks, I think it's probably a good idea.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
yes, nice idea... 
but there is one thing that's not so good:this changes can break older codes !!!
you should set "ISceneNode* parent=0" as last parameter, so older codes will work without changing the code...
or make a new (overwritten) function...
and another nice addition would be to make the saveScene function similar...
but there is one thing that's not so good:
Code: Select all
- virtual bool loadScene(const io::path& filename, ISceneUserDataSerializer* userDataSerializer=0) = 0;
+ virtual bool loadScene(const io::path& filename, ISceneNode* parent=0, ISceneUserDataSerializer* userDataSerializer=0) = 0;you should set "ISceneNode* parent=0" as last parameter, so older codes will work without changing the code...
or make a new (overwritten) function...
and another nice addition would be to make the saveScene function similar...
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:

http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
I thought it, but watching the doc i notice that ISceneNode*parent is ever the first default parameter, and I think it's more likely that ISceneUserDataSerializer* is passed as NULLAcki wrote:this changes can break older codes !!!
you should set "ISceneNode* parent=0" as last parameter, so older codes will work without changing the code...
Something like this?Acki wrote:or make a new (overwritten) function...
Code: Select all
bool CSceneManager::loadScene(const io::path& filename, ISceneUserDataSerializer* userDataSerializer)
{
return loadScene(filename, 0, userDataSerializer);
}
I'm working on itAcki wrote:and another nice addition would be to make the saveScene function similar...
Hi,
I've modified previous patch:
- readSceneNode now doesn't create a new emptynode
- added functions for backward compatibility
- added saveScene with 'ISceneNode* parent' parameter
Note:
saveScene doesn't use parent's attributes (position, orientation scale, ecc) but root's
Feedback is highly appreciated!
Bye^2
I've modified previous patch:
- readSceneNode now doesn't create a new emptynode
- added functions for backward compatibility
- added saveScene with 'ISceneNode* parent' parameter
Note:
saveScene doesn't use parent's attributes (position, orientation scale, ecc) but root's
Feedback is highly appreciated!
Bye^2