x_ite 16.4.2 → 16.5.0

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 (56) hide show
  1. package/README.md +6 -6
  2. package/dist/assets/components/AnnotationComponent.js +1 -1
  3. package/dist/assets/components/AnnotationComponent.min.js +1 -1
  4. package/dist/assets/components/CADGeometryComponent.js +1 -1
  5. package/dist/assets/components/CADGeometryComponent.min.js +1 -1
  6. package/dist/assets/components/CubeMapTexturingComponent.js +2 -2
  7. package/dist/assets/components/CubeMapTexturingComponent.min.js +2 -2
  8. package/dist/assets/components/DISComponent.js +1 -1
  9. package/dist/assets/components/DISComponent.min.js +1 -1
  10. package/dist/assets/components/EventUtilitiesComponent.js +1 -1
  11. package/dist/assets/components/EventUtilitiesComponent.min.js +1 -1
  12. package/dist/assets/components/GaussianSplatsComponent.js +1 -1
  13. package/dist/assets/components/GaussianSplatsComponent.min.js +1 -1
  14. package/dist/assets/components/Geometry2DComponent.js +1 -1
  15. package/dist/assets/components/Geometry2DComponent.min.js +1 -1
  16. package/dist/assets/components/Geometry3DComponent.js +1 -1
  17. package/dist/assets/components/Geometry3DComponent.min.js +1 -1
  18. package/dist/assets/components/GeospatialComponent.js +1 -1
  19. package/dist/assets/components/GeospatialComponent.min.js +1 -1
  20. package/dist/assets/components/HAnimComponent.js +5 -5
  21. package/dist/assets/components/HAnimComponent.min.js +2 -2
  22. package/dist/assets/components/KeyDeviceSensorComponent.js +1 -1
  23. package/dist/assets/components/KeyDeviceSensorComponent.min.js +1 -1
  24. package/dist/assets/components/LayoutComponent.js +1 -1
  25. package/dist/assets/components/LayoutComponent.min.js +1 -1
  26. package/dist/assets/components/NURBSComponent.js +1 -1
  27. package/dist/assets/components/NURBSComponent.min.js +1 -1
  28. package/dist/assets/components/ParticleSystemsComponent.js +1 -1
  29. package/dist/assets/components/ParticleSystemsComponent.min.js +1 -1
  30. package/dist/assets/components/PickingComponent.js +1 -1
  31. package/dist/assets/components/PickingComponent.min.js +1 -1
  32. package/dist/assets/components/RigidBodyPhysicsComponent.js +1 -1
  33. package/dist/assets/components/RigidBodyPhysicsComponent.min.js +1 -1
  34. package/dist/assets/components/ScriptingComponent.js +3 -3
  35. package/dist/assets/components/ScriptingComponent.min.js +2 -2
  36. package/dist/assets/components/TextComponent.js +1 -1
  37. package/dist/assets/components/TextComponent.min.js +1 -1
  38. package/dist/assets/components/TextureProjectionComponent.js +1 -1
  39. package/dist/assets/components/TextureProjectionComponent.min.js +1 -1
  40. package/dist/assets/components/Texturing3DComponent.js +10 -10
  41. package/dist/assets/components/Texturing3DComponent.min.js +2 -2
  42. package/dist/assets/components/VolumeRenderingComponent.js +1 -1
  43. package/dist/assets/components/VolumeRenderingComponent.min.js +1 -1
  44. package/dist/assets/components/WebXRComponent.js +1 -1
  45. package/dist/assets/components/WebXRComponent.min.js +1 -1
  46. package/dist/assets/components/X_ITEComponent.js +1 -1
  47. package/dist/assets/components/X_ITEComponent.min.js +1 -1
  48. package/dist/example.html +1 -1
  49. package/dist/x_ite.css +1 -1
  50. package/dist/x_ite.d.ts +4 -0
  51. package/dist/x_ite.js +513 -507
  52. package/dist/x_ite.min.js +2 -2
  53. package/dist/x_ite.min.mjs +2 -2
  54. package/dist/x_ite.mjs +513 -507
  55. package/dist/x_ite.zip +0 -0
  56. package/package.json +2 -1
package/dist/x_ite.js CHANGED
@@ -1,4 +1,4 @@
1
- /* X_ITE v16.4.2 */
1
+ /* X_ITE v16.5.0 */
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
- /***/ 8
15
+ /***/ 829
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
- /***/ 618
1020
+ /***/ 247
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
- /***/ 362
2016
+ /***/ 67
2017
2017
  (module) {
2018
2018
 
2019
2019
  /**
@@ -7581,21 +7581,21 @@ Object .assign (Generator .prototype,
7581
7581
 
7582
7582
  return false;
7583
7583
  },
7584
- ImportedName (importedNode)
7584
+ ImportedName (importedNodeInstance)
7585
7585
  {
7586
7586
  const importedNames = this .importedNames .get (this .ExecutionContext ());
7587
7587
 
7588
- if (importedNames .has (importedNode))
7589
- return importedNames .get (importedNode);
7588
+ if (importedNames .has (importedNodeInstance))
7589
+ return importedNames .get (importedNodeInstance);
7590
7590
 
7591
7591
  const
7592
7592
  names = this .names .get (this .ExecutionContext ()),
7593
- newName = getUniqueName (names, importedNode .getImportedName ());
7593
+ newName = getUniqueName (names, importedNodeInstance .getName ());
7594
7594
 
7595
7595
  // Add to indices.
7596
7596
 
7597
7597
  names .add (newName);
7598
- importedNames .set (importedNode, newName);
7598
+ importedNames .set (importedNodeInstance, newName);
7599
7599
 
7600
7600
  return newName;
7601
7601
  },
@@ -7820,7 +7820,7 @@ Object .assign (Object .setPrototypeOf (JSONGenerator .prototype, X3DGenerator .
7820
7820
  },
7821
7821
  RemoveComma ()
7822
7822
  {
7823
- this .string = this .string .replace (/,\s*$/s, "");
7823
+ this .string = this .string .replace (/,\s*$/, "");
7824
7824
  },
7825
7825
  stringProperty (key, value, comma = true)
7826
7826
  {
@@ -8273,14 +8273,14 @@ Object .assign (X3DObject .prototype,
8273
8273
  {
8274
8274
  return this .constructor .typeName;
8275
8275
  },
8276
- setName (value)
8277
- {
8278
- this [_name] = value;
8279
- },
8280
8276
  getName ()
8281
8277
  {
8282
8278
  return this [_name];
8283
8279
  },
8280
+ setName (value)
8281
+ {
8282
+ this [_name] = value;
8283
+ },
8284
8284
  getDisplayName ()
8285
8285
  {
8286
8286
  return this [_name];
@@ -8869,7 +8869,7 @@ const
8869
8869
 
8870
8870
  const handler =
8871
8871
  {
8872
- get (target, key, receiver)
8872
+ get (target, key)
8873
8873
  {
8874
8874
  if (typeof key === "string")
8875
8875
  {
@@ -8879,9 +8879,9 @@ const handler =
8879
8879
  return target [_array] [index];
8880
8880
  }
8881
8881
 
8882
- return Reflect .get (target, key, receiver);
8882
+ return Reflect .get (target, key);
8883
8883
  },
8884
- set (target, key, value, receiver)
8884
+ set (target, key, value)
8885
8885
  {
8886
8886
  if (typeof key === "string")
8887
8887
  {
@@ -8891,7 +8891,7 @@ const handler =
8891
8891
  return false;
8892
8892
  }
8893
8893
 
8894
- return Reflect .set (target, key, value, receiver);
8894
+ return Reflect .set (target, key, value);
8895
8895
  },
8896
8896
  has (target, key)
8897
8897
  {
@@ -14359,16 +14359,16 @@ const
14359
14359
 
14360
14360
  const SFNode_handler =
14361
14361
  {
14362
- get (target, key, receiver)
14362
+ get (target, key)
14363
14363
  {
14364
- if (typeof key === "string")
14364
+ try
14365
14365
  {
14366
- const
14367
- node = target .getValue (),
14368
- field = node ?.getField (key, false);
14369
-
14370
- if (field)
14366
+ if (typeof key === "string")
14371
14367
  {
14368
+ const
14369
+ node = target .getValue (),
14370
+ field = node ?.getField (key);
14371
+
14372
14372
  // Specification conform would be: `accessType & X3DConstants .outputOnly`.
14373
14373
  // However, we also allow read access to initializeOnly fields.
14374
14374
  if (field .getAccessType () === Base_X3DConstants .inputOnly)
@@ -14377,19 +14377,21 @@ const SFNode_handler =
14377
14377
  return field .valueOf ();
14378
14378
  }
14379
14379
  }
14380
+ catch
14381
+ { }
14380
14382
 
14381
- return Reflect .get (target, key, receiver);
14383
+ return Reflect .get (target, key);
14382
14384
  },
14383
- set (target, key, value, receiver)
14385
+ set (target, key, value)
14384
14386
  {
14385
- if (typeof key === "string")
14387
+ try
14386
14388
  {
14387
- const
14388
- node = target .getValue (),
14389
- field = node ?.getField (key, false);
14390
-
14391
- if (field)
14389
+ if (typeof key === "string")
14392
14390
  {
14391
+ const
14392
+ node = target .getValue (),
14393
+ field = node ?.getField (key);
14394
+
14393
14395
  if (field .getAccessType () === Base_X3DConstants .outputOnly)
14394
14396
  return false;
14395
14397
 
@@ -14397,13 +14399,21 @@ const SFNode_handler =
14397
14399
  return true;
14398
14400
  }
14399
14401
  }
14402
+ catch
14403
+ { }
14400
14404
 
14401
- return Reflect .set (target, key, value, receiver);
14405
+ return Reflect .set (target, key, value);
14402
14406
  },
14403
14407
  has (target, key)
14404
14408
  {
14405
- return Boolean (target .getValue () ?.getField (key, false))
14406
- || Reflect .has (target, key);
14409
+ try
14410
+ {
14411
+ return Boolean (target .getValue () ?.getField (key));
14412
+ }
14413
+ catch
14414
+ {
14415
+ return Reflect .has (target, key);
14416
+ }
14407
14417
  },
14408
14418
  ownKeys (target)
14409
14419
  {
@@ -15759,7 +15769,7 @@ const
15759
15769
 
15760
15770
  const X3DObjectArrayField_handler =
15761
15771
  {
15762
- get (target, key, receiver)
15772
+ get (target, key)
15763
15773
  {
15764
15774
  if (typeof key === "string")
15765
15775
  {
@@ -15776,9 +15786,9 @@ const X3DObjectArrayField_handler =
15776
15786
  }
15777
15787
  }
15778
15788
 
15779
- return Reflect .get (target, key, receiver);
15789
+ return Reflect .get (target, key);
15780
15790
  },
15781
- set (target, key, value, receiver)
15791
+ set (target, key, value)
15782
15792
  {
15783
15793
  if (typeof key === "string")
15784
15794
  {
@@ -15797,7 +15807,7 @@ const X3DObjectArrayField_handler =
15797
15807
  }
15798
15808
  }
15799
15809
 
15800
- return Reflect .set (target, key, value, receiver);
15810
+ return Reflect .set (target, key, value);
15801
15811
  },
15802
15812
  has (target, key)
15803
15813
  {
@@ -16284,7 +16294,7 @@ const
16284
16294
 
16285
16295
  const X3DTypedArrayField_handler =
16286
16296
  {
16287
- get (target, key, receiver)
16297
+ get (target, key)
16288
16298
  {
16289
16299
  if (typeof key === "string")
16290
16300
  {
@@ -16314,9 +16324,9 @@ const X3DTypedArrayField_handler =
16314
16324
  }
16315
16325
  }
16316
16326
 
16317
- return Reflect .get (target, key, receiver);
16327
+ return Reflect .get (target, key);
16318
16328
  },
16319
- set (target, key, value, receiver)
16329
+ set (target, key, value)
16320
16330
  {
16321
16331
  if (typeof key === "string")
16322
16332
  {
@@ -16351,7 +16361,7 @@ const X3DTypedArrayField_handler =
16351
16361
  }
16352
16362
  }
16353
16363
 
16354
- return Reflect .set (target, key, value, receiver);
16364
+ return Reflect .set (target, key, value);
16355
16365
  },
16356
16366
  has (target, key)
16357
16367
  {
@@ -18444,7 +18454,7 @@ Object .assign (Object .setPrototypeOf (X3DBaseNode .prototype, Base_X3DChildObj
18444
18454
  {
18445
18455
  return this [_fieldDefinitions];
18446
18456
  },
18447
- getField (name, _throw = true)
18457
+ getField (name)
18448
18458
  {
18449
18459
  const field = getFieldFromArray (this [_userDefinedFields], name)
18450
18460
  ?? getFieldFromArray (this [_predefinedFields], name);
@@ -18452,8 +18462,7 @@ Object .assign (Object .setPrototypeOf (X3DBaseNode .prototype, Base_X3DChildObj
18452
18462
  if (field)
18453
18463
  return field;
18454
18464
 
18455
- if (_throw)
18456
- throw new Error (`Unknown field '${name}' in node class ${this .getTypeName ()}.`);
18465
+ throw new Error (`Unknown field '${name}' in node class ${this .getTypeName ()}.`);
18457
18466
  },
18458
18467
  getFields ()
18459
18468
  {
@@ -18885,7 +18894,7 @@ const Legacy_default_ = Legacy;
18885
18894
 
18886
18895
  /* harmony default export */ const Browser_Legacy = (x_ite_Namespace .add ("Legacy", Legacy_default_));
18887
18896
  ;// ./src/x_ite/BROWSER_VERSION.js
18888
- const BROWSER_VERSION_default_ = "16.4.2";
18897
+ const BROWSER_VERSION_default_ = "16.5.0";
18889
18898
  ;
18890
18899
 
18891
18900
  /* harmony default export */ const BROWSER_VERSION = (x_ite_Namespace .add ("BROWSER_VERSION", BROWSER_VERSION_default_));
@@ -21398,6 +21407,7 @@ const URLs_default_ = URLs;
21398
21407
 
21399
21408
 
21400
21409
 
21410
+
21401
21411
  const _metaDataCallbacks = Symbol ();
21402
21412
 
21403
21413
  function X3DNode (executionContext)
@@ -21447,17 +21457,19 @@ Object .assign (Object .setPrototypeOf (X3DNode .prototype, Base_X3DBaseNode .pr
21447
21457
  else
21448
21458
  {
21449
21459
  // Make a copy for a X3DPrototypeInstance.
21450
-
21460
+
21451
21461
  const executionContext = instance .getBody ();
21452
21462
 
21453
21463
  // First try to get a named node with the node's name.
21454
21464
 
21455
- if (this .getName () .length)
21465
+ if (this .getName ())
21456
21466
  {
21457
- const namedNode = executionContext .getNamedNodes () .get (this .getName ());
21458
-
21459
- if (namedNode)
21460
- return namedNode .getValue ();
21467
+ try
21468
+ {
21469
+ return executionContext .getLocalNode (this .getName ()) .getValue ();
21470
+ }
21471
+ catch
21472
+ { }
21461
21473
  }
21462
21474
 
21463
21475
  // Create copy.
@@ -21468,7 +21480,7 @@ Object .assign (Object .setPrototypeOf (X3DNode .prototype, Base_X3DBaseNode .pr
21468
21480
  if (this .getNeedsName ())
21469
21481
  this .getExecutionContext () .updateNamedNode (this .getExecutionContext () .getUniqueName (), this);
21470
21482
 
21471
- if (this .getName () .length)
21483
+ if (this .getName ())
21472
21484
  executionContext .updateNamedNode (this .getName (), copy);
21473
21485
 
21474
21486
  // Default fields
@@ -21569,7 +21581,7 @@ Object .assign (Object .setPrototypeOf (X3DNode .prototype, Base_X3DBaseNode .pr
21569
21581
  },
21570
21582
  getNeedsName ()
21571
21583
  {
21572
- if (this .getName () .length)
21584
+ if (this .getName ())
21573
21585
  return false;
21574
21586
 
21575
21587
  if (this .getCloneCount () > 1)
@@ -22295,7 +22307,7 @@ Object .assign (Object .setPrototypeOf (X3DNode .prototype, Base_X3DBaseNode .pr
22295
22307
  if (cdata ?.length === 0)
22296
22308
  cdata = null;
22297
22309
 
22298
- if (!cdata ?.some (string => string .match (/^\s*(?:data|ecmascript|javascript|vrmlscript):/s)))
22310
+ if (!cdata ?.some (string => string .match (/^\s*(?:data|ecmascript|javascript|vrmlscript):/)))
22299
22311
  cdata = null;
22300
22312
 
22301
22313
  generator .IncIndent ();
@@ -22574,7 +22586,7 @@ Object .assign (Object .setPrototypeOf (X3DNode .prototype, Base_X3DBaseNode .pr
22574
22586
  if (sourceText ?.length !== 1)
22575
22587
  sourceText = null;
22576
22588
 
22577
- if (!sourceText ?.some (string => string .match (/^\s*(?:data|ecmascript|javascript|vrmlscript):/s)))
22589
+ if (!sourceText ?.some (string => string .match (/^\s*(?:data|ecmascript|javascript|vrmlscript):/)))
22578
22590
  sourceText = null;
22579
22591
 
22580
22592
  // Predefined fields
@@ -22793,22 +22805,47 @@ Object .assign (Object .setPrototypeOf (X3DNode .prototype, Base_X3DBaseNode .pr
22793
22805
 
22794
22806
  if (executionContext .isScene)
22795
22807
  {
22796
- // Remove exported node if any.
22808
+ // Collect imported nodes in parent context.
22809
+ // This must be done before the exported nodes are removed.
22810
+
22811
+ const
22812
+ parentContext = executionContext .getExecutionContext (),
22813
+ importedNodes = [ ];
22814
+
22815
+ if (parentContext)
22816
+ {
22817
+ for (const importedNode of parentContext .getImportedNodes ())
22818
+ {
22819
+ if (helper.try (() => importedNode .getExportedNode ()) === this)
22820
+ importedNodes .push (importedNode);
22821
+ }
22822
+ }
22823
+
22824
+ // Remove exported nodes if any.
22797
22825
 
22798
22826
  for (const exportedNode of Array .from (executionContext .getExportedNodes ()))
22799
22827
  {
22800
- if (exportedNode .getLocalNode () === this)
22801
- executionContext .removeExportedNode (exportedNode .getExportedName ());
22828
+ if (exportedNode .getLocalNode () !== this)
22829
+ continue;
22830
+
22831
+ executionContext .removeExportedNode (exportedNode .getExportedName ());
22802
22832
  }
22803
22833
 
22804
- // Remove imported node if any.
22834
+ // Update imported node instances in parent context if any.
22835
+ // This must be done after the exported nodes are removed.
22805
22836
 
22806
- const parentContext = executionContext .getExecutionContext ();
22837
+ for (const importedNode of importedNodes)
22838
+ importedNode .getInstance () .update ();
22807
22839
 
22808
- if (parentContext)
22840
+ // Update routes after the exported nodes are removed.
22841
+
22842
+ for (const field of this .getFields ())
22809
22843
  {
22810
- for (const importedNode of parentContext .getImportedNodes ())
22811
- importedNode .getExportedNode () .update ();
22844
+ for (const route of Array .from (field .getInputRoutes ()))
22845
+ route .reconnect ();
22846
+
22847
+ for (const route of Array .from (field .getOutputRoutes ()))
22848
+ route .reconnect ();
22812
22849
  }
22813
22850
  }
22814
22851
 
@@ -23953,146 +23990,66 @@ const NamedNodesArray_default_ = NamedNodesArray;
23953
23990
  ;
23954
23991
 
23955
23992
  /* harmony default export */ const Execution_NamedNodesArray = (x_ite_Namespace .add ("NamedNodesArray", NamedNodesArray_default_));
23956
- ;// ./src/x_ite/Components/Core/X3DImportedNodeProxy.js
23957
-
23958
-
23959
-
23960
-
23961
-
23962
- const
23963
- _importedName = Symbol (),
23964
- _importedNode = Symbol (),
23965
- X3DImportedNodeProxy_type = Symbol (),
23966
- _functions = Symbol ();
23967
-
23968
- const X3DImportedNodeProxy_handler =
23969
- {
23970
- get (target, key, receiver)
23971
- {
23972
- if (Reflect .has (target, key))
23973
- return Reflect .get (target, key, receiver);
23974
-
23975
- const node = target .getSharedNode ();
23976
-
23977
- if (node)
23978
- {
23979
- const property = Reflect .get (node, key, receiver);
23993
+ ;// ./src/x_ite/Components/Core/X3DImportedNodeInstance.js
23980
23994
 
23981
- if (typeof property === "function")
23982
- {
23983
- return target [_functions] .get (key) ?? (() =>
23984
- {
23985
- const func = property .bind (node);
23986
23995
 
23987
- target [_functions] .set (key, func);
23988
23996
 
23989
- return func;
23990
- })();
23991
- }
23992
23997
 
23993
- return property;
23994
- }
23995
- },
23996
- set (target, key, value, receiver)
23997
- {
23998
- if (Reflect .has (target, key))
23999
- {
24000
- return Reflect .set (target, key, value, receiver);
24001
- }
24002
- else
24003
- {
24004
- const node = target .getSharedNode ();
24005
-
24006
- if (node)
24007
- return Reflect .set (node, key, value, receiver);
24008
23998
 
24009
- return false;
24010
- }
24011
- },
24012
- has (target, key)
24013
- {
24014
- return Reflect .has (target, key)
24015
- || Reflect .has (target .getSharedNode () ?? { }, key);
24016
- },
24017
- ownKeys (target)
24018
- {
24019
- return Array .from (new Set (Reflect .ownKeys (target)
24020
- .concat (Reflect .ownKeys (target .getSharedNode () ?? { }))));
24021
- },
24022
- getOwnPropertyDescriptor (target, key)
24023
- {
24024
- return Reflect .getOwnPropertyDescriptor (target, key)
24025
- ?? Reflect .getOwnPropertyDescriptor (target .getSharedNode () ?? { }, key);
24026
- },
24027
- };
23999
+ const _importedNode = Symbol ();
24028
24000
 
24029
- function X3DImportedNodeProxy (executionContext, importedName, type)
24001
+ function X3DImportedNodeInstance (executionContext, importedNode)
24030
24002
  {
24031
24003
  Core_X3DNode .call (this, executionContext);
24032
24004
 
24033
- const proxy = new Proxy (this, X3DImportedNodeProxy_handler);
24005
+ this .addType (Base_X3DConstants .X3DImportedNodeInstance);
24034
24006
 
24035
- this [_importedName] = importedName;
24036
- this [X3DImportedNodeProxy_type] = type;
24037
- this [_functions] = new Map ();
24038
-
24039
- this .setup ();
24007
+ // Private properties
24040
24008
 
24041
- return proxy;
24009
+ this [_importedNode] = importedNode;
24042
24010
  }
24043
24011
 
24044
- Object .assign (Object .setPrototypeOf (X3DImportedNodeProxy .prototype, Core_X3DNode .prototype),
24012
+ Object .assign (Object .setPrototypeOf (X3DImportedNodeInstance .prototype, Core_X3DNode .prototype),
24045
24013
  {
24046
24014
  initialize ()
24047
24015
  {
24048
24016
  Core_X3DNode .prototype .initialize .call (this);
24049
24017
 
24050
- this .getExecutionContext () .importedNodes .addInterest ("update", this);
24018
+ this [_importedNode] .getInlineNode () ._loadState .addInterest ("update", this);
24051
24019
 
24052
24020
  this .update ();
24053
24021
  },
24054
- getExtendedEventHandling ()
24022
+ update ()
24055
24023
  {
24056
- return false;
24024
+ if (this [_importedNode] .getInlineNode () .checkLoadState () === Base_X3DConstants .COMPLETE_STATE)
24025
+ helper.try (() => this [_importedNode] .getExportedNode ()) ?.addInterest ("addNodeEvent", this);
24026
+
24027
+ this ._typeName_changed ?.setValue (Date .now () / 1000);
24028
+
24029
+ Base_X3DChildObject .prototype .addEvent .call (this);
24057
24030
  },
24058
- setTypeHint (value)
24031
+ getExtendedEventHandling ()
24059
24032
  {
24060
- this [X3DImportedNodeProxy_type] ??= value;
24033
+ return false;
24061
24034
  },
24062
- getSharedNode ()
24035
+ getInnerNode ()
24063
24036
  {
24064
- return helper.try (() => this [_importedNode] .getSharedNode ()) ?? null;
24037
+ return this [_importedNode] .getExportedNode () .getInnerNode ();
24065
24038
  },
24066
24039
  getImportedNode ()
24067
24040
  {
24068
24041
  return this [_importedNode];
24069
24042
  },
24070
- getInnerNode ()
24071
- {
24072
- return this [_importedNode] .getSharedNode () .getInnerNode ();
24073
- },
24074
24043
  getName ()
24075
24044
  {
24076
- return this [_importedName];
24077
- },
24078
- setName (value)
24079
- {
24080
- this [_importedName] = value;
24081
-
24082
- this ._name_changed ?.setValue (Date .now () / 1000);
24045
+ return this [_importedNode] .getImportedName ();
24083
24046
  },
24084
24047
  ... Object .fromEntries ([
24085
- ["getComponentInfo", "componentInfo"],
24086
- ["getContainerField", "containerField"],
24087
- ["getSpecificationRange", "specificationRange"],
24088
- ["getTypeName", "typeName"],
24089
- ]
24090
- .map (([fn, property]) => [fn, function ()
24091
- {
24092
- return this .getSharedNode () ?.[fn] () ?? this .constructor [property];
24093
- }])),
24094
- ... Object .fromEntries ([
24048
+ "getTypeName",
24095
24049
  "getType",
24050
+ "getComponentInfo",
24051
+ "getContainerField",
24052
+ "getSpecificationRange",
24096
24053
  "getFieldDefinitions",
24097
24054
  "getPredefinedField",
24098
24055
  "getPredefinedFields",
@@ -24106,36 +24063,15 @@ Object .assign (Object .setPrototypeOf (X3DImportedNodeProxy .prototype, Core_X3
24106
24063
  ]
24107
24064
  .map (fn => [fn, function (... args)
24108
24065
  {
24109
- return this .getSharedNode () ?.[fn] (... args) ?? Core_X3DNode .prototype [fn] .call (this, ... args);
24066
+ return helper.try (() => this [_importedNode] .getExportedNode ()) ?.[fn] (... args)
24067
+ ?? Core_X3DNode .prototype [fn] .call (this, ... args);
24110
24068
  }])),
24111
- update ()
24112
- {
24113
- const importedNode = this .getExecutionContext () .getImportedNodes () .get (this [_importedName])
24114
- ?? null;
24115
-
24116
- this [_importedNode] ?.getInlineNode () ._loadState .removeInterest ("set_loadState__", this);
24117
-
24118
- this [_importedNode] = importedNode;
24119
-
24120
- this [_importedNode] ?.getInlineNode () ._loadState .addInterest ("set_loadState__", this);
24121
-
24122
- this .set_loadState__ ();
24123
- },
24124
- set_loadState__ ()
24125
- {
24126
- if (this [_importedNode] ?.getInlineNode () .checkLoadState () === Base_X3DConstants .COMPLETE_STATE)
24127
- this [X3DImportedNodeProxy_type] = this .getSharedNode () ?.constructor ?? this [X3DImportedNodeProxy_type];
24128
-
24129
- this ._typeName_changed ?.setValue (Date .now () / 1000);
24130
-
24131
- Base_X3DChildObject .prototype .addEvent .call (this);
24132
- },
24133
24069
  toVRMLStream (generator)
24134
24070
  {
24135
24071
  generator .CheckSpace ();
24136
24072
  generator .string += "USE";
24137
24073
  generator .Space ();
24138
- generator .string += this [_importedName];
24074
+ generator .string += this [_importedNode] .getImportedName ();
24139
24075
  generator .NeedsSpace ();
24140
24076
  },
24141
24077
  toXMLStream (generator)
@@ -24145,36 +24081,48 @@ Object .assign (Object .setPrototypeOf (X3DImportedNodeProxy .prototype, Core_X3
24145
24081
  if (generator .html && this .getTypeName () === "Script")
24146
24082
  generator .attribute ("type", "model/x3d+xml");
24147
24083
 
24148
- generator .attribute ("USE", this [_importedName]);
24084
+ generator .attribute ("USE", this [_importedNode] .getImportedName ());
24149
24085
  generator .containerField (this .getContainerField ());
24150
24086
  generator .closeTag (this .getTypeName ());
24151
24087
  },
24152
24088
  toJSONStream (generator)
24153
24089
  {
24154
24090
  generator .beginObject (this .getTypeName (), false, true);
24155
- generator .stringProperty ("@USE", this [_importedName], false);
24091
+ generator .stringProperty ("@USE", this [_importedNode] .getImportedName (), false);
24156
24092
  generator .endObject ();
24157
24093
  generator .endObject ();
24158
24094
  },
24159
- });
24160
-
24161
- Object .defineProperties (X3DImportedNodeProxy .prototype,
24162
- {
24163
- constructor:
24095
+ dispose ()
24164
24096
  {
24165
- get ()
24097
+ const executionContext = this .getExecutionContext ();
24098
+
24099
+ for (const route of Array .from (executionContext .getRoutes ()))
24166
24100
  {
24167
- return this [X3DImportedNodeProxy_type] ?? Core_X3DNode;
24168
- },
24169
- }
24101
+ if (route .getSourceNode () === this)
24102
+ {
24103
+ executionContext .deleteRoute (route);
24104
+ continue;
24105
+ }
24106
+
24107
+ if (route .getDestinationNode () === this)
24108
+ {
24109
+ executionContext .deleteRoute (route);
24110
+ continue;
24111
+ }
24112
+ }
24113
+
24114
+ this .getImportedNode () .refreshInstance ();
24115
+
24116
+ Core_X3DNode .prototype .dispose .call (this);
24117
+ },
24170
24118
  });
24171
24119
 
24172
- Object .defineProperties (X3DImportedNodeProxy, Core_X3DNode .getStaticProperties ("X3DImportedNodeProxy", "Core", 2, "children", "4.1"));
24120
+ Object .defineProperties (X3DImportedNodeInstance, Core_X3DNode .getStaticProperties ("X3DImportedNodeInstance", "Core", 2, "children", "4.1"));
24173
24121
 
24174
- const X3DImportedNodeProxy_default_ = X3DImportedNodeProxy;
24122
+ const X3DImportedNodeInstance_default_ = X3DImportedNodeInstance;
24175
24123
  ;
24176
24124
 
24177
- /* harmony default export */ const Core_X3DImportedNodeProxy = (x_ite_Namespace .add ("X3DImportedNodeProxy", X3DImportedNodeProxy_default_));
24125
+ /* harmony default export */ const Core_X3DImportedNodeInstance = (x_ite_Namespace .add ("X3DImportedNodeInstance", X3DImportedNodeInstance_default_));
24178
24126
  ;// ./src/x_ite/Execution/X3DImportedNode.js
24179
24127
 
24180
24128
 
@@ -24184,20 +24132,23 @@ const
24184
24132
  X3DImportedNode_executionContext = Symbol (),
24185
24133
  _inlineNode = Symbol (),
24186
24134
  _exportedName = Symbol (),
24187
- X3DImportedNode_importedName = Symbol (),
24188
- _description = Symbol (),
24189
- _exportedNodes = Symbol ();
24135
+ _importedName = Symbol (),
24136
+ _instance = Symbol (),
24137
+ _description = Symbol ();
24190
24138
 
24191
24139
  function X3DImportedNode (executionContext, inlineNode, exportedName, importedName, description)
24192
24140
  {
24193
24141
  Base_X3DObject .call (this);
24194
24142
 
24143
+ // Private properties
24144
+
24195
24145
  this [X3DImportedNode_executionContext] = executionContext;
24196
24146
  this [_inlineNode] = inlineNode;
24197
24147
  this [_exportedName] = exportedName;
24198
- this [X3DImportedNode_importedName] = importedName;
24148
+ this [_importedName] = importedName;
24199
24149
  this [_description] = description;
24200
- this [_exportedNodes] = executionContext [_exportedNodes] ??= new Map ();
24150
+
24151
+ this .refreshInstance ();
24201
24152
  }
24202
24153
 
24203
24154
  Object .assign (Object .setPrototypeOf (X3DImportedNode .prototype, Base_X3DObject .prototype),
@@ -24214,27 +24165,7 @@ Object .assign (Object .setPrototypeOf (X3DImportedNode .prototype, Base_X3DObje
24214
24165
  {
24215
24166
  return this [_exportedName];
24216
24167
  },
24217
- getExportedNode (type)
24218
- {
24219
- const exportedNode = this [_exportedNodes] .get (this [X3DImportedNode_importedName]);
24220
-
24221
- exportedNode ?.setTypeHint (type);
24222
-
24223
- return exportedNode ?? this .createExportedNode (type);
24224
- },
24225
- createExportedNode (type)
24226
- {
24227
- const exportedNode = new Core_X3DImportedNodeProxy (this .getExecutionContext (), this [X3DImportedNode_importedName], type);
24228
-
24229
- this [_exportedNodes] .set (this [X3DImportedNode_importedName], exportedNode);
24230
-
24231
- return exportedNode;
24232
- },
24233
- updateExportedNode ()
24234
- {
24235
- this [_exportedNodes] .get (this [X3DImportedNode_importedName]) ?.update ();
24236
- },
24237
- getSharedNode ()
24168
+ getExportedNode ()
24238
24169
  {
24239
24170
  const exportedNode = this .getInlineNode () .getInternalScene () .getExportedNodes () .get (this [_exportedName]);
24240
24171
 
@@ -24245,20 +24176,26 @@ Object .assign (Object .setPrototypeOf (X3DImportedNode .prototype, Base_X3DObje
24245
24176
  },
24246
24177
  getImportedName ()
24247
24178
  {
24248
- return this [X3DImportedNode_importedName];
24179
+ return this [_importedName];
24249
24180
  },
24250
- [Symbol .for ("X_ITE.X3DImportedNode.setImportName")] (importedName)
24181
+ setImportName (importedName)
24251
24182
  {
24252
- const
24253
- exportedNode = this .getExportedNode (),
24254
- exportedNodes = this [_exportedNodes];
24183
+ this [_instance] .setName (importedName);
24255
24184
 
24256
- exportedNodes .delete (this [X3DImportedNode_importedName]);
24257
- exportedNodes .set (importedName, exportedNode);
24185
+ this [_importedName] = importedName;
24186
+ },
24187
+ getInstance ()
24188
+ {
24189
+ return this [_instance];
24190
+ },
24191
+ refreshInstance ()
24192
+ {
24193
+ if (this [_instance] && !this [X3DImportedNode_executionContext] .getImportedNodes () .has (this [_importedName]))
24194
+ return;
24258
24195
 
24259
- this [X3DImportedNode_importedName] = importedName;
24196
+ this [_instance] = new Core_X3DImportedNodeInstance (this [X3DImportedNode_executionContext], this);
24260
24197
 
24261
- exportedNode .setName (importedName);
24198
+ this [_instance] .setup ();
24262
24199
  },
24263
24200
  getDescription ()
24264
24201
  {
@@ -24273,9 +24210,9 @@ Object .assign (Object .setPrototypeOf (X3DImportedNode .prototype, Base_X3DObje
24273
24210
  if (!generator .ExistsNode (this .getInlineNode ()))
24274
24211
  throw new Error ("X3DImportedNode.toVRMLStream: Inline node does not exist.");
24275
24212
 
24276
- generator .AddRouteNode (this);
24213
+ generator .AddRouteNode (this .getInstance ());
24277
24214
 
24278
- const importedName = generator .ImportedName (this);
24215
+ const importedName = generator .ImportedName (this .getInstance ());
24279
24216
 
24280
24217
  generator .Indent ();
24281
24218
  generator .string += "IMPORT";
@@ -24307,9 +24244,9 @@ Object .assign (Object .setPrototypeOf (X3DImportedNode .prototype, Base_X3DObje
24307
24244
  if (!generator .ExistsNode (this .getInlineNode ()))
24308
24245
  throw new Error ("X3DImportedNode.toXMLStream: Inline node does not exist.");
24309
24246
 
24310
- generator .AddRouteNode (this);
24247
+ generator .AddRouteNode (this .getInstance ());
24311
24248
 
24312
- const importedName = generator .ImportedName (this);
24249
+ const importedName = generator .ImportedName (this .getInstance ());
24313
24250
 
24314
24251
  generator .openTag ("IMPORT");
24315
24252
  generator .attribute ("inlineDEF", generator .Name (this .getInlineNode ()));
@@ -24331,12 +24268,12 @@ Object .assign (Object .setPrototypeOf (X3DImportedNode .prototype, Base_X3DObje
24331
24268
  generator .TidyBreak ();
24332
24269
  generator .Indent ();
24333
24270
 
24334
- generator .AddRouteNode (this);
24271
+ generator .AddRouteNode (this .getInstance ());
24335
24272
  generator .beginObject ("IMPORT", false, true);
24336
24273
  generator .stringProperty ("@inlineDEF", generator .Name (this .getInlineNode ()), false);
24337
24274
  generator .stringProperty ("@importedDEF", this .getExportedName ());
24338
24275
 
24339
- const importedName = generator .ImportedName (this);
24276
+ const importedName = generator .ImportedName (this .getInstance ());
24340
24277
 
24341
24278
  if (importedName !== this .getExportedName ())
24342
24279
  generator .stringProperty ("@AS", importedName);
@@ -24349,20 +24286,9 @@ Object .assign (Object .setPrototypeOf (X3DImportedNode .prototype, Base_X3DObje
24349
24286
  },
24350
24287
  dispose ()
24351
24288
  {
24352
- for (const route of Array .from (this [X3DImportedNode_executionContext] .getRoutes ()))
24353
- {
24354
- if (route .getSourceNode () === this)
24355
- {
24356
- this [X3DImportedNode_executionContext] .deleteRoute (route);
24357
- continue;
24358
- }
24289
+ this [X3DImportedNode_executionContext] .removeImportedNode (this [_importedName]);
24359
24290
 
24360
- if (route .getDestinationNode () === this)
24361
- {
24362
- this [X3DImportedNode_executionContext] .deleteRoute (route);
24363
- continue;
24364
- }
24365
- }
24291
+ this .instance .dispose ();
24366
24292
 
24367
24293
  Base_X3DObject .prototype .dispose .call (this);
24368
24294
  },
@@ -24399,6 +24325,14 @@ Object .defineProperties (X3DImportedNode .prototype,
24399
24325
  get: X3DImportedNode .prototype .getImportedName,
24400
24326
  enumerable: true,
24401
24327
  },
24328
+ instance:
24329
+ {
24330
+ get ()
24331
+ {
24332
+ return Fields_SFNodeCache .get (this .getInstance ());
24333
+ },
24334
+ enumerable: true,
24335
+ },
24402
24336
  description:
24403
24337
  {
24404
24338
  get: X3DImportedNode .prototype .getDescription,
@@ -24760,11 +24694,14 @@ Object .assign (Object .setPrototypeOf (X3DPrototypeInstance .prototype, Core_X3
24760
24694
 
24761
24695
  this .set_live__ ();
24762
24696
 
24763
- this .importExternProtos (proto .getBody () .externprotos);
24764
- this .importProtos (proto .getBody () .protos);
24765
- this .copyRootNodes (proto .getBody () .rootNodes);
24766
- this .importImportedNodes (proto .getBody () .importedNodes);
24767
- this .copyRoutes (proto .getBody () .routes);
24697
+ const protoBody = proto .getBody ();
24698
+
24699
+ this .addExternProtos (protoBody .externprotos);
24700
+ this .addProtos (protoBody .protos);
24701
+ this .copyNamedNodes (protoBody .namedNodes);
24702
+ this .copyImportedNodes (protoBody .importedNodes);
24703
+ this .copyRootNodes (protoBody .rootNodes);
24704
+ this .copyRoutes (protoBody .routes);
24768
24705
 
24769
24706
  // Propagate events.
24770
24707
 
@@ -25024,20 +24961,25 @@ Object .assign (Object .setPrototypeOf (X3DPrototypeInstance .prototype, Core_X3
25024
24961
 
25025
24962
  return Core_X3DNode .prototype .isDefaultValue .call (this, field);
25026
24963
  },
25027
- importExternProtos (externprotos1)
24964
+ addExternProtos (externprotos1)
25028
24965
  {
25029
24966
  const externprotos2 = this [_body] .externprotos;
25030
24967
 
25031
24968
  for (const externproto of externprotos1)
25032
24969
  externprotos2 .add (externproto .getName (), externproto);
25033
24970
  },
25034
- importProtos (protos1)
24971
+ addProtos (protos1)
25035
24972
  {
25036
24973
  const protos2 = this [_body] .protos;
25037
24974
 
25038
24975
  for (const proto of protos1)
25039
24976
  protos2 .add (proto .getName (), proto);
25040
24977
  },
24978
+ copyNamedNodes (namedNodes)
24979
+ {
24980
+ for (const node of namedNodes)
24981
+ node .copy (this);
24982
+ },
25041
24983
  copyRootNodes (rootNodes1)
25042
24984
  {
25043
24985
  const rootNodes2 = this [_body] .getRootNodes ();
@@ -25045,15 +24987,17 @@ Object .assign (Object .setPrototypeOf (X3DPrototypeInstance .prototype, Core_X3
25045
24987
  for (const node of rootNodes1 .getValue ())
25046
24988
  rootNodes2 .push (node .copy (this));
25047
24989
  },
25048
- importImportedNodes (importedNodes)
24990
+ copyImportedNodes (importedNodes)
25049
24991
  {
24992
+ const body = this [_body];
24993
+
25050
24994
  for (const importedNode of importedNodes)
25051
24995
  {
25052
24996
  try
25053
24997
  {
25054
- const inlineNode = this [_body] .getNamedNode (importedNode .getInlineNode () .getName ());
24998
+ const inlineNode = body .getNamedNode (importedNode .getInlineNode () .getName ());
25055
24999
 
25056
- this [_body] .addImportedNode (inlineNode, importedNode .getExportedName (), importedNode .getImportedName ());
25000
+ body .addImportedNode (inlineNode, importedNode .getExportedName (), importedNode .getImportedName ());
25057
25001
  }
25058
25002
  catch (error)
25059
25003
  {
@@ -25063,19 +25007,17 @@ Object .assign (Object .setPrototypeOf (X3DPrototypeInstance .prototype, Core_X3
25063
25007
  },
25064
25008
  copyRoutes (routes)
25065
25009
  {
25010
+ const body = this [_body];
25011
+
25066
25012
  for (const route of routes)
25067
25013
  {
25068
25014
  try
25069
25015
  {
25070
- const sourceNode = route .getSourceNode () instanceof Core_X3DNode
25071
- ? this [_body] .getLocalNode (route .getSourceNode () .getName ())
25072
- : this [_body] .getLocalNode (route .getSourceNode () .getImportedName ());
25073
-
25074
- const destinationNode = route .getDestinationNode () instanceof Core_X3DNode
25075
- ? this [_body] .getLocalNode (route .getDestinationNode () .getName ())
25076
- : this [_body] .getLocalNode (route .getDestinationNode () .getImportedName ());
25016
+ const
25017
+ sourceNode = body .getLocalNode (route .getSourceNode () .getName ()),
25018
+ destinationNode = body .getLocalNode (route .getDestinationNode () .getName ());
25077
25019
 
25078
- this [_body] .addRoute (sourceNode, route .sourceField, destinationNode, route .destinationField);
25020
+ body .addRoute (sourceNode, route .sourceField, destinationNode, route .destinationField);
25079
25021
  }
25080
25022
  catch (error)
25081
25023
  {
@@ -26027,6 +25969,11 @@ Object .assign (X3DParser .prototype,
26027
25969
 
26028
25970
  return values;
26029
25971
  },
25972
+ checkColorName (color, name)
25973
+ {
25974
+ if (color .every (v => v === 1) && name .toLowerCase () !== "white" && name .match (/^[a-zA-Z]+$/))
25975
+ throw new Error ("Invalid color name.");
25976
+ },
26030
25977
  sanitizeName (name = "")
26031
25978
  {
26032
25979
  // NonIdFirstChar
@@ -26230,7 +26177,7 @@ class Placeholder extends Core_X3DNode
26230
26177
  localNode = this .#namedNodes .get (name) ?? this .#importedNodes .get (name);
26231
26178
 
26232
26179
  const node = localNode instanceof Execution_X3DImportedNode
26233
- ? localNode .getExportedNode (this .#type)
26180
+ ? localNode .getInstance ()
26234
26181
  : localNode;
26235
26182
 
26236
26183
  if (node)
@@ -26340,7 +26287,7 @@ const Grammar = Parser_Expressions ({
26340
26287
 
26341
26288
  // Values
26342
26289
  int32: /(?:0[xX][\da-fA-F]+)|(?:[+-]?\d+)/y,
26343
- double: /[+-]?(?:(?:(?:\d*\.\d+)|(?:\d+(?:\.)?))(?:[eE][+-]?\d+)?)/y,
26290
+ double: /(?!0[xX])[+-]?(?:(?:(?:\d*\.\d+)|(?:\d+(?:\.)?))(?:[eE][+-]?\d+)?)/y,
26344
26291
  doubleQuotes: /"/y,
26345
26292
  noDoubleQuotes: /[^"]+/y,
26346
26293
 
@@ -26442,6 +26389,9 @@ Object .assign (Object .setPrototypeOf (VRMLParser .prototype, Parser_X3DParser
26442
26389
  }
26443
26390
  catch (error)
26444
26391
  {
26392
+ if (DEVELOPMENT)
26393
+ console .error (error);
26394
+
26445
26395
  throw new Error (this .getError (error), { cause: error });
26446
26396
  }
26447
26397
  },
@@ -26595,6 +26545,9 @@ Object .assign (Object .setPrototypeOf (VRMLParser .prototype, Parser_X3DParser
26595
26545
  }
26596
26546
  catch (error)
26597
26547
  {
26548
+ if (DEVELOPMENT)
26549
+ console .error (error);
26550
+
26598
26551
  throw new Error (this .getError (error), { cause: error });
26599
26552
  }
26600
26553
  })
@@ -26949,11 +26902,7 @@ Object .assign (Object .setPrototypeOf (VRMLParser .prototype, Parser_X3DParser
26949
26902
 
26950
26903
  try
26951
26904
  {
26952
- const localNode = this .getExecutionContext () .getLocalNode (nodeNameId);
26953
-
26954
- return localNode instanceof Execution_X3DImportedNode
26955
- ? localNode .getExportedNode ()
26956
- : localNode .getValue ();
26905
+ return this .getExecutionContext () .getLocalNode (nodeNameId) .getValue ();
26957
26906
  }
26958
26907
  catch
26959
26908
  {
@@ -27994,7 +27943,9 @@ Object .assign (Object .setPrototypeOf (VRMLParser .prototype, Parser_X3DParser
27994
27943
 
27995
27944
  if (Grammar .HTMLColor .parse (this))
27996
27945
  {
27997
- const color = this .convertColor (this .result [0] .replace (/0x/i, "#"));
27946
+ const color = this .convertColor (this .result [0] .replace (/^0x/i, "#"));
27947
+
27948
+ this .checkColorName (color, this .result [0]);
27998
27949
 
27999
27950
  field .r = color [0];
28000
27951
  field .g = color [1];
@@ -28027,12 +27978,28 @@ Object .assign (Object .setPrototypeOf (VRMLParser .prototype, Parser_X3DParser
28027
27978
 
28028
27979
  return false;
28029
27980
  },
27981
+ sfColor: new x_ite_Fields .SFColor (),
28030
27982
  sfcolorValues (field)
28031
27983
  {
28032
27984
  const array = [ ];
28033
27985
 
28034
- while (this .double ())
28035
- array .push (this .value);
27986
+ for (;;)
27987
+ {
27988
+ if (this .double ())
27989
+ {
27990
+ array .push (this .value);
27991
+ continue;
27992
+ }
27993
+
27994
+ // Try parse HTML/CSS color values.
27995
+ if (this .sfcolorValue (this .sfColor))
27996
+ {
27997
+ array .push (... this .sfColor);
27998
+ continue;
27999
+ }
28000
+
28001
+ break;
28002
+ }
28036
28003
 
28037
28004
  field .setValue (array);
28038
28005
 
@@ -28075,7 +28042,9 @@ Object .assign (Object .setPrototypeOf (VRMLParser .prototype, Parser_X3DParser
28075
28042
 
28076
28043
  if (Grammar .HTMLColor .parse (this))
28077
28044
  {
28078
- const color = this .convertColor (this .result [0] .replace (/0x/i, "#"));
28045
+ const color = this .convertColor (this .result [0] .replace (/^0x/i, "#"));
28046
+
28047
+ this .checkColorName (color, this .result [0]);
28079
28048
 
28080
28049
  field .r = color [0];
28081
28050
  field .g = color [1];
@@ -28099,7 +28068,7 @@ Object .assign (Object .setPrototypeOf (VRMLParser .prototype, Parser_X3DParser
28099
28068
 
28100
28069
  if (Grammar .OpenBracket .parse (this))
28101
28070
  {
28102
- this .sfcolorValues (field);
28071
+ this .sfcolorrgbaValues (field);
28103
28072
 
28104
28073
  if (Grammar .CloseBracket .parse (this))
28105
28074
  return true;
@@ -28109,6 +28078,33 @@ Object .assign (Object .setPrototypeOf (VRMLParser .prototype, Parser_X3DParser
28109
28078
 
28110
28079
  return false;
28111
28080
  },
28081
+ sfColorRGBA: new x_ite_Fields .SFColorRGBA (),
28082
+ sfcolorrgbaValues (field)
28083
+ {
28084
+ const array = [ ];
28085
+
28086
+ for (;;)
28087
+ {
28088
+ if (this .double ())
28089
+ {
28090
+ array .push (this .value);
28091
+ continue;
28092
+ }
28093
+
28094
+ // Try parse HTML/CSS color values.
28095
+ if (this .sfcolorrgbaValue (this .sfColorRGBA))
28096
+ {
28097
+ array .push (... this .sfColorRGBA);
28098
+ continue;
28099
+ }
28100
+
28101
+ break;
28102
+ }
28103
+
28104
+ field .setValue (array);
28105
+
28106
+ return field .length !== 0;
28107
+ },
28112
28108
  sfdoubleValue (field)
28113
28109
  {
28114
28110
  if (this .double ())
@@ -29879,11 +29875,7 @@ Object .assign (Object .setPrototypeOf (XMLParser .prototype, Parser_X3DParser .
29879
29875
 
29880
29876
  try
29881
29877
  {
29882
- const localNode = this .getExecutionContext () .getLocalNode (name);
29883
-
29884
- const node = localNode instanceof Execution_X3DImportedNode
29885
- ? localNode .getExportedNode (type)
29886
- : localNode .getValue ();
29878
+ const node = this .getExecutionContext () .getLocalNode (name) .getValue ();
29887
29879
 
29888
29880
  this .checkNodeType (node, name, type, typeName);
29889
29881
  this .addNode (xmlElement, node);
@@ -29912,6 +29904,9 @@ Object .assign (Object .setPrototypeOf (XMLParser .prototype, Parser_X3DParser .
29912
29904
  },
29913
29905
  checkNodeType (node, name, type, typeName)
29914
29906
  {
29907
+ if (node instanceof Core_X3DImportedNodeInstance)
29908
+ return;
29909
+
29915
29910
  if (type === Core_X3DNode)
29916
29911
  return;
29917
29912
 
@@ -31186,7 +31181,7 @@ const Plane3_default_ = Plane3;
31186
31181
 
31187
31182
  /* harmony default export */ const Geometry_Plane3 = (x_ite_Namespace .add ("Plane3", Plane3_default_));
31188
31183
  ;// ./src/standard/Math/Geometry/Triangle3.js
31189
- /* provided dependency */ var libtess = __webpack_require__(362);
31184
+ /* provided dependency */ var libtess = __webpack_require__(67);
31190
31185
 
31191
31186
 
31192
31187
  const Triangle3 =
@@ -37880,7 +37875,7 @@ Object .assign (Object .setPrototypeOf (ImageTexture .prototype, Texturing_X3DTe
37880
37875
  {
37881
37876
  fileURL = new URL (fileURL);
37882
37877
 
37883
- if (fileURL .pathname .match (/\.ktx2?(?:\.gz)?$/) || fileURL .href .match (/^\s*data:image\/ktx2[;,]/s))
37878
+ if (fileURL .pathname .match (/\.ktx2?(?:\.gz)?$/) || fileURL .href .match (/^\s*data:image\/ktx2[;,]/))
37884
37879
  {
37885
37880
  this .setLinear (true);
37886
37881
  this .setMipMaps (false);
@@ -47908,7 +47903,7 @@ const Bezier_default_ = Bezier;
47908
47903
 
47909
47904
  /* harmony default export */ const Algorithms_Bezier = (x_ite_Namespace .add ("Bezier", Bezier_default_));
47910
47905
  ;// ./src/x_ite/Parser/SVGParser.js
47911
- /* provided dependency */ var SVGParser_libtess = __webpack_require__(362);
47906
+ /* provided dependency */ var SVGParser_libtess = __webpack_require__(67);
47912
47907
 
47913
47908
 
47914
47909
 
@@ -50767,9 +50762,15 @@ class GoldenGate extends Parser_X3DParser
50767
50762
  if (string === undefined)
50768
50763
  return;
50769
50764
 
50770
- if (string .match (/^\s*$/s))
50765
+ // An empty string should result in an empty XML (encoding) scene.
50766
+ if (string .match (/^\s*$/))
50771
50767
  return "";
50772
50768
 
50769
+ // XML must start with markup. Do not try DOMParser on other input, because
50770
+ // some browsers (Firefox) log a parsing error to the console when it fails.
50771
+ if (!string .match (/^\s*</))
50772
+ return;
50773
+
50773
50774
  return helper.parseXML (string);
50774
50775
  }
50775
50776
  case "JSON":
@@ -51190,9 +51191,6 @@ class FileLoader
51190
51191
  {
51191
51192
  const scene = new Execution_X3DScene (this .browser);
51192
51193
 
51193
- if (!(this .node instanceof Execution_X3DWorld))
51194
- scene .setExecutionContext (this .executionContext);
51195
-
51196
51194
  scene .setWorldURL (new URL (worldURL, this .getBaseURL ()));
51197
51195
  scene .setup ();
51198
51196
 
@@ -51297,7 +51295,7 @@ class FileLoader
51297
51295
 
51298
51296
  // Script:
51299
51297
  {
51300
- const result = url .match (/^\s*(?:ecmascript|javascript|vrmlscript):/s);
51298
+ const result = url .match (/^\s*(?:ecmascript|javascript|vrmlscript):/);
51301
51299
 
51302
51300
  if (result)
51303
51301
  return await this .dataCallback (url .substring (result [0] .length));
@@ -51308,7 +51306,7 @@ class FileLoader
51308
51306
  // Handle data URLs that are not base64 decoded here:
51309
51307
  if (this .dataAsString)
51310
51308
  {
51311
- const result = url .match (/^\s*data:(.*?)(?:;charset=(.*?))?(?:;(base64))?,/s);
51309
+ const result = url .match (/^\s*data:(.*?)(?:;charset=(.*?))?(?:;(base64))?,/);
51312
51310
 
51313
51311
  if (result && result [3] !== "base64")
51314
51312
  {
@@ -51936,8 +51934,6 @@ const ProtoDeclarationArray_default_ = ProtoDeclarationArray;
51936
51934
 
51937
51935
 
51938
51936
 
51939
-
51940
-
51941
51937
  const
51942
51938
  X3DRoute_executionContext = Symbol (),
51943
51939
  _sourceNode = Symbol (),
@@ -51945,8 +51941,7 @@ const
51945
51941
  _sourceField = Symbol (),
51946
51942
  _destinationNode = Symbol (),
51947
51943
  _destinationFieldName = Symbol (),
51948
- _destinationField = Symbol (),
51949
- _disposed = Symbol ();
51944
+ _destinationField = Symbol ();
51950
51945
 
51951
51946
  function X3DRoute (executionContext, sourceNode, sourceFieldName, destinationNode, destinationFieldName)
51952
51947
  {
@@ -51958,11 +51953,11 @@ function X3DRoute (executionContext, sourceNode, sourceFieldName, destinationNod
51958
51953
  this [_destinationNode] = destinationNode;
51959
51954
  this [_destinationFieldName] = destinationFieldName;
51960
51955
 
51961
- if (sourceNode instanceof Execution_X3DImportedNode)
51962
- sourceNode .getInlineNode () ._loadState .addInterest ("reconnect", this);
51956
+ if (sourceNode instanceof Core_X3DImportedNodeInstance)
51957
+ sourceNode .getImportedNode () .getInlineNode () ._loadState .addInterest ("reconnect", this);
51963
51958
 
51964
- if (destinationNode instanceof Execution_X3DImportedNode)
51965
- destinationNode .getInlineNode () ._loadState .addInterest ("reconnect", this);
51959
+ if (destinationNode instanceof Core_X3DImportedNodeInstance)
51960
+ destinationNode .getImportedNode () .getInlineNode () ._loadState .addInterest ("reconnect", this);
51966
51961
 
51967
51962
  this .reconnect ();
51968
51963
  }
@@ -51973,17 +51968,8 @@ Object .assign (Object .setPrototypeOf (X3DRoute .prototype, Base_X3DObject .pro
51973
51968
  {
51974
51969
  return this [X3DRoute_executionContext];
51975
51970
  },
51976
- getRouteId ()
51977
- {
51978
- return X3DRoute .getRouteId (this [_sourceNode], this [_sourceFieldName], this [_destinationNode], this [_destinationFieldName]);
51979
- },
51980
51971
  getSourceNode ()
51981
51972
  {
51982
- /// SAI
51983
-
51984
- if (this [_sourceNode] instanceof Execution_X3DImportedNode)
51985
- return this [_sourceNode] .getExportedNode ();
51986
-
51987
51973
  return this [_sourceNode];
51988
51974
  },
51989
51975
  getSourceField ()
@@ -52004,11 +51990,6 @@ Object .assign (Object .setPrototypeOf (X3DRoute .prototype, Base_X3DObject .pro
52004
51990
  },
52005
51991
  getDestinationNode ()
52006
51992
  {
52007
- /// SAI
52008
-
52009
- if (this [_destinationNode] instanceof Execution_X3DImportedNode)
52010
- return this [_destinationNode] .getExportedNode ();
52011
-
52012
51993
  return this [_destinationNode];
52013
51994
  },
52014
51995
  getDestinationField ()
@@ -52035,10 +52016,10 @@ Object .assign (Object .setPrototypeOf (X3DRoute .prototype, Base_X3DObject .pro
52035
52016
  }
52036
52017
  catch (error)
52037
52018
  {
52038
- if ((this [_sourceNode] instanceof Core_X3DNode ||
52039
- this [_sourceNode] .getInlineNode () .checkLoadState () === Base_X3DConstants .COMPLETE_STATE) &&
52040
- (this [_destinationNode] instanceof Core_X3DNode ||
52041
- this [_destinationNode] .getInlineNode () .checkLoadState () === Base_X3DConstants .COMPLETE_STATE))
52019
+ if ((!(this [_sourceNode] instanceof Core_X3DImportedNodeInstance) ||
52020
+ this [_sourceNode] .getImportedNode () .getInlineNode () .checkLoadState () === Base_X3DConstants .COMPLETE_STATE) &&
52021
+ (!(this [_destinationNode] instanceof Core_X3DImportedNodeInstance) ||
52022
+ this [_destinationNode] .getImportedNode () .getInlineNode () .checkLoadState () === Base_X3DConstants .COMPLETE_STATE))
52042
52023
  {
52043
52024
  console .warn (error);
52044
52025
  }
@@ -52046,18 +52027,11 @@ Object .assign (Object .setPrototypeOf (X3DRoute .prototype, Base_X3DObject .pro
52046
52027
  },
52047
52028
  connect ()
52048
52029
  {
52049
- if (this [_disposed])
52050
- return;
52051
-
52052
52030
  const errors = [ ];
52053
52031
 
52054
52032
  try
52055
52033
  {
52056
- const sourceNode = this [_sourceNode] instanceof Core_X3DNode
52057
- ? this [_sourceNode]
52058
- : this [_sourceNode] .getExportedNode ();
52059
-
52060
- this [_sourceField] = sourceNode .getField (this [_sourceFieldName]);
52034
+ this [_sourceField] = this [_sourceNode] .getField (this [_sourceFieldName]);
52061
52035
  }
52062
52036
  catch (error)
52063
52037
  {
@@ -52066,11 +52040,7 @@ Object .assign (Object .setPrototypeOf (X3DRoute .prototype, Base_X3DObject .pro
52066
52040
 
52067
52041
  try
52068
52042
  {
52069
- const destinationNode = this [_destinationNode] instanceof Core_X3DNode
52070
- ? this [_destinationNode]
52071
- : this [_destinationNode] .getExportedNode ();
52072
-
52073
- this [_destinationField] = destinationNode .getField (this [_destinationFieldName]);
52043
+ this [_destinationField] = this [_destinationNode] .getField (this [_destinationFieldName]);
52074
52044
  }
52075
52045
  catch (error)
52076
52046
  {
@@ -52109,13 +52079,13 @@ Object .assign (Object .setPrototypeOf (X3DRoute .prototype, Base_X3DObject .pro
52109
52079
  if (!generator .ExistsRouteNode (this [_destinationNode]))
52110
52080
  throw new Error (`Destination node does not exist in scene graph.`);
52111
52081
 
52112
- const sourceNodeName = this [_sourceNode] instanceof Core_X3DNode
52113
- ? generator .Name (this [_sourceNode])
52114
- : generator .ImportedName (this [_sourceNode]);
52082
+ const sourceNodeName = this [_sourceNode] instanceof Core_X3DImportedNodeInstance
52083
+ ? generator .ImportedName (this [_sourceNode])
52084
+ : generator .Name (this [_sourceNode]);
52115
52085
 
52116
- const destinationNodeName = this [_destinationNode] instanceof Core_X3DNode
52117
- ? generator .Name (this [_destinationNode])
52118
- : generator .ImportedName (this [_destinationNode]);
52086
+ const destinationNodeName = this [_destinationNode] instanceof Core_X3DImportedNodeInstance
52087
+ ? generator .ImportedName (this [_destinationNode])
52088
+ : generator .Name (this [_destinationNode]);
52119
52089
 
52120
52090
  generator .Indent ();
52121
52091
  generator .string += "ROUTE";
@@ -52138,13 +52108,13 @@ Object .assign (Object .setPrototypeOf (X3DRoute .prototype, Base_X3DObject .pro
52138
52108
  if (!generator .ExistsRouteNode (this [_destinationNode]))
52139
52109
  throw new Error (`Destination node does not exist in scene graph.`);
52140
52110
 
52141
- const sourceNodeName = this [_sourceNode] instanceof Core_X3DNode
52142
- ? generator .Name (this [_sourceNode])
52143
- : generator .ImportedName (this [_sourceNode]);
52111
+ const sourceNodeName = this [_sourceNode] instanceof Core_X3DImportedNodeInstance
52112
+ ? generator .ImportedName (this [_sourceNode])
52113
+ : generator .Name (this [_sourceNode]);
52144
52114
 
52145
- const destinationNodeName = this [_destinationNode] instanceof Core_X3DNode
52146
- ? generator .Name (this [_destinationNode])
52147
- : generator .ImportedName (this [_destinationNode]);
52115
+ const destinationNodeName = this [_destinationNode] instanceof Core_X3DImportedNodeInstance
52116
+ ? generator .ImportedName (this [_destinationNode])
52117
+ : generator .Name (this [_destinationNode]);
52148
52118
 
52149
52119
  generator .openTag ("ROUTE");
52150
52120
  generator .attribute ("fromNode", sourceNodeName);
@@ -52161,13 +52131,13 @@ Object .assign (Object .setPrototypeOf (X3DRoute .prototype, Base_X3DObject .pro
52161
52131
  if (!generator .ExistsRouteNode (this [_destinationNode]))
52162
52132
  throw new Error (`Destination node does not exist in scene graph.`);
52163
52133
 
52164
- const sourceNodeName = this [_sourceNode] instanceof Core_X3DNode
52165
- ? generator .Name (this [_sourceNode])
52166
- : generator .ImportedName (this [_sourceNode]);
52134
+ const sourceNodeName = this [_sourceNode] instanceof Core_X3DImportedNodeInstance
52135
+ ? generator .ImportedName (this [_sourceNode])
52136
+ : generator .Name (this [_sourceNode]);
52167
52137
 
52168
- const destinationNodeName = this [_destinationNode] instanceof Core_X3DNode
52169
- ? generator .Name (this [_destinationNode])
52170
- : generator .ImportedName (this [_destinationNode]);
52138
+ const destinationNodeName = this [_destinationNode] instanceof Core_X3DImportedNodeInstance
52139
+ ? generator .ImportedName (this [_destinationNode])
52140
+ : generator .Name (this [_destinationNode]);
52171
52141
 
52172
52142
  generator .TidyBreak ();
52173
52143
  generator .Indent ();
@@ -52184,18 +52154,13 @@ Object .assign (Object .setPrototypeOf (X3DRoute .prototype, Base_X3DObject .pro
52184
52154
  },
52185
52155
  dispose ()
52186
52156
  {
52187
- if (this [_disposed])
52188
- return;
52189
-
52190
- this [_disposed] = true;
52191
-
52192
52157
  this .disconnect ();
52193
52158
 
52194
- if (this [_sourceNode] instanceof Execution_X3DImportedNode)
52195
- this [_sourceNode] .getInlineNode () ._loadState .removeInterest ("reconnect", this);
52159
+ if (this [_sourceNode] instanceof Core_X3DImportedNodeInstance)
52160
+ this [_sourceNode] .getImportedNode () .getInlineNode () ._loadState .removeInterest ("reconnect", this);
52196
52161
 
52197
- if (this [_destinationNode] instanceof Execution_X3DImportedNode)
52198
- this [_destinationNode] .getInlineNode () ._loadState .removeInterest ("reconnect", this);
52162
+ if (this [_destinationNode] instanceof Core_X3DImportedNodeInstance)
52163
+ this [_destinationNode] .getImportedNode () .getInlineNode () ._loadState .removeInterest ("reconnect", this);
52199
52164
 
52200
52165
  this [X3DRoute_executionContext] .deleteRoute (this);
52201
52166
 
@@ -52247,36 +52212,6 @@ Object .defineProperties (X3DRoute,
52247
52212
 
52248
52213
  Object .assign (X3DRoute,
52249
52214
  {
52250
- getRouteId (sourceNode, sourceFieldName, destinationNode, destinationFieldName)
52251
- {
52252
- const sourceField = sourceNode instanceof Core_X3DNode
52253
- ? sourceNode .getField (sourceFieldName)
52254
- : helper.try (() => sourceNode .getExportedNode () .getField (sourceFieldName));
52255
-
52256
- const destinationField = destinationNode instanceof Core_X3DNode
52257
- ? destinationNode .getField (destinationFieldName)
52258
- : helper.try (() => destinationNode .getExportedNode () .getField (destinationFieldName));
52259
-
52260
- X3DRoute .checkFields (sourceField, destinationField);
52261
-
52262
- if (sourceField)
52263
- {
52264
- sourceFieldName = sourceField .getName ();
52265
-
52266
- if (sourceField .getAccessType () === Base_X3DConstants .inputOutput)
52267
- sourceFieldName += "_changed";
52268
- }
52269
-
52270
- if (destinationField)
52271
- {
52272
- destinationFieldName = destinationField .getName ();
52273
-
52274
- if (destinationField .getAccessType () === Base_X3DConstants .inputOutput)
52275
- destinationFieldName = "set_" + destinationFieldName;
52276
- }
52277
-
52278
- return `${sourceNode .getId ()}.${sourceFieldName}.${destinationNode .getId ()}.${destinationFieldName}`;
52279
- },
52280
52215
  checkFields (sourceField, destinationField)
52281
52216
  {
52282
52217
  if (sourceField && destinationField)
@@ -52349,6 +52284,7 @@ const RouteArray_default_ = RouteArray;
52349
52284
 
52350
52285
 
52351
52286
 
52287
+
52352
52288
  const
52353
52289
  _outerNode = Symbol (),
52354
52290
  _namedNodes = Symbol (),
@@ -52557,10 +52493,13 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52557
52493
  if (!node)
52558
52494
  throw new Error ("Couldn't add named node: node must be of type X3DNode.");
52559
52495
 
52496
+ if (node instanceof Core_X3DImportedNodeInstance)
52497
+ throw new Error ("Couldn't add named node: node cannot be of type X3DImportedNodeInstance.");
52498
+
52560
52499
  if (node .getExecutionContext () !== this)
52561
52500
  throw new Error ("Couldn't add named node: node does not belong to this execution context.");
52562
52501
 
52563
- if (name .length === 0)
52502
+ if (!name)
52564
52503
  throw new Error ("Couldn't add named node: node name is empty.");
52565
52504
 
52566
52505
  if (this [_namedNodes] .has (name))
@@ -52583,10 +52522,13 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52583
52522
  if (!node)
52584
52523
  throw new Error ("Couldn't update named node: node must be of type X3DNode.");
52585
52524
 
52525
+ if (node instanceof Core_X3DImportedNodeInstance)
52526
+ throw new Error ("Couldn't add named node: node cannot be of type X3DImportedNodeInstance.");
52527
+
52586
52528
  if (node .getExecutionContext () !== this)
52587
52529
  throw new Error ("Couldn't update named node: node does not belong to this execution context.");
52588
52530
 
52589
- if (name .length === 0)
52531
+ if (!name)
52590
52532
  throw new Error ("Couldn't update named node: node name is empty.");
52591
52533
 
52592
52534
  // Remove named node.
@@ -52655,10 +52597,10 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52655
52597
  if (inlineNode .getExecutionContext () !== this)
52656
52598
  throw new Error ("Couldn't update imported node: Inline node does not belong to this execution context.");
52657
52599
 
52658
- if (exportedName .length === 0)
52600
+ if (!exportedName)
52659
52601
  throw new Error ("Couldn't update imported node: exported name is empty.");
52660
52602
 
52661
- if (importedName .length === 0)
52603
+ if (!importedName)
52662
52604
  throw new Error ("Couldn't update imported node: imported name is empty.");
52663
52605
 
52664
52606
  // Update imported node.
@@ -52669,8 +52611,6 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52669
52611
 
52670
52612
  this [_importedNodes] .add (importedName, importedNode);
52671
52613
 
52672
- importedNode .updateExportedNode ();
52673
-
52674
52614
  this ._sceneGraph_changed = Date .now () / 1000;
52675
52615
  },
52676
52616
  renameImportedNode (oldImportedName, newImportedName)
@@ -52683,7 +52623,7 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52683
52623
  if (this [_importedNodes] .get (newImportedName))
52684
52624
  throw new Error ("Couldn't rename imported node: new imported name does already exists.");
52685
52625
 
52686
- importedNode [Symbol .for ("X_ITE.X3DImportedNode.setImportName")] (newImportedName);
52626
+ importedNode .setImportName (newImportedName);
52687
52627
 
52688
52628
  this [_importedNodes] .update (oldImportedName, newImportedName, importedNode);
52689
52629
 
@@ -52698,10 +52638,10 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52698
52638
  if (!importedNode)
52699
52639
  return;
52700
52640
 
52701
- importedNode .dispose ();
52702
-
52703
52641
  this [_importedNodes] .remove (importedName);
52704
52642
 
52643
+ importedNode .dispose ();
52644
+
52705
52645
  this ._sceneGraph_changed = Date .now () / 1000;
52706
52646
  },
52707
52647
  getImportedNode (importedName)
@@ -52711,7 +52651,7 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52711
52651
  const importedNode = this [_importedNodes] .get (importedName);
52712
52652
 
52713
52653
  if (importedNode)
52714
- return importedNode .exportedNode;
52654
+ return importedNode .instance;
52715
52655
 
52716
52656
  throw new Error (`Imported node '${importedName}' not found.`);
52717
52657
  },
@@ -52736,7 +52676,7 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52736
52676
  const importedNode = this [_importedNodes] .get (name);
52737
52677
 
52738
52678
  if (importedNode)
52739
- return importedNode;
52679
+ return importedNode .instance;
52740
52680
 
52741
52681
  throw new Error (`Unknown named or imported node '${name}'.`);
52742
52682
  }
@@ -52746,28 +52686,19 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52746
52686
  * @param {SFNode|X3DNode|X3DImportedNode} node
52747
52687
  * @returns either an X3DImportedNode if possible or X3DNode
52748
52688
  */
52749
- getLocalizedNode (node)
52689
+ getNodeOrImportedNode (node)
52750
52690
  {
52751
- node = Base_X3DCast (Base_X3DConstants .X3DNode, node, false)
52752
- ?? (node instanceof Execution_X3DImportedNode ? node : null);
52691
+ node = Base_X3DCast (Base_X3DConstants .X3DNode, node, false);
52753
52692
 
52754
52693
  if (!node)
52755
52694
  throw new Error ("Couldn't get localized node: node must be of type X3DNode.");
52756
52695
 
52757
- if (node .getExecutionContext () === this)
52758
- {
52759
- if (node instanceof Core_X3DImportedNodeProxy)
52760
- return node .getImportedNode ();
52761
-
52762
- return node;
52763
- }
52764
-
52765
52696
  for (const importedNode of this [_importedNodes])
52766
52697
  {
52767
52698
  try
52768
52699
  {
52769
- if (importedNode .getSharedNode () === node)
52770
- return importedNode;
52700
+ if (importedNode .getExportedNode () === node)
52701
+ return importedNode .getInstance ();
52771
52702
  }
52772
52703
  catch
52773
52704
  { }
@@ -52808,7 +52739,7 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52808
52739
  if (this [_protos] .get (proto .getName ()) === proto)
52809
52740
  throw new Error (`Couldn't add proto declaration: proto '${proto .getName ()}' already added.`);
52810
52741
 
52811
- if (name .length === 0)
52742
+ if (!name)
52812
52743
  throw new Error ("Couldn't add proto declaration: proto name is empty.");
52813
52744
 
52814
52745
  if (this [_externprotos] .has (name))
@@ -52832,7 +52763,7 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52832
52763
  if (proto .getExecutionContext () !== this)
52833
52764
  throw new Error ("Couldn't update proto declaration: proto does not belong to this execution context.");
52834
52765
 
52835
- if (name .length === 0)
52766
+ if (!name)
52836
52767
  throw new Error ("Couldn't update proto declaration: proto name is empty.");
52837
52768
 
52838
52769
  if (this [_externprotos] .has (name))
@@ -52889,7 +52820,7 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52889
52820
  if (this [_externprotos] .get (externproto .getName ()) === externproto)
52890
52821
  throw new Error (`Couldn't add extern proto declaration: extern proto '${externproto .getName ()}' already added.`);
52891
52822
 
52892
- if (name .length === 0)
52823
+ if (!name)
52893
52824
  throw new Error ("Couldn't add extern proto declaration: extern proto name is empty.");
52894
52825
 
52895
52826
  if (this [_protos] .has (name))
@@ -52913,7 +52844,7 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52913
52844
  if (externproto .getExecutionContext () !== this)
52914
52845
  throw new Error ("Couldn't update extern proto declaration: extern proto does not belong to this execution context.");
52915
52846
 
52916
- if (name .length === 0)
52847
+ if (!name)
52917
52848
  throw new Error ("Couldn't update extern proto declaration: extern proto name is empty.");
52918
52849
 
52919
52850
  if (this [_protos] .has (name))
@@ -52947,13 +52878,9 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52947
52878
  {
52948
52879
  // Normalize arguments.
52949
52880
 
52950
- const
52951
- importedSourceNode = sourceNode instanceof Execution_X3DImportedNode ? sourceNode : null,
52952
- importedDestinationNode = destinationNode instanceof Execution_X3DImportedNode ? destinationNode : null;
52953
-
52954
- sourceNode = Base_X3DCast (Base_X3DConstants .X3DNode, sourceNode, false) ?? importedSourceNode;
52881
+ sourceNode = Base_X3DCast (Base_X3DConstants .X3DNode, sourceNode, false);
52955
52882
  sourceField = String (sourceField);
52956
- destinationNode = Base_X3DCast (Base_X3DConstants .X3DNode, destinationNode, false) ?? importedDestinationNode;
52883
+ destinationNode = Base_X3DCast (Base_X3DConstants .X3DNode, destinationNode, false);
52957
52884
  destinationField = String (destinationField);
52958
52885
 
52959
52886
  // Check nodes.
@@ -52966,14 +52893,11 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52966
52893
 
52967
52894
  // Resolve imported source and destination node.
52968
52895
 
52969
- sourceNode = this .getLocalizedNode (sourceNode);
52970
- destinationNode = this .getLocalizedNode (destinationNode);
52896
+ sourceNode = this .getNodeOrImportedNode (sourceNode);
52897
+ destinationNode = this .getNodeOrImportedNode (destinationNode);
52971
52898
 
52972
52899
  // Add route.
52973
-
52974
- const
52975
- id = Routing_X3DRoute .getRouteId (sourceNode, sourceField, destinationNode, destinationField),
52976
- route = this [_routes] .get (id);
52900
+ const route = this .getRoute (sourceNode, sourceField, destinationNode, destinationField);
52977
52901
 
52978
52902
  if (route)
52979
52903
  {
@@ -52983,7 +52907,7 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52983
52907
  {
52984
52908
  const route = new Routing_X3DRoute (this, sourceNode, sourceField, destinationNode, destinationField);
52985
52909
 
52986
- this [_routes] .add (id, route);
52910
+ this [_routes] .add (route .getId (), route);
52987
52911
 
52988
52912
  return route;
52989
52913
  }
@@ -52997,25 +52921,21 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52997
52921
  if (!(route instanceof Routing_X3DRoute))
52998
52922
  return;
52999
52923
 
53000
- if (this [_routes] .get (route .getRouteId ()) !== route)
52924
+ if (!this .routes .has (route .getId ()))
53001
52925
  return;
53002
52926
 
53003
- this [_routes] .remove (route .getRouteId ());
52927
+ this [_routes] .remove (route .getId ());
53004
52928
 
53005
52929
  route .dispose ();
53006
52930
  },
53007
- getRoute (sourceNode, sourceField, destinationNode, destinationField)
52931
+ getRoute (sourceNode, sourceFieldName, destinationNode, destinationFieldName)
53008
52932
  {
53009
52933
  // Normalize arguments.
53010
52934
 
53011
- const
53012
- importedSourceNode = sourceNode instanceof Execution_X3DImportedNode ? sourceNode : null,
53013
- importedDestinationNode = destinationNode instanceof Execution_X3DImportedNode ? destinationNode : null;
53014
-
53015
- sourceNode = Base_X3DCast (Base_X3DConstants .X3DNode, sourceNode, false) ?? importedSourceNode;
53016
- sourceField = String (sourceField);
53017
- destinationNode = Base_X3DCast (Base_X3DConstants .X3DNode, destinationNode, false) ?? importedDestinationNode;
53018
- destinationField = String (destinationField);
52935
+ sourceNode = Base_X3DCast (Base_X3DConstants .X3DNode, sourceNode, false);
52936
+ sourceFieldName = String (sourceFieldName);
52937
+ destinationNode = Base_X3DCast (Base_X3DConstants .X3DNode, destinationNode, false);
52938
+ destinationFieldName = String (destinationFieldName);
53019
52939
 
53020
52940
  // Check nodes.
53021
52941
 
@@ -53027,12 +52947,69 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
53027
52947
 
53028
52948
  // Resolve imported source and destination node.
53029
52949
 
53030
- sourceNode = this .getLocalizedNode (sourceNode);
53031
- destinationNode = this .getLocalizedNode (destinationNode);
52950
+ sourceNode = this .getNodeOrImportedNode (sourceNode);
52951
+ destinationNode = this .getNodeOrImportedNode (destinationNode);
52952
+
52953
+ // Get fields if possible.
52954
+
52955
+ const sourceField = sourceNode instanceof Core_X3DImportedNodeInstance
52956
+ ? helper.try (() => sourceNode .getField (sourceFieldName))
52957
+ : sourceNode .getField (sourceFieldName);
52958
+
52959
+ const destinationField = destinationNode instanceof Core_X3DImportedNodeInstance
52960
+ ? helper.try (() => destinationNode .getField (destinationFieldName))
52961
+ : destinationNode .getField (destinationFieldName);
52962
+
52963
+ Routing_X3DRoute .checkFields (sourceField, destinationField);
53032
52964
 
53033
52965
  // Return route.
53034
52966
 
53035
- return this [_routes] .get (Routing_X3DRoute .getRouteId (sourceNode, sourceField, destinationNode, destinationField));
52967
+ return this [_routes] .find (route =>
52968
+ {
52969
+ if (route .getSourceNode () !== sourceNode)
52970
+ return false;
52971
+
52972
+ if (route .getDestinationNode () !== destinationNode)
52973
+ return false;
52974
+
52975
+ if (sourceField)
52976
+ {
52977
+ if (helper.try (() => sourceNode .getField (route .getSourceField ())) !== sourceField)
52978
+ return false;
52979
+ }
52980
+ else
52981
+ {
52982
+ if (sourceNode instanceof Core_X3DImportedNodeInstance)
52983
+ {
52984
+ if (route .getSourceField () !== sourceFieldName)
52985
+ return false;
52986
+ }
52987
+ else
52988
+ {
52989
+ return false;
52990
+ }
52991
+ }
52992
+
52993
+ if (destinationField)
52994
+ {
52995
+ if (helper.try (() => destinationNode .getField (route .getDestinationField ())) !== destinationField)
52996
+ return false;
52997
+ }
52998
+ else
52999
+ {
53000
+ if (destinationNode instanceof Core_X3DImportedNodeInstance)
53001
+ {
53002
+ if (route .getDestinationField () !== destinationFieldName)
53003
+ return false;
53004
+ }
53005
+ else
53006
+ {
53007
+ return false;
53008
+ }
53009
+ }
53010
+
53011
+ return true;
53012
+ });
53036
53013
  },
53037
53014
  getRoutes ()
53038
53015
  {
@@ -53598,6 +53575,12 @@ Object .assign (Object .setPrototypeOf (X3DExportedNode .prototype, Base_X3DObje
53598
53575
  generator .endObject ();
53599
53576
  generator .endObject ();
53600
53577
  },
53578
+ dispose ()
53579
+ {
53580
+ this [X3DExportedNode_executionContext] .removeExportedNode (this [X3DExportedNode_exportedName]);
53581
+
53582
+ Base_X3DObject .prototype .dispose .call (this);
53583
+ },
53601
53584
  });
53602
53585
 
53603
53586
  for (const key of Object .keys (X3DExportedNode .prototype))
@@ -53688,6 +53671,7 @@ const LATEST_VERSION_default_ = "4.1";
53688
53671
 
53689
53672
 
53690
53673
 
53674
+
53691
53675
  const
53692
53676
  _specificationVersion = Symbol (),
53693
53677
  _encoding = Symbol (),
@@ -53696,7 +53680,7 @@ const
53696
53680
  _worldURL = Symbol (),
53697
53681
  _units = Symbol (),
53698
53682
  _metadata = Symbol (),
53699
- X3DScene_exportedNodes = Symbol (),
53683
+ _exportedNodes = Symbol (),
53700
53684
  _loadingObjects = Symbol ();
53701
53685
 
53702
53686
  function X3DScene (browser)
@@ -53728,12 +53712,12 @@ function X3DScene (browser)
53728
53712
  this [_units] .add ("mass", new Configuration_UnitInfo ("mass", "kilogram", 1));
53729
53713
 
53730
53714
  this [_metadata] = [ ];
53731
- this [X3DScene_exportedNodes] = new Execution_ExportedNodesArray ();
53715
+ this [_exportedNodes] = new Execution_ExportedNodesArray ();
53732
53716
  this [_loadingObjects] = new Set ();
53733
53717
 
53734
53718
  this [_components] .addParent (this);
53735
53719
  this [_units] .addParent (this);
53736
- this [X3DScene_exportedNodes] .addParent (this);
53720
+ this [_exportedNodes] .addParent (this);
53737
53721
  }
53738
53722
 
53739
53723
  Object .assign (Object .setPrototypeOf (X3DScene .prototype, Execution_X3DExecutionContext .prototype),
@@ -53789,7 +53773,7 @@ Object .assign (Object .setPrototypeOf (X3DScene .prototype, Execution_X3DExecut
53789
53773
  hasComponent (name, level = 0)
53790
53774
  {
53791
53775
  if (name instanceof Configuration_ComponentInfo)
53792
- var { name, level } = name;
53776
+ ({ name, level } = name);
53793
53777
 
53794
53778
  const
53795
53779
  browser = this .getBrowser (),
@@ -53960,7 +53944,7 @@ Object .assign (Object .setPrototypeOf (X3DScene .prototype, Execution_X3DExecut
53960
53944
  {
53961
53945
  exportedName = String (exportedName);
53962
53946
 
53963
- if (this [X3DScene_exportedNodes] .has (exportedName))
53947
+ if (this [_exportedNodes] .has (exportedName))
53964
53948
  throw new Error (`Couldn't add exported node: exported name '${exportedName}' already in use.`);
53965
53949
 
53966
53950
  this .updateExportedNode (exportedName, node, description);
@@ -53973,18 +53957,21 @@ Object .assign (Object .setPrototypeOf (X3DScene .prototype, Execution_X3DExecut
53973
53957
  node = Base_X3DCast (Base_X3DConstants .X3DNode, node, false);
53974
53958
  description = String (description);
53975
53959
 
53976
- if (exportedName .length === 0)
53977
- throw new Error ("Couldn't update exported node: node exported name is empty.");
53978
-
53979
53960
  if (!node)
53980
53961
  throw new Error ("Couldn't update exported node: node must be of type X3DNode.");
53981
53962
 
53982
- //if (node .getExecutionContext () !== this)
53983
- // throw new Error ("Couldn't update exported node: node does not belong to this execution context.");
53963
+ if (node instanceof Core_X3DImportedNodeInstance)
53964
+ throw new Error ("Couldn't update exported node: node cannot be of type X3DImportedNodeInstance.");
53965
+
53966
+ if (node .getExecutionContext () !== this)
53967
+ throw new Error ("Couldn't update exported node: node does not belong to this execution context.");
53968
+
53969
+ if (!exportedName)
53970
+ throw new Error ("Couldn't update exported node: node exported name is empty.");
53984
53971
 
53985
53972
  const exportedNode = new Execution_X3DExportedNode (this, exportedName, node, description);
53986
53973
 
53987
- this [X3DScene_exportedNodes] .update (exportedName, exportedName, exportedNode);
53974
+ this [_exportedNodes] .update (exportedName, exportedName, exportedNode);
53988
53975
 
53989
53976
  this ._sceneGraph_changed = Date .now () / 1000;
53990
53977
  },
@@ -53992,7 +53979,14 @@ Object .assign (Object .setPrototypeOf (X3DScene .prototype, Execution_X3DExecut
53992
53979
  {
53993
53980
  exportedName = String (exportedName);
53994
53981
 
53995
- this [X3DScene_exportedNodes] .remove (exportedName);
53982
+ const exportedNode = this [_exportedNodes] .get (exportedName);
53983
+
53984
+ if (!exportedNode)
53985
+ return;
53986
+
53987
+ this [_exportedNodes] .remove (exportedName);
53988
+
53989
+ exportedNode .dispose ();
53996
53990
 
53997
53991
  this ._sceneGraph_changed = Date .now () / 1000;
53998
53992
  },
@@ -54000,7 +53994,7 @@ Object .assign (Object .setPrototypeOf (X3DScene .prototype, Execution_X3DExecut
54000
53994
  {
54001
53995
  exportedName = String (exportedName);
54002
53996
 
54003
- const exportedNode = this [X3DScene_exportedNodes] .get (exportedName);
53997
+ const exportedNode = this [_exportedNodes] .get (exportedName);
54004
53998
 
54005
53999
  if (exportedNode)
54006
54000
  return exportedNode .localNode;
@@ -54009,11 +54003,11 @@ Object .assign (Object .setPrototypeOf (X3DScene .prototype, Execution_X3DExecut
54009
54003
  },
54010
54004
  getExportedNodes ()
54011
54005
  {
54012
- return this [X3DScene_exportedNodes];
54006
+ return this [_exportedNodes];
54013
54007
  },
54014
54008
  getUniqueExportName (name)
54015
54009
  {
54016
- return getUniqueName (this [X3DScene_exportedNodes], name);
54010
+ return getUniqueName (this [_exportedNodes], name);
54017
54011
  },
54018
54012
  addRootNode (node)
54019
54013
  {
@@ -54289,7 +54283,7 @@ Object .assign (Object .setPrototypeOf (X3DScene .prototype, Execution_X3DExecut
54289
54283
 
54290
54284
  generator .endArray ();
54291
54285
 
54292
- headLastProperty = true;
54286
+ // headLastProperty = true;
54293
54287
  }
54294
54288
 
54295
54289
  // Head end
@@ -54618,6 +54612,7 @@ Fonts_add ("PT_Sans/PTSans-Italic.woff2", false, true);
54618
54612
 
54619
54613
 
54620
54614
 
54615
+
54621
54616
  const
54622
54617
  _instanceId = Symbol (),
54623
54618
  _element = Symbol (),
@@ -54681,7 +54676,9 @@ function X3DCoreContext (element)
54681
54676
  {
54682
54677
  const link = document .createElement ("link");
54683
54678
 
54684
- link .integrity = "sha384-fEzovT4J83tA9kKXGV4bUgl6uLo/jpIuUjb7ogp7mj1miyDlddDqWywNrpuG5Yzv";
54679
+ if (!DEVELOPMENT)
54680
+ link .integrity = "sha384-PV+KMMYFFsD4yJSRNZxR5SQtB1+/svusY5D4rmCUw1HodNYMj3Nx2fKast5z9E0g";
54681
+
54685
54682
  link .rel = "stylesheet";
54686
54683
  link .crossOrigin = "anonymous";
54687
54684
  link .onload = resolve;
@@ -65676,6 +65673,7 @@ const
65676
65673
  _defaultFramebuffer = Symbol (),
65677
65674
  _textureBuffers = Symbol (),
65678
65675
  _resizer = Symbol (),
65676
+ _traverse = Symbol .for ("X_ITE.X3DBrowserContext.traverse"),
65679
65677
  _localObjects = Symbol (),
65680
65678
  _fullscreenArray = Symbol (),
65681
65679
  _fullscreenBuffer = Symbol (),
@@ -65720,12 +65718,7 @@ Object .assign (X3DRenderingContext .prototype,
65720
65718
 
65721
65719
  helper.on (this, window, "orientationchange", () => this .reshape ());
65722
65720
 
65723
- this [_resizer] = new ResizeObserver (() =>
65724
- {
65725
- this .reshape ();
65726
-
65727
- this [Symbol .for ("X_ITE.X3DBrowserContext.traverse")] (performance .now ());
65728
- });
65721
+ this [_resizer] = new ResizeObserver (() => this .reshape ());
65729
65722
 
65730
65723
  this [_resizer] .observe (this .getSurface ());
65731
65724
 
@@ -66002,6 +65995,9 @@ Object .assign (X3DRenderingContext .prototype,
66002
65995
 
66003
65996
  this .reshapeFramebuffer (0, 0, 0, width, height);
66004
65997
 
65998
+ if (this .getWorld ())
65999
+ this [_traverse] (-1);
66000
+
66005
66001
  this .addBrowserEvent ();
66006
66002
  },
66007
66003
  limitFramebufferSize (width, height)
@@ -67337,7 +67333,7 @@ vec3 color=vec3(0);vec3 v=normalize(-vertex);
67337
67333
  #if defined(X3D_USE_IBL)||defined(X3D_LIGHTING)
67338
67334
  NormalInfo normalInfo=getNormalInfo(x3d_Material.normalScale);vec3 n=normalInfo.n;float NdotV=clamp(dot(n,v),0.,1.);
67339
67335
  #if defined(X3D_RETROREFLECTION_MATERIAL_EXT)
67340
- vec3 v_retro=reflect(-v,n);float NdotV_retro=clamp(dot(n,v_retro),0.,1.);
67336
+ vec3 v_retro=normalize(reflect(-v,n));
67341
67337
  #endif
67342
67338
  #endif
67343
67339
  MaterialInfo materialInfo;materialInfo.baseColor=baseColor.rgb;materialInfo.ior=1.5;materialInfo.f0_dielectric=vec3(.04);materialInfo.specularWeight=1.;materialInfo.f90=vec3(1);materialInfo.f90_dielectric=materialInfo.f90;
@@ -67365,6 +67361,9 @@ materialInfo=getVolumeInfo(materialInfo);
67365
67361
  #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)
67366
67362
  materialInfo=getIridescenceInfo(materialInfo);
67367
67363
  #endif
67364
+ #if defined(X3D_RETROREFLECTION_MATERIAL_EXT)
67365
+ materialInfo=getRetroreflectionInfo(materialInfo);
67366
+ #endif
67368
67367
  #if defined(X3D_DIFFUSE_TRANSMISSION_MATERIAL_EXT)
67369
67368
  materialInfo=getDiffuseTransmissionInfo(materialInfo);
67370
67369
  #endif
@@ -67374,17 +67373,10 @@ materialInfo=getVolumeScatterInfo(materialInfo);
67374
67373
  #if defined(X3D_ANISOTROPY_MATERIAL_EXT)
67375
67374
  materialInfo=getAnisotropyInfo(materialInfo,normalInfo);
67376
67375
  #endif
67377
- #if defined(X3D_RETROREFLECTION_MATERIAL_EXT)
67378
- materialInfo=getRetroreflectionInfo(materialInfo);
67379
- #endif
67380
67376
  materialInfo.perceptualRoughness=clamp(materialInfo.perceptualRoughness,0.,1.);materialInfo.metallic=clamp(materialInfo.metallic,0.,1.);materialInfo.alphaRoughness=materialInfo.perceptualRoughness*materialInfo.perceptualRoughness;vec3 f_specular_dielectric=vec3(0);vec3 f_specular_metal=vec3(0);vec3 f_diffuse=vec3(0);vec3 f_dielectric_brdf_ibl=vec3(0);vec3 f_metal_brdf_ibl=vec3(0);vec3 f_emissive=vec3(0);vec3 clearcoat_brdf=vec3(0);vec3 f_sheen=vec3(0);vec3 f_specular_transmission=vec3(0);vec3 f_diffuse_transmission=vec3(0);float clearcoatFactor=0.;vec3 clearcoatFresnel=vec3(0);float albedoSheenScaling=1.;float diffuseTransmissionThickness=1.;vec3 diffuseTransmissionIBL=vec3(0);
67381
67377
  #if defined(X3D_USE_IBL)||defined(X3D_LIGHTING)
67382
67378
  #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)
67383
- vec3 iridescenceFresnel_dielectric=evalIridescence(1.,materialInfo.iridescenceIor,NdotV,materialInfo.iridescenceThickness,materialInfo.f0_dielectric);vec3 iridescenceFresnel_metallic=evalIridescence(1.,materialInfo.iridescenceIor,NdotV,materialInfo.iridescenceThickness,baseColor.rgb);
67384
- #if defined(X3D_RETROREFLECTION_MATERIAL_EXT)
67385
- vec3 iridescenceFresnel_dielectric_retro=evalIridescence(1.,materialInfo.iridescenceIor,NdotV_retro,materialInfo.iridescenceThickness,materialInfo.f0_dielectric);vec3 iridescenceFresnel_metallic_retro=evalIridescence(1.,materialInfo.iridescenceIor,NdotV_retro,materialInfo.iridescenceThickness,baseColor.rgb);
67386
- #endif
67387
- if(materialInfo.iridescenceThickness==0.)materialInfo.iridescenceFactor=0.;
67379
+ vec3 iridescenceFresnel_dielectric=evalIridescence(1.,materialInfo.iridescenceIor,NdotV,materialInfo.iridescenceThickness,materialInfo.f0_dielectric);vec3 iridescenceFresnel_metallic=evalIridescence(1.,materialInfo.iridescenceIor,NdotV,materialInfo.iridescenceThickness,baseColor.rgb);if(materialInfo.iridescenceThickness==0.)materialInfo.iridescenceFactor=0.;
67388
67380
  #endif
67389
67381
  #endif
67390
67382
  #if defined(X3D_DIFFUSE_TRANSMISSION_MATERIAL_EXT)
@@ -67422,6 +67414,18 @@ vec3 f_metal_fresnel_ibl=getIBLGGXFresnel(n,v,materialInfo.perceptualRoughness,b
67422
67414
  #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)
67423
67415
  f_metal_brdf_ibl=mix(f_metal_brdf_ibl,f_specular_metal*iridescenceFresnel_metallic,materialInfo.iridescenceFactor);f_dielectric_brdf_ibl=mix(f_dielectric_brdf_ibl,rgb_mix(f_diffuse,f_specular_dielectric,iridescenceFresnel_dielectric),materialInfo.iridescenceFactor);
67424
67416
  #endif
67417
+ #if defined(X3D_RETROREFLECTION_MATERIAL_EXT)
67418
+ #if defined(X3D_ANISOTROPY_MATERIAL_EXT)
67419
+ vec3 f_specular_retro=getIBLRadianceAnisotropy(n,v_retro,materialInfo.perceptualRoughness,materialInfo.anisotropyStrength,materialInfo.anisotropicB);
67420
+ #else
67421
+ vec3 f_specular_retro=getIBLRadianceGGX(n,v_retro,materialInfo.perceptualRoughness);
67422
+ #endif
67423
+ vec3 f_metal_brdf_retro=f_metal_fresnel_ibl*f_specular_retro;vec3 f_dielectric_brdf_retro=mix(f_diffuse,f_specular_retro,f_dielectric_fresnel_ibl);
67424
+ #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)
67425
+ f_metal_brdf_retro=mix(f_metal_brdf_retro,f_specular_retro*iridescenceFresnel_metallic,materialInfo.iridescenceFactor);f_dielectric_brdf_retro=mix(f_dielectric_brdf_retro,rgb_mix(f_diffuse,f_specular_retro,iridescenceFresnel_dielectric),materialInfo.iridescenceFactor);
67426
+ #endif
67427
+ f_metal_brdf_ibl=mix(f_metal_brdf_ibl,f_metal_brdf_retro,materialInfo.retroreflectionFactor);f_dielectric_brdf_ibl=mix(f_dielectric_brdf_ibl,f_dielectric_brdf_retro,materialInfo.retroreflectionFactor);
67428
+ #endif
67425
67429
  #if defined(X3D_CLEARCOAT_MATERIAL_EXT)
67426
67430
  clearcoat_brdf=getIBLRadianceGGX(materialInfo.clearcoatNormal,v,materialInfo.clearcoatRoughness);
67427
67431
  #endif
@@ -67464,15 +67468,15 @@ l_metal_brdf=metal_fresnel*l_specular_metal;l_dielectric_brdf=mix(l_diffuse,l_sp
67464
67468
  l_metal_brdf=mix(l_metal_brdf,l_specular_metal*iridescenceFresnel_metallic,materialInfo.iridescenceFactor);l_dielectric_brdf=mix(l_dielectric_brdf,rgb_mix(l_diffuse,l_specular_dielectric,iridescenceFresnel_dielectric),materialInfo.iridescenceFactor);
67465
67469
  #endif
67466
67470
  #if defined(X3D_RETROREFLECTION_MATERIAL_EXT)
67467
- vec3 h_retro=normalize(l+v_retro);float NdotH_retro=clamp(dot(n,h_retro),0.,1.);float VdotH_retro=clamp(dot(v_retro,h_retro),0.,1.);vec3 dielectric_fresnel_retro=F_Schlick(materialInfo.f0_dielectric*materialInfo.specularWeight,materialInfo.f90_dielectric,abs(VdotH_retro));vec3 metal_fresnel_retro=F_Schlick(baseColor.rgb,vec3(1),abs(VdotH_retro));vec3 l_specular_metal_retro;
67471
+ vec3 h_retro=normalize(l+v_retro);float NdotH_retro=clamp(dot(n,h_retro),0.,1.);float VdotH_retro=clamp(dot(v_retro,h_retro),0.,1.);vec3 dielectric_fresnel_retro=F_Schlick(materialInfo.f0_dielectric*materialInfo.specularWeight,materialInfo.f90_dielectric,abs(VdotH_retro));vec3 metal_fresnel_retro=F_Schlick(baseColor.rgb,vec3(1),abs(VdotH_retro));
67468
67472
  #if defined(X3D_ANISOTROPY_MATERIAL_EXT)
67469
- l_specular_metal_retro=intensity*NdotL*BRDF_specularGGXAnisotropy(materialInfo.alphaRoughness,materialInfo.anisotropyStrength,n,v_retro,l,h_retro,materialInfo.anisotropicT,materialInfo.anisotropicB);
67473
+ vec3 l_specular_retro=intensity*NdotL*BRDF_specularGGXAnisotropy(materialInfo.alphaRoughness,materialInfo.anisotropyStrength,n,v_retro,l,h_retro,materialInfo.anisotropicT,materialInfo.anisotropicB);
67470
67474
  #else
67471
- l_specular_metal_retro=intensity*NdotL*BRDF_specularGGX(materialInfo.alphaRoughness,NdotL,NdotV_retro,NdotH_retro);
67475
+ vec3 l_specular_retro=intensity*NdotL*BRDF_specularGGX(materialInfo.alphaRoughness,NdotL,NdotV,NdotH_retro);
67472
67476
  #endif
67473
- vec3 l_specular_dielectric_retro=l_specular_metal_retro;vec3 l_metal_brdf_retro=metal_fresnel_retro*l_specular_metal_retro;vec3 l_dielectric_brdf_retro=mix(l_diffuse,l_specular_dielectric_retro,dielectric_fresnel_retro);
67477
+ vec3 l_metal_brdf_retro=metal_fresnel_retro*l_specular_retro;vec3 l_dielectric_brdf_retro=mix(l_diffuse,l_specular_retro,dielectric_fresnel_retro);
67474
67478
  #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)
67475
- l_metal_brdf_retro=mix(l_metal_brdf_retro,l_specular_metal*iridescenceFresnel_metallic_retro,materialInfo.iridescenceFactor);l_dielectric_brdf_retro=mix(l_dielectric_brdf_retro,rgb_mix(l_diffuse,l_specular_dielectric,iridescenceFresnel_dielectric_retro),materialInfo.iridescenceFactor);
67479
+ l_metal_brdf_retro=mix(l_metal_brdf_retro,l_specular_retro*iridescenceFresnel_metallic,materialInfo.iridescenceFactor);l_dielectric_brdf_retro=mix(l_dielectric_brdf_retro,rgb_mix(l_diffuse,l_specular_retro,iridescenceFresnel_dielectric),materialInfo.iridescenceFactor);
67476
67480
  #endif
67477
67481
  l_metal_brdf=mix(l_metal_brdf,l_metal_brdf_retro,materialInfo.retroreflectionFactor);l_dielectric_brdf=mix(l_dielectric_brdf,l_dielectric_brdf_retro,materialInfo.retroreflectionFactor);
67478
67482
  #endif
@@ -72687,14 +72691,14 @@ Object .assign (X3DTimeContext .prototype,
72687
72691
  {
72688
72692
  const lastPosition = new Numbers_Vector3 ();
72689
72693
 
72690
- return function ()
72694
+ return function (checkFrameRate)
72691
72695
  {
72692
72696
  const
72693
72697
  time = Date .now () / 1000,
72694
72698
  interval = time - this [_lastTime],
72695
72699
  viewpointNode = this .getActiveViewpoint ();
72696
72700
 
72697
- if (interval <= 1 / Math .max (this .getBrowserOption ("MaximumFrameRate"), 1))
72701
+ if (checkFrameRate && interval <= 1 / Math .max (this .getBrowserOption ("MaximumFrameRate"), 1))
72698
72702
  return false;
72699
72703
 
72700
72704
  this [_lastTime] = time;
@@ -72936,7 +72940,7 @@ const ConcreteNodes_default_ = new Configuration_ConcreteNodesArray ();
72936
72940
  const
72937
72941
  _world = Symbol (),
72938
72942
  X3DBrowserContext_tainted = Symbol (),
72939
- _traverse = Symbol .for ("X_ITE.X3DBrowserContext.traverse"),
72943
+ X3DBrowserContext_traverse = Symbol .for ("X_ITE.X3DBrowserContext.traverse"),
72940
72944
  _renderCallback = Symbol (),
72941
72945
  _animFrame = Symbol (),
72942
72946
  _previousTime = Symbol (),
@@ -72992,7 +72996,7 @@ function X3DBrowserContext (element)
72992
72996
 
72993
72997
  this [X3DBrowserContext_tainted] = false;
72994
72998
  this [_previousTime] = 0;
72995
- this [_renderCallback] = this [_traverse] .bind (this);
72999
+ this [_renderCallback] = this [X3DBrowserContext_traverse] .bind (this);
72996
73000
  this [_systemTime] = new Time_StopWatch ();
72997
73001
  this [_browserTime] = new Time_StopWatch ();
72998
73002
  this [_cameraTime] = new Time_StopWatch ();
@@ -73103,13 +73107,15 @@ Object .assign (Object .setPrototypeOf (X3DBrowserContext .prototype, Base_X3DBa
73103
73107
  this .addBrowserEvent ();
73104
73108
  });
73105
73109
  },
73106
- [_traverse] (now, frame)
73110
+ [X3DBrowserContext_traverse] (now, frame)
73107
73111
  {
73108
73112
  // Limit frame rate.
73109
73113
 
73110
73114
  this [X3DBrowserContext_tainted] = false;
73111
73115
 
73112
- if (!this .advanceTime ())
73116
+ // If now is negative, don't check framerate.
73117
+ // Now can be negative when reshape is called.
73118
+ if (!this .advanceTime (now >= 0))
73113
73119
  {
73114
73120
  this .addBrowserEvent ();
73115
73121
  return;
@@ -74877,7 +74883,7 @@ const CoreComponent_default_ = {
74877
74883
  [
74878
74884
  Core_X3DBindableNode,
74879
74885
  Core_X3DChildNode,
74880
- Core_X3DImportedNodeProxy,
74886
+ Core_X3DImportedNodeInstance,
74881
74887
  Core_X3DInfoNode,
74882
74888
  Core_X3DMetadataObject,
74883
74889
  Core_X3DNode,
@@ -91546,8 +91552,8 @@ const PNGMedia_default_ = PNGMedia;
91546
91552
 
91547
91553
  /* harmony default export */ const Texturing_PNGMedia = (x_ite_Namespace .add ("PNGMedia", PNGMedia_default_));
91548
91554
  ;// ./src/x_ite/Components/Texturing/MovieTexture.js
91549
- /* provided dependency */ var SuperGif = __webpack_require__(8);
91550
- /* provided dependency */ var APNG = __webpack_require__(618);
91555
+ /* provided dependency */ var SuperGif = __webpack_require__(829);
91556
+ /* provided dependency */ var APNG = __webpack_require__(247);
91551
91557
 
91552
91558
 
91553
91559
 
@@ -91620,7 +91626,7 @@ Object .assign (Object .setPrototypeOf (MovieTexture .prototype, Texturing_X3DTe
91620
91626
 
91621
91627
  try
91622
91628
  {
91623
- if (fileURL .pathname .endsWith (".gif") || fileURL .href .match (/^\s*data:image\/gif[;,]/s))
91629
+ if (fileURL .pathname .endsWith (".gif") || fileURL .href .match (/^\s*data:image\/gif[;,]/))
91624
91630
  {
91625
91631
  const
91626
91632
  data = await this .loadDocument (fileURL),
@@ -91639,7 +91645,7 @@ Object .assign (Object .setPrototypeOf (MovieTexture .prototype, Texturing_X3DTe
91639
91645
  this .setGif (gif);
91640
91646
  return;
91641
91647
  }
91642
- else if (fileURL .pathname .endsWith (".png") || fileURL .href .match (/^\s*data:image\/png[;,]/s))
91648
+ else if (fileURL .pathname .endsWith (".png") || fileURL .href .match (/^\s*data:image\/png[;,]/))
91643
91649
  {
91644
91650
  const
91645
91651
  data = await this .loadDocument (fileURL),
@@ -92898,7 +92904,7 @@ const Components_default_ = Components;
92898
92904
 
92899
92905
  /* eslint no-undef: "off"
92900
92906
  --------
92901
- no-undef: global variable is used here for use in node projects.
92907
+ no-undef: node `global` variable is used here for use in node projects.
92902
92908
  */
92903
92909
 
92904
92910
  const
@@ -94191,7 +94197,7 @@ const QuickSort_default_ = QuickSort;
94191
94197
 
94192
94198
  /* harmony default export */ const Algorithms_QuickSort = (x_ite_Namespace .add ("QuickSort", QuickSort_default_));
94193
94199
  ;// ./src/lib/libtess.js
94194
- /* provided dependency */ var libtess_libtess = __webpack_require__(362);
94200
+ /* provided dependency */ var libtess_libtess = __webpack_require__(67);
94195
94201
  const libtess_default_ = libtess_libtess;
94196
94202
  ;
94197
94203