NavigationEvents.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. // Copyright (c) 2008-2023 the Urho3D project
  2. // License: MIT
  3. #pragma once
  4. #include "../Core/Object.h"
  5. namespace Urho3D
  6. {
  7. /// Complete rebuild of navigation mesh.
  8. URHO3D_EVENT(E_NAVIGATION_MESH_REBUILT, NavigationMeshRebuilt)
  9. {
  10. URHO3D_PARAM(P_NODE, Node); // Node pointer
  11. URHO3D_PARAM(P_MESH, Mesh); // NavigationMesh pointer
  12. }
  13. /// Partial bounding box rebuild of navigation mesh.
  14. URHO3D_EVENT(E_NAVIGATION_AREA_REBUILT, NavigationAreaRebuilt)
  15. {
  16. URHO3D_PARAM(P_NODE, Node); // Node pointer
  17. URHO3D_PARAM(P_MESH, Mesh); // NavigationMesh pointer
  18. URHO3D_PARAM(P_BOUNDSMIN, BoundsMin); // Vector3
  19. URHO3D_PARAM(P_BOUNDSMAX, BoundsMax); // Vector3
  20. }
  21. /// Mesh tile is added to navigation mesh.
  22. URHO3D_EVENT(E_NAVIGATION_TILE_ADDED, NavigationTileAdded)
  23. {
  24. URHO3D_PARAM(P_NODE, Node); // Node pointer
  25. URHO3D_PARAM(P_MESH, Mesh); // NavigationMesh pointer
  26. URHO3D_PARAM(P_TILE, Tile); // IntVector2
  27. }
  28. /// Mesh tile is removed from navigation mesh.
  29. URHO3D_EVENT(E_NAVIGATION_TILE_REMOVED, NavigationTileRemoved)
  30. {
  31. URHO3D_PARAM(P_NODE, Node); // Node pointer
  32. URHO3D_PARAM(P_MESH, Mesh); // NavigationMesh pointer
  33. URHO3D_PARAM(P_TILE, Tile); // IntVector2
  34. }
  35. /// All mesh tiles are removed from navigation mesh.
  36. URHO3D_EVENT(E_NAVIGATION_ALL_TILES_REMOVED, NavigationAllTilesRemoved)
  37. {
  38. URHO3D_PARAM(P_NODE, Node); // Node pointer
  39. URHO3D_PARAM(P_MESH, Mesh); // NavigationMesh pointer
  40. }
  41. /// Crowd agent formation.
  42. URHO3D_EVENT(E_CROWD_AGENT_FORMATION, CrowdAgentFormation)
  43. {
  44. URHO3D_PARAM(P_NODE, Node); // Node pointer
  45. URHO3D_PARAM(P_CROWD_AGENT, CrowdAgent); // CrowdAgent pointer
  46. URHO3D_PARAM(P_INDEX, Index); // unsigned
  47. URHO3D_PARAM(P_SIZE, Size); // unsigned
  48. URHO3D_PARAM(P_POSITION, Position); // Vector3 [in/out]
  49. }
  50. /// Crowd agent formation specific to a node.
  51. URHO3D_EVENT(E_CROWD_AGENT_NODE_FORMATION, CrowdAgentNodeFormation)
  52. {
  53. URHO3D_PARAM(P_NODE, Node); // Node pointer
  54. URHO3D_PARAM(P_CROWD_AGENT, CrowdAgent); // CrowdAgent pointer
  55. URHO3D_PARAM(P_INDEX, Index); // unsigned
  56. URHO3D_PARAM(P_SIZE, Size); // unsigned
  57. URHO3D_PARAM(P_POSITION, Position); // Vector3 [in/out]
  58. }
  59. /// Crowd agent has been repositioned.
  60. URHO3D_EVENT(E_CROWD_AGENT_REPOSITION, CrowdAgentReposition)
  61. {
  62. URHO3D_PARAM(P_NODE, Node); // Node pointer
  63. URHO3D_PARAM(P_CROWD_AGENT, CrowdAgent); // CrowdAgent pointer
  64. URHO3D_PARAM(P_POSITION, Position); // Vector3
  65. URHO3D_PARAM(P_VELOCITY, Velocity); // Vector3
  66. URHO3D_PARAM(P_ARRIVED, Arrived); // bool
  67. URHO3D_PARAM(P_TIMESTEP, TimeStep); // float
  68. }
  69. /// Crowd agent has been repositioned, specific to a node.
  70. URHO3D_EVENT(E_CROWD_AGENT_NODE_REPOSITION, CrowdAgentNodeReposition)
  71. {
  72. URHO3D_PARAM(P_NODE, Node); // Node pointer
  73. URHO3D_PARAM(P_CROWD_AGENT, CrowdAgent); // CrowdAgent pointer
  74. URHO3D_PARAM(P_POSITION, Position); // Vector3
  75. URHO3D_PARAM(P_VELOCITY, Velocity); // Vector3
  76. URHO3D_PARAM(P_ARRIVED, Arrived); // bool
  77. URHO3D_PARAM(P_TIMESTEP, TimeStep); // float
  78. }
  79. /// Crowd agent's internal state has become invalidated. This is a special case of CrowdAgentStateChanged event.
  80. URHO3D_EVENT(E_CROWD_AGENT_FAILURE, CrowdAgentFailure)
  81. {
  82. URHO3D_PARAM(P_NODE, Node); // Node pointer
  83. URHO3D_PARAM(P_CROWD_AGENT, CrowdAgent); // CrowdAgent pointer
  84. URHO3D_PARAM(P_POSITION, Position); // Vector3
  85. URHO3D_PARAM(P_VELOCITY, Velocity); // Vector3
  86. URHO3D_PARAM(P_CROWD_AGENT_STATE, CrowdAgentState); // int
  87. URHO3D_PARAM(P_CROWD_TARGET_STATE, CrowdTargetState); // int
  88. }
  89. /// Crowd agent's internal state has become invalidated. This is a special case of CrowdAgentStateChanged event.
  90. URHO3D_EVENT(E_CROWD_AGENT_NODE_FAILURE, CrowdAgentNodeFailure)
  91. {
  92. URHO3D_PARAM(P_NODE, Node); // Node pointer
  93. URHO3D_PARAM(P_CROWD_AGENT, CrowdAgent); // CrowdAgent pointer
  94. URHO3D_PARAM(P_POSITION, Position); // Vector3
  95. URHO3D_PARAM(P_VELOCITY, Velocity); // Vector3
  96. URHO3D_PARAM(P_CROWD_AGENT_STATE, CrowdAgentState); // int
  97. URHO3D_PARAM(P_CROWD_TARGET_STATE, CrowdTargetState); // int
  98. }
  99. /// Crowd agent's state has been changed.
  100. URHO3D_EVENT(E_CROWD_AGENT_STATE_CHANGED, CrowdAgentStateChanged)
  101. {
  102. URHO3D_PARAM(P_NODE, Node); // Node pointer
  103. URHO3D_PARAM(P_CROWD_AGENT, CrowdAgent); // CrowdAgent pointer
  104. URHO3D_PARAM(P_POSITION, Position); // Vector3
  105. URHO3D_PARAM(P_VELOCITY, Velocity); // Vector3
  106. URHO3D_PARAM(P_CROWD_AGENT_STATE, CrowdAgentState); // int
  107. URHO3D_PARAM(P_CROWD_TARGET_STATE, CrowdTargetState); // int
  108. }
  109. /// Crowd agent's state has been changed.
  110. URHO3D_EVENT(E_CROWD_AGENT_NODE_STATE_CHANGED, CrowdAgentNodeStateChanged)
  111. {
  112. URHO3D_PARAM(P_NODE, Node); // Node pointer
  113. URHO3D_PARAM(P_CROWD_AGENT, CrowdAgent); // CrowdAgent pointer
  114. URHO3D_PARAM(P_POSITION, Position); // Vector3
  115. URHO3D_PARAM(P_VELOCITY, Velocity); // Vector3
  116. URHO3D_PARAM(P_CROWD_AGENT_STATE, CrowdAgentState); // int
  117. URHO3D_PARAM(P_CROWD_TARGET_STATE, CrowdTargetState); // int
  118. }
  119. /// Addition of obstacle to dynamic navigation mesh.
  120. URHO3D_EVENT(E_NAVIGATION_OBSTACLE_ADDED, NavigationObstacleAdded)
  121. {
  122. URHO3D_PARAM(P_NODE, Node); // Node pointer
  123. URHO3D_PARAM(P_OBSTACLE, Obstacle); // Obstacle pointer
  124. URHO3D_PARAM(P_POSITION, Position); // Vector3
  125. URHO3D_PARAM(P_RADIUS, Radius); // float
  126. URHO3D_PARAM(P_HEIGHT, Height); // float
  127. }
  128. /// Removal of obstacle from dynamic navigation mesh.
  129. URHO3D_EVENT(E_NAVIGATION_OBSTACLE_REMOVED, NavigationObstacleRemoved)
  130. {
  131. URHO3D_PARAM(P_NODE, Node); // Node pointer
  132. URHO3D_PARAM(P_OBSTACLE, Obstacle); // Obstacle pointer
  133. URHO3D_PARAM(P_POSITION, Position); // Vector3
  134. URHO3D_PARAM(P_RADIUS, Radius); // float
  135. URHO3D_PARAM(P_HEIGHT, Height); // float
  136. }
  137. }