1
2
3
4
5
6
7
8
9
10 package
11 cz.cuni.amis.pogamut.udk.communication.messages.gbcommands;
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 TurnTo extends
43 CommandMessage
44
45 {
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68 public TurnTo(
69 UnrealId Target, Rotation Rotation, Location Location) {
70
71 this.Target = Target;
72
73 this.Rotation = Rotation;
74
75 this.Location = Location;
76
77 }
78
79
80
81
82
83
84
85
86
87
88 public TurnTo() {
89 }
90
91
92
93
94
95
96
97
98
99 protected
100 UnrealId Target =
101 null;
102
103
104
105
106
107
108
109 public
110 UnrealId getTarget() {
111 return
112 Target;
113 }
114
115
116
117
118
119
120
121
122 public TurnTo setTarget(UnrealId Target) {
123 this.Target = Target;
124 return this;
125 }
126
127
128
129
130
131
132
133
134 protected
135 Rotation Rotation =
136 null;
137
138
139
140
141
142
143
144
145
146 public
147 Rotation getRotation() {
148 return
149 Rotation;
150 }
151
152
153
154
155
156
157
158
159
160
161 public TurnTo setRotation(Rotation Rotation) {
162 this.Rotation = Rotation;
163 return this;
164 }
165
166
167
168
169
170
171 protected
172 Location Location =
173 null;
174
175
176
177
178
179
180
181 public
182 Location getLocation() {
183 return
184 Location;
185 }
186
187
188
189
190
191
192
193
194 public TurnTo setLocation(Location Location) {
195 this.Location = Location;
196 return this;
197 }
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220 public TurnTo(TurnTo original) {
221
222 this.Target=original.Target;
223
224 this.Rotation=original.Rotation;
225
226 this.Location=original.Location;
227
228 }
229
230
231
232
233 public String toString() {
234 return
235
236 toMessage();
237
238 }
239
240 public String toHtmlString() {
241 return super.toString() +
242
243 "<b>Target</b> : " +
244 String.valueOf(Target) +
245 " <br/> " +
246
247 "<b>Rotation</b> : " +
248 String.valueOf(Rotation) +
249 " <br/> " +
250
251 "<b>Location</b> : " +
252 String.valueOf(Location) +
253 " <br/> " +
254 "";
255 }
256
257
258
259 public String toMessage() {
260 StringBuffer buf = new StringBuffer();
261 buf.append("TURNTO");
262
263 if (Target != null) {
264 buf.append(" {Target " + Target.getStringId() + "}");
265 }
266
267 if (Rotation != null) {
268 buf.append(" {Rotation " +
269 Rotation.getPitch() + "," +
270 Rotation.getYaw() + "," +
271 Rotation.getRoll() + "}");
272 }
273
274 if (Location != null) {
275 buf.append(" {Location " +
276 Location.getX() + "," +
277 Location.getY() + "," +
278 Location.getZ() + "}");
279 }
280
281 return buf.toString();
282 }
283
284 }
285
286