NavigationEvents.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. /// Complete rebuild of navigation mesh.
  27. EVENT(E_NAVIGATION_MESH_REBUILT, NavigationMeshRebuilt)
  28. {
  29. PARAM(P_NODE, Node); // Node pointer
  30. PARAM(P_MESH, Mesh); // NavigationMesh pointer
  31. }
  32. /// Partial bounding box rebuild of navigation mesh.
  33. EVENT(E_NAVIGATION_AREA_REBUILT, NavigationAreaRebuilt)
  34. {
  35. PARAM(P_NODE, Node); // Node pointer
  36. PARAM(P_MESH, Mesh); // NavigationMesh pointer
  37. PARAM(P_BOUNDSMIN, BoundsMin); // Vector3
  38. PARAM(P_BOUNDSMAX, BoundsMax); // Vector3
  39. }
  40. /// Crowd agent formation.
  41. EVENT(E_CROWD_AGENT_FORMATION, CrowdAgentFormation)
  42. {
  43. PARAM(P_NODE, Node); // Node pointer
  44. PARAM(P_CROWD_AGENT, CrowdAgent); // CrowdAgent pointer
  45. PARAM(P_INDEX, Index); // unsigned
  46. PARAM(P_SIZE, Size); // unsigned
  47. PARAM(P_POSITION, Position); // Vector3 [in/out]
  48. }
  49. /// Crowd agent has been repositioned.
  50. EVENT(E_CROWD_AGENT_REPOSITION, CrowdAgentReposition)
  51. {
  52. PARAM(P_NODE, Node); // Node pointer
  53. PARAM(P_CROWD_AGENT, CrowdAgent); // CrowdAgent pointer
  54. PARAM(P_POSITION, Position); // Vector3
  55. PARAM(P_VELOCITY, Velocity); // Vector3
  56. PARAM(P_ARRIVED, Arrived); // bool
  57. PARAM(P_TIMESTEP, TimeStep); // float
  58. }
  59. /// Crowd agent's internal state has become invalidated. This is a special case of CrowdAgentStateChanged event.
  60. EVENT(E_CROWD_AGENT_FAILURE, CrowdAgentFailure)
  61. {
  62. PARAM(P_NODE, Node); // Node pointer
  63. PARAM(P_CROWD_AGENT, CrowdAgent); // CrowdAgent pointer
  64. PARAM(P_POSITION, Position); // Vector3
  65. PARAM(P_VELOCITY, Velocity); // Vector3
  66. PARAM(P_CROWD_AGENT_STATE, CrowdAgentState); // int
  67. PARAM(P_CROWD_TARGET_STATE, CrowdTargetState); // int
  68. }
  69. /// Crowd agent's state has been changed.
  70. EVENT(E_CROWD_AGENT_STATE_CHANGED, CrowdAgentStateChanged)
  71. {
  72. PARAM(P_NODE, Node); // Node pointer
  73. PARAM(P_CROWD_AGENT, CrowdAgent); // CrowdAgent pointer
  74. PARAM(P_POSITION, Position); // Vector3
  75. PARAM(P_VELOCITY, Velocity); // Vector3
  76. PARAM(P_CROWD_AGENT_STATE, CrowdAgentState); // int
  77. PARAM(P_CROWD_TARGET_STATE, CrowdTargetState); // int
  78. }
  79. /// Addition of obstacle to dynamic navigation mesh.
  80. EVENT(E_NAVIGATION_OBSTACLE_ADDED, NavigationObstacleAdded)
  81. {
  82. PARAM(P_NODE, Node); // Node pointer
  83. PARAM(P_OBSTACLE, Obstacle); // Obstacle pointer
  84. PARAM(P_POSITION, Position); // Vector3
  85. PARAM(P_RADIUS, Radius); // float
  86. PARAM(P_HEIGHT, Height); // float
  87. }
  88. /// Removal of obstacle from dynamic navigation mesh.
  89. EVENT(E_NAVIGATION_OBSTACLE_REMOVED, NavigationObstacleRemoved)
  90. {
  91. PARAM(P_NODE, Node); // Node pointer
  92. PARAM(P_OBSTACLE, Obstacle); // Obstacle pointer
  93. PARAM(P_POSITION, Position); // Vector3
  94. PARAM(P_RADIUS, Radius); // float
  95. PARAM(P_HEIGHT, Height); // float
  96. }
  97. }