1
2
3
4
5
6
7
8
9
10 package
11 cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages;
12 import java.util.*;
13 import javax.vecmath.*;
14 import cz.cuni.amis.pogamut.base.communication.messages.*;
15 import cz.cuni.amis.pogamut.base.communication.worldview.*;
16 import cz.cuni.amis.pogamut.base.communication.worldview.event.*;
17 import cz.cuni.amis.pogamut.base.communication.worldview.object.*;
18 import cz.cuni.amis.pogamut.base.communication.translator.event.*;
19 import cz.cuni.amis.pogamut.base3d.worldview.object.*;
20 import cz.cuni.amis.pogamut.base3d.worldview.object.event.*;
21 import cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId;
22 import cz.cuni.amis.pogamut.udk.communication.messages.*;
23 import cz.cuni.amis.pogamut.udk.communication.worldview.objects.*;
24 import cz.cuni.amis.pogamut.udk.communication.translator.itemdescriptor.*;
25 import cz.cuni.amis.pogamut.udk.communication.messages.ItemType.Category;
26 import cz.cuni.amis.utils.exception.*;
27 import cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result;
28 import cz.cuni.amis.utils.SafeEquals;
29 import cz.cuni.amis.pogamut.multi.communication.worldview.object.*;
30
31
32
33
34
35
36
37
38
39
40
41 public class
42 TraceResponse
43 extends GBEvent
44
45 implements IWorldEvent, IWorldChangeEvent
46
47 {
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81 public TraceResponse(
82 String Id, Location From, Location To, boolean Result, Vector3d HitNormal, Vector3d HitLocation, UnrealId HitID, boolean TraceActors) {
83
84 this.Id = Id;
85
86 this.From = From;
87
88 this.To = To;
89
90 this.Result = Result;
91
92 this.HitNormal = HitNormal;
93
94 this.HitLocation = HitLocation;
95
96 this.HitID = HitID;
97
98 this.TraceActors = TraceActors;
99
100 }
101
102
103
104 public static final String PROTOTYPE =
105 "TRC {Id text} {From 0,0,0} {To 0,0,0} {Result False} {HitNormal 0,0,0} {HitLocation 0,0,0} {HitID unreal_id} {TraceActors False}";
106
107
108
109
110
111
112
113
114
115 protected
116 String Id =
117 null;
118
119
120
121
122
123
124
125 public
126 String getId() {
127 return
128 Id;
129 }
130
131
132
133
134
135
136
137 protected
138 Location From =
139 null;
140
141
142
143
144
145
146 public
147 Location getFrom() {
148 return
149 From;
150 }
151
152
153
154
155
156
157
158 protected
159 Location To =
160 null;
161
162
163
164
165
166
167 public
168 Location getTo() {
169 return
170 To;
171 }
172
173
174
175
176
177
178
179 protected
180 boolean Result =
181 false;
182
183
184
185
186
187
188 public
189 boolean isResult() {
190 return
191 Result;
192 }
193
194
195
196
197
198
199
200 protected
201 Vector3d HitNormal =
202 null;
203
204
205
206
207
208
209 public
210 Vector3d getHitNormal() {
211 return
212 HitNormal;
213 }
214
215
216
217
218
219 protected
220 Vector3d HitLocation =
221 null;
222
223
224
225
226 public
227 Vector3d getHitLocation() {
228 return
229 HitLocation;
230 }
231
232
233
234
235
236
237
238
239 protected
240 UnrealId HitID =
241 null;
242
243
244
245
246
247
248
249 public
250 UnrealId getHitID() {
251 return
252 HitID;
253 }
254
255
256
257
258
259
260
261
262 protected
263 boolean TraceActors =
264 false;
265
266
267
268
269
270
271
272 public
273 boolean isTraceActors() {
274 return
275 TraceActors;
276 }
277
278
279
280
281
282
283
284
285
286 public long getSimTime() {
287
288 return 0;
289 }
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306 public TraceResponse(TraceResponse original) {
307
308 this.Id=original.Id;
309
310 this.From=original.From;
311
312 this.To=original.To;
313
314 this.Result=original.Result;
315
316 this.HitNormal=original.HitNormal;
317
318 this.HitLocation=original.HitLocation;
319
320 this.HitID=original.HitID;
321
322 this.TraceActors=original.TraceActors;
323
324 }
325
326
327
328
329
330 public TraceResponse() {
331 }
332
333
334
335 public String toString() {
336 return
337
338 super.toString() + " | " +
339
340 "Id = " +
341 String.valueOf(Id) + " | " +
342
343 "From = " +
344 String.valueOf(From) + " | " +
345
346 "To = " +
347 String.valueOf(To) + " | " +
348
349 "Result = " +
350 String.valueOf(Result) + " | " +
351
352 "HitNormal = " +
353 String.valueOf(HitNormal) + " | " +
354
355 "HitLocation = " +
356 String.valueOf(HitLocation) + " | " +
357
358 "HitID = " +
359 String.valueOf(HitID) + " | " +
360
361 "TraceActors = " +
362 String.valueOf(TraceActors) + " | " +
363 "";
364
365 }
366
367 public String toHtmlString() {
368 return super.toString() +
369
370 "<b>Id</b> : " +
371 String.valueOf(Id) +
372 " <br/> " +
373
374 "<b>From</b> : " +
375 String.valueOf(From) +
376 " <br/> " +
377
378 "<b>To</b> : " +
379 String.valueOf(To) +
380 " <br/> " +
381
382 "<b>Result</b> : " +
383 String.valueOf(Result) +
384 " <br/> " +
385
386 "<b>HitNormal</b> : " +
387 String.valueOf(HitNormal) +
388 " <br/> " +
389
390 "<b>HitLocation</b> : " +
391 String.valueOf(HitLocation) +
392 " <br/> " +
393
394 "<b>HitID</b> : " +
395 String.valueOf(HitID) +
396 " <br/> " +
397
398 "<b>TraceActors</b> : " +
399 String.valueOf(TraceActors) +
400 " <br/> " +
401 "";
402 }
403
404
405
406 }
407
408