x_ite 8.6.18 → 8.6.20

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 (87) hide show
  1. package/README.md +1 -1
  2. package/dist/assets/components/Annotation.js +13 -13
  3. package/dist/assets/components/Annotation.min.js +1 -1
  4. package/dist/assets/components/CADGeometry.js +13 -13
  5. package/dist/assets/components/CADGeometry.min.js +1 -1
  6. package/dist/assets/components/CubeMapTexturing.js +25 -25
  7. package/dist/assets/components/CubeMapTexturing.min.js +1 -1
  8. package/dist/assets/components/DIS.js +13 -13
  9. package/dist/assets/components/DIS.min.js +1 -1
  10. package/dist/assets/components/EventUtilities.js +9 -9
  11. package/dist/assets/components/EventUtilities.min.js +1 -1
  12. package/dist/assets/components/Geometry2D.js +19 -19
  13. package/dist/assets/components/Geometry2D.min.js +1 -1
  14. package/dist/assets/components/Geospatial.js +33 -33
  15. package/dist/assets/components/Geospatial.min.js +1 -1
  16. package/dist/assets/components/HAnim.js +18 -18
  17. package/dist/assets/components/HAnim.min.js +1 -1
  18. package/dist/assets/components/KeyDeviceSensor.js +8 -8
  19. package/dist/assets/components/KeyDeviceSensor.min.js +1 -1
  20. package/dist/assets/components/Layout.js +27 -27
  21. package/dist/assets/components/Layout.min.js +1 -1
  22. package/dist/assets/components/NURBS.js +24 -24
  23. package/dist/assets/components/NURBS.min.js +1 -1
  24. package/dist/assets/components/ParticleSystems.js +23 -25
  25. package/dist/assets/components/ParticleSystems.min.js +1 -1
  26. package/dist/assets/components/Picking.js +19 -21
  27. package/dist/assets/components/Picking.min.js +1 -1
  28. package/dist/assets/components/RigidBodyPhysics.js +18 -18
  29. package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
  30. package/dist/assets/components/Scripting.js +30 -32
  31. package/dist/assets/components/Scripting.min.js +1 -1
  32. package/dist/assets/components/Text.js +24 -24
  33. package/dist/assets/components/Text.min.js +1 -1
  34. package/dist/assets/components/TextureProjector.js +14 -14
  35. package/dist/assets/components/TextureProjector.min.js +1 -1
  36. package/dist/assets/components/Texturing3D.js +30 -30
  37. package/dist/assets/components/Texturing3D.min.js +1 -1
  38. package/dist/assets/components/VolumeRendering.js +19 -19
  39. package/dist/assets/components/VolumeRendering.min.js +1 -1
  40. package/dist/assets/components/X_ITE.js +9 -9
  41. package/dist/assets/components/X_ITE.min.js +1 -1
  42. package/dist/example.html +1 -1
  43. package/dist/x_ite.css +1 -1
  44. package/dist/x_ite.js +234 -235
  45. package/dist/x_ite.min.js +1 -1
  46. package/dist/x_ite.zip +0 -0
  47. package/docs/_config.yml +1 -1
  48. package/docs/_posts/getting-started.md +18 -18
  49. package/docs/_posts/setup-a-localhost-server.md +2 -2
  50. package/docs/_tabs/playground.html +24 -17
  51. package/package.json +4 -4
  52. package/src/example.html +1 -1
  53. package/src/standard/Math/Algorithm.js +1 -1
  54. package/src/standard/Math/Algorithms/MergeSort.js +7 -5
  55. package/src/standard/Math/Algorithms/PartialSort.js +3 -1
  56. package/src/standard/Math/Algorithms/QuickSort.js +1 -3
  57. package/src/standard/Math/Geometry/Box2.js +1 -1
  58. package/src/standard/Math/Geometry/Box3.js +1 -1
  59. package/src/standard/Math/Numbers/Quaternion.js +4 -3
  60. package/src/standard/Math/Numbers/Rotation4.js +4 -3
  61. package/src/x_ite/Base/X3DBaseNode.js +1 -1
  62. package/src/x_ite/Base/X3DEventObject.js +3 -2
  63. package/src/x_ite/Base/X3DField.js +2 -2
  64. package/src/x_ite/Browser/Core/Context.js +1 -1
  65. package/src/x_ite/Browser/Navigation/ExamineViewer.js +4 -1
  66. package/src/x_ite/Browser/Navigation/LookAtViewer.js +3 -0
  67. package/src/x_ite/Browser/Networking/X3DNetworkingContext.js +18 -11
  68. package/src/x_ite/Browser/VERSION.js +1 -1
  69. package/src/x_ite/Browser/X3DBrowser.js +48 -57
  70. package/src/x_ite/Browser/X3DBrowserContext.js +3 -3
  71. package/src/x_ite/Components/Scripting/Script.js +2 -4
  72. package/src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js +1 -1
  73. package/src/x_ite/Components/Sound/AudioClip.js +3 -3
  74. package/src/x_ite/Components/Sound/DynamicsCompressor.js +4 -4
  75. package/src/x_ite/Components/Texturing/MovieTexture.js +3 -3
  76. package/src/x_ite/Execution/Scene.js +1 -1
  77. package/src/x_ite/Execution/X3DExecutionContext.js +11 -11
  78. package/src/x_ite/Fields/SFNode.js +5 -3
  79. package/src/x_ite/Fields/SFRotation.js +2 -4
  80. package/src/x_ite/Fields/SFVecPrototypeTemplate.js +3 -3
  81. package/src/x_ite/InputOutput/FileLoader.js +16 -22
  82. package/src/x_ite/InputOutput/Generator.js +1 -1
  83. package/src/x_ite/Parser/X3DParser.js +4 -4
  84. package/src/x_ite/Parser/XMLParser.js +13 -19
  85. package/src/x_ite/Prototype/X3DExternProtoDeclaration.js +5 -4
  86. package/src/x_ite/Prototype/X3DProtoDeclaration.js +4 -3
  87. package/docs/_tabs/imprint.md +0 -52
@@ -473,74 +473,56 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
473
473
  if (!(parameter instanceof Fields .MFString))
474
474
  throw new Error ("Browser.loadURL: parameter must be of type MFString.");
475
475
 
476
- // Cancel any loading.
477
-
478
- this ._loadCount .removeInterest ("checkLoadCount", this);
479
- this .prepareEvents () .removeInterest ("updateInitialized", this);
480
-
481
- this [_fileLoader] ?.abort ();
482
-
483
476
  // Start loading.
484
477
 
485
- const fileLoader = this [_fileLoader] = new FileLoader (this .getWorld ());
486
-
487
- this .setBrowserLoading (true);
488
- this .addLoadingObject (fileLoader);
478
+ const fileLoader = new FileLoader (this .getWorld ());
489
479
 
490
480
  fileLoader .createX3DFromURL (url, parameter, (scene) =>
491
481
  {
492
- if (fileLoader !== this [_fileLoader])
482
+ if (this [_fileLoader] !== fileLoader)
493
483
  {
494
484
  reject (new Error ("Loading of X3D file aborted."));
495
- return;
496
- }
497
-
498
- if (!this .getBrowserOption ("SplashScreen"))
499
- this .getCanvas () .show ();
500
-
501
- if (scene)
502
- {
503
- this .addLoadingObject (this); // Prevent resetLoadCount.
504
- this .replaceWorld (scene) .then (resolve) .catch (reject);
505
- this .removeLoadingObject (this);
506
- this .removeLoadingObject (fileLoader);
507
485
  }
508
486
  else
509
487
  {
510
- this .callBrowserCallbacks (X3DConstants .CONNECTION_ERROR);
511
- this .callBrowserEventHandler ("error");
488
+ if (!this .getBrowserOption ("SplashScreen"))
489
+ this .getCanvas () .show ();
512
490
 
513
- 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
514
499
  {
515
- this .getSplashScreen ()
516
- .find (".x_ite-private-spinner-text")
517
- .text (_ ("Failed loading world."));
518
- });
500
+ this .callBrowserCallbacks (X3DConstants .CONNECTION_ERROR);
501
+ this .callBrowserEventHandler ("error");
519
502
 
520
- 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
+ }
521
512
  }
522
513
  },
523
514
  (fragment) =>
524
515
  {
525
- if (fileLoader !== this [_fileLoader])
526
- {
527
- reject (new Error ("Change viewpoint aborted."));
528
- return;
529
- }
516
+ fileLoader .ready = true;
530
517
 
531
518
  this .changeViewpoint (fragment);
532
519
  this .removeLoadingObject (fileLoader);
533
- this .setBrowserLoading (false);
534
520
 
535
521
  resolve ();
536
522
  },
537
523
  (url, target) =>
538
524
  {
539
- if (fileLoader !== this [_fileLoader])
540
- {
541
- reject (new Error ("Loading of file aborted."));
542
- return;
543
- }
525
+ fileLoader .ready = true;
544
526
 
545
527
  if (target)
546
528
  window .open (url, target);
@@ -548,10 +530,17 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
548
530
  location = url;
549
531
 
550
532
  this .removeLoadingObject (fileLoader);
551
- this .setBrowserLoading (false);
552
533
 
553
534
  resolve ();
554
535
  });
536
+
537
+ if (!fileLoader .ready)
538
+ {
539
+ this [_fileLoader] ?.abort ();
540
+
541
+ this .setBrowserLoading (true);
542
+ this .addLoadingObject (this [_fileLoader] = fileLoader);
543
+ }
555
544
  });
556
545
  },
557
546
  addBrowserListener: function (callback, object)
@@ -837,49 +826,51 @@ for (const key of Reflect .ownKeys (X3DBrowser .prototype))
837
826
 
838
827
  Object .defineProperty (X3DBrowser .prototype, "name",
839
828
  {
840
- get: function () { return this .getName (); },
829
+ get: X3DBrowser .prototype .getName,
841
830
  enumerable: true,
842
831
  configurable: false
843
832
  });
844
833
 
845
834
  Object .defineProperty (X3DBrowser .prototype, "version",
846
835
  {
847
- get: function () { return this .getVersion (); },
836
+ get: X3DBrowser .prototype .getVersion,
848
837
  enumerable: true,
849
838
  configurable: false
850
839
  });
851
840
 
852
841
  Object .defineProperty (X3DBrowser .prototype, "providerUrl",
853
842
  {
854
- get: function () { return this .getProviderUrl (); },
843
+ get: X3DBrowser .prototype .getProviderUrl,
855
844
  enumerable: true,
856
845
  configurable: false
857
846
  });
858
847
 
859
848
  Object .defineProperty (X3DBrowser .prototype, "currentFrameRate",
860
849
  {
861
- get: function () { return this .getCurrentFrameRate (); },
850
+ get: X3DBrowser .prototype .getCurrentFrameRate,
862
851
  enumerable: true,
863
852
  configurable: false
864
853
  });
865
854
 
866
855
  Object .defineProperty (X3DBrowser .prototype, "currentSpeed",
867
856
  {
868
- get: function () { return this .getCurrentSpeed (); },
857
+ get: X3DBrowser .prototype .getCurrentSpeed,
869
858
  enumerable: true,
870
859
  configurable: false
871
860
  });
872
861
 
873
862
  Object .defineProperty (X3DBrowser .prototype, "description",
874
863
  {
875
- get: function ()
876
- {
877
- return this .getDescription ();
878
- },
879
- set: function (value)
880
- {
881
- this .setDescription (value);
882
- },
864
+ get: X3DBrowser .prototype .getDescription,
865
+ set: X3DBrowser .prototype .setDescription,
866
+ enumerable: true,
867
+ configurable: false
868
+ });
869
+
870
+ Object .defineProperty (X3DBrowser .prototype, "baseURL",
871
+ {
872
+ get: X3DBrowser .prototype .getBaseURL,
873
+ set: X3DBrowser .prototype .setBaseURL,
883
874
  enumerable: true,
884
875
  configurable: false
885
876
  });
@@ -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
  },
@@ -152,8 +152,7 @@ Script .prototype = Object .assign (Object .create (X3DScriptNode .prototype),
152
152
  },
153
153
  loadData: function ()
154
154
  {
155
- new FileLoader (this) .loadDocument (this ._url,
156
- (data) =>
155
+ new FileLoader (this) .loadDocument (this ._url, (data) =>
157
156
  {
158
157
  if (data === null)
159
158
  {
@@ -162,9 +161,8 @@ Script .prototype = Object .assign (Object .create (X3DScriptNode .prototype),
162
161
  }
163
162
  else
164
163
  {
165
- this .setLoadState (X3DConstants .COMPLETE_STATE);
166
-
167
164
  this .initialize__ ($.decodeText (data));
165
+ this .setLoadState (X3DConstants .COMPLETE_STATE);
168
166
  }
169
167
  });
170
168
  },
@@ -49,7 +49,7 @@ import X3DCast from "../../Base/X3DCast.js";
49
49
  import X3DConstants from "../../Base/X3DConstants.js";
50
50
  import Matrix3 from "../../../standard/Math/Numbers/Matrix3.js";
51
51
 
52
- const _uniformLocation = Symbol .for ("X3DField.uniformLocation");
52
+ const _uniformLocation = Symbol .for ("X_ITE.X3DField.uniformLocation");
53
53
 
54
54
  function X3DProgrammableShaderObject (executionContext)
55
55
  {
@@ -165,12 +165,12 @@ AudioClip .prototype = Object .assign (Object .create (X3DSoundSourceNode .proto
165
165
  },
166
166
  setTimeout: function (event)
167
167
  {
168
- setTimeout (function ()
168
+ setTimeout (() =>
169
169
  {
170
170
  if (this .checkLoadState () === X3DConstants .IN_PROGRESS_STATE)
171
171
  this .setError (event);
172
- }
173
- .bind (this), 3000);
172
+ },
173
+ 3000);
174
174
  },
175
175
  setError: function (event)
176
176
  {
@@ -62,12 +62,12 @@ DynamicsCompressor .prototype = Object .assign (Object .create (X3DSoundProcessi
62
62
  {
63
63
  constructor: DynamicsCompressor,
64
64
  [Symbol .for ("X_ITE.X3DBaseNode.fieldDefinitions")]: new FieldDefinitionArray ([
65
- new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
66
- new X3DFieldDefinition (X3DConstants .inputOutput, "description", new Fields .SFString ()),
67
- new X3DFieldDefinition (X3DConstants .inputOutput, "enabled", new Fields .SFBool (true)),
65
+ new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
66
+ new X3DFieldDefinition (X3DConstants .inputOutput, "description", new Fields .SFString ()),
67
+ new X3DFieldDefinition (X3DConstants .inputOutput, "enabled", new Fields .SFBool (true)),
68
68
 
69
69
  new X3DFieldDefinition (X3DConstants .inputOutput, "gain", new Fields .SFFloat (1)),
70
- new X3DFieldDefinition (X3DConstants .inputOutput, "attack", new Fields .SFFloat (0.003)),
70
+ new X3DFieldDefinition (X3DConstants .inputOutput, "attack", new Fields .SFFloat (0.003)), // TODO: SFTime
71
71
  new X3DFieldDefinition (X3DConstants .inputOutput, "knee", new Fields .SFFloat (30)),
72
72
  new X3DFieldDefinition (X3DConstants .inputOutput, "ratio", new Fields .SFFloat (12)),
73
73
  new X3DFieldDefinition (X3DConstants .inputOutput, "reduction", new Fields .SFFloat ()),
@@ -188,12 +188,12 @@ MovieTexture .prototype = Object .assign (Object .create (X3DTexture2DNode .prot
188
188
  },
189
189
  setTimeout: function (event)
190
190
  {
191
- setTimeout (function ()
191
+ setTimeout (() =>
192
192
  {
193
193
  if (this .checkLoadState () === X3DConstants .IN_PROGRESS_STATE)
194
194
  this .setError (event);
195
- }
196
- .bind (this), 3000);
195
+ },
196
+ 3000);
197
197
  },
198
198
  setError: function (event)
199
199
  {
@@ -49,7 +49,7 @@ import Fields from "../Fields.js";
49
49
  import X3DScene from "./X3DScene.js";
50
50
 
51
51
  const
52
- _browser = Symbol .for ("X3DEventObject.browser"),
52
+ _browser = Symbol .for ("X_ITE.X3DEventObject.browser"),
53
53
  _loadingObjects = Symbol ();
54
54
 
55
55
  function Scene (browser)
@@ -942,71 +942,71 @@ for (const key of Reflect .ownKeys (X3DExecutionContext .prototype))
942
942
 
943
943
  Object .defineProperty (X3DExecutionContext .prototype, "specificationVersion",
944
944
  {
945
- get: function () { return this .getSpecificationVersion (); },
945
+ get: X3DExecutionContext .prototype .getSpecificationVersion,
946
946
  enumerable: true,
947
947
  configurable: false
948
948
  });
949
949
 
950
950
  Object .defineProperty (X3DExecutionContext .prototype, "encoding",
951
951
  {
952
- get: function () { return this .getEncoding (); },
952
+ get: X3DExecutionContext .prototype .getEncoding,
953
953
  enumerable: true,
954
954
  configurable: false
955
955
  });
956
956
 
957
957
  Object .defineProperty (X3DExecutionContext .prototype, "profile",
958
958
  {
959
- get: function () { return this .getProfile (); },
959
+ get: X3DExecutionContext .prototype .getProfile,
960
960
  enumerable: true,
961
961
  configurable: false
962
962
  });
963
963
 
964
964
  Object .defineProperty (X3DExecutionContext .prototype, "components",
965
965
  {
966
- get: function () { return this .getComponents (); },
966
+ get: X3DExecutionContext .prototype .getComponents,
967
967
  enumerable: true,
968
968
  configurable: false
969
969
  });
970
970
 
971
971
  Object .defineProperty (X3DExecutionContext .prototype, "worldURL",
972
972
  {
973
- get: function () { return this .getWorldURL (); },
973
+ get: X3DExecutionContext .prototype .getWorldURL,
974
974
  enumerable: true,
975
975
  configurable: false
976
976
  });
977
977
 
978
978
  Object .defineProperty (X3DExecutionContext .prototype, "units",
979
979
  {
980
- get: function () { return this .getUnits (); },
980
+ get: X3DExecutionContext .prototype .getUnits,
981
981
  enumerable: true,
982
982
  configurable: false
983
983
  });
984
984
 
985
985
  Object .defineProperty (X3DExecutionContext .prototype, "rootNodes",
986
986
  {
987
- get: function () { return this .getRootNodes (); },
988
- set: function (value) { this .setRootNodes (value); },
987
+ get: X3DExecutionContext .prototype .getRootNodes,
988
+ set: X3DExecutionContext .prototype .setRootNodes,
989
989
  enumerable: true,
990
990
  configurable: false
991
991
  });
992
992
 
993
993
  Object .defineProperty (X3DExecutionContext .prototype, "protos",
994
994
  {
995
- get: function () { return this .getProtoDeclarations (); },
995
+ get: X3DExecutionContext .prototype .getProtoDeclarations,
996
996
  enumerable: true,
997
997
  configurable: false
998
998
  });
999
999
 
1000
1000
  Object .defineProperty (X3DExecutionContext .prototype, "externprotos",
1001
1001
  {
1002
- get: function () { return this .getExternProtoDeclarations (); },
1002
+ get: X3DExecutionContext .prototype .getExternProtoDeclarations,
1003
1003
  enumerable: true,
1004
1004
  configurable: false
1005
1005
  });
1006
1006
 
1007
1007
  Object .defineProperty (X3DExecutionContext .prototype, "routes",
1008
1008
  {
1009
- get: function () { return this .getRoutes (); },
1009
+ get: X3DExecutionContext .prototype .getRoutes,
1010
1010
  enumerable: true,
1011
1011
  configurable: false
1012
1012
  });
@@ -67,7 +67,8 @@ const handler =
67
67
  return value;
68
68
 
69
69
  const
70
- field = target .getValue () .getField (key),
70
+ node = target .getValue (),
71
+ field = node .getField (key),
71
72
  accessType = field .getAccessType ();
72
73
 
73
74
  // Specification conform would be: accessType & X3DConstants .outputOnly.
@@ -93,13 +94,14 @@ const handler =
93
94
  try
94
95
  {
95
96
  const
96
- field = target .getValue () .getField (key),
97
+ node = target .getValue (),
98
+ field = node .getField (key),
97
99
  accessType = field .getAccessType ();
98
100
 
99
101
  if (accessType !== X3DConstants .outputOnly)
100
102
  field .setValue (value);
101
103
 
102
- return true;
104
+ return true;
103
105
  }
104
106
  catch (error)
105
107
  {
@@ -49,9 +49,7 @@ import X3DField from "../Base/X3DField.js";
49
49
  import SFVec3 from "./SFVec3.js";
50
50
  import SFMatrix3 from "./SFMatrix3.js";
51
51
  import X3DConstants from "../Base/X3DConstants.js";
52
- import Vector3 from "../../standard/Math/Numbers/Vector3.js";
53
52
  import Rotation4 from "../../standard/Math/Numbers/Rotation4.js";
54
- import Matrix3 from "../../standard/Math/Numbers/Matrix3.js";
55
53
 
56
54
  const
57
55
  SFVec3f = SFVec3 .SFVec3f,
@@ -126,7 +124,7 @@ SFRotation .prototype = Object .assign (Object .create (X3DField .prototype),
126
124
  },
127
125
  getAxis: function ()
128
126
  {
129
- return new SFVec3f (this .getValue () .getAxis (new Vector3 (0, 0, 0)));
127
+ return new SFVec3f (this .getValue () .getAxis ());
130
128
  },
131
129
  setMatrix: function (matrix)
132
130
  {
@@ -135,7 +133,7 @@ SFRotation .prototype = Object .assign (Object .create (X3DField .prototype),
135
133
  },
136
134
  getMatrix: function ()
137
135
  {
138
- return new SFMatrix3f (this .getValue () .getMatrix (new Matrix3 ()));
136
+ return new SFMatrix3f (this .getValue () .getMatrix ());
139
137
  },
140
138
  inverse: function ()
141
139
  {
@@ -181,9 +181,9 @@ function SFVecPrototypeTemplate (TypeName, Type, ValueType, double)
181
181
  toJSONStreamValue: function (generator)
182
182
  {
183
183
  const
184
- value = this .getValue (),
185
- last = value .length - 1,
186
- category = generator .Unit (this .getUnit ());
184
+ value = this .getValue (),
185
+ last = value .length - 1,
186
+ category = generator .Unit (this .getUnit ());
187
187
 
188
188
  for (let i = 0; i < last; ++ i)
189
189
  {
@@ -55,7 +55,7 @@ const
55
55
  ECMAScript = /^\s*(?:vrmlscript|javascript|ecmascript)\:(.*)$/s,
56
56
  dataURL = /^data:(.*?)(?:;charset=(.*?))?(?:;(base64))?,(.*)$/s;
57
57
 
58
- const foreignExtensions = new RegExp ("\.(?:html|xhtml)$");
58
+ const foreignExtensions = new RegExp ("\.(?:html|htm|xhtml)$");
59
59
 
60
60
  const foreign = {
61
61
  "text/html": true,
@@ -72,11 +72,10 @@ function FileLoader (node, external)
72
72
  this .browser = node .getBrowser ();
73
73
  this .external = external === undefined ? this .browser .isExternal () : external;
74
74
  this .executionContext = this .external ? node .getExecutionContext () : this .browser .currentScene;
75
- this .userAgent = this .browser .getName () + "/" + this .browser .getVersion () + " (X3D Browser; +" + this .browser .getProviderUrl () + ")";
76
75
  this .target = "";
77
76
  this .url = [ ];
78
77
  this .URL = new URL (this .getReferer (), this .getReferer ());
79
- this .fileReader = new FileReader ();
78
+ this .controller = new AbortController ();
80
79
  }
81
80
 
82
81
  FileLoader .prototype = Object .assign (Object .create (X3DObject .prototype),
@@ -84,24 +83,20 @@ FileLoader .prototype = Object .assign (Object .create (X3DObject .prototype),
84
83
  constructor: FileLoader,
85
84
  abort: function ()
86
85
  {
87
- this .callback = Function .prototype;
88
- this .bindViewpoint = Function .prototype;
89
- this .foreign = Function .prototype;
90
- },
91
- isPrivate: function ()
92
- {
93
- return true;
86
+ this .url .length = 0;
87
+
88
+ this .controller .abort ();
94
89
  },
95
- getWorldURL: function ()
90
+ getURL: function ()
96
91
  {
97
92
  return this .URL;
98
93
  },
99
94
  getReferer: function ()
100
95
  {
101
- if (this .node .getTypeName () === "X3DWorld")
96
+ if (this .node instanceof X3DWorld)
102
97
  {
103
98
  if (this .external)
104
- return this .browser .getLocation ();
99
+ return this .browser .getBaseURL ();
105
100
  }
106
101
 
107
102
  return this .executionContext .getWorldURL ();
@@ -167,7 +162,7 @@ FileLoader .prototype = Object .assign (Object .create (X3DObject .prototype),
167
162
 
168
163
  // Wait for instances to be created.
169
164
 
170
- setTimeout (function ()
165
+ setTimeout (() =>
171
166
  {
172
167
  try
173
168
  {
@@ -180,8 +175,7 @@ FileLoader .prototype = Object .assign (Object .create (X3DObject .prototype),
180
175
  else
181
176
  throw exception;
182
177
  }
183
- },
184
- 0);
178
+ });
185
179
 
186
180
  if (DEBUG)
187
181
  {
@@ -200,7 +194,7 @@ FileLoader .prototype = Object .assign (Object .create (X3DObject .prototype),
200
194
  createX3DFromURLAsync: function (callback, data)
201
195
  {
202
196
  if (data === null)
203
- callback (null, this .URL);
197
+ callback (null);
204
198
  else
205
199
  this .createX3DFromString (this .URL, data, callback, this .loadDocumentError .bind (this));
206
200
  },
@@ -249,7 +243,7 @@ FileLoader .prototype = Object .assign (Object .create (X3DObject .prototype),
249
243
  if (result [3] === "base64")
250
244
  data = atob (data);
251
245
  else
252
- data = unescape (data);
246
+ data = decodeURIComponent (data);
253
247
 
254
248
  this .callback (data);
255
249
  return;
@@ -289,7 +283,7 @@ FileLoader .prototype = Object .assign (Object .create (X3DObject .prototype),
289
283
  // Load URL async
290
284
 
291
285
  const
292
- options = { cache: this .node .getCache () ? "default" : "reload" },
286
+ options = { cache: this .node .getCache () ? "default" : "reload", signal: this .controller .signal },
293
287
  response = this .handleErrors (await fetch (this .URL .href, options)),
294
288
  contentType = response .headers .get ("content-type") ?.replace (/;.*$/, "");
295
289
 
@@ -305,10 +299,10 @@ FileLoader .prototype = Object .assign (Object .create (X3DObject .prototype),
305
299
  },
306
300
  handleErrors: function (response)
307
301
  {
308
- if (!response .ok)
309
- throw Error (response .statusText || response .status);
302
+ if (response .ok)
303
+ return response;
310
304
 
311
- return response;
305
+ throw Error (response .statusText || response .status);
312
306
  },
313
307
  loadDocumentError: function (exception)
314
308
  {
@@ -72,7 +72,7 @@ function Generator ({ style = "TIDY", precision = 7, doublePrecision = 15 })
72
72
  this .units = true;
73
73
  this .unitCategories = [ ];
74
74
 
75
- this .names .set (null, new Set ());
75
+ this .names .set (null, Object .assign (new Set (), { index: 0 }));
76
76
  }
77
77
 
78
78
  Generator .prototype =
@@ -54,14 +54,14 @@ function X3DParser (scene)
54
54
 
55
55
  X3DParser .prototype = {
56
56
  constructor: X3DParser,
57
- getScene: function ()
58
- {
59
- return this .scene;
60
- },
61
57
  getBrowser: function ()
62
58
  {
63
59
  return this .scene .getBrowser ();
64
60
  },
61
+ getScene: function ()
62
+ {
63
+ return this .scene;
64
+ },
65
65
  getExecutionContext: function ()
66
66
  {
67
67
  return this .executionContexts .at (-1);