x_ite 16.2.0 → 16.3.1

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 (55) 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 +1 -1
  7. package/dist/assets/components/CubeMapTexturingComponent.min.js +1 -1
  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 +4 -2
  11. package/dist/assets/components/EventUtilitiesComponent.min.js +2 -2
  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 +1 -1
  21. package/dist/assets/components/HAnimComponent.min.js +1 -1
  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 +2 -2
  33. package/dist/assets/components/RigidBodyPhysicsComponent.min.js +1 -1
  34. package/dist/assets/components/ScriptingComponent.js +1 -1
  35. package/dist/assets/components/ScriptingComponent.min.js +1 -1
  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 +9 -9
  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 +107 -1
  47. package/dist/assets/components/X_ITEComponent.min.js +2 -2
  48. package/dist/example.html +1 -1
  49. package/dist/x_ite.css +1 -1
  50. package/dist/x_ite.js +303 -180
  51. package/dist/x_ite.min.js +2 -2
  52. package/dist/x_ite.min.mjs +2 -2
  53. package/dist/x_ite.mjs +303 -180
  54. package/dist/x_ite.zip +0 -0
  55. package/package.json +7 -6
package/dist/x_ite.mjs CHANGED
@@ -1,7 +1,7 @@
1
- /* X_ITE v16.2.0 */
1
+ /* X_ITE v16.3.1 */
2
2
  var __webpack_modules__ = ({
3
3
 
4
- /***/ 627
4
+ /***/ 617
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
- /***/ 249
1009
+ /***/ 851
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
- /***/ 289
2005
+ /***/ 775
2006
2006
  (module) {
2007
2007
 
2008
2008
  /**
@@ -14552,12 +14552,11 @@ Object .assign (Object .setPrototypeOf (SFNode .prototype, Base_X3DField .protot
14552
14552
  },
14553
14553
  getFieldDefinition (name)
14554
14554
  {
14555
- const fieldDefinition = this .getFieldDefinitions () .get (name);
14556
-
14557
- if (fieldDefinition)
14558
- return fieldDefinition;
14555
+ const
14556
+ target = this [_target],
14557
+ node = target .getValue ();
14559
14558
 
14560
- throw new Error (`Unknown field '${name}' in node class ${this .getNodeTypeName ()}.`);
14559
+ return node .getFieldDefinition (name);
14561
14560
  },
14562
14561
  getFieldDefinitions ()
14563
14562
  {
@@ -14587,7 +14586,7 @@ Object .assign (Object .setPrototypeOf (SFNode .prototype, Base_X3DField .protot
14587
14586
 
14588
14587
  Error .captureStackTrace (target, this .getField);
14589
14588
 
14590
- console .warn ("The use of sfnode.getField(name) is deprecated. Future versions of X_ITE may remove this feature. Instead, use the sfnode.{fieldName} syntax or sfnode.addFieldCallback(key, fieldName, callback).", target .stack);
14589
+ console .warn ("The use of sfnode.getField(name) is deprecated. Future versions of X_ITE may remove this feature. Instead, use the sfnode.{fieldName} property syntax or sfnode.addFieldCallback(key, fieldName, callback).", target .stack);
14591
14590
  }
14592
14591
 
14593
14592
  const
@@ -18430,7 +18429,12 @@ Object .assign (Object .setPrototypeOf (X3DBaseNode .prototype, Base_X3DChildObj
18430
18429
  },
18431
18430
  getFieldDefinition (name)
18432
18431
  {
18433
- return this [_fieldDefinitions] .get (name);
18432
+ const fieldDefinition = this [_fieldDefinitions] .get (name);
18433
+
18434
+ if (fieldDefinition)
18435
+ return fieldDefinition;
18436
+
18437
+ throw new Error (`Unknown field '${name}' in node class ${this .getTypeName ()}.`);
18434
18438
  },
18435
18439
  getFieldDefinitions ()
18436
18440
  {
@@ -18865,7 +18869,7 @@ const Legacy_default_ = Legacy;
18865
18869
 
18866
18870
  /* harmony default export */ const Browser_Legacy = (x_ite_Namespace .add ("Legacy", Legacy_default_));
18867
18871
  ;// ./src/x_ite/BROWSER_VERSION.js
18868
- const BROWSER_VERSION_default_ = "16.2.0";
18872
+ const BROWSER_VERSION_default_ = "16.3.1";
18869
18873
  ;
18870
18874
 
18871
18875
  /* harmony default export */ const BROWSER_VERSION = (x_ite_Namespace .add ("BROWSER_VERSION", BROWSER_VERSION_default_));
@@ -27447,9 +27451,7 @@ Object .assign (Object .setPrototypeOf (VRMLParser .prototype, Parser_X3DParser
27447
27451
  {
27448
27452
  if (this .nodeNameId ())
27449
27453
  {
27450
- const
27451
- fromNodeId = this .result [0],
27452
- fromNode = this .getExecutionContext () .getLocalNode (fromNodeId);
27454
+ const fromNodeId = this .result [0];
27453
27455
 
27454
27456
  this .comments ();
27455
27457
 
@@ -27465,9 +27467,7 @@ Object .assign (Object .setPrototypeOf (VRMLParser .prototype, Parser_X3DParser
27465
27467
  {
27466
27468
  if (this .nodeNameId ())
27467
27469
  {
27468
- const
27469
- toNodeId = this .result [0],
27470
- toNode = this .getExecutionContext () .getLocalNode (toNodeId);
27470
+ const toNodeId = this .result [0];
27471
27471
 
27472
27472
  this .comments ();
27473
27473
 
@@ -27477,7 +27477,10 @@ Object .assign (Object .setPrototypeOf (VRMLParser .prototype, Parser_X3DParser
27477
27477
  {
27478
27478
  try
27479
27479
  {
27480
- const eventInId = this .result [0];
27480
+ const
27481
+ eventInId = this .result [0],
27482
+ fromNode = this .getExecutionContext () .getLocalNode (fromNodeId),
27483
+ toNode = this .getExecutionContext () .getLocalNode (toNodeId);
27481
27484
 
27482
27485
  this .getExecutionContext () .addRoute (fromNode, eventOutId, toNode, eventInId);
27483
27486
  return true;
@@ -29762,16 +29765,16 @@ Object .assign (Object .setPrototypeOf (XMLParser .prototype, Parser_X3DParser .
29762
29765
  destinationField = xmlElement .getAttribute ("toField");
29763
29766
 
29764
29767
  if (sourceNodeName === null)
29765
- throw new Error ("Bad ROUTE statement: Expected fromNode attribute.");
29768
+ throw new Error ("Bad ROUTE specification: Expected fromNode attribute.");
29766
29769
 
29767
29770
  if (sourceField === null)
29768
- throw new Error ("Bad ROUTE statement: Expected fromField attribute.");
29771
+ throw new Error ("Bad ROUTE specification: Expected fromField attribute.");
29769
29772
 
29770
29773
  if (destinationNodeName === null)
29771
- throw new Error ("Bad ROUTE statement: Expected toNode attribute.");
29774
+ throw new Error ("Bad ROUTE specification: Expected toNode attribute.");
29772
29775
 
29773
29776
  if (destinationField === null)
29774
- throw new Error ("Bad ROUTE statement: Expected toField attribute.");
29777
+ throw new Error ("Bad ROUTE specification: Expected toField attribute.");
29775
29778
 
29776
29779
  const
29777
29780
  executionContext = this .getExecutionContext (),
@@ -31192,7 +31195,7 @@ const Plane3_default_ = Plane3;
31192
31195
 
31193
31196
  /* harmony default export */ const Geometry_Plane3 = (x_ite_Namespace .add ("Plane3", Plane3_default_));
31194
31197
  ;// ./src/standard/Math/Geometry/Triangle3.js
31195
- /* provided dependency */ var libtess = __webpack_require__(289);
31198
+ /* provided dependency */ var libtess = __webpack_require__(775);
31196
31199
 
31197
31200
 
31198
31201
  const Triangle3 =
@@ -38661,7 +38664,7 @@ const X3DSensorNode_default_ = X3DSensorNode;
38661
38664
 
38662
38665
 
38663
38666
 
38664
- function X3DTimeDependentNode (executionContext)
38667
+ function X3DTimeDependentNode (/* executionContext */)
38665
38668
  {
38666
38669
  this .addType (Base_X3DConstants .X3DTimeDependentNode);
38667
38670
 
@@ -38713,8 +38716,10 @@ Object .assign (Object .setPrototypeOf (X3DTimeDependentNode .prototype, Core_X3
38713
38716
  },
38714
38717
  resetElapsedTime ()
38715
38718
  {
38716
- this .start = this .getBrowser () .getCurrentTime ();
38717
- this .pause = this .getBrowser () .getCurrentTime ();
38719
+ const time = this .getBrowser () .getCurrentTime ();
38720
+
38721
+ this .start = time;
38722
+ this .pause = time;
38718
38723
  this .pauseInterval = 0;
38719
38724
  },
38720
38725
  set_live__ ()
@@ -38840,14 +38845,14 @@ Object .assign (Object .setPrototypeOf (X3DTimeDependentNode .prototype, Core_X3
38840
38845
 
38841
38846
  // The event order below is very important.
38842
38847
 
38843
- this ._isActive = true;
38844
- this ._elapsedTime = 0;
38848
+ this ._isActive = true;
38845
38849
 
38846
38850
  this .set_start ();
38847
38851
 
38848
38852
  if (this .getLive () .getValue ())
38849
38853
  {
38850
- this .getBrowser () .timeEvents () .addInterest ("set_time" ,this);
38854
+ this .getBrowser () .timeEvents () .addInterest ("set_time", this);
38855
+ this .getBrowser () .addBrowserEvent ();
38851
38856
  }
38852
38857
  else
38853
38858
  {
@@ -38872,7 +38877,7 @@ Object .assign (Object .setPrototypeOf (X3DTimeDependentNode .prototype, Core_X3
38872
38877
 
38873
38878
  this .set_pause ();
38874
38879
 
38875
- this .getBrowser () .timeEvents () .removeInterest ("set_time" ,this);
38880
+ this .getBrowser () .timeEvents () .removeInterest ("set_time", this);
38876
38881
  },
38877
38882
  do_resume ()
38878
38883
  {
@@ -38907,14 +38912,12 @@ Object .assign (Object .setPrototypeOf (X3DTimeDependentNode .prototype, Core_X3
38907
38912
 
38908
38913
  this .set_stop ();
38909
38914
 
38910
- this ._elapsedTime = this .getElapsedTime ();
38911
-
38912
38915
  if (this ._isPaused .getValue ())
38913
38916
  this ._isPaused = false;
38914
38917
 
38915
38918
  this ._isActive = false;
38916
38919
 
38917
- this .getBrowser () .timeEvents () .removeInterest ("set_time" ,this);
38920
+ this .getBrowser () .timeEvents () .removeInterest ("set_time", this);
38918
38921
  }
38919
38922
  },
38920
38923
  addTimeout (name, callback, startTime)
@@ -38936,19 +38939,16 @@ Object .assign (Object .setPrototypeOf (X3DTimeDependentNode .prototype, Core_X3
38936
38939
  if (!this ._enabled .getValue ())
38937
38940
  return;
38938
38941
 
38939
- if (!(this .getLive () .getValue ()))
38940
- return;
38941
-
38942
38942
  this .getBrowser () .advanceOnlyTime ();
38943
38943
 
38944
38944
  this [callback] ();
38945
38945
  },
38946
- set_loop: Function .prototype,
38947
- set_start: Function .prototype,
38948
- set_pause: Function .prototype,
38949
- set_resume: Function .prototype,
38950
- set_stop: Function .prototype,
38951
- set_time: Function .prototype,
38946
+ set_loop () { },
38947
+ set_start () { },
38948
+ set_pause () { },
38949
+ set_resume () { },
38950
+ set_stop () { },
38951
+ set_time () { },
38952
38952
  dispose ()
38953
38953
  {
38954
38954
  for (const name of [... this .timeouts .keys ()])
@@ -38979,7 +38979,9 @@ function TimeSensor (executionContext)
38979
38979
 
38980
38980
  this .addType (Base_X3DConstants .TimeSensor);
38981
38981
 
38982
- this .addChildObjects (Base_X3DConstants .inputOutput, "range", new x_ite_Fields .MFFloat (0, 0, 1)); // current, first, last (in fractions) - play range starting at current
38982
+ // Special non-public field:
38983
+ // rangeFraction, rangeStart, rangeEnd (in fractions) - play range starting at rangeFraction
38984
+ this .addChildObjects (Base_X3DConstants .inputOutput, "range", new x_ite_Fields .MFFloat (0, 0, 1));
38983
38985
 
38984
38986
  this .cycle = 0;
38985
38987
  this .interval = 0;
@@ -39015,6 +39017,10 @@ Object .assign (Object .setPrototypeOf (TimeSensor .prototype, Core_X3DSensorNod
39015
39017
  this .fraction = Math_Algorithm .fract (fraction + this .offset);
39016
39018
  this .cycle = currentTime - (this .fraction - this .first) * cycleInterval;
39017
39019
  },
39020
+ getFraction (time)
39021
+ {
39022
+ return this .first + (this .interval ? Math_Algorithm .fract ((time - this .cycle) / this .interval) : 0) * this .scale;
39023
+ },
39018
39024
  set_cycleInterval__ ()
39019
39025
  {
39020
39026
  if (!this ._isActive .getValue ())
@@ -39032,28 +39038,56 @@ Object .assign (Object .setPrototypeOf (TimeSensor .prototype, Core_X3DSensorNod
39032
39038
  if (this ._isPaused .getValue ())
39033
39039
  return;
39034
39040
 
39035
- this .set_fraction (this .getBrowser () .getCurrentTime ());
39041
+ this ._fraction_changed = this .fraction = this .getFraction (this .getBrowser () .getCurrentTime ());
39036
39042
  },
39037
39043
  set_start ()
39038
39044
  {
39045
+ const browser = this .getBrowser ();
39046
+
39047
+ browser .timePrepareEvents () .addInterest ("set_prepare", this);
39048
+ browser .addBrowserEvent ();
39049
+
39039
39050
  this .setRange (this ._range [0], this ._range [1], this ._range [2], true);
39040
39051
 
39041
- const time = this .getBrowser () .getCurrentTime ();
39052
+ const time = browser .getCurrentTime ();
39042
39053
 
39043
39054
  this ._time = time;
39055
+ this ._elapsedTime = 0;
39044
39056
  this ._cycleTime = time;
39045
39057
  this ._fraction_changed = this .fraction;
39058
+ this ._cycleCount = 0;
39059
+ },
39060
+ set_pause ()
39061
+ {
39062
+ this .getBrowser () .timePrepareEvents () .removeInterest ("set_prepare", this);
39046
39063
  },
39047
39064
  set_resume (/* pauseInterval */)
39048
39065
  {
39066
+ const browser = this .getBrowser ();
39067
+
39068
+ browser .timePrepareEvents () .addInterest ("set_prepare", this);
39069
+ browser .addBrowserEvent ();
39070
+
39049
39071
  this .setRange (this .fraction, this ._range [1], this ._range [2], false);
39050
39072
  },
39051
- set_fraction (time)
39073
+ set_stop ()
39074
+ {
39075
+ this .getBrowser () .timePrepareEvents () .removeInterest ("set_prepare", this);
39076
+ },
39077
+ set_prepare ()
39052
39078
  {
39053
- const fraction = this .first + (this .interval ? Math_Algorithm .fract ((time - this .cycle) / this .interval) : 0) * this .scale;
39079
+ const time = this .getBrowser () .getCurrentTime ();
39080
+
39081
+ this ._time = time;
39082
+ this ._elapsedTime = this .getElapsedTime ();
39083
+
39084
+ if (time - this .cycle < this .interval)
39085
+ return;
39054
39086
 
39055
- this .fraction = fraction;
39056
- this ._fraction_changed = fraction;
39087
+ this ._fraction_changed = this .last;
39088
+ this ._cycleCount = this ._cycleCount .getValue () + 1;
39089
+ this ._cycleComplete = true;
39090
+ this ._cycleCompleteTime = time;
39057
39091
  },
39058
39092
  set_time ()
39059
39093
  {
@@ -39061,8 +39095,6 @@ Object .assign (Object .setPrototypeOf (TimeSensor .prototype, Core_X3DSensorNod
39061
39095
 
39062
39096
  const time = this .getBrowser () .getCurrentTime ();
39063
39097
 
39064
- this ._time = time;
39065
-
39066
39098
  if (time - this .cycle >= this .interval)
39067
39099
  {
39068
39100
  if (this ._loop .getValue ())
@@ -39071,25 +39103,18 @@ Object .assign (Object .setPrototypeOf (TimeSensor .prototype, Core_X3DSensorNod
39071
39103
  {
39072
39104
  this .cycle += this .interval * Math .floor ((time - this .cycle) / this .interval);
39073
39105
 
39074
- this ._elapsedTime = this .getElapsedTime ();
39075
- this ._cycleTime = time;
39076
-
39077
- this .set_fraction (time);
39106
+ this ._cycleTime = time;
39107
+ this ._fraction_changed = this .fraction = this .getFraction (time);
39078
39108
  }
39079
39109
  }
39080
39110
  else
39081
39111
  {
39082
- this ._elapsedTime = this .getElapsedTime ();
39083
- this ._fraction_changed = this .fraction = this .last;
39084
-
39085
39112
  this .stop ();
39086
39113
  }
39087
39114
  }
39088
39115
  else
39089
39116
  {
39090
- this ._elapsedTime = this .getElapsedTime ();
39091
-
39092
- this .set_fraction (time);
39117
+ this ._fraction_changed = this .fraction = this .getFraction (time);
39093
39118
  }
39094
39119
  },
39095
39120
  dispose ()
@@ -39105,21 +39130,24 @@ Object .defineProperties (TimeSensor,
39105
39130
  fieldDefinitions:
39106
39131
  {
39107
39132
  value: new Base_FieldDefinitionArray ([
39108
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "metadata", new x_ite_Fields .SFNode ()),
39109
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "description", new x_ite_Fields .SFString ()),
39110
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "enabled", new x_ite_Fields .SFBool (true)),
39111
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "cycleInterval", new x_ite_Fields .SFTime (1)),
39112
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "loop", new x_ite_Fields .SFBool ()),
39113
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "startTime", new x_ite_Fields .SFTime (0)),
39114
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "resumeTime", new x_ite_Fields .SFTime (0)),
39115
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "pauseTime", new x_ite_Fields .SFTime (0)),
39116
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "stopTime", new x_ite_Fields .SFTime (0)),
39117
- new Base_X3DFieldDefinition (Base_X3DConstants .outputOnly, "isPaused", new x_ite_Fields .SFBool ()),
39118
- new Base_X3DFieldDefinition (Base_X3DConstants .outputOnly, "isActive", new x_ite_Fields .SFBool ()),
39119
- new Base_X3DFieldDefinition (Base_X3DConstants .outputOnly, "cycleTime", new x_ite_Fields .SFTime ()),
39120
- new Base_X3DFieldDefinition (Base_X3DConstants .outputOnly, "elapsedTime", new x_ite_Fields .SFTime ()),
39121
- new Base_X3DFieldDefinition (Base_X3DConstants .outputOnly, "fraction_changed", new x_ite_Fields .SFFloat ()),
39122
- new Base_X3DFieldDefinition (Base_X3DConstants .outputOnly, "time", new x_ite_Fields .SFTime ()),
39133
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "metadata", new x_ite_Fields .SFNode ()),
39134
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "description", new x_ite_Fields .SFString ()),
39135
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "enabled", new x_ite_Fields .SFBool (true)),
39136
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "cycleInterval", new x_ite_Fields .SFTime (1)),
39137
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "loop", new x_ite_Fields .SFBool ()),
39138
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "startTime", new x_ite_Fields .SFTime (0)),
39139
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "resumeTime", new x_ite_Fields .SFTime (0)),
39140
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "pauseTime", new x_ite_Fields .SFTime (0)),
39141
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "stopTime", new x_ite_Fields .SFTime (0)),
39142
+ new Base_X3DFieldDefinition (Base_X3DConstants .outputOnly, "isPaused", new x_ite_Fields .SFBool ()),
39143
+ new Base_X3DFieldDefinition (Base_X3DConstants .outputOnly, "isActive", new x_ite_Fields .SFBool ()),
39144
+ new Base_X3DFieldDefinition (Base_X3DConstants .outputOnly, "cycleTime", new x_ite_Fields .SFTime ()),
39145
+ new Base_X3DFieldDefinition (Base_X3DConstants .outputOnly, "cycleComplete", new x_ite_Fields .SFBool ()), // experimental
39146
+ new Base_X3DFieldDefinition (Base_X3DConstants .outputOnly, "cycleCompleteTime", new x_ite_Fields .SFTime ()), // experimental
39147
+ new Base_X3DFieldDefinition (Base_X3DConstants .outputOnly, "cycleCount", new x_ite_Fields .SFInt32 ()), // experimental
39148
+ new Base_X3DFieldDefinition (Base_X3DConstants .outputOnly, "fraction_changed", new x_ite_Fields .SFFloat ()),
39149
+ new Base_X3DFieldDefinition (Base_X3DConstants .outputOnly, "elapsedTime", new x_ite_Fields .SFTime ()),
39150
+ new Base_X3DFieldDefinition (Base_X3DConstants .outputOnly, "time", new x_ite_Fields .SFTime ()),
39123
39151
  ]),
39124
39152
  enumerable: true,
39125
39153
  },
@@ -40663,6 +40691,7 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
40663
40691
  case "KHR_materials_ior":
40664
40692
  case "KHR_materials_iridescence":
40665
40693
  case "KHR_materials_pbrSpecularGlossiness":
40694
+ case "KHR_materials_retroreflection":
40666
40695
  case "KHR_materials_sheen":
40667
40696
  case "KHR_materials_specular":
40668
40697
  case "KHR_materials_transmission":
@@ -41731,6 +41760,9 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
41731
41760
  case "KHR_materials_iridescence":
41732
41761
  this .khrMaterialsIridescenceObject (value, materialNode);
41733
41762
  break;
41763
+ case "KHR_materials_retroreflection":
41764
+ this .khrMaterialsRetroreflectionObject (value, materialNode);
41765
+ break;
41734
41766
  case "KHR_materials_sheen":
41735
41767
  this .khrMaterialsSheenObject (value, materialNode);
41736
41768
  break;
@@ -41878,6 +41910,23 @@ Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, Parser_X3DParser
41878
41910
 
41879
41911
  materialNode ._extensions .push (extension);
41880
41912
  },
41913
+ khrMaterialsRetroreflectionObject (KHR_materials_retroreflection, materialNode)
41914
+ {
41915
+ if (!(KHR_materials_retroreflection instanceof Object))
41916
+ return;
41917
+
41918
+ const extension = this .getScene () .createNode ("RetroreflectionMaterialExtension", false);
41919
+
41920
+ extension ._retroreflection = this .numberValue (KHR_materials_retroreflection .retroreflectionFactor, 0);
41921
+ extension ._retroreflectionTexture = this .textureInfo (KHR_materials_retroreflection .retroreflectionTexture);
41922
+ extension ._retroreflectionTextureMapping = this .textureMapping (KHR_materials_retroreflection .retroreflectionTexture);
41923
+
41924
+ extension .setup ();
41925
+
41926
+ KHR_materials_retroreflection .pointers = [extension];
41927
+
41928
+ materialNode ._extensions .push (extension);
41929
+ },
41881
41930
  khrMaterialsSheenObject (KHR_materials_sheen, materialNode)
41882
41931
  {
41883
41932
  if (!(KHR_materials_sheen instanceof Object))
@@ -46496,7 +46545,7 @@ Object .assign (Object .setPrototypeOf (STLBParser .prototype, Parser_X3DParser
46496
46545
  },
46497
46546
  header ()
46498
46547
  {
46499
- const header = helper.decodeText (this .arrayBuffer .slice (0, 80)) .trim ();
46548
+ const header = helper.decodeText (this .arrayBuffer .slice (0, 80)) .replace (/\u0000.*$/, "") .trim ();
46500
46549
 
46501
46550
  if (!header)
46502
46551
  return;
@@ -46680,7 +46729,8 @@ Object .assign (Object .setPrototypeOf (PLYAParser .prototype, Parser_X3DParser
46680
46729
  {
46681
46730
  const value = this .result [0] .trim ();
46682
46731
 
46683
- this .comments .push (value);
46732
+ if (value)
46733
+ this .comments .push (value);
46684
46734
 
46685
46735
  this .mustRotateAxes ||= !! value .match (/\b(?:Blender|Artec|Polycam)\b/i);
46686
46736
 
@@ -47892,7 +47942,7 @@ const Bezier_default_ = Bezier;
47892
47942
 
47893
47943
  /* harmony default export */ const Algorithms_Bezier = (x_ite_Namespace .add ("Bezier", Bezier_default_));
47894
47944
  ;// ./src/x_ite/Parser/SVGParser.js
47895
- /* provided dependency */ var SVGParser_libtess = __webpack_require__(289);
47945
+ /* provided dependency */ var SVGParser_libtess = __webpack_require__(775);
47896
47946
 
47897
47947
 
47898
47948
 
@@ -52014,7 +52064,7 @@ Object .assign (Object .setPrototypeOf (X3DRoute .prototype, Base_X3DObject .pro
52014
52064
  if (this [_disposed])
52015
52065
  return;
52016
52066
 
52017
- let firstError, secondError;
52067
+ const errors = [ ];
52018
52068
 
52019
52069
  try
52020
52070
  {
@@ -52026,7 +52076,7 @@ Object .assign (Object .setPrototypeOf (X3DRoute .prototype, Base_X3DObject .pro
52026
52076
  }
52027
52077
  catch (error)
52028
52078
  {
52029
- firstError = error;
52079
+ errors .push (error);
52030
52080
  }
52031
52081
 
52032
52082
  try
@@ -52039,19 +52089,12 @@ Object .assign (Object .setPrototypeOf (X3DRoute .prototype, Base_X3DObject .pro
52039
52089
  }
52040
52090
  catch (error)
52041
52091
  {
52042
- secondError = error;
52092
+ errors .push (error);
52043
52093
  }
52044
52094
 
52045
52095
  if (this [_sourceField] && this [_destinationField])
52046
52096
  {
52047
- if (this [_sourceField] .getType () !== this [_destinationField] .getType ())
52048
- throw new Error (`Bad ROUTE statement: Source field type must match destination field type of fields named "${this [_sourceField] .getName ()}" and "${this [_destinationField] .getName ()}".`);
52049
-
52050
- if (!this [_sourceField] .isOutput ())
52051
- throw new Error (`Bad ROUTE statement: Source field "${this [_sourceField] .getName ()}" must be an output.`);
52052
-
52053
- if (!this [_destinationField] .isInput ())
52054
- throw new Error (`Bad ROUTE statement: Destination field "${this [_destinationField] .getName ()}" must be an input.`);
52097
+ X3DRoute .checkFields (this [_sourceField], this [_destinationField]);
52055
52098
 
52056
52099
  this [_sourceField] .addOutputRoute (this);
52057
52100
  this [_destinationField] .addInputRoute (this);
@@ -52059,7 +52102,7 @@ Object .assign (Object .setPrototypeOf (X3DRoute .prototype, Base_X3DObject .pro
52059
52102
  }
52060
52103
  else
52061
52104
  {
52062
- throw firstError ?? secondError;
52105
+ throw new AggregateError (errors, "Couldn't connect route.");
52063
52106
  }
52064
52107
  },
52065
52108
  disconnect ()
@@ -52067,8 +52110,8 @@ Object .assign (Object .setPrototypeOf (X3DRoute .prototype, Base_X3DObject .pro
52067
52110
  this [_sourceField] ?.removeOutputRoute (this);
52068
52111
  this [_destinationField] ?.removeInputRoute (this);
52069
52112
 
52070
- if (this [_sourceField] && this [_destinationField])
52071
- this [_sourceField] .removeFieldInterest (this [_destinationField]);
52113
+ if (this [_destinationField])
52114
+ this [_sourceField] ?.removeFieldInterest (this [_destinationField]);
52072
52115
 
52073
52116
  this [_sourceField] = null;
52074
52117
  this [_destinationField] = null;
@@ -52229,6 +52272,8 @@ Object .assign (X3DRoute,
52229
52272
  ? destinationNode .getField (destinationFieldName)
52230
52273
  : helper.try (() => destinationNode .getExportedNode () .getField (destinationFieldName));
52231
52274
 
52275
+ X3DRoute .checkFields (sourceField, destinationField);
52276
+
52232
52277
  if (sourceField)
52233
52278
  {
52234
52279
  sourceFieldName = sourceField .getName ();
@@ -52247,6 +52292,26 @@ Object .assign (X3DRoute,
52247
52292
 
52248
52293
  return `${sourceNode .getId ()}.${sourceFieldName}.${destinationNode .getId ()}.${destinationFieldName}`;
52249
52294
  },
52295
+ checkFields (sourceField, destinationField)
52296
+ {
52297
+ if (sourceField && destinationField)
52298
+ {
52299
+ if (sourceField .getType () !== destinationField .getType ())
52300
+ throw new Error (`Bad ROUTE specification: source field type must match destination field type of fields named "${sourceField .getName ()}" and "${destinationField .getName ()}".`);
52301
+ }
52302
+
52303
+ if (sourceField)
52304
+ {
52305
+ if (!sourceField .isOutput ())
52306
+ throw new Error (`Bad ROUTE specification: source field "${sourceField .getName ()}" must be an output.`);
52307
+ }
52308
+
52309
+ if (destinationField)
52310
+ {
52311
+ if (!destinationField .isInput ())
52312
+ throw new Error (`Bad ROUTE specification: destination field "${destinationField .getName ()}" must be an input.`);
52313
+ }
52314
+ },
52250
52315
  });
52251
52316
 
52252
52317
  const X3DRoute_default_ = X3DRoute;
@@ -52895,54 +52960,47 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52895
52960
  },
52896
52961
  addRoute (sourceNode, sourceField, destinationNode, destinationField)
52897
52962
  {
52898
- try
52899
- {
52900
- // Normalize arguments.
52901
-
52902
- const
52903
- importedSourceNode = sourceNode instanceof Execution_X3DImportedNode ? sourceNode : null,
52904
- importedDestinationNode = destinationNode instanceof Execution_X3DImportedNode ? destinationNode : null;
52905
-
52906
- sourceNode = Base_X3DCast (Base_X3DConstants .X3DNode, sourceNode, false) ?? importedSourceNode;
52907
- sourceField = String (sourceField);
52908
- destinationNode = Base_X3DCast (Base_X3DConstants .X3DNode, destinationNode, false) ?? importedDestinationNode;
52909
- destinationField = String (destinationField);
52963
+ // Normalize arguments.
52910
52964
 
52911
- // Check nodes.
52965
+ const
52966
+ importedSourceNode = sourceNode instanceof Execution_X3DImportedNode ? sourceNode : null,
52967
+ importedDestinationNode = destinationNode instanceof Execution_X3DImportedNode ? destinationNode : null;
52912
52968
 
52913
- if (!sourceNode)
52914
- throw new Error ("source node must be of type X3DNode.");
52969
+ sourceNode = Base_X3DCast (Base_X3DConstants .X3DNode, sourceNode, false) ?? importedSourceNode;
52970
+ sourceField = String (sourceField);
52971
+ destinationNode = Base_X3DCast (Base_X3DConstants .X3DNode, destinationNode, false) ?? importedDestinationNode;
52972
+ destinationField = String (destinationField);
52915
52973
 
52916
- if (!destinationNode)
52917
- throw new Error ("destination node must be of type X3DNode.");
52974
+ // Check nodes.
52918
52975
 
52919
- // Resolve imported source and destination node.
52976
+ if (!sourceNode)
52977
+ throw new Error ("Bad ROUTE specification: source node must be of type X3DNode.");
52920
52978
 
52921
- sourceNode = this .getLocalizedNode (sourceNode);
52922
- destinationNode = this .getLocalizedNode (destinationNode);
52979
+ if (!destinationNode)
52980
+ throw new Error ("Bad ROUTE specification: destination node must be of type X3DNode.");
52923
52981
 
52924
- // Add route.
52982
+ // Resolve imported source and destination node.
52925
52983
 
52926
- const
52927
- id = Routing_X3DRoute .getRouteId (sourceNode, sourceField, destinationNode, destinationField),
52928
- route = this [_routes] .get (id);
52984
+ sourceNode = this .getLocalizedNode (sourceNode);
52985
+ destinationNode = this .getLocalizedNode (destinationNode);
52929
52986
 
52930
- if (route)
52931
- {
52932
- return route;
52933
- }
52934
- else
52935
- {
52936
- const route = new Routing_X3DRoute (this, sourceNode, sourceField, destinationNode, destinationField);
52987
+ // Add route.
52937
52988
 
52938
- this [_routes] .add (id, route);
52989
+ const
52990
+ id = Routing_X3DRoute .getRouteId (sourceNode, sourceField, destinationNode, destinationField),
52991
+ route = this [_routes] .get (id);
52939
52992
 
52940
- return route;
52941
- }
52993
+ if (route)
52994
+ {
52995
+ return route;
52942
52996
  }
52943
- catch (error)
52997
+ else
52944
52998
  {
52945
- throw new Error (`Bad ROUTE specification.`, { cause: error });
52999
+ const route = new Routing_X3DRoute (this, sourceNode, sourceField, destinationNode, destinationField);
53000
+
53001
+ this [_routes] .add (id, route);
53002
+
53003
+ return route;
52946
53004
  }
52947
53005
  },
52948
53006
  deleteRoute (route)
@@ -54638,7 +54696,7 @@ function X3DCoreContext (element)
54638
54696
  {
54639
54697
  const link = document .createElement ("link");
54640
54698
 
54641
- link .integrity = "sha384-OncRzbLtLD5Caw7AMriMRlhuhJ/fW3gh5dFvrdeifrhlqF+YTzx/lbZh5l6JjYau";
54699
+ link .integrity = "sha384-x6y/hxdrQVgxMyDh++oW/v2xiaW7k1Rmjai5PMfLQ+DLzcx2odeW89DVDfzQkGs9";
54642
54700
  link .rel = "stylesheet";
54643
54701
  link .crossOrigin = "anonymous";
54644
54702
  link .onload = resolve;
@@ -64034,11 +64092,13 @@ const
64034
64092
  _loadingTotal = Symbol (),
64035
64093
  X3DNetworkingContext_loadingObjects = Symbol (),
64036
64094
  _browserLoading = Symbol (),
64037
- _browserTime = Symbol (),
64095
+ _percentTime = Symbol (),
64038
64096
  _set_loadCount = Symbol (),
64039
64097
  _loadFractions = Symbol (),
64040
64098
  _defaultScene = Symbol ();
64041
64099
 
64100
+ const PERCENT_TIME = 8_000; // in ms
64101
+
64042
64102
  function getBaseURI (element)
64043
64103
  {
64044
64104
  const { baseURI } = element;
@@ -64095,7 +64155,7 @@ Object .assign (X3DNetworkingContext .prototype,
64095
64155
  setBrowserLoading (value)
64096
64156
  {
64097
64157
  this [_browserLoading] = value;
64098
- this [_browserTime] = Date .now ();
64158
+ this [_percentTime] = Date .now ();
64099
64159
 
64100
64160
  if (value)
64101
64161
  {
@@ -64159,7 +64219,8 @@ Object .assign (X3DNetworkingContext .prototype,
64159
64219
 
64160
64220
  this ._loadCount = this [X3DNetworkingContext_loadingObjects] .size;
64161
64221
 
64162
- this [_browserTime] = Date .now ();
64222
+ if (Date .now () - this [_percentTime] < PERCENT_TIME)
64223
+ this [_percentTime] = Date .now ();
64163
64224
  },
64164
64225
  removeLoadingObject (object)
64165
64226
  {
@@ -64167,7 +64228,8 @@ Object .assign (X3DNetworkingContext .prototype,
64167
64228
 
64168
64229
  this ._loadCount = this [X3DNetworkingContext_loadingObjects] .size;
64169
64230
 
64170
- this [_browserTime] = Date .now ();
64231
+ if (Date .now () - this [_percentTime] < PERCENT_TIME)
64232
+ this [_percentTime] = Date .now ();
64171
64233
  },
64172
64234
  getDisplayLoadCount ()
64173
64235
  {
@@ -64203,8 +64265,8 @@ Object .assign (X3DNetworkingContext .prototype,
64203
64265
  if (this ._loadCount .getValue () || this [_browserLoading])
64204
64266
  {
64205
64267
  string = ((loadingDisplay || 1) === 1
64206
- ? gettext ("Loading %1 file")
64207
- : gettext ("Loading %1 files")) .replace ("%1", loadingDisplay || 1);
64268
+ ? gettext("Loading %1 file")
64269
+ : gettext("Loading %1 files")) .replace ("%1", loadingDisplay || 1);
64208
64270
  }
64209
64271
  else
64210
64272
  {
@@ -64224,8 +64286,8 @@ Object .assign (X3DNetworkingContext .prototype,
64224
64286
  const percent = fractions * 100;
64225
64287
 
64226
64288
  // Show progress in % if loading takes too long.
64227
- if (Date .now () - this [_browserTime] > 8_000)
64228
- string += ` (${percent .toFixed (2)} %)`;
64289
+ if (Date .now () - this [_percentTime] > PERCENT_TIME)
64290
+ string += ` (${percent .toFixed (2)}\u202F%)`;
64229
64291
 
64230
64292
  this .getSplashScreen () .querySelector (".x_ite-private-spinner-text") .textContent = string;
64231
64293
  this .getSplashScreen () .querySelector (".x_ite-private-progressbar div") .style .width = `${percent}%`;
@@ -64368,12 +64430,11 @@ Object .assign (Object .setPrototypeOf (PointingDevice .prototype, Base_X3DBaseN
64368
64430
  {
64369
64431
  const surface = this .getBrowser () .getSurface ();
64370
64432
 
64371
- helper.on (this, surface, "mousedown", event => this .mousedown (event));
64372
- helper.on (this, surface, "mouseup", event => this .mouseup (event));
64373
- helper.on (this, surface, "dblclick", event => this .dblclick (event));
64374
- helper.on (this, surface, "mousemove", event => this .mousemove (event));
64375
- helper.on (this, surface, "mouseenter", event => this .onmouseenter (event));
64376
- helper.on (this, surface, "mouseout", event => this .onmouseout (event));
64433
+ helper.on (this, surface, "mousedown", event => this .mousedown (event));
64434
+ helper.on (this, surface, "mouseup", event => this .mouseup (event));
64435
+ helper.on (this, surface, "dblclick", event => this .dblclick (event));
64436
+ helper.on (this, surface, "mousemove", event => this .mousemove (event));
64437
+ helper.on (this, surface, "mouseout", event => this .onmouseout (event));
64377
64438
 
64378
64439
  helper.on (this, surface, "touchstart", event => this .touchstart (event));
64379
64440
  helper.on (this, surface, "touchend", event => this .touchend (event));
@@ -64384,6 +64445,8 @@ Object .assign (Object .setPrototypeOf (PointingDevice .prototype, Base_X3DBaseN
64384
64445
  browser = this .getBrowser (),
64385
64446
  surface = browser .getSurface ();
64386
64447
 
64448
+ browser .getElement () .focus ({ preventScroll: true });
64449
+
64387
64450
  if (browser .getShiftKey () && (browser .getControlKey () || browser .getCommandKey ()))
64388
64451
  return;
64389
64452
 
@@ -64564,10 +64627,6 @@ Object .assign (Object .setPrototypeOf (PointingDevice .prototype, Base_X3DBaseN
64564
64627
  else
64565
64628
  browser .setCursor (this .grabbing && move ? "GRABBING" : "DEFAULT");
64566
64629
  },
64567
- onmouseenter ()
64568
- {
64569
- this .getBrowser () .getElement () .focus ({ preventScroll: true });
64570
- },
64571
64630
  onmouseout ()
64572
64631
  {
64573
64632
  this .getBrowser () .leaveNotifyEvent ();
@@ -67076,7 +67135,7 @@ vec3 getIBLRadianceCharlie(const in vec3 n,const in vec3 v,const in float sheenR
67076
67135
 
67077
67136
 
67078
67137
  const MaterialInfo2_glsl_default_ = () => /* glsl */ `
67079
- struct MaterialInfo{float ior;float perceptualRoughness;vec3 f0_dielectric;float alphaRoughness;float fresnel_w;vec3 f90;vec3 f90_dielectric;float metallic;vec3 baseColor;float sheenRoughnessFactor;vec3 sheenColorFactor;vec3 clearcoatF0;vec3 clearcoatF90;float clearcoatFactor;vec3 clearcoatNormal;float clearcoatRoughness;float specularWeight;float transmissionFactor;float thickness;vec3 attenuationColor;float attenuationDistance;float iridescenceFactor;float iridescenceIor;float iridescenceThickness;float diffuseTransmissionFactor;vec3 diffuseTransmissionColorFactor;vec3 anisotropicT;vec3 anisotropicB;float anisotropyStrength;float dispersion;vec3 multiscatterColor;};
67138
+ struct MaterialInfo{float ior;float perceptualRoughness;vec3 f0_dielectric;float alphaRoughness;float fresnel_w;vec3 f90;vec3 f90_dielectric;float metallic;vec3 baseColor;float sheenRoughnessFactor;vec3 sheenColorFactor;vec3 clearcoatF0;vec3 clearcoatF90;float clearcoatFactor;vec3 clearcoatNormal;float clearcoatRoughness;float specularWeight;float transmissionFactor;float thickness;vec3 attenuationColor;float attenuationDistance;float iridescenceFactor;float iridescenceIor;float iridescenceThickness;float diffuseTransmissionFactor;vec3 diffuseTransmissionColorFactor;vec3 anisotropicT;vec3 anisotropicB;float anisotropyStrength;float dispersion;vec3 multiscatterColor;float retroreflectionFactor;};
67080
67139
  #if defined(X3D_MATERIAL_METALLIC_ROUGHNESS)
67081
67140
  ${MaterialTextures .texture ("x3d_BaseTexture", "rgba", "linear")}
67082
67141
  vec4 getBaseColor(){float alpha=1.-x3d_Material.transparency;vec4 baseColor=vec4(x3d_Material.baseColor,alpha);
@@ -67241,6 +67300,14 @@ vec3 anisotropySample=getAnisotropyTextureEXT();direction=anisotropySample.xy*2.
67241
67300
  #endif
67242
67301
  vec2 directionRotation=x3d_AnisotropyEXT.xy;mat2 rotationMatrix=mat2(directionRotation.xy,-directionRotation.y,directionRotation.x);direction=rotationMatrix*direction;info.anisotropicT=mat3(normalInfo.t,normalInfo.b,normalInfo.n)*normalize(vec3(direction,0.));info.anisotropicB=cross(normalInfo.ng,info.anisotropicT);info.anisotropyStrength=clamp(x3d_AnisotropyEXT.z*strengthFactor,0.,1.);return info;}
67243
67302
  #endif
67303
+ #if defined(X3D_RETROREFLECTION_MATERIAL_EXT)
67304
+ ${MaterialTextures .texture ("x3d_RetroreflectionTextureEXT", "r")}
67305
+ uniform float x3d_RetroreflectionEXT;MaterialInfo getRetroreflectionInfo(in MaterialInfo info){float retroreflectionFactor=x3d_RetroreflectionEXT;
67306
+ #if defined(X3D_RETROREFLECTION_TEXTURE_EXT)
67307
+ retroreflectionFactor*=getRetroreflectionTextureEXT();
67308
+ #endif
67309
+ info.retroreflectionFactor=retroreflectionFactor;return info;}
67310
+ #endif
67244
67311
  `
67245
67312
  ;
67246
67313
 
@@ -67283,6 +67350,9 @@ baseColor.rgb*=getTextureProjectorColor();
67283
67350
  vec3 color=vec3(0);vec3 v=normalize(-vertex);
67284
67351
  #if defined(X3D_USE_IBL)||defined(X3D_LIGHTING)
67285
67352
  NormalInfo normalInfo=getNormalInfo(x3d_Material.normalScale);vec3 n=normalInfo.n;float NdotV=clamp(dot(n,v),0.,1.);
67353
+ #if defined(X3D_RETROREFLECTION_MATERIAL_EXT)
67354
+ vec3 v_retro=reflect(-v,n);float NdotV_retro=clamp(dot(n,v_retro),0.,1.);
67355
+ #endif
67286
67356
  #endif
67287
67357
  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;
67288
67358
  #if defined(X3D_IOR_MATERIAL_EXT)
@@ -67318,10 +67388,17 @@ materialInfo=getVolumeScatterInfo(materialInfo);
67318
67388
  #if defined(X3D_ANISOTROPY_MATERIAL_EXT)
67319
67389
  materialInfo=getAnisotropyInfo(materialInfo,normalInfo);
67320
67390
  #endif
67391
+ #if defined(X3D_RETROREFLECTION_MATERIAL_EXT)
67392
+ materialInfo=getRetroreflectionInfo(materialInfo);
67393
+ #endif
67321
67394
  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);
67322
67395
  #if defined(X3D_USE_IBL)||defined(X3D_LIGHTING)
67323
67396
  #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)
67324
- 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.;
67397
+ 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);
67398
+ #if defined(X3D_RETROREFLECTION_MATERIAL_EXT)
67399
+ 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);
67400
+ #endif
67401
+ if(materialInfo.iridescenceThickness==0.)materialInfo.iridescenceFactor=0.;
67325
67402
  #endif
67326
67403
  #endif
67327
67404
  #if defined(X3D_DIFFUSE_TRANSMISSION_MATERIAL_EXT)
@@ -67400,6 +67477,19 @@ l_metal_brdf=metal_fresnel*l_specular_metal;l_dielectric_brdf=mix(l_diffuse,l_sp
67400
67477
  #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)
67401
67478
  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);
67402
67479
  #endif
67480
+ #if defined(X3D_RETROREFLECTION_MATERIAL_EXT)
67481
+ 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;
67482
+ #if defined(X3D_ANISOTROPY_MATERIAL_EXT)
67483
+ l_specular_metal_retro=intensity*NdotL*BRDF_specularGGXAnisotropy(materialInfo.alphaRoughness,materialInfo.anisotropyStrength,n,v_retro,l,h_retro,materialInfo.anisotropicT,materialInfo.anisotropicB);
67484
+ #else
67485
+ l_specular_metal_retro=intensity*NdotL*BRDF_specularGGX(materialInfo.alphaRoughness,NdotL,NdotV_retro,NdotH_retro);
67486
+ #endif
67487
+ 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);
67488
+ #if defined(X3D_IRIDESCENCE_MATERIAL_EXT)
67489
+ 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);
67490
+ #endif
67491
+ 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);
67492
+ #endif
67403
67493
  #if defined(X3D_CLEARCOAT_MATERIAL_EXT)
67404
67494
  l_clearcoat_brdf=intensity*getPunctualRadianceClearCoat(materialInfo.clearcoatNormal,v,l,h,VdotH,materialInfo.clearcoatF0,materialInfo.clearcoatF90,materialInfo.clearcoatRoughness);
67405
67495
  #endif
@@ -72878,7 +72968,7 @@ const
72878
72968
  _animFrame = Symbol (),
72879
72969
  _previousTime = Symbol (),
72880
72970
  _systemTime = Symbol (),
72881
- X3DBrowserContext_browserTime = Symbol (),
72971
+ _browserTime = Symbol (),
72882
72972
  _cameraTime = Symbol (),
72883
72973
  _collisionTime = Symbol (),
72884
72974
  _displayTime = Symbol (),
@@ -72916,21 +73006,22 @@ function X3DBrowserContext (element)
72916
73006
  for (const browserContext of browserContexts)
72917
73007
  browserContext .call (this, element);
72918
73008
 
72919
- this .addChildObjects (Base_X3DConstants .outputOnly, "initialized", new x_ite_Fields .SFTime (),
72920
- Base_X3DConstants .outputOnly, "shutdown", new x_ite_Fields .SFTime (),
72921
- Base_X3DConstants .outputOnly, "prepareEvents", new x_ite_Fields .SFTime (),
72922
- Base_X3DConstants .outputOnly, "timeEvents", new x_ite_Fields .SFTime (),
72923
- Base_X3DConstants .outputOnly, "cameraEvents", new x_ite_Fields .SFTime (),
72924
- Base_X3DConstants .outputOnly, "sensorEvents", new x_ite_Fields .SFTime (),
72925
- Base_X3DConstants .outputOnly, "displayEvents", new x_ite_Fields .SFTime (),
72926
- Base_X3DConstants .outputOnly, "finishedEvents", new x_ite_Fields .SFTime (),
72927
- Base_X3DConstants .outputOnly, "endEvents", new x_ite_Fields .SFTime ());
73009
+ this .addChildObjects (Base_X3DConstants .outputOnly, "initialized", new x_ite_Fields .SFTime (),
73010
+ Base_X3DConstants .outputOnly, "shutdown", new x_ite_Fields .SFTime (),
73011
+ Base_X3DConstants .outputOnly, "prepareEvents", new x_ite_Fields .SFTime (),
73012
+ Base_X3DConstants .outputOnly, "timePrepareEvents", new x_ite_Fields .SFTime (),
73013
+ Base_X3DConstants .outputOnly, "timeEvents", new x_ite_Fields .SFTime (),
73014
+ Base_X3DConstants .outputOnly, "cameraEvents", new x_ite_Fields .SFTime (),
73015
+ Base_X3DConstants .outputOnly, "sensorEvents", new x_ite_Fields .SFTime (),
73016
+ Base_X3DConstants .outputOnly, "displayEvents", new x_ite_Fields .SFTime (),
73017
+ Base_X3DConstants .outputOnly, "finishedEvents", new x_ite_Fields .SFTime (),
73018
+ Base_X3DConstants .outputOnly, "endEvents", new x_ite_Fields .SFTime ());
72928
73019
 
72929
73020
  this [X3DBrowserContext_tainted] = false;
72930
73021
  this [_previousTime] = 0;
72931
73022
  this [_renderCallback] = this [_traverse] .bind (this);
72932
73023
  this [_systemTime] = new Time_StopWatch ();
72933
- this [X3DBrowserContext_browserTime] = new Time_StopWatch ();
73024
+ this [_browserTime] = new Time_StopWatch ();
72934
73025
  this [_cameraTime] = new Time_StopWatch ();
72935
73026
  this [_collisionTime] = new Time_StopWatch ();
72936
73027
  this [_displayTime] = new Time_StopWatch ();
@@ -72958,6 +73049,10 @@ Object .assign (Object .setPrototypeOf (X3DBrowserContext .prototype, Base_X3DBa
72958
73049
  {
72959
73050
  return this ._prepareEvents;
72960
73051
  },
73052
+ timePrepareEvents ()
73053
+ {
73054
+ return this ._timePrepareEvents;
73055
+ },
72961
73056
  timeEvents ()
72962
73057
  {
72963
73058
  return this ._timeEvents;
@@ -73050,7 +73145,7 @@ Object .assign (Object .setPrototypeOf (X3DBrowserContext .prototype, Base_X3DBa
73050
73145
  // Start
73051
73146
 
73052
73147
  this [_systemTime] .stop ();
73053
- this [X3DBrowserContext_browserTime] .start ();
73148
+ this [_browserTime] .start ();
73054
73149
 
73055
73150
  // Time
73056
73151
 
@@ -73061,6 +73156,9 @@ Object .assign (Object .setPrototypeOf (X3DBrowserContext .prototype, Base_X3DBa
73061
73156
  this .addTaintedField (this ._prepareEvents);
73062
73157
  this [X3DBrowserContext_processEvents] ();
73063
73158
 
73159
+ this .addTaintedField (this ._timePrepareEvents);
73160
+ this [X3DBrowserContext_processEvents] ();
73161
+
73064
73162
  this .addTaintedField (this ._timeEvents);
73065
73163
  this [X3DBrowserContext_processEvents] ();
73066
73164
 
@@ -73111,7 +73209,7 @@ Object .assign (Object .setPrototypeOf (X3DBrowserContext .prototype, Base_X3DBa
73111
73209
 
73112
73210
  // Finish
73113
73211
 
73114
- this [X3DBrowserContext_browserTime] .stop ();
73212
+ this [_browserTime] .stop ();
73115
73213
  this [_systemTime] .start ();
73116
73214
  },
73117
73215
  getSystemTime ()
@@ -73120,7 +73218,7 @@ Object .assign (Object .setPrototypeOf (X3DBrowserContext .prototype, Base_X3DBa
73120
73218
  },
73121
73219
  getBrowserTime ()
73122
73220
  {
73123
- return this [X3DBrowserContext_browserTime];
73221
+ return this [_browserTime];
73124
73222
  },
73125
73223
  getCameraTime ()
73126
73224
  {
@@ -87261,7 +87359,7 @@ Object .assign (Object .setPrototypeOf (PhysicalMaterial .prototype, Shape_X3DOn
87261
87359
 
87262
87360
  this .setTransmission (extensionNodes .some (extensionNode => extensionNode .getType () .includes (Base_X3DConstants .TransmissionMaterialExtension)));
87263
87361
 
87264
- this .setVolumeScatter (extensionNodes .some (extensionNode => extensionNode .getType () .includes (Base_X3DConstants .VolumeScatterMaterialExtension)) && extensionNodes .some (extensionNode => extensionNode .getType () .includes (Base_X3DConstants .VolumeMaterialExtension)));
87362
+ this .setVolumeScatter (extensionNodes .some (extensionNode => extensionNode .getType () .includes (Base_X3DConstants .VolumeScatterMaterialExtension)));
87265
87363
 
87266
87364
  this .set_extensionsKey__ ();
87267
87365
  this .set_renderedTextures__ ();
@@ -87793,6 +87891,10 @@ Object .assign (Object .setPrototypeOf (X3DSoundProcessingNode .prototype, Sound
87793
87891
  for (const childNode of this .childNodes)
87794
87892
  childNode .getAudioSource () .connect (this .audioDestination);
87795
87893
  },
87894
+ set_start ()
87895
+ {
87896
+ this ._elapsedTime = 0;
87897
+ },
87796
87898
  set_time ()
87797
87899
  {
87798
87900
  this ._elapsedTime = this .getElapsedTime ();
@@ -88046,6 +88148,8 @@ Object .assign (Object .setPrototypeOf (X3DSoundSourceNode .prototype, Sound_X3D
88046
88148
  if (!this .mediaElement)
88047
88149
  return;
88048
88150
 
88151
+ this ._elapsedTime = 0;
88152
+
88049
88153
  this .mediaElement .currentTime = 0;
88050
88154
 
88051
88155
  this .getBrowser () .startAudioElement (this .mediaElement);
@@ -88949,12 +89053,12 @@ Object .defineProperties (BufferAudioSource,
88949
89053
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "gain", new x_ite_Fields .SFFloat (1)),
88950
89054
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "detune", new x_ite_Fields .SFFloat ()),
88951
89055
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "playbackRate", new x_ite_Fields .SFFloat (1)),
88952
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "loopStart", new x_ite_Fields .SFTime (0)),
88953
- new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "loopEnd", new x_ite_Fields .SFTime (0)),
88954
89056
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "channelCount", new x_ite_Fields .SFInt32 ()), // skip test
88955
89057
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "channelCountMode", new x_ite_Fields .SFString ("MAX")),
88956
89058
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "channelInterpretation", new x_ite_Fields .SFString ("SPEAKERS")),
88957
89059
 
89060
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "loopStart", new x_ite_Fields .SFTime (0)),
89061
+ new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "loopEnd", new x_ite_Fields .SFTime (0)),
88958
89062
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "loop", new x_ite_Fields .SFBool ()),
88959
89063
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "startTime", new x_ite_Fields .SFTime (0)),
88960
89064
  new Base_X3DFieldDefinition (Base_X3DConstants .inputOutput, "resumeTime", new x_ite_Fields .SFTime (0)),
@@ -89992,6 +90096,8 @@ Object .assign (Object .setPrototypeOf (MicrophoneSource .prototype, Sound_X3DSo
89992
90096
 
89993
90097
  this .mediaStreamAudioSourceNode = new MediaStreamAudioSourceNode (audioContext, { mediaStream });
89994
90098
 
90099
+ this ._elapsedTime = 0;
90100
+
89995
90101
  if (this ._isActive .getValue ())
89996
90102
  {
89997
90103
  if (this ._isPaused .getValue () || !this .getLive () .getValue ())
@@ -90063,6 +90169,9 @@ Object .assign (Object .setPrototypeOf (MicrophoneSource .prototype, Sound_X3DSo
90063
90169
  },
90064
90170
  set_time ()
90065
90171
  {
90172
+ if (!this .mediaStreamAudioSourceNode)
90173
+ return;
90174
+
90066
90175
  this ._elapsedTime = this .getElapsedTime ();
90067
90176
  },
90068
90177
  });
@@ -90131,7 +90240,7 @@ Object .assign (Object .setPrototypeOf (OscillatorSource .prototype, Sound_X3DSo
90131
90240
  if (!this .oscillatorNode)
90132
90241
  return;
90133
90242
 
90134
- this .oscillatorNode .detune .value = Math .max (this ._detune .getValue (), 0);
90243
+ this .oscillatorNode .detune .value = this ._detune .getValue ();
90135
90244
  },
90136
90245
  set_frequency__ ()
90137
90246
  {
@@ -90199,12 +90308,15 @@ Object .assign (Object .setPrototypeOf (OscillatorSource .prototype, Sound_X3DSo
90199
90308
 
90200
90309
  this .oscillatorNode = new OscillatorNode (audioContext);
90201
90310
 
90311
+ this .set_gain__ ();
90202
90312
  this .set_detune__ ();
90203
90313
  this .set_frequency__ ();
90204
90314
  this .set_type__ ();
90205
90315
 
90206
90316
  this .oscillatorNode .connect (this .getAudioSource ());
90207
90317
  this .oscillatorNode .start ();
90318
+
90319
+ this ._elapsedTime = 0;
90208
90320
  },
90209
90321
  set_pause ()
90210
90322
  {
@@ -90216,8 +90328,16 @@ Object .assign (Object .setPrototypeOf (OscillatorSource .prototype, Sound_X3DSo
90216
90328
  },
90217
90329
  set_stop ()
90218
90330
  {
90219
- this .oscillatorNode .stop ();
90220
- this .oscillatorNode .disconnect ();
90331
+ const
90332
+ audioContext = this .getBrowser () .getAudioContext (),
90333
+ gainNode = this .getAudioSource (),
90334
+ now = audioContext .currentTime,
90335
+ fadeDuration = 0.03;
90336
+
90337
+ gainNode .gain .setValueAtTime (gainNode .gain .value, now);
90338
+ gainNode .gain .exponentialRampToValueAtTime (1e-3, now + fadeDuration);
90339
+
90340
+ this .oscillatorNode .stop (now + fadeDuration);
90221
90341
  },
90222
90342
  set_time ()
90223
90343
  {
@@ -90378,6 +90498,9 @@ Object .assign (Object .setPrototypeOf (Sound .prototype, Sound_X3DSoundNode .pr
90378
90498
  },
90379
90499
  setGain (gain, pan = 0.5, rotation = 0)
90380
90500
  {
90501
+ // Given a pan value, left and right channel levels can be obtained using the equations from:
90502
+ // https://www.web3d.org/documents/specifications/19775-1/V4.0/index.html
90503
+
90381
90504
  const
90382
90505
  panLeft = 1 - pan ** 2,
90383
90506
  panRight = 1 - (1 - pan) ** 2,
@@ -91256,7 +91379,7 @@ function GifMedia (gif, movieTexture)
91256
91379
  if (!loop && cycle < this .cycle)
91257
91380
  return this .duration;
91258
91381
 
91259
- return (movieTexture ._elapsedTime * playbackRate) % this .duration;
91382
+ return (movieTexture ._elapsedTime .getValue () * playbackRate) % this .duration;
91260
91383
  },
91261
91384
  set: Function .prototype,
91262
91385
  },
@@ -91283,7 +91406,7 @@ function GifMedia (gif, movieTexture)
91283
91406
  {
91284
91407
  get ()
91285
91408
  {
91286
- return Math .floor (movieTexture ._elapsedTime / this .duration);
91409
+ return Math .floor (movieTexture ._elapsedTime .getValue () / this .duration);
91287
91410
  },
91288
91411
  },
91289
91412
  currentFrame:
@@ -91377,7 +91500,7 @@ async function PNGMedia (apng, movieTexture)
91377
91500
  {
91378
91501
  get ()
91379
91502
  {
91380
- return Math .floor (movieTexture ._elapsedTime / this .duration);
91503
+ return Math .floor (movieTexture ._elapsedTime .getValue () / this .duration);
91381
91504
  },
91382
91505
  },
91383
91506
  currentFrame:
@@ -91422,8 +91545,8 @@ const PNGMedia_default_ = PNGMedia;
91422
91545
 
91423
91546
  /* harmony default export */ const Texturing_PNGMedia = (x_ite_Namespace .add ("PNGMedia", PNGMedia_default_));
91424
91547
  ;// ./src/x_ite/Components/Texturing/MovieTexture.js
91425
- /* provided dependency */ var SuperGif = __webpack_require__(627);
91426
- /* provided dependency */ var APNG = __webpack_require__(249);
91548
+ /* provided dependency */ var SuperGif = __webpack_require__(617);
91549
+ /* provided dependency */ var APNG = __webpack_require__(851);
91427
91550
 
91428
91551
 
91429
91552
 
@@ -93374,7 +93497,7 @@ Object .assign (Object .setPrototypeOf (X3DBrowser .prototype, Browser_X3DBrowse
93374
93497
  {
93375
93498
  const spinnerText = this .getSplashScreen () .querySelector (".x_ite-private-spinner-text");
93376
93499
 
93377
- spinnerText .textContent = gettext ("Failed loading world.");
93500
+ spinnerText .textContent = gettext("Failed loading world.");
93378
93501
  });
93379
93502
 
93380
93503
  reject (new Error ("Couldn't load X3D file."));
@@ -93690,7 +93813,7 @@ Object .assign (Object .setPrototypeOf (X3DBrowser .prototype, Browser_X3DBrowse
93690
93813
  },
93691
93814
  print (... args)
93692
93815
  {
93693
- const string = args .map (String) .join (" ");
93816
+ const string = args .join (" ");
93694
93817
 
93695
93818
  console .log (string);
93696
93819
 
@@ -93699,7 +93822,7 @@ Object .assign (Object .setPrototypeOf (X3DBrowser .prototype, Browser_X3DBrowse
93699
93822
  },
93700
93823
  println (... args)
93701
93824
  {
93702
- const string = args .map (String) .join (" ");
93825
+ const string = args .join (" ");
93703
93826
 
93704
93827
  console .log (string);
93705
93828
 
@@ -94067,7 +94190,7 @@ const QuickSort_default_ = QuickSort;
94067
94190
 
94068
94191
  /* harmony default export */ const Algorithms_QuickSort = (x_ite_Namespace .add ("QuickSort", QuickSort_default_));
94069
94192
  ;// ./src/lib/libtess.js
94070
- /* provided dependency */ var libtess_libtess = __webpack_require__(289);
94193
+ /* provided dependency */ var libtess_libtess = __webpack_require__(775);
94071
94194
  const libtess_default_ = libtess_libtess;
94072
94195
  ;
94073
94196