1 : #VRML V2.0 utf8
2 :
3 : WorldInfo {
4 : info "Author: Martin Petricek"
5 : title "Tank"
6 : }
7 :
8 : PROTO BlackHole[]{
9 : Appearance {
10 : material Material {
11 : diffuseColor 0 0 0
12 : }
13 : }
14 : }
15 :
16 : PROTO Red[]{
17 : Appearance {
18 : material Material {
19 : diffuseColor .5 0 0
20 : emissiveColor .5 0 0
21 : }
22 : }
23 : }
24 :
25 : PROTO TankInside[]{
26 : Appearance {
27 : material Material {
28 : diffuseColor .3 .3 0
29 : ambientIntensity .6
30 : specularColor 1 1 1
31 : shininess .9
32 : }
33 : }
34 : }
35 :
36 : PROTO TankSurf[]{
37 : Appearance {
38 : material Material {
39 : diffuseColor .4 .8 .2
40 : ambientIntensity .6
41 : specularColor .1 .3 .1
42 : }
43 : }
44 : }
45 :
46 : PROTO TankPinkSurf[]{
47 : Appearance {
48 : material Material {
49 : diffuseColor .9 .5 .9
50 : ambientIntensity .6
51 : specularColor .3 .1 .3
52 : }
53 : }
54 : }
55 :
56 : PROTO TankTex [
57 : field MFString tex "tank2.png"
58 : ]{
59 : Appearance {
60 : texture ImageTexture {
61 : url IS tex
62 : }
63 : material Material {
64 : ambientIntensity .4
65 : diffuseColor .4 .4 .4
66 : }
67 : }
68 : }
69 :
70 :
71 : PROTO TankWheelSurf [
72 : exposedField SFColor wheelColor 0 .4 0
73 : ]{
74 : Appearance {
75 : material Material {
76 : diffuseColor IS wheelColor
77 : ambientIntensity .6
78 : specularColor 0 .3 0
79 : }
80 : }
81 : }
82 :
83 : PROTO TankWheel [
84 : exposedField SFVec3f pos 0 0 0
85 : exposedField SFColor wheelColor 0 .4 0
86 : exposedField SFColor wheelDarkColor 0 .2 0
87 : ]{
88 : Transform {
89 : translation IS pos
90 : children Transform {
91 : rotation 0 0 1 1.57
92 : translation 0 -.9 -3
93 : children [
94 : Shape {
95 : appearance TankWheelSurf {wheelColor IS wheelColor }
96 : geometry Cylinder{
97 : height .2
98 : radius .4
99 : }
100 : }
101 : Shape {
102 : appearance TankWheelSurf {wheelColor IS wheelDarkColor }
103 : geometry Cylinder{
104 : height .25
105 : radius .32
106 : }
107 : }
108 : ]
109 : }
110 : }
111 : }
112 :
113 : PROTO TankWheelLod0 [
114 : exposedField SFVec3f pos 0 0 0
115 : exposedField SFColor wheelColor 0 .4 0
116 : exposedField SFColor wheelDarkColor 0 .2 0
117 : ]{
118 : Transform {
119 : translation IS pos
120 : children Transform {
121 : rotation 0 0 1 1.57
122 : translation 0 -.9 -3
123 : children [
124 : Shape {
125 : appearance TankWheelSurf {wheelColor IS wheelColor }
126 : geometry Cylinder{
127 : height .23
128 : radius .4
129 : bottom FALSE
130 : top FALSE
131 : }
132 : }
133 : Shape {
134 : appearance TankWheelSurf {wheelColor IS wheelDarkColor }
135 : geometry Cylinder{
136 : height .23
137 : radius .4
138 : side FALSE
139 : }
140 : }
141 : ]
142 : }
143 : }
144 : }
145 :
146 :
147 : PROTO TankTexTrans[
148 : exposedField SFVec2f trans -.05 0
149 : ] { TextureTransform {
150 : scale 3 128
151 : translation IS trans
152 : }
153 : }
154 :
155 : PROTO TankTrack[
156 : exposedField SFNode ttrans TankTexTrans{}
157 : ]{
158 : Shape {
159 : appearance Appearance {
160 : texture ImageTexture {
161 : url "trk.png"
162 : }
163 : textureTransform IS ttrans
164 : }
165 : geometry Extrusion {
166 : creaseAngle 1.3
167 : beginCap FALSE
168 : endCap FALSE
169 : spine [
170 : 0 -1.3 -3.1,
171 : 0 -1.2 -3.3,
172 : 0 -1.1 -3.4,
173 : 0 -0.4 -3.85,
174 : 0 -0.2 -3.9,
175 : 0 0.0 -3.85
176 : 0 0.1 -3.75
177 : 0 0.2 -3.6,
178 : 0 0.2 3.6,
179 : 0 0.1 3.75
180 : 0 0.0 3.85
181 : 0 -0.2 3.9,
182 : 0 -0.4 3.85,
183 : 0 -1.1 3.4,
184 : 0 -1.2 3.3,
185 : 0 -1.3 3.1,
186 : 0 -1.3 -3.1
187 : ]
188 : crossSection [.02 .16,.02 -.16,-.02 -.16,-.02 .16,.02 .16]
189 : }
190 : }
191 : }
192 :
193 : PROTO TankWheelSet [
194 : exposedField SFColor wheelColor 0 .4 0
195 : exposedField SFColor wheelDarkColor 0 .2 0
196 : ]{
197 : Group {
198 : children [
199 : #upper row
200 : TankWheel { wheelColor IS wheelColor wheelDarkColor IS wheelDarkColor }
201 : TankWheel { wheelColor IS wheelColor wheelDarkColor IS wheelDarkColor pos 0 0 1.5 }
202 : TankWheel { wheelColor IS wheelColor wheelDarkColor IS wheelDarkColor pos 0 0 3 }
203 : TankWheel { wheelColor IS wheelColor wheelDarkColor IS wheelDarkColor pos 0 0 4.5 }
204 : TankWheel { wheelColor IS wheelColor wheelDarkColor IS wheelDarkColor pos 0 0 6 }
205 : #lower row
206 : TankWheel { wheelColor IS wheelColor wheelDarkColor IS wheelDarkColor pos 0 .7 -.5 }
207 : TankWheel { wheelColor IS wheelColor wheelDarkColor IS wheelDarkColor pos 0 .7 0.9 }
208 : TankWheel { wheelColor IS wheelColor wheelDarkColor IS wheelDarkColor pos 0 .7 2.3 }
209 : TankWheel { wheelColor IS wheelColor wheelDarkColor IS wheelDarkColor pos 0 .7 3.7 }
210 : TankWheel { wheelColor IS wheelColor wheelDarkColor IS wheelDarkColor pos 0 .7 5.1 }
211 : TankWheel { wheelColor IS wheelColor wheelDarkColor IS wheelDarkColor pos 0 .7 6.5 }
212 : ]
213 : }
214 : }
215 :
216 : PROTO TankWheelSetLod0 [
217 : exposedField SFColor wheelColor 0 .4 0
218 : exposedField SFColor wheelDarkColor 0 .2 0
219 : ]{
220 : Group {
221 : children [
222 : #upper row
223 : TankWheelLod0 { wheelColor IS wheelColor wheelDarkColor IS wheelDarkColor }
224 : TankWheelLod0 { wheelColor IS wheelColor wheelDarkColor IS wheelDarkColor pos 0 0 1.5 }
225 : TankWheelLod0 { wheelColor IS wheelColor wheelDarkColor IS wheelDarkColor pos 0 0 3 }
226 : TankWheelLod0 { wheelColor IS wheelColor wheelDarkColor IS wheelDarkColor pos 0 0 4.5 }
227 : TankWheelLod0 { wheelColor IS wheelColor wheelDarkColor IS wheelDarkColor pos 0 0 6 }
228 : #lower row
229 : TankWheelLod0 { wheelColor IS wheelColor wheelDarkColor IS wheelDarkColor pos 0 .7 -.5 }
230 : TankWheelLod0 { wheelColor IS wheelColor wheelDarkColor IS wheelDarkColor pos 0 .7 0.9 }
231 : TankWheelLod0 { wheelColor IS wheelColor wheelDarkColor IS wheelDarkColor pos 0 .7 2.3 }
232 : TankWheelLod0 { wheelColor IS wheelColor wheelDarkColor IS wheelDarkColor pos 0 .7 3.7 }
233 : TankWheelLod0 { wheelColor IS wheelColor wheelDarkColor IS wheelDarkColor pos 0 .7 5.1 }
234 : TankWheelLod0 { wheelColor IS wheelColor wheelDarkColor IS wheelDarkColor pos 0 .7 6.5 }
235 : ]
236 : }
237 : }
238 :
239 :
240 : PROTO TankTrackComponent [
241 : exposedField SFVec3f pos 0 0 0
242 : exposedField SFColor wheelColor 0 .4 0
243 : exposedField SFColor wheelDarkColor 0 .2 0
244 : exposedField SFNode ttrans TankTexTrans{}
245 : ]{
246 : Transform {
247 : translation IS pos
248 : children [
249 : TankTrack { ttrans IS ttrans }
250 : TankWheelSet { wheelColor IS wheelColor wheelDarkColor IS wheelDarkColor}
251 : ]
252 : }
253 : }
254 :
255 : PROTO TankTrackComponentLod0 [
256 : exposedField SFVec3f pos 0 0 0
257 : exposedField SFColor wheelColor 0 .4 0
258 : exposedField SFColor wheelDarkColor 0 .2 0
259 : exposedField SFNode ttrans TankTexTrans{}
260 : ]{
261 : Transform {
262 : translation IS pos
263 : children [
264 : TankTrack {ttrans IS ttrans }
265 : TankWheelSetLod0 { wheelColor IS wheelColor wheelDarkColor IS wheelDarkColor}
266 : ]
267 : }
268 : }
269 :
270 : PROTO TankLight [
271 : exposedField SFVec3f pos 0 0 0
272 : exposedField SFNode tex TankSurf {}
273 : ]{
274 : Transform {
275 : translation IS pos
276 : rotation 1 0 0 -1.57
277 : children [
278 : SpotLight {
279 : beamWidth 0.770796
280 : radius 8
281 : cutOffAngle 0.385398
282 : direction 0 1 0
283 : }
284 : Shape {
285 : appearance IS tex
286 : geometry Cylinder {
287 : bottom FALSE
288 : height .2
289 : radius .15
290 : }
291 : }
292 : Transform {
293 : translation 0 .35 0
294 : scale .35 .25 .35
295 : children Billboard {
296 : children Shape {
297 : appearance Appearance {
298 : texture ImageTexture {
299 : url "lite2.png"
300 : }
301 : }
302 : geometry IndexedFaceSet {
303 : coord Coordinate {
304 : point [-1 -1 0,-1 1 0,1 1 0 1 -1 0]
305 : }
306 : coordIndex [3 2 1 0 -1]
307 : }
308 : }
309 : }
310 : }
311 : Shape {
312 : appearance Appearance {
313 : material Material {
314 : diffuseColor .9 .9 .9
315 : emissiveColor 1 1 1
316 : }
317 : }
318 : geometry Cylinder {
319 : bottom FALSE
320 : side FALSE
321 : height .205
322 : radius .12
323 : }
324 : }
325 : ]
326 : }
327 : }
328 :
329 : PROTO TankLightBack [
330 : exposedField SFVec3f pos 0 0 0
331 : exposedField SFNode tex TankSurf {}
332 : ]{
333 : Transform {
334 : translation IS pos
335 : rotation 1 0 0 -1.57
336 : children [
337 : Shape {
338 : appearance IS tex
339 : geometry Cylinder {
340 : top FALSE
341 : height .2
342 : radius .09
343 : }
344 : }
345 : Shape {
346 : appearance Appearance {
347 : material Material {
348 : diffuseColor .9 0 0
349 : emissiveColor 1 0 0
350 : }
351 : }
352 : geometry Cylinder {
353 : top FALSE
354 : side FALSE
355 : height .205
356 : radius .06
357 : }
358 : }
359 : ]
360 : }
361 : }
362 :
363 : PROTO TankEntranceLod0 [
364 : exposedField SFVec3f pos 0 0 0
365 : exposedField SFNode tex TankSurf {}
366 : ]{
367 : Transform {
368 : translation IS pos
369 : children [
370 : #cover
371 : Transform {
372 : translation 0 .04 0
373 : children [
374 : Shape {
375 : appearance IS tex
376 : geometry Cylinder {
377 : radius .45
378 : bottom FALSE
379 : height .09
380 : }
381 : }
382 : ]
383 : }
384 : #rim
385 : Shape {
386 : appearance IS tex
387 : geometry Cylinder {
388 : radius .5
389 : height .03
390 : bottom FALSE
391 : }
392 : }
393 : ]
394 : }
395 : }
396 :
397 : PROTO TankEntranceLod1 [
398 : exposedField SFVec3f pos 0 0 0
399 : exposedField SFNode tex TankSurf {}
400 : ]{
401 : Transform {
402 : translation IS pos
403 : children Transform {
404 : translation 0 .025 0
405 : children Shape {
406 : appearance IS tex
407 : geometry Cylinder {
408 : radius .48
409 : bottom FALSE
410 : height .12
411 : }
412 : }
413 : }
414 : }
415 : }
416 :
417 : PROTO TankEntrance [
418 : exposedField SFVec3f pos 0 0 0
419 : exposedField SFNode tex TankSurf {}
420 : ]{
421 : Transform {
422 : translation IS pos
423 : children [
424 : #interior
425 : Shape {
426 : appearance TankInside {}
427 : geometry Cylinder {
428 : radius .4
429 : height .05
430 : bottom FALSE
431 : }
432 : }
433 : TankEntranceLod0 { tex IS tex }
434 : #handle
435 : Transform {
436 : translation 0 .1 -.38
437 : children [
438 : Shape {
439 : appearance IS tex
440 : geometry Box {
441 : size .08 .03 .25
442 : }
443 : }
444 : ]
445 : }
446 : #"axis" of rotation
447 : Transform {
448 : translation 0 .05 .42
449 : rotation 0 0 1 1.57
450 : children [
451 : Shape {
452 : appearance IS tex
453 : geometry Cylinder {
454 : height .25
455 : radius .05
456 : }
457 : }
458 : ]
459 : }
460 : ]
461 : }
462 : }
463 :
464 : PROTO TankMGLodB [
465 : exposedField SFNode tex TankSurf {}
466 : ]{
467 : Shape {
468 : appearance IS tex
469 : geometry Sphere {
470 : radius .2
471 : }
472 : }
473 : }
474 :
475 : PROTO TankMGLodA [
476 : exposedField SFNode tex TankSurf {}
477 : ]{
478 : Group {
479 : children [
480 : Transform {
481 : rotation 1 0 0 -1.57
482 : translation 0 0 -.25
483 : children [
484 : Shape {
485 : appearance IS tex
486 : geometry Cylinder {
487 : radius .03
488 : height .5
489 : bottom FALSE
490 : }
491 : }
492 : Shape {
493 : appearance BlackHole {}
494 : geometry Cylinder {
495 : radius .02
496 : height .502
497 : bottom FALSE
498 : side FALSE
499 : }
500 : }
501 : ]
502 : }
503 : TankMGLodB { tex IS tex }
504 : ]
505 : }
506 : }
507 :
508 :
509 : PROTO TankMG [
510 : exposedField SFVec3f pos 0 0 0
511 : exposedField SFNode tex TankSurf {}
512 : field MFFloat lodRanges [6 14 20 100 500]
513 : ]{
514 : Transform {
515 : translation IS pos
516 : children [
517 : DEF SM CylinderSensor {
518 : maxAngle 0.8
519 : minAngle -0.8
520 : }
521 : DEF TM Transform {
522 : children LOD {
523 : range IS lodRanges
524 : level [
525 : TankMGLodA { tex IS tex}
526 : TankMGLodA { tex IS tex}
527 : TankMGLodB { tex IS tex}
528 : Group{}
529 : Group{}
530 : Group{}
531 : ]
532 : }
533 : }
534 : ]
535 : ROUTE SM.rotation_changed TO TM.rotation
536 : }
537 : }
538 :
539 : PROTO TankEntranceLod [
540 : exposedField SFVec3f pos 0 0 0
541 : exposedField SFNode tex TankSurf {}
542 : field MFFloat lodRanges [6 14 20 100 500]
543 : ]{
544 : LOD {
545 : range IS lodRanges
546 : level [
547 : TankEntrance { pos IS pos tex IS tex}
548 : TankEntranceLod0 { pos IS pos tex IS tex}
549 : TankEntranceLod1 { pos IS pos tex IS tex}
550 : Group{}
551 : Group{}
552 : Group{}
553 : ]
554 : }
555 : }
556 :
557 : PROTO TankCannonHole[]{
558 : Transform {
559 : translation 0 -1.5 0
560 : children [
561 : Shape {
562 : appearance BlackHole {}
563 : geometry Cylinder {
564 : radius .10
565 : height .001
566 : top FALSE
567 : side FALSE
568 : }
569 : }
570 : ]
571 : }
572 : }
573 :
574 : PROTO TankCannon [
575 : exposedField SFVec3f pos 0 0 0
576 : exposedField SFNode tex TankSurf {}
577 : ]{
578 : Transform {
579 : rotation 1 0 0 1.57
580 : translation IS pos
581 : children [
582 : TankCannonHole {}
583 : Transform {
584 : translation 0 -1.4 0
585 : children [
586 : Shape {
587 : appearance IS tex
588 : geometry Cylinder {
589 : radius .15
590 : height .2
591 : }
592 : }
593 : ]
594 : }
595 : Shape {
596 : appearance IS tex
597 : geometry Cylinder {
598 : radius .12
599 : height 3
600 : top FALSE
601 : }
602 : }
603 : Shape {
604 : appearance IS tex
605 : geometry Cylinder {
606 : radius .14
607 : height 1.1
608 : }
609 : }
610 : ]
611 : }
612 : }
613 :
614 : PROTO TankCannonLod0 [
615 : exposedField SFVec3f pos 0 0 0
616 : exposedField SFNode tex TankSurf {}
617 : ]{
618 : Transform {
619 : rotation 1 0 0 1.57
620 : translation IS pos
621 : children [
622 : TankCannonHole {}
623 : Shape {
624 : appearance IS tex
625 : geometry Cylinder {
626 : radius .14
627 : height 3
628 : top FALSE
629 : }
630 : }
631 : ]
632 : }
633 : }
634 :
635 : PROTO TankWindow [
636 : exposedField SFVec3f pos 0 0 0
637 : exposedField SFNode tex TankSurf {}
638 : ]{
639 : Transform {
640 : translation IS pos
641 : children [
642 : Shape {
643 : appearance IS tex
644 : geometry Box {
645 : size .6 .3 .3
646 : }
647 : }
648 : Shape {
649 : appearance BlackHole {}
650 : geometry Box {
651 : size .4 .1 .31
652 : }
653 : }
654 : ]
655 : }
656 : }
657 :
658 : PROTO TankWedge [
659 : exposedField SFNode tex TankSurf {}
660 : ]{
661 : Shape {
662 : appearance IS tex
663 : geometry IndexedFaceSet {
664 : coord Coordinate {
665 : point [
666 : -1.2 -.65 -3.4,
667 : -1.2 -.65 3.4,
668 : -1.2 .65 4.1,
669 : -1.2 .65 -4.1,
670 : 1.2 -.65 -3.4,
671 : 1.2 -.65 3.4,
672 : 1.2 .65 4.1
673 : 1.2 .65 -4.1,
674 : ]
675 : }
676 : coordIndex [
677 : 0 1 2 3 -1,
678 : 4 5 1 0 -1,
679 : 7 6 5 4 -1,
680 : 6 7 3 2 -1,
681 : 5 6 2 1 -1,
682 : 0 3 7 4 -1
683 : ]
684 : texCoord TextureCoordinate {
685 : point [
686 : -1 -2,
687 : -1 2,
688 : 1 1.7,
689 : 1 -1.7,
690 : ]
691 : }
692 : texCoordIndex [
693 : 0 1 2 3 -1,
694 : 0 1 2 3 -1,
695 : 0 1 2 3 -1,
696 : 0 1 2 3 -1,
697 : 1 2 3 0 -1,
698 : 1 2 3 0 -1,
699 : ]
700 : }
701 : }
702 : }
703 :
704 : PROTO TankWedges [
705 : exposedField SFNode tex TankSurf {}
706 : ]{
707 : Transform {
708 : translation 0 -.4 0
709 : children [
710 : TankWedge {tex IS tex }
711 : Transform {
712 : rotation 1 0 0 3.14
713 : scale 1.4 .5 1
714 : translation 0 .975 0
715 : children TankWedge {tex IS tex }
716 : }
717 : ]
718 : }
719 : }
720 :
721 : PROTO TankBackBox [
722 : exposedField SFVec3f pos 0 0 0
723 : exposedField SFNode tex TankSurf {}
724 : ]{
725 : Transform {
726 : translation IS pos
727 : children Shape {
728 : appearance IS tex
729 : geometry Box {
730 : size 1 .06 1
731 : }
732 : }
733 : }
734 : }
735 :
736 : PROTO TankGunRack [
737 : exposedField SFVec3f pos 0 0 0
738 : exposedField SFNode tex TankSurf {}
739 : ]{
740 : Transform {
741 : translation IS pos
742 : rotation 0 0 1 1.57
743 : children [
744 : Shape {
745 : appearance IS tex
746 : geometry Cylinder {
747 : radius .4
748 : height .3
749 : }
750 : }
751 : Shape {
752 : appearance IS tex
753 : geometry Box {
754 : size .7 .5 .5
755 : }
756 : }
757 : ]
758 : }
759 : }
760 :
761 : PROTO TankGunRackLod0 [
762 : exposedField SFVec3f pos 0 0 0
763 : exposedField SFNode tex TankSurf {}
764 : ]{
765 : Transform {
766 : translation IS pos
767 : rotation 0 0 1 1.57
768 : children [
769 : Shape {
770 : appearance IS tex
771 : geometry Cylinder {
772 : radius .4
773 : height .4
774 : }
775 : }
776 : ]
777 : }
778 : }
779 :
780 :
781 : PROTO TankHiBox [
782 : exposedField SFNode tex TankSurf {}
783 : ]{
784 : Transform {
785 : translation 0 .6 .5
786 : children [
787 : Shape {
788 : appearance IS tex
789 : geometry Box {
790 : size 2.7 .65 6.7
791 : }
792 : }
793 : ]
794 : }
795 : }
796 :
797 : PROTO TankLowerBodyLod0 [
798 : exposedField SFNode tex TankSurf {}
799 : ]{
800 : Group {
801 : children [
802 : TankHiBox {tex IS tex }
803 : TankWedges {tex IS tex }
804 : ]
805 : }
806 : }
807 :
808 : PROTO TankLowerBody [
809 : exposedField SFNode tex TankSurf {}
810 : ]{
811 : Group {
812 : children [
813 : TankBackBox { pos .7 .95 3.1 tex IS tex }
814 : TankBackBox { pos -.7 .95 3.1 tex IS tex }
815 : TankLowerBodyLod0 {tex IS tex }
816 : ]
817 : }
818 : }
819 :
820 : PROTO TurretBackWedge [
821 : exposedField SFNode tex TankSurf {}
822 : ]{
823 : Transform {
824 : rotation 1 1 1 2.09
825 : translation 0 .69 1.75
826 : children [
827 : Shape {
828 : appearance IS tex
829 : geometry IndexedFaceSet {
830 : coord Coordinate {
831 : point [
832 : -.35 -1.75 -1.45,
833 : -.35 -1.75 1.45,
834 : -.35 .15 .8,
835 : -.35 .15 -.8,
836 : .35 -1.75 -1.45,
837 : .35 -1.75 1.45,
838 : .35 .15 .8
839 : .35 .15 -.8,
840 : ]
841 : }
842 : coordIndex [
843 : 0 1 2 3 -1,
844 : 4 5 1 0 -1,
845 : 7 6 5 4 -1,
846 : 6 7 3 2 -1,
847 : 5 6 2 1 -1,
848 : 0 3 7 4 -1
849 : ]
850 : }
851 : }
852 : ]
853 : }
854 : }
855 :
856 : PROTO TurretMiddle [
857 : exposedField SFNode tex TankSurf {}
858 : ]{
859 : Transform { translation 0 .55 0
860 : children [
861 : Shape {
862 : appearance IS tex
863 : geometry Cylinder {
864 : radius 1.5
865 : height 1
866 : }
867 : }
868 : ]
869 : }
870 : }
871 :
872 : PROTO TurretMiddleLod0 [
873 : exposedField SFNode tex TankSurf {}
874 : ]{
875 : Transform { translation 0 .5 0
876 : children [
877 : Shape {
878 : appearance IS tex
879 : geometry Cylinder {
880 : radius 1.5
881 : height 1.1
882 : bottom FALSE
883 : }
884 : }
885 : ]
886 : }
887 : }
888 :
889 : PROTO TurretBottom [
890 : exposedField SFNode tex TankSurf {}
891 : ]{
892 : Shape {
893 : appearance IS tex
894 : geometry Cylinder {
895 : radius 1.4
896 : height .1
897 : top FALSE
898 : bottom FALSE
899 : }
900 : }
901 : }
902 :
903 : PROTO TurretTop [
904 : exposedField SFNode tex TankSurf {}
905 : ]{
906 : Transform { translation 0 1.08 0
907 : children [
908 : Shape {
909 : appearance IS tex
910 : geometry Cone {
911 : bottomRadius 1.5
912 : height .1
913 : bottom FALSE
914 : }
915 : }
916 : ]
917 : }
918 : }
919 :
920 : PROTO TankTurretCore0 [
921 : exposedField SFNode tex TankSurf {}
922 : ]{
923 : Group {
924 : children [
925 : TurretBackWedge { tex IS tex}
926 : TurretMiddle { tex IS tex}
927 : TurretBottom { tex IS tex}
928 : TurretTop { tex IS tex}
929 : TankCannon { pos 0 .5 -2.7 tex IS tex }
930 : TankGunRack { pos 0 .5 -1.3 tex IS tex }
931 : ]
932 : }
933 : }
934 :
935 :
936 : PROTO TankTurretLodB [
937 : exposedField SFNode tex TankSurf {}
938 : exposedField SFRotation rot 0 0 1 0
939 : ]{
940 : Transform {
941 : translation 0 .94 1
942 : rotation IS rot
943 : children [
944 : TankTurretCore0 { tex IS tex }
945 : TankEntranceLod0 { pos -.7 1.1 .45 tex IS tex }
946 : TankEntranceLod0 { pos .7 1.1 .45 tex IS tex }
947 : ]
948 : }
949 : }
950 :
951 :
952 : PROTO TankTurretLod0 [
953 : exposedField SFNode tex TankSurf {}
954 : exposedField SFRotation rot 0 0 1 0
955 : ]{
956 : Transform {
957 : translation 0 .94 1
958 : rotation IS rot
959 : children [
960 : TankTurretCore0 { tex IS tex }
961 : TankEntranceLod0 { pos -.7 1.1 .45 tex IS tex }
962 : TankEntranceLod0 { pos .7 1.1 .45 tex IS tex }
963 : ]
964 : }
965 : }
966 :
967 : PROTO TankTurretCore1 [
968 : exposedField SFNode tex TankSurf {}
969 : ]{
970 : Group {
971 : children [
972 : TurretBackWedge { tex IS tex}
973 : TurretMiddleLod0 { tex IS tex}
974 : TankCannonLod0 { pos 0 .5 -2.7 tex IS tex }
975 : ]
976 : }
977 : }
978 :
979 :
980 : PROTO TankTurretLod2 [
981 : exposedField SFNode tex TankSurf {}
982 : exposedField SFRotation rot 0 0 1 0
983 : ]{
984 : Transform {
985 : translation 0 .94 1
986 : rotation IS rot
987 : children TankTurretCore1 { tex IS tex }
988 : }
989 : }
990 :
991 : PROTO TankTurretLod1 [
992 : exposedField SFNode tex TankSurf {}
993 : exposedField SFRotation rot 0 0 1 0
994 : ]{
995 : Transform {
996 : translation 0 .94 1
997 : rotation IS rot
998 : children [
999 : TankTurretCore1 { tex IS tex }
1000 : TankGunRackLod0 { pos 0 .5 -1.3 tex IS tex }
1001 : TankEntranceLod1 { pos -.7 1.1 .45 tex IS tex }
1002 : TankEntranceLod1 { pos .7 1.1 .45 tex IS tex }
1003 : ]
1004 : }
1005 : }
1006 :
1007 : PROTO TankTurretLod [
1008 : exposedField SFNode tex TankSurf {}
1009 : field MFFloat lodRanges [6 14 20 100 500]
1010 : exposedField SFBool rotatable TRUE
1011 : ]{
1012 : Group {
1013 : children [
1014 : DEF S CylinderSensor {enabled IS rotatable}
1015 : DEF T Transform {
1016 : center 0 0 1
1017 : children LOD {
1018 : range IS lodRanges
1019 : level [
1020 : TankTurretLodB { tex IS tex }
1021 : TankTurretLod0 { tex IS tex }
1022 : TankTurretLod1 { tex IS tex }
1023 : TankTurretLod2 { tex IS tex }
1024 : Group {}
1025 : Group {}
1026 : ]
1027 : }
1028 : }
1029 : ]
1030 : ROUTE S.rotation_changed TO T.rotation
1031 : }
1032 : }
1033 :
1034 : PROTO TankFLights [
1035 : exposedField SFNode tex TankSurf {}
1036 : ]{
1037 : Group {
1038 : children [
1039 : TankLight { pos 1.3 .5 -3.9 tex IS tex }
1040 : TankLight { pos -1.3 .5 -3.9 tex IS tex }
1041 : ]
1042 : }
1043 : }
1044 :
1045 : PROTO TankLights [
1046 : exposedField SFNode tex TankSurf {}
1047 : ]{
1048 : Group {
1049 : children [
1050 : TankFLights { tex IS tex }
1051 : TankLightBack { pos 1.3 .5 3.85 tex IS tex}
1052 : TankLightBack { pos -1.3 .5 3.85 tex IS tex }
1053 : ]
1054 : }
1055 : }
1056 :
1057 : PROTO TankLod0 [
1058 : exposedField SFColor wheelColor 0 .4 0
1059 : exposedField SFColor wheelDarkColor 0 .2 0
1060 : exposedField SFNode tex TankSurf {}
1061 : exposedField SFNode ttrans TankTexTrans{}
1062 : ]{
1063 : Group {
1064 : children [
1065 : TankTrackComponent {ttrans IS ttrans pos -1.4 0 0 wheelColor IS wheelColor wheelDarkColor IS wheelDarkColor}
1066 : TankTrackComponent {ttrans IS ttrans pos 1.4 0 0 wheelColor IS wheelColor wheelDarkColor IS wheelDarkColor}
1067 : TankWindow { pos 0 .7 -3.6 tex IS tex }
1068 : TankLights { tex IS tex }
1069 : ]
1070 : }
1071 : }
1072 :
1073 : PROTO TankLod1 [
1074 : exposedField SFColor wheelColor 0 .4 0
1075 : exposedField SFColor wheelDarkColor 0 .2 0
1076 : exposedField SFNode tex TankSurf {}
1077 : exposedField SFNode ttrans TankTexTrans{}
1078 : ]{
1079 : Group {
1080 : children [
1081 : TankTrackComponent {ttrans IS ttrans pos -1.4 0 0 wheelColor IS wheelColor wheelDarkColor IS wheelDarkColor}
1082 : TankTrackComponent {ttrans IS ttrans pos 1.4 0 0 wheelColor IS wheelColor wheelDarkColor IS wheelDarkColor}
1083 : TankWindow { pos 0 .7 -3.6 tex IS tex }
1084 : TankLights { tex IS tex }
1085 : ]
1086 : }
1087 : }
1088 :
1089 : PROTO TankLod2 [
1090 : exposedField SFColor wheelColor 0 .4 0
1091 : exposedField SFColor wheelDarkColor 0 .2 0
1092 : exposedField SFNode tex TankSurf {}
1093 : exposedField SFNode ttrans TankTexTrans{}
1094 : ]{
1095 : Group {
1096 : children [
1097 : TankTrackComponent {ttrans IS ttrans pos -1.4 0 0 wheelColor IS wheelColor wheelDarkColor IS wheelDarkColor}
1098 : TankTrackComponent {ttrans IS ttrans pos 1.4 0 0 wheelColor IS wheelColor wheelDarkColor IS wheelDarkColor}
1099 : TankWindow { pos 0 .7 -3.6 tex IS tex }
1100 : TankFLights { tex IS tex }
1101 : ]
1102 : }
1103 : }
1104 :
1105 : PROTO TankLod3 [
1106 : exposedField SFColor wheelColor 0 .4 0
1107 : exposedField SFColor wheelDarkColor 0 .2 0
1108 : exposedField SFNode tex TankSurf {}
1109 : exposedField SFNode ttrans TankTexTrans{}
1110 : ]{
1111 : Group {
1112 : children [
1113 : TankTrackComponentLod0 {ttrans IS ttrans pos -1.4 0 0 wheelColor IS wheelColor wheelDarkColor IS wheelDarkColor}
1114 : TankTrackComponentLod0 {ttrans IS ttrans pos 1.4 0 0 wheelColor IS wheelColor wheelDarkColor IS wheelDarkColor}
1115 : ]
1116 : }
1117 : }
1118 :
1119 : PROTO TankLod4 [
1120 : exposedField SFNode tex TankSurf {}
1121 : ]{
1122 : Group {
1123 : children [
1124 : Shape {
1125 : appearance IS tex
1126 : geometry Box {
1127 : size 3.36 2.2 7.5
1128 : }
1129 : }
1130 : Transform {
1131 : translation 0 1.54 1
1132 : children Shape {
1133 : appearance IS tex
1134 : geometry Box {
1135 : size 3 1.1 3.4
1136 : }
1137 : }
1138 : }
1139 : ]
1140 : }
1141 : }
1142 :
1143 : PROTO Exhaust [
1144 : exposedField SFColor color 0 0 0
1145 : field SFVec3f pos 0 0 0
1146 : ]{
1147 : Transform {
1148 : translation IS pos
1149 : children [
1150 : Shape {
1151 : appearance BlackHole {}
1152 : geometry Cylinder {
1153 : side FALSE
1154 : bottom FALSE
1155 : radius 0.1
1156 : height 0.5
1157 : }
1158 : }
1159 : Shape {
1160 : appearance Appearance {
1161 : material Material {
1162 : diffuseColor 0.5 0.5 0.5
1163 : emissiveColor IS color
1164 : }
1165 : }
1166 : geometry Cylinder {
1167 : top FALSE
1168 : bottom FALSE
1169 : radius 0.1
1170 : height 0.5
1171 : }
1172 : }
1173 : ]
1174 : }
1175 : }
1176 :
1177 : PROTO Exhausts [
1178 : exposedField SFColor color 0.5 0.5 0.5
1179 : ]{
1180 : Group {
1181 : children [
1182 : Exhaust{pos -0.8 1 3.6 color IS color }
1183 : Exhaust{pos 0.8 1 3.6 color IS color }
1184 : Exhaust{pos -1.1 1 3.6 color IS color }
1185 : Exhaust{pos 1.1 1 3.6 color IS color }
1186 : ]
1187 : }
1188 : }
1189 :
1190 : PROTO Arrow [
1191 : exposedField SFVec3f pos 0 0 0
1192 : exposedField SFRotation rot 0 0 1 0
1193 : ]{
1194 : Transform {
1195 : translation IS pos
1196 : rotation IS rot
1197 : children [
1198 : Transform {
1199 : scale 0.25 1 1
1200 : rotation 1 0 0 -1.54
1201 : children
1202 : Shape {
1203 : appearance Red {}
1204 : geometry Cone {
1205 : bottomRadius .2
1206 : height .2
1207 : }
1208 : }
1209 : }
1210 : Transform {
1211 : translation 0 0 .3
1212 : rotation 1 0 0 -1.54
1213 : children
1214 : Shape {
1215 : appearance Red {}
1216 : geometry Cylinder {
1217 : radius .05
1218 : height .4
1219 : }
1220 : }
1221 : }
1222 : ]
1223 : }
1224 : }
1225 :
1226 : PROTO Tank [
1227 : exposedField SFVec3f pos 0 0 0 #pozice
1228 : exposedField SFRotation rot 0 0 1 0 #rotace
1229 : exposedField SFInt32 lod 1 #zaputo/vypnuto lOD
1230 : exposedField SFColor wheelColor 0 .4 0 #barva kolecek
1231 : exposedField SFColor wheelDarkColor 0 .2 0 #barva vnitrku kolecek
1232 : exposedField SFNode tex TankSurf {} #barva ci textura tanku
1233 : field MFFloat lodRanges [6 14 20 100 500] #vzdalenosti pro lod
1234 : exposedField SFColor light 1 1 1 #barva svetla nad strojem
1235 : exposedField SFFloat lightIntensity 2 #intenzita svetla nad strojem
1236 : eventIn SFBool lightOn #zapnuti svetel
1237 : exposedField SFTime startRotation 0 #zapnuti rotace
1238 : exposedField SFTime stopRotation 0 #vypnuti rotace
1239 : eventIn SFFloat rotSpeed #rychlost rotace
1240 : field SFString name "Tank" #jmeno tanku
1241 : eventOut SFString get_name #vraci jmeno tanku
1242 : eventOut SFBool nearby
1243 : ]{
1244 : DEF ROT Transform {
1245 : center IS pos
1246 : children
1247 : Transform {
1248 : translation IS pos
1249 : rotation IS rot
1250 : children
1251 : DEF TK Transform {
1252 : children [
1253 : DEF NameScr Script {
1254 : eventOut SFString get_name IS get_name
1255 : eventIn SFBool SendName
1256 : eventOut SFBool nearby IS nearby
1257 : field SFString name IS name
1258 : url "javascript:
1259 : function SendName(x) {
1260 : if (x){
1261 : get_name = name;
1262 : }
1263 : nearby=x;
1264 : }
1265 : "
1266 : }
1267 : DEF P ProximitySensor {
1268 : size 20 20 20
1269 : enabled FALSE
1270 : }
1271 : DEF P2 ProximitySensor {
1272 : size 20 20 20
1273 : enabled TRUE
1274 : }
1275 : DEF L PointLight {
1276 : color IS light
1277 : intensity IS lightIntensity
1278 : location 3 4 3
1279 : radius 6
1280 : on FALSE
1281 : }
1282 : DEF L2 PointLight {
1283 : color IS light
1284 : intensity IS lightIntensity
1285 : location -3 4 -3
1286 : radius 6
1287 : on FALSE
1288 : }
1289 : PointLight {
1290 : color IS light
1291 : intensity IS lightIntensity
1292 : location 3 4 3
1293 : radius 6
1294 : on IS lightOn
1295 : }
1296 : PointLight {
1297 : color IS light
1298 : intensity IS lightIntensity
1299 : location -3 4 -3
1300 : radius 6
1301 : on IS lightOn
1302 : }
1303 : Switch {
1304 : whichChoice IS lod
1305 : choice [
1306 : TankLod0 { wheelColor IS wheelColor wheelDarkColor IS wheelDarkColor tex IS tex}
1307 : Group {
1308 : children [
1309 : LOD {
1310 : range IS lodRanges
1311 : level [
1312 : DEF TL0 TankLod0 { ttrans TankTexTrans{} wheelColor IS wheelColor wheelDarkColor IS wheelDarkColor tex IS tex}
1313 : DEF TL1 TankLod1 { ttrans TankTexTrans{} wheelColor IS wheelColor wheelDarkColor IS wheelDarkColor tex IS tex }
1314 : DEF TL2 TankLod2 { ttrans TankTexTrans{} wheelColor IS wheelColor wheelDarkColor IS wheelDarkColor tex IS tex }
1315 : DEF TL3 TankLod3 { ttrans TankTexTrans{} wheelColor IS wheelColor wheelDarkColor IS wheelDarkColor tex IS tex }
1316 : DEF TL4 TankLod4 { tex IS tex}
1317 : Group{}
1318 : ]
1319 : }
1320 : LOD {
1321 : range IS lodRanges
1322 : level [
1323 : DEF EX0 Exhausts{ color 0 0 0}
1324 : USE EX0
1325 : USE EX0
1326 : USE EX0
1327 : USE EX0
1328 : Group{}
1329 : ]
1330 : }
1331 : Transform {
1332 : children [
1333 : DEF T TouchSensor {enabled FALSE}
1334 : DEF B LOD {
1335 : range IS lodRanges
1336 : level [
1337 : TankLowerBody { tex IS tex}
1338 : TankLowerBody { tex IS tex}
1339 : TankLowerBodyLod0 { tex IS tex}
1340 : TankLowerBodyLod0 { tex IS tex}
1341 : Group{}
1342 : Group{}
1343 : ]
1344 : }
1345 : DEF Z PositionInterpolator {
1346 : key [0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1]
1347 : keyValue [0 0 9
1348 : ,0 0 9.005,0 0 8.995
1349 : ,0 0 9.01 ,0 0 8.99
1350 : ,0 0 9.015,0 0 8.99
1351 : ,0 0 9.01 ,0 0 8.995
1352 : ,0 0 9.005,0 0 9]
1353 : }
1354 : DEF Z2 PositionInterpolator {
1355 : key [0,.2,.4,.6,.8,1]
1356 : keyValue [
1357 : 0 0 9,
1358 : 0 0 8,
1359 : 0 0 6,
1360 : 0 0 3,
1361 : 0 0 1,
1362 : 0 0 0]
1363 : }
1364 : DEF AU1 Sound {
1365 : direction 0 0 1
1366 : maxFront 200
1367 : minFront 1
1368 : maxBack 200
1369 : minBack 1
1370 : source DEF AC1 AudioClip {
1371 : url "tstart.wav"
1372 : }
1373 : }
1374 : DEF AU2 Sound {
1375 : direction 0 0 1
1376 : maxFront 200
1377 : minFront 1
1378 : maxBack 200
1379 : minBack 1
1380 : source DEF AC2 AudioClip {
1381 : url "tstart2.wav"
1382 : }
1383 : }
1384 : DEF AU3 Sound {
1385 : direction 0 0 1
1386 : maxFront 200
1387 : minFront 1
1388 : maxBack 200
1389 : minBack 1
1390 : source DEF AC3 AudioClip {
1391 : url "tmove.wav"
1392 : }
1393 : }
1394 : DEF AU4 Sound {
1395 : direction 0 0 1
1396 : maxFront 200
1397 : minFront 1
1398 : maxBack 200
1399 : minBack 1
1400 : source DEF AC4 AudioClip {
1401 : url "tstop.wav"
1402 : }
1403 : }
1404 : DEF TS TimeSensor {
1405 : cycleInterval 1
1406 : loop FALSE
1407 : }
1408 : DEF TS2 TimeSensor {
1409 : cycleInterval 3.36
1410 : loop FALSE
1411 : }
1412 : DEF CI1 ColorInterpolator {
1413 : key [0,1]
1414 : keyValue [0 0 0,1 0 0]
1415 : }
1416 : DEF CI2 ColorInterpolator {
1417 : key [0,.3,.6,.9,1]
1418 : keyValue [1 0 0,1 1 0,1 1 1,.3 .3 1,0 0 0]
1419 : }
1420 : DEF TIMER Script {
1421 : eventIn SFTime tick
1422 : eventIn SFTime flip
1423 : eventOut SFTime tick1
1424 : eventOut SFTime tick2
1425 : eventOut SFTime tick3
1426 : eventOut SFTime tick4
1427 : eventIn SFFloat tick5
1428 : field SFFloat dir 1
1429 : field SFNode p_I USE Z2
1430 : field SFNode p_I0 USE Z
1431 : field SFNode ts USE T
1432 : field MFNode t [USE TL0 USE TL1 USE TL2 USE TL3]
1433 : url "javascript:
1434 : function tick5(x) {
1435 : if (x>=1) ts.enabled=true;
1436 : for (j=0;j<3;j++) t[j].ttrans.trans =new SFVec2f (-.05,dir*x/4);
1437 : }
1438 : function tick(x) {
1439 : tick2=x+1;
1440 : tick3=x+1.88;
1441 : tick4=x+1.88+1.48;
1442 : }
1443 : function flip(x) {
1444 : ts.enabled=false;
1445 : tick1=x;
1446 : dir=-dir;
1447 : for (i=0;i<p_I.keyValue.length;i++) {
1448 : p_I.keyValue[i][2]=9-p_I.keyValue[i][2];
1449 : }
1450 : for (i=0;i<p_I0.keyValue.length;i++) {
1451 : p_I0.keyValue[i][2]=9-p_I0.keyValue[i][2];
1452 : }
1453 : }
1454 : "
1455 : }
1456 : DEF TSROT TimeSensor {
1457 : cycleInterval 10
1458 : loop TRUE
1459 : }
1460 : DEF RI OrientationInterpolator {
1461 : key [0,0.5,1]
1462 : keyValue [0 1 0 0,0 1 0 3.14,0 1 0 6.28]
1463 : }
1464 : Group{
1465 : children [
1466 : DEF MMV Transform {
1467 : translation 2 2 2
1468 : children [
1469 : Shape {
1470 : appearance Appearance {
1471 : material DEF MM Material {
1472 : emissiveColor 1 0 0
1473 : diffuseColor 1 0 0
1474 : }
1475 : }
1476 : geometry Box {
1477 : size .4 .4 .4
1478 : }
1479 : }
1480 : LOD {
1481 : range [80]
1482 : level [
1483 : DEF A1 Transform {
1484 : children [
1485 : Arrow {pos 0 0 .5}
1486 : Arrow {pos 0 0 -.5 rot 0 1 0 3.14}
1487 : ]
1488 : }
1489 : Group {}
1490 : ]
1491 : }
1492 : ]
1493 : }
1494 : DEF MASTER TouchSensor {}
1495 : DEF CI3 ColorInterpolator {
1496 : key [0,.5,1]
1497 : keyValue [.4 .4 0,0 .4 .2,.4 .4 0]
1498 : }
1499 : DEF CI4 ColorInterpolator {
1500 : key [0,.5,1]
1501 : keyValue [1 0 0,0 0 1,1 0 0]
1502 : }
1503 : DEF TS5 TimeSensor {
1504 : cycleInterval .7
1505 : loop TRUE
1506 : }
1507 : DEF TS3 TimeSensor {
1508 : cycleInterval .7
1509 : loop TRUE
1510 : }
1511 : DEF TS4 TimeSensor {
1512 : cycleInterval .7
1513 : loop TRUE
1514 : enabled FALSE
1515 : }
1516 : DEF RI2 OrientationInterpolator {
1517 : key [0,0.5,1]
1518 : keyValue [0 0 1 0,0 0 1 3.14,0 0 1 6.28]
1519 : }
1520 : DEF SC1 PositionInterpolator {
1521 : key [0,.15,.5,.85,1]
1522 : keyValue [1 1 1,.9 .9 .9,.7 .7 .7,.9 .9 .9,1 1 1]
1523 : }
1524 : DEF PI PositionInterpolator {
1525 : key [0,1]
1526 : keyValue [2 2 2,2 2 -2]
1527 : }
1528 : ]
1529 : ROUTE RI2.value_changed TO A1.rotation
1530 : ROUTE SC1.value_changed TO A1.scale
1531 : ROUTE TS5.fraction_changed TO RI2.set_fraction
1532 : ROUTE TS5.fraction_changed TO SC1.set_fraction
1533 : ROUTE TS3.fraction_changed TO CI3.set_fraction
1534 : ROUTE TS4.fraction_changed TO CI4.set_fraction
1535 : ROUTE CI3.value_changed TO MM.emissiveColor
1536 : ROUTE CI4.value_changed TO MM.emissiveColor
1537 : ROUTE CI3.value_changed TO MM.diffuseColor
1538 : ROUTE CI4.value_changed TO MM.diffuseColor
1539 : }
1540 :
1541 :
1542 : DEF ROTATOR Script {
1543 : field SFBool rotEnable FALSE
1544 : field SFFloat rotFracx 0
1545 : eventOut SFFloat rotFrac
1546 : field SFFloat rotSpd 0.05
1547 : eventIn SFTime rotStart
1548 : eventIn SFTime rotStop
1549 : eventIn SFFloat rotSpeed IS rotSpeed
1550 : field SFFloat rotFracLast 0
1551 : field SFBool t1 FALSE
1552 : eventIn SFFloat tick
1553 : url "javascript:
1554 : function rotStart(qx) {
1555 : rotEnable=true;
1556 : }
1557 : function rotStop (qx) {
1558 : rotEnable=false;
1559 : }
1560 : function rotSpeed(qx) {
1561 : rotSpd=qx;
1562 : }
1563 : function tick(qx) {
1564 : if (rotEnable) {
1565 : var diff=qx-rotFracLast;
1566 : if (diff<0) diff+=1;
1567 : rotFracx+=diff*rotSpd;
1568 : while (rotFracx>1) rotFracx-=1;
1569 : rotFrac=rotFracx;
1570 : }
1571 : rotFracLast=qx;
1572 : }
1573 : "
1574 : }
1575 : DEF DUMMY TimeSensor {
1576 : startTime IS startRotation
1577 : stopTime IS stopRotation
1578 : }
1579 : DEF ACTIVATOR Script {
1580 : eventIn SFTime touch
1581 : eventOut SFBool active
1582 : eventOut SFBool activeNot
1583 : field SFBool isActive FALSE
1584 : eventOut SFFloat move
1585 : url "javascript:
1586 : function touch(x) {
1587 : isActive=!isActive;
1588 : active=isActive;
1589 : activeNot=!isActive;
1590 : if (isActive) {
1591 : move=1;
1592 : } else {
1593 : move=0;
1594 : }
1595 : }
1596 : "
1597 : }
1598 : ]
1599 : ROUTE T.touchTime TO TIMER.flip
1600 : ROUTE T.touchTime TO TS.startTime
1601 : ROUTE T.touchTime TO AC1.startTime
1602 : ROUTE T.touchTime TO TIMER.tick
1603 : ROUTE TIMER.tick2 TO AC2.startTime
1604 : ROUTE TIMER.tick2 TO TS2.startTime
1605 : ROUTE TIMER.tick3 TO AC3.startTime
1606 : ROUTE TIMER.tick4 TO AC4.startTime
1607 : ROUTE TS2.fraction_changed TO TIMER.tick5
1608 : ROUTE TS.fraction_changed TO Z.set_fraction
1609 : ROUTE TS2.fraction_changed TO Z2.set_fraction
1610 : ROUTE TS.fraction_changed TO CI1.set_fraction
1611 : ROUTE TS2.fraction_changed TO CI2.set_fraction
1612 : ROUTE Z.value_changed TO TK.translation
1613 : ROUTE Z2.value_changed TO TK.translation
1614 : ROUTE CI1.value_changed TO EX0.color
1615 : ROUTE CI2.value_changed TO EX0.color
1616 : }
1617 : TankEntranceLod { pos .8 .95 -2.2 tex IS tex lodRanges IS lodRanges}
1618 : TankEntranceLod { pos -.8 .95 -2.2 tex IS tex lodRanges IS lodRanges}
1619 : DEF TT TankTurretLod { lodRanges IS lodRanges tex IS tex rotatable FALSE }
1620 : TankMG { pos .7 .65 -3.68 tex IS tex lodRanges IS lodRanges }
1621 : ]
1622 : }
1623 : ]
1624 :
1625 : #proximity -> light
1626 : ROUTE P.isActive TO L.on
1627 : ROUTE P.isActive TO L2.on
1628 : ROUTE P2.isActive TO NameScr.SendName
1629 : #rotator
1630 : ROUTE TSROT.fraction_changed TO ROTATOR.tick
1631 : ROUTE ROTATOR.rotFrac TO RI.set_fraction
1632 : ROUTE RI.value_changed TO ROT.rotation
1633 : ROUTE ACTIVATOR.activeNot TO TS3.enabled
1634 : ROUTE ACTIVATOR.active TO TS4.enabled
1635 : ROUTE ACTIVATOR.move TO PI.set_fraction
1636 : ROUTE PI.value_changed TO MMV.translation
1637 : ROUTE DUMMY.startTime TO ROTATOR.rotStart
1638 : ROUTE DUMMY.stopTime TO ROTATOR.rotStop
1639 : #master
1640 : ROUTE MASTER.touchTime TO ACTIVATOR.touch
1641 : ROUTE ACTIVATOR.active TO T.enabled
1642 : ROUTE ACTIVATOR.active TO P.enabled
1643 : ROUTE ACTIVATOR.active TO TT.rotatable
1644 :
1645 : }
1646 : ]
1647 : }
1648 : }
1649 : }
1650 : }