x_ite 16.1.2 → 16.1.3

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 (57) hide show
  1. package/README.md +5 -5
  2. package/dist/X3DUOM.xml +10 -0
  3. package/dist/assets/components/AnnotationComponent.js +1 -1
  4. package/dist/assets/components/AnnotationComponent.min.js +1 -1
  5. package/dist/assets/components/CADGeometryComponent.js +1 -1
  6. package/dist/assets/components/CADGeometryComponent.min.js +1 -1
  7. package/dist/assets/components/CubeMapTexturingComponent.js +1 -1
  8. package/dist/assets/components/CubeMapTexturingComponent.min.js +1 -1
  9. package/dist/assets/components/DISComponent.js +1 -1
  10. package/dist/assets/components/DISComponent.min.js +1 -1
  11. package/dist/assets/components/EventUtilitiesComponent.js +1 -1
  12. package/dist/assets/components/EventUtilitiesComponent.min.js +1 -1
  13. package/dist/assets/components/GaussianSplatsComponent.js +1 -1
  14. package/dist/assets/components/GaussianSplatsComponent.min.js +1 -1
  15. package/dist/assets/components/Geometry2DComponent.js +1 -1
  16. package/dist/assets/components/Geometry2DComponent.min.js +1 -1
  17. package/dist/assets/components/Geometry3DComponent.js +1 -1
  18. package/dist/assets/components/Geometry3DComponent.min.js +1 -1
  19. package/dist/assets/components/GeospatialComponent.js +1 -1
  20. package/dist/assets/components/GeospatialComponent.min.js +1 -1
  21. package/dist/assets/components/HAnimComponent.js +1 -1
  22. package/dist/assets/components/HAnimComponent.min.js +1 -1
  23. package/dist/assets/components/KeyDeviceSensorComponent.js +1 -1
  24. package/dist/assets/components/KeyDeviceSensorComponent.min.js +1 -1
  25. package/dist/assets/components/LayoutComponent.js +1 -1
  26. package/dist/assets/components/LayoutComponent.min.js +1 -1
  27. package/dist/assets/components/NURBSComponent.js +1 -1
  28. package/dist/assets/components/NURBSComponent.min.js +1 -1
  29. package/dist/assets/components/ParticleSystemsComponent.js +1 -1
  30. package/dist/assets/components/ParticleSystemsComponent.min.js +1 -1
  31. package/dist/assets/components/PickingComponent.js +1 -1
  32. package/dist/assets/components/PickingComponent.min.js +1 -1
  33. package/dist/assets/components/RigidBodyPhysicsComponent.js +1 -1
  34. package/dist/assets/components/RigidBodyPhysicsComponent.min.js +1 -1
  35. package/dist/assets/components/ScriptingComponent.js +1 -1
  36. package/dist/assets/components/ScriptingComponent.min.js +1 -1
  37. package/dist/assets/components/TextComponent.js +1 -1
  38. package/dist/assets/components/TextComponent.min.js +1 -1
  39. package/dist/assets/components/TextureProjectionComponent.js +1 -1
  40. package/dist/assets/components/TextureProjectionComponent.min.js +1 -1
  41. package/dist/assets/components/Texturing3DComponent.js +9 -9
  42. package/dist/assets/components/Texturing3DComponent.min.js +2 -2
  43. package/dist/assets/components/VolumeRenderingComponent.js +1 -1
  44. package/dist/assets/components/VolumeRenderingComponent.min.js +1 -1
  45. package/dist/assets/components/WebXRComponent.js +1 -1
  46. package/dist/assets/components/WebXRComponent.min.js +1 -1
  47. package/dist/assets/components/X_ITEComponent.js +1 -1
  48. package/dist/assets/components/X_ITEComponent.min.js +1 -1
  49. package/dist/example.html +1 -1
  50. package/dist/x_ite.css +1 -1
  51. package/dist/x_ite.d.ts +126 -8
  52. package/dist/x_ite.js +246 -108
  53. package/dist/x_ite.min.js +2 -2
  54. package/dist/x_ite.min.mjs +2 -2
  55. package/dist/x_ite.mjs +246 -108
  56. package/dist/x_ite.zip +0 -0
  57. package/package.json +5 -5
package/dist/x_ite.js CHANGED
@@ -1,4 +1,4 @@
1
- /* X_ITE v16.1.2 */
1
+ /* X_ITE v16.1.3 */
2
2
  (function webpackUniversalModuleDefinition(root, factory) {
3
3
  if(typeof exports === 'object' && typeof module === 'object')
4
4
  module.exports = factory();
@@ -12,7 +12,7 @@
12
12
  return /******/ (() => { // webpackBootstrap
13
13
  /******/ var __webpack_modules__ = ({
14
14
 
15
- /***/ 603
15
+ /***/ 143
16
16
  (module, exports) {
17
17
 
18
18
  var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*
@@ -1017,7 +1017,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
1017
1017
 
1018
1018
  /***/ },
1019
1019
 
1020
- /***/ 777
1020
+ /***/ 701
1021
1021
  (module) {
1022
1022
 
1023
1023
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -2013,7 +2013,7 @@ return /******/ (function(modules) { // webpackBootstrap
2013
2013
 
2014
2014
  /***/ },
2015
2015
 
2016
- /***/ 457
2016
+ /***/ 877
2017
2017
  (module) {
2018
2018
 
2019
2019
  /**
@@ -7114,10 +7114,6 @@ const Algorithm =
7114
7114
  n = (n & 0x33333333) + ((n >>> 2) & 0x33333333);
7115
7115
  return ((n + (n >>> 4) & 0xF0F0F0F) * 0x1010101) >>> 24;
7116
7116
  },
7117
- cmp (lhs, rhs)
7118
- {
7119
- return lhs > rhs ? 1 : lhs < rhs ? -1 : 0;
7120
- },
7121
7117
  less (lhs, rhs)
7122
7118
  {
7123
7119
  return lhs < rhs;
@@ -7130,19 +7126,17 @@ const Algorithm =
7130
7126
  {
7131
7127
  // https://en.cppreference.com/w/cpp/algorithm/lower_bound
7132
7128
 
7133
- let
7134
- index = 0,
7135
- step = 0,
7136
- count = last - first;
7129
+ let count = last - first;
7137
7130
 
7138
7131
  while (count > 0)
7139
7132
  {
7140
- step = count >>> 1;
7141
- index = first + step;
7133
+ const
7134
+ step = count >>> 1,
7135
+ index = first + step;
7142
7136
 
7143
7137
  if (comp (array [index], value))
7144
7138
  {
7145
- first = ++ index;
7139
+ first = index + 1;
7146
7140
  count -= step + 1;
7147
7141
  }
7148
7142
  else
@@ -7157,15 +7151,13 @@ const Algorithm =
7157
7151
  {
7158
7152
  // https://en.cppreference.com/w/cpp/algorithm/upper_bound
7159
7153
 
7160
- let
7161
- index = 0,
7162
- step = 0,
7163
- count = last - first;
7154
+ let count = last - first;
7164
7155
 
7165
7156
  while (count > 0)
7166
7157
  {
7167
- step = count >>> 1;
7168
- index = first + step;
7158
+ const
7159
+ step = count >>> 1,
7160
+ index = first + step;
7169
7161
 
7170
7162
  if (comp (value, array [index]))
7171
7163
  {
@@ -7173,7 +7165,7 @@ const Algorithm =
7173
7165
  }
7174
7166
  else
7175
7167
  {
7176
- first = ++ index;
7168
+ first = index + 1;
7177
7169
  count -= step + 1;
7178
7170
  }
7179
7171
  }
@@ -14394,10 +14386,10 @@ const SFNode_handler =
14394
14386
 
14395
14387
  if (field)
14396
14388
  {
14397
- // Specification conform would be: accessType & X3DConstants .outputOnly.
14398
- // But we allow read access to plain fields, too.
14389
+ // Specification conform would be: `accessType & X3DConstants .outputOnly`.
14390
+ // However, we also allow read access to initializeOnly fields.
14399
14391
  if (field .getAccessType () === Base_X3DConstants .inputOnly)
14400
- return undefined;
14392
+ return;
14401
14393
 
14402
14394
  return field .valueOf ();
14403
14395
  }
@@ -14521,16 +14513,14 @@ Object .assign (Object .setPrototypeOf (SFNode .prototype, Base_X3DField .protot
14521
14513
  {
14522
14514
  const target = this [_target];
14523
14515
 
14524
- if (node)
14525
- return target .getValue () === node .getValue ();
14516
+ if (node instanceof SFNode)
14517
+ return target .getValue () === node [_target] .getValue ();
14526
14518
 
14527
- return target .getValue () === null;
14519
+ return target .getValue () === node;
14528
14520
  },
14529
14521
  isDefaultValue ()
14530
14522
  {
14531
- const target = this [_target];
14532
-
14533
- return target .getValue () === null;
14523
+ return this [_target] .getValue () === null;
14534
14524
  },
14535
14525
  set (node)
14536
14526
  {
@@ -15752,6 +15742,17 @@ Object .defineProperties (X3DArrayField,
15752
15742
  for (const v of Array .from (... args))
15753
15743
  target .push (v);
15754
15744
 
15745
+ return array;
15746
+ },
15747
+ },
15748
+ fromArray:
15749
+ {
15750
+ value (values)
15751
+ {
15752
+ const array = new constructor ();
15753
+
15754
+ array .setValue (values);
15755
+
15755
15756
  return array;
15756
15757
  },
15757
15758
  },
@@ -17077,7 +17078,7 @@ Object .assign (Object .setPrototypeOf (X3DTypedArrayField .prototype, Base_X3DA
17077
17078
 
17078
17079
  const cmp = compareFn
17079
17080
  ? (a, b) => compareFn (valueType (a), valueType (b))
17080
- : Math_Algorithm .cmp;
17081
+ : undefined;
17081
17082
 
17082
17083
  target .set (array .subarray (0, length) .sort (cmp));
17083
17084
  }
@@ -17702,6 +17703,49 @@ Object .assign (Object .setPrototypeOf (MFImage .prototype, Base_X3DObjectArrayF
17702
17703
  {
17703
17704
  return Fields_SFImage;
17704
17705
  },
17706
+ setValue (value)
17707
+ {
17708
+ if (value .length && !(value [0] instanceof Fields_SFImage))
17709
+ {
17710
+ const
17711
+ target = this .getTarget (),
17712
+ array = target .getValue ();
17713
+
17714
+ this .length = 0;
17715
+
17716
+ while (value .length)
17717
+ {
17718
+ const
17719
+ width = value .shift (),
17720
+ height = value .shift (),
17721
+ comp = value .shift (),
17722
+ pixels = value .splice (0, width * height),
17723
+ field = new Fields_SFImage (width, height, comp, pixels);
17724
+
17725
+ target .addChildObject (field);
17726
+ array .push (field);
17727
+ }
17728
+
17729
+ target .addEvent ();
17730
+ }
17731
+ else
17732
+ {
17733
+ Base_X3DObjectArrayField .prototype .setValue .call (this, value);
17734
+ }
17735
+ },
17736
+ flat ()
17737
+ {
17738
+ return Array .from (this, element => Array .from (element)) .flat ();
17739
+ },
17740
+ sort (compareFn)
17741
+ {
17742
+ const target = this .getTarget ();
17743
+
17744
+ target .getValue () .sort (compareFn);
17745
+ target .addEvent ();
17746
+
17747
+ return this;
17748
+ },
17705
17749
  });
17706
17750
 
17707
17751
  for (const key of Object .keys (MFImage .prototype))
@@ -18858,7 +18902,7 @@ const Legacy_default_ = Legacy;
18858
18902
 
18859
18903
  /* harmony default export */ const Browser_Legacy = (x_ite_Namespace .add ("Legacy", Legacy_default_));
18860
18904
  ;// ./src/x_ite/BROWSER_VERSION.js
18861
- const BROWSER_VERSION_default_ = "16.1.2";
18905
+ const BROWSER_VERSION_default_ = "16.1.3";
18862
18906
  ;
18863
18907
 
18864
18908
  /* harmony default export */ const BROWSER_VERSION = (x_ite_Namespace .add ("BROWSER_VERSION", BROWSER_VERSION_default_));
@@ -24881,7 +24925,7 @@ Object .assign (Object .setPrototypeOf (X3DPrototypeInstance .prototype, Core_X3
24881
24925
  for (const fieldDefinition of this [_protoNode] .getFieldDefinitions ())
24882
24926
  this .addPredefinedField (fieldDefinition);
24883
24927
 
24884
- // Reuse old fields, and therefor routes.
24928
+ // Reuse old fields, and therefore routes.
24885
24929
 
24886
24930
  for (const protoField of this [_protoFields])
24887
24931
  {
@@ -26036,8 +26080,6 @@ Object .assign (X3DParser .prototype,
26036
26080
  },
26037
26081
  sanitizeName (name = "")
26038
26082
  {
26039
-
26040
-
26041
26083
  // NonIdFirstChar
26042
26084
  name = name .replace (/^[\x30-\x39\x00-\x20\x22\x23\x27\x2b\x2c\x2d\x2e\x5b\x5c\x5d\x7b\x7d\x7f]*/, "");
26043
26085
 
@@ -26051,8 +26093,6 @@ Object .assign (X3DParser .prototype,
26051
26093
  name = name .replace (/^-+|-+$/g, "");
26052
26094
 
26053
26095
  return name;
26054
-
26055
-
26056
26096
  },
26057
26097
  renameExistingNode (name)
26058
26098
  {
@@ -30796,6 +30836,9 @@ Object .assign (X3DOptimizer .prototype,
30796
30836
  if (!node .getNodeType () .includes (Base_X3DConstants .X3DGroupingNode))
30797
30837
  return node;
30798
30838
 
30839
+ if (!node .visible)
30840
+ return node;
30841
+
30799
30842
  const children = Array .from (node .children);
30800
30843
 
30801
30844
  removedNodes .push (this .removeChildren (node));
@@ -30875,9 +30918,6 @@ Object .assign (X3DOptimizer .prototype,
30875
30918
  if (node .children .length !== 1)
30876
30919
  return node;
30877
30920
 
30878
- if (!node .visible)
30879
- return node;
30880
-
30881
30921
  const child = node .children [0];
30882
30922
 
30883
30923
  if (child .getValue () .getCloneCount () > 1)
@@ -30890,16 +30930,27 @@ Object .assign (X3DOptimizer .prototype,
30890
30930
  {
30891
30931
  case "Transform":
30892
30932
  case "HAnimHumanoid":
30933
+ {
30934
+ if (child .visible !== node .visible)
30935
+ return node;
30936
+
30893
30937
  return this .combineTransform (node, child, removedNodes);
30938
+ }
30894
30939
  case "DirectionalLight":
30895
30940
  case "PointLight":
30896
30941
  case "SpotLight":
30942
+ {
30897
30943
  return this .combineLight (node, child, removedNodes);
30944
+ }
30898
30945
  case "Viewpoint":
30899
30946
  case "OrthoViewpoint":
30947
+ {
30900
30948
  return this .combineViewpoint (node, child, removedNodes);
30949
+ }
30901
30950
  default:
30951
+ {
30902
30952
  return node;
30953
+ }
30903
30954
  }
30904
30955
  },
30905
30956
  combineTransform (node, child, removedNodes)
@@ -31187,7 +31238,7 @@ const Plane3_default_ = Plane3;
31187
31238
 
31188
31239
  /* harmony default export */ const Geometry_Plane3 = (x_ite_Namespace .add ("Plane3", Plane3_default_));
31189
31240
  ;// ./src/standard/Math/Geometry/Triangle3.js
31190
- /* provided dependency */ var libtess = __webpack_require__(457);
31241
+ /* provided dependency */ var libtess = __webpack_require__(877);
31191
31242
 
31192
31243
 
31193
31244
  const Triangle3 =
@@ -43481,7 +43532,7 @@ function eventsProcessed ()
43481
43532
  return null;
43482
43533
 
43483
43534
  const textureTransformNodes = this .textureTransformNodes
43484
- .sort ((a, b) => Math_Algorithm .cmp (a ._mapping .getValue (), b ._mapping .getValue ()));
43535
+ .sort ((a, b) => a ._mapping .getValue () .localeCompare (b ._mapping .getValue (), "en"));
43485
43536
 
43486
43537
  switch (textureTransformNodes .length)
43487
43538
  {
@@ -43896,7 +43947,7 @@ function eventsProcessed ()
43896
43947
  default:
43897
43948
  {
43898
43949
  const textureCoordinateNodes = Array .from (material .texCoordMappings .entries ())
43899
- .sort ((a, b) => Math_Algorithm .cmp (a [0], b [0]))
43950
+ .sort ((a, b) => a [0] .localeCompare (b [0], "en"))
43900
43951
  .sort ((a, b) => a [1] - b [1])
43901
43952
  .map (([mapping, i]) => this .createTextureCoordinate (texCoords [i], mapping));
43902
43953
 
@@ -47887,7 +47938,7 @@ const Bezier_default_ = Bezier;
47887
47938
 
47888
47939
  /* harmony default export */ const Algorithms_Bezier = (x_ite_Namespace .add ("Bezier", Bezier_default_));
47889
47940
  ;// ./src/x_ite/Parser/SVGParser.js
47890
- /* provided dependency */ var SVGParser_libtess = __webpack_require__(457);
47941
+ /* provided dependency */ var SVGParser_libtess = __webpack_require__(877);
47891
47942
 
47892
47943
 
47893
47944
 
@@ -51097,8 +51148,10 @@ function FileLoader (node, { cacheScene = false, dataAsString = true } = { })
51097
51148
  this .executionContext = node .getExecutionContext ();
51098
51149
  this .target = "";
51099
51150
  this .url = [ ];
51100
- this .fileURL = new URL (this .getBaseURL ());
51101
51151
  this .controller = new AbortController ();
51152
+ this .candidateURL = "";
51153
+ this .resolvedURL = null;
51154
+ this .attempts = [ ];
51102
51155
  }
51103
51156
 
51104
51157
  Object .assign (FileLoader,
@@ -51129,10 +51182,6 @@ Object .assign (Object .setPrototypeOf (FileLoader .prototype, Base_X3DObject .p
51129
51182
 
51130
51183
  this .controller .abort ();
51131
51184
  },
51132
- getURL ()
51133
- {
51134
- return this .fileURL;
51135
- },
51136
51185
  getBaseURL ()
51137
51186
  {
51138
51187
  if (this .node instanceof Execution_X3DWorld)
@@ -51215,8 +51264,8 @@ Object .assign (Object .setPrototypeOf (FileLoader .prototype, Base_X3DObject .p
51215
51264
 
51216
51265
  if (DEVELOPMENT)
51217
51266
  {
51218
- if (this .fileURL .protocol !== "data:")
51219
- console .info (`Done loading scene '${decodeURI (this .fileURL)}'.`);
51267
+ if (this .resolvedURL .protocol !== "data:")
51268
+ console .info (`Done loading scene '${decodeURI (this .resolvedURL)}'.`);
51220
51269
  }
51221
51270
  },
51222
51271
  createX3DFromURL (url, parameter, callback, bindViewpoint, foreign)
@@ -51233,13 +51282,15 @@ Object .assign (Object .setPrototypeOf (FileLoader .prototype, Base_X3DObject .p
51233
51282
  if (data === null)
51234
51283
  callback (null);
51235
51284
  else
51236
- this .createX3DFromString (this .fileURL, data, callback, this .loadDocumentError .bind (this));
51285
+ this .createX3DFromString (this .resolvedURL, data, callback, this .loadDocumentError .bind (this));
51237
51286
  },
51238
51287
  loadDocument (url, callback)
51239
51288
  {
51240
51289
  this .url = url .slice ();
51241
51290
  this .callback = callback;
51242
51291
 
51292
+ this .attempts .length = 0;
51293
+
51243
51294
  if (url .length === 0)
51244
51295
  return this .loadDocumentError ();
51245
51296
 
@@ -51248,8 +51299,15 @@ Object .assign (Object .setPrototypeOf (FileLoader .prototype, Base_X3DObject .p
51248
51299
  },
51249
51300
  async loadDocumentAsync (url)
51250
51301
  {
51302
+ // Not every candidate reaches URL resolution, so resolvedURL stays null until it
51303
+ // does. Diagnostics must not attribute the previous candidate's resolved URL to
51304
+ // this one.
51305
+
51306
+ this .candidateURL = url;
51307
+ this .resolvedURL = null;
51308
+
51251
51309
  if (!url .length)
51252
- return this .loadDocumentError ();
51310
+ return this .loadDocumentError (new Error ("Empty URL."));
51253
51311
 
51254
51312
  // Script:
51255
51313
  {
@@ -51259,7 +51317,7 @@ Object .assign (Object .setPrototypeOf (FileLoader .prototype, Base_X3DObject .p
51259
51317
  return await this .callback (url .substring (result [0] .length));
51260
51318
  }
51261
51319
 
51262
- this .fileURL = new URL (url, this .getBaseURL ());
51320
+ this .resolvedURL = new URL (url, this .getBaseURL ());
51263
51321
 
51264
51322
  // Handle data URLs that are not base64 decoded here:
51265
51323
  if (this .dataAsString)
@@ -51281,17 +51339,17 @@ Object .assign (Object .setPrototypeOf (FileLoader .prototype, Base_X3DObject .p
51281
51339
 
51282
51340
  // Bind Viewpoint URLs:
51283
51341
 
51284
- if (this .fileURL .protocol !== "data:" && this .bindViewpoint)
51342
+ if (this .resolvedURL .protocol !== "data:" && this .bindViewpoint)
51285
51343
  {
51286
51344
  const referer = new URL (this .getBaseURL ());
51287
51345
 
51288
- if (this .fileURL .protocol === referer .protocol &&
51289
- this .fileURL .hostname === referer .hostname &&
51290
- this .fileURL .port === referer .port &&
51291
- this .fileURL .pathname === referer .pathname &&
51292
- this .fileURL .hash)
51346
+ if (this .resolvedURL .protocol === referer .protocol &&
51347
+ this .resolvedURL .hostname === referer .hostname &&
51348
+ this .resolvedURL .port === referer .port &&
51349
+ this .resolvedURL .pathname === referer .pathname &&
51350
+ this .resolvedURL .hash)
51293
51351
  {
51294
- return this .bindViewpoint (decodeURIComponent (this .fileURL .hash .substring (1)));
51352
+ return this .bindViewpoint (decodeURIComponent (this .resolvedURL .hash .substring (1)));
51295
51353
  }
51296
51354
  }
51297
51355
 
@@ -51302,19 +51360,19 @@ Object .assign (Object .setPrototypeOf (FileLoader .prototype, Base_X3DObject .p
51302
51360
  // Handle target
51303
51361
 
51304
51362
  if (this .target .length && this .target !== "_self")
51305
- return this .foreign (this .fileURL .href, this .target);
51363
+ return this .foreign (this .resolvedURL .href, this .target);
51306
51364
 
51307
51365
  // Handle well known foreign content depending on extension or if path looks like directory.
51308
51366
 
51309
- if (this .fileURL .protocol !== "data:" && this .fileURL .href .match (/\.(?:html|htm|xhtml)$/))
51310
- return this .foreign (this .fileURL .href, this .target);
51367
+ if (this .resolvedURL .protocol !== "data:" && this .resolvedURL .href .match (/\.(?:html|htm|xhtml)$/))
51368
+ return this .foreign (this .resolvedURL .href, this .target);
51311
51369
  }
51312
51370
 
51313
51371
  // Cached scenes:
51314
51372
 
51315
- if (this .sceneCallback && this .cacheScene && !this .fileURL .search .length)
51373
+ if (this .sceneCallback && this .cacheScene && !this .resolvedURL .search .length)
51316
51374
  {
51317
- const cacheURL = new URL (this .fileURL);
51375
+ const cacheURL = new URL (this .resolvedURL);
51318
51376
 
51319
51377
  cacheURL .hash = "";
51320
51378
 
@@ -51324,7 +51382,7 @@ Object .assign (Object .setPrototypeOf (FileLoader .prototype, Base_X3DObject .p
51324
51382
  {
51325
51383
  const scene = await promise;
51326
51384
 
51327
- scene .setWorldURL (this .fileURL .href);
51385
+ scene .setWorldURL (this .resolvedURL .href);
51328
51386
 
51329
51387
  return this .sceneCallback (scene);
51330
51388
  }
@@ -51342,7 +51400,7 @@ Object .assign (Object .setPrototypeOf (FileLoader .prototype, Base_X3DObject .p
51342
51400
 
51343
51401
  const
51344
51402
  options = { cache: this .node .getCache () ? "default" : "reload", signal: this .controller .signal },
51345
- response = this .checkResponse (await fetch (this .fileURL, options)),
51403
+ response = this .checkResponse (await fetch (this .resolvedURL, options)),
51346
51404
  mimeType = response .headers .get ("Content-Type") ?.replace (/;.*$/, "");
51347
51405
 
51348
51406
  if (this .foreign)
@@ -51350,10 +51408,10 @@ Object .assign (Object .setPrototypeOf (FileLoader .prototype, Base_X3DObject .p
51350
51408
  // console .log (mimeType);
51351
51409
 
51352
51410
  if (foreignMimeType .has (mimeType))
51353
- return this .foreign (this .fileURL .href, this .target);
51411
+ return this .foreign (this .resolvedURL .href, this .target);
51354
51412
  }
51355
51413
 
51356
- await this .callback (await helper.gunzip (await this .getBlob (response)), this .fileURL);
51414
+ await this .callback (await helper.gunzip (await this .getBlob (response)), this .resolvedURL);
51357
51415
  },
51358
51416
  async getBlob (response)
51359
51417
  {
@@ -51393,7 +51451,7 @@ Object .assign (Object .setPrototypeOf (FileLoader .prototype, Base_X3DObject .p
51393
51451
  if (response .ok)
51394
51452
  return response;
51395
51453
 
51396
- throw Error (response .statusText || response .status);
51454
+ throw new Error (response .statusText || response .status);
51397
51455
  },
51398
51456
  loadDocumentError (error)
51399
51457
  {
@@ -51419,12 +51477,52 @@ Object .assign (Object .setPrototypeOf (FileLoader .prototype, Base_X3DObject .p
51419
51477
  if (!error)
51420
51478
  return;
51421
51479
 
51422
- const typeName = this .node instanceof Execution_X3DWorld ? "" : ` for ${this .node .getTypeName ()}`;
51480
+ // Candidates that are evaluated rather than fetched — an empty string, or a
51481
+ // script URL — have no resolved URL, and are reported by their authored value.
51423
51482
 
51424
- if (this .fileURL .protocol === "data:")
51425
- console .error (`Couldn't load data URL${typeName}.`, error);
51426
- else
51427
- console .error (`Couldn't load URL '${helper.try (() => decodeURI (this .fileURL)) ?? this .fileURL}'${typeName}.`, error);
51483
+ const
51484
+ typeName = this .node instanceof Execution_X3DWorld ? "" : ` for ${this .node .getTypeName ()}`,
51485
+ dataURL = this .resolvedURL ?.protocol === "data:",
51486
+ resolved = this .resolvedURL && !dataURL ? `${helper.try (() => decodeURI (this .resolvedURL)) ?? this .resolvedURL}` : "",
51487
+ subject = !this .candidateURL .length ? "empty URL"
51488
+ : dataURL ? "data URL"
51489
+ : `URL '${resolved || this .truncate (this .candidateURL)}'`;
51490
+
51491
+ this .attempts .push ({ url: this .candidateURL, resolved, error });
51492
+
51493
+ // A url field is a fallback list, so a failed candidate is not yet a failure of
51494
+ // the resource: a later candidate may still succeed. Report the resource as
51495
+ // failed only once every candidate has been tried.
51496
+
51497
+ if (this .url .length)
51498
+ return console .warn (`Couldn't load ${subject}${typeName}, trying URL ${this .attempts .length + 1} of ${this .attempts .length + this .url .length}.`, error);
51499
+
51500
+ if (this .attempts .length === 1)
51501
+ return console .error (`Couldn't load ${subject}${typeName}.`, error);
51502
+
51503
+ // Pass the errors themselves along with the summary, so their stacks and context
51504
+ // stay inspectable.
51505
+
51506
+ console .error (`Couldn't load any of the ${this .attempts .length} URLs${typeName}, tried in this order:\n`
51507
+ + this .attempts
51508
+ .map (({ url, resolved, error }, i) =>
51509
+ ` ${i + 1}. '${this .truncate (url)}'${resolved && resolved !== url ? ` → ${this .truncate (resolved)}` : ""}: ${this .describe (error)}`)
51510
+ .join ("\n") + "\n",
51511
+ ... this .attempts .map (({ error }) => error));
51512
+ },
51513
+ /**
51514
+ * Keep diagnostics readable when a candidate is a long data URL.
51515
+ */
51516
+ truncate (string, length = 120)
51517
+ {
51518
+ return string .length > length ? `${string .substring (0, length)}…` : string;
51519
+ },
51520
+ /**
51521
+ * Not every thrown value is an Error, so don't summarize one as [object Object].
51522
+ */
51523
+ describe (error)
51524
+ {
51525
+ return error ?.message ?? (typeof error === "object" ? helper.try (() => JSON .stringify (error)) : null) ?? String (error);
51428
51526
  },
51429
51527
  });
51430
51528
 
@@ -54586,7 +54684,7 @@ function X3DCoreContext (element)
54586
54684
  {
54587
54685
  const link = document .createElement ("link");
54588
54686
 
54589
- link .integrity = "sha384-FEmsQpL8R1dkzlxB19h2qi5U9Cuh8Zk2953YCudH0PTQSwiWiUovdIWVDBu3/YAc";
54687
+ link .integrity = "sha384-F+mssNuFiQHol3RT7fLg6krIVxgAio+0HtxiqkBJSZIYtVM6Z51XLEsu66xkirs/";
54590
54688
  link .rel = "stylesheet";
54591
54689
  link .crossOrigin = "anonymous";
54592
54690
  link .onload = resolve;
@@ -71768,15 +71866,21 @@ const PeriodicWave_default_ = PeriodicWave;
71768
71866
 
71769
71867
 
71770
71868
 
71869
+
71870
+
71771
71871
  const
71772
- _audioElements = Symbol (),
71773
71872
  _audioContext = Symbol (),
71873
+ _audioNodes = Symbol (),
71874
+ _audioElements = Symbol (),
71774
71875
  _defaultPeriodicWave = Symbol (),
71775
71876
  _noSoundButton = Symbol (),
71776
71877
  _noSoundButtonId = Symbol ();
71777
71878
 
71778
71879
  function X3DSoundContext ()
71779
71880
  {
71881
+ this .addChildObjects (Base_X3DConstants .outputOnly, "audio", new x_ite_Fields .SFBool ());
71882
+
71883
+ this [_audioNodes] = new Set ();
71780
71884
  this [_audioElements] = new Map ();
71781
71885
  }
71782
71886
 
@@ -71814,16 +71918,17 @@ Object .assign (X3DSoundContext .prototype,
71814
71918
  return audioContext;
71815
71919
  })();
71816
71920
  },
71817
- getDefaultPeriodicWave ()
71921
+ addAudioNode (element)
71818
71922
  {
71819
- return this [_defaultPeriodicWave] ??= (() =>
71820
- {
71821
- const defaultPeriodicWave = new Sound_PeriodicWave (this .getPrivateScene ());
71923
+ this [_audioNodes] .add (element);
71822
71924
 
71823
- defaultPeriodicWave .setup ();
71925
+ this ._audio = this [_audioNodes] .size;
71926
+ },
71927
+ removeAudioNode (element)
71928
+ {
71929
+ this [_audioNodes] .delete (element);
71824
71930
 
71825
- return defaultPeriodicWave;
71826
- })();
71931
+ this ._audio = this [_audioNodes] .size;
71827
71932
  },
71828
71933
  startAudioElement (audioElement, functionName = "play")
71829
71934
  {
@@ -71900,6 +72005,17 @@ Object .assign (X3DSoundContext .prototype,
71900
72005
  },
71901
72006
  200);
71902
72007
  },
72008
+ getDefaultPeriodicWave ()
72009
+ {
72010
+ return this [_defaultPeriodicWave] ??= (() =>
72011
+ {
72012
+ const defaultPeriodicWave = new Sound_PeriodicWave (this .getPrivateScene ());
72013
+
72014
+ defaultPeriodicWave .setup ();
72015
+
72016
+ return defaultPeriodicWave;
72017
+ })();
72018
+ },
71903
72019
  });
71904
72020
 
71905
72021
  const X3DSoundContext_default_ = X3DSoundContext;
@@ -74924,9 +75040,12 @@ Object .assign (Object .setPrototypeOf (TextureBackground .prototype, Environmen
74924
75040
  this .set_texture__ (4, this ._topTexture);
74925
75041
  this .set_texture__ (5, this ._bottomTexture);
74926
75042
  },
74927
- set_texture__ (index, textureNode)
75043
+ set_texture__ (index, node)
74928
75044
  {
74929
- EnvironmentalEffects_X3DBackgroundNode .prototype .set_texture__ .call (this, index, Base_X3DCast (Base_X3DConstants .X3DTextureNode, textureNode));
75045
+ const textureNode = Base_X3DCast (Base_X3DConstants .X3DTexture2DNode, node)
75046
+ ?? Base_X3DCast (Base_X3DConstants .MultiTexture, node);
75047
+
75048
+ EnvironmentalEffects_X3DBackgroundNode .prototype .set_texture__ .call (this, index, textureNode);
74930
75049
  },
74931
75050
  traverse (type, renderObject)
74932
75051
  {
@@ -88350,10 +88469,20 @@ Object .assign (Object .setPrototypeOf (X3DSoundDestinationNode .prototype, Soun
88350
88469
  {
88351
88470
  // If enabled field is FALSE, the audio signal is blocked and does not pass through.
88352
88471
 
88353
- if (this ._enabled .getValue () && this .getLive () .getValue ())
88472
+ const
88473
+ browser = this .getBrowser (),
88474
+ active = this ._enabled .getValue () && this .getLive () .getValue ();
88475
+
88476
+ if (active)
88477
+ {
88354
88478
  this .audioDestination .connect (this .getSoundDestination ());
88479
+ browser .addAudioNode (this);
88480
+ }
88355
88481
  else
88482
+ {
88356
88483
  this .audioDestination .disconnect ();
88484
+ browser .removeAudioNode (this);
88485
+ }
88357
88486
 
88358
88487
  this ._isActive = this ._enabled;
88359
88488
  },
@@ -88475,6 +88604,8 @@ Object .assign (Object .setPrototypeOf (AudioDestination .prototype, Sound_X3DSo
88475
88604
  },
88476
88605
  set_enabled__ ()
88477
88606
  {
88607
+ Sound_X3DSoundDestinationNode .prototype .set_enabled__ .call (this);
88608
+
88478
88609
  const
88479
88610
  browser = this .getBrowser (),
88480
88611
  active = this ._enabled .getValue () && this .getLive () .getValue ();
@@ -88483,8 +88614,6 @@ Object .assign (Object .setPrototypeOf (AudioDestination .prototype, Sound_X3DSo
88483
88614
  browser .startAudioElement (this .audioElement);
88484
88615
  else
88485
88616
  browser .stopAudioElement (this .audioElement);
88486
-
88487
- Sound_X3DSoundDestinationNode .prototype .set_enabled__ .call (this);
88488
88617
  },
88489
88618
  set_mediaDeviceID__ ()
88490
88619
  {
@@ -90167,7 +90296,7 @@ function Sound (executionContext)
90167
90296
 
90168
90297
  this .addType (Base_X3DConstants .Sound);
90169
90298
 
90170
- this .addChildObjects (Base_X3DConstants .outputOnly, "traversed", new x_ite_Fields .SFBool (true));
90299
+ this .addChildObjects (Base_X3DConstants .outputOnly, "traversed", new x_ite_Fields .SFBool ());
90171
90300
 
90172
90301
  this .setVisibleObject (true);
90173
90302
 
@@ -90269,19 +90398,23 @@ Object .assign (Object .setPrototypeOf (Sound .prototype, Sound_X3DSoundNode .pr
90269
90398
  },
90270
90399
  set_live__ ()
90271
90400
  {
90401
+ const browser = this .getBrowser ();
90402
+
90272
90403
  this .mergerNode .disconnect ();
90273
90404
 
90274
90405
  if (this .getLive () .getValue () && this ._traversed .getValue ())
90275
90406
  {
90276
90407
  const audioContext = this .getBrowser () .getAudioContext ();
90277
90408
 
90278
- this .getBrowser () .sensorEvents () .addInterest ("update", this);
90279
-
90280
90409
  this .mergerNode .connect (audioContext .destination);
90410
+
90411
+ browser .addAudioNode (this);
90412
+ browser .sensorEvents () .addInterest ("update", this);
90281
90413
  }
90282
90414
  else
90283
90415
  {
90284
- this .getBrowser () .sensorEvents () .removeInterest ("update", this);
90416
+ browser .removeAudioNode (this);
90417
+ browser .sensorEvents () .removeInterest ("update", this);
90285
90418
  }
90286
90419
  },
90287
90420
  set_intensity__ ()
@@ -90522,7 +90655,7 @@ function SpatialSound (executionContext)
90522
90655
 
90523
90656
  this .addType (Base_X3DConstants .SpatialSound);
90524
90657
 
90525
- this .addChildObjects (Base_X3DConstants .outputOnly, "traversed", new x_ite_Fields .SFBool (true));
90658
+ this .addChildObjects (Base_X3DConstants .outputOnly, "traversed", new x_ite_Fields .SFBool ());
90526
90659
 
90527
90660
  this .setVisibleObject (true);
90528
90661
 
@@ -90612,19 +90745,23 @@ Object .assign (Object .setPrototypeOf (SpatialSound .prototype, Sound_X3DSoundN
90612
90745
  },
90613
90746
  set_live__ ()
90614
90747
  {
90748
+ const browser = this .getBrowser ();
90749
+
90615
90750
  this .pannerNode .disconnect ();
90616
90751
 
90617
90752
  if (this .getLive () .getValue () && this ._traversed .getValue ())
90618
90753
  {
90619
90754
  const audioContext = this .getBrowser () .getAudioContext ();
90620
90755
 
90621
- this .getBrowser () .sensorEvents () .addInterest ("update", this);
90622
-
90623
90756
  this .pannerNode .connect (audioContext .destination);
90757
+
90758
+ browser .addAudioNode (this);
90759
+ browser .sensorEvents () .addInterest ("update", this);
90624
90760
  }
90625
90761
  else
90626
90762
  {
90627
- this .getBrowser () .sensorEvents () .removeInterest ("update", this);
90763
+ browser .removeAudioNode (this);
90764
+ browser .sensorEvents () .removeInterest ("update", this);
90628
90765
  }
90629
90766
  },
90630
90767
  set_spatialize__ ()
@@ -90728,6 +90865,8 @@ Object .assign (Object .setPrototypeOf (SpatialSound .prototype, Sound_X3DSoundN
90728
90865
 
90729
90866
  for (const childNode of this .childNodes)
90730
90867
  childNode .getAudioSource () .connect (this .gainNode);
90868
+
90869
+ this .setVisibleObject (this .childNodes .length);
90731
90870
  },
90732
90871
  update ()
90733
90872
  {
@@ -90832,11 +90971,10 @@ Object .assign (Object .setPrototypeOf (StreamAudioDestination .prototype, Sound
90832
90971
  {
90833
90972
  return this .mediaStreamAudioDestinationNode;
90834
90973
  },
90835
- set_enabled__ () { /* remove this function if implemented */ },
90974
+ set_enabled__ ()
90975
+ { },
90836
90976
  set_mediaDeviceID__ ()
90837
- {
90838
-
90839
- },
90977
+ { },
90840
90978
  });
90841
90979
 
90842
90980
  Object .defineProperties (StreamAudioDestination,
@@ -91269,8 +91407,8 @@ const PNGMedia_default_ = PNGMedia;
91269
91407
 
91270
91408
  /* harmony default export */ const Texturing_PNGMedia = (x_ite_Namespace .add ("PNGMedia", PNGMedia_default_));
91271
91409
  ;// ./src/x_ite/Components/Texturing/MovieTexture.js
91272
- /* provided dependency */ var SuperGif = __webpack_require__(603);
91273
- /* provided dependency */ var APNG = __webpack_require__(777);
91410
+ /* provided dependency */ var SuperGif = __webpack_require__(143);
91411
+ /* provided dependency */ var APNG = __webpack_require__(701);
91274
91412
 
91275
91413
 
91276
91414
 
@@ -92742,7 +92880,7 @@ Object .assign (Object .setPrototypeOf (X3DBrowser .prototype, Browser_X3DBrowse
92742
92880
  if (profile)
92743
92881
  return profile;
92744
92882
 
92745
- throw Error (`Profile '${name}' is not supported.`);
92883
+ throw new Error (`Profile '${name}' is not supported.`);
92746
92884
  },
92747
92885
  addSupportedProfile: function (profile)
92748
92886
  {
@@ -92786,7 +92924,7 @@ Object .assign (Object .setPrototypeOf (X3DBrowser .prototype, Browser_X3DBrowse
92786
92924
  component .dependencies);
92787
92925
  }
92788
92926
 
92789
- throw Error (`Component '${name}' at level '${level}' is not supported.`);
92927
+ throw new Error (`Component '${name}' at level '${level}' is not supported.`);
92790
92928
  },
92791
92929
  addSupportedComponent (component)
92792
92930
  {
@@ -93908,7 +94046,7 @@ const QuickSort_default_ = QuickSort;
93908
94046
 
93909
94047
  /* harmony default export */ const Algorithms_QuickSort = (x_ite_Namespace .add ("QuickSort", QuickSort_default_));
93910
94048
  ;// ./src/lib/libtess.js
93911
- /* provided dependency */ var libtess_libtess = __webpack_require__(457);
94049
+ /* provided dependency */ var libtess_libtess = __webpack_require__(877);
93912
94050
  const libtess_default_ = libtess_libtess;
93913
94051
  ;
93914
94052