Index out of bounds when calling renderOneFrame()


12-09-2007 06:53:55

Following is the message I get when running my program against a certain scene.
ogre.renderer.OGRE._ogre_exceptions_.OgreInvalidParametersException: OGRE EXCEPTION(2:): Index out of bounds. in Entity::getSubEntity at ..\src\OgreEntity.cpp (line 299)

Since it roots into the wrapped c++ code, I can only go so far with my python debugger.

I only get this error when loading this one particular scene after another scene. If I load this scene from the start (where there's no sceneNodes or entities at all under the sceneManager) everything is OK. And if I catch this with a try block, the program goes into what seems to be an infinite loop. I'm suspecting there're things that ought to be cleaned from memory from the previous scene but remained but don't know how to locate it.

Does anyone know what might have been wrong? Is there anyway I can diagnose this?


12-09-2007 07:49:31

Ok. I found out what the problem is- I didn't completely kill the skybox from the previous outdoor scene even thoughI called sceneManager.getRootSceneNode().removeAndDestroyAllChildren(), sceneManager.destroyAllEntities() and renderWindow.removeViewport(). And the new scene, an indoor scene, has no skybox. And that seems to give an index out of bound error.

Now I need advice on how completely to destroy the skybox, I tried sceneManager.getSkyNode().removeAndDestroyAllChildren() and sceneManager.getSkyNode() as well as the three methods listed above... they didn't work.


13-09-2007 10:39:49

Maybe try sceneManager.clearScene() ... Managera58