NavigationEvents.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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 Urho3D
  25. {
  26. /// Complete rebuild of navigation mesh.
  27. URHO3D_EVENT(E_NAVIGATION_MESH_REBUILT, NavigationMeshRebuilt)
  28. {
  29. URHO3D_PARAM(P_NODE, Node); // Node pointer
  30. URHO3D_PARAM(P_MESH, Mesh); // NavigationMesh pointer
  31. }
  32. /// Partial bounding box rebuild of navigation mesh.
  33. URHO3D_EVENT(E_NAVIGATION_AREA_REBUILT, NavigationAreaRebuilt)
  34. {
  35. URHO3D_PARAM(P_NODE, Node); // Node pointer
  36. URHO3D_PARAM(P_MESH, Mesh); // NavigationMesh pointer
  37. URHO3D_PARAM(P_BOUNDSMIN, BoundsMin); // Vector3
  38. URHO3D_PARAM(P_BOUNDSMAX, BoundsMax); // Vector3
  39. }
  40. /// Crowd agent formation.
  41. URHO3D_EVENT(E_CROWD_AGENT_FORMATION, CrowdAgentFormation)
  42. {
  43. URHO3D_PARAM(P_NODE, Node); // Node pointer
  44. URHO3D_PARAM(P_CROWD_AGENT, CrowdAgent); // CrowdAgent pointer
  45. URHO3D_PARAM(P_INDEX, Index); // unsigned
  46. URHO3D_PARAM(P_SIZE, Size); // unsigned
  47. URHO3D_PARAM(P_POSITION, Position); // Vector3 [in/out]
  48. }
  49. /// Crowd agent formation specific to a node.
  50. URHO3D_EVENT(E_CROWD_AGENT_NODE_FORMATION, CrowdAgentNodeFormation)
  51. {
  52. URHO3D_PARAM(P_NODE, Node); // Node pointer
  53. URHO3D_PARAM(P_CROWD_AGENT, CrowdAgent); // CrowdAgent pointer
  54. URHO3D_PARAM(P_INDEX, Index); // unsigned
  55. URHO3D_PARAM(P_SIZE, Size); // unsigned
  56. URHO3D_PARAM(P_POSITION, Position); // Vector3 [in/out]
  57. }
  58. /// Crowd agent has been repositioned.
  59. URHO3D_EVENT(E_CROWD_AGENT_REPOSITION, CrowdAgentReposition)
  60. {
  61. URHO3D_PARAM(P_NODE, Node); // Node pointer
  62. URHO3D_PARAM(P_CROWD_AGENT, CrowdAgent); // CrowdAgent pointer
  63. URHO3D_PARAM(P_POSITION, Position); // Vector3
  64. URHO3D_PARAM(P_VELOCITY, Velocity); // Vector3
  65. URHO3D_PARAM(P_ARRIVED, Arrived); // bool
  66. URHO3D_PARAM(P_TIMESTEP, TimeStep); // float
  67. }
  68. /// Crowd agent has been repositioned, specific to a node
  69. URHO3D_EVENT(E_CROWD_AGENT_NODE_REPOSITION, CrowdAgentNodeReposition)
  70. {
  71. URHO3D_PARAM(P_NODE, Node); // Node pointer
  72. URHO3D_PARAM(P_CROWD_AGENT, CrowdAgent); // CrowdAgent pointer
  73. URHO3D_PARAM(P_POSITION, Position); // Vector3
  74. URHO3D_PARAM(P_VELOCITY, Velocity); // Vector3
  75. URHO3D_PARAM(P_ARRIVED, Arrived); // bool
  76. URHO3D_PARAM(P_TIMESTEP, TimeStep); // float
  77. }
  78. /// Crowd agent's internal state has become invalidated. This is a special case of CrowdAgentStateChanged event.
  79. URHO3D_EVENT(E_CROWD_AGENT_FAILURE, CrowdAgentFailure)
  80. {
  81. URHO3D_PARAM(P_NODE, Node); // Node pointer
  82. URHO3D_PARAM(P_CROWD_AGENT, CrowdAgent); // CrowdAgent pointer
  83. URHO3D_PARAM(P_POSITION, Position); // Vector3
  84. URHO3D_PARAM(P_VELOCITY, Velocity); // Vector3
  85. URHO3D_PARAM(P_CROWD_AGENT_STATE, CrowdAgentState); // int
  86. URHO3D_PARAM(P_CROWD_TARGET_STATE, CrowdTargetState); // int
  87. }
  88. /// Crowd agent's internal state has become invalidated. This is a special case of CrowdAgentStateChanged event.
  89. URHO3D_EVENT(E_CROWD_AGENT_NODE_FAILURE, CrowdAgentNodeFailure)
  90. {
  91. URHO3D_PARAM(P_NODE, Node); // Node pointer
  92. URHO3D_PARAM(P_CROWD_AGENT, CrowdAgent); // CrowdAgent pointer
  93. URHO3D_PARAM(P_POSITION, Position); // Vector3
  94. URHO3D_PARAM(P_VELOCITY, Velocity); // Vector3
  95. URHO3D_PARAM(P_CROWD_AGENT_STATE, CrowdAgentState); // int
  96. URHO3D_PARAM(P_CROWD_TARGET_STATE, CrowdTargetState); // int
  97. }
  98. /// Crowd agent's state has been changed.
  99. URHO3D_EVENT(E_CROWD_AGENT_STATE_CHANGED, CrowdAgentStateChanged)
  100. {
  101. URHO3D_PARAM(P_NODE, Node); // Node pointer
  102. URHO3D_PARAM(P_CROWD_AGENT, CrowdAgent); // CrowdAgent pointer
  103. URHO3D_PARAM(P_POSITION, Position); // Vector3
  104. URHO3D_PARAM(P_VELOCITY, Velocity); // Vector3
  105. URHO3D_PARAM(P_CROWD_AGENT_STATE, CrowdAgentState); // int
  106. URHO3D_PARAM(P_CROWD_TARGET_STATE, CrowdTargetState); // int
  107. }
  108. /// Crowd agent's state has been changed.
  109. URHO3D_EVENT(E_CROWD_AGENT_NODE_STATE_CHANGED, CrowdAgentNodeStateChanged)
  110. {
  111. URHO3D_PARAM(P_NODE, Node); // Node pointer
  112. URHO3D_PARAM(P_CROWD_AGENT, CrowdAgent); // CrowdAgent pointer
  113. URHO3D_PARAM(P_POSITION, Position); // Vector3
  114. URHO3D_PARAM(P_VELOCITY, Velocity); // Vector3
  115. URHO3D_PARAM(P_CROWD_AGENT_STATE, CrowdAgentState); // int
  116. URHO3D_PARAM(P_CROWD_TARGET_STATE, CrowdTargetState); // int
  117. }
  118. /// Addition of obstacle to dynamic navigation mesh.
  119. URHO3D_EVENT(E_NAVIGATION_OBSTACLE_ADDED, NavigationObstacleAdded)
  120. {
  121. URHO3D_PARAM(P_NODE, Node); // Node pointer
  122. URHO3D_PARAM(P_OBSTACLE, Obstacle); // Obstacle pointer
  123. URHO3D_PARAM(P_POSITION, Position); // Vector3
  124. URHO3D_PARAM(P_RADIUS, Radius); // float
  125. URHO3D_PARAM(P_HEIGHT, Height); // float
  126. }
  127. /// Removal of obstacle from dynamic navigation mesh.
  128. URHO3D_EVENT(E_NAVIGATION_OBSTACLE_REMOVED, NavigationObstacleRemoved)
  129. {
  130. URHO3D_PARAM(P_NODE, Node); // Node pointer
  131. URHO3D_PARAM(P_OBSTACLE, Obstacle); // Obstacle pointer
  132. URHO3D_PARAM(P_POSITION, Position); // Vector3
  133. URHO3D_PARAM(P_RADIUS, Radius); // float
  134. URHO3D_PARAM(P_HEIGHT, Height); // float
  135. }
  136. }