summaryrefslogtreecommitdiff
path: root/NET/worlds/scape/Rect.java
blob: 4a9488c293e852fcb23c2748532c88e5cd628c05 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
/*     */ package NET.worlds.scape;
/*     */ 
/*     */ import NET.worlds.console.Console;
/*     */ import NET.worlds.console.DefaultConsole;
/*     */ import NET.worlds.console.RenderCanvas;
/*     */ import java.io.IOException;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class Rect
/*     */   extends Surface
/*     */   implements MouseDownHandler, FrameHandler, Prerenderable
/*     */ {
/*     */   public Rect(float w, float h, Material material)
/*     */   {
/*  76 */     super(material);
/*     */     
/*     */ 
/*  79 */     scale(w, h, h);
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public Rect(float x, float y, float z, Material material)
/*     */   {
/*  88 */     super(material);
/*  89 */     setFarCorner(Point3Temp.make(x, y, z));
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public Rect(float llx, float lly, float llz, float urx, float ury, float urz, Material material)
/*     */   {
/*  98 */     super(material);
/*  99 */     moveBy(llx, lly, llz);
/* 100 */     setFarCorner(Point3Temp.make(urx, ury, urz));
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public Rect(Point3Temp llc, Point3Temp urc, Material material)
/*     */   {
/* 108 */     this(llc.x, llc.y, llc.z, urc.x, urc.y, urc.z, material);
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public static boolean setFarCornerHelper(Transform t, Point3Temp newCorner)
/*     */   {
/* 149 */     t.scale(1.0F / t.getScaleX(), 1.0F / t.getScaleY(), 1.0F / t.getScaleZ());
/*     */     
/*     */ 
/*     */ 
/* 153 */     Point3Temp lookRight = Point3Temp.make(1.0F, 0.0F, 0.0F).vectorTimes(t);
/* 154 */     Point3Temp lookOut = Point3Temp.make(0.0F, 1.0F, 0.0F).vectorTimes(t);
/* 155 */     Point3Temp lookUp = Point3Temp.make(0.0F, 0.0F, 1.0F).vectorTimes(t);
/*     */     
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/* 161 */     Point3Temp newEndOffset = Point3Temp.make(newCorner).minus(
/* 162 */       t.getPosition());
/* 163 */     float x = newEndOffset.dot(lookRight);
/* 164 */     float y = newEndOffset.dot(lookOut);
/* 165 */     float z = newEndOffset.dot(lookUp);
/*     */     
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/* 171 */     if (z >= 0.0F)
/*     */     {
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/* 180 */       if ((x != 0.0F) || (y != 0.0F)) {
/* 181 */         t.spin(0.0F, 0.0F, 1.0F, (float)(Math.atan2(y, x) * 180.0D / 3.141592653589793D));
/*     */       }
/*     */       
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/* 192 */       t.scale((float)Math.sqrt(x * x + y * y), z, z);
/* 193 */       return true;
/*     */     }
/* 195 */     return false;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public boolean setFarCorner(Point3Temp newCorner)
/*     */   {
/* 203 */     Transform t = getTransform();
/* 204 */     if (setFarCornerHelper(t, newCorner)) {
/* 205 */       setTransform(t);
/* 206 */       t.recycle();
/* 207 */       return true;
/*     */     }
/* 209 */     t.recycle();
/* 210 */     Console.println(Console.message("cant-rot-rect"));
/* 211 */     return false;
/*     */   }
/*     */   
/*     */ 
/*     */   public Point3Temp getFarCorner()
/*     */   {
/* 217 */     Point3Temp ret = Point3Temp.make(1.0F, 0.0F, 1.0F);
/*     */     
/* 219 */     if (hasClump()) {
/* 220 */       Transform t = getObjectToWorldMatrix();
/* 221 */       ret.times(t);
/* 222 */       t.recycle();
/*     */     } else {
/* 224 */       ret.times(this);
/*     */     }
/* 226 */     return ret;
/*     */   }
/*     */   
/*     */ 
/*     */   public Point3Temp getFarCornerLocal()
/*     */   {
/* 232 */     Point3Temp ret = Point3Temp.make(1.0F, 0.0F, 1.0F);
/*     */     
/* 234 */     if (hasClump()) {
/* 235 */       Transform t = getTransform();
/* 236 */       ret.times(t);
/* 237 */       t.recycle();
/*     */     } else {
/* 239 */       ret.times(this);
/*     */     }
/* 241 */     return ret;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public void setNearCorner(Point3Temp from)
/*     */   {
/* 249 */     Point3Temp oldEnd = getFarCornerLocal();
/* 250 */     Point3Temp oldStart = getPosition();
/* 251 */     moveTo(from);
/* 252 */     if (!setFarCorner(oldEnd)) {
/* 253 */       moveTo(oldStart);
/*     */     }
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public Point3Temp getPlaneExtent()
/*     */   {
/* 262 */     return Point3Temp.make(1.0F, 0.0F, 1.0F);
/*     */   }
/*     */   
/* 265 */   static BumpCalc standardPlaneBumpCalc = new PlaneBumpCalc();
/*     */   
/*     */   static {
/* 268 */     standardPlaneBumpCalc.setName("defaultPlaneBumpCalc");
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */   public BumpCalc getBumpCalc(BumpEventTemp b)
/*     */   {
/* 275 */     if (this.bumpCalc == null)
/* 276 */       return standardPlaneBumpCalc;
/* 277 */     return this.bumpCalc;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public Point2 getTileSize()
/*     */   {
/* 285 */     return new Point2(this.u != 1.0F ? getScaleX() / this.u : 0.0F, this.v != 1.0F ? getScaleZ() / 
/* 286 */       this.v : 0.0F);
/*     */   }
/*     */   
/*     */   void setUV(float u, float v)
/*     */   {
/* 291 */     setTileSize(getScaleX() / u, getScaleZ() / v);
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public Rect setTileSize(float tx, float ty)
/*     */   {
/* 299 */     this.u = (tx == 0.0F ? 1.0F : getScaleX() / tx);
/* 300 */     this.v = (ty == 0.0F ? 1.0F : getScaleZ() / ty);
/*     */     
/* 302 */     reclump();
/*     */     
/* 304 */     return this;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public void setTileOffset(Point2 p)
/*     */   {
/* 312 */     this.uOff = (getScaleX() == 0.0F ? 0.0F : p.x / getScaleX());
/* 313 */     this.vOff = (getScaleZ() == 0.0F ? 0.0F : p.y / getScaleZ());
/* 314 */     reclump();
/*     */   }
/*     */   
/*     */   public Point2 getTileOffset() {
/* 318 */     return new Point2(this.uOff * getScaleX(), this.vOff * getScaleZ());
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public static Rect floor(float x, float y, Material m)
/*     */   {
/* 331 */     return (Rect)new Rect(x, y, m).setBumpable(false).postspin(1.0F, 0.0F, 0.0F, 
/* 332 */       -90.0F);
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public static Rect floor(float llx, float lly, float z, float urx, float ury, Material m)
/*     */   {
/* 341 */     return (Rect)floor(urx - llx, ury - lly, m).moveBy(llx, lly, z);
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public static Rect ceiling(float x, float y, Material m)
/*     */   {
/* 349 */     return (Rect)new Rect(x, y, m).setBumpable(false)
/* 350 */       .postspin(1.0F, 0.0F, 0.0F, 90.0F).moveBy(0.0F, y, 0.0F);
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public static Rect ceiling(float llx, float lly, float z, float urx, float ury, Material m)
/*     */   {
/* 359 */     return (Rect)ceiling(urx - llx, ury - lly, m).moveBy(llx, lly, z);
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public Rect hang(float pllx, float pllz, float purx, float purz, Material pic)
/*     */   {
/* 377 */     Rect r = (Rect)new Rect((purx - pllx) / getScaleX(), (purz - pllz) / 
/* 378 */       getScaleZ(), pic).moveBy(pllx / getScaleX(), 0.0F, 
/* 379 */       pllz / getScaleZ()).post(this);
/*     */     
/*     */ 
/*     */ 
/* 383 */     return (Rect)r.premoveBy(0.0F, -1.0F / r.getScale().length(), 0.0F);
/*     */   }
/*     */   
/* 386 */   Billboard _billboardAttribute = null;
/* 387 */   VideoTexture _videoAttribute = null;
/*     */   
/*     */   public VideoTexture getVideoAttribute() {
/* 390 */     return this._videoAttribute;
/*     */   }
/*     */   
/*     */   public Billboard getBillboardAttribute() {
/* 394 */     return this._billboardAttribute;
/*     */   }
/*     */   
/* 397 */   boolean visible = false;
/*     */   
/*     */   public boolean handle(MouseDownEvent event)
/*     */   {
/* 401 */     if ((this._billboardAttribute != null) && 
/* 402 */       ((event.key & 0x1) == '\001')) {
/* 403 */       Point2 pt = deproject();
/* 404 */       this._billboardAttribute.billboardClicked(pt);
/*     */     }
/*     */     
/*     */ 
/* 408 */     return false;
/*     */   }
/*     */   
/*     */   public boolean handle(FrameEvent f) {
/* 412 */     if ((this._billboardAttribute != null) && (getVisible()) && 
/* 413 */       (this.visible)) {
/* 414 */       this._billboardAttribute.billboardFrame(f);
/*     */     }
/*     */     
/*     */ 
/* 418 */     if ((this._videoAttribute != null) && (getVisible()) && 
/* 419 */       (this.visible)) {
/* 420 */       this._videoAttribute.videoFrame(f);
/*     */     }
/*     */     
/*     */ 
/* 424 */     this.visible = false;
/*     */     
/* 426 */     return false;
/*     */   }
/*     */   
/*     */   public void prerender(Camera cam) {
/* 430 */     if ((this._billboardAttribute != null) || (this._videoAttribute != null)) {
/* 431 */       Point3Temp p = inCamSpace(cam);
/*     */       
/*     */ 
/*     */ 
/* 435 */       boolean v = (p != null) && (p.z > 1.0F) && (p.x < p.z) && (-p.x < p.z);
/*     */       
/* 437 */       if (v) {
/* 438 */         this.visible = true;
/*     */       }
/*     */     }
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   protected Point2 deproject()
/*     */   {
/* 448 */     Console c = Console.getActive();
/*     */     
/*     */     Point3Temp worldClick;
/* 451 */     if ((c instanceof DefaultConsole)) {
/* 452 */       DefaultConsole dc = (DefaultConsole)c;
/* 453 */       worldClick = dc.getRender().getCamera().lastPickSpot();
/*     */     } else {
/* 455 */       return new Point2(-1.0F, -1.0F);
/*     */     }
/*     */     
/*     */     Point3Temp worldClick;
/* 459 */     Point3Temp vWorld = Point3Temp.make(worldClick);
/* 460 */     vWorld.minus(getObjectToWorldMatrix().getPosition());
/*     */     
/*     */ 
/* 463 */     Transform inv = getObjectToWorldMatrix().invert();
/* 464 */     Point3Temp vObj = Point3Temp.make(vWorld).vectorTimes(inv);
/* 465 */     inv.recycle();
/*     */     
/*     */ 
/* 468 */     Point2 rectPt = new Point2();
/*     */     
/*     */ 
/* 471 */     rectPt.set(vObj.x, vObj.z);
/*     */     
/* 473 */     return rectPt;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/* 478 */   protected float u = 1.0F; protected float v = 1.0F;
/*     */   
/*     */   protected float uOff;
/*     */   protected float vOff;
/*     */   
/*     */   protected void addRwChildren(WObject container)
/*     */   {
/* 485 */     addNewRwChild(container);
/*     */     
/*     */ 
/* 488 */     float uo = this.uOff;
/* 489 */     if (uo != 0.0F) {
/* 490 */       uo *= this.u;
/* 491 */       uo = (float)(uo - 2.0D * Math.floor(uo / 2.0F));
/*     */     }
/*     */     
/* 494 */     float vo = this.vOff;
/* 495 */     if (vo != 0.0F) {
/* 496 */       vo *= this.v;
/* 497 */       vo = (float)(vo - 2.0D * Math.floor(vo / 2.0F));
/*     */     }
/*     */     
/* 500 */     addVertex(0.0F, 0.0F, 0.0F, uo, this.v + vo);
/* 501 */     addVertex(1.0F, 0.0F, 0.0F, this.u + uo, this.v + vo);
/* 502 */     addVertex(1.0F, 0.0F, 1.0F, this.u + uo, vo);
/* 503 */     addVertex(0.0F, 0.0F, 1.0F, uo, vo);
/*     */     
/* 505 */     doneWithEditing();
/*     */     
/* 507 */     if (!(this instanceof Portal))
/* 508 */       getRoom().addPrerenderHandler(this);
/*     */   }
/*     */   
/*     */   protected void markVoid() {
/* 512 */     if (!(this instanceof Portal))
/* 513 */       getRoom().removePrerenderHandler(this);
/* 514 */     super.markVoid();
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */   public Object properties(int index, int offset, int mode, Object value)
/*     */     throws NoSuchPropertyException
/*     */   {
/* 522 */     Object ret = null;
/* 523 */     switch (index - offset) {
/*     */     case 0: 
/* 525 */       if (mode == 0) {
/* 526 */         ret = Point2PropertyEditor.make(new Property(this, index, 
/* 527 */           "Tile Size"));
/* 528 */       } else if (mode == 1) {
/* 529 */         ret = getTileSize();
/* 530 */       } else if (mode == 2) {
/* 531 */         Point2 p = (Point2)value;
/* 532 */         if ((p.x < 0.0F) || (p.y < 0.0F)) {
/* 533 */           Console.println(Console.message("Tile-size"));
/*     */         } else {
/* 535 */           setTileSize(p.x, p.y);
/*     */         }
/*     */       }
/* 538 */       break;
/*     */     case 1: 
/* 540 */       if (mode == 0) {
/* 541 */         ret = Point2PropertyEditor.make(new Property(this, index, 
/* 542 */           "Tile Origin"));
/* 543 */       } else if (mode == 1) {
/* 544 */         ret = getTileOffset();
/* 545 */       } else if (mode == 2)
/* 546 */         setTileOffset((Point2)value);
/* 547 */       break;
/*     */     case 2: 
/* 549 */       if (mode == 0) {
/* 550 */         ret = Point3PropertyEditor.make(new Property(this, index, 
/* 551 */           "From"));
/* 552 */       } else if (mode == 1) {
/* 553 */         ret = new Point3(getPosition());
/* 554 */       } else if (mode == 2)
/* 555 */         setNearCorner((Point3)value);
/* 556 */       break;
/*     */     case 3: 
/* 558 */       if (mode == 0) {
/* 559 */         ret = 
/* 560 */           Point3PropertyEditor.make(new Property(this, index, "To"));
/* 561 */       } else if (mode == 1) {
/* 562 */         ret = new Point3(getFarCornerLocal());
/* 563 */       } else if (mode == 2)
/* 564 */         setFarCorner((Point3)value);
/* 565 */       break;
/*     */     case 4: 
/* 567 */       if (mode == 0) {
/* 568 */         ret = Point2PropertyEditor.make(new Property(this, index, 
/* 569 */           "Extent"));
/* 570 */       } else if (mode == 1) {
/* 571 */         ret = new Point2(getScaleX(), getScaleZ());
/* 572 */       } else if (mode == 2) {
/* 573 */         float zScale = ((Point2)value).y / getScaleZ();
/* 574 */         scale(((Point2)value).x / getScaleX(), zScale, zScale);
/*     */       }
/* 576 */       break;
/*     */     case 5: 
/* 578 */       if (mode == 0) {
/* 579 */         ret = BooleanPropertyEditor.make(new Property(this, index, 
/* 580 */           "Flip Alternate U"), "No", "Yes");
/* 581 */       } else if (mode == 1) {
/* 582 */         ret = new Boolean(getUFlip());
/* 583 */       } else if (mode == 2) {
/* 584 */         setUFlip(((Boolean)value).booleanValue());
/* 585 */         reclump();
/*     */       }
/* 587 */       break;
/*     */     case 6: 
/* 589 */       if (mode == 0) {
/* 590 */         ret = BooleanPropertyEditor.make(new Property(this, index, 
/* 591 */           "Flip Alternate V"), "No", "Yes");
/* 592 */       } else if (mode == 1) {
/* 593 */         ret = new Boolean(getVFlip());
/* 594 */       } else if (mode == 2) {
/* 595 */         setVFlip(((Boolean)value).booleanValue());
/* 596 */         reclump();
/*     */       }
/* 598 */       break;
/*     */     case 7: 
/* 600 */       if (mode == 0) {
/* 601 */         ret = BooleanPropertyEditor.make(new Property(this, index, 
/* 602 */           "Unused"), "No", "Yes");
/* 603 */       } else if (mode == 1) {
/* 604 */         ret = new Boolean(getMouseOver());
/* 605 */       } else if (mode == 2) {
/* 606 */         setMouseOver(((Boolean)value).booleanValue());
/*     */       }
/* 608 */       break;
/*     */     default: 
/* 610 */       ret = super.properties(index, offset + 8, mode, value);
/*     */     }
/* 612 */     return ret;
/*     */   }
/*     */   
/* 615 */   private static Object classCookie = new Object();
/*     */   
/*     */   public void saveState(Saver s) throws IOException {
/* 618 */     s.saveVersion(4, classCookie);
/* 619 */     super.saveState(s);
/* 620 */     s.saveFloat(this.u);
/* 621 */     s.saveFloat(this.v);
/* 622 */     s.saveFloat(this.uOff);
/* 623 */     s.saveFloat(this.vOff);
/* 624 */     s.saveBoolean(false);
/*     */   }
/*     */   
/*     */   public void restoreState(Restorer r) throws IOException, TooNewException {
/* 628 */     int vers = r.restoreVersion(classCookie);
/* 629 */     switch (vers) {
/*     */     case 4: 
/* 631 */       super.restoreState(r);
/* 632 */       this.u = r.restoreFloat();
/* 633 */       this.v = r.restoreFloat();
/* 634 */       this.uOff = r.restoreFloat();
/* 635 */       this.vOff = r.restoreFloat();
/* 636 */       r.restoreBoolean();
/* 637 */       break;
/*     */     case 3: 
/* 639 */       super.restoreState(r);
/* 640 */       this.u = r.restoreFloat();
/* 641 */       this.v = r.restoreFloat();
/* 642 */       this.uOff = r.restoreFloat();
/* 643 */       this.vOff = r.restoreFloat();
/* 644 */       break;
/*     */     case 2: 
/* 646 */       super.restoreState(r);
/* 647 */       this.u = r.restoreFloat();
/* 648 */       this.v = r.restoreFloat();
/* 649 */       break;
/*     */     case 0: 
/*     */     case 1: 
/* 652 */       super.restoreState(r);
/* 653 */       float x = r.restoreFloat();
/* 654 */       float y = r.restoreFloat();
/* 655 */       float z = r.restoreFloat();
/* 656 */       r.restoreFloat();
/* 657 */       r.restoreFloat();
/* 658 */       r.restoreFloat();
/* 659 */       this.u = r.restoreFloat();
/* 660 */       this.v = r.restoreFloat();
/*     */       
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/* 669 */       spin(0.0F, 0.0F, 1.0F, (float)(Math.atan2(y, x) * 180.0D / 3.141592653589793D));
/* 670 */       scale((float)Math.sqrt(x * x + y * y), z, z);
/* 671 */       break;
/*     */     default: 
/* 673 */       throw new TooNewException();
/*     */     }
/*     */   }
/*     */   
/*     */   public String toString() {
/* 678 */     return 
/* 679 */       super.toString() + "[" + getPosition() + "->" + getFarCornerLocal() + "]";
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */   public boolean acceptsLeftClicks()
/*     */   {
/* 686 */     if ((this._billboardAttribute != null) && 
/* 687 */       (this._billboardAttribute.getIsAdBanner())) {
/* 688 */       return true;
/*     */     }
/*     */     
/*     */ 
/*     */ 
/* 693 */     return getMouseOver();
/*     */   }
/*     */   
/*     */   Rect() {}
/*     */ }


/* Location:              C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\Rect.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */