SceneEvents.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. //
  2. // Copyright (c) 2008-2014 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 "Object.h"
  24. namespace Urho3D
  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. /// Variable timestep scene post-update.
  65. EVENT(E_SCENEPOSTUPDATE, ScenePostUpdate)
  66. {
  67. PARAM(P_SCENE, Scene); // Scene pointer
  68. PARAM(P_TIMESTEP, TimeStep); // float
  69. }
  70. /// Asynchronous scene loading progress.
  71. EVENT(E_ASYNCLOADPROGRESS, AsyncLoadProgress)
  72. {
  73. PARAM(P_SCENE, Scene); // Scene pointer
  74. PARAM(P_PROGRESS, Progress); // float
  75. PARAM(P_LOADEDNODES, LoadedNodes); // int
  76. PARAM(P_TOTALNODES, TotalNodes); // int
  77. PARAM(P_LOADEDRESOURCES, LoadedResources); // int
  78. PARAM(P_TOTALRESOURCES, TotalResources); // int
  79. };
  80. /// Asynchronous scene loading finished.
  81. EVENT(E_ASYNCLOADFINISHED, AsyncLoadFinished)
  82. {
  83. PARAM(P_SCENE, Scene); // Scene pointer
  84. };
  85. /// A child node has been added to a parent node.
  86. EVENT(E_NODEADDED, NodeAdded)
  87. {
  88. PARAM(P_SCENE, Scene); // Scene pointer
  89. PARAM(P_PARENT, Parent); // Node pointer
  90. PARAM(P_NODE, Node); // Node pointer
  91. }
  92. /// A child node is about to be removed from a parent node.
  93. EVENT(E_NODEREMOVED, NodeRemoved)
  94. {
  95. PARAM(P_SCENE, Scene); // Scene pointer
  96. PARAM(P_PARENT, Parent); // Node pointer
  97. PARAM(P_NODE, Node); // Node pointer
  98. }
  99. /// A component has been created to a node.
  100. EVENT(E_COMPONENTADDED, ComponentAdded)
  101. {
  102. PARAM(P_SCENE, Scene); // Scene pointer
  103. PARAM(P_NODE, Node); // Node pointer
  104. PARAM(P_COMPONENT, Component); // Component pointer
  105. }
  106. /// A component is about to be removed from a node.
  107. EVENT(E_COMPONENTREMOVED, ComponentRemoved)
  108. {
  109. PARAM(P_SCENE, Scene); // Scene pointer
  110. PARAM(P_NODE, Node); // Node pointer
  111. PARAM(P_COMPONENT, Component); // Component pointer
  112. }
  113. /// A node's name has changed.
  114. EVENT(E_NODENAMECHANGED, NodeNameChanged)
  115. {
  116. PARAM(P_SCENE, Scene); // Scene pointer
  117. PARAM(P_NODE, Node); // Node pointer
  118. }
  119. /// A node's enabled state has changed.
  120. EVENT(E_NODEENABLEDCHANGED, NodeEnabledChanged)
  121. {
  122. PARAM(P_SCENE, Scene); // Scene pointer
  123. PARAM(P_NODE, Node); // Node pointer
  124. }
  125. /// A component's enabled state has changed.
  126. EVENT(E_COMPONENTENABLEDCHANGED, ComponentEnabledChanged)
  127. {
  128. PARAM(P_SCENE, Scene); // Scene pointer
  129. PARAM(P_NODE, Node); // Node pointer
  130. PARAM(P_COMPONENT, Component); // Component pointer
  131. }
  132. /// A serializable's temporary state has changed.
  133. EVENT(E_TEMPORARYCHANGED, TemporaryChanged)
  134. {
  135. PARAM(P_SERIALIZABLE, Serializable); // Serializable pointer
  136. }
  137. }