NavigationEvents.h 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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 has been repositioned.
  41. EVENT(E_CROWD_AGENT_REPOSITION, CrowdAgentReposition)
  42. {
  43. PARAM(P_NODE, Node); // Node pointer
  44. PARAM(P_CROWD_AGENT, CrowdAgent); // CrowdAgent pointer
  45. PARAM(P_POSITION, Position); // Vector3
  46. PARAM(P_VELOCITY, Velocity); // Vector3
  47. }
  48. /// Crowd agent's internal state has become invalidated.
  49. EVENT(E_CROWD_AGENT_FAILURE, CrowdAgentFailure)
  50. {
  51. PARAM(P_NODE, Node); // Node pointer
  52. PARAM(P_CROWD_AGENT, CrowdAgent); // CrowdAgent pointer
  53. PARAM(P_POSITION, Position); // Vector3
  54. PARAM(P_VELOCITY, Velocity); // Vector3
  55. PARAM(P_CROWD_AGENT_STATE, CrowdAgentState); // int
  56. PARAM(P_CROWD_TARGET_STATE, CrowdTargetState); // int
  57. }
  58. /// Crowd agent's state has been changed.
  59. EVENT(E_CROWD_AGENT_STATE_CHANGED, CrowdAgentStateChanged)
  60. {
  61. PARAM(P_NODE, Node); // Node pointer
  62. PARAM(P_CROWD_AGENT, CrowdAgent); // CrowdAgent pointer
  63. PARAM(P_POSITION, Position); // Vector3
  64. PARAM(P_VELOCITY, Velocity); // Vector3
  65. PARAM(P_CROWD_AGENT_STATE, CrowdAgentState); // int
  66. PARAM(P_CROWD_TARGET_STATE, CrowdTargetState); // int
  67. }
  68. /// Addition of obstacle to dynamic navigation mesh.
  69. EVENT(E_NAVIGATION_OBSTACLE_ADDED, NavigationObstacleAdded)
  70. {
  71. PARAM(P_NODE, Node); // Node pointer
  72. PARAM(P_OBSTACLE, Obstacle); // Obstacle pointer
  73. PARAM(P_POSITION, Position); // Vector3
  74. PARAM(P_RADIUS, Radius); // float
  75. PARAM(P_HEIGHT, Height); // float
  76. }
  77. /// Removal of obstacle from dynamic navigation mesh.
  78. EVENT(E_NAVIGATION_OBSTACLE_REMOVED, NavigationObstacleRemoved)
  79. {
  80. PARAM(P_NODE, Node); // Node pointer
  81. PARAM(P_OBSTACLE, Obstacle); // Obstacle pointer
  82. PARAM(P_POSITION, Position); // Vector3
  83. PARAM(P_RADIUS, Radius); // float
  84. PARAM(P_HEIGHT, Height); // float
  85. }
  86. }