I noticed, that QuickGUI needs to know about the current scene manager. Is it possible to switch to a different scene manager at run time? (haven't tried it yet, but I am going to start using multiple scene managers very soon).
If it is not possible, I would like to file it in as a feature request.
kungfoomasta
08-09-2007 18:04:59
It is supported, however I haven't tested it.
void GUIManager::setSceneManager(Ogre::SceneManager* sm)
{
if(sm == NULL)
return;
// remove listener from previous scene manager
if(mSceneManager != NULL)
mSceneManager->removeRenderQueueListener(this);
// update
mSceneManager = sm;
// add listener to new scene manager
mSceneManager->addRenderQueueListener(this);
}
The reason I need SceneManager is to register the GUIManager as a RenderQueueListener. When you switch SceneManagers, it will just deregister and register with the new scenemanager. Previously I had gotten a SceneManager iterator from root and chosen the first scenemanager I come across, so the user didn't have to make this call.