I haven't found tutorials that are concerned about deleting scenenodes and entities. I assume that the scenemanager will take ownership of them when they are attached (am I right?). However, I can imagine many situations where I would like to deterministically and selectively terminate objects, for example if I were to use OGRE to display a huge open-world level, I would like to dynamically load and unload parts of the world. How can I do this while also telling the scenemanager that his pointer is no longer valid?
|
Despite the facts that is not recommended to delete entities and scenenodes yourself, did you take a look at the Ogre SceneManager documention ? In this document you can find the following functions to remove & destroy entities:
And you can find the following function to remove & destroy Scene Nodes:
Anyway don't forget you need to detach entities from the sceneNode first to avoid problems...
Finally I do really recommend you to take a look at the Scene Manager FAQ. This document presents the different ways to manage the scene nodes using BSP, Octree or Portal Connected Zone etc. This is probably better way to achieve what you want to to without having to manage the scene nodes yourself. |
|||||
|
