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 /// Variable timestep scene update.
URHO3D_EVENT(E_SCENEUPDATE,SceneUpdate)31 URHO3D_EVENT(E_SCENEUPDATE, SceneUpdate)
32 {
33     URHO3D_PARAM(P_SCENE, Scene);                  // Scene pointer
34     URHO3D_PARAM(P_TIMESTEP, TimeStep);            // float
35 }
36 
37 /// Scene subsystem update.
URHO3D_EVENT(E_SCENESUBSYSTEMUPDATE,SceneSubsystemUpdate)38 URHO3D_EVENT(E_SCENESUBSYSTEMUPDATE, SceneSubsystemUpdate)
39 {
40     URHO3D_PARAM(P_SCENE, Scene);                  // Scene pointer
41     URHO3D_PARAM(P_TIMESTEP, TimeStep);            // float
42 }
43 
44 /// Scene transform smoothing update.
URHO3D_EVENT(E_UPDATESMOOTHING,UpdateSmoothing)45 URHO3D_EVENT(E_UPDATESMOOTHING, UpdateSmoothing)
46 {
47     URHO3D_PARAM(P_CONSTANT, Constant);            // float
48     URHO3D_PARAM(P_SQUAREDSNAPTHRESHOLD, SquaredSnapThreshold);  // float
49 }
50 
51 /// Scene drawable update finished. Custom animation (eg. IK) can be done at this point.
URHO3D_EVENT(E_SCENEDRAWABLEUPDATEFINISHED,SceneDrawableUpdateFinished)52 URHO3D_EVENT(E_SCENEDRAWABLEUPDATEFINISHED, SceneDrawableUpdateFinished)
53 {
54     URHO3D_PARAM(P_SCENE, Scene);                  // Scene pointer
55     URHO3D_PARAM(P_TIMESTEP, TimeStep);            // float
56 }
57 
58 /// SmoothedTransform target position changed.
URHO3D_EVENT(E_TARGETPOSITION,TargetPositionChanged)59 URHO3D_EVENT(E_TARGETPOSITION, TargetPositionChanged)
60 {
61 }
62 
63 /// SmoothedTransform target position changed.
URHO3D_EVENT(E_TARGETROTATION,TargetRotationChanged)64 URHO3D_EVENT(E_TARGETROTATION, TargetRotationChanged)
65 {
66 }
67 
68 /// Scene attribute animation update.
URHO3D_EVENT(E_ATTRIBUTEANIMATIONUPDATE,AttributeAnimationUpdate)69 URHO3D_EVENT(E_ATTRIBUTEANIMATIONUPDATE, AttributeAnimationUpdate)
70 {
71     URHO3D_PARAM(P_SCENE, Scene);                  // Scene pointer
72     URHO3D_PARAM(P_TIMESTEP, TimeStep);            // float
73 }
74 
75 /// Attribute animation added to object animation.
URHO3D_EVENT(E_ATTRIBUTEANIMATIONADDED,AttributeAnimationAdded)76 URHO3D_EVENT(E_ATTRIBUTEANIMATIONADDED, AttributeAnimationAdded)
77 {
78     URHO3D_PARAM(P_OBJECTANIMATION, ObjectAnimation);               // Object animation pointer
79     URHO3D_PARAM(P_ATTRIBUTEANIMATIONNAME, AttributeAnimationName); // String
80 }
81 
82 /// Attribute animation removed from object animation.
URHO3D_EVENT(E_ATTRIBUTEANIMATIONREMOVED,AttributeAnimationRemoved)83 URHO3D_EVENT(E_ATTRIBUTEANIMATIONREMOVED, AttributeAnimationRemoved)
84 {
85     URHO3D_PARAM(P_OBJECTANIMATION, ObjectAnimation);               // Object animation pointer
86     URHO3D_PARAM(P_ATTRIBUTEANIMATIONNAME, AttributeAnimationName); // String
87 }
88 
89 /// Variable timestep scene post-update.
URHO3D_EVENT(E_SCENEPOSTUPDATE,ScenePostUpdate)90 URHO3D_EVENT(E_SCENEPOSTUPDATE, ScenePostUpdate)
91 {
92     URHO3D_PARAM(P_SCENE, Scene);                  // Scene pointer
93     URHO3D_PARAM(P_TIMESTEP, TimeStep);            // float
94 }
95 
96 /// Asynchronous scene loading progress.
URHO3D_EVENT(E_ASYNCLOADPROGRESS,AsyncLoadProgress)97 URHO3D_EVENT(E_ASYNCLOADPROGRESS, AsyncLoadProgress)
98 {
99     URHO3D_PARAM(P_SCENE, Scene);                  // Scene pointer
100     URHO3D_PARAM(P_PROGRESS, Progress);            // float
101     URHO3D_PARAM(P_LOADEDNODES, LoadedNodes);      // int
102     URHO3D_PARAM(P_TOTALNODES, TotalNodes);        // int
103     URHO3D_PARAM(P_LOADEDRESOURCES, LoadedResources); // int
104     URHO3D_PARAM(P_TOTALRESOURCES, TotalResources);   // int
105 };
106 
107 /// Asynchronous scene loading finished.
URHO3D_EVENT(E_ASYNCLOADFINISHED,AsyncLoadFinished)108 URHO3D_EVENT(E_ASYNCLOADFINISHED, AsyncLoadFinished)
109 {
110     URHO3D_PARAM(P_SCENE, Scene);                  // Scene pointer
111 };
112 
113 /// A child node has been added to a parent node.
URHO3D_EVENT(E_NODEADDED,NodeAdded)114 URHO3D_EVENT(E_NODEADDED, NodeAdded)
115 {
116     URHO3D_PARAM(P_SCENE, Scene);                  // Scene pointer
117     URHO3D_PARAM(P_PARENT, Parent);                // Node pointer
118     URHO3D_PARAM(P_NODE, Node);                    // Node pointer
119 }
120 
121 /// A child node is about to be removed from a parent node. Note that individual component removal events will not be sent.
URHO3D_EVENT(E_NODEREMOVED,NodeRemoved)122 URHO3D_EVENT(E_NODEREMOVED, NodeRemoved)
123 {
124     URHO3D_PARAM(P_SCENE, Scene);                  // Scene pointer
125     URHO3D_PARAM(P_PARENT, Parent);                // Node pointer
126     URHO3D_PARAM(P_NODE, Node);                    // Node pointer
127 }
128 
129 /// A component has been created to a node.
URHO3D_EVENT(E_COMPONENTADDED,ComponentAdded)130 URHO3D_EVENT(E_COMPONENTADDED, ComponentAdded)
131 {
132     URHO3D_PARAM(P_SCENE, Scene);                  // Scene pointer
133     URHO3D_PARAM(P_NODE, Node);                    // Node pointer
134     URHO3D_PARAM(P_COMPONENT, Component);          // Component pointer
135 }
136 
137 /// A component is about to be removed from a node.
URHO3D_EVENT(E_COMPONENTREMOVED,ComponentRemoved)138 URHO3D_EVENT(E_COMPONENTREMOVED, ComponentRemoved)
139 {
140     URHO3D_PARAM(P_SCENE, Scene);                  // Scene pointer
141     URHO3D_PARAM(P_NODE, Node);                    // Node pointer
142     URHO3D_PARAM(P_COMPONENT, Component);          // Component pointer
143 }
144 
145 /// A node's name has changed.
URHO3D_EVENT(E_NODENAMECHANGED,NodeNameChanged)146 URHO3D_EVENT(E_NODENAMECHANGED, NodeNameChanged)
147 {
148     URHO3D_PARAM(P_SCENE, Scene);                  // Scene pointer
149     URHO3D_PARAM(P_NODE, Node);                    // Node pointer
150 }
151 
152 /// A node's enabled state has changed.
URHO3D_EVENT(E_NODEENABLEDCHANGED,NodeEnabledChanged)153 URHO3D_EVENT(E_NODEENABLEDCHANGED, NodeEnabledChanged)
154 {
155     URHO3D_PARAM(P_SCENE, Scene);                  // Scene pointer
156     URHO3D_PARAM(P_NODE, Node);                    // Node pointer
157 }
158 
159 /// A node's tag has been added.
URHO3D_EVENT(E_NODETAGADDED,NodeTagAdded)160 URHO3D_EVENT(E_NODETAGADDED, NodeTagAdded)
161 {
162     URHO3D_PARAM(P_SCENE, Scene);                  // Scene pointer
163     URHO3D_PARAM(P_NODE, Node);                    // Node pointer
164     URHO3D_PARAM(P_TAG, Tag);                      // String tag
165 }
166 
167 /// A node's tag has been removed.
URHO3D_EVENT(E_NODETAGREMOVED,NodeTagRemoved)168 URHO3D_EVENT(E_NODETAGREMOVED, NodeTagRemoved)
169 {
170     URHO3D_PARAM(P_SCENE, Scene);                  // Scene pointer
171     URHO3D_PARAM(P_NODE, Node);                    // Node pointer
172     URHO3D_PARAM(P_TAG, Tag);                      // String tag
173 }
174 
175 /// A component's enabled state has changed.
URHO3D_EVENT(E_COMPONENTENABLEDCHANGED,ComponentEnabledChanged)176 URHO3D_EVENT(E_COMPONENTENABLEDCHANGED, ComponentEnabledChanged)
177 {
178     URHO3D_PARAM(P_SCENE, Scene);                  // Scene pointer
179     URHO3D_PARAM(P_NODE, Node);                    // Node pointer
180     URHO3D_PARAM(P_COMPONENT, Component);          // Component pointer
181 }
182 
183 /// A serializable's temporary state has changed.
URHO3D_EVENT(E_TEMPORARYCHANGED,TemporaryChanged)184 URHO3D_EVENT(E_TEMPORARYCHANGED, TemporaryChanged)
185 {
186     URHO3D_PARAM(P_SERIALIZABLE, Serializable);    // Serializable pointer
187 }
188 
189 /// A node (and its children and components) has been cloned.
URHO3D_EVENT(E_NODECLONED,NodeCloned)190 URHO3D_EVENT(E_NODECLONED, NodeCloned)
191 {
192     URHO3D_PARAM(P_SCENE, Scene);                  // Scene pointer
193     URHO3D_PARAM(P_NODE, Node);                    // Node pointer
194     URHO3D_PARAM(P_CLONENODE, CloneNode);          // Node pointer
195 }
196 
197 /// A component has been cloned.
URHO3D_EVENT(E_COMPONENTCLONED,ComponentCloned)198 URHO3D_EVENT(E_COMPONENTCLONED, ComponentCloned)
199 {
200     URHO3D_PARAM(P_SCENE, Scene);                  // Scene pointer
201     URHO3D_PARAM(P_COMPONENT, Component);          // Component pointer
202     URHO3D_PARAM(P_CLONECOMPONENT, CloneComponent); // Component pointer
203 }
204 
205 /// A network attribute update from the server has been intercepted.
URHO3D_EVENT(E_INTERCEPTNETWORKUPDATE,InterceptNetworkUpdate)206 URHO3D_EVENT(E_INTERCEPTNETWORKUPDATE, InterceptNetworkUpdate)
207 {
208     URHO3D_PARAM(P_SERIALIZABLE, Serializable);    // Serializable pointer
209     URHO3D_PARAM(P_TIMESTAMP, TimeStamp);          // unsigned (0-255)
210     URHO3D_PARAM(P_INDEX, Index);                  // unsigned
211     URHO3D_PARAM(P_NAME, Name);                    // String
212     URHO3D_PARAM(P_VALUE, Value);                  // Variant
213 }
214 
215 }
216