x_ite 8.6.17 → 8.6.19

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.
Files changed (123) hide show
  1. package/dist/assets/components/Annotation.js +13 -13
  2. package/dist/assets/components/Annotation.min.js +1 -1
  3. package/dist/assets/components/CADGeometry.js +13 -13
  4. package/dist/assets/components/CADGeometry.min.js +1 -1
  5. package/dist/assets/components/CubeMapTexturing.js +28 -28
  6. package/dist/assets/components/CubeMapTexturing.min.js +1 -1
  7. package/dist/assets/components/DIS.js +13 -21
  8. package/dist/assets/components/DIS.min.js +1 -1
  9. package/dist/assets/components/EventUtilities.js +9 -9
  10. package/dist/assets/components/EventUtilities.min.js +1 -1
  11. package/dist/assets/components/Geometry2D.js +19 -19
  12. package/dist/assets/components/Geometry2D.min.js +1 -1
  13. package/dist/assets/components/Geospatial.js +33 -39
  14. package/dist/assets/components/Geospatial.min.js +1 -1
  15. package/dist/assets/components/HAnim.js +18 -18
  16. package/dist/assets/components/HAnim.min.js +1 -1
  17. package/dist/assets/components/KeyDeviceSensor.js +8 -8
  18. package/dist/assets/components/KeyDeviceSensor.min.js +1 -1
  19. package/dist/assets/components/Layout.js +27 -27
  20. package/dist/assets/components/Layout.min.js +1 -1
  21. package/dist/assets/components/NURBS.js +24 -24
  22. package/dist/assets/components/NURBS.min.js +1 -1
  23. package/dist/assets/components/ParticleSystems.js +23 -25
  24. package/dist/assets/components/ParticleSystems.min.js +1 -1
  25. package/dist/assets/components/Picking.js +25 -26
  26. package/dist/assets/components/Picking.min.js +1 -1
  27. package/dist/assets/components/RigidBodyPhysics.js +20 -20
  28. package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
  29. package/dist/assets/components/Scripting.js +121 -195
  30. package/dist/assets/components/Scripting.min.js +1 -1
  31. package/dist/assets/components/Text.js +30 -31
  32. package/dist/assets/components/Text.min.js +1 -1
  33. package/dist/assets/components/TextureProjector.js +14 -14
  34. package/dist/assets/components/TextureProjector.min.js +1 -1
  35. package/dist/assets/components/Texturing3D.js +174 -174
  36. package/dist/assets/components/Texturing3D.min.js +1 -1
  37. package/dist/assets/components/VolumeRendering.js +35 -33
  38. package/dist/assets/components/VolumeRendering.min.js +1 -1
  39. package/dist/assets/components/X_ITE.js +9 -9
  40. package/dist/assets/components/X_ITE.min.js +1 -1
  41. package/dist/example.html +1 -1
  42. package/dist/x_ite.css +1 -1
  43. package/dist/x_ite.js +512 -519
  44. package/dist/x_ite.min.js +1 -1
  45. package/dist/x_ite.zip +0 -0
  46. package/docs/_config.yml +1 -1
  47. package/docs/_posts/getting-started.md +1 -1
  48. package/docs/_posts/reference/prototype-services.md +2 -2
  49. package/docs/_posts/setup-a-localhost-server.md +2 -2
  50. package/package.json +4 -4
  51. package/src/example.html +1 -1
  52. package/src/standard/Math/Algorithm.js +1 -1
  53. package/src/standard/Math/Algorithms/MergeSort.js +7 -5
  54. package/src/standard/Math/Algorithms/PartialSort.js +3 -1
  55. package/src/standard/Math/Algorithms/QuickSort.js +1 -3
  56. package/src/standard/Math/Geometry/Box2.js +1 -1
  57. package/src/standard/Math/Geometry/Box3.js +1 -1
  58. package/src/standard/Math/Numbers/Quaternion.js +4 -3
  59. package/src/standard/Math/Numbers/Rotation4.js +4 -3
  60. package/src/x_ite/Base/X3DBaseNode.js +9 -24
  61. package/src/x_ite/Base/X3DEventObject.js +4 -3
  62. package/src/x_ite/Base/X3DField.js +19 -20
  63. package/src/x_ite/Base/X3DObject.js +5 -1
  64. package/src/x_ite/Base/X3DObjectArrayField.js +12 -11
  65. package/src/x_ite/Base/X3DTypedArrayField.js +3 -3
  66. package/src/x_ite/Browser/Core/Context.js +1 -1
  67. package/src/x_ite/Browser/Navigation/ExamineViewer.js +1 -1
  68. package/src/x_ite/Browser/Networking/X3DNetworkingContext.js +14 -9
  69. package/src/x_ite/Browser/PointingDeviceSensor/X3DPointingDeviceSensorContext.js +2 -2
  70. package/src/x_ite/Browser/VERSION.js +1 -1
  71. package/src/x_ite/Browser/VolumeRendering/X3DVolumeRenderingContext.js +2 -2
  72. package/src/x_ite/Browser/X3DBrowser.js +44 -77
  73. package/src/x_ite/Browser/X3DBrowserContext.js +3 -3
  74. package/src/x_ite/Components/Core/X3DNode.js +2 -2
  75. package/src/x_ite/Components/Core/X3DPrototypeInstance.js +3 -8
  76. package/src/x_ite/Components/CubeMapTexturing/ImageCubeMapTexture.js +3 -3
  77. package/src/x_ite/Components/DIS/DISEntityTypeMapping.js +0 -8
  78. package/src/x_ite/Components/EnvironmentalSensor/ProximitySensor.js +14 -12
  79. package/src/x_ite/Components/EnvironmentalSensor/TransformSensor.js +3 -3
  80. package/src/x_ite/Components/EnvironmentalSensor/VisibilitySensor.js +1 -1
  81. package/src/x_ite/Components/EnvironmentalSensor/X3DEnvironmentalSensorNode.js +1 -1
  82. package/src/x_ite/Components/Geospatial/GeoMetadata.js +0 -6
  83. package/src/x_ite/Components/Networking/Anchor.js +36 -33
  84. package/src/x_ite/Components/Networking/Inline.js +3 -3
  85. package/src/x_ite/Components/Networking/X3DUrlObject.js +74 -23
  86. package/src/x_ite/Components/Picking/X3DPickSensorNode.js +6 -5
  87. package/src/x_ite/Components/RigidBodyPhysics/CollisionSensor.js +2 -2
  88. package/src/x_ite/Components/Scripting/Script.js +93 -167
  89. package/src/x_ite/Components/Shaders/ComposedShader.js +3 -18
  90. package/src/x_ite/Components/Shaders/PackagedShader.js +0 -2
  91. package/src/x_ite/Components/Shaders/ShaderPart.js +4 -4
  92. package/src/x_ite/Components/Shaders/ShaderProgram.js +0 -2
  93. package/src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js +4 -5
  94. package/src/x_ite/Components/Sound/AudioClip.js +6 -6
  95. package/src/x_ite/Components/Sound/DynamicsCompressor.js +4 -4
  96. package/src/x_ite/Components/Text/Text.js +2 -3
  97. package/src/x_ite/Components/Text/X3DFontStyleNode.js +4 -4
  98. package/src/x_ite/Components/Texturing/ImageTexture.js +3 -3
  99. package/src/x_ite/Components/Texturing/MovieTexture.js +6 -6
  100. package/src/x_ite/Components/Texturing3D/ImageTexture3D.js +3 -3
  101. package/src/x_ite/Components/Texturing3D/ImageTextureAtlas.js +3 -3
  102. package/src/x_ite/Components/Time/X3DTimeDependentNode.js +31 -25
  103. package/src/x_ite/Components/VolumeRendering/IsoSurfaceVolumeData.js +1 -1
  104. package/src/x_ite/Components/VolumeRendering/SegmentedVolumeData.js +1 -1
  105. package/src/x_ite/Components/VolumeRendering/VolumeData.js +1 -1
  106. package/src/x_ite/Components/VolumeRendering/X3DVolumeDataNode.js +11 -9
  107. package/src/x_ite/Execution/Scene.js +1 -1
  108. package/src/x_ite/Execution/X3DExecutionContext.js +30 -32
  109. package/src/x_ite/Execution/X3DScene.js +6 -6
  110. package/src/x_ite/Fields/ArrayFields.js +2 -1
  111. package/src/x_ite/Fields/SFImage.js +0 -1
  112. package/src/x_ite/Fields/SFNode.js +9 -8
  113. package/src/x_ite/Fields/SFRotation.js +2 -4
  114. package/src/x_ite/Fields/SFVecPrototypeTemplate.js +3 -3
  115. package/src/x_ite/InputOutput/FileLoader.js +3 -4
  116. package/src/x_ite/InputOutput/Generator.js +1 -1
  117. package/src/x_ite/Parser/GLTF2Parser.js +45 -45
  118. package/src/x_ite/Parser/VRMLParser.js +2 -2
  119. package/src/x_ite/Parser/X3DParser.js +4 -4
  120. package/src/x_ite/Parser/XMLParser.js +16 -22
  121. package/src/x_ite/Prototype/X3DExternProtoDeclaration.js +2 -2
  122. package/src/x_ite/Prototype/X3DProtoDeclarationNode.js +1 -1
  123. package/docs/_tabs/imprint.md +0 -52
@@ -59,9 +59,9 @@ function X3DVolumeRenderingContext () { }
59
59
 
60
60
  X3DVolumeRenderingContext .prototype =
61
61
  {
62
- getDefaultVoxels: function (executionContext)
62
+ getDefaultVoxels: function ()
63
63
  {
64
- this [_defaultVoxelsNode] = executionContext .createNode ("PixelTexture3D", { setup: false, warn: false });
64
+ this [_defaultVoxelsNode] = this .getPrivateScene () .createNode ("PixelTexture3D", false);
65
65
  this [_defaultVoxelsNode] ._image = [1, 1, 1, 1, 255];
66
66
  this [_defaultVoxelsNode] .repeatS = true;
67
67
  this [_defaultVoxelsNode] .repeatT = true;
@@ -87,7 +87,6 @@ function X3DBrowser (element)
87
87
 
88
88
  X3DBrowserContext .call (this, element);
89
89
 
90
- this [_reject] = Function .prototype;
91
90
  this [_browserCallbacks] = new Map ();
92
91
  this [_console] = document .getElementsByClassName ("x_ite-console");
93
92
 
@@ -244,6 +243,7 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
244
243
  if (argument instanceof ComponentInfo)
245
244
  return this .loadComponents ([argument .name]);
246
245
 
246
+ // Load array of component names.
247
247
  return loadComponents (this, [... argument], new Set ());
248
248
  };
249
249
  })(),
@@ -285,11 +285,9 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
285
285
  {
286
286
  return new Promise ((resolve, reject) =>
287
287
  {
288
- this [_reject] ("Replacing world aborted.");
289
-
290
- if (this [_fileLoader])
291
- this [_fileLoader] .abort ();
288
+ this [_fileLoader] ?.abort ();
292
289
 
290
+ this [_reject] ?.("Replacing world aborted.");
293
291
  this [_reject] = reject;
294
292
 
295
293
  // Remove world.
@@ -475,84 +473,74 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
475
473
  if (!(parameter instanceof Fields .MFString))
476
474
  throw new Error ("Browser.loadURL: parameter must be of type MFString.");
477
475
 
478
- // Cancel any loading.
479
-
480
- this ._loadCount .removeInterest ("checkLoadCount", this);
481
- this .prepareEvents () .removeInterest ("updateInitialized", this);
482
-
483
- if (this [_fileLoader])
484
- this [_fileLoader] .abort ();
485
-
486
476
  // Start loading.
487
477
 
488
- this .setBrowserLoading (true);
489
- this .addLoadingObject (this);
490
-
491
- const fileLoader = this [_fileLoader] = new FileLoader (this .getWorld ());
478
+ const fileLoader = new FileLoader (this .getWorld ());
492
479
 
493
480
  fileLoader .createX3DFromURL (url, parameter, (scene) =>
494
481
  {
495
- if (fileLoader !== this [_fileLoader])
482
+ if (this [_fileLoader] !== fileLoader)
496
483
  {
497
484
  reject (new Error ("Loading of X3D file aborted."));
498
- return;
499
- }
500
-
501
- if (!this .getBrowserOption ("SplashScreen"))
502
- this .getCanvas () .show ();
503
-
504
- if (scene)
505
- {
506
- this .replaceWorld (scene) .then (resolve) .catch (reject);
507
- this .removeLoadingObject (this);
508
485
  }
509
486
  else
510
487
  {
511
- this .callBrowserCallbacks (X3DConstants .CONNECTION_ERROR);
512
- this .callBrowserEventHandler ("error");
488
+ if (!this .getBrowserOption ("SplashScreen"))
489
+ this .getCanvas () .show ();
513
490
 
514
- setTimeout (() =>
491
+ if (scene)
492
+ {
493
+ this .addLoadingObject (this); // Prevent resetLoadCount.
494
+ this .replaceWorld (scene) .then (resolve) .catch (reject);
495
+ this .removeLoadingObject (this);
496
+ this .removeLoadingObject (fileLoader);
497
+ }
498
+ else
515
499
  {
516
- this .getSplashScreen ()
517
- .find (".x_ite-private-spinner-text")
518
- .text (_ ("Failed loading world."));
519
- });
500
+ this .callBrowserCallbacks (X3DConstants .CONNECTION_ERROR);
501
+ this .callBrowserEventHandler ("error");
520
502
 
521
- reject (new Error ("Couldn't load X3D file."));
503
+ setTimeout (() =>
504
+ {
505
+ this .getSplashScreen ()
506
+ .find (".x_ite-private-spinner-text")
507
+ .text (_ ("Failed loading world."));
508
+ });
509
+
510
+ reject (new Error ("Couldn't load X3D file."));
511
+ }
522
512
  }
523
513
  },
524
514
  (fragment) =>
525
515
  {
526
- if (fileLoader !== this [_fileLoader])
527
- {
528
- reject (new Error ("Change viewpoint aborted."));
529
- return;
530
- }
516
+ fileLoader .ready = true;
531
517
 
532
518
  this .changeViewpoint (fragment);
533
- this .removeLoadingObject (this);
534
- this .setBrowserLoading (false);
519
+ this .removeLoadingObject (fileLoader);
535
520
 
536
521
  resolve ();
537
522
  },
538
523
  (url, target) =>
539
524
  {
540
- if (fileLoader !== this [_fileLoader])
541
- {
542
- reject (new Error ("Loading of file aborted."));
543
- return;
544
- }
525
+ fileLoader .ready = true;
545
526
 
546
527
  if (target)
547
528
  window .open (url, target);
548
529
  else
549
530
  location = url;
550
531
 
551
- this .removeLoadingObject (this);
552
- this .setBrowserLoading (false);
532
+ this .removeLoadingObject (fileLoader);
553
533
 
554
534
  resolve ();
555
535
  });
536
+
537
+ if (!fileLoader .ready)
538
+ {
539
+ this [_fileLoader] ?.abort ();
540
+
541
+ this .setBrowserLoading (true);
542
+ this .addLoadingObject (this [_fileLoader] = fileLoader);
543
+ }
556
544
  });
557
545
  },
558
546
  addBrowserListener: function (callback, object)
@@ -648,10 +636,7 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
648
636
  },
649
637
  viewAll: function (layerNode)
650
638
  {
651
- layerNode = X3DCast (X3DConstants .X3DLayerNode, layerNode);
652
-
653
- if (!layerNode)
654
- layerNode = this .getActiveLayer ();
639
+ layerNode = X3DCast (X3DConstants .X3DLayerNode, layerNode) ?? this .getActiveLayer ();
655
640
 
656
641
  if (!layerNode)
657
642
  return;
@@ -660,13 +645,7 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
660
645
  },
661
646
  firstViewpoint: function (layerNode)
662
647
  {
663
- layerNode = X3DCast (X3DConstants .X3DLayerNode, layerNode);
664
-
665
- if (!layerNode)
666
- layerNode = this .getActiveLayer ();
667
-
668
- if (!layerNode)
669
- return;
648
+ layerNode = X3DCast (X3DConstants .X3DLayerNode, layerNode) ?? this .getActiveLayer ();
670
649
 
671
650
  const viewpoints = layerNode .getUserViewpoints ();
672
651
 
@@ -675,10 +654,7 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
675
654
  },
676
655
  previousViewpoint: function (layerNode)
677
656
  {
678
- layerNode = X3DCast (X3DConstants .X3DLayerNode, layerNode);
679
-
680
- if (!layerNode)
681
- layerNode = this .getActiveLayer ();
657
+ layerNode = X3DCast (X3DConstants .X3DLayerNode, layerNode) ?? this .getActiveLayer ();
682
658
 
683
659
  if (!layerNode)
684
660
  return;
@@ -707,10 +683,7 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
707
683
  },
708
684
  nextViewpoint: function (layerNode)
709
685
  {
710
- layerNode = X3DCast (X3DConstants .X3DLayerNode, layerNode);
711
-
712
- if (!layerNode)
713
- layerNode = this .getActiveLayer ();
686
+ layerNode = X3DCast (X3DConstants .X3DLayerNode, layerNode) ?? this .getActiveLayer ();
714
687
 
715
688
  if (!layerNode)
716
689
  return;
@@ -739,10 +712,7 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
739
712
  },
740
713
  lastViewpoint: function (layerNode)
741
714
  {
742
- layerNode = X3DCast (X3DConstants .X3DLayerNode, layerNode);
743
-
744
- if (!layerNode)
745
- layerNode = this .getActiveLayer ();
715
+ layerNode = X3DCast (X3DConstants .X3DLayerNode, layerNode) ?? this .getActiveLayer ();
746
716
 
747
717
  if (!layerNode)
748
718
  return;
@@ -760,10 +730,7 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
760
730
  layerNode = this .getActiveLayer ();
761
731
  }
762
732
 
763
- layerNode = X3DCast (X3DConstants .X3DLayerNode, layerNode);
764
-
765
- if (!layerNode)
766
- layerNode = this .getActiveLayer ();
733
+ layerNode = X3DCast (X3DConstants .X3DLayerNode, layerNode) ?? this .getActiveLayer ();
767
734
 
768
735
  if (!layerNode)
769
736
  return;
@@ -91,8 +91,8 @@ function X3DBrowserContext (element)
91
91
  {
92
92
  X3DBaseNode .call (this, this);
93
93
  X3DRoutingContext .call (this);
94
- X3DCoreContext .call (this, element);
95
94
  X3DScriptingContext .call (this);
95
+ X3DCoreContext .call (this, element);
96
96
  X3DNetworkingContext .call (this);
97
97
  X3DTexturingContext .call (this);
98
98
  X3DShadersContext .call (this);
@@ -157,8 +157,8 @@ X3DBrowserContext .prototype = Object .assign (Object .create (X3DBaseNode .prot
157
157
  {
158
158
  X3DBaseNode .prototype .initialize ?.call (this);
159
159
  X3DRoutingContext .prototype .initialize ?.call (this);
160
- X3DCoreContext .prototype .initialize ?.call (this);
161
160
  X3DScriptingContext .prototype .initialize ?.call (this);
161
+ X3DCoreContext .prototype .initialize ?.call (this);
162
162
  X3DNetworkingContext .prototype .initialize ?.call (this);
163
163
  X3DTexturingContext .prototype .initialize ?.call (this);
164
164
  X3DShadersContext .prototype .initialize ?.call (this);
@@ -365,8 +365,8 @@ X3DBrowserContext .prototype = Object .assign (Object .create (X3DBaseNode .prot
365
365
  X3DShadersContext .prototype .dispose ?.call (this);
366
366
  X3DTexturingContext .prototype .dispose ?.call (this);
367
367
  X3DNetworkingContext .prototype .dispose ?.call (this);
368
- X3DScriptingContext .prototype .dispose ?.call (this);
369
368
  X3DCoreContext .prototype .dispose ?.call (this);
369
+ X3DScriptingContext .prototype .dispose ?.call (this);
370
370
  X3DRoutingContext .prototype .dispose ?.call (this);
371
371
  X3DBaseNode .prototype .dispose ?.call (this);
372
372
  },
@@ -208,9 +208,9 @@ X3DNode .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
208
208
 
209
209
  return false;
210
210
  },
211
- getFieldsAreEnumerable: function ()
211
+ getSourceText: function ()
212
212
  {
213
- return true;
213
+ return null;
214
214
  },
215
215
  traverse: function () { },
216
216
  toStream: function (generator)
@@ -276,11 +276,6 @@ X3DPrototypeInstance .prototype = Object .assign (Object .create (X3DNode .proto
276
276
 
277
277
  protoNode ._name_changed .addFieldInterest (this ._typeName_changed);
278
278
 
279
- const outerNode = this .getExecutionContext () .getOuterNode ();
280
-
281
- if (outerNode ?.getType () .includes (X3DConstants .X3DProtoDeclaration))
282
- return;
283
-
284
279
  if (protoNode .isExternProto)
285
280
  {
286
281
  if (this [_protoNode] .checkLoadState () === X3DConstants .COMPLETE_STATE)
@@ -290,7 +285,7 @@ X3DPrototypeInstance .prototype = Object .assign (Object .create (X3DNode .proto
290
285
  else
291
286
  {
292
287
  protoNode ._updateInstances .addInterest ("construct", this);
293
- protoNode .requestImmediateLoad ();
288
+ protoNode .requestImmediateLoad () .catch (Function .prototype);
294
289
  }
295
290
  }
296
291
  else
@@ -1017,11 +1012,11 @@ X3DPrototypeInstance .prototype = Object .assign (Object .create (X3DNode .proto
1017
1012
  },
1018
1013
  dispose: function ()
1019
1014
  {
1015
+ this [_protoNode] ._name_changed .removeFieldInterest (this ._typeName_changed);
1020
1016
  this [_protoNode] ._updateInstances .removeInterest ("construct", this);
1021
1017
  this [_protoNode] ._updateInstances .removeInterest ("update", this);
1022
1018
 
1023
- if (this [_body])
1024
- this [_body] .dispose ();
1019
+ this [_body] ?.dispose ();
1025
1020
 
1026
1021
  X3DNode .prototype .dispose .call (this);
1027
1022
  },
@@ -127,13 +127,13 @@ ImageCubeMapTexture .prototype = Object .assign (Object .create (X3DEnvironmentT
127
127
  this .image .on ("abort error", this .setError .bind (this));
128
128
  this .image .prop ("crossOrigin", "Anonymous");
129
129
 
130
- this .requestImmediateLoad ();
130
+ this .requestImmediateLoad () .catch (Function .prototype);
131
131
  },
132
- unLoadNow: function ()
132
+ unloadData: function ()
133
133
  {
134
134
  this .clearTexture ();
135
135
  },
136
- loadNow: function ()
136
+ loadData: function ()
137
137
  {
138
138
  this .urlStack .setValue (this ._url);
139
139
  this .loadNext ();
@@ -99,14 +99,6 @@ DISEntityTypeMapping .prototype = Object .assign (Object .create (X3DInfoNode .p
99
99
  X3DInfoNode .prototype .initialize .call (this);
100
100
  X3DUrlObject .prototype .initialize .call (this);
101
101
  },
102
- requestImmediateLoad: function (cache = true)
103
- { },
104
- requestUnload: function ()
105
- { },
106
- set_load__: function ()
107
- { },
108
- set_url__: function ()
109
- { },
110
102
  dispose: function ()
111
103
  {
112
104
  X3DUrlObject .prototype .dispose .call (this);
@@ -70,7 +70,7 @@ function ProximitySensor (executionContext)
70
70
 
71
71
  this .min = new Vector3 (0, 0, 0);
72
72
  this .max = new Vector3 (0, 0, 0);
73
- this .viewpointNode = null;
73
+ this .layerNode = null;
74
74
  this .modelMatrix = new Matrix4 ();
75
75
  this .inside = false;
76
76
  }
@@ -156,15 +156,17 @@ ProximitySensor .prototype = Object .assign (Object .create (X3DEnvironmentalSen
156
156
  {
157
157
  if (this .inside && this .getTraversed ())
158
158
  {
159
- if (this .viewpointNode)
159
+ if (this .layerNode)
160
160
  {
161
- const modelMatrix = this .modelMatrix;
161
+ const
162
+ viewpointNode = this .layerNode .getViewpoint (),
163
+ modelMatrix = this .modelMatrix;
162
164
 
163
- centerOfRotationMatrix .assign (this .viewpointNode .getModelMatrix ());
164
- centerOfRotationMatrix .translate (this .viewpointNode .getUserCenterOfRotation ());
165
+ centerOfRotationMatrix .assign (viewpointNode .getModelMatrix ());
166
+ centerOfRotationMatrix .translate (viewpointNode .getUserCenterOfRotation ());
165
167
  centerOfRotationMatrix .multRight (invModelMatrix .assign (modelMatrix) .inverse ());
166
168
 
167
- modelMatrix .multRight (this .viewpointNode .getViewMatrix ());
169
+ modelMatrix .multRight (viewpointNode .getViewMatrix ());
168
170
  modelMatrix .get (null, orientation);
169
171
  modelMatrix .inverse ();
170
172
 
@@ -176,13 +178,13 @@ ProximitySensor .prototype = Object .assign (Object .create (X3DEnvironmentalSen
176
178
 
177
179
  if (this ._isActive .getValue ())
178
180
  {
179
- if (! this ._position_changed .getValue () .equals (position))
181
+ if (!this ._position_changed .getValue () .equals (position))
180
182
  this ._position_changed = position;
181
183
 
182
- if (! this ._orientation_changed .getValue () .equals (orientation))
184
+ if (!this ._orientation_changed .getValue () .equals (orientation))
183
185
  this ._orientation_changed = orientation;
184
186
 
185
- if (! this ._centerOfRotation_changed .getValue () .equals (centerOfRotation))
187
+ if (!this ._centerOfRotation_changed .getValue () .equals (centerOfRotation))
186
188
  this ._centerOfRotation_changed = centerOfRotation;
187
189
  }
188
190
  else
@@ -204,8 +206,8 @@ ProximitySensor .prototype = Object .assign (Object .create (X3DEnvironmentalSen
204
206
  }
205
207
  }
206
208
 
207
- this .inside = false;
208
- this .viewpointNode = null;
209
+ this .inside = false;
210
+ this .layerNode = null;
209
211
 
210
212
  this .setTraversed (false);
211
213
  };
@@ -222,7 +224,7 @@ ProximitySensor .prototype = Object .assign (Object .create (X3DEnvironmentalSen
222
224
  {
223
225
  case TraverseType .CAMERA:
224
226
  {
225
- this .viewpointNode = renderObject .getViewpoint ();
227
+ this .layerNode = renderObject .getLayer ();
226
228
  this .modelMatrix .assign (renderObject .getModelViewMatrix () .get ());
227
229
  return;
228
230
  }
@@ -127,7 +127,7 @@ TransformSensor .prototype = Object .assign (Object .create (X3DEnvironmentalSen
127
127
  { },
128
128
  set_enabled__: function ()
129
129
  {
130
- if (this .getLive () .getValue () && this .targetObjectNode && this ._enabled .getValue () && ! this ._size. getValue () .equals (Vector3 .Zero))
130
+ if (this .getLive () .getValue () && this .targetObjectNode && this ._enabled .getValue () && !this ._size. getValue () .equals (Vector3 .Zero))
131
131
  {
132
132
  this .setPickableObject (true);
133
133
  this .getBrowser () .addTransformSensor (this);
@@ -228,10 +228,10 @@ TransformSensor .prototype = Object .assign (Object .create (X3DEnvironmentalSen
228
228
 
229
229
  if (this ._isActive .getValue ())
230
230
  {
231
- if (! this ._position_changed .getValue () .equals (position))
231
+ if (!this ._position_changed .getValue () .equals (position))
232
232
  this ._position_changed = position;
233
233
 
234
- if (! this ._orientation_changed .getValue () .equals (orientation))
234
+ if (!this ._orientation_changed .getValue () .equals (orientation))
235
235
  this ._orientation_changed = orientation;
236
236
  }
237
237
  else
@@ -112,7 +112,7 @@ VisibilitySensor .prototype = Object .assign (Object .create (X3DEnvironmentalSe
112
112
  {
113
113
  if (this .visible && this .getTraversed ())
114
114
  {
115
- if (! this ._isActive .getValue ())
115
+ if (!this ._isActive .getValue ())
116
116
  {
117
117
  this ._isActive = true;
118
118
  this ._enterTime = this .getBrowser () .getCurrentTime ();
@@ -82,7 +82,7 @@ X3DEnvironmentalSensorNode .prototype = Object .assign (Object .create (X3DSenso
82
82
  },
83
83
  set_live__: function ()
84
84
  {
85
- if (this ._traversed .getValue () && this .getLive () .getValue () && this ._enabled .getValue () && ! (this .zeroTest && this ._size. getValue () .equals (Vector3 .Zero)))
85
+ if (this ._traversed .getValue () && this .getLive () .getValue () && this ._enabled .getValue () && !(this .zeroTest && this ._size. getValue () .equals (Vector3 .Zero)))
86
86
  {
87
87
  this .getBrowser () .sensorEvents () .addInterest ("update", this);
88
88
  }
@@ -96,12 +96,6 @@ GeoMetadata .prototype = Object .assign (Object .create (X3DInfoNode .prototype)
96
96
  },
97
97
  requestImmediateLoad: function (cache = true)
98
98
  { },
99
- requestUnload: function ()
100
- { },
101
- set_load__: function ()
102
- { },
103
- set_url__: function ()
104
- { },
105
99
  dispose: function ()
106
100
  {
107
101
  X3DUrlObject .prototype .dispose .call (this);
@@ -114,18 +114,15 @@ Anchor .prototype = Object .assign (Object .create (X3DGroupingNode .prototype),
114
114
  this .touchSensorNode ._enabled = this ._load;
115
115
  this .touchSensorNode .setup ();
116
116
 
117
- // Modify set_active__ to get immediate response to user action (click event), otherwise links are not opened in this window.
117
+ // Modify set_active__ to get immediate response to user action (click event),
118
+ // otherwise links are not opened in this window.
118
119
 
119
- const
120
- anchor = this,
121
- set_active__ = this .touchSensorNode .set_active__;
122
-
123
- this .touchSensorNode .set_active__ = function (active, hit)
120
+ this .touchSensorNode .set_active__ = (active, hit) =>
124
121
  {
125
- set_active__ .call (this, active, hit);
122
+ TouchSensor .prototype .set_active__ .call (this .touchSensorNode, active, hit);
126
123
 
127
- if (this ._isOver .getValue () && ! active)
128
- anchor .requestImmediateLoad ();
124
+ if (this .touchSensorNode ._isOver .getValue () && !active)
125
+ this .requestImmediateLoad () .catch (Function .prototype);
129
126
  };
130
127
  },
131
128
  set_load__: function ()
@@ -137,34 +134,40 @@ Anchor .prototype = Object .assign (Object .create (X3DGroupingNode .prototype),
137
134
  this .setCache (cache);
138
135
  this .setLoadState (X3DConstants .IN_PROGRESS_STATE, false);
139
136
 
140
- new FileLoader (this) .createX3DFromURL (this ._url, this ._parameter,
141
- function (scene)
137
+ return new Promise ((resolve, reject) =>
142
138
  {
143
- if (scene)
139
+ new FileLoader (this) .createX3DFromURL (this ._url, this ._parameter,
140
+ (scene) =>
141
+ {
142
+ if (scene)
143
+ {
144
+ this .getBrowser () .replaceWorld (scene);
145
+ this .setLoadState (X3DConstants .COMPLETE_STATE, false);
146
+ resolve ();
147
+ }
148
+ else
149
+ {
150
+ this .setLoadState (X3DConstants .FAILED_STATE, false);
151
+ reject ();
152
+ }
153
+ },
154
+ (viewpointName) =>
144
155
  {
145
- this .getBrowser () .replaceWorld (scene);
156
+ this .getBrowser () .changeViewpoint (viewpointName);
146
157
  this .setLoadState (X3DConstants .COMPLETE_STATE, false);
147
- }
148
- else
149
- this .setLoadState (X3DConstants .FAILED_STATE, false);
150
- }
151
- .bind (this),
152
- function (viewpointName)
153
- {
154
- this .getBrowser () .changeViewpoint (viewpointName);
155
- this .setLoadState (X3DConstants .COMPLETE_STATE, false);
156
- }
157
- .bind (this),
158
- function (url, target)
159
- {
160
- if (target)
161
- window .open (url, target);
162
- else
163
- location = url;
158
+ resolve ();
159
+ },
160
+ (url, target) =>
161
+ {
162
+ if (target)
163
+ window .open (url, target);
164
+ else
165
+ location = url;
164
166
 
165
- this .setLoadState (X3DConstants .COMPLETE_STATE, false);
166
- }
167
- .bind (this));
167
+ this .setLoadState (X3DConstants .COMPLETE_STATE, false);
168
+ resolve ();
169
+ });
170
+ });
168
171
  },
169
172
  requestUnload ()
170
173
  { },
@@ -119,7 +119,7 @@ Inline .prototype = Object .assign (Object .create (X3DChildNode .prototype),
119
119
  this .groupNode ._isCameraObject .addFieldInterest (this ._isCameraObject);
120
120
  this .groupNode ._isPickableObject .addFieldInterest (this ._isPickableObject);
121
121
 
122
- this .requestImmediateLoad ();
122
+ this .requestImmediateLoad () .catch (Function .prototype);
123
123
  },
124
124
  getBBox: function (bbox, shadows)
125
125
  {
@@ -137,12 +137,12 @@ Inline .prototype = Object .assign (Object .create (X3DChildNode .prototype),
137
137
 
138
138
  this .scene .setLive (this .getLive () .getValue ());
139
139
  },
140
- unLoadNow: function ()
140
+ unloadData: function ()
141
141
  {
142
142
  this .abortLoading ();
143
143
  this .setInternalScene (this .getBrowser () .getDefaultScene ());
144
144
  },
145
- loadNow: function ()
145
+ loadData: function ()
146
146
  {
147
147
  this .abortLoading ();
148
148
  this .fileLoader = new FileLoader (this) .createX3DFromURL (this ._url, null, this .setInternalSceneAsync .bind (this));