NavigationEvents.h 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. PARAM(P_ARRIVED, Arrived); // bool
  48. }
  49. /// Crowd agent's internal state has become invalidated.
  50. EVENT(E_CROWD_AGENT_FAILURE, CrowdAgentFailure)
  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_CROWD_AGENT_STATE, CrowdAgentState); // int
  57. PARAM(P_CROWD_TARGET_STATE, CrowdTargetState); // int
  58. }
  59. /// Crowd agent's state has been changed.
  60. EVENT(E_CROWD_AGENT_STATE_CHANGED, CrowdAgentStateChanged)
  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. /// Addition of obstacle to dynamic navigation mesh.
  70. EVENT(E_NAVIGATION_OBSTACLE_ADDED, NavigationObstacleAdded)
  71. {
  72. PARAM(P_NODE, Node); // Node pointer
  73. PARAM(P_OBSTACLE, Obstacle); // Obstacle pointer
  74. PARAM(P_POSITION, Position); // Vector3
  75. PARAM(P_RADIUS, Radius); // float
  76. PARAM(P_HEIGHT, Height); // float
  77. }
  78. /// Removal of obstacle from dynamic navigation mesh.
  79. EVENT(E_NAVIGATION_OBSTACLE_REMOVED, NavigationObstacleRemoved)
  80. {
  81. PARAM(P_NODE, Node); // Node pointer
  82. PARAM(P_OBSTACLE, Obstacle); // Obstacle pointer
  83. PARAM(P_POSITION, Position); // Vector3
  84. PARAM(P_RADIUS, Radius); // float
  85. PARAM(P_HEIGHT, Height); // float
  86. }
  87. }