SceneEvents.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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. };
  78. /// Asynchronous scene loading finished.
  79. EVENT(E_ASYNCLOADFINISHED, AsyncLoadFinished)
  80. {
  81. PARAM(P_SCENE, Scene); // Scene pointer
  82. };
  83. /// A child node has been added to a parent node.
  84. EVENT(E_NODEADDED, NodeAdded)
  85. {
  86. PARAM(P_SCENE, Scene); // Scene pointer
  87. PARAM(P_PARENT, Parent); // Node pointer
  88. PARAM(P_NODE, Node); // Node pointer
  89. }
  90. /// A child node is about to be removed from a parent node.
  91. EVENT(E_NODEREMOVED, NodeRemoved)
  92. {
  93. PARAM(P_SCENE, Scene); // Scene pointer
  94. PARAM(P_PARENT, Parent); // Node pointer
  95. PARAM(P_NODE, Node); // Node pointer
  96. }
  97. /// A component has been created to a node.
  98. EVENT(E_COMPONENTADDED, ComponentAdded)
  99. {
  100. PARAM(P_SCENE, Scene); // Scene pointer
  101. PARAM(P_NODE, Node); // Node pointer
  102. PARAM(P_COMPONENT, Component); // Component pointer
  103. }
  104. /// A component is about to be removed from a node.
  105. EVENT(E_COMPONENTREMOVED, ComponentRemoved)
  106. {
  107. PARAM(P_SCENE, Scene); // Scene pointer
  108. PARAM(P_NODE, Node); // Node pointer
  109. PARAM(P_COMPONENT, Component); // Component pointer
  110. }
  111. /// A node's name has changed.
  112. EVENT(E_NODENAMECHANGED, NodeNameChanged)
  113. {
  114. PARAM(P_SCENE, Scene); // Scene pointer
  115. PARAM(P_NODE, Node); // Node pointer
  116. }
  117. /// A node's enabled state has changed.
  118. EVENT(E_NODEENABLEDCHANGED, NodeEnabledChanged)
  119. {
  120. PARAM(P_SCENE, Scene); // Scene pointer
  121. PARAM(P_NODE, Node); // Node pointer
  122. }
  123. /// A component's enabled state has changed.
  124. EVENT(E_COMPONENTENABLEDCHANGED, ComponentEnabledChanged)
  125. {
  126. PARAM(P_SCENE, Scene); // Scene pointer
  127. PARAM(P_NODE, Node); // Node pointer
  128. PARAM(P_COMPONENT, Component); // Component pointer
  129. }
  130. /// A serializable's temporary state has changed.
  131. EVENT(E_TEMPORARYCHANGED, TemporaryChanged)
  132. {
  133. PARAM(P_SERIALIZABLE, Serializable); // Serializable pointer
  134. }
  135. }