Ticket #52 (new defect)
SceneManager.Remove...() Methods
| Reported by: | borrillis | Owned by: | borrillis |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | Core Library | Version: | 0.8.0.0 (crickhollow) |
| Keywords: | Cc: |
Description
Not a bug in it's truest sense but quite confusing.
All the Remove...() and RemoveAll...() methods in the
generic scene manager claim to be removing an item
from the scene in their docs. But they only remove the
appropriate item from the SceneManager's lists, which
doesn't prevent the removed item from being rendered.
1. The docs could be updated telling that an item is
going to be removed from the SceneManager's list only
and explain how it should be removed from the scene
correctly... i.e. I think that should be something
like this:
light.ParentSceneNode.DetachObject( light ); sceneManager.RemoveLight( light );
2. The set of Remove...() methods could be extended
either with overloads consuming additional bool param
telling whether or not to truely remove an item from
the scene as in the above example or a more
descriptive name could be used for the extended set of
removal methods. I'd like the second option better,
here an example of such an RemoveEntityFromScene()
method...
/// <summary> /// Removes the specified entity from the scene hierarchy. /// </summary> /// <param name="entity">Entity to remove from the scene.</param> public virtual void RemoveEntityFromScene( Entity entity ) { if (entity.ParentSceneNode != null) { entity.ParentSceneNode.DetachObject( entity ); } //..if you'd eventually think the //following line could do a RemoveEntity( entity ) call //instead, just note that virtual methods cannot be in- //lined AFAIK... entityList.Remove( entity ); }
