Browse Source

Additions to documentation.

Lasse Öörni 13 năm trước cách đây
mục cha
commit
f4f538fcd0
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      Docs/Reference.dox

+ 4 - 0
Docs/Reference.dox

@@ -114,6 +114,10 @@ eventData["TimeStep"] = timeStep;
 SendEvent("Update", eventData);
 \endcode
 
+\section Events_AnotherObject Sending events through another object
+
+Because the \ref Object::SendEvent "SendEvent()" function is public, an event can be "masqueraded" as originating from any object, even when not actually sent by that object's member function code. This can be used to simplify communication, particularly between components in the scene. For example, the \ref Physics "physics simulation" signals collision events by using the participating \ref Node "scene nodes" as senders. This means that any component can easily subscribe to its own node's collisions without having to know of the actual physics components involved. The same principle can also be used in any game-specific messaging, for example making a "damage received" event originate from the scene node, though it itself has no concept of damage or health.
+
 
 \page MainLoop Main loop and frame update