1
2
3
4
5
6
7
8
9
10
11
12 package cz.cuni.amis.pogamut.ut2004.communication.messages.gbcommands;import java.util.*;import javax.vecmath.*;import cz.cuni.amis.pogamut.base.communication.messages.*;import cz.cuni.amis.pogamut.base.communication.worldview.*;import cz.cuni.amis.pogamut.base.communication.worldview.event.*;import cz.cuni.amis.pogamut.base.communication.worldview.object.*;import cz.cuni.amis.pogamut.multi.communication.worldview.object.*;import cz.cuni.amis.pogamut.base.communication.translator.event.*;import cz.cuni.amis.pogamut.multi.communication.translator.event.*;import cz.cuni.amis.pogamut.base3d.worldview.object.*;import cz.cuni.amis.pogamut.base3d.worldview.object.event.*;import cz.cuni.amis.pogamut.ut2004.communication.messages.*;import cz.cuni.amis.pogamut.ut2004.communication.worldview.objects.*;import cz.cuni.amis.pogamut.ut2004multi.communication.worldview.objects.*;import cz.cuni.amis.pogamut.ut2004.communication.translator.itemdescriptor.*;import cz.cuni.amis.pogamut.ut2004.communication.messages.ItemType.Category;import cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId;import cz.cuni.amis.utils.exception.*;import cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result;import cz.cuni.amis.utils.SafeEquals;import cz.cuni.amis.pogamut.base.agent.*;import cz.cuni.amis.pogamut.multi.agent.*;import cz.cuni.amis.pogamut.multi.communication.worldview.property.*;import cz.cuni.amis.pogamut.ut2004multi.communication.worldview.property.*;import cz.cuni.amis.utils.token.*;import cz.cuni.amis.utils.*;
13
14
15
16
17
18
19
20
21 public class SetCamera
22 extends CommandMessage
23 {
24
25
26
27 public static final String PROTOTYPE =
28 " {Id unreal_id} {Location 0,0,0} {Rotation 0,0,0} {Release False} ";
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45 public SetCamera(
46 UnrealId Id, Location Location, Rotation Rotation, Boolean Release
47 ) {
48
49 this.Id = Id;
50
51 this.Location = Location;
52
53 this.Rotation = Rotation;
54
55 this.Release = Release;
56
57 }
58
59
60
61
62
63
64
65
66
67
68
69
70
71 public SetCamera() {
72 }
73
74
75
76
77
78
79
80 public SetCamera(SetCamera original) {
81
82 this.Id = original.Id;
83
84 this.Location = original.Location;
85
86 this.Rotation = original.Rotation;
87
88 this.Release = original.Release;
89
90 }
91
92
93
94
95 protected
96 UnrealId Id =
97
98 null
99 ;
100
101
102
103
104
105
106 public UnrealId getId()
107
108 {
109 return
110 Id;
111 }
112
113
114
115
116
117
118
119 public SetCamera
120 setId(UnrealId Id)
121
122 {
123 this.Id = Id;
124 return this;
125 }
126
127
128
129
130 protected
131 Location Location =
132
133 null
134 ;
135
136
137
138
139
140
141 public Location getLocation()
142
143 {
144 return
145 Location;
146 }
147
148
149
150
151
152
153
154 public SetCamera
155 setLocation(Location Location)
156
157 {
158 this.Location = Location;
159 return this;
160 }
161
162
163
164
165 protected
166 Rotation Rotation =
167
168 null
169 ;
170
171
172
173
174
175
176 public Rotation getRotation()
177
178 {
179 return
180 Rotation;
181 }
182
183
184
185
186
187
188
189 public SetCamera
190 setRotation(Rotation Rotation)
191
192 {
193 this.Rotation = Rotation;
194 return this;
195 }
196
197
198
199
200 protected
201 Boolean Release =
202
203 null
204 ;
205
206
207
208
209
210
211 public Boolean isRelease()
212
213 {
214 return
215 Release;
216 }
217
218
219
220
221
222
223
224 public SetCamera
225 setRelease(Boolean Release)
226
227 {
228 this.Release = Release;
229 return this;
230 }
231
232 public String toString() {
233 return toMessage();
234 }
235
236 public String toHtmlString() {
237 return super.toString() + "[<br/>" +
238
239 "<b>Id</b> = " +
240 String.valueOf(getId()
241 ) +
242 " <br/> " +
243
244 "<b>Location</b> = " +
245 String.valueOf(getLocation()
246 ) +
247 " <br/> " +
248
249 "<b>Rotation</b> = " +
250 String.valueOf(getRotation()
251 ) +
252 " <br/> " +
253
254 "<b>Release</b> = " +
255 String.valueOf(isRelease()
256 ) +
257 " <br/> " +
258
259 "<br/>]"
260 ;
261 }
262
263 public String toMessage() {
264 StringBuffer buf = new StringBuffer();
265 buf.append("FORCECAM");
266
267 if (Id != null) {
268 buf.append(" {Id " + Id.getStringId() + "}");
269 }
270
271 if (Location != null) {
272 buf.append(" {Location " +
273 Location.getX() + "," +
274 Location.getY() + "," +
275 Location.getZ() + "}");
276 }
277
278 if (Rotation != null) {
279 buf.append(" {Rotation " +
280 Rotation.getPitch() + "," +
281 Rotation.getYaw() + "," +
282 Rotation.getRoll() + "}");
283 }
284
285 if (Release != null) {
286 buf.append(" {Release " + Release + "}");
287 }
288
289 return buf.toString();
290 }
291
292
293
294
295
296 }
297