loading multiple .irr files?
loading multiple .irr files?
making a multiple level game using different .irr files, how can we do this?
Re: loading multiple .irr files?
Do you mean loading multiple .irr files into one active scene (manager) or having separate levels, each a different .irr file?
If you are wanting to simultaneously load multiple .irr files, I think you can just simply load them in succession.
If you want to treat them as separate level files, then you just need to call the SceneManager's clear function and load the next level.
If you are wanting to simultaneously load multiple .irr files, I think you can just simply load them in succession.
If you want to treat them as separate level files, then you just need to call the SceneManager's clear function and load the next level.
Re: loading multiple .irr files?
having seperate levels, i use thre clear but does that mean everything i had in the scenemanager goes? is there not a way to unload a level only?
Re: loading multiple .irr files?
One thing you could do is load a level where the root node is another node, and simply remove that node if you'd like to keep everything else intact. It would act as a holder of all the level objects.
So: Create an empty scene node position (0,0,0) rotation (0,0,0) scale (1,1,1). Call loadScene and set the parent to be that empty scene node so all objects get loaded as a child of this object. Then if you call SceneManager->queueForRemoval() or emptyNode->remove() or whatever to remove it from the scene, you can keep the rest of the SceneManager objects.
So: Create an empty scene node position (0,0,0) rotation (0,0,0) scale (1,1,1). Call loadScene and set the parent to be that empty scene node so all objects get loaded as a child of this object. Then if you call SceneManager->queueForRemoval() or emptyNode->remove() or whatever to remove it from the scene, you can keep the rest of the SceneManager objects.
Last edited by luthyr on Fri May 10, 2013 7:30 pm, edited 1 time in total.
Re: loading multiple .irr files?
when clearing the scenemgr i get an error?
Re: loading multiple .irr files?
That's not enough info to tell what's going on, but if you remove objects from the scene, you have to be absolutely sure nothing is referencing them still. For instance, you cannot remove objects if they are queued up to draw (which is why QueueForRemoval() is safer). Otherwise, if anything is trying to access those now deleted objects outside of the scene manager, it will crash.
Re: loading multiple .irr files?
It is better to handle the scene clear outside the begin/end calls, it is the best way to be sure you aren't picking something you shouldn't
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt