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.mjs CHANGED
@@ -1,7 +1,7 @@
1
- /* X_ITE v16.4.2 */
1
+ /* X_ITE v16.5.0 */
2
2
  var __webpack_modules__ = ({
3
3
 
4
- /***/ 8
4
+ /***/ 829
5
5
  (module, exports) {
6
6
 
7
7
  var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*
@@ -1006,7 +1006,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
1006
1006
 
1007
1007
  /***/ },
1008
1008
 
1009
- /***/ 618
1009
+ /***/ 247
1010
1010
  (module) {
1011
1011
 
1012
1012
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -2002,7 +2002,7 @@ return /******/ (function(modules) { // webpackBootstrap
2002
2002
 
2003
2003
  /***/ },
2004
2004
 
2005
- /***/ 981
2005
+ /***/ 67
2006
2006
  (module) {
2007
2007
 
2008
2008
  /**
@@ -7561,21 +7561,21 @@ Object .assign (Generator .prototype,
7561
7561
 
7562
7562
  return false;
7563
7563
  },
7564
- ImportedName (importedNode)
7564
+ ImportedName (importedNodeInstance)
7565
7565
  {
7566
7566
  const importedNames = this .importedNames .get (this .ExecutionContext ());
7567
7567
 
7568
- if (importedNames .has (importedNode))
7569
- return importedNames .get (importedNode);
7568
+ if (importedNames .has (importedNodeInstance))
7569
+ return importedNames .get (importedNodeInstance);
7570
7570
 
7571
7571
  const
7572
7572
  names = this .names .get (this .ExecutionContext ()),
7573
- newName = getUniqueName (names, importedNode .getImportedName ());
7573
+ newName = getUniqueName (names, importedNodeInstance .getName ());
7574
7574
 
7575
7575
  // Add to indices.
7576
7576
 
7577
7577
  names .add (newName);
7578
- importedNames .set (importedNode, newName);
7578
+ importedNames .set (importedNodeInstance, newName);
7579
7579
 
7580
7580
  return newName;
7581
7581
  },
@@ -7800,7 +7800,7 @@ Object .assign (Object .setPrototypeOf (JSONGenerator .prototype, X3DGenerator .
7800
7800
  },
7801
7801
  RemoveComma ()
7802
7802
  {
7803
- this .string = this .string .replace (/,\s*$/s, "");
7803
+ this .string = this .string .replace (/,\s*$/, "");
7804
7804
  },
7805
7805
  stringProperty (key, value, comma = true)
7806
7806
  {
@@ -8253,14 +8253,14 @@ Object .assign (X3DObject .prototype,
8253
8253
  {
8254
8254
  return this .constructor .typeName;
8255
8255
  },
8256
- setName (value)
8257
- {
8258
- this [_name] = value;
8259
- },
8260
8256
  getName ()
8261
8257
  {
8262
8258
  return this [_name];
8263
8259
  },
8260
+ setName (value)
8261
+ {
8262
+ this [_name] = value;
8263
+ },
8264
8264
  getDisplayName ()
8265
8265
  {
8266
8266
  return this [_name];
@@ -8849,7 +8849,7 @@ const
8849
8849
 
8850
8850
  const handler =
8851
8851
  {
8852
- get (target, key, receiver)
8852
+ get (target, key)
8853
8853
  {
8854
8854
  if (typeof key === "string")
8855
8855
  {
@@ -8859,9 +8859,9 @@ const handler =
8859
8859
  return target [_array] [index];
8860
8860
  }
8861
8861
 
8862
- return Reflect .get (target, key, receiver);
8862
+ return Reflect .get (target, key);
8863
8863
  },
8864
- set (target, key, value, receiver)
8864
+ set (target, key, value)
8865
8865
  {
8866
8866
  if (typeof key === "string")
8867
8867
  {
@@ -8871,7 +8871,7 @@ const handler =
8871
8871
  return false;
8872
8872
  }
8873
8873
 
8874
- return Reflect .set (target, key, value, receiver);
8874
+ return Reflect .set (target, key, value);
8875
8875
  },
8876
8876
  has (target, key)
8877
8877
  {
@@ -14339,16 +14339,16 @@ const
14339
14339
 
14340
14340
  const SFNode_handler =
14341
14341
  {
14342
- get (target, key, receiver)
14342
+ get (target, key)
14343
14343
  {
14344
- if (typeof key === "string")
14344
+ try
14345
14345
  {
14346
- const
14347
- node = target .getValue (),
14348
- field = node ?.getField (key, false);
14349
-
14350
- if (field)
14346
+ if (typeof key === "string")
14351
14347
  {
14348
+ const
14349
+ node = target .getValue (),
14350
+ field = node ?.getField (key);
14351
+
14352
14352
  // Specification conform would be: `accessType & X3DConstants .outputOnly`.
14353
14353
  // However, we also allow read access to initializeOnly fields.
14354
14354
  if (field .getAccessType () === Base_X3DConstants .inputOnly)
@@ -14357,19 +14357,21 @@ const SFNode_handler =
14357
14357
  return field .valueOf ();
14358
14358
  }
14359
14359
  }
14360
+ catch
14361
+ { }
14360
14362
 
14361
- return Reflect .get (target, key, receiver);
14363
+ return Reflect .get (target, key);
14362
14364
  },
14363
- set (target, key, value, receiver)
14365
+ set (target, key, value)
14364
14366
  {
14365
- if (typeof key === "string")
14367
+ try
14366
14368
  {
14367
- const
14368
- node = target .getValue (),
14369
- field = node ?.getField (key, false);
14370
-
14371
- if (field)
14369
+ if (typeof key === "string")
14372
14370
  {
14371
+ const
14372
+ node = target .getValue (),
14373
+ field = node ?.getField (key);
14374
+
14373
14375
  if (field .getAccessType () === Base_X3DConstants .outputOnly)
14374
14376
  return false;
14375
14377
 
@@ -14377,13 +14379,21 @@ const SFNode_handler =
14377
14379
  return true;
14378
14380
  }
14379
14381
  }
14382
+ catch
14383
+ { }
14380
14384
 
14381
- return Reflect .set (target, key, value, receiver);
14385
+ return Reflect .set (target, key, value);
14382
14386
  },
14383
14387
  has (target, key)
14384
14388
  {
14385
- return Boolean (target .getValue () ?.getField (key, false))
14386
- || Reflect .has (target, key);
14389
+ try
14390
+ {
14391
+ return Boolean (target .getValue () ?.getField (key));
14392
+ }
14393
+ catch
14394
+ {
14395
+ return Reflect .has (target, key);
14396
+ }
14387
14397
  },
14388
14398
  ownKeys (target)
14389
14399
  {
@@ -15739,7 +15749,7 @@ const
15739
15749
 
15740
15750
  const X3DObjectArrayField_handler =
15741
15751
  {
15742
- get (target, key, receiver)
15752
+ get (target, key)
15743
15753
  {
15744
15754
  if (typeof key === "string")
15745
15755
  {
@@ -15756,9 +15766,9 @@ const X3DObjectArrayField_handler =
15756
15766
  }
15757
15767
  }
15758
15768
 
15759
- return Reflect .get (target, key, receiver);
15769
+ return Reflect .get (target, key);
15760
15770
  },
15761
- set (target, key, value, receiver)
15771
+ set (target, key, value)
15762
15772
  {
15763
15773
  if (typeof key === "string")
15764
15774
  {
@@ -15777,7 +15787,7 @@ const X3DObjectArrayField_handler =
15777
15787
  }
15778
15788
  }
15779
15789
 
15780
- return Reflect .set (target, key, value, receiver);
15790
+ return Reflect .set (target, key, value);
15781
15791
  },
15782
15792
  has (target, key)
15783
15793
  {
@@ -16264,7 +16274,7 @@ const
16264
16274
 
16265
16275
  const X3DTypedArrayField_handler =
16266
16276
  {
16267
- get (target, key, receiver)
16277
+ get (target, key)
16268
16278
  {
16269
16279
  if (typeof key === "string")
16270
16280
  {
@@ -16294,9 +16304,9 @@ const X3DTypedArrayField_handler =
16294
16304
  }
16295
16305
  }
16296
16306
 
16297
- return Reflect .get (target, key, receiver);
16307
+ return Reflect .get (target, key);
16298
16308
  },
16299
- set (target, key, value, receiver)
16309
+ set (target, key, value)
16300
16310
  {
16301
16311
  if (typeof key === "string")
16302
16312
  {
@@ -16331,7 +16341,7 @@ const X3DTypedArrayField_handler =
16331
16341
  }
16332
16342
  }
16333
16343
 
16334
- return Reflect .set (target, key, value, receiver);
16344
+ return Reflect .set (target, key, value);
16335
16345
  },
16336
16346
  has (target, key)
16337
16347
  {
@@ -18424,7 +18434,7 @@ Object .assign (Object .setPrototypeOf (X3DBaseNode .prototype, Base_X3DChildObj
18424
18434
  {
18425
18435
  return this [_fieldDefinitions];
18426
18436
  },
18427
- getField (name, _throw = true)
18437
+ getField (name)
18428
18438
  {
18429
18439
  const field = getFieldFromArray (this [_userDefinedFields], name)
18430
18440
  ?? getFieldFromArray (this [_predefinedFields], name);
@@ -18432,8 +18442,7 @@ Object .assign (Object .setPrototypeOf (X3DBaseNode .prototype, Base_X3DChildObj
18432
18442
  if (field)
18433
18443
  return field;
18434
18444
 
18435
- if (_throw)
18436
- throw new Error (`Unknown field '${name}' in node class ${this .getTypeName ()}.`);
18445
+ throw new Error (`Unknown field '${name}' in node class ${this .getTypeName ()}.`);
18437
18446
  },
18438
18447
  getFields ()
18439
18448
  {
@@ -18865,7 +18874,7 @@ const Legacy_default_ = Legacy;
18865
18874
 
18866
18875
  /* harmony default export */ const Browser_Legacy = (x_ite_Namespace .add ("Legacy", Legacy_default_));
18867
18876
  ;// ./src/x_ite/BROWSER_VERSION.js
18868
- const BROWSER_VERSION_default_ = "16.4.2";
18877
+ const BROWSER_VERSION_default_ = "16.5.0";
18869
18878
  ;
18870
18879
 
18871
18880
  /* harmony default export */ const BROWSER_VERSION = (x_ite_Namespace .add ("BROWSER_VERSION", BROWSER_VERSION_default_));
@@ -21378,6 +21387,7 @@ const URLs_default_ = URLs;
21378
21387
 
21379
21388
 
21380
21389
 
21390
+
21381
21391
  const _metaDataCallbacks = Symbol ();
21382
21392
 
21383
21393
  function X3DNode (executionContext)
@@ -21427,17 +21437,19 @@ Object .assign (Object .setPrototypeOf (X3DNode .prototype, Base_X3DBaseNode .pr
21427
21437
  else
21428
21438
  {
21429
21439
  // Make a copy for a X3DPrototypeInstance.
21430
-
21440
+
21431
21441
  const executionContext = instance .getBody ();
21432
21442
 
21433
21443
  // First try to get a named node with the node's name.
21434
21444
 
21435
- if (this .getName () .length)
21445
+ if (this .getName ())
21436
21446
  {
21437
- const namedNode = executionContext .getNamedNodes () .get (this .getName ());
21438
-
21439
- if (namedNode)
21440
- return namedNode .getValue ();
21447
+ try
21448
+ {
21449
+ return executionContext .getLocalNode (this .getName ()) .getValue ();
21450
+ }
21451
+ catch
21452
+ { }
21441
21453
  }
21442
21454
 
21443
21455
  // Create copy.
@@ -21448,7 +21460,7 @@ Object .assign (Object .setPrototypeOf (X3DNode .prototype, Base_X3DBaseNode .pr
21448
21460
  if (this .getNeedsName ())
21449
21461
  this .getExecutionContext () .updateNamedNode (this .getExecutionContext () .getUniqueName (), this);
21450
21462
 
21451
- if (this .getName () .length)
21463
+ if (this .getName ())
21452
21464
  executionContext .updateNamedNode (this .getName (), copy);
21453
21465
 
21454
21466
  // Default fields
@@ -21549,7 +21561,7 @@ Object .assign (Object .setPrototypeOf (X3DNode .prototype, Base_X3DBaseNode .pr
21549
21561
  },
21550
21562
  getNeedsName ()
21551
21563
  {
21552
- if (this .getName () .length)
21564
+ if (this .getName ())
21553
21565
  return false;
21554
21566
 
21555
21567
  if (this .getCloneCount () > 1)
@@ -22275,7 +22287,7 @@ Object .assign (Object .setPrototypeOf (X3DNode .prototype, Base_X3DBaseNode .pr
22275
22287
  if (cdata ?.length === 0)
22276
22288
  cdata = null;
22277
22289
 
22278
- if (!cdata ?.some (string => string .match (/^\s*(?:data|ecmascript|javascript|vrmlscript):/s)))
22290
+ if (!cdata ?.some (string => string .match (/^\s*(?:data|ecmascript|javascript|vrmlscript):/)))
22279
22291
  cdata = null;
22280
22292
 
22281
22293
  generator .IncIndent ();
@@ -22554,7 +22566,7 @@ Object .assign (Object .setPrototypeOf (X3DNode .prototype, Base_X3DBaseNode .pr
22554
22566
  if (sourceText ?.length !== 1)
22555
22567
  sourceText = null;
22556
22568
 
22557
- if (!sourceText ?.some (string => string .match (/^\s*(?:data|ecmascript|javascript|vrmlscript):/s)))
22569
+ if (!sourceText ?.some (string => string .match (/^\s*(?:data|ecmascript|javascript|vrmlscript):/)))
22558
22570
  sourceText = null;
22559
22571
 
22560
22572
  // Predefined fields
@@ -22773,22 +22785,47 @@ Object .assign (Object .setPrototypeOf (X3DNode .prototype, Base_X3DBaseNode .pr
22773
22785
 
22774
22786
  if (executionContext .isScene)
22775
22787
  {
22776
- // Remove exported node if any.
22788
+ // Collect imported nodes in parent context.
22789
+ // This must be done before the exported nodes are removed.
22790
+
22791
+ const
22792
+ parentContext = executionContext .getExecutionContext (),
22793
+ importedNodes = [ ];
22794
+
22795
+ if (parentContext)
22796
+ {
22797
+ for (const importedNode of parentContext .getImportedNodes ())
22798
+ {
22799
+ if (helper.try (() => importedNode .getExportedNode ()) === this)
22800
+ importedNodes .push (importedNode);
22801
+ }
22802
+ }
22803
+
22804
+ // Remove exported nodes if any.
22777
22805
 
22778
22806
  for (const exportedNode of Array .from (executionContext .getExportedNodes ()))
22779
22807
  {
22780
- if (exportedNode .getLocalNode () === this)
22781
- executionContext .removeExportedNode (exportedNode .getExportedName ());
22808
+ if (exportedNode .getLocalNode () !== this)
22809
+ continue;
22810
+
22811
+ executionContext .removeExportedNode (exportedNode .getExportedName ());
22782
22812
  }
22783
22813
 
22784
- // Remove imported node if any.
22814
+ // Update imported node instances in parent context if any.
22815
+ // This must be done after the exported nodes are removed.
22785
22816
 
22786
- const parentContext = executionContext .getExecutionContext ();
22817
+ for (const importedNode of importedNodes)
22818
+ importedNode .getInstance () .update ();
22787
22819
 
22788
- if (parentContext)
22820
+ // Update routes after the exported nodes are removed.
22821
+
22822
+ for (const field of this .getFields ())
22789
22823
  {
22790
- for (const importedNode of parentContext .getImportedNodes ())
22791
- importedNode .getExportedNode () .update ();
22824
+ for (const route of Array .from (field .getInputRoutes ()))
22825
+ route .reconnect ();
22826
+
22827
+ for (const route of Array .from (field .getOutputRoutes ()))
22828
+ route .reconnect ();
22792
22829
  }
22793
22830
  }
22794
22831
 
@@ -23933,146 +23970,66 @@ const NamedNodesArray_default_ = NamedNodesArray;
23933
23970
  ;
23934
23971
 
23935
23972
  /* harmony default export */ const Execution_NamedNodesArray = (x_ite_Namespace .add ("NamedNodesArray", NamedNodesArray_default_));
23936
- ;// ./src/x_ite/Components/Core/X3DImportedNodeProxy.js
23937
-
23938
-
23939
-
23940
-
23941
-
23942
- const
23943
- _importedName = Symbol (),
23944
- _importedNode = Symbol (),
23945
- X3DImportedNodeProxy_type = Symbol (),
23946
- _functions = Symbol ();
23947
-
23948
- const X3DImportedNodeProxy_handler =
23949
- {
23950
- get (target, key, receiver)
23951
- {
23952
- if (Reflect .has (target, key))
23953
- return Reflect .get (target, key, receiver);
23954
-
23955
- const node = target .getSharedNode ();
23956
-
23957
- if (node)
23958
- {
23959
- const property = Reflect .get (node, key, receiver);
23973
+ ;// ./src/x_ite/Components/Core/X3DImportedNodeInstance.js
23960
23974
 
23961
- if (typeof property === "function")
23962
- {
23963
- return target [_functions] .get (key) ?? (() =>
23964
- {
23965
- const func = property .bind (node);
23966
23975
 
23967
- target [_functions] .set (key, func);
23968
23976
 
23969
- return func;
23970
- })();
23971
- }
23972
23977
 
23973
- return property;
23974
- }
23975
- },
23976
- set (target, key, value, receiver)
23977
- {
23978
- if (Reflect .has (target, key))
23979
- {
23980
- return Reflect .set (target, key, value, receiver);
23981
- }
23982
- else
23983
- {
23984
- const node = target .getSharedNode ();
23985
-
23986
- if (node)
23987
- return Reflect .set (node, key, value, receiver);
23988
23978
 
23989
- return false;
23990
- }
23991
- },
23992
- has (target, key)
23993
- {
23994
- return Reflect .has (target, key)
23995
- || Reflect .has (target .getSharedNode () ?? { }, key);
23996
- },
23997
- ownKeys (target)
23998
- {
23999
- return Array .from (new Set (Reflect .ownKeys (target)
24000
- .concat (Reflect .ownKeys (target .getSharedNode () ?? { }))));
24001
- },
24002
- getOwnPropertyDescriptor (target, key)
24003
- {
24004
- return Reflect .getOwnPropertyDescriptor (target, key)
24005
- ?? Reflect .getOwnPropertyDescriptor (target .getSharedNode () ?? { }, key);
24006
- },
24007
- };
23979
+ const _importedNode = Symbol ();
24008
23980
 
24009
- function X3DImportedNodeProxy (executionContext, importedName, type)
23981
+ function X3DImportedNodeInstance (executionContext, importedNode)
24010
23982
  {
24011
23983
  Core_X3DNode .call (this, executionContext);
24012
23984
 
24013
- const proxy = new Proxy (this, X3DImportedNodeProxy_handler);
23985
+ this .addType (Base_X3DConstants .X3DImportedNodeInstance);
24014
23986
 
24015
- this [_importedName] = importedName;
24016
- this [X3DImportedNodeProxy_type] = type;
24017
- this [_functions] = new Map ();
24018
-
24019
- this .setup ();
23987
+ // Private properties
24020
23988
 
24021
- return proxy;
23989
+ this [_importedNode] = importedNode;
24022
23990
  }
24023
23991
 
24024
- Object .assign (Object .setPrototypeOf (X3DImportedNodeProxy .prototype, Core_X3DNode .prototype),
23992
+ Object .assign (Object .setPrototypeOf (X3DImportedNodeInstance .prototype, Core_X3DNode .prototype),
24025
23993
  {
24026
23994
  initialize ()
24027
23995
  {
24028
23996
  Core_X3DNode .prototype .initialize .call (this);
24029
23997
 
24030
- this .getExecutionContext () .importedNodes .addInterest ("update", this);
23998
+ this [_importedNode] .getInlineNode () ._loadState .addInterest ("update", this);
24031
23999
 
24032
24000
  this .update ();
24033
24001
  },
24034
- getExtendedEventHandling ()
24002
+ update ()
24035
24003
  {
24036
- return false;
24004
+ if (this [_importedNode] .getInlineNode () .checkLoadState () === Base_X3DConstants .COMPLETE_STATE)
24005
+ helper.try (() => this [_importedNode] .getExportedNode ()) ?.addInterest ("addNodeEvent", this);
24006
+
24007
+ this ._typeName_changed ?.setValue (Date .now () / 1000);
24008
+
24009
+ Base_X3DChildObject .prototype .addEvent .call (this);
24037
24010
  },
24038
- setTypeHint (value)
24011
+ getExtendedEventHandling ()
24039
24012
  {
24040
- this [X3DImportedNodeProxy_type] ??= value;
24013
+ return false;
24041
24014
  },
24042
- getSharedNode ()
24015
+ getInnerNode ()
24043
24016
  {
24044
- return helper.try (() => this [_importedNode] .getSharedNode ()) ?? null;
24017
+ return this [_importedNode] .getExportedNode () .getInnerNode ();
24045
24018
  },
24046
24019
  getImportedNode ()
24047
24020
  {
24048
24021
  return this [_importedNode];
24049
24022
  },
24050
- getInnerNode ()
24051
- {
24052
- return this [_importedNode] .getSharedNode () .getInnerNode ();
24053
- },
24054
24023
  getName ()
24055
24024
  {
24056
- return this [_importedName];
24057
- },
24058
- setName (value)
24059
- {
24060
- this [_importedName] = value;
24061
-
24062
- this ._name_changed ?.setValue (Date .now () / 1000);
24025
+ return this [_importedNode] .getImportedName ();
24063
24026
  },
24064
24027
  ... Object .fromEntries ([
24065
- ["getComponentInfo", "componentInfo"],
24066
- ["getContainerField", "containerField"],
24067
- ["getSpecificationRange", "specificationRange"],
24068
- ["getTypeName", "typeName"],
24069
- ]
24070
- .map (([fn, property]) => [fn, function ()
24071
- {
24072
- return this .getSharedNode () ?.[fn] () ?? this .constructor [property];
24073
- }])),
24074
- ... Object .fromEntries ([
24028
+ "getTypeName",
24075
24029
  "getType",
24030
+ "getComponentInfo",
24031
+ "getContainerField",
24032
+ "getSpecificationRange",
24076
24033
  "getFieldDefinitions",
24077
24034
  "getPredefinedField",
24078
24035
  "getPredefinedFields",
@@ -24086,36 +24043,15 @@ Object .assign (Object .setPrototypeOf (X3DImportedNodeProxy .prototype, Core_X3
24086
24043
  ]
24087
24044
  .map (fn => [fn, function (... args)
24088
24045
  {
24089
- return this .getSharedNode () ?.[fn] (... args) ?? Core_X3DNode .prototype [fn] .call (this, ... args);
24046
+ return helper.try (() => this [_importedNode] .getExportedNode ()) ?.[fn] (... args)
24047
+ ?? Core_X3DNode .prototype [fn] .call (this, ... args);
24090
24048
  }])),
24091
- update ()
24092
- {
24093
- const importedNode = this .getExecutionContext () .getImportedNodes () .get (this [_importedName])
24094
- ?? null;
24095
-
24096
- this [_importedNode] ?.getInlineNode () ._loadState .removeInterest ("set_loadState__", this);
24097
-
24098
- this [_importedNode] = importedNode;
24099
-
24100
- this [_importedNode] ?.getInlineNode () ._loadState .addInterest ("set_loadState__", this);
24101
-
24102
- this .set_loadState__ ();
24103
- },
24104
- set_loadState__ ()
24105
- {
24106
- if (this [_importedNode] ?.getInlineNode () .checkLoadState () === Base_X3DConstants .COMPLETE_STATE)
24107
- this [X3DImportedNodeProxy_type] = this .getSharedNode () ?.constructor ?? this [X3DImportedNodeProxy_type];
24108
-
24109
- this ._typeName_changed ?.setValue (Date .now () / 1000);
24110
-
24111
- Base_X3DChildObject .prototype .addEvent .call (this);
24112
- },
24113
24049
  toVRMLStream (generator)
24114
24050
  {
24115
24051
  generator .CheckSpace ();
24116
24052
  generator .string += "USE";
24117
24053
  generator .Space ();
24118
- generator .string += this [_importedName];
24054
+ generator .string += this [_importedNode] .getImportedName ();
24119
24055
  generator .NeedsSpace ();
24120
24056
  },
24121
24057
  toXMLStream (generator)
@@ -24125,36 +24061,48 @@ Object .assign (Object .setPrototypeOf (X3DImportedNodeProxy .prototype, Core_X3
24125
24061
  if (generator .html && this .getTypeName () === "Script")
24126
24062
  generator .attribute ("type", "model/x3d+xml");
24127
24063
 
24128
- generator .attribute ("USE", this [_importedName]);
24064
+ generator .attribute ("USE", this [_importedNode] .getImportedName ());
24129
24065
  generator .containerField (this .getContainerField ());
24130
24066
  generator .closeTag (this .getTypeName ());
24131
24067
  },
24132
24068
  toJSONStream (generator)
24133
24069
  {
24134
24070
  generator .beginObject (this .getTypeName (), false, true);
24135
- generator .stringProperty ("@USE", this [_importedName], false);
24071
+ generator .stringProperty ("@USE", this [_importedNode] .getImportedName (), false);
24136
24072
  generator .endObject ();
24137
24073
  generator .endObject ();
24138
24074
  },
24139
- });
24140
-
24141
- Object .defineProperties (X3DImportedNodeProxy .prototype,
24142
- {
24143
- constructor:
24075
+ dispose ()
24144
24076
  {
24145
- get ()
24077
+ const executionContext = this .getExecutionContext ();
24078
+
24079
+ for (const route of Array .from (executionContext .getRoutes ()))
24146
24080
  {
24147
- return this [X3DImportedNodeProxy_type] ?? Core_X3DNode;
24148
- },
24149
- }
24081
+ if (route .getSourceNode () === this)
24082
+ {
24083
+ executionContext .deleteRoute (route);
24084
+ continue;
24085
+ }
24086
+
24087
+ if (route .getDestinationNode () === this)
24088
+ {
24089
+ executionContext .deleteRoute (route);
24090
+ continue;
24091
+ }
24092
+ }
24093
+
24094
+ this .getImportedNode () .refreshInstance ();
24095
+
24096
+ Core_X3DNode .prototype .dispose .call (this);
24097
+ },
24150
24098
  });
24151
24099
 
24152
- Object .defineProperties (X3DImportedNodeProxy, Core_X3DNode .getStaticProperties ("X3DImportedNodeProxy", "Core", 2, "children", "4.1"));
24100
+ Object .defineProperties (X3DImportedNodeInstance, Core_X3DNode .getStaticProperties ("X3DImportedNodeInstance", "Core", 2, "children", "4.1"));
24153
24101
 
24154
- const X3DImportedNodeProxy_default_ = X3DImportedNodeProxy;
24102
+ const X3DImportedNodeInstance_default_ = X3DImportedNodeInstance;
24155
24103
  ;
24156
24104
 
24157
- /* harmony default export */ const Core_X3DImportedNodeProxy = (x_ite_Namespace .add ("X3DImportedNodeProxy", X3DImportedNodeProxy_default_));
24105
+ /* harmony default export */ const Core_X3DImportedNodeInstance = (x_ite_Namespace .add ("X3DImportedNodeInstance", X3DImportedNodeInstance_default_));
24158
24106
  ;// ./src/x_ite/Execution/X3DImportedNode.js
24159
24107
 
24160
24108
 
@@ -24164,20 +24112,23 @@ const
24164
24112
  X3DImportedNode_executionContext = Symbol (),
24165
24113
  _inlineNode = Symbol (),
24166
24114
  _exportedName = Symbol (),
24167
- X3DImportedNode_importedName = Symbol (),
24168
- _description = Symbol (),
24169
- _exportedNodes = Symbol ();
24115
+ _importedName = Symbol (),
24116
+ _instance = Symbol (),
24117
+ _description = Symbol ();
24170
24118
 
24171
24119
  function X3DImportedNode (executionContext, inlineNode, exportedName, importedName, description)
24172
24120
  {
24173
24121
  Base_X3DObject .call (this);
24174
24122
 
24123
+ // Private properties
24124
+
24175
24125
  this [X3DImportedNode_executionContext] = executionContext;
24176
24126
  this [_inlineNode] = inlineNode;
24177
24127
  this [_exportedName] = exportedName;
24178
- this [X3DImportedNode_importedName] = importedName;
24128
+ this [_importedName] = importedName;
24179
24129
  this [_description] = description;
24180
- this [_exportedNodes] = executionContext [_exportedNodes] ??= new Map ();
24130
+
24131
+ this .refreshInstance ();
24181
24132
  }
24182
24133
 
24183
24134
  Object .assign (Object .setPrototypeOf (X3DImportedNode .prototype, Base_X3DObject .prototype),
@@ -24194,27 +24145,7 @@ Object .assign (Object .setPrototypeOf (X3DImportedNode .prototype, Base_X3DObje
24194
24145
  {
24195
24146
  return this [_exportedName];
24196
24147
  },
24197
- getExportedNode (type)
24198
- {
24199
- const exportedNode = this [_exportedNodes] .get (this [X3DImportedNode_importedName]);
24200
-
24201
- exportedNode ?.setTypeHint (type);
24202
-
24203
- return exportedNode ?? this .createExportedNode (type);
24204
- },
24205
- createExportedNode (type)
24206
- {
24207
- const exportedNode = new Core_X3DImportedNodeProxy (this .getExecutionContext (), this [X3DImportedNode_importedName], type);
24208
-
24209
- this [_exportedNodes] .set (this [X3DImportedNode_importedName], exportedNode);
24210
-
24211
- return exportedNode;
24212
- },
24213
- updateExportedNode ()
24214
- {
24215
- this [_exportedNodes] .get (this [X3DImportedNode_importedName]) ?.update ();
24216
- },
24217
- getSharedNode ()
24148
+ getExportedNode ()
24218
24149
  {
24219
24150
  const exportedNode = this .getInlineNode () .getInternalScene () .getExportedNodes () .get (this [_exportedName]);
24220
24151
 
@@ -24225,20 +24156,26 @@ Object .assign (Object .setPrototypeOf (X3DImportedNode .prototype, Base_X3DObje
24225
24156
  },
24226
24157
  getImportedName ()
24227
24158
  {
24228
- return this [X3DImportedNode_importedName];
24159
+ return this [_importedName];
24229
24160
  },
24230
- [Symbol .for ("X_ITE.X3DImportedNode.setImportName")] (importedName)
24161
+ setImportName (importedName)
24231
24162
  {
24232
- const
24233
- exportedNode = this .getExportedNode (),
24234
- exportedNodes = this [_exportedNodes];
24163
+ this [_instance] .setName (importedName);
24235
24164
 
24236
- exportedNodes .delete (this [X3DImportedNode_importedName]);
24237
- exportedNodes .set (importedName, exportedNode);
24165
+ this [_importedName] = importedName;
24166
+ },
24167
+ getInstance ()
24168
+ {
24169
+ return this [_instance];
24170
+ },
24171
+ refreshInstance ()
24172
+ {
24173
+ if (this [_instance] && !this [X3DImportedNode_executionContext] .getImportedNodes () .has (this [_importedName]))
24174
+ return;
24238
24175
 
24239
- this [X3DImportedNode_importedName] = importedName;
24176
+ this [_instance] = new Core_X3DImportedNodeInstance (this [X3DImportedNode_executionContext], this);
24240
24177
 
24241
- exportedNode .setName (importedName);
24178
+ this [_instance] .setup ();
24242
24179
  },
24243
24180
  getDescription ()
24244
24181
  {
@@ -24253,9 +24190,9 @@ Object .assign (Object .setPrototypeOf (X3DImportedNode .prototype, Base_X3DObje
24253
24190
  if (!generator .ExistsNode (this .getInlineNode ()))
24254
24191
  throw new Error ("X3DImportedNode.toVRMLStream: Inline node does not exist.");
24255
24192
 
24256
- generator .AddRouteNode (this);
24193
+ generator .AddRouteNode (this .getInstance ());
24257
24194
 
24258
- const importedName = generator .ImportedName (this);
24195
+ const importedName = generator .ImportedName (this .getInstance ());
24259
24196
 
24260
24197
  generator .Indent ();
24261
24198
  generator .string += "IMPORT";
@@ -24287,9 +24224,9 @@ Object .assign (Object .setPrototypeOf (X3DImportedNode .prototype, Base_X3DObje
24287
24224
  if (!generator .ExistsNode (this .getInlineNode ()))
24288
24225
  throw new Error ("X3DImportedNode.toXMLStream: Inline node does not exist.");
24289
24226
 
24290
- generator .AddRouteNode (this);
24227
+ generator .AddRouteNode (this .getInstance ());
24291
24228
 
24292
- const importedName = generator .ImportedName (this);
24229
+ const importedName = generator .ImportedName (this .getInstance ());
24293
24230
 
24294
24231
  generator .openTag ("IMPORT");
24295
24232
  generator .attribute ("inlineDEF", generator .Name (this .getInlineNode ()));
@@ -24311,12 +24248,12 @@ Object .assign (Object .setPrototypeOf (X3DImportedNode .prototype, Base_X3DObje
24311
24248
  generator .TidyBreak ();
24312
24249
  generator .Indent ();
24313
24250
 
24314
- generator .AddRouteNode (this);
24251
+ generator .AddRouteNode (this .getInstance ());
24315
24252
  generator .beginObject ("IMPORT", false, true);
24316
24253
  generator .stringProperty ("@inlineDEF", generator .Name (this .getInlineNode ()), false);
24317
24254
  generator .stringProperty ("@importedDEF", this .getExportedName ());
24318
24255
 
24319
- const importedName = generator .ImportedName (this);
24256
+ const importedName = generator .ImportedName (this .getInstance ());
24320
24257
 
24321
24258
  if (importedName !== this .getExportedName ())
24322
24259
  generator .stringProperty ("@AS", importedName);
@@ -24329,20 +24266,9 @@ Object .assign (Object .setPrototypeOf (X3DImportedNode .prototype, Base_X3DObje
24329
24266
  },
24330
24267
  dispose ()
24331
24268
  {
24332
- for (const route of Array .from (this [X3DImportedNode_executionContext] .getRoutes ()))
24333
- {
24334
- if (route .getSourceNode () === this)
24335
- {
24336
- this [X3DImportedNode_executionContext] .deleteRoute (route);
24337
- continue;
24338
- }
24269
+ this [X3DImportedNode_executionContext] .removeImportedNode (this [_importedName]);
24339
24270
 
24340
- if (route .getDestinationNode () === this)
24341
- {
24342
- this [X3DImportedNode_executionContext] .deleteRoute (route);
24343
- continue;
24344
- }
24345
- }
24271
+ this .instance .dispose ();
24346
24272
 
24347
24273
  Base_X3DObject .prototype .dispose .call (this);
24348
24274
  },
@@ -24379,6 +24305,14 @@ Object .defineProperties (X3DImportedNode .prototype,
24379
24305
  get: X3DImportedNode .prototype .getImportedName,
24380
24306
  enumerable: true,
24381
24307
  },
24308
+ instance:
24309
+ {
24310
+ get ()
24311
+ {
24312
+ return Fields_SFNodeCache .get (this .getInstance ());
24313
+ },
24314
+ enumerable: true,
24315
+ },
24382
24316
  description:
24383
24317
  {
24384
24318
  get: X3DImportedNode .prototype .getDescription,
@@ -24740,11 +24674,14 @@ Object .assign (Object .setPrototypeOf (X3DPrototypeInstance .prototype, Core_X3
24740
24674
 
24741
24675
  this .set_live__ ();
24742
24676
 
24743
- this .importExternProtos (proto .getBody () .externprotos);
24744
- this .importProtos (proto .getBody () .protos);
24745
- this .copyRootNodes (proto .getBody () .rootNodes);
24746
- this .importImportedNodes (proto .getBody () .importedNodes);
24747
- this .copyRoutes (proto .getBody () .routes);
24677
+ const protoBody = proto .getBody ();
24678
+
24679
+ this .addExternProtos (protoBody .externprotos);
24680
+ this .addProtos (protoBody .protos);
24681
+ this .copyNamedNodes (protoBody .namedNodes);
24682
+ this .copyImportedNodes (protoBody .importedNodes);
24683
+ this .copyRootNodes (protoBody .rootNodes);
24684
+ this .copyRoutes (protoBody .routes);
24748
24685
 
24749
24686
  // Propagate events.
24750
24687
 
@@ -25004,20 +24941,25 @@ Object .assign (Object .setPrototypeOf (X3DPrototypeInstance .prototype, Core_X3
25004
24941
 
25005
24942
  return Core_X3DNode .prototype .isDefaultValue .call (this, field);
25006
24943
  },
25007
- importExternProtos (externprotos1)
24944
+ addExternProtos (externprotos1)
25008
24945
  {
25009
24946
  const externprotos2 = this [_body] .externprotos;
25010
24947
 
25011
24948
  for (const externproto of externprotos1)
25012
24949
  externprotos2 .add (externproto .getName (), externproto);
25013
24950
  },
25014
- importProtos (protos1)
24951
+ addProtos (protos1)
25015
24952
  {
25016
24953
  const protos2 = this [_body] .protos;
25017
24954
 
25018
24955
  for (const proto of protos1)
25019
24956
  protos2 .add (proto .getName (), proto);
25020
24957
  },
24958
+ copyNamedNodes (namedNodes)
24959
+ {
24960
+ for (const node of namedNodes)
24961
+ node .copy (this);
24962
+ },
25021
24963
  copyRootNodes (rootNodes1)
25022
24964
  {
25023
24965
  const rootNodes2 = this [_body] .getRootNodes ();
@@ -25025,15 +24967,17 @@ Object .assign (Object .setPrototypeOf (X3DPrototypeInstance .prototype, Core_X3
25025
24967
  for (const node of rootNodes1 .getValue ())
25026
24968
  rootNodes2 .push (node .copy (this));
25027
24969
  },
25028
- importImportedNodes (importedNodes)
24970
+ copyImportedNodes (importedNodes)
25029
24971
  {
24972
+ const body = this [_body];
24973
+
25030
24974
  for (const importedNode of importedNodes)
25031
24975
  {
25032
24976
  try
25033
24977
  {
25034
- const inlineNode = this [_body] .getNamedNode (importedNode .getInlineNode () .getName ());
24978
+ const inlineNode = body .getNamedNode (importedNode .getInlineNode () .getName ());
25035
24979
 
25036
- this [_body] .addImportedNode (inlineNode, importedNode .getExportedName (), importedNode .getImportedName ());
24980
+ body .addImportedNode (inlineNode, importedNode .getExportedName (), importedNode .getImportedName ());
25037
24981
  }
25038
24982
  catch (error)
25039
24983
  {
@@ -25043,19 +24987,17 @@ Object .assign (Object .setPrototypeOf (X3DPrototypeInstance .prototype, Core_X3
25043
24987
  },
25044
24988
  copyRoutes (routes)
25045
24989
  {
24990
+ const body = this [_body];
24991
+
25046
24992
  for (const route of routes)
25047
24993
  {
25048
24994
  try
25049
24995
  {
25050
- const sourceNode = route .getSourceNode () instanceof Core_X3DNode
25051
- ? this [_body] .getLocalNode (route .getSourceNode () .getName ())
25052
- : this [_body] .getLocalNode (route .getSourceNode () .getImportedName ());
25053
-
25054
- const destinationNode = route .getDestinationNode () instanceof Core_X3DNode
25055
- ? this [_body] .getLocalNode (route .getDestinationNode () .getName ())
25056
- : this [_body] .getLocalNode (route .getDestinationNode () .getImportedName ());
24996
+ const
24997
+ sourceNode = body .getLocalNode (route .getSourceNode () .getName ()),
24998
+ destinationNode = body .getLocalNode (route .getDestinationNode () .getName ());
25057
24999
 
25058
- this [_body] .addRoute (sourceNode, route .sourceField, destinationNode, route .destinationField);
25000
+ body .addRoute (sourceNode, route .sourceField, destinationNode, route .destinationField);
25059
25001
  }
25060
25002
  catch (error)
25061
25003
  {
@@ -26007,6 +25949,11 @@ Object .assign (X3DParser .prototype,
26007
25949
 
26008
25950
  return values;
26009
25951
  },
25952
+ checkColorName (color, name)
25953
+ {
25954
+ if (color .every (v => v === 1) && name .toLowerCase () !== "white" && name .match (/^[a-zA-Z]+$/))
25955
+ throw new Error ("Invalid color name.");
25956
+ },
26010
25957
  sanitizeName (name = "")
26011
25958
  {
26012
25959
  // NonIdFirstChar
@@ -26210,7 +26157,7 @@ class Placeholder extends Core_X3DNode
26210
26157
  localNode = this .#namedNodes .get (name) ?? this .#importedNodes .get (name);
26211
26158
 
26212
26159
  const node = localNode instanceof Execution_X3DImportedNode
26213
- ? localNode .getExportedNode (this .#type)
26160
+ ? localNode .getInstance ()
26214
26161
  : localNode;
26215
26162
 
26216
26163
  if (node)
@@ -26320,7 +26267,7 @@ const Grammar = Parser_Expressions ({
26320
26267
 
26321
26268
  // Values
26322
26269
  int32: /(?:0[xX][\da-fA-F]+)|(?:[+-]?\d+)/y,
26323
- double: /[+-]?(?:(?:(?:\d*\.\d+)|(?:\d+(?:\.)?))(?:[eE][+-]?\d+)?)/y,
26270
+ double: /(?!0[xX])[+-]?(?:(?:(?:\d*\.\d+)|(?:\d+(?:\.)?))(?:[eE][+-]?\d+)?)/y,
26324
26271
  doubleQuotes: /"/y,
26325
26272
  noDoubleQuotes: /[^"]+/y,
26326
26273
 
@@ -26422,6 +26369,9 @@ Object .assign (Object .setPrototypeOf (VRMLParser .prototype, Parser_X3DParser
26422
26369
  }
26423
26370
  catch (error)
26424
26371
  {
26372
+ if (DEVELOPMENT)
26373
+ console .error (error);
26374
+
26425
26375
  throw new Error (this .getError (error), { cause: error });
26426
26376
  }
26427
26377
  },
@@ -26575,6 +26525,9 @@ Object .assign (Object .setPrototypeOf (VRMLParser .prototype, Parser_X3DParser
26575
26525
  }
26576
26526
  catch (error)
26577
26527
  {
26528
+ if (DEVELOPMENT)
26529
+ console .error (error);
26530
+
26578
26531
  throw new Error (this .getError (error), { cause: error });
26579
26532
  }
26580
26533
  })
@@ -26929,11 +26882,7 @@ Object .assign (Object .setPrototypeOf (VRMLParser .prototype, Parser_X3DParser
26929
26882
 
26930
26883
  try
26931
26884
  {
26932
- const localNode = this .getExecutionContext () .getLocalNode (nodeNameId);
26933
-
26934
- return localNode instanceof Execution_X3DImportedNode
26935
- ? localNode .getExportedNode ()
26936
- : localNode .getValue ();
26885
+ return this .getExecutionContext () .getLocalNode (nodeNameId) .getValue ();
26937
26886
  }
26938
26887
  catch
26939
26888
  {
@@ -27974,7 +27923,9 @@ Object .assign (Object .setPrototypeOf (VRMLParser .prototype, Parser_X3DParser
27974
27923
 
27975
27924
  if (Grammar .HTMLColor .parse (this))
27976
27925
  {
27977
- const color = this .convertColor (this .result [0] .replace (/0x/i, "#"));
27926
+ const color = this .convertColor (this .result [0] .replace (/^0x/i, "#"));
27927
+
27928
+ this .checkColorName (color, this .result [0]);
27978
27929
 
27979
27930
  field .r = color [0];
27980
27931
  field .g = color [1];
@@ -28007,12 +27958,28 @@ Object .assign (Object .setPrototypeOf (VRMLParser .prototype, Parser_X3DParser
28007
27958
 
28008
27959
  return false;
28009
27960
  },
27961
+ sfColor: new x_ite_Fields .SFColor (),
28010
27962
  sfcolorValues (field)
28011
27963
  {
28012
27964
  const array = [ ];
28013
27965
 
28014
- while (this .double ())
28015
- array .push (this .value);
27966
+ for (;;)
27967
+ {
27968
+ if (this .double ())
27969
+ {
27970
+ array .push (this .value);
27971
+ continue;
27972
+ }
27973
+
27974
+ // Try parse HTML/CSS color values.
27975
+ if (this .sfcolorValue (this .sfColor))
27976
+ {
27977
+ array .push (... this .sfColor);
27978
+ continue;
27979
+ }
27980
+
27981
+ break;
27982
+ }
28016
27983
 
28017
27984
  field .setValue (array);
28018
27985
 
@@ -28055,7 +28022,9 @@ Object .assign (Object .setPrototypeOf (VRMLParser .prototype, Parser_X3DParser
28055
28022
 
28056
28023
  if (Grammar .HTMLColor .parse (this))
28057
28024
  {
28058
- const color = this .convertColor (this .result [0] .replace (/0x/i, "#"));
28025
+ const color = this .convertColor (this .result [0] .replace (/^0x/i, "#"));
28026
+
28027
+ this .checkColorName (color, this .result [0]);
28059
28028
 
28060
28029
  field .r = color [0];
28061
28030
  field .g = color [1];
@@ -28079,7 +28048,7 @@ Object .assign (Object .setPrototypeOf (VRMLParser .prototype, Parser_X3DParser
28079
28048
 
28080
28049
  if (Grammar .OpenBracket .parse (this))
28081
28050
  {
28082
- this .sfcolorValues (field);
28051
+ this .sfcolorrgbaValues (field);
28083
28052
 
28084
28053
  if (Grammar .CloseBracket .parse (this))
28085
28054
  return true;
@@ -28089,6 +28058,33 @@ Object .assign (Object .setPrototypeOf (VRMLParser .prototype, Parser_X3DParser
28089
28058
 
28090
28059
  return false;
28091
28060
  },
28061
+ sfColorRGBA: new x_ite_Fields .SFColorRGBA (),
28062
+ sfcolorrgbaValues (field)
28063
+ {
28064
+ const array = [ ];
28065
+
28066
+ for (;;)
28067
+ {
28068
+ if (this .double ())
28069
+ {
28070
+ array .push (this .value);
28071
+ continue;
28072
+ }
28073
+
28074
+ // Try parse HTML/CSS color values.
28075
+ if (this .sfcolorrgbaValue (this .sfColorRGBA))
28076
+ {
28077
+ array .push (... this .sfColorRGBA);
28078
+ continue;
28079
+ }
28080
+
28081
+ break;
28082
+ }
28083
+
28084
+ field .setValue (array);
28085
+
28086
+ return field .length !== 0;
28087
+ },
28092
28088
  sfdoubleValue (field)
28093
28089
  {
28094
28090
  if (this .double ())
@@ -29859,11 +29855,7 @@ Object .assign (Object .setPrototypeOf (XMLParser .prototype, Parser_X3DParser .
29859
29855
 
29860
29856
  try
29861
29857
  {
29862
- const localNode = this .getExecutionContext () .getLocalNode (name);
29863
-
29864
- const node = localNode instanceof Execution_X3DImportedNode
29865
- ? localNode .getExportedNode (type)
29866
- : localNode .getValue ();
29858
+ const node = this .getExecutionContext () .getLocalNode (name) .getValue ();
29867
29859
 
29868
29860
  this .checkNodeType (node, name, type, typeName);
29869
29861
  this .addNode (xmlElement, node);
@@ -29892,6 +29884,9 @@ Object .assign (Object .setPrototypeOf (XMLParser .prototype, Parser_X3DParser .
29892
29884
  },
29893
29885
  checkNodeType (node, name, type, typeName)
29894
29886
  {
29887
+ if (node instanceof Core_X3DImportedNodeInstance)
29888
+ return;
29889
+
29895
29890
  if (type === Core_X3DNode)
29896
29891
  return;
29897
29892
 
@@ -31166,7 +31161,7 @@ const Plane3_default_ = Plane3;
31166
31161
 
31167
31162
  /* harmony default export */ const Geometry_Plane3 = (x_ite_Namespace .add ("Plane3", Plane3_default_));
31168
31163
  ;// ./src/standard/Math/Geometry/Triangle3.js
31169
- /* provided dependency */ var libtess = __webpack_require__(981);
31164
+ /* provided dependency */ var libtess = __webpack_require__(67);
31170
31165
 
31171
31166
 
31172
31167
  const Triangle3 =
@@ -37860,7 +37855,7 @@ Object .assign (Object .setPrototypeOf (ImageTexture .prototype, Texturing_X3DTe
37860
37855
  {
37861
37856
  fileURL = new URL (fileURL);
37862
37857
 
37863
- if (fileURL .pathname .match (/\.ktx2?(?:\.gz)?$/) || fileURL .href .match (/^\s*data:image\/ktx2[;,]/s))
37858
+ if (fileURL .pathname .match (/\.ktx2?(?:\.gz)?$/) || fileURL .href .match (/^\s*data:image\/ktx2[;,]/))
37864
37859
  {
37865
37860
  this .setLinear (true);
37866
37861
  this .setMipMaps (false);
@@ -47888,7 +47883,7 @@ const Bezier_default_ = Bezier;
47888
47883
 
47889
47884
  /* harmony default export */ const Algorithms_Bezier = (x_ite_Namespace .add ("Bezier", Bezier_default_));
47890
47885
  ;// ./src/x_ite/Parser/SVGParser.js
47891
- /* provided dependency */ var SVGParser_libtess = __webpack_require__(981);
47886
+ /* provided dependency */ var SVGParser_libtess = __webpack_require__(67);
47892
47887
 
47893
47888
 
47894
47889
 
@@ -50747,9 +50742,15 @@ class GoldenGate extends Parser_X3DParser
50747
50742
  if (string === undefined)
50748
50743
  return;
50749
50744
 
50750
- if (string .match (/^\s*$/s))
50745
+ // An empty string should result in an empty XML (encoding) scene.
50746
+ if (string .match (/^\s*$/))
50751
50747
  return "";
50752
50748
 
50749
+ // XML must start with markup. Do not try DOMParser on other input, because
50750
+ // some browsers (Firefox) log a parsing error to the console when it fails.
50751
+ if (!string .match (/^\s*</))
50752
+ return;
50753
+
50753
50754
  return helper.parseXML (string);
50754
50755
  }
50755
50756
  case "JSON":
@@ -51170,9 +51171,6 @@ class FileLoader
51170
51171
  {
51171
51172
  const scene = new Execution_X3DScene (this .browser);
51172
51173
 
51173
- if (!(this .node instanceof Execution_X3DWorld))
51174
- scene .setExecutionContext (this .executionContext);
51175
-
51176
51174
  scene .setWorldURL (new URL (worldURL, this .getBaseURL ()));
51177
51175
  scene .setup ();
51178
51176
 
@@ -51277,7 +51275,7 @@ class FileLoader
51277
51275
 
51278
51276
  // Script:
51279
51277
  {
51280
- const result = url .match (/^\s*(?:ecmascript|javascript|vrmlscript):/s);
51278
+ const result = url .match (/^\s*(?:ecmascript|javascript|vrmlscript):/);
51281
51279
 
51282
51280
  if (result)
51283
51281
  return await this .dataCallback (url .substring (result [0] .length));
@@ -51288,7 +51286,7 @@ class FileLoader
51288
51286
  // Handle data URLs that are not base64 decoded here:
51289
51287
  if (this .dataAsString)
51290
51288
  {
51291
- const result = url .match (/^\s*data:(.*?)(?:;charset=(.*?))?(?:;(base64))?,/s);
51289
+ const result = url .match (/^\s*data:(.*?)(?:;charset=(.*?))?(?:;(base64))?,/);
51292
51290
 
51293
51291
  if (result && result [3] !== "base64")
51294
51292
  {
@@ -51916,8 +51914,6 @@ const ProtoDeclarationArray_default_ = ProtoDeclarationArray;
51916
51914
 
51917
51915
 
51918
51916
 
51919
-
51920
-
51921
51917
  const
51922
51918
  X3DRoute_executionContext = Symbol (),
51923
51919
  _sourceNode = Symbol (),
@@ -51925,8 +51921,7 @@ const
51925
51921
  _sourceField = Symbol (),
51926
51922
  _destinationNode = Symbol (),
51927
51923
  _destinationFieldName = Symbol (),
51928
- _destinationField = Symbol (),
51929
- _disposed = Symbol ();
51924
+ _destinationField = Symbol ();
51930
51925
 
51931
51926
  function X3DRoute (executionContext, sourceNode, sourceFieldName, destinationNode, destinationFieldName)
51932
51927
  {
@@ -51938,11 +51933,11 @@ function X3DRoute (executionContext, sourceNode, sourceFieldName, destinationNod
51938
51933
  this [_destinationNode] = destinationNode;
51939
51934
  this [_destinationFieldName] = destinationFieldName;
51940
51935
 
51941
- if (sourceNode instanceof Execution_X3DImportedNode)
51942
- sourceNode .getInlineNode () ._loadState .addInterest ("reconnect", this);
51936
+ if (sourceNode instanceof Core_X3DImportedNodeInstance)
51937
+ sourceNode .getImportedNode () .getInlineNode () ._loadState .addInterest ("reconnect", this);
51943
51938
 
51944
- if (destinationNode instanceof Execution_X3DImportedNode)
51945
- destinationNode .getInlineNode () ._loadState .addInterest ("reconnect", this);
51939
+ if (destinationNode instanceof Core_X3DImportedNodeInstance)
51940
+ destinationNode .getImportedNode () .getInlineNode () ._loadState .addInterest ("reconnect", this);
51946
51941
 
51947
51942
  this .reconnect ();
51948
51943
  }
@@ -51953,17 +51948,8 @@ Object .assign (Object .setPrototypeOf (X3DRoute .prototype, Base_X3DObject .pro
51953
51948
  {
51954
51949
  return this [X3DRoute_executionContext];
51955
51950
  },
51956
- getRouteId ()
51957
- {
51958
- return X3DRoute .getRouteId (this [_sourceNode], this [_sourceFieldName], this [_destinationNode], this [_destinationFieldName]);
51959
- },
51960
51951
  getSourceNode ()
51961
51952
  {
51962
- /// SAI
51963
-
51964
- if (this [_sourceNode] instanceof Execution_X3DImportedNode)
51965
- return this [_sourceNode] .getExportedNode ();
51966
-
51967
51953
  return this [_sourceNode];
51968
51954
  },
51969
51955
  getSourceField ()
@@ -51984,11 +51970,6 @@ Object .assign (Object .setPrototypeOf (X3DRoute .prototype, Base_X3DObject .pro
51984
51970
  },
51985
51971
  getDestinationNode ()
51986
51972
  {
51987
- /// SAI
51988
-
51989
- if (this [_destinationNode] instanceof Execution_X3DImportedNode)
51990
- return this [_destinationNode] .getExportedNode ();
51991
-
51992
51973
  return this [_destinationNode];
51993
51974
  },
51994
51975
  getDestinationField ()
@@ -52015,10 +51996,10 @@ Object .assign (Object .setPrototypeOf (X3DRoute .prototype, Base_X3DObject .pro
52015
51996
  }
52016
51997
  catch (error)
52017
51998
  {
52018
- if ((this [_sourceNode] instanceof Core_X3DNode ||
52019
- this [_sourceNode] .getInlineNode () .checkLoadState () === Base_X3DConstants .COMPLETE_STATE) &&
52020
- (this [_destinationNode] instanceof Core_X3DNode ||
52021
- this [_destinationNode] .getInlineNode () .checkLoadState () === Base_X3DConstants .COMPLETE_STATE))
51999
+ if ((!(this [_sourceNode] instanceof Core_X3DImportedNodeInstance) ||
52000
+ this [_sourceNode] .getImportedNode () .getInlineNode () .checkLoadState () === Base_X3DConstants .COMPLETE_STATE) &&
52001
+ (!(this [_destinationNode] instanceof Core_X3DImportedNodeInstance) ||
52002
+ this [_destinationNode] .getImportedNode () .getInlineNode () .checkLoadState () === Base_X3DConstants .COMPLETE_STATE))
52022
52003
  {
52023
52004
  console .warn (error);
52024
52005
  }
@@ -52026,18 +52007,11 @@ Object .assign (Object .setPrototypeOf (X3DRoute .prototype, Base_X3DObject .pro
52026
52007
  },
52027
52008
  connect ()
52028
52009
  {
52029
- if (this [_disposed])
52030
- return;
52031
-
52032
52010
  const errors = [ ];
52033
52011
 
52034
52012
  try
52035
52013
  {
52036
- const sourceNode = this [_sourceNode] instanceof Core_X3DNode
52037
- ? this [_sourceNode]
52038
- : this [_sourceNode] .getExportedNode ();
52039
-
52040
- this [_sourceField] = sourceNode .getField (this [_sourceFieldName]);
52014
+ this [_sourceField] = this [_sourceNode] .getField (this [_sourceFieldName]);
52041
52015
  }
52042
52016
  catch (error)
52043
52017
  {
@@ -52046,11 +52020,7 @@ Object .assign (Object .setPrototypeOf (X3DRoute .prototype, Base_X3DObject .pro
52046
52020
 
52047
52021
  try
52048
52022
  {
52049
- const destinationNode = this [_destinationNode] instanceof Core_X3DNode
52050
- ? this [_destinationNode]
52051
- : this [_destinationNode] .getExportedNode ();
52052
-
52053
- this [_destinationField] = destinationNode .getField (this [_destinationFieldName]);
52023
+ this [_destinationField] = this [_destinationNode] .getField (this [_destinationFieldName]);
52054
52024
  }
52055
52025
  catch (error)
52056
52026
  {
@@ -52089,13 +52059,13 @@ Object .assign (Object .setPrototypeOf (X3DRoute .prototype, Base_X3DObject .pro
52089
52059
  if (!generator .ExistsRouteNode (this [_destinationNode]))
52090
52060
  throw new Error (`Destination node does not exist in scene graph.`);
52091
52061
 
52092
- const sourceNodeName = this [_sourceNode] instanceof Core_X3DNode
52093
- ? generator .Name (this [_sourceNode])
52094
- : generator .ImportedName (this [_sourceNode]);
52062
+ const sourceNodeName = this [_sourceNode] instanceof Core_X3DImportedNodeInstance
52063
+ ? generator .ImportedName (this [_sourceNode])
52064
+ : generator .Name (this [_sourceNode]);
52095
52065
 
52096
- const destinationNodeName = this [_destinationNode] instanceof Core_X3DNode
52097
- ? generator .Name (this [_destinationNode])
52098
- : generator .ImportedName (this [_destinationNode]);
52066
+ const destinationNodeName = this [_destinationNode] instanceof Core_X3DImportedNodeInstance
52067
+ ? generator .ImportedName (this [_destinationNode])
52068
+ : generator .Name (this [_destinationNode]);
52099
52069
 
52100
52070
  generator .Indent ();
52101
52071
  generator .string += "ROUTE";
@@ -52118,13 +52088,13 @@ Object .assign (Object .setPrototypeOf (X3DRoute .prototype, Base_X3DObject .pro
52118
52088
  if (!generator .ExistsRouteNode (this [_destinationNode]))
52119
52089
  throw new Error (`Destination node does not exist in scene graph.`);
52120
52090
 
52121
- const sourceNodeName = this [_sourceNode] instanceof Core_X3DNode
52122
- ? generator .Name (this [_sourceNode])
52123
- : generator .ImportedName (this [_sourceNode]);
52091
+ const sourceNodeName = this [_sourceNode] instanceof Core_X3DImportedNodeInstance
52092
+ ? generator .ImportedName (this [_sourceNode])
52093
+ : generator .Name (this [_sourceNode]);
52124
52094
 
52125
- const destinationNodeName = this [_destinationNode] instanceof Core_X3DNode
52126
- ? generator .Name (this [_destinationNode])
52127
- : generator .ImportedName (this [_destinationNode]);
52095
+ const destinationNodeName = this [_destinationNode] instanceof Core_X3DImportedNodeInstance
52096
+ ? generator .ImportedName (this [_destinationNode])
52097
+ : generator .Name (this [_destinationNode]);
52128
52098
 
52129
52099
  generator .openTag ("ROUTE");
52130
52100
  generator .attribute ("fromNode", sourceNodeName);
@@ -52141,13 +52111,13 @@ Object .assign (Object .setPrototypeOf (X3DRoute .prototype, Base_X3DObject .pro
52141
52111
  if (!generator .ExistsRouteNode (this [_destinationNode]))
52142
52112
  throw new Error (`Destination node does not exist in scene graph.`);
52143
52113
 
52144
- const sourceNodeName = this [_sourceNode] instanceof Core_X3DNode
52145
- ? generator .Name (this [_sourceNode])
52146
- : generator .ImportedName (this [_sourceNode]);
52114
+ const sourceNodeName = this [_sourceNode] instanceof Core_X3DImportedNodeInstance
52115
+ ? generator .ImportedName (this [_sourceNode])
52116
+ : generator .Name (this [_sourceNode]);
52147
52117
 
52148
- const destinationNodeName = this [_destinationNode] instanceof Core_X3DNode
52149
- ? generator .Name (this [_destinationNode])
52150
- : generator .ImportedName (this [_destinationNode]);
52118
+ const destinationNodeName = this [_destinationNode] instanceof Core_X3DImportedNodeInstance
52119
+ ? generator .ImportedName (this [_destinationNode])
52120
+ : generator .Name (this [_destinationNode]);
52151
52121
 
52152
52122
  generator .TidyBreak ();
52153
52123
  generator .Indent ();
@@ -52164,18 +52134,13 @@ Object .assign (Object .setPrototypeOf (X3DRoute .prototype, Base_X3DObject .pro
52164
52134
  },
52165
52135
  dispose ()
52166
52136
  {
52167
- if (this [_disposed])
52168
- return;
52169
-
52170
- this [_disposed] = true;
52171
-
52172
52137
  this .disconnect ();
52173
52138
 
52174
- if (this [_sourceNode] instanceof Execution_X3DImportedNode)
52175
- this [_sourceNode] .getInlineNode () ._loadState .removeInterest ("reconnect", this);
52139
+ if (this [_sourceNode] instanceof Core_X3DImportedNodeInstance)
52140
+ this [_sourceNode] .getImportedNode () .getInlineNode () ._loadState .removeInterest ("reconnect", this);
52176
52141
 
52177
- if (this [_destinationNode] instanceof Execution_X3DImportedNode)
52178
- this [_destinationNode] .getInlineNode () ._loadState .removeInterest ("reconnect", this);
52142
+ if (this [_destinationNode] instanceof Core_X3DImportedNodeInstance)
52143
+ this [_destinationNode] .getImportedNode () .getInlineNode () ._loadState .removeInterest ("reconnect", this);
52179
52144
 
52180
52145
  this [X3DRoute_executionContext] .deleteRoute (this);
52181
52146
 
@@ -52227,36 +52192,6 @@ Object .defineProperties (X3DRoute,
52227
52192
 
52228
52193
  Object .assign (X3DRoute,
52229
52194
  {
52230
- getRouteId (sourceNode, sourceFieldName, destinationNode, destinationFieldName)
52231
- {
52232
- const sourceField = sourceNode instanceof Core_X3DNode
52233
- ? sourceNode .getField (sourceFieldName)
52234
- : helper.try (() => sourceNode .getExportedNode () .getField (sourceFieldName));
52235
-
52236
- const destinationField = destinationNode instanceof Core_X3DNode
52237
- ? destinationNode .getField (destinationFieldName)
52238
- : helper.try (() => destinationNode .getExportedNode () .getField (destinationFieldName));
52239
-
52240
- X3DRoute .checkFields (sourceField, destinationField);
52241
-
52242
- if (sourceField)
52243
- {
52244
- sourceFieldName = sourceField .getName ();
52245
-
52246
- if (sourceField .getAccessType () === Base_X3DConstants .inputOutput)
52247
- sourceFieldName += "_changed";
52248
- }
52249
-
52250
- if (destinationField)
52251
- {
52252
- destinationFieldName = destinationField .getName ();
52253
-
52254
- if (destinationField .getAccessType () === Base_X3DConstants .inputOutput)
52255
- destinationFieldName = "set_" + destinationFieldName;
52256
- }
52257
-
52258
- return `${sourceNode .getId ()}.${sourceFieldName}.${destinationNode .getId ()}.${destinationFieldName}`;
52259
- },
52260
52195
  checkFields (sourceField, destinationField)
52261
52196
  {
52262
52197
  if (sourceField && destinationField)
@@ -52329,6 +52264,7 @@ const RouteArray_default_ = RouteArray;
52329
52264
 
52330
52265
 
52331
52266
 
52267
+
52332
52268
  const
52333
52269
  _outerNode = Symbol (),
52334
52270
  _namedNodes = Symbol (),
@@ -52537,10 +52473,13 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52537
52473
  if (!node)
52538
52474
  throw new Error ("Couldn't add named node: node must be of type X3DNode.");
52539
52475
 
52476
+ if (node instanceof Core_X3DImportedNodeInstance)
52477
+ throw new Error ("Couldn't add named node: node cannot be of type X3DImportedNodeInstance.");
52478
+
52540
52479
  if (node .getExecutionContext () !== this)
52541
52480
  throw new Error ("Couldn't add named node: node does not belong to this execution context.");
52542
52481
 
52543
- if (name .length === 0)
52482
+ if (!name)
52544
52483
  throw new Error ("Couldn't add named node: node name is empty.");
52545
52484
 
52546
52485
  if (this [_namedNodes] .has (name))
@@ -52563,10 +52502,13 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52563
52502
  if (!node)
52564
52503
  throw new Error ("Couldn't update named node: node must be of type X3DNode.");
52565
52504
 
52505
+ if (node instanceof Core_X3DImportedNodeInstance)
52506
+ throw new Error ("Couldn't add named node: node cannot be of type X3DImportedNodeInstance.");
52507
+
52566
52508
  if (node .getExecutionContext () !== this)
52567
52509
  throw new Error ("Couldn't update named node: node does not belong to this execution context.");
52568
52510
 
52569
- if (name .length === 0)
52511
+ if (!name)
52570
52512
  throw new Error ("Couldn't update named node: node name is empty.");
52571
52513
 
52572
52514
  // Remove named node.
@@ -52635,10 +52577,10 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52635
52577
  if (inlineNode .getExecutionContext () !== this)
52636
52578
  throw new Error ("Couldn't update imported node: Inline node does not belong to this execution context.");
52637
52579
 
52638
- if (exportedName .length === 0)
52580
+ if (!exportedName)
52639
52581
  throw new Error ("Couldn't update imported node: exported name is empty.");
52640
52582
 
52641
- if (importedName .length === 0)
52583
+ if (!importedName)
52642
52584
  throw new Error ("Couldn't update imported node: imported name is empty.");
52643
52585
 
52644
52586
  // Update imported node.
@@ -52649,8 +52591,6 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52649
52591
 
52650
52592
  this [_importedNodes] .add (importedName, importedNode);
52651
52593
 
52652
- importedNode .updateExportedNode ();
52653
-
52654
52594
  this ._sceneGraph_changed = Date .now () / 1000;
52655
52595
  },
52656
52596
  renameImportedNode (oldImportedName, newImportedName)
@@ -52663,7 +52603,7 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52663
52603
  if (this [_importedNodes] .get (newImportedName))
52664
52604
  throw new Error ("Couldn't rename imported node: new imported name does already exists.");
52665
52605
 
52666
- importedNode [Symbol .for ("X_ITE.X3DImportedNode.setImportName")] (newImportedName);
52606
+ importedNode .setImportName (newImportedName);
52667
52607
 
52668
52608
  this [_importedNodes] .update (oldImportedName, newImportedName, importedNode);
52669
52609
 
@@ -52678,10 +52618,10 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52678
52618
  if (!importedNode)
52679
52619
  return;
52680
52620
 
52681
- importedNode .dispose ();
52682
-
52683
52621
  this [_importedNodes] .remove (importedName);
52684
52622
 
52623
+ importedNode .dispose ();
52624
+
52685
52625
  this ._sceneGraph_changed = Date .now () / 1000;
52686
52626
  },
52687
52627
  getImportedNode (importedName)
@@ -52691,7 +52631,7 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52691
52631
  const importedNode = this [_importedNodes] .get (importedName);
52692
52632
 
52693
52633
  if (importedNode)
52694
- return importedNode .exportedNode;
52634
+ return importedNode .instance;
52695
52635
 
52696
52636
  throw new Error (`Imported node '${importedName}' not found.`);
52697
52637
  },
@@ -52716,7 +52656,7 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52716
52656
  const importedNode = this [_importedNodes] .get (name);
52717
52657
 
52718
52658
  if (importedNode)
52719
- return importedNode;
52659
+ return importedNode .instance;
52720
52660
 
52721
52661
  throw new Error (`Unknown named or imported node '${name}'.`);
52722
52662
  }
@@ -52726,28 +52666,19 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52726
52666
  * @param {SFNode|X3DNode|X3DImportedNode} node
52727
52667
  * @returns either an X3DImportedNode if possible or X3DNode
52728
52668
  */
52729
- getLocalizedNode (node)
52669
+ getNodeOrImportedNode (node)
52730
52670
  {
52731
- node = Base_X3DCast (Base_X3DConstants .X3DNode, node, false)
52732
- ?? (node instanceof Execution_X3DImportedNode ? node : null);
52671
+ node = Base_X3DCast (Base_X3DConstants .X3DNode, node, false);
52733
52672
 
52734
52673
  if (!node)
52735
52674
  throw new Error ("Couldn't get localized node: node must be of type X3DNode.");
52736
52675
 
52737
- if (node .getExecutionContext () === this)
52738
- {
52739
- if (node instanceof Core_X3DImportedNodeProxy)
52740
- return node .getImportedNode ();
52741
-
52742
- return node;
52743
- }
52744
-
52745
52676
  for (const importedNode of this [_importedNodes])
52746
52677
  {
52747
52678
  try
52748
52679
  {
52749
- if (importedNode .getSharedNode () === node)
52750
- return importedNode;
52680
+ if (importedNode .getExportedNode () === node)
52681
+ return importedNode .getInstance ();
52751
52682
  }
52752
52683
  catch
52753
52684
  { }
@@ -52788,7 +52719,7 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52788
52719
  if (this [_protos] .get (proto .getName ()) === proto)
52789
52720
  throw new Error (`Couldn't add proto declaration: proto '${proto .getName ()}' already added.`);
52790
52721
 
52791
- if (name .length === 0)
52722
+ if (!name)
52792
52723
  throw new Error ("Couldn't add proto declaration: proto name is empty.");
52793
52724
 
52794
52725
  if (this [_externprotos] .has (name))
@@ -52812,7 +52743,7 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52812
52743
  if (proto .getExecutionContext () !== this)
52813
52744
  throw new Error ("Couldn't update proto declaration: proto does not belong to this execution context.");
52814
52745
 
52815
- if (name .length === 0)
52746
+ if (!name)
52816
52747
  throw new Error ("Couldn't update proto declaration: proto name is empty.");
52817
52748
 
52818
52749
  if (this [_externprotos] .has (name))
@@ -52869,7 +52800,7 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52869
52800
  if (this [_externprotos] .get (externproto .getName ()) === externproto)
52870
52801
  throw new Error (`Couldn't add extern proto declaration: extern proto '${externproto .getName ()}' already added.`);
52871
52802
 
52872
- if (name .length === 0)
52803
+ if (!name)
52873
52804
  throw new Error ("Couldn't add extern proto declaration: extern proto name is empty.");
52874
52805
 
52875
52806
  if (this [_protos] .has (name))
@@ -52893,7 +52824,7 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52893
52824
  if (externproto .getExecutionContext () !== this)
52894
52825
  throw new Error ("Couldn't update extern proto declaration: extern proto does not belong to this execution context.");
52895
52826
 
52896
- if (name .length === 0)
52827
+ if (!name)
52897
52828
  throw new Error ("Couldn't update extern proto declaration: extern proto name is empty.");
52898
52829
 
52899
52830
  if (this [_protos] .has (name))
@@ -52927,13 +52858,9 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52927
52858
  {
52928
52859
  // Normalize arguments.
52929
52860
 
52930
- const
52931
- importedSourceNode = sourceNode instanceof Execution_X3DImportedNode ? sourceNode : null,
52932
- importedDestinationNode = destinationNode instanceof Execution_X3DImportedNode ? destinationNode : null;
52933
-
52934
- sourceNode = Base_X3DCast (Base_X3DConstants .X3DNode, sourceNode, false) ?? importedSourceNode;
52861
+ sourceNode = Base_X3DCast (Base_X3DConstants .X3DNode, sourceNode, false);
52935
52862
  sourceField = String (sourceField);
52936
- destinationNode = Base_X3DCast (Base_X3DConstants .X3DNode, destinationNode, false) ?? importedDestinationNode;
52863
+ destinationNode = Base_X3DCast (Base_X3DConstants .X3DNode, destinationNode, false);
52937
52864
  destinationField = String (destinationField);
52938
52865
 
52939
52866
  // Check nodes.
@@ -52946,14 +52873,11 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52946
52873
 
52947
52874
  // Resolve imported source and destination node.
52948
52875
 
52949
- sourceNode = this .getLocalizedNode (sourceNode);
52950
- destinationNode = this .getLocalizedNode (destinationNode);
52876
+ sourceNode = this .getNodeOrImportedNode (sourceNode);
52877
+ destinationNode = this .getNodeOrImportedNode (destinationNode);
52951
52878
 
52952
52879
  // Add route.
52953
-
52954
- const
52955
- id = Routing_X3DRoute .getRouteId (sourceNode, sourceField, destinationNode, destinationField),
52956
- route = this [_routes] .get (id);
52880
+ const route = this .getRoute (sourceNode, sourceField, destinationNode, destinationField);
52957
52881
 
52958
52882
  if (route)
52959
52883
  {
@@ -52963,7 +52887,7 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52963
52887
  {
52964
52888
  const route = new Routing_X3DRoute (this, sourceNode, sourceField, destinationNode, destinationField);
52965
52889
 
52966
- this [_routes] .add (id, route);
52890
+ this [_routes] .add (route .getId (), route);
52967
52891
 
52968
52892
  return route;
52969
52893
  }
@@ -52977,25 +52901,21 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52977
52901
  if (!(route instanceof Routing_X3DRoute))
52978
52902
  return;
52979
52903
 
52980
- if (this [_routes] .get (route .getRouteId ()) !== route)
52904
+ if (!this .routes .has (route .getId ()))
52981
52905
  return;
52982
52906
 
52983
- this [_routes] .remove (route .getRouteId ());
52907
+ this [_routes] .remove (route .getId ());
52984
52908
 
52985
52909
  route .dispose ();
52986
52910
  },
52987
- getRoute (sourceNode, sourceField, destinationNode, destinationField)
52911
+ getRoute (sourceNode, sourceFieldName, destinationNode, destinationFieldName)
52988
52912
  {
52989
52913
  // Normalize arguments.
52990
52914
 
52991
- const
52992
- importedSourceNode = sourceNode instanceof Execution_X3DImportedNode ? sourceNode : null,
52993
- importedDestinationNode = destinationNode instanceof Execution_X3DImportedNode ? destinationNode : null;
52994
-
52995
- sourceNode = Base_X3DCast (Base_X3DConstants .X3DNode, sourceNode, false) ?? importedSourceNode;
52996
- sourceField = String (sourceField);
52997
- destinationNode = Base_X3DCast (Base_X3DConstants .X3DNode, destinationNode, false) ?? importedDestinationNode;
52998
- destinationField = String (destinationField);
52915
+ sourceNode = Base_X3DCast (Base_X3DConstants .X3DNode, sourceNode, false);
52916
+ sourceFieldName = String (sourceFieldName);
52917
+ destinationNode = Base_X3DCast (Base_X3DConstants .X3DNode, destinationNode, false);
52918
+ destinationFieldName = String (destinationFieldName);
52999
52919
 
53000
52920
  // Check nodes.
53001
52921
 
@@ -53007,12 +52927,69 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
53007
52927
 
53008
52928
  // Resolve imported source and destination node.
53009
52929
 
53010
- sourceNode = this .getLocalizedNode (sourceNode);
53011
- destinationNode = this .getLocalizedNode (destinationNode);
52930
+ sourceNode = this .getNodeOrImportedNode (sourceNode);
52931
+ destinationNode = this .getNodeOrImportedNode (destinationNode);
52932
+
52933
+ // Get fields if possible.
52934
+
52935
+ const sourceField = sourceNode instanceof Core_X3DImportedNodeInstance
52936
+ ? helper.try (() => sourceNode .getField (sourceFieldName))
52937
+ : sourceNode .getField (sourceFieldName);
52938
+
52939
+ const destinationField = destinationNode instanceof Core_X3DImportedNodeInstance
52940
+ ? helper.try (() => destinationNode .getField (destinationFieldName))
52941
+ : destinationNode .getField (destinationFieldName);
52942
+
52943
+ Routing_X3DRoute .checkFields (sourceField, destinationField);
53012
52944
 
53013
52945
  // Return route.
53014
52946
 
53015
- return this [_routes] .get (Routing_X3DRoute .getRouteId (sourceNode, sourceField, destinationNode, destinationField));
52947
+ return this [_routes] .find (route =>
52948
+ {
52949
+ if (route .getSourceNode () !== sourceNode)
52950
+ return false;
52951
+
52952
+ if (route .getDestinationNode () !== destinationNode)
52953
+ return false;
52954
+
52955
+ if (sourceField)
52956
+ {
52957
+ if (helper.try (() => sourceNode .getField (route .getSourceField ())) !== sourceField)
52958
+ return false;
52959
+ }
52960
+ else
52961
+ {
52962
+ if (sourceNode instanceof Core_X3DImportedNodeInstance)
52963
+ {
52964
+ if (route .getSourceField () !== sourceFieldName)
52965
+ return false;
52966
+ }
52967
+ else
52968
+ {
52969
+ return false;
52970
+ }
52971
+ }
52972
+
52973
+ if (destinationField)
52974
+ {
52975
+ if (helper.try (() => destinationNode .getField (route .getDestinationField ())) !== destinationField)
52976
+ return false;
52977
+ }
52978
+ else
52979
+ {
52980
+ if (destinationNode instanceof Core_X3DImportedNodeInstance)
52981
+ {
52982
+ if (route .getDestinationField () !== destinationFieldName)
52983
+ return false;
52984
+ }
52985
+ else
52986
+ {
52987
+ return false;
52988
+ }
52989
+ }
52990
+
52991
+ return true;
52992
+ });
53016
52993
  },
53017
52994
  getRoutes ()
53018
52995
  {
@@ -53578,6 +53555,12 @@ Object .assign (Object .setPrototypeOf (X3DExportedNode .prototype, Base_X3DObje
53578
53555
  generator .endObject ();
53579
53556
  generator .endObject ();
53580
53557
  },
53558
+ dispose ()
53559
+ {
53560
+ this [X3DExportedNode_executionContext] .removeExportedNode (this [X3DExportedNode_exportedName]);
53561
+
53562
+ Base_X3DObject .prototype .dispose .call (this);
53563
+ },
53581
53564
  });
53582
53565
 
53583
53566
  for (const key of Object .keys (X3DExportedNode .prototype))
@@ -53668,6 +53651,7 @@ const LATEST_VERSION_default_ = "4.1";
53668
53651
 
53669
53652
 
53670
53653
 
53654
+
53671
53655
  const
53672
53656
  _specificationVersion = Symbol (),
53673
53657
  _encoding = Symbol (),
@@ -53676,7 +53660,7 @@ const
53676
53660
  _worldURL = Symbol (),
53677
53661
  _units = Symbol (),
53678
53662
  _metadata = Symbol (),
53679
- X3DScene_exportedNodes = Symbol (),
53663
+ _exportedNodes = Symbol (),
53680
53664
  _loadingObjects = Symbol ();
53681
53665
 
53682
53666
  function X3DScene (browser)
@@ -53708,12 +53692,12 @@ function X3DScene (browser)
53708
53692
  this [_units] .add ("mass", new Configuration_UnitInfo ("mass", "kilogram", 1));
53709
53693
 
53710
53694
  this [_metadata] = [ ];
53711
- this [X3DScene_exportedNodes] = new Execution_ExportedNodesArray ();
53695
+ this [_exportedNodes] = new Execution_ExportedNodesArray ();
53712
53696
  this [_loadingObjects] = new Set ();
53713
53697
 
53714
53698
  this [_components] .addParent (this);
53715
53699
  this [_units] .addParent (this);
53716
- this [X3DScene_exportedNodes] .addParent (this);
53700
+ this [_exportedNodes] .addParent (this);
53717
53701
  }
53718
53702
 
53719
53703
  Object .assign (Object .setPrototypeOf (X3DScene .prototype, Execution_X3DExecutionContext .prototype),
@@ -53769,7 +53753,7 @@ Object .assign (Object .setPrototypeOf (X3DScene .prototype, Execution_X3DExecut
53769
53753
  hasComponent (name, level = 0)
53770
53754
  {
53771
53755
  if (name instanceof Configuration_ComponentInfo)
53772
- var { name, level } = name;
53756
+ ({ name, level } = name);
53773
53757
 
53774
53758
  const
53775
53759
  browser = this .getBrowser (),
@@ -53940,7 +53924,7 @@ Object .assign (Object .setPrototypeOf (X3DScene .prototype, Execution_X3DExecut
53940
53924
  {
53941
53925
  exportedName = String (exportedName);
53942
53926
 
53943
- if (this [X3DScene_exportedNodes] .has (exportedName))
53927
+ if (this [_exportedNodes] .has (exportedName))
53944
53928
  throw new Error (`Couldn't add exported node: exported name '${exportedName}' already in use.`);
53945
53929
 
53946
53930
  this .updateExportedNode (exportedName, node, description);
@@ -53953,18 +53937,21 @@ Object .assign (Object .setPrototypeOf (X3DScene .prototype, Execution_X3DExecut
53953
53937
  node = Base_X3DCast (Base_X3DConstants .X3DNode, node, false);
53954
53938
  description = String (description);
53955
53939
 
53956
- if (exportedName .length === 0)
53957
- throw new Error ("Couldn't update exported node: node exported name is empty.");
53958
-
53959
53940
  if (!node)
53960
53941
  throw new Error ("Couldn't update exported node: node must be of type X3DNode.");
53961
53942
 
53962
- //if (node .getExecutionContext () !== this)
53963
- // throw new Error ("Couldn't update exported node: node does not belong to this execution context.");
53943
+ if (node instanceof Core_X3DImportedNodeInstance)
53944
+ throw new Error ("Couldn't update exported node: node cannot be of type X3DImportedNodeInstance.");
53945
+
53946
+ if (node .getExecutionContext () !== this)
53947
+ throw new Error ("Couldn't update exported node: node does not belong to this execution context.");
53948
+
53949
+ if (!exportedName)
53950
+ throw new Error ("Couldn't update exported node: node exported name is empty.");
53964
53951
 
53965
53952
  const exportedNode = new Execution_X3DExportedNode (this, exportedName, node, description);
53966
53953
 
53967
- this [X3DScene_exportedNodes] .update (exportedName, exportedName, exportedNode);
53954
+ this [_exportedNodes] .update (exportedName, exportedName, exportedNode);
53968
53955
 
53969
53956
  this ._sceneGraph_changed = Date .now () / 1000;
53970
53957
  },
@@ -53972,7 +53959,14 @@ Object .assign (Object .setPrototypeOf (X3DScene .prototype, Execution_X3DExecut
53972
53959
  {
53973
53960
  exportedName = String (exportedName);
53974
53961
 
53975
- this [X3DScene_exportedNodes] .remove (exportedName);
53962
+ const exportedNode = this [_exportedNodes] .get (exportedName);
53963
+
53964
+ if (!exportedNode)
53965
+ return;
53966
+
53967
+ this [_exportedNodes] .remove (exportedName);
53968
+
53969
+ exportedNode .dispose ();
53976
53970
 
53977
53971
  this ._sceneGraph_changed = Date .now () / 1000;
53978
53972
  },
@@ -53980,7 +53974,7 @@ Object .assign (Object .setPrototypeOf (X3DScene .prototype, Execution_X3DExecut
53980
53974
  {
53981
53975
  exportedName = String (exportedName);
53982
53976
 
53983
- const exportedNode = this [X3DScene_exportedNodes] .get (exportedName);
53977
+ const exportedNode = this [_exportedNodes] .get (exportedName);
53984
53978
 
53985
53979
  if (exportedNode)
53986
53980
  return exportedNode .localNode;
@@ -53989,11 +53983,11 @@ Object .assign (Object .setPrototypeOf (X3DScene .prototype, Execution_X3DExecut
53989
53983
  },
53990
53984
  getExportedNodes ()
53991
53985
  {
53992
- return this [X3DScene_exportedNodes];
53986
+ return this [_exportedNodes];
53993
53987
  },
53994
53988
  getUniqueExportName (name)
53995
53989
  {
53996
- return getUniqueName (this [X3DScene_exportedNodes], name);
53990
+ return getUniqueName (this [_exportedNodes], name);
53997
53991
  },
53998
53992
  addRootNode (node)
53999
53993
  {
@@ -54269,7 +54263,7 @@ Object .assign (Object .setPrototypeOf (X3DScene .prototype, Execution_X3DExecut
54269
54263
 
54270
54264
  generator .endArray ();
54271
54265
 
54272
- headLastProperty = true;
54266
+ // headLastProperty = true;
54273
54267
  }
54274
54268
 
54275
54269
  // Head end
@@ -54598,6 +54592,7 @@ Fonts_add ("PT_Sans/PTSans-Italic.woff2", false, true);
54598
54592
 
54599
54593
 
54600
54594
 
54595
+
54601
54596
  const
54602
54597
  _instanceId = Symbol (),
54603
54598
  _element = Symbol (),
@@ -54661,7 +54656,9 @@ function X3DCoreContext (element)
54661
54656
  {
54662
54657
  const link = document .createElement ("link");
54663
54658
 
54664
- link .integrity = "sha384-fEzovT4J83tA9kKXGV4bUgl6uLo/jpIuUjb7ogp7mj1miyDlddDqWywNrpuG5Yzv";
54659
+ if (!DEVELOPMENT)
54660
+ link .integrity = "sha384-PV+KMMYFFsD4yJSRNZxR5SQtB1+/svusY5D4rmCUw1HodNYMj3Nx2fKast5z9E0g";
54661
+
54665
54662
  link .rel = "stylesheet";
54666
54663
  link .crossOrigin = "anonymous";
54667
54664
  link .onload = resolve;
@@ -65656,6 +65653,7 @@ const
65656
65653
  _defaultFramebuffer = Symbol (),
65657
65654
  _textureBuffers = Symbol (),
65658
65655
  _resizer = Symbol (),
65656
+ _traverse = Symbol .for ("X_ITE.X3DBrowserContext.traverse"),
65659
65657
  _localObjects = Symbol (),
65660
65658
  _fullscreenArray = Symbol (),
65661
65659
  _fullscreenBuffer = Symbol (),
@@ -65700,12 +65698,7 @@ Object .assign (X3DRenderingContext .prototype,
65700
65698
 
65701
65699
  helper.on (this, window, "orientationchange", () => this .reshape ());
65702
65700
 
65703
- this [_resizer] = new ResizeObserver (() =>
65704
- {
65705
- this .reshape ();
65706
-
65707
- this [Symbol .for ("X_ITE.X3DBrowserContext.traverse")] (performance .now ());
65708
- });
65701
+ this [_resizer] = new ResizeObserver (() => this .reshape ());
65709
65702
 
65710
65703
  this [_resizer] .observe (this .getSurface ());
65711
65704
 
@@ -65982,6 +65975,9 @@ Object .assign (X3DRenderingContext .prototype,
65982
65975
 
65983
65976
  this .reshapeFramebuffer (0, 0, 0, width, height);
65984
65977
 
65978
+ if (this .getWorld ())
65979
+ this [_traverse] (-1);
65980
+
65985
65981
  this .addBrowserEvent ();
65986
65982
  },
65987
65983
  limitFramebufferSize (width, height)
@@ -67317,7 +67313,7 @@ vec3 color=vec3(0);vec3 v=normalize(-vertex);
67317
67313
  #if defined(X3D_USE_IBL)||defined(X3D_LIGHTING)
67318
67314
  NormalInfo normalInfo=getNormalInfo(x3d_Material.normalScale);vec3 n=normalInfo.n;float NdotV=clamp(dot(n,v),0.,1.);
67319
67315
  #if defined(X3D_RETROREFLECTION_MATERIAL_EXT)
67320
- vec3 v_retro=reflect(-v,n);float NdotV_retro=clamp(dot(n,v_retro),0.,1.);
67316
+ vec3 v_retro=normalize(reflect(-v,n));
67321
67317
  #endif
67322
67318
  #endif
67323
67319
  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;
@@ -67345,6 +67341,9 @@ materialInfo=getVolumeInfo(materialInfo);
67345
67341
  #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)
67346
67342
  materialInfo=getIridescenceInfo(materialInfo);
67347
67343
  #endif
67344
+ #if defined(X3D_RETROREFLECTION_MATERIAL_EXT)
67345
+ materialInfo=getRetroreflectionInfo(materialInfo);
67346
+ #endif
67348
67347
  #if defined(X3D_DIFFUSE_TRANSMISSION_MATERIAL_EXT)
67349
67348
  materialInfo=getDiffuseTransmissionInfo(materialInfo);
67350
67349
  #endif
@@ -67354,17 +67353,10 @@ materialInfo=getVolumeScatterInfo(materialInfo);
67354
67353
  #if defined(X3D_ANISOTROPY_MATERIAL_EXT)
67355
67354
  materialInfo=getAnisotropyInfo(materialInfo,normalInfo);
67356
67355
  #endif
67357
- #if defined(X3D_RETROREFLECTION_MATERIAL_EXT)
67358
- materialInfo=getRetroreflectionInfo(materialInfo);
67359
- #endif
67360
67356
  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);
67361
67357
  #if defined(X3D_USE_IBL)||defined(X3D_LIGHTING)
67362
67358
  #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)
67363
- 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);
67364
- #if defined(X3D_RETROREFLECTION_MATERIAL_EXT)
67365
- 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);
67366
- #endif
67367
- if(materialInfo.iridescenceThickness==0.)materialInfo.iridescenceFactor=0.;
67359
+ 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.;
67368
67360
  #endif
67369
67361
  #endif
67370
67362
  #if defined(X3D_DIFFUSE_TRANSMISSION_MATERIAL_EXT)
@@ -67402,6 +67394,18 @@ vec3 f_metal_fresnel_ibl=getIBLGGXFresnel(n,v,materialInfo.perceptualRoughness,b
67402
67394
  #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)
67403
67395
  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);
67404
67396
  #endif
67397
+ #if defined(X3D_RETROREFLECTION_MATERIAL_EXT)
67398
+ #if defined(X3D_ANISOTROPY_MATERIAL_EXT)
67399
+ vec3 f_specular_retro=getIBLRadianceAnisotropy(n,v_retro,materialInfo.perceptualRoughness,materialInfo.anisotropyStrength,materialInfo.anisotropicB);
67400
+ #else
67401
+ vec3 f_specular_retro=getIBLRadianceGGX(n,v_retro,materialInfo.perceptualRoughness);
67402
+ #endif
67403
+ 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);
67404
+ #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)
67405
+ 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);
67406
+ #endif
67407
+ 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);
67408
+ #endif
67405
67409
  #if defined(X3D_CLEARCOAT_MATERIAL_EXT)
67406
67410
  clearcoat_brdf=getIBLRadianceGGX(materialInfo.clearcoatNormal,v,materialInfo.clearcoatRoughness);
67407
67411
  #endif
@@ -67444,15 +67448,15 @@ l_metal_brdf=metal_fresnel*l_specular_metal;l_dielectric_brdf=mix(l_diffuse,l_sp
67444
67448
  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);
67445
67449
  #endif
67446
67450
  #if defined(X3D_RETROREFLECTION_MATERIAL_EXT)
67447
- 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;
67451
+ 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));
67448
67452
  #if defined(X3D_ANISOTROPY_MATERIAL_EXT)
67449
- l_specular_metal_retro=intensity*NdotL*BRDF_specularGGXAnisotropy(materialInfo.alphaRoughness,materialInfo.anisotropyStrength,n,v_retro,l,h_retro,materialInfo.anisotropicT,materialInfo.anisotropicB);
67453
+ vec3 l_specular_retro=intensity*NdotL*BRDF_specularGGXAnisotropy(materialInfo.alphaRoughness,materialInfo.anisotropyStrength,n,v_retro,l,h_retro,materialInfo.anisotropicT,materialInfo.anisotropicB);
67450
67454
  #else
67451
- l_specular_metal_retro=intensity*NdotL*BRDF_specularGGX(materialInfo.alphaRoughness,NdotL,NdotV_retro,NdotH_retro);
67455
+ vec3 l_specular_retro=intensity*NdotL*BRDF_specularGGX(materialInfo.alphaRoughness,NdotL,NdotV,NdotH_retro);
67452
67456
  #endif
67453
- 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);
67457
+ 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);
67454
67458
  #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)
67455
- 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);
67459
+ 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);
67456
67460
  #endif
67457
67461
  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);
67458
67462
  #endif
@@ -72667,14 +72671,14 @@ Object .assign (X3DTimeContext .prototype,
72667
72671
  {
72668
72672
  const lastPosition = new Numbers_Vector3 ();
72669
72673
 
72670
- return function ()
72674
+ return function (checkFrameRate)
72671
72675
  {
72672
72676
  const
72673
72677
  time = Date .now () / 1000,
72674
72678
  interval = time - this [_lastTime],
72675
72679
  viewpointNode = this .getActiveViewpoint ();
72676
72680
 
72677
- if (interval <= 1 / Math .max (this .getBrowserOption ("MaximumFrameRate"), 1))
72681
+ if (checkFrameRate && interval <= 1 / Math .max (this .getBrowserOption ("MaximumFrameRate"), 1))
72678
72682
  return false;
72679
72683
 
72680
72684
  this [_lastTime] = time;
@@ -72916,7 +72920,7 @@ const ConcreteNodes_default_ = new Configuration_ConcreteNodesArray ();
72916
72920
  const
72917
72921
  _world = Symbol (),
72918
72922
  X3DBrowserContext_tainted = Symbol (),
72919
- _traverse = Symbol .for ("X_ITE.X3DBrowserContext.traverse"),
72923
+ X3DBrowserContext_traverse = Symbol .for ("X_ITE.X3DBrowserContext.traverse"),
72920
72924
  _renderCallback = Symbol (),
72921
72925
  _animFrame = Symbol (),
72922
72926
  _previousTime = Symbol (),
@@ -72972,7 +72976,7 @@ function X3DBrowserContext (element)
72972
72976
 
72973
72977
  this [X3DBrowserContext_tainted] = false;
72974
72978
  this [_previousTime] = 0;
72975
- this [_renderCallback] = this [_traverse] .bind (this);
72979
+ this [_renderCallback] = this [X3DBrowserContext_traverse] .bind (this);
72976
72980
  this [_systemTime] = new Time_StopWatch ();
72977
72981
  this [_browserTime] = new Time_StopWatch ();
72978
72982
  this [_cameraTime] = new Time_StopWatch ();
@@ -73083,13 +73087,15 @@ Object .assign (Object .setPrototypeOf (X3DBrowserContext .prototype, Base_X3DBa
73083
73087
  this .addBrowserEvent ();
73084
73088
  });
73085
73089
  },
73086
- [_traverse] (now, frame)
73090
+ [X3DBrowserContext_traverse] (now, frame)
73087
73091
  {
73088
73092
  // Limit frame rate.
73089
73093
 
73090
73094
  this [X3DBrowserContext_tainted] = false;
73091
73095
 
73092
- if (!this .advanceTime ())
73096
+ // If now is negative, don't check framerate.
73097
+ // Now can be negative when reshape is called.
73098
+ if (!this .advanceTime (now >= 0))
73093
73099
  {
73094
73100
  this .addBrowserEvent ();
73095
73101
  return;
@@ -74857,7 +74863,7 @@ const CoreComponent_default_ = {
74857
74863
  [
74858
74864
  Core_X3DBindableNode,
74859
74865
  Core_X3DChildNode,
74860
- Core_X3DImportedNodeProxy,
74866
+ Core_X3DImportedNodeInstance,
74861
74867
  Core_X3DInfoNode,
74862
74868
  Core_X3DMetadataObject,
74863
74869
  Core_X3DNode,
@@ -91526,8 +91532,8 @@ const PNGMedia_default_ = PNGMedia;
91526
91532
 
91527
91533
  /* harmony default export */ const Texturing_PNGMedia = (x_ite_Namespace .add ("PNGMedia", PNGMedia_default_));
91528
91534
  ;// ./src/x_ite/Components/Texturing/MovieTexture.js
91529
- /* provided dependency */ var SuperGif = __webpack_require__(8);
91530
- /* provided dependency */ var APNG = __webpack_require__(618);
91535
+ /* provided dependency */ var SuperGif = __webpack_require__(829);
91536
+ /* provided dependency */ var APNG = __webpack_require__(247);
91531
91537
 
91532
91538
 
91533
91539
 
@@ -91600,7 +91606,7 @@ Object .assign (Object .setPrototypeOf (MovieTexture .prototype, Texturing_X3DTe
91600
91606
 
91601
91607
  try
91602
91608
  {
91603
- if (fileURL .pathname .endsWith (".gif") || fileURL .href .match (/^\s*data:image\/gif[;,]/s))
91609
+ if (fileURL .pathname .endsWith (".gif") || fileURL .href .match (/^\s*data:image\/gif[;,]/))
91604
91610
  {
91605
91611
  const
91606
91612
  data = await this .loadDocument (fileURL),
@@ -91619,7 +91625,7 @@ Object .assign (Object .setPrototypeOf (MovieTexture .prototype, Texturing_X3DTe
91619
91625
  this .setGif (gif);
91620
91626
  return;
91621
91627
  }
91622
- else if (fileURL .pathname .endsWith (".png") || fileURL .href .match (/^\s*data:image\/png[;,]/s))
91628
+ else if (fileURL .pathname .endsWith (".png") || fileURL .href .match (/^\s*data:image\/png[;,]/))
91623
91629
  {
91624
91630
  const
91625
91631
  data = await this .loadDocument (fileURL),
@@ -92878,7 +92884,7 @@ const Components_default_ = Components;
92878
92884
 
92879
92885
  /* eslint no-undef: "off"
92880
92886
  --------
92881
- no-undef: global variable is used here for use in node projects.
92887
+ no-undef: node `global` variable is used here for use in node projects.
92882
92888
  */
92883
92889
 
92884
92890
  const
@@ -94171,7 +94177,7 @@ const QuickSort_default_ = QuickSort;
94171
94177
 
94172
94178
  /* harmony default export */ const Algorithms_QuickSort = (x_ite_Namespace .add ("QuickSort", QuickSort_default_));
94173
94179
  ;// ./src/lib/libtess.js
94174
- /* provided dependency */ var libtess_libtess = __webpack_require__(981);
94180
+ /* provided dependency */ var libtess_libtess = __webpack_require__(67);
94175
94181
  const libtess_default_ = libtess_libtess;
94176
94182
  ;
94177
94183