SceneEvents.h 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. // Copyright (c) 2008-2023 the Urho3D project
  2. // License: MIT
  3. #pragma once
  4. #include "../Core/Object.h"
  5. namespace Urho3D
  6. {
  7. /// Variable timestep scene update.
  8. URHO3D_EVENT(E_SCENEUPDATE, SceneUpdate)
  9. {
  10. URHO3D_PARAM(P_SCENE, Scene); // Scene pointer
  11. URHO3D_PARAM(P_TIMESTEP, TimeStep); // float
  12. }
  13. /// Scene subsystem update.
  14. URHO3D_EVENT(E_SCENESUBSYSTEMUPDATE, SceneSubsystemUpdate)
  15. {
  16. URHO3D_PARAM(P_SCENE, Scene); // Scene pointer
  17. URHO3D_PARAM(P_TIMESTEP, TimeStep); // float
  18. }
  19. /// Scene transform smoothing update.
  20. URHO3D_EVENT(E_UPDATESMOOTHING, UpdateSmoothing)
  21. {
  22. URHO3D_PARAM(P_CONSTANT, Constant); // float
  23. URHO3D_PARAM(P_SQUAREDSNAPTHRESHOLD, SquaredSnapThreshold); // float
  24. }
  25. /// Scene drawable update finished. Custom animation (eg. IK) can be done at this point.
  26. URHO3D_EVENT(E_SCENEDRAWABLEUPDATEFINISHED, SceneDrawableUpdateFinished)
  27. {
  28. URHO3D_PARAM(P_SCENE, Scene); // Scene pointer
  29. URHO3D_PARAM(P_TIMESTEP, TimeStep); // float
  30. }
  31. /// SmoothedTransform target position changed.
  32. URHO3D_EVENT(E_TARGETPOSITION, TargetPositionChanged)
  33. {
  34. }
  35. /// SmoothedTransform target position changed.
  36. URHO3D_EVENT(E_TARGETROTATION, TargetRotationChanged)
  37. {
  38. }
  39. /// Scene attribute animation update.
  40. URHO3D_EVENT(E_ATTRIBUTEANIMATIONUPDATE, AttributeAnimationUpdate)
  41. {
  42. URHO3D_PARAM(P_SCENE, Scene); // Scene pointer
  43. URHO3D_PARAM(P_TIMESTEP, TimeStep); // float
  44. }
  45. /// Attribute animation added to object animation.
  46. URHO3D_EVENT(E_ATTRIBUTEANIMATIONADDED, AttributeAnimationAdded)
  47. {
  48. URHO3D_PARAM(P_OBJECTANIMATION, ObjectAnimation); // Object animation pointer
  49. URHO3D_PARAM(P_ATTRIBUTEANIMATIONNAME, AttributeAnimationName); // String
  50. }
  51. /// Attribute animation removed from object animation.
  52. URHO3D_EVENT(E_ATTRIBUTEANIMATIONREMOVED, AttributeAnimationRemoved)
  53. {
  54. URHO3D_PARAM(P_OBJECTANIMATION, ObjectAnimation); // Object animation pointer
  55. URHO3D_PARAM(P_ATTRIBUTEANIMATIONNAME, AttributeAnimationName); // String
  56. }
  57. /// Variable timestep scene post-update.
  58. URHO3D_EVENT(E_SCENEPOSTUPDATE, ScenePostUpdate)
  59. {
  60. URHO3D_PARAM(P_SCENE, Scene); // Scene pointer
  61. URHO3D_PARAM(P_TIMESTEP, TimeStep); // float
  62. }
  63. /// Asynchronous scene loading progress.
  64. URHO3D_EVENT(E_ASYNCLOADPROGRESS, AsyncLoadProgress)
  65. {
  66. URHO3D_PARAM(P_SCENE, Scene); // Scene pointer
  67. URHO3D_PARAM(P_PROGRESS, Progress); // float
  68. URHO3D_PARAM(P_LOADEDNODES, LoadedNodes); // int
  69. URHO3D_PARAM(P_TOTALNODES, TotalNodes); // int
  70. URHO3D_PARAM(P_LOADEDRESOURCES, LoadedResources); // int
  71. URHO3D_PARAM(P_TOTALRESOURCES, TotalResources); // int
  72. }
  73. /// Asynchronous scene loading finished.
  74. URHO3D_EVENT(E_ASYNCLOADFINISHED, AsyncLoadFinished)
  75. {
  76. URHO3D_PARAM(P_SCENE, Scene); // Scene pointer
  77. }
  78. /// A child node has been added to a parent node.
  79. URHO3D_EVENT(E_NODEADDED, NodeAdded)
  80. {
  81. URHO3D_PARAM(P_SCENE, Scene); // Scene pointer
  82. URHO3D_PARAM(P_PARENT, Parent); // Node pointer
  83. URHO3D_PARAM(P_NODE, Node); // Node pointer
  84. }
  85. /// A child node is about to be removed from a parent node. Note that individual component removal events will not be sent.
  86. URHO3D_EVENT(E_NODEREMOVED, NodeRemoved)
  87. {
  88. URHO3D_PARAM(P_SCENE, Scene); // Scene pointer
  89. URHO3D_PARAM(P_PARENT, Parent); // Node pointer
  90. URHO3D_PARAM(P_NODE, Node); // Node pointer
  91. }
  92. /// A component has been created to a node.
  93. URHO3D_EVENT(E_COMPONENTADDED, ComponentAdded)
  94. {
  95. URHO3D_PARAM(P_SCENE, Scene); // Scene pointer
  96. URHO3D_PARAM(P_NODE, Node); // Node pointer
  97. URHO3D_PARAM(P_COMPONENT, Component); // Component pointer
  98. }
  99. /// A component is about to be removed from a node.
  100. URHO3D_EVENT(E_COMPONENTREMOVED, ComponentRemoved)
  101. {
  102. URHO3D_PARAM(P_SCENE, Scene); // Scene pointer
  103. URHO3D_PARAM(P_NODE, Node); // Node pointer
  104. URHO3D_PARAM(P_COMPONENT, Component); // Component pointer
  105. }
  106. /// A node's name has changed.
  107. URHO3D_EVENT(E_NODENAMECHANGED, NodeNameChanged)
  108. {
  109. URHO3D_PARAM(P_SCENE, Scene); // Scene pointer
  110. URHO3D_PARAM(P_NODE, Node); // Node pointer
  111. }
  112. /// A node's enabled state has changed.
  113. URHO3D_EVENT(E_NODEENABLEDCHANGED, NodeEnabledChanged)
  114. {
  115. URHO3D_PARAM(P_SCENE, Scene); // Scene pointer
  116. URHO3D_PARAM(P_NODE, Node); // Node pointer
  117. }
  118. /// A node's tag has been added.
  119. URHO3D_EVENT(E_NODETAGADDED, NodeTagAdded)
  120. {
  121. URHO3D_PARAM(P_SCENE, Scene); // Scene pointer
  122. URHO3D_PARAM(P_NODE, Node); // Node pointer
  123. URHO3D_PARAM(P_TAG, Tag); // String tag
  124. }
  125. /// A node's tag has been removed.
  126. URHO3D_EVENT(E_NODETAGREMOVED, NodeTagRemoved)
  127. {
  128. URHO3D_PARAM(P_SCENE, Scene); // Scene pointer
  129. URHO3D_PARAM(P_NODE, Node); // Node pointer
  130. URHO3D_PARAM(P_TAG, Tag); // String tag
  131. }
  132. /// A component's enabled state has changed.
  133. URHO3D_EVENT(E_COMPONENTENABLEDCHANGED, ComponentEnabledChanged)
  134. {
  135. URHO3D_PARAM(P_SCENE, Scene); // Scene pointer
  136. URHO3D_PARAM(P_NODE, Node); // Node pointer
  137. URHO3D_PARAM(P_COMPONENT, Component); // Component pointer
  138. }
  139. /// A serializable's temporary state has changed.
  140. URHO3D_EVENT(E_TEMPORARYCHANGED, TemporaryChanged)
  141. {
  142. URHO3D_PARAM(P_SERIALIZABLE, Serializable); // Serializable pointer
  143. }
  144. /// A node (and its children and components) has been cloned.
  145. URHO3D_EVENT(E_NODECLONED, NodeCloned)
  146. {
  147. URHO3D_PARAM(P_SCENE, Scene); // Scene pointer
  148. URHO3D_PARAM(P_NODE, Node); // Node pointer
  149. URHO3D_PARAM(P_CLONENODE, CloneNode); // Node pointer
  150. }
  151. /// A component has been cloned.
  152. URHO3D_EVENT(E_COMPONENTCLONED, ComponentCloned)
  153. {
  154. URHO3D_PARAM(P_SCENE, Scene); // Scene pointer
  155. URHO3D_PARAM(P_COMPONENT, Component); // Component pointer
  156. URHO3D_PARAM(P_CLONECOMPONENT, CloneComponent); // Component pointer
  157. }
  158. /// A network attribute update from the server has been intercepted.
  159. URHO3D_EVENT(E_INTERCEPTNETWORKUPDATE, InterceptNetworkUpdate)
  160. {
  161. URHO3D_PARAM(P_SERIALIZABLE, Serializable); // Serializable pointer
  162. URHO3D_PARAM(P_TIMESTAMP, TimeStamp); // unsigned (0-255)
  163. URHO3D_PARAM(P_INDEX, Index); // unsigned
  164. URHO3D_PARAM(P_NAME, Name); // String
  165. URHO3D_PARAM(P_VALUE, Value); // Variant
  166. }
  167. }