sunrize 1.2.0 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,14 +3,16 @@
3
3
  <X3D profile='Interchange' version='4.0' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='http://www.web3d.org/specifications/x3d-4.0.xsd'>
4
4
  <head>
5
5
  <component name='Layout' level='2'/>
6
+ <component name='PointingDeviceSensor' level='1'/>
6
7
  <component name='Scripting' level='1'/>
8
+ <component name='X_ITE' level='1'/>
7
9
  <unit category='angle' name='degree' conversionFactor='0.017453292519943295'/>
8
10
  <meta name='comment' content='Rise and Shine'/>
9
11
  <meta name='created' content='Thu, 18 Feb 2016 08:47:54 GMT'/>
10
12
  <meta name='creator' content='Holger Seelig'/>
11
- <meta name='generator' content='Sunrize X3D Editor V1.1.9, https://create3000.github.io/sunrize/'/>
13
+ <meta name='generator' content='Sunrize X3D Editor V1.2.1, https://create3000.github.io/sunrize/'/>
12
14
  <meta name='identifier' content='file:///Users/holger/Desktop/X_ITE/sunrize/src/sunrize/Tools/Sound/SoundTool.x3d'/>
13
- <meta name='modified' content='Thu, 23 Nov 2023 02:13:35 GMT'/>
15
+ <meta name='modified' content='Fri, 24 Nov 2023 22:20:23 GMT'/>
14
16
  </head>
15
17
  <Scene>
16
18
  <ExternProtoDeclare name='ToolShader' url='"../Shaders/ToolShader.x3d"'>
@@ -29,7 +31,7 @@
29
31
  <ProtoInterface>
30
32
  <field accessType='inputOutput' type='SFBool' name='selected'/>
31
33
  <field accessType='inputOutput' type='SFString' name='group' value='TRANSFORM_TOOL'/>
32
- <field accessType='inputOutput' type='SFBool' name='grouped'/>
34
+ <field accessType='inputOutput' type='SFBool' name='grouping'/>
33
35
  <field accessType='inputOutput' type='SFBool' name='undo' value='true'/>
34
36
  <field accessType='inputOutput' type='SFVec3f' name='location'/>
35
37
  <field accessType='inputOutput' type='SFVec3f' name='direction' value='0 0 1'/>
@@ -38,7 +40,7 @@
38
40
  <field accessType='inputOutput' type='SFFloat' name='maxBack'/>
39
41
  <field accessType='inputOutput' type='SFFloat' name='maxFront'/>
40
42
  <field accessType='outputOnly' type='SFNode' name='transformTool'/>
41
- <field accessType='outputOnly' type='SFInt32' name='activeTool'/>
43
+ <field accessType='outputOnly' type='SFString' name='activeTool'/>
42
44
  <field accessType='outputOnly' type='SFBool' name='isActive'/>
43
45
  </ProtoInterface>
44
46
  <ProtoBody>
@@ -58,7 +60,7 @@
58
60
  <Material DEF='_2'
59
61
  diffuseColor='0.2705882 0.2705882 0.2705882'
60
62
  specularColor='0.8627451 0.8588235 0.8588235'/>
61
- <ProtoInstance name='ToolShader' DEF='_3' containerField='shaders'/>
63
+ <ProtoInstance name='ToolShader' DEF='_13' containerField='shaders'/>
62
64
  </Appearance>
63
65
  <Cone
64
66
  bottom='false'
@@ -84,7 +86,7 @@
84
86
  rotation='-1 0 0 90'>
85
87
  <ProtoInstance name='BooleanSwitch'>
86
88
  <fieldValue name='children'>
87
- <Shape DEF='_4'
89
+ <Shape DEF='_14'
88
90
  castShadow='false'>
89
91
  <Appearance>
90
92
  <LineProperties DEF='_5'
@@ -92,7 +94,7 @@
92
94
  <Material
93
95
  diffuseColor='0 0 0'
94
96
  emissiveColor='0.619608 0.184314 0.184314'/>
95
- <ProtoInstance name='ToolShader' USE='_3' containerField='shaders'/>
97
+ <ProtoInstance name='ToolShader' USE='_13' containerField='shaders'/>
96
98
  </Appearance>
97
99
  <IndexedLineSet DEF='_6'
98
100
  coordIndex='0, 1, 2, 0, -1, 2, 3, 0, -1, 3, 4, 0, -1, 4, 5, 0, -1, 5, 6, 0, -1, 6, 7, 0, -1, 7, 8, 0, -1, 8, 9, 0, -1, 9, 10, 0, -1, 10, 1, -1, 1, 11, 12, 2, -1, 12, 13, 3, -1, 13, 14, 4, -1, 14, 15, 5, -1, 15, 16, 6, -1, 16, 17, 7, -1, 17, 18, 8, -1, 18, 19, 9, -1, 19, 20, 10, -1, 20, 11, -1, 11, 21, 22, 12, -1, 22, 23, 13, -1, 23, 24, 14, -1, 24, 25, 15, -1, 25, 26, 16, -1, 26, 27, 17, -1, 27, 28, 18, -1, 28, 29, 19, -1, 29, 30, 20, -1, 30, 21, -1, 21, 31, 32, 22, -1, 32, 33, 23, -1, 33, 34, 24, -1, 34, 35, 25, -1, 35, 36, 26, -1, 36, 37, 27, -1, 37, 38, 28, -1, 38, 39, 29, -1, 39, 40, 30, -1, 40, 31, -1, 31, 41, 42, 32, -1, 42, 43, 33, -1, 43, 44, 34, -1, 44, 45, 35, -1, 45, 46, 36, -1, 46, 47, 37, -1, 47, 48, 38, -1, 48, 49, 39, -1, 49, 50, 40, -1, 50, 41, -1, 41, 51, 52, 42, -1, 52, 53, 43, -1, 53, 54, 44, -1, 54, 55, 45, -1, 55, 56, 46, -1, 56, 57, 47, -1, 57, 58, 48, -1, 58, 59, 49, -1, 59, 60, 50, -1, 60, 51, -1, 51, 61, 62, 52, -1, 62, 63, 53, -1, 63, 64, 54, -1, 64, 65, 55, -1, 65, 66, 56, -1, 66, 67, 57, -1, 67, 68, 58, -1, 68, 69, 59, -1, 69, 70, 60, -1, 70, 61, -1, 71, 62, -1, 61, 71, -1, 71, 63, -1, 71, 64, -1, 71, 65, -1, 71, 66, -1, 71, 67, -1, 71, 68, -1, 71, 69, -1, 71, 70, -1'>
@@ -118,7 +120,8 @@
118
120
  </ProtoInstance>
119
121
  </Transform>
120
122
  </Transform>
121
- <Transform DEF='MaxEllipsoid'>
123
+ <Transform DEF='MaxEllipsoid'
124
+ scale='10 10 10'>
122
125
  <Transform
123
126
  rotation='-1 0 0 90'>
124
127
  <ProtoInstance name='BooleanSwitch'>
@@ -130,7 +133,7 @@
130
133
  <Material
131
134
  diffuseColor='0 0 0'
132
135
  emissiveColor='0.184314 0.619608 0.258824'/>
133
- <ProtoInstance name='ToolShader' USE='_3' containerField='shaders'/>
136
+ <ProtoInstance name='ToolShader' USE='_13' containerField='shaders'/>
134
137
  </Appearance>
135
138
  <IndexedLineSet DEF='_9'
136
139
  coordIndex='0, 1, 2, 0, -1, 2, 3, 0, -1, 3, 4, 0, -1, 4, 5, 0, -1, 5, 6, 0, -1, 6, 7, 0, -1, 7, 8, 0, -1, 8, 9, 0, -1, 9, 10, 0, -1, 10, 1, -1, 1, 11, 12, 2, -1, 12, 13, 3, -1, 13, 14, 4, -1, 14, 15, 5, -1, 15, 16, 6, -1, 16, 17, 7, -1, 17, 18, 8, -1, 18, 19, 9, -1, 19, 20, 10, -1, 20, 11, -1, 11, 21, 22, 12, -1, 22, 23, 13, -1, 23, 24, 14, -1, 24, 25, 15, -1, 25, 26, 16, -1, 26, 27, 17, -1, 27, 28, 18, -1, 28, 29, 19, -1, 29, 30, 20, -1, 30, 21, -1, 21, 31, 32, 22, -1, 32, 33, 23, -1, 33, 34, 24, -1, 34, 35, 25, -1, 35, 36, 26, -1, 36, 37, 27, -1, 37, 38, 28, -1, 38, 39, 29, -1, 39, 40, 30, -1, 40, 31, -1, 31, 41, 42, 32, -1, 42, 43, 33, -1, 43, 44, 34, -1, 44, 45, 35, -1, 45, 46, 36, -1, 46, 47, 37, -1, 47, 48, 38, -1, 48, 49, 39, -1, 49, 50, 40, -1, 50, 41, -1, 41, 51, 52, 42, -1, 52, 53, 43, -1, 53, 54, 44, -1, 54, 55, 45, -1, 55, 56, 46, -1, 56, 57, 47, -1, 57, 58, 48, -1, 58, 59, 49, -1, 59, 60, 50, -1, 60, 51, -1, 51, 61, 62, 52, -1, 62, 63, 53, -1, 63, 64, 54, -1, 64, 65, 55, -1, 65, 66, 56, -1, 66, 67, 57, -1, 67, 68, 58, -1, 68, 69, 59, -1, 69, 70, 60, -1, 70, 61, -1, 71, 62, -1, 61, 71, -1, 71, 63, -1, 71, 64, -1, 71, 65, -1, 71, 66, -1, 71, 67, -1, 71, 68, -1, 71, 69, -1, 71, 70, -1'>
@@ -145,7 +148,7 @@
145
148
  <Material
146
149
  diffuseColor='0 0 0'
147
150
  emissiveColor='0.301961 1 0.415686'/>
148
- <ProtoInstance name='ToolShader' USE='_3' containerField='shaders'/>
151
+ <ProtoInstance name='ToolShader' USE='_13' containerField='shaders'/>
149
152
  </Appearance>
150
153
  <IndexedLineSet USE='_9'/>
151
154
  </Shape>
@@ -156,6 +159,107 @@
156
159
  </ProtoInstance>
157
160
  </Transform>
158
161
  </Transform>
162
+ <Group DEF='MinBack'>
163
+ <Transform DEF='CenterPoint_2'
164
+ translation='0 0 -1'>
165
+ <IS>
166
+ <connect nodeField='visible' protoField='selected'/>
167
+ </IS>
168
+ <ScreenGroup DEF='_19'>
169
+ <Shape
170
+ castShadow='false'>
171
+ <Appearance DEF='Red'>
172
+ <Material
173
+ diffuseColor='1 0 0'/>
174
+ <ProtoInstance name='ToolShader' DEF='_21' containerField='shaders'/>
175
+ <DepthMode DEF='_22'
176
+ depthRange='0 0.01'/>
177
+ </Appearance>
178
+ <Sphere DEF='Sphere'
179
+ radius='6'/>
180
+ </Shape>
181
+ </ScreenGroup>
182
+ <TouchSensor DEF='_18'
183
+ description='Min Back'/>
184
+ </Transform>
185
+ <Transform DEF='MinBackTool'
186
+ translation='0 0 -1'
187
+ rotation='0 1 0 90'
188
+ visible='false'>
189
+ <ScreenGroup>
190
+ <Group DEF='_26'
191
+ bboxSize='30 30 30'/>
192
+ </ScreenGroup>
193
+ </Transform>
194
+ </Group>
195
+ <Group DEF='MinFront'>
196
+ <Transform DEF='CenterPoint_3'
197
+ translation='0 0 1'>
198
+ <IS>
199
+ <connect nodeField='visible' protoField='selected'/>
200
+ </IS>
201
+ <ScreenGroup USE='_19'/>
202
+ <TouchSensor DEF='_24'
203
+ description='Min Front'/>
204
+ </Transform>
205
+ <Transform DEF='MinFrontTool'
206
+ translation='0 0 1'
207
+ rotation='0 1 0 -90'
208
+ visible='false'>
209
+ <ScreenGroup>
210
+ <Group USE='_26'/>
211
+ </ScreenGroup>
212
+ </Transform>
213
+ </Group>
214
+ <Group DEF='MaxBack'>
215
+ <Transform DEF='CenterPoint'
216
+ translation='0 0 -10'>
217
+ <IS>
218
+ <connect nodeField='visible' protoField='selected'/>
219
+ </IS>
220
+ <ScreenGroup DEF='_3'>
221
+ <Shape
222
+ castShadow='false'>
223
+ <Appearance DEF='Green'>
224
+ <Material
225
+ diffuseColor='0 1 0'/>
226
+ <ProtoInstance name='ToolShader' USE='_21' containerField='shaders'/>
227
+ <DepthMode USE='_22'/>
228
+ </Appearance>
229
+ <Sphere USE='Sphere'/>
230
+ </Shape>
231
+ </ScreenGroup>
232
+ <TouchSensor DEF='_16'
233
+ description='Max Back'/>
234
+ </Transform>
235
+ <Transform DEF='MaxBackTool'
236
+ translation='0 0 -10'
237
+ rotation='1 0 0 -90'
238
+ visible='false'>
239
+ <ScreenGroup>
240
+ <Group USE='_26'/>
241
+ </ScreenGroup>
242
+ </Transform>
243
+ </Group>
244
+ <Group DEF='MaxFront'>
245
+ <Transform DEF='CenterPoint_1'
246
+ translation='0 0 10'>
247
+ <IS>
248
+ <connect nodeField='visible' protoField='selected'/>
249
+ </IS>
250
+ <ScreenGroup USE='_3'/>
251
+ <TouchSensor DEF='_17'
252
+ description='Max Front'/>
253
+ </Transform>
254
+ <Transform DEF='MaxFrontTool'
255
+ translation='0 0 10'
256
+ rotation='1 0 0 90'
257
+ visible='false'>
258
+ <ScreenGroup>
259
+ <Group USE='_26'/>
260
+ </ScreenGroup>
261
+ </Transform>
262
+ </Group>
159
263
  </Transform>
160
264
  <Transform DEF='TransformTool'>
161
265
  <IS>
@@ -171,46 +275,68 @@
171
275
  <Script DEF='SoundScript'
172
276
  directOutput='true'>
173
277
  <field accessType='inputOutput' type='SFBool' name='selected'/>
278
+ <field accessType='inputOutput' type='SFBool' name='active'/>
174
279
  <field accessType='inputOutput' type='SFVec3f' name='direction'/>
175
280
  <field accessType='inputOnly' type='SFRotation' name='set_rotation'/>
281
+ <field accessType='inputOnly' type='SFTime' name='set_minBackTime'/>
282
+ <field accessType='inputOnly' type='SFBool' name='set_minBackActive'/>
283
+ <field accessType='inputOnly' type='SFVec3f' name='set_minBackTranslation'/>
284
+ <field accessType='initializeOnly' type='SFBool' name='minBackDisplay'/>
176
285
  <field accessType='inputOutput' type='SFFloat' name='minBack'/>
286
+ <field accessType='inputOnly' type='SFTime' name='set_minFrontTime'/>
287
+ <field accessType='inputOnly' type='SFBool' name='set_minFrontActive'/>
288
+ <field accessType='inputOnly' type='SFVec3f' name='set_minFrontTranslation'/>
289
+ <field accessType='initializeOnly' type='SFBool' name='minFrontDisplay'/>
177
290
  <field accessType='inputOutput' type='SFFloat' name='minFront'/>
291
+ <field accessType='inputOnly' type='SFTime' name='set_maxBackTime'/>
292
+ <field accessType='inputOnly' type='SFBool' name='set_maxBackActive'/>
293
+ <field accessType='inputOnly' type='SFVec3f' name='set_maxBackTranslation'/>
294
+ <field accessType='initializeOnly' type='SFBool' name='maxBackDisplay'/>
178
295
  <field accessType='inputOutput' type='SFFloat' name='maxBack'/>
296
+ <field accessType='inputOnly' type='SFTime' name='set_maxFrontTime'/>
297
+ <field accessType='inputOnly' type='SFBool' name='set_maxFrontActive'/>
298
+ <field accessType='inputOnly' type='SFVec3f' name='set_maxFrontTranslation'/>
299
+ <field accessType='initializeOnly' type='SFBool' name='maxFrontDisplay'/>
179
300
  <field accessType='inputOutput' type='SFFloat' name='maxFront'/>
180
301
  <field accessType='outputOnly' type='SFVec3f' name='minTranslation_changed'/>
181
302
  <field accessType='outputOnly' type='SFVec3f' name='maxTranslation_changed'/>
182
303
  <field accessType='outputOnly' type='SFVec3f' name='minScale_changed'/>
183
304
  <field accessType='outputOnly' type='SFVec3f' name='maxScale_changed'/>
184
- <field accessType='inputOutput' type='SFInt32' name='activeTool'/>
185
- <field accessType='inputOutput' type='SFBool' name='active'/>
305
+ <field accessType='inputOutput' type='SFString' name='activeTool'/>
186
306
  <field accessType='inputOutput' type='SFNode' name='transform'>
187
307
  <Transform USE='TransformTool'/>
188
308
  </field>
309
+ <field accessType='initializeOnly' type='SFNode' name='minBackTransform'>
310
+ <Transform USE='MinBackTool'/>
311
+ </field>
312
+ <field accessType='initializeOnly' type='SFNode' name='minFrontTransform'>
313
+ <Transform USE='MinFrontTool'/>
314
+ </field>
315
+ <field accessType='initializeOnly' type='SFNode' name='maxBackTransform'>
316
+ <Transform USE='MaxBackTool'/>
317
+ </field>
318
+ <field accessType='initializeOnly' type='SFNode' name='maxFrontTransform'>
319
+ <Transform USE='MaxFrontTool'/>
320
+ </field>
189
321
  <field accessType='initializeOnly' type='SFNode' name='material'>
190
322
  <Material USE='_2'/>
191
323
  </field>
192
324
  <IS>
193
325
  <connect nodeField='selected' protoField='selected'/>
326
+ <connect nodeField='active' protoField='isActive'/>
194
327
  <connect nodeField='direction' protoField='direction'/>
195
328
  <connect nodeField='minBack' protoField='minBack'/>
196
329
  <connect nodeField='minFront' protoField='minFront'/>
197
330
  <connect nodeField='maxBack' protoField='maxBack'/>
198
331
  <connect nodeField='maxFront' protoField='maxFront'/>
199
332
  <connect nodeField='activeTool' protoField='activeTool'/>
200
- <connect nodeField='active' protoField='isActive'/>
201
333
  <connect nodeField='transform' protoField='transformTool'/>
202
334
  </IS>
203
335
  <![CDATA[ecmascript:
204
336
 
205
- const zAxis = new SFVec3f (0, 0, 1);
206
-
207
337
  async function initialize ()
208
338
  {
209
- set_direction (direction);
210
- set_minRange ();
211
- set_maxRange ();
212
-
213
- const tool = await transform .getValue () .addTool () .getToolInstance ();
339
+ const tool = await transform .getValue () .addTool () .getToolInstance ();
214
340
 
215
341
  Browser .addRoute (tool, "activeTool", this, "activeTool");
216
342
  Browser .addRoute (tool, "isActive", this, "active");
@@ -226,6 +352,11 @@ function set_selected ()
226
352
  material .emissiveColor = selected
227
353
  ? new SFColor (0.1, 0.1, 0.1)
228
354
  : new SFColor ();
355
+
356
+ minBackTransform .visible = selected && minBackDisplay;
357
+ minFrontTransform .visible = selected && minFrontDisplay;
358
+ maxBackTransform .visible = selected && maxBackDisplay;
359
+ maxFrontTransform .visible = selected && maxFrontDisplay;
229
360
  }
230
361
 
231
362
  let changing = false;
@@ -240,7 +371,7 @@ function set_direction (value)
240
371
 
241
372
  changing = true;
242
373
 
243
- transform .rotation = straightenHorizon (new SFRotation (new SFVec3f (0, 0, 1), value),
374
+ transform .rotation = straightenHorizon (new SFRotation (new SFVec3f (0, 0, 1), value),
244
375
  new SFVec3f (0, 1, 0));
245
376
  }
246
377
 
@@ -276,28 +407,288 @@ function straightenHorizon (orientation, upVector)
276
407
  return orientation .multiply (rotation);
277
408
  }
278
409
 
279
- function set_minBack ()
410
+ // minBack
411
+
412
+ let minBackChanging = false;
413
+
414
+ async function set_minBackTime ()
415
+ {
416
+ minBackDisplay = !minBackDisplay;
417
+
418
+ set_selected ();
419
+
420
+ if (minBackTransform .getValue () .getTool ())
421
+ return;
422
+
423
+ const tool = await minBackTransform .getValue () .addTool () .getToolInstance ();
424
+
425
+ Browser .addRoute (tool, "isActive", this, "set_minBackActive");
426
+
427
+ tool .group = "NONE";
428
+ tool .undo = false;
429
+ tool .tools = new MFString ("TRANSLATE");
430
+ tool .yAxisDisplay = false;
431
+ tool .zAxisDisplay = false;
432
+ tool .centerDisplay = false;
433
+ tool .bboxDisplay = false;
434
+ }
435
+
436
+ async function set_minBackActive (value)
437
+ {
438
+ if (value)
439
+ {
440
+ activeTool = "MIN_BACK";
441
+ active = true;
442
+ }
443
+ else
444
+ {
445
+ const tool = await transform .getValue () .addTool () .getToolInstance ();
446
+
447
+ activeTool = tool .activeTool;
448
+ active = false;
449
+ }
450
+ }
451
+
452
+ function set_minBackTranslation (value)
453
+ {
454
+ if (minBackChanging)
455
+ {
456
+ minBackChanging = false;
457
+ return;
458
+ }
459
+
460
+ minBackChanging = true;
461
+
462
+ minBack = -value .z;
463
+ }
464
+
465
+ function set_minBack (value)
280
466
  {
281
467
  set_minRange ();
468
+
469
+ if (minBackChanging)
470
+ {
471
+ minBackChanging = false;
472
+ return;
473
+ }
474
+
475
+ minBackChanging = true;
476
+
477
+ minBackTransform .translation .z = -value;
478
+ }
479
+
480
+ // minFront
481
+
482
+ let minFrontChanging = false;
483
+
484
+ async function set_minFrontTime ()
485
+ {
486
+ minFrontDisplay = !minFrontDisplay;
487
+
488
+ set_selected ();
489
+
490
+ if (minFrontTransform .getValue () .getTool ())
491
+ return;
492
+
493
+ const tool = await minFrontTransform .getValue () .addTool () .getToolInstance ();
494
+
495
+ Browser .addRoute (tool, "isActive", this, "set_minFrontActive");
496
+
497
+ tool .group = "NONE";
498
+ tool .undo = false;
499
+ tool .tools = new MFString ("TRANSLATE");
500
+ tool .yAxisDisplay = false;
501
+ tool .zAxisDisplay = false;
502
+ tool .centerDisplay = false;
503
+ tool .bboxDisplay = false;
504
+ }
505
+
506
+ async function set_minFrontActive (value)
507
+ {
508
+ if (value)
509
+ {
510
+ activeTool = "MIN_FRONT";
511
+ active = true;
512
+ }
513
+ else
514
+ {
515
+ const tool = await transform .getValue () .addTool () .getToolInstance ();
516
+
517
+ activeTool = tool .activeTool;
518
+ active = false;
519
+ }
282
520
  }
283
521
 
284
- function set_minFront ()
522
+ function set_minFrontTranslation (value)
523
+ {
524
+ if (minFrontChanging)
525
+ {
526
+ minFrontChanging = false;
527
+ return;
528
+ }
529
+
530
+ minFrontChanging = true;
531
+
532
+ minFront = value .z;
533
+ }
534
+
535
+ function set_minFront (value)
285
536
  {
286
537
  set_minRange ();
538
+
539
+ if (minFrontChanging)
540
+ {
541
+ minFrontChanging = false;
542
+ return;
543
+ }
544
+
545
+ minFrontChanging = true;
546
+
547
+ minFrontTransform .translation .z = value;
287
548
  }
288
549
 
289
- function set_maxBack ()
550
+ // maxBack
551
+
552
+ let maxBackChanging = false;
553
+
554
+ async function set_maxBackTime ()
290
555
  {
556
+ maxBackDisplay = !maxBackDisplay;
557
+
558
+ set_selected ();
559
+
560
+ if (maxBackTransform .getValue () .getTool ())
561
+ return;
562
+
563
+ const tool = await maxBackTransform .getValue () .addTool () .getToolInstance ();
564
+
565
+ Browser .addRoute (tool, "isActive", this, "set_maxBackActive");
566
+
567
+ tool .group = "NONE";
568
+ tool .undo = false;
569
+ tool .tools = new MFString ("TRANSLATE");
570
+ tool .xAxisDisplay = false;
571
+ tool .zAxisDisplay = false;
572
+ tool .centerDisplay = false;
573
+ tool .bboxDisplay = false;
574
+ }
575
+
576
+ async function set_maxBackActive (value)
577
+ {
578
+ if (value)
579
+ {
580
+ activeTool = "MAX_BACK";
581
+ active = true;
582
+ }
583
+ else
584
+ {
585
+ const tool = await transform .getValue () .addTool () .getToolInstance ();
586
+
587
+ activeTool = tool .activeTool;
588
+ active = false;
589
+ }
590
+ }
591
+
592
+ function set_maxBackTranslation (value)
593
+ {
594
+ if (maxBackChanging)
595
+ {
596
+ maxBackChanging = false;
597
+ return;
598
+ }
599
+
600
+ maxBackChanging = true;
601
+
602
+ maxBack = -value .z;
603
+ }
291
604
 
605
+ function set_maxBack (value)
606
+ {
292
607
  set_maxRange ();
608
+
609
+ if (maxBackChanging)
610
+ {
611
+ maxBackChanging = false;
612
+ return;
613
+ }
614
+
615
+ maxBackChanging = true;
616
+
617
+ maxBackTransform .translation .z = -value;
618
+ }
619
+
620
+ // maxFront
621
+
622
+ let maxFrontChanging = false;
623
+
624
+ async function set_maxFrontTime ()
625
+ {
626
+ maxFrontDisplay = !maxFrontDisplay;
627
+
628
+ set_selected ();
629
+
630
+ if (maxFrontTransform .getValue () .getTool ())
631
+ return;
632
+
633
+ const tool = await maxFrontTransform .getValue () .addTool () .getToolInstance ();
634
+
635
+ Browser .addRoute (tool, "isActive", this, "set_maxFrontActive");
636
+
637
+ tool .group = "NONE";
638
+ tool .undo = false;
639
+ tool .tools = new MFString ("TRANSLATE");
640
+ tool .xAxisDisplay = false;
641
+ tool .zAxisDisplay = false;
642
+ tool .centerDisplay = false;
643
+ tool .bboxDisplay = false;
644
+ }
645
+
646
+ async function set_maxFrontActive (value)
647
+ {
648
+ if (value)
649
+ {
650
+ activeTool = "MAX_FRONT";
651
+ active = true;
652
+ }
653
+ else
654
+ {
655
+ const tool = await transform .getValue () .addTool () .getToolInstance ();
656
+
657
+ activeTool = tool .activeTool;
658
+ active = false;
659
+ }
293
660
  }
294
661
 
295
- function set_maxFront ()
662
+ function set_maxFrontTranslation (value)
296
663
  {
664
+ if (maxFrontChanging)
665
+ {
666
+ maxFrontChanging = false;
667
+ return;
668
+ }
669
+
670
+ maxFrontChanging = true;
297
671
 
672
+ maxFront = value .z;
673
+ }
674
+
675
+ function set_maxFront (value)
676
+ {
298
677
  set_maxRange ();
678
+
679
+ if (maxFrontChanging)
680
+ {
681
+ maxFrontChanging = false;
682
+ return;
683
+ }
684
+
685
+ maxFrontChanging = true;
686
+
687
+ maxFrontTransform .translation .z = value;
299
688
  }
300
689
 
690
+ // Ranges
691
+
301
692
  function set_minRange ()
302
693
  {
303
694
  const [a, b, e] = getEllipsoidParams (minBack, minFront);
@@ -333,14 +724,26 @@ function getEllipsoidParams (back, front)
333
724
  <ROUTE fromNode='SoundScript' fromField='maxScale_changed' toNode='MaxEllipsoid' toField='set_scale'/>
334
725
  <ROUTE fromNode='TransformTool' fromField='rotation_changed' toNode='Sound' toField='set_rotation'/>
335
726
  <ROUTE fromNode='TransformTool' fromField='rotation_changed' toNode='SoundScript' toField='set_rotation'/>
727
+ <ROUTE fromNode='MaxBackTool' fromField='translation_changed' toNode='CenterPoint' toField='set_translation'/>
728
+ <ROUTE fromNode='_16' fromField='touchTime' toNode='SoundScript' toField='set_maxBackTime'/>
729
+ <ROUTE fromNode='MaxBackTool' fromField='translation_changed' toNode='SoundScript' toField='set_maxBackTranslation'/>
730
+ <ROUTE fromNode='MaxFrontTool' fromField='translation_changed' toNode='CenterPoint_1' toField='set_translation'/>
731
+ <ROUTE fromNode='MaxFrontTool' fromField='translation_changed' toNode='SoundScript' toField='set_maxFrontTranslation'/>
732
+ <ROUTE fromNode='_17' fromField='touchTime' toNode='SoundScript' toField='set_maxFrontTime'/>
733
+ <ROUTE fromNode='MinBackTool' fromField='translation_changed' toNode='CenterPoint_2' toField='set_translation'/>
734
+ <ROUTE fromNode='_18' fromField='touchTime' toNode='SoundScript' toField='set_minBackTime'/>
735
+ <ROUTE fromNode='MinBackTool' fromField='translation_changed' toNode='SoundScript' toField='set_minBackTranslation'/>
736
+ <ROUTE fromNode='MinFrontTool' fromField='translation_changed' toNode='CenterPoint_3' toField='set_translation'/>
737
+ <ROUTE fromNode='_24' fromField='touchTime' toNode='SoundScript' toField='set_minFrontTime'/>
738
+ <ROUTE fromNode='MinFrontTool' fromField='translation_changed' toNode='SoundScript' toField='set_minFrontTranslation'/>
336
739
  </ProtoBody>
337
740
  </ProtoDeclare>
338
741
  <ProtoInstance name='Tool'>
339
742
  <fieldValue name='selected' value='true'/>
340
- <fieldValue name='minBack' value='10'/>
341
- <fieldValue name='minFront' value='10'/>
743
+ <fieldValue name='minBack' value='1'/>
744
+ <fieldValue name='minFront' value='1'/>
342
745
  <fieldValue name='maxBack' value='10'/>
343
- <fieldValue name='maxFront' value='100'/>
746
+ <fieldValue name='maxFront' value='10'/>
344
747
  </ProtoInstance>
345
748
  </Scene>
346
749
  </X3D>
@@ -23,31 +23,9 @@ class X3DTextureProjectorNodeTool extends X3DChildNodeTool
23
23
  this .addExternalNode (this .node ._texture);
24
24
  }
25
25
 
26
- #initialLocation;
27
- #initialDirection;
28
- #initialUpVector;
29
-
30
26
  beginUndo ()
31
27
  {
32
- this .#initialLocation = this ._location .copy ();
33
- this .#initialDirection = this ._direction .copy ();
34
- this .#initialUpVector = this ._upVector .copy ();
35
- }
36
-
37
- endUndo ()
38
- {
39
- const
40
- location = this ._location .copy (),
41
- direction = this ._direction .copy (),
42
- upVector = this ._upVector .copy ();
43
-
44
- this ._location = this .#initialLocation;
45
- this ._direction = this .#initialDirection;
46
- this ._upVector = this .#initialUpVector;
47
-
48
- Editor .setFieldValue (this .getExecutionContext (), this .node, this ._location, location);
49
- Editor .setFieldValue (this .getExecutionContext (), this .node, this ._direction, direction);
50
- Editor .setFieldValue (this .getExecutionContext (), this .node, this ._upVector, upVector);
28
+ this .undoSaveInitialValues (["location", "direction", "upVector"]);
51
29
  }
52
30
  }
53
31
 
@@ -29,7 +29,7 @@
29
29
  <ProtoInterface>
30
30
  <field accessType='inputOutput' type='SFBool' name='selected'/>
31
31
  <field accessType='inputOutput' type='SFString' name='group' value='TRANSFORM_TOOL'/>
32
- <field accessType='inputOutput' type='SFBool' name='grouped'/>
32
+ <field accessType='inputOutput' type='SFBool' name='grouping'/>
33
33
  <field accessType='inputOutput' type='SFBool' name='undo' value='true'/>
34
34
  <field accessType='inputOutput' type='SFBool' name='on'/>
35
35
  <field accessType='inputOutput' type='SFVec3f' name='location'/>
@@ -45,7 +45,7 @@
45
45
  <field accessType='inputOutput' type='SFFloat' name='perspectiveAspectRatio'/>
46
46
  <field accessType='inputOutput' type='SFNode' name='texture'/>
47
47
  <field accessType='outputOnly' type='SFNode' name='transformTool'/>
48
- <field accessType='outputOnly' type='SFInt32' name='activeTool'/>
48
+ <field accessType='outputOnly' type='SFString' name='activeTool'/>
49
49
  <field accessType='outputOnly' type='SFBool' name='isActive'/>
50
50
  </ProtoInterface>
51
51
  <ProtoBody>
@@ -177,7 +177,7 @@
177
177
  <field accessType='inputOutput' type='SFFloat' name='perspectiveNearDistance'/>
178
178
  <field accessType='inputOutput' type='SFFloat' name='perspectiveFarDistance'/>
179
179
  <field accessType='inputOutput' type='SFFloat' name='perspectiveAspectRatio'/>
180
- <field accessType='inputOutput' type='SFInt32' name='activeTool'/>
180
+ <field accessType='inputOutput' type='SFString' name='activeTool'/>
181
181
  <field accessType='inputOutput' type='SFBool' name='active'/>
182
182
  <field accessType='initializeOnly' type='SFNode' name='projector'>
183
183
  <Transform USE='Projector'/>