SceneEvents.h 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. //
  2. // Copyright (c) 2008-2017 the Urho3D project.
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy
  5. // of this software and associated documentation files (the "Software"), to deal
  6. // in the Software without restriction, including without limitation the rights
  7. // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. // copies of the Software, and to permit persons to whom the Software is
  9. // furnished to do so, subject to the following conditions:
  10. //
  11. // The above copyright notice and this permission notice shall be included in
  12. // all copies or substantial portions of the Software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20. // THE SOFTWARE.
  21. //
  22. #pragma once
  23. #include "../Core/Object.h"
  24. namespace Atomic
  25. {
  26. /// Variable timestep scene update.
  27. ATOMIC_EVENT(E_SCENEUPDATE, SceneUpdate)
  28. {
  29. ATOMIC_PARAM(P_SCENE, Scene); // Scene pointer
  30. ATOMIC_PARAM(P_TIMESTEP, TimeStep); // float
  31. }
  32. /// Scene subsystem update.
  33. ATOMIC_EVENT(E_SCENESUBSYSTEMUPDATE, SceneSubsystemUpdate)
  34. {
  35. ATOMIC_PARAM(P_SCENE, Scene); // Scene pointer
  36. ATOMIC_PARAM(P_TIMESTEP, TimeStep); // float
  37. }
  38. /// Scene transform smoothing update.
  39. ATOMIC_EVENT(E_UPDATESMOOTHING, UpdateSmoothing)
  40. {
  41. ATOMIC_PARAM(P_CONSTANT, Constant); // float
  42. ATOMIC_PARAM(P_SQUAREDSNAPTHRESHOLD, SquaredSnapThreshold); // float
  43. }
  44. /// Scene drawable update finished. Custom animation (eg. IK) can be done at this point.
  45. ATOMIC_EVENT(E_SCENEDRAWABLEUPDATEFINISHED, SceneDrawableUpdateFinished)
  46. {
  47. ATOMIC_PARAM(P_SCENE, Scene); // Scene pointer
  48. ATOMIC_PARAM(P_TIMESTEP, TimeStep); // float
  49. }
  50. /// SmoothedTransform target position changed.
  51. ATOMIC_EVENT(E_TARGETPOSITION, TargetPositionChanged)
  52. {
  53. }
  54. /// SmoothedTransform target position changed.
  55. ATOMIC_EVENT(E_TARGETROTATION, TargetRotationChanged)
  56. {
  57. }
  58. /// Scene attribute animation update.
  59. ATOMIC_EVENT(E_ATTRIBUTEANIMATIONUPDATE, AttributeAnimationUpdate)
  60. {
  61. ATOMIC_PARAM(P_SCENE, Scene); // Scene pointer
  62. ATOMIC_PARAM(P_TIMESTEP, TimeStep); // float
  63. }
  64. /// Attribute animation added to object animation.
  65. ATOMIC_EVENT(E_ATTRIBUTEANIMATIONADDED, AttributeAnimationAdded)
  66. {
  67. ATOMIC_PARAM(P_OBJECTANIMATION, ObjectAnimation); // Object animation pointer
  68. ATOMIC_PARAM(P_ATTRIBUTEANIMATIONNAME, AttributeAnimationName); // String
  69. }
  70. /// Attribute animation removed from object animation.
  71. ATOMIC_EVENT(E_ATTRIBUTEANIMATIONREMOVED, AttributeAnimationRemoved)
  72. {
  73. ATOMIC_PARAM(P_OBJECTANIMATION, ObjectAnimation); // Object animation pointer
  74. ATOMIC_PARAM(P_ATTRIBUTEANIMATIONNAME, AttributeAnimationName); // String
  75. }
  76. /// Variable timestep scene post-update.
  77. ATOMIC_EVENT(E_SCENEPOSTUPDATE, ScenePostUpdate)
  78. {
  79. ATOMIC_PARAM(P_SCENE, Scene); // Scene pointer
  80. ATOMIC_PARAM(P_TIMESTEP, TimeStep); // float
  81. }
  82. /// Asynchronous scene loading progress.
  83. ATOMIC_EVENT(E_ASYNCLOADPROGRESS, AsyncLoadProgress)
  84. {
  85. ATOMIC_PARAM(P_SCENE, Scene); // Scene pointer
  86. ATOMIC_PARAM(P_PROGRESS, Progress); // float
  87. ATOMIC_PARAM(P_LOADEDNODES, LoadedNodes); // int
  88. ATOMIC_PARAM(P_TOTALNODES, TotalNodes); // int
  89. ATOMIC_PARAM(P_LOADEDRESOURCES, LoadedResources); // int
  90. ATOMIC_PARAM(P_TOTALRESOURCES, TotalResources); // int
  91. };
  92. /// Asynchronous scene loading finished.
  93. ATOMIC_EVENT(E_ASYNCLOADFINISHED, AsyncLoadFinished)
  94. {
  95. ATOMIC_PARAM(P_SCENE, Scene); // Scene pointer
  96. };
  97. /// A child node has been added to a parent node.
  98. ATOMIC_EVENT(E_NODEADDED, NodeAdded)
  99. {
  100. ATOMIC_PARAM(P_SCENE, Scene); // Scene pointer
  101. ATOMIC_PARAM(P_PARENT, Parent); // Node pointer
  102. ATOMIC_PARAM(P_NODE, Node); // Node pointer
  103. }
  104. /// A child node is about to be removed from a parent node. Note that individual component removal events will not be sent.
  105. ATOMIC_EVENT(E_NODEREMOVED, NodeRemoved)
  106. {
  107. ATOMIC_PARAM(P_SCENE, Scene); // Scene pointer
  108. ATOMIC_PARAM(P_PARENT, Parent); // Node pointer
  109. ATOMIC_PARAM(P_NODE, Node); // Node pointer
  110. }
  111. /// A component has been created to a node.
  112. ATOMIC_EVENT(E_COMPONENTADDED, ComponentAdded)
  113. {
  114. ATOMIC_PARAM(P_SCENE, Scene); // Scene pointer
  115. ATOMIC_PARAM(P_NODE, Node); // Node pointer
  116. ATOMIC_PARAM(P_COMPONENT, Component); // Component pointer
  117. }
  118. /// A component is about to be removed from a node.
  119. ATOMIC_EVENT(E_COMPONENTREMOVED, ComponentRemoved)
  120. {
  121. ATOMIC_PARAM(P_SCENE, Scene); // Scene pointer
  122. ATOMIC_PARAM(P_NODE, Node); // Node pointer
  123. ATOMIC_PARAM(P_COMPONENT, Component); // Component pointer
  124. }
  125. /// A node's name has changed.
  126. ATOMIC_EVENT(E_NODENAMECHANGED, NodeNameChanged)
  127. {
  128. ATOMIC_PARAM(P_SCENE, Scene); // Scene pointer
  129. ATOMIC_PARAM(P_NODE, Node); // Node pointer
  130. }
  131. /// A node's enabled state has changed.
  132. ATOMIC_EVENT(E_NODEENABLEDCHANGED, NodeEnabledChanged)
  133. {
  134. ATOMIC_PARAM(P_SCENE, Scene); // Scene pointer
  135. ATOMIC_PARAM(P_NODE, Node); // Node pointer
  136. }
  137. /// A node's tag has been added.
  138. ATOMIC_EVENT(E_NODETAGADDED, NodeTagAdded)
  139. {
  140. ATOMIC_PARAM(P_SCENE, Scene); // Scene pointer
  141. ATOMIC_PARAM(P_NODE, Node); // Node pointer
  142. ATOMIC_PARAM(P_TAG, Tag); // String tag
  143. }
  144. /// A node's tag has been removed.
  145. ATOMIC_EVENT(E_NODETAGREMOVED, NodeTagRemoved)
  146. {
  147. ATOMIC_PARAM(P_SCENE, Scene); // Scene pointer
  148. ATOMIC_PARAM(P_NODE, Node); // Node pointer
  149. ATOMIC_PARAM(P_TAG, Tag); // String tag
  150. }
  151. /// A component's enabled state has changed.
  152. ATOMIC_EVENT(E_COMPONENTENABLEDCHANGED, ComponentEnabledChanged)
  153. {
  154. ATOMIC_PARAM(P_SCENE, Scene); // Scene pointer
  155. ATOMIC_PARAM(P_NODE, Node); // Node pointer
  156. ATOMIC_PARAM(P_COMPONENT, Component); // Component pointer
  157. }
  158. /// A serializable's temporary state has changed.
  159. ATOMIC_EVENT(E_TEMPORARYCHANGED, TemporaryChanged)
  160. {
  161. ATOMIC_PARAM(P_SERIALIZABLE, Serializable); // Serializable pointer
  162. }
  163. /// A node (and its children and components) has been cloned.
  164. ATOMIC_EVENT(E_NODECLONED, NodeCloned)
  165. {
  166. ATOMIC_PARAM(P_SCENE, Scene); // Scene pointer
  167. ATOMIC_PARAM(P_NODE, Node); // Node pointer
  168. ATOMIC_PARAM(P_CLONENODE, CloneNode); // Node pointer
  169. }
  170. /// A component has been cloned.
  171. ATOMIC_EVENT(E_COMPONENTCLONED, ComponentCloned)
  172. {
  173. ATOMIC_PARAM(P_SCENE, Scene); // Scene pointer
  174. ATOMIC_PARAM(P_COMPONENT, Component); // Component pointer
  175. ATOMIC_PARAM(P_CLONECOMPONENT, CloneComponent); // Component pointer
  176. }
  177. /// A network attribute update from the server has been intercepted.
  178. ATOMIC_EVENT(E_INTERCEPTNETWORKUPDATE, InterceptNetworkUpdate)
  179. {
  180. ATOMIC_PARAM(P_SERIALIZABLE, Serializable); // Serializable pointer
  181. ATOMIC_PARAM(P_TIMESTAMP, TimeStamp); // unsigned (0-255)
  182. ATOMIC_PARAM(P_INDEX, Index); // unsigned
  183. ATOMIC_PARAM(P_NAME, Name); // String
  184. ATOMIC_PARAM(P_VALUE, Value); // Variant
  185. }
  186. }