SceneEvents.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. //
  2. // Copyright (c) 2008-2015 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. EVENT(E_SCENEUPDATE, SceneUpdate)
  28. {
  29. PARAM(P_SCENE, Scene); // Scene pointer
  30. PARAM(P_TIMESTEP, TimeStep); // float
  31. }
  32. /// Scene subsystem update.
  33. EVENT(E_SCENESUBSYSTEMUPDATE, SceneSubsystemUpdate)
  34. {
  35. PARAM(P_SCENE, Scene); // Scene pointer
  36. PARAM(P_TIMESTEP, TimeStep); // float
  37. }
  38. /// Scene transform smoothing update.
  39. EVENT(E_UPDATESMOOTHING, UpdateSmoothing)
  40. {
  41. PARAM(P_CONSTANT, Constant); // float
  42. PARAM(P_SQUAREDSNAPTHRESHOLD, SquaredSnapThreshold); // float
  43. }
  44. /// Scene drawable update finished. Custom animation (eg. IK) can be done at this point.
  45. EVENT(E_SCENEDRAWABLEUPDATEFINISHED, SceneDrawableUpdateFinished)
  46. {
  47. PARAM(P_SCENE, Scene); // Scene pointer
  48. PARAM(P_TIMESTEP, TimeStep); // float
  49. }
  50. /// SmoothedTransform target position changed.
  51. EVENT(E_TARGETPOSITION, TargetPositionChanged)
  52. {
  53. }
  54. /// SmoothedTransform target position changed.
  55. EVENT(E_TARGETROTATION, TargetRotationChanged)
  56. {
  57. }
  58. /// Scene attribute animation update.
  59. EVENT(E_ATTRIBUTEANIMATIONUPDATE, AttributeAnimationUpdate)
  60. {
  61. PARAM(P_SCENE, Scene); // Scene pointer
  62. PARAM(P_TIMESTEP, TimeStep); // float
  63. }
  64. /// Attribute animation added to object animation.
  65. EVENT(E_ATTRIBUTEANIMATIONADDED, AttributeAnimationAdded)
  66. {
  67. PARAM(P_OBJECTANIMATION, ObjectAnimation); // Object animation pointer
  68. PARAM(P_ATTRIBUTEANIMATIONNAME, AttributeAnimationName); // String
  69. }
  70. /// Attribute animation removed from object animation.
  71. EVENT(E_ATTRIBUTEANIMATIONREMOVED, AttributeAnimationRemoved)
  72. {
  73. PARAM(P_OBJECTANIMATION, ObjectAnimation); // Object animation pointer
  74. PARAM(P_ATTRIBUTEANIMATIONNAME, AttributeAnimationName); // String
  75. }
  76. /// Variable timestep scene post-update.
  77. EVENT(E_SCENEPOSTUPDATE, ScenePostUpdate)
  78. {
  79. PARAM(P_SCENE, Scene); // Scene pointer
  80. PARAM(P_TIMESTEP, TimeStep); // float
  81. }
  82. /// Asynchronous scene loading progress.
  83. EVENT(E_ASYNCLOADPROGRESS, AsyncLoadProgress)
  84. {
  85. PARAM(P_SCENE, Scene); // Scene pointer
  86. PARAM(P_PROGRESS, Progress); // float
  87. PARAM(P_LOADEDNODES, LoadedNodes); // int
  88. PARAM(P_TOTALNODES, TotalNodes); // int
  89. PARAM(P_LOADEDRESOURCES, LoadedResources); // int
  90. PARAM(P_TOTALRESOURCES, TotalResources); // int
  91. };
  92. /// Asynchronous scene loading finished.
  93. EVENT(E_ASYNCLOADFINISHED, AsyncLoadFinished)
  94. {
  95. PARAM(P_SCENE, Scene); // Scene pointer
  96. };
  97. /// A child node has been added to a parent node.
  98. EVENT(E_NODEADDED, NodeAdded)
  99. {
  100. PARAM(P_SCENE, Scene); // Scene pointer
  101. PARAM(P_PARENT, Parent); // Node pointer
  102. PARAM(P_NODE, Node); // Node pointer
  103. }
  104. /// A child node is about to be removed from a parent node.
  105. EVENT(E_NODEREMOVED, NodeRemoved)
  106. {
  107. PARAM(P_SCENE, Scene); // Scene pointer
  108. PARAM(P_PARENT, Parent); // Node pointer
  109. PARAM(P_NODE, Node); // Node pointer
  110. }
  111. /// A component has been created to a node.
  112. EVENT(E_COMPONENTADDED, ComponentAdded)
  113. {
  114. PARAM(P_SCENE, Scene); // Scene pointer
  115. PARAM(P_NODE, Node); // Node pointer
  116. PARAM(P_COMPONENT, Component); // Component pointer
  117. }
  118. /// A component is about to be removed from a node.
  119. EVENT(E_COMPONENTREMOVED, ComponentRemoved)
  120. {
  121. PARAM(P_SCENE, Scene); // Scene pointer
  122. PARAM(P_NODE, Node); // Node pointer
  123. PARAM(P_COMPONENT, Component); // Component pointer
  124. }
  125. /// A node's name has changed.
  126. EVENT(E_NODENAMECHANGED, NodeNameChanged)
  127. {
  128. PARAM(P_SCENE, Scene); // Scene pointer
  129. PARAM(P_NODE, Node); // Node pointer
  130. }
  131. /// A node's enabled state has changed.
  132. EVENT(E_NODEENABLEDCHANGED, NodeEnabledChanged)
  133. {
  134. PARAM(P_SCENE, Scene); // Scene pointer
  135. PARAM(P_NODE, Node); // Node pointer
  136. }
  137. /// A component's enabled state has changed.
  138. EVENT(E_COMPONENTENABLEDCHANGED, ComponentEnabledChanged)
  139. {
  140. PARAM(P_SCENE, Scene); // Scene pointer
  141. PARAM(P_NODE, Node); // Node pointer
  142. PARAM(P_COMPONENT, Component); // Component pointer
  143. }
  144. /// A serializable's temporary state has changed.
  145. EVENT(E_TEMPORARYCHANGED, TemporaryChanged)
  146. {
  147. PARAM(P_SERIALIZABLE, Serializable); // Serializable pointer
  148. }
  149. /// A network attribute update from the server has been intercepted.
  150. EVENT(E_INTERCEPTNETWORKUPDATE, InterceptNetworkUpdate)
  151. {
  152. PARAM(P_SERIALIZABLE, Serializable); // Serializable pointer
  153. PARAM(P_TIMESTAMP, TimeStamp); // unsigned (0-255)
  154. PARAM(P_INDEX, Index); // unsigned
  155. PARAM(P_NAME, Name); // String
  156. PARAM(P_VALUE, Value); // Variant
  157. }
  158. }