Browse Source

Added documentation chapter on scene graph events, and that individual component removals are not signaled when node is removed. Closes #1864.

Lasse Öörni 8 years ago
parent
commit
eccf7cef88
2 changed files with 7 additions and 1 deletions
  1. 6 0
      Docs/Reference.dox
  2. 1 1
      Source/Urho3D/Scene/SceneEvents.h

+ 6 - 0
Docs/Reference.dox

@@ -398,6 +398,12 @@ Just loading or saving whole scenes is not flexible enough for eg. games where n
 
 To instantiate the saved node into a scene, call \ref Scene::Instantiate "Instantiate()", \ref Scene::InstantiateJSON() or \ref Scene::InstantiateXML "InstantiateXML()" depending on the format. The node will be created as a child of the Scene but can be freely reparented after that. Position and rotation for placing the node need to be specified. The NinjaSnowWar example uses XML format for its object prefabs; these exist in the bin/Data/Objects directory.
 
+\section SceneModel_Events Scene graph events
+
+The Scene object sends events on scene graph modification, such as nodes or components being added or removed, the enabled status of a node or component being 
+changed, or name or tags being changed. These are used in the Editor to implement keeping the scene hierarchy window up to date. See the include file
+SceneEvents.h. Note that when a node is removed from the scene, individual component removals are not signaled.
+
 \section SceneModel_FurtherInformation Further information
 
 For more information on the component-based scene model, see for example http://cowboyprogramming.com/2007/01/05/evolve-your-heirachy/. Note that the Urho3D scene model is not a pure Entity-Component-System design, which would have the components just as bare data containers, and only systems acting on them. Instead the Urho3D components contain logic of their own, and actively communicate with the systems (such as rendering, physics or script engine) they depend on.

+ 1 - 1
Source/Urho3D/Scene/SceneEvents.h

@@ -118,7 +118,7 @@ URHO3D_EVENT(E_NODEADDED, NodeAdded)
     URHO3D_PARAM(P_NODE, Node);                    // Node pointer
 }
 
-/// A child node is about to be removed from a parent node.
+/// A child node is about to be removed from a parent node. Note that individual component removal events will not be sent.
 URHO3D_EVENT(E_NODEREMOVED, NodeRemoved)
 {
     URHO3D_PARAM(P_SCENE, Scene);                  // Scene pointer