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
23 #pragma once
24
25 #include "../Core/Object.h"
26
27 namespace Urho3D
28 {
29
30 /// Complete rebuild of navigation mesh.
URHO3D_EVENT(E_NAVIGATION_MESH_REBUILT,NavigationMeshRebuilt)31 URHO3D_EVENT(E_NAVIGATION_MESH_REBUILT, NavigationMeshRebuilt)
32 {
33 URHO3D_PARAM(P_NODE, Node); // Node pointer
34 URHO3D_PARAM(P_MESH, Mesh); // NavigationMesh pointer
35 }
36
37 /// Partial bounding box rebuild of navigation mesh.
URHO3D_EVENT(E_NAVIGATION_AREA_REBUILT,NavigationAreaRebuilt)38 URHO3D_EVENT(E_NAVIGATION_AREA_REBUILT, NavigationAreaRebuilt)
39 {
40 URHO3D_PARAM(P_NODE, Node); // Node pointer
41 URHO3D_PARAM(P_MESH, Mesh); // NavigationMesh pointer
42 URHO3D_PARAM(P_BOUNDSMIN, BoundsMin); // Vector3
43 URHO3D_PARAM(P_BOUNDSMAX, BoundsMax); // Vector3
44 }
45
46 /// Mesh tile is added to navigation mesh.
URHO3D_EVENT(E_NAVIGATION_TILE_ADDED,NavigationTileAdded)47 URHO3D_EVENT(E_NAVIGATION_TILE_ADDED, NavigationTileAdded)
48 {
49 URHO3D_PARAM(P_NODE, Node); // Node pointer
50 URHO3D_PARAM(P_MESH, Mesh); // NavigationMesh pointer
51 URHO3D_PARAM(P_TILE, Tile); // IntVector2
52 }
53
54 /// Mesh tile is removed from navigation mesh.
URHO3D_EVENT(E_NAVIGATION_TILE_REMOVED,NavigationTileRemoved)55 URHO3D_EVENT(E_NAVIGATION_TILE_REMOVED, NavigationTileRemoved)
56 {
57 URHO3D_PARAM(P_NODE, Node); // Node pointer
58 URHO3D_PARAM(P_MESH, Mesh); // NavigationMesh pointer
59 URHO3D_PARAM(P_TILE, Tile); // IntVector2
60 }
61
62 /// All mesh tiles are removed from navigation mesh.
URHO3D_EVENT(E_NAVIGATION_ALL_TILES_REMOVED,NavigationAllTilesRemoved)63 URHO3D_EVENT(E_NAVIGATION_ALL_TILES_REMOVED, NavigationAllTilesRemoved)
64 {
65 URHO3D_PARAM(P_NODE, Node); // Node pointer
66 URHO3D_PARAM(P_MESH, Mesh); // NavigationMesh pointer
67 }
68
69 /// Crowd agent formation.
URHO3D_EVENT(E_CROWD_AGENT_FORMATION,CrowdAgentFormation)70 URHO3D_EVENT(E_CROWD_AGENT_FORMATION, CrowdAgentFormation)
71 {
72 URHO3D_PARAM(P_NODE, Node); // Node pointer
73 URHO3D_PARAM(P_CROWD_AGENT, CrowdAgent); // CrowdAgent pointer
74 URHO3D_PARAM(P_INDEX, Index); // unsigned
75 URHO3D_PARAM(P_SIZE, Size); // unsigned
76 URHO3D_PARAM(P_POSITION, Position); // Vector3 [in/out]
77 }
78
79 /// Crowd agent formation specific to a node.
URHO3D_EVENT(E_CROWD_AGENT_NODE_FORMATION,CrowdAgentNodeFormation)80 URHO3D_EVENT(E_CROWD_AGENT_NODE_FORMATION, CrowdAgentNodeFormation)
81 {
82 URHO3D_PARAM(P_NODE, Node); // Node pointer
83 URHO3D_PARAM(P_CROWD_AGENT, CrowdAgent); // CrowdAgent pointer
84 URHO3D_PARAM(P_INDEX, Index); // unsigned
85 URHO3D_PARAM(P_SIZE, Size); // unsigned
86 URHO3D_PARAM(P_POSITION, Position); // Vector3 [in/out]
87 }
88
89 /// Crowd agent has been repositioned.
URHO3D_EVENT(E_CROWD_AGENT_REPOSITION,CrowdAgentReposition)90 URHO3D_EVENT(E_CROWD_AGENT_REPOSITION, CrowdAgentReposition)
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_ARRIVED, Arrived); // bool
97 URHO3D_PARAM(P_TIMESTEP, TimeStep); // float
98 }
99
100 /// Crowd agent has been repositioned, specific to a node
URHO3D_EVENT(E_CROWD_AGENT_NODE_REPOSITION,CrowdAgentNodeReposition)101 URHO3D_EVENT(E_CROWD_AGENT_NODE_REPOSITION, CrowdAgentNodeReposition)
102 {
103 URHO3D_PARAM(P_NODE, Node); // Node pointer
104 URHO3D_PARAM(P_CROWD_AGENT, CrowdAgent); // CrowdAgent pointer
105 URHO3D_PARAM(P_POSITION, Position); // Vector3
106 URHO3D_PARAM(P_VELOCITY, Velocity); // Vector3
107 URHO3D_PARAM(P_ARRIVED, Arrived); // bool
108 URHO3D_PARAM(P_TIMESTEP, TimeStep); // float
109 }
110
111 /// Crowd agent's internal state has become invalidated. This is a special case of CrowdAgentStateChanged event.
URHO3D_EVENT(E_CROWD_AGENT_FAILURE,CrowdAgentFailure)112 URHO3D_EVENT(E_CROWD_AGENT_FAILURE, CrowdAgentFailure)
113 {
114 URHO3D_PARAM(P_NODE, Node); // Node pointer
115 URHO3D_PARAM(P_CROWD_AGENT, CrowdAgent); // CrowdAgent pointer
116 URHO3D_PARAM(P_POSITION, Position); // Vector3
117 URHO3D_PARAM(P_VELOCITY, Velocity); // Vector3
118 URHO3D_PARAM(P_CROWD_AGENT_STATE, CrowdAgentState); // int
119 URHO3D_PARAM(P_CROWD_TARGET_STATE, CrowdTargetState); // int
120 }
121
122 /// Crowd agent's internal state has become invalidated. This is a special case of CrowdAgentStateChanged event.
URHO3D_EVENT(E_CROWD_AGENT_NODE_FAILURE,CrowdAgentNodeFailure)123 URHO3D_EVENT(E_CROWD_AGENT_NODE_FAILURE, CrowdAgentNodeFailure)
124 {
125 URHO3D_PARAM(P_NODE, Node); // Node pointer
126 URHO3D_PARAM(P_CROWD_AGENT, CrowdAgent); // CrowdAgent pointer
127 URHO3D_PARAM(P_POSITION, Position); // Vector3
128 URHO3D_PARAM(P_VELOCITY, Velocity); // Vector3
129 URHO3D_PARAM(P_CROWD_AGENT_STATE, CrowdAgentState); // int
130 URHO3D_PARAM(P_CROWD_TARGET_STATE, CrowdTargetState); // int
131 }
132
133 /// Crowd agent's state has been changed.
URHO3D_EVENT(E_CROWD_AGENT_STATE_CHANGED,CrowdAgentStateChanged)134 URHO3D_EVENT(E_CROWD_AGENT_STATE_CHANGED, CrowdAgentStateChanged)
135 {
136 URHO3D_PARAM(P_NODE, Node); // Node pointer
137 URHO3D_PARAM(P_CROWD_AGENT, CrowdAgent); // CrowdAgent pointer
138 URHO3D_PARAM(P_POSITION, Position); // Vector3
139 URHO3D_PARAM(P_VELOCITY, Velocity); // Vector3
140 URHO3D_PARAM(P_CROWD_AGENT_STATE, CrowdAgentState); // int
141 URHO3D_PARAM(P_CROWD_TARGET_STATE, CrowdTargetState); // int
142 }
143
144 /// Crowd agent's state has been changed.
URHO3D_EVENT(E_CROWD_AGENT_NODE_STATE_CHANGED,CrowdAgentNodeStateChanged)145 URHO3D_EVENT(E_CROWD_AGENT_NODE_STATE_CHANGED, CrowdAgentNodeStateChanged)
146 {
147 URHO3D_PARAM(P_NODE, Node); // Node pointer
148 URHO3D_PARAM(P_CROWD_AGENT, CrowdAgent); // CrowdAgent pointer
149 URHO3D_PARAM(P_POSITION, Position); // Vector3
150 URHO3D_PARAM(P_VELOCITY, Velocity); // Vector3
151 URHO3D_PARAM(P_CROWD_AGENT_STATE, CrowdAgentState); // int
152 URHO3D_PARAM(P_CROWD_TARGET_STATE, CrowdTargetState); // int
153 }
154
155 /// Addition of obstacle to dynamic navigation mesh.
URHO3D_EVENT(E_NAVIGATION_OBSTACLE_ADDED,NavigationObstacleAdded)156 URHO3D_EVENT(E_NAVIGATION_OBSTACLE_ADDED, NavigationObstacleAdded)
157 {
158 URHO3D_PARAM(P_NODE, Node); // Node pointer
159 URHO3D_PARAM(P_OBSTACLE, Obstacle); // Obstacle pointer
160 URHO3D_PARAM(P_POSITION, Position); // Vector3
161 URHO3D_PARAM(P_RADIUS, Radius); // float
162 URHO3D_PARAM(P_HEIGHT, Height); // float
163 }
164
165 /// Removal of obstacle from dynamic navigation mesh.
URHO3D_EVENT(E_NAVIGATION_OBSTACLE_REMOVED,NavigationObstacleRemoved)166 URHO3D_EVENT(E_NAVIGATION_OBSTACLE_REMOVED, NavigationObstacleRemoved)
167 {
168 URHO3D_PARAM(P_NODE, Node); // Node pointer
169 URHO3D_PARAM(P_OBSTACLE, Obstacle); // Obstacle pointer
170 URHO3D_PARAM(P_POSITION, Position); // Vector3
171 URHO3D_PARAM(P_RADIUS, Radius); // float
172 URHO3D_PARAM(P_HEIGHT, Height); // float
173 }
174
175 }
176