-
Notifications
You must be signed in to change notification settings - Fork 2
/
rb_js.wrl
128 lines (114 loc) · 2.41 KB
/
rb_js.wrl
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
#VRML V2.0 utf8
Transform {
translation -0.5 1 0
rotation 1 0 0 0.5
children [
DEF robot Transform {
children [
DEF touch TouchSensor {
enabled TRUE
}
DEF dau Transform {
translation 0 0 0
children [
Transform {
children [
Shape {
geometry Sphere {
radius 0.2
}
appearance Appearance {
material Material {
diffuseColor .58 .27 .01
specularColor .0745 0 0
ambientIntensity 0
shininess 0
}
}
}
]
}
Transform {
translation 0.2 0 0
rotation 0 0 -1 1.57
children [
Shape {
geometry Cone {
height 0.5
bottom TRUE
bottomRadius 0.15
side TRUE
}
appearance Appearance {
material Material {
diffuseColor .996 0 0
}
}
}
]
}
]
}
DEF than Transform {
translation 0 -0.7 0
rotation 0 0 1 0
children [
Shape {
geometry Box {
size 0.5 1 0.5
}
appearance Appearance {
material Material {
diffuseColor .39 .46 .42
specularColor .53 .53 .53
ambientIntensity .103
shininess .93
}
}
}
]
}
DEF or OrientationInterpolator {
key [0 0.15 0.25 0.45 0.55 0.65 0.75 1]
keyValue [0 0 0 0,0 0 0 0,0 1 0 -1.57, 0 1 0 -1.57,0 1 0 -3.14,0 1 0 -3.14, 0 1 0 -4.71, 0 1 0 -4.71]
}
DEF pos PositionInterpolator {
key [0 0.15 0.25 0.45 0.55 0.65 0.75 1]
keyValue [0 0 0, 3 0 0, 3 0 0, 3 0 3,3 0 3,0 0 3,0 0 3, 0 0 0]
}
DEF Clock TimeSensor {
enabled FALSE
cycleInterval 10
loop TRUE
}
DEF majs Script {
eventIn SFBool Bat
eventOut SFBool On
eventOut SFBool Off
field SFBool turn FALSE
url "javascript:
function Bat(val){
if(val){
turn = !turn;
if(turn)
{
On = true;
Off = false;
}else{
On = false;
Off = true;
}
}
}
"
}
]
}
]
ROUTE touch.isActive TO majs.Bat
ROUTE majs.On TO Clock.enabled
ROUTE Clock.fraction_changed TO or.set_fraction
ROUTE Clock.fraction_changed TO pos.set_fraction
ROUTE or.value_changed TO robot.rotation
ROUTE pos.value_changed TO robot.translation
}