Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

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.

share|improve this answer
    
If not managing by myself, then what is the preferred way to efficiently load and maintain very big scenes (i.e. open world-type scenes)? –  Tamás Szelei Mar 1 '12 at 11:57
    
Octree scene manager could probably fits your needs. The Scene Manager FAQ (introduced at the bottom of my answer) presents you the pros and cons of each Ogre Scene Manager type. –  Valkea Mar 1 '12 at 13:17
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.