x_ite 8.6.19 → 8.6.22

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 (104) hide show
  1. package/Makefile +1 -4
  2. package/README.md +1 -1
  3. package/build/bin/components.js +45 -0
  4. package/dist/assets/components/Annotation.js +13 -13
  5. package/dist/assets/components/Annotation.min.js +1 -1
  6. package/dist/assets/components/CADGeometry.js +13 -13
  7. package/dist/assets/components/CADGeometry.min.js +1 -1
  8. package/dist/assets/components/CubeMapTexturing.js +25 -25
  9. package/dist/assets/components/CubeMapTexturing.min.js +1 -1
  10. package/dist/assets/components/DIS.js +13 -13
  11. package/dist/assets/components/DIS.min.js +1 -1
  12. package/dist/assets/components/EventUtilities.js +9 -9
  13. package/dist/assets/components/EventUtilities.min.js +1 -1
  14. package/dist/assets/components/Geometry2D.js +19 -19
  15. package/dist/assets/components/Geometry2D.min.js +1 -1
  16. package/dist/assets/components/Geospatial.js +33 -33
  17. package/dist/assets/components/Geospatial.min.js +1 -1
  18. package/dist/assets/components/HAnim.js +18 -18
  19. package/dist/assets/components/HAnim.min.js +1 -1
  20. package/dist/assets/components/KeyDeviceSensor.js +8 -8
  21. package/dist/assets/components/KeyDeviceSensor.min.js +1 -1
  22. package/dist/assets/components/Layout.js +27 -27
  23. package/dist/assets/components/Layout.min.js +1 -1
  24. package/dist/assets/components/NURBS.js +24 -24
  25. package/dist/assets/components/NURBS.min.js +1 -1
  26. package/dist/assets/components/ParticleSystems.js +22 -22
  27. package/dist/assets/components/ParticleSystems.min.js +1 -1
  28. package/dist/assets/components/Picking.js +18 -18
  29. package/dist/assets/components/Picking.min.js +1 -1
  30. package/dist/assets/components/RigidBodyPhysics.js +18 -18
  31. package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
  32. package/dist/assets/components/Scripting.js +28 -28
  33. package/dist/assets/components/Scripting.min.js +1 -1
  34. package/dist/assets/components/Text.js +24 -24
  35. package/dist/assets/components/Text.min.js +1 -1
  36. package/dist/assets/components/TextureProjector.js +14 -14
  37. package/dist/assets/components/TextureProjector.min.js +1 -1
  38. package/dist/assets/components/Texturing3D.js +30 -30
  39. package/dist/assets/components/Texturing3D.min.js +1 -1
  40. package/dist/assets/components/VolumeRendering.js +19 -19
  41. package/dist/assets/components/VolumeRendering.min.js +1 -1
  42. package/dist/assets/components/X_ITE.js +9 -9
  43. package/dist/assets/components/X_ITE.min.js +1 -1
  44. package/dist/x_ite.css +1 -1
  45. package/dist/x_ite.js +796 -654
  46. package/dist/x_ite.min.js +1 -1
  47. package/dist/x_ite.zip +0 -0
  48. package/docs/_config.yml +2 -2
  49. package/docs/_posts/dom-integration.md +14 -12
  50. package/docs/_posts/getting-started.md +31 -29
  51. package/docs/_posts/reference/ecmascript-object-and-function-definitions.md +1 -1
  52. package/docs/_posts/reference/scene-services.md +6 -3
  53. package/docs/_posts/report-a-bug.md +5 -3
  54. package/docs/_posts/setup-a-localhost-server.md +7 -7
  55. package/docs/_posts/tutorials/writing-program-scripts-with-ecmascript.md +1 -1
  56. package/docs/_tabs/playground.html +31 -28
  57. package/package.json +1 -1
  58. package/src/locale/de.po.js +9 -0
  59. package/src/locale/fr.po.js +31 -25
  60. package/src/tests.js +1 -0
  61. package/src/x_ite/Base/X3DBaseNode.js +2 -12
  62. package/src/x_ite/Base/X3DInfoArray.js +0 -2
  63. package/src/x_ite/Base/X3DObjectArrayField.js +0 -2
  64. package/src/x_ite/Base/X3DTypedArrayField.js +0 -2
  65. package/src/x_ite/Browser/Core/BrowserTimings.js +147 -67
  66. package/src/x_ite/Browser/Core/ContextMenu.js +2 -2
  67. package/src/x_ite/Browser/Core/X3DCoreContext.js +6 -2
  68. package/src/x_ite/Browser/Navigation/ExamineViewer.js +3 -0
  69. package/src/x_ite/Browser/Navigation/LookAtViewer.js +3 -0
  70. package/src/x_ite/Browser/Networking/X3DNetworkingContext.js +13 -5
  71. package/src/x_ite/Browser/VERSION.js +1 -1
  72. package/src/x_ite/Browser/X3DBrowser.js +14 -22
  73. package/src/x_ite/Browser/X3DBrowserContext.js +0 -1
  74. package/src/x_ite/Components/Core/X3DNode.js +40 -9
  75. package/src/x_ite/Components/Core/X3DPrototypeInstance.js +5 -5
  76. package/src/x_ite/Configuration/ComponentInfo.js +2 -1
  77. package/src/x_ite/Configuration/ProfileInfo.js +1 -0
  78. package/src/x_ite/Configuration/UnitInfo.js +3 -5
  79. package/src/x_ite/Execution/BindableList.js +34 -27
  80. package/src/x_ite/Execution/BindableStack.js +15 -17
  81. package/src/x_ite/Execution/X3DExecutionContext.js +11 -21
  82. package/src/x_ite/Execution/X3DExportedNode.js +1 -3
  83. package/src/x_ite/Execution/X3DImportedNode.js +2 -6
  84. package/src/x_ite/Execution/X3DScene.js +30 -28
  85. package/src/x_ite/Fields/ArrayFields.js +4 -4
  86. package/src/x_ite/Fields/SFColor.js +0 -3
  87. package/src/x_ite/Fields/SFColorRGBA.js +0 -4
  88. package/src/x_ite/Fields/SFImage.js +0 -4
  89. package/src/x_ite/Fields/SFMatrix3.js +0 -1
  90. package/src/x_ite/Fields/SFMatrix4.js +0 -1
  91. package/src/x_ite/Fields/SFRotation.js +0 -4
  92. package/src/x_ite/Fields/SFString.js +7 -4
  93. package/src/x_ite/Fields/SFVec2.js +0 -2
  94. package/src/x_ite/Fields/SFVec3.js +0 -3
  95. package/src/x_ite/Fields/SFVec4.js +0 -4
  96. package/src/x_ite/InputOutput/FileLoader.js +13 -18
  97. package/src/x_ite/InputOutput/Generator.js +86 -16
  98. package/src/x_ite/Prototype/X3DExternProtoDeclaration.js +6 -11
  99. package/src/x_ite/Prototype/X3DProtoDeclaration.js +5 -8
  100. package/src/x_ite/Routing/X3DRoute.js +1 -5
  101. package/src/x_ite/X3DCanvasElement.js +2 -0
  102. package/src/x_ite.css +5 -1
  103. package/src/x_ite.html +4 -36
  104. package/x_ite.min.html +4 -36
@@ -178,12 +178,7 @@ X3DBaseNode .prototype = Object .assign (Object .create (X3DEventObject .prototy
178
178
 
179
179
  // Change function.
180
180
 
181
- Object .defineProperty (this, "getLive",
182
- {
183
- value: getLive,
184
- enumerable: false,
185
- configurable: true,
186
- });
181
+ Object .defineProperty (this, "getLive", { value: getLive });
187
182
 
188
183
  // Add isLive event.
189
184
 
@@ -194,7 +189,7 @@ X3DBaseNode .prototype = Object .assign (Object .create (X3DEventObject .prototy
194
189
 
195
190
  // Connect to execution context.
196
191
 
197
- if (this .getOuterNode && this .getOuterNode ())
192
+ if (this .getOuterNode ?.())
198
193
  this .getOuterNode () .getLive () .addInterest (_set_live__, this);
199
194
 
200
195
  else if (this [_executionContext] !== this)
@@ -298,8 +293,6 @@ X3DBaseNode .prototype = Object .assign (Object .create (X3DEventObject .prototy
298
293
  {
299
294
  get: function () { return field; },
300
295
  set: function (value) { field .setValue (value); },
301
- enumerable: false,
302
- configurable: false,
303
296
  });
304
297
  },
305
298
  getFieldDefinitions: function ()
@@ -325,8 +318,6 @@ X3DBaseNode .prototype = Object .assign (Object .create (X3DEventObject .prototy
325
318
  {
326
319
  get: function () { return field; },
327
320
  set: function (value) { field .setValue (value); },
328
- enumerable: false,
329
- configurable: true, // false : non deletable
330
321
  });
331
322
 
332
323
  if (!this .isPrivate ())
@@ -382,7 +373,6 @@ X3DBaseNode .prototype = Object .assign (Object .create (X3DEventObject .prototy
382
373
  get: function () { return field; },
383
374
  set: function (value) { field .setValue (value); },
384
375
  enumerable: true,
385
- configurable: false,
386
376
  });
387
377
 
388
378
  if (field .isInitializable ())
@@ -307,8 +307,6 @@ for (const key of Reflect .ownKeys (X3DInfoArray .prototype))
307
307
  Object .defineProperty (X3DInfoArray .prototype, "length",
308
308
  {
309
309
  get: function () { return this [_array] .length; },
310
- enumerable: false,
311
- configurable: false,
312
310
  });
313
311
 
314
312
  export default X3DInfoArray;
@@ -620,8 +620,6 @@ Object .defineProperty (X3DObjectArrayField .prototype, "length",
620
620
  {
621
621
  get: function () { return this [_target] .getValue () .length; },
622
622
  set: function (value) { this [_target] .resize (value); },
623
- enumerable: false,
624
- configurable: false,
625
623
  });
626
624
 
627
625
  export default X3DObjectArrayField;
@@ -1076,8 +1076,6 @@ Object .defineProperty (X3DTypedArrayField .prototype, "length",
1076
1076
  {
1077
1077
  get: function () { return this [_length]; },
1078
1078
  set: function (value) { this [_target] .resize (value); },
1079
- enumerable: false,
1080
- configurable: false,
1081
1079
  });
1082
1080
 
1083
1081
  // Getter/Setter functions to reference a value for a given index.
@@ -55,7 +55,6 @@ function BrowserTimings (executionContext)
55
55
 
56
56
  this .localStorage = this .getBrowser () .getLocalStorage () .addNameSpace ("BrowserTimings.");
57
57
  this .fps = new StopWatch ();
58
- this .localeOptions = { minimumFractionDigits: 2, maximumFractionDigits: 2 };
59
58
  }
60
59
 
61
60
  BrowserTimings .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
@@ -81,17 +80,101 @@ BrowserTimings .prototype = Object .assign (Object .create (X3DBaseNode .prototy
81
80
 
82
81
  this .localStorage .addDefaultValues ({ type: "LESS" });
83
82
 
84
- this .element = $("<div></div>") .hide () .addClass ("x_ite-private-browser-timings") .appendTo (this .getBrowser () .getSurface ());
85
- this .table = $("<table></table>") .appendTo (this .element);
86
- this .header = $("<thead></thead>") .append ($("<tr></tr>") .append ($("<th colspan='2'></th>"))) .appendTo (this .table);
87
- this .body = $("<tbody></tbody>") .appendTo (this .table);
88
- this .footer = $("<tfoot></tfoot>") .append ($("<tr></tr>") .append ($("<td colspan='2'></td>"))) .appendTo (this .table);
89
- this .button = $("<button></button>") .attr ("type", "button") .appendTo (this .footer .find ("td"));
90
- this .rows = [ ];
83
+ this .element = $("<div></div>")
84
+ .hide ()
85
+ .addClass ("x_ite-private-browser-timings")
86
+ .appendTo (this .getBrowser () .getSurface ());
87
+
88
+ this .table = $("<table></table>")
89
+ .appendTo (this .element);
90
+
91
+ this .header = $("<thead></thead>")
92
+ .append ($("<tr></tr>")
93
+ .append ($("<th colspan='2'></th>")
94
+ .text (_("Browser Timings"))))
95
+ .appendTo (this .table);
96
+
97
+ this .body = $("<tbody></tbody>")
98
+ .appendTo (this .table);
99
+
100
+ this .footer = $("<tfoot></tfoot>")
101
+ .append ($("<tr></tr>")
102
+ .append ($("<td colspan='2'></td>")))
103
+ .appendTo (this .table);
104
+
105
+ this .button = $("<button></button>")
106
+ .attr ("type", "button")
107
+ .appendTo (this .footer .find ("td"));
108
+
109
+ this .frameRate = $("<td></td>");
110
+ this .speed = $("<td></td>");
111
+ this .frameRate = $("<td></td>");
112
+ this .speed = $("<td></td>");
113
+ this .browserTime = $("<td></td>");
114
+ this .x3dTotal = $("<td></td>");
115
+ this .eventProcessing = $("<td></td>");
116
+ this .pointerTime = $("<td></td>");
117
+ this .cameraTime = $("<td></td>");
118
+ this .pickingTime = $("<td></td>");
119
+ this .collisionTime = $("<td></td>");
120
+ this .renderTime = $("<td></td>");
121
+ this .numShapes = $("<td></td>");
122
+ this .sensors = $("<td></td>");
123
+
124
+ this .body .append ($("<tr></tr>")
125
+ .append ($("<td></td>") .text (_("Frame rate") + ":"))
126
+ .append (this .frameRate));
127
+
128
+ this .body .append ($("<tr></tr>")
129
+ .append ($("<td></td>") .text (_("Speed") + ":"))
130
+ .append (this .speed)
131
+ .addClass ("x_ite-private-more"));
132
+
133
+ this .body .append ($("<tr></tr>")
134
+ .append ($("<td></td>") .text (_("Browser") + ":"))
135
+ .append (this .browserTime));
136
+
137
+ this .body .append ($("<tr></tr>")
138
+ .append ($("<td></td>") .text (_("X3D total") + ":"))
139
+ .append (this .x3dTotal));
140
+
141
+ this .body .append ($("<tr></tr>")
142
+ .append ($("<td></td>") .text (_("Event Processing") + ":"))
143
+ .append (this .eventProcessing));
144
+
145
+ this .body .append ($("<tr></tr>")
146
+ .append ($("<td></td>") .text (_("Pointer") + ":"))
147
+ .append (this .pointerTime));
148
+
149
+ this .body .append ($("<tr></tr>")
150
+ .append ($("<td></td>") .text (_("Camera") + ":"))
151
+ .append (this .cameraTime));
152
+
153
+ this .body .append ($("<tr></tr>")
154
+ .append ($("<td></td>") .text (_("Picking") + ":"))
155
+ .append (this .pickingTime));
156
+
157
+ this .body .append ($("<tr></tr>")
158
+ .append ($("<td></td>") .text (_("Collision Detection") + ":"))
159
+ .append (this .collisionTime));
160
+
161
+ this .body .append ($("<tr></tr>")
162
+ .append ($("<td></td>") .text (_("Rendering") + ":"))
163
+ .append (this .renderTime));
164
+
165
+ this .body .append ($("<tr></tr>")
166
+ .append ($("<td></td>") .text (_("Number of Shapes") + ":"))
167
+ .append (this .numShapes));
168
+
169
+ this .body .append ($("<tr></tr>")
170
+ .append ($("<td></td>") .text (_("Number of Sensors") + ":"))
171
+ .append (this .sensors));
91
172
 
92
173
  this .button .on ("click touchend", this .set_type__ .bind (this));
93
174
 
94
- this .set_button__ ();
175
+ this .localStorage .type = this .localStorage .type === "MORE" ? "LESS" : "MORE";
176
+
177
+ this .set_type__ ();
95
178
  },
96
179
  set_enabled__: function ()
97
180
  {
@@ -112,9 +195,17 @@ BrowserTimings .prototype = Object .assign (Object .create (X3DBaseNode .prototy
112
195
  set_type__: function ()
113
196
  {
114
197
  if (this .localStorage .type === "MORE")
198
+ {
115
199
  this .localStorage .type = "LESS";
200
+ this .table .addClass ("less");
201
+ this .table .removeClass ("more");
202
+ }
116
203
  else
204
+ {
117
205
  this .localStorage .type = "MORE";
206
+ this .table .addClass ("more");
207
+ this .table .removeClass ("less");
208
+ }
118
209
 
119
210
  this .set_button__ ();
120
211
  this .build ();
@@ -140,68 +231,45 @@ BrowserTimings .prototype = Object .assign (Object .create (X3DBaseNode .prototy
140
231
  },
141
232
  build: function ()
142
233
  {
143
- const
144
- browser = this .getBrowser (),
145
- language = navigator .language || navigator .userLanguage,
146
- fixed = this .localeOptions,
147
- rows = this .rows;
234
+ const browser = this .getBrowser ();
148
235
 
149
- let r = 0;
236
+ this .frameRate .text (f2(1000 / this .fps .averageTime) + " " + _("fps"));
237
+ this .speed .text (f2(this .getSpeed (browser .currentSpeed)) + " " + this .getSpeedUnit (browser .currentSpeed));
150
238
 
151
- rows [r++] = $("<tr></tr>") .append ($("<td></td>") .text (_("Frame rate") + ":")) .append ($("<td></td>") .text (f2(1000 / this .fps .averageTime) .toLocaleString (language, fixed) + " " + _("fps")));
152
- rows [r++] = $("<tr></tr>") .append ($("<td></td>") .text (_("Speed") + ":")) .append ($("<td></td>") .text (f2(this .getSpeed (browser .currentSpeed)) .toLocaleString (language, fixed) + " " + this .getSpeedUnit (browser .currentSpeed)));
239
+ if (this .localStorage .type !== "MORE" || !browser .getWorld ())
240
+ return;
153
241
 
154
- if (this .localStorage .type === "MORE")
155
- {
156
- const
157
- layers = browser .getWorld () .getLayerSet () .getLayers (),
158
- activeLayer = browser .getActiveLayer (),
159
- navigationTime = activeLayer && browser .getCollisionCount () ? activeLayer .getCollisionTime () .averageTime : 0,
160
- collisionTime = browser .getCollisionTime () .averageTime + navigationTime,
161
- routingTime = Math .max (0, browser .getBrowserTime () .averageTime - (browser .getCameraTime () .averageTime + browser .getCollisionTime () .averageTime + browser .getDisplayTime () .averageTime)),
162
- prepareEvents = browser .prepareEvents () .getInterests () .size - 1,
163
- sensors = browser .sensorEvents () .getInterests () .size;
164
-
165
- let
166
- opaqueShapes = 0,
167
- transparentShapes = 0;
168
-
169
- for (const layer of layers)
170
- {
171
- opaqueShapes += layer .numOpaqueShapes;
172
- transparentShapes += layer .numTransparentShapes;
173
- }
174
-
175
- rows [1] .addClass ("x_ite-private-more");
176
-
177
- rows [r++] = $("<tr></tr>") .append ($("<td></td>") .text (_("Browser") + ":")) .append ($("<td></td>") .text (f2(browser .getSystemTime () .averageTime) .toLocaleString (language, fixed) + " " + _("ms")));
178
- rows [r++] = $("<tr></tr>") .append ($("<td></td>") .text (_("X3D total") + ":")) .append ($("<td></td>") .text (f2(browser .getBrowserTime () .averageTime) .toLocaleString (language, fixed) + " " + _("ms")));
179
- rows [r++] = $("<tr></tr>") .append ($("<td></td>") .text (_("Event Processing") + ":")) .append ($("<td></td>") .text (f2(routingTime) .toLocaleString (language, fixed) + " " + _("ms")));
180
- rows [r++] = $("<tr></tr>") .append ($("<td></td>") .text (_("Pointer") + ":")) .append ($("<td></td>") .text (f2(browser .getPointingTime () .averageTime) .toLocaleString (language, fixed) + " " + _("ms")));
181
- rows [r++] = $("<tr></tr>") .append ($("<td></td>") .text (_("Camera") + ":")) .append ($("<td></td>") .text (f2(browser .getCameraTime () .averageTime) .toLocaleString (language, fixed) + " " + _("ms")));
182
- rows [r++] = $("<tr></tr>") .append ($("<td></td>") .text (_("Picking") + ":")) .append ($("<td></td>") .text (f2(browser .getPickingTime () .averageTime) .toLocaleString (language, fixed) + " " + _("ms")));
183
- rows [r++] = $("<tr></tr>") .append ($("<td></td>") .text (_("Collision Detection") + ":")) .append ($("<td></td>") .text (f2(collisionTime) .toLocaleString (language, fixed) + " " + _("ms")));
184
- rows [r++] = $("<tr></tr>") .append ($("<td></td>") .text (_("Rendering") + ":")) .append ($("<td></td>") .text (f2(browser .getDisplayTime () .averageTime) .toLocaleString (language, fixed) + " " + _("ms")));
185
- rows [r++] = $("<tr></tr>") .append ($("<td></td>") .text (_("Number of Shapes") + ":")) .append ($("<td></td>") .text (opaqueShapes + " + " + transparentShapes));
186
- rows [r++] = $("<tr></tr>") .append ($("<td></td>") .text (_("Number of Sensors") + ":")) .append ($("<td></td>") .text (prepareEvents + sensors));
187
-
188
- browser .getSystemTime () .reset ();
189
- browser .getBrowserTime () .reset ();
190
- browser .getPointingTime () .reset ();
191
- browser .getCameraTime () .reset ();
192
- browser .getPickingTime () .reset ();
193
- browser .getCollisionTime () .reset ();
194
- browser .getDisplayTime () .reset ();
195
-
196
- if (activeLayer)
197
- activeLayer .getCollisionTime () .reset ();
198
- }
242
+ const
243
+ layers = browser .getWorld () .getLayerSet () .getLayers (),
244
+ activeLayer = browser .getActiveLayer (),
245
+ navigationTime = activeLayer && browser .getCollisionCount () ? activeLayer .getCollisionTime () .averageTime : 0,
246
+ collisionTime = browser .getCollisionTime () .averageTime + navigationTime,
247
+ routingTime = Math .max (0, browser .getBrowserTime () .averageTime - (browser .getCameraTime () .averageTime + browser .getCollisionTime () .averageTime + browser .getDisplayTime () .averageTime)),
248
+ prepareEvents = browser .prepareEvents () .getInterests () .size - 1,
249
+ sensors = browser .sensorEvents () .getInterests () .size,
250
+ opaqueShapes = layers .reduce ((n, layer) => n + layer .getNumOpaqueShapes (), 0),
251
+ transparentShapes = layers .reduce ((n, layer) => n + layer .getNumTransparentShapes (), 0);
199
252
 
200
- rows .length = r;
253
+ this .browserTime .text (f2(browser .getSystemTime () .averageTime) + " " + _("ms"));
254
+ this .x3dTotal .text (f2(browser .getBrowserTime () .averageTime) + " " + _("ms"));
255
+ this .eventProcessing .text (f2(routingTime) + " " + _("ms"));
256
+ this .pointerTime .text (f2(browser .getPointingTime () .averageTime) + " " + _("ms"));
257
+ this .cameraTime .text (f2(browser .getCameraTime () .averageTime) + " " + _("ms"));
258
+ this .pickingTime .text (f2(browser .getPickingTime () .averageTime) + " " + _("ms"));
259
+ this .collisionTime .text (f2(collisionTime) + " " + _("ms"));
260
+ this .renderTime .text (f2(browser .getDisplayTime () .averageTime) + " " + _("ms"));
261
+ this .numShapes .text (opaqueShapes + " + " + transparentShapes);
262
+ this .sensors .text (prepareEvents + sensors);
201
263
 
202
- this .header .find ("th") .text (_("Browser Timings"));
203
- this .body .empty ();
204
- this .body .append (rows);
264
+ browser .getSystemTime () .reset ();
265
+ browser .getBrowserTime () .reset ();
266
+ browser .getPointingTime () .reset ();
267
+ browser .getCameraTime () .reset ();
268
+ browser .getPickingTime () .reset ();
269
+ browser .getCollisionTime () .reset ();
270
+ browser .getDisplayTime () .reset ();
271
+
272
+ activeLayer ?.getCollisionTime () .reset ();
205
273
  },
206
274
  getSpeed: function (speed)
207
275
  {
@@ -219,6 +287,18 @@ BrowserTimings .prototype = Object .assign (Object .create (X3DBaseNode .prototy
219
287
  },
220
288
  });
221
289
 
222
- function f2 (n) { return isFinite (n) ? n .toFixed (2) : 0 .toFixed (2); }
290
+ const f2 = (function ()
291
+ {
292
+ const format = new Intl .NumberFormat (navigator .language || navigator .userLanguage, {
293
+ notation: "standard",
294
+ minimumFractionDigits: 2,
295
+ maximumFractionDigits: 2,
296
+ }) .format;
297
+
298
+ return function (value)
299
+ {
300
+ return format (Number .isFinite (value) ? value : 0);
301
+ };
302
+ })();
223
303
 
224
304
  export default BrowserTimings;
@@ -278,7 +278,7 @@ ContextMenu .prototype = Object .assign (Object .create (X3DBaseNode .prototype)
278
278
  className: "context-menu-icon x_ite-private-icon-shading",
279
279
  items: {
280
280
  "point": {
281
- name: _("Point"),
281
+ name: _("Points"),
282
282
  type: "radio",
283
283
  radio: "shading",
284
284
  selected: browser .getBrowserOption ("Shading") === "POINT",
@@ -286,7 +286,7 @@ ContextMenu .prototype = Object .assign (Object .create (X3DBaseNode .prototype)
286
286
  click: function ()
287
287
  {
288
288
  browser .setBrowserOption ("Shading", "POINT");
289
- browser .getNotification () ._string = _("Shading") + ": " + _("Point");
289
+ browser .getNotification () ._string = _("Shading") + ": " + _("Points");
290
290
  }
291
291
  .bind (this),
292
292
  },
@@ -156,7 +156,6 @@ X3DCoreContext .prototype =
156
156
  this .loadURL (new Fields .MFString (value), new Fields .MFString ());
157
157
  },
158
158
  enumerable: true,
159
- configurable: false,
160
159
  });
161
160
 
162
161
  Object .defineProperty (this .getElement () .get (0), "url",
@@ -170,7 +169,6 @@ X3DCoreContext .prototype =
170
169
  this .loadURL (value, new Fields .MFString ());
171
170
  },
172
171
  enumerable: true,
173
- configurable: false,
174
172
  });
175
173
 
176
174
  // Configure browser event handlers.
@@ -272,6 +270,12 @@ X3DCoreContext .prototype =
272
270
  this .setBrowserOption ("Antialiased", this .parseBooleanAttribute (newValue, true));
273
271
  break;
274
272
  }
273
+ case "baseURL":
274
+ case "baseurl":
275
+ {
276
+ this .setBaseURL (newValue);
277
+ break;
278
+ }
275
279
  case "cache":
276
280
  {
277
281
  this .setBrowserOption ("Cache", this .parseBooleanAttribute (newValue, true));
@@ -533,6 +533,9 @@ ExamineViewer .prototype = Object .assign (Object .create (X3DViewer .prototype)
533
533
  event .deltaY = delta;
534
534
  event .zoomFactor = Math .abs (delta) / $(window) .width ();
535
535
 
536
+ event .pageX = (touches [0] .pageX + touches [1] .pageX) / 2;
537
+ event .pageY = (touches [0] .pageY + touches [1] .pageY) / 2;
538
+
536
539
  this .mousewheel (event);
537
540
 
538
541
  break;
@@ -370,6 +370,9 @@ LookAtViewer .prototype = Object .assign (Object .create (X3DViewer .prototype),
370
370
 
371
371
  event .deltaY = delta;
372
372
  event .zoomFactor = Math .abs (delta) / $(window) .width ();
373
+
374
+ event .pageX = (touches [0] .pageX + touches [1] .pageX) / 2;
375
+ event .pageY = (touches [0] .pageY + touches [1] .pageY) / 2;
373
376
 
374
377
  this .mousewheel (event);
375
378
  }
@@ -54,13 +54,13 @@ const
54
54
  _loadingTotal = Symbol (),
55
55
  _loadingObjects = Symbol (),
56
56
  _loading = Symbol (),
57
- _location = Symbol (),
57
+ _baseURL = Symbol (),
58
58
  _defaultScene = Symbol (),
59
59
  _set_loadCount = Symbol ();
60
60
 
61
61
  function getBaseURI (element)
62
62
  {
63
- let baseURI = element .baseURI;
63
+ let baseURI = element .prop ("baseURI");
64
64
 
65
65
  // Fix for Edge.
66
66
  if (baseURI .startsWith ("about:"))
@@ -77,7 +77,7 @@ function X3DNetworkingContext ()
77
77
  this [_loadingTotal] = 0;
78
78
  this [_loadingObjects] = new Set ();
79
79
  this [_loading] = false;
80
- this [_location] = getBaseURI (this .getElement () [0]);
80
+ this [_baseURL] = getBaseURI (this .getElement ());
81
81
  }
82
82
 
83
83
  X3DNetworkingContext .prototype =
@@ -90,9 +90,17 @@ X3DNetworkingContext .prototype =
90
90
  {
91
91
  return URLs .getProviderUrl ();
92
92
  },
93
- getLocation: function ()
93
+ getBaseURL: function ()
94
94
  {
95
- return this [_location];
95
+ return this [_baseURL];
96
+ },
97
+ setBaseURL: function (value)
98
+ {
99
+ const
100
+ base = getBaseURI (this .getElement ()),
101
+ url = new URL (value, base);
102
+
103
+ this [_baseURL] = url .protocol === "data:" ? base : url .href;
96
104
  },
97
105
  getDefaultScene: function ()
98
106
  {
@@ -45,4 +45,4 @@
45
45
  *
46
46
  ******************************************************************************/
47
47
 
48
- export default "8.6.19";
48
+ export default "8.6.22";
@@ -826,51 +826,46 @@ for (const key of Reflect .ownKeys (X3DBrowser .prototype))
826
826
 
827
827
  Object .defineProperty (X3DBrowser .prototype, "name",
828
828
  {
829
- get: function () { return this .getName (); },
829
+ get: X3DBrowser .prototype .getName,
830
830
  enumerable: true,
831
- configurable: false
832
831
  });
833
832
 
834
833
  Object .defineProperty (X3DBrowser .prototype, "version",
835
834
  {
836
- get: function () { return this .getVersion (); },
835
+ get: X3DBrowser .prototype .getVersion,
837
836
  enumerable: true,
838
- configurable: false
839
837
  });
840
838
 
841
839
  Object .defineProperty (X3DBrowser .prototype, "providerUrl",
842
840
  {
843
- get: function () { return this .getProviderUrl (); },
841
+ get: X3DBrowser .prototype .getProviderUrl,
844
842
  enumerable: true,
845
- configurable: false
846
843
  });
847
844
 
848
845
  Object .defineProperty (X3DBrowser .prototype, "currentFrameRate",
849
846
  {
850
- get: function () { return this .getCurrentFrameRate (); },
847
+ get: X3DBrowser .prototype .getCurrentFrameRate,
851
848
  enumerable: true,
852
- configurable: false
853
849
  });
854
850
 
855
851
  Object .defineProperty (X3DBrowser .prototype, "currentSpeed",
856
852
  {
857
- get: function () { return this .getCurrentSpeed (); },
853
+ get: X3DBrowser .prototype .getCurrentSpeed,
858
854
  enumerable: true,
859
- configurable: false
860
855
  });
861
856
 
862
857
  Object .defineProperty (X3DBrowser .prototype, "description",
863
858
  {
864
- get: function ()
865
- {
866
- return this .getDescription ();
867
- },
868
- set: function (value)
869
- {
870
- this .setDescription (value);
871
- },
859
+ get: X3DBrowser .prototype .getDescription,
860
+ set: X3DBrowser .prototype .setDescription,
861
+ enumerable: true,
862
+ });
863
+
864
+ Object .defineProperty (X3DBrowser .prototype, "baseURL",
865
+ {
866
+ get: X3DBrowser .prototype .getBaseURL,
867
+ set: X3DBrowser .prototype .setBaseURL,
872
868
  enumerable: true,
873
- configurable: false
874
869
  });
875
870
 
876
871
  Object .defineProperty (X3DBrowser .prototype, "currentScene",
@@ -880,7 +875,6 @@ Object .defineProperty (X3DBrowser .prototype, "currentScene",
880
875
  return this .getScriptStack () .at (-1) .getExecutionContext ();
881
876
  },
882
877
  enumerable: true,
883
- configurable: false
884
878
  });
885
879
 
886
880
  Object .defineProperty (X3DBrowser .prototype, "supportedProfiles",
@@ -890,7 +884,6 @@ Object .defineProperty (X3DBrowser .prototype, "supportedProfiles",
890
884
  return SupportedProfiles;
891
885
  },
892
886
  enumerable: true,
893
- configurable: false
894
887
  });
895
888
 
896
889
  Object .defineProperty (X3DBrowser .prototype, "supportedComponents",
@@ -900,7 +893,6 @@ Object .defineProperty (X3DBrowser .prototype, "supportedComponents",
900
893
  return SupportedComponents;
901
894
  },
902
895
  enumerable: true,
903
- configurable: false
904
896
  });
905
897
 
906
898
  export default X3DBrowser;
@@ -390,7 +390,6 @@ Object .assign (X3DBrowserContext,
390
390
  Object .defineProperty (X3DBrowserContext .prototype, key,
391
391
  {
392
392
  value: browserContext .prototype [key],
393
- enumerable: false,
394
393
  writable: true,
395
394
  });
396
395
  }