x_ite 8.7.8 → 8.7.9

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 (89) hide show
  1. package/dist/assets/components/Annotation.js +13 -13
  2. package/dist/assets/components/Annotation.min.js +1 -1
  3. package/dist/assets/components/CADGeometry.js +13 -13
  4. package/dist/assets/components/CADGeometry.min.js +1 -1
  5. package/dist/assets/components/CubeMapTexturing.js +25 -25
  6. package/dist/assets/components/CubeMapTexturing.min.js +1 -1
  7. package/dist/assets/components/DIS.js +13 -13
  8. package/dist/assets/components/DIS.min.js +1 -1
  9. package/dist/assets/components/EventUtilities.js +9 -9
  10. package/dist/assets/components/EventUtilities.min.js +1 -1
  11. package/dist/assets/components/Geometry2D.js +19 -19
  12. package/dist/assets/components/Geometry2D.min.js +1 -1
  13. package/dist/assets/components/Geospatial.js +33 -33
  14. package/dist/assets/components/Geospatial.min.js +1 -1
  15. package/dist/assets/components/HAnim.js +18 -18
  16. package/dist/assets/components/HAnim.min.js +1 -1
  17. package/dist/assets/components/KeyDeviceSensor.js +8 -8
  18. package/dist/assets/components/KeyDeviceSensor.min.js +1 -1
  19. package/dist/assets/components/Layout.js +27 -27
  20. package/dist/assets/components/Layout.min.js +1 -1
  21. package/dist/assets/components/NURBS.js +27 -33
  22. package/dist/assets/components/NURBS.min.js +1 -1
  23. package/dist/assets/components/ParticleSystems.js +22 -22
  24. package/dist/assets/components/ParticleSystems.min.js +1 -1
  25. package/dist/assets/components/Picking.js +18 -18
  26. package/dist/assets/components/Picking.min.js +1 -1
  27. package/dist/assets/components/RigidBodyPhysics.js +18 -18
  28. package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
  29. package/dist/assets/components/Scripting.js +35 -35
  30. package/dist/assets/components/Scripting.min.js +1 -1
  31. package/dist/assets/components/Text.js +24 -24
  32. package/dist/assets/components/Text.min.js +1 -1
  33. package/dist/assets/components/TextureProjector.js +14 -14
  34. package/dist/assets/components/TextureProjector.min.js +1 -1
  35. package/dist/assets/components/Texturing3D.js +30 -30
  36. package/dist/assets/components/Texturing3D.min.js +1 -1
  37. package/dist/assets/components/VolumeRendering.js +19 -19
  38. package/dist/assets/components/VolumeRendering.min.js +1 -1
  39. package/dist/assets/components/X_ITE.js +9 -9
  40. package/dist/assets/components/X_ITE.min.js +1 -1
  41. package/dist/x_ite.css +1 -1
  42. package/dist/x_ite.js +516 -458
  43. package/dist/x_ite.min.js +1 -1
  44. package/dist/x_ite.zip +0 -0
  45. package/docs/_config.yml +1 -1
  46. package/package.json +1 -1
  47. package/src/assets/shaders/webgl1/include/Shadow.glsl.js +21 -25
  48. package/src/assets/shaders/webgl2/include/Shadow.glsl.js +23 -27
  49. package/src/x_ite/Base/X3DBaseNode.js +4 -5
  50. package/src/x_ite/Base/X3DObject.js +1 -1
  51. package/src/x_ite/Base/X3DObjectArrayField.js +7 -38
  52. package/src/x_ite/Base/X3DTypedArrayField.js +2 -2
  53. package/src/x_ite/Browser/VERSION.js +1 -1
  54. package/src/x_ite/Browser/X3DBrowser.js +10 -2
  55. package/src/x_ite/Components/Core/X3DNode.js +15 -15
  56. package/src/x_ite/Components/Core.js +2 -2
  57. package/src/x_ite/Components/EnvironmentalEffects.js +2 -2
  58. package/src/x_ite/Components/EnvironmentalSensor.js +2 -2
  59. package/src/x_ite/Components/Followers.js +2 -2
  60. package/src/x_ite/Components/Geometry3D.js +2 -2
  61. package/src/x_ite/Components/Grouping/X3DGroupingNode.js +1 -3
  62. package/src/x_ite/Components/Grouping.js +2 -2
  63. package/src/x_ite/Components/Interpolation.js +2 -2
  64. package/src/x_ite/Components/Layering.js +2 -2
  65. package/src/x_ite/Components/Lighting.js +2 -2
  66. package/src/x_ite/Components/NURBS/Contour2D.js +1 -3
  67. package/src/x_ite/Components/NURBS/NurbsSet.js +1 -3
  68. package/src/x_ite/Components/NURBS/NurbsTrimmedSurface.js +1 -3
  69. package/src/x_ite/Components/Navigation.js +2 -2
  70. package/src/x_ite/Components/Networking.js +2 -2
  71. package/src/x_ite/Components/PointingDeviceSensor.js +2 -2
  72. package/src/x_ite/Components/Rendering.js +2 -2
  73. package/src/x_ite/Components/Scripting/Script.js +7 -7
  74. package/src/x_ite/Components/Shaders.js +2 -2
  75. package/src/x_ite/Components/Shape.js +2 -2
  76. package/src/x_ite/Components/Sound.js +2 -2
  77. package/src/x_ite/Components/Texturing.js +2 -2
  78. package/src/x_ite/Components/Time.js +2 -2
  79. package/src/x_ite/Components.js +2 -2
  80. package/src/x_ite/Configuration/NodeTypeArray.js +68 -0
  81. package/src/x_ite/Configuration/SupportedNodes.js +13 -20
  82. package/src/x_ite/Execution/X3DExecutionContext.js +67 -49
  83. package/src/x_ite/Execution/X3DScene.js +1 -1
  84. package/src/x_ite/Execution/X3DWorld.js +1 -1
  85. package/src/x_ite/InputOutput/FileLoader.js +1 -1
  86. package/src/x_ite/Prototype/X3DExternProtoDeclaration.js +1 -1
  87. package/src/x_ite/Prototype/X3DProtoDeclaration.js +1 -1
  88. package/src/x_ite/Prototype/X3DProtoDeclarationNode.js +1 -1
  89. package/src/x_ite/Routing/X3DRoute.js +8 -0
package/dist/x_ite.zip CHANGED
Binary file
package/docs/_config.yml CHANGED
@@ -20,7 +20,7 @@ timezone:
20
20
  # ↓ --------------------------
21
21
 
22
22
  title: X_ITE X3D Browser # the main title
23
- version: 8.7.8 # x_ite latest version
23
+ version: 8.7.9 # x_ite latest version
24
24
  size: 290 # size in kb
25
25
  x3d_latest_version: 4.0 # x3d latest version
26
26
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "x_ite",
3
- "version": "8.7.8",
3
+ "version": "8.7.9",
4
4
  "description": "X_ITE X3D Browser, view and manipulate X3D and VRML scenes in HTML.",
5
5
  "homepage": "https://create3000.github.io/x_ite/",
6
6
  "author": "Holger Seelig <holger.seelig@gmail.com>",
@@ -245,21 +245,19 @@ getShadowIntensity (const in int index, const in x3d_LightSourceParameters light
245
245
  if (any (greaterThan (abs (shadowCoord .xy - 0.5), vec2 (0.5))))
246
246
  return 0.0;
247
247
 
248
- float dx0 = - texelSize .x;
249
- float dy0 = - texelSize .y;
250
- float dx1 = + texelSize .x;
251
- float dy1 = + texelSize .y;
248
+ vec2 d0 = - texelSize;
249
+ vec2 d1 = texelSize;
252
250
 
253
251
  float value = (
254
- texture2DCompare (index, shadowCoord .xy + vec2 (dx0, dy0), shadowCoord .z) +
255
- texture2DCompare (index, shadowCoord .xy + vec2 (0.0, dy0), shadowCoord .z) +
256
- texture2DCompare (index, shadowCoord .xy + vec2 (dx1, dy0), shadowCoord .z) +
257
- texture2DCompare (index, shadowCoord .xy + vec2 (dx0, 0.0), shadowCoord .z) +
252
+ texture2DCompare (index, shadowCoord .xy + d0, shadowCoord .z) +
253
+ texture2DCompare (index, shadowCoord .xy + vec2 (0.0, d0 .y), shadowCoord .z) +
254
+ texture2DCompare (index, shadowCoord .xy + vec2 (d1 .x, d0 .y), shadowCoord .z) +
255
+ texture2DCompare (index, shadowCoord .xy + vec2 (d0 .x, 0.0), shadowCoord .z) +
258
256
  texture2DCompare (index, shadowCoord .xy, shadowCoord .z) +
259
- texture2DCompare (index, shadowCoord .xy + vec2 (dx1, 0.0), shadowCoord .z) +
260
- texture2DCompare (index, shadowCoord .xy + vec2 (dx0, dy1), shadowCoord .z) +
261
- texture2DCompare (index, shadowCoord .xy + vec2 (0.0, dy1), shadowCoord .z) +
262
- texture2DCompare (index, shadowCoord .xy + vec2 (dx1, dy1), shadowCoord .z)
257
+ texture2DCompare (index, shadowCoord .xy + vec2 (d1 .x, 0.0), shadowCoord .z) +
258
+ texture2DCompare (index, shadowCoord .xy + vec2 (d0 .x, d1 .y), shadowCoord .z) +
259
+ texture2DCompare (index, shadowCoord .xy + vec2 (0.0, d1 .y), shadowCoord .z) +
260
+ texture2DCompare (index, shadowCoord .xy + d1, shadowCoord .z)
263
261
  ) * (1.0 / 9.0);
264
262
 
265
263
  return light .shadowIntensity * value;
@@ -275,22 +273,20 @@ getShadowIntensity (const in int index, const in x3d_LightSourceParameters light
275
273
  if (any (greaterThan (abs (shadowCoord .xy - 0.5), vec2 (0.5))))
276
274
  return 0.0;
277
275
 
278
- float dx0 = - texelSize.x;
279
- float dy0 = - texelSize.y;
280
- float dx1 = + texelSize.x;
281
- float dy1 = + texelSize.y;
276
+ vec2 d0 = - texelSize;
277
+ vec2 d1 = texelSize;
282
278
 
283
279
  float value = (
284
- texture2DShadowLerp (index, texelSize, float (shadowMapSize), shadowCoord .xy + vec2 (dx0, dy0), shadowCoord .z) +
285
- texture2DShadowLerp (index, texelSize, float (shadowMapSize), shadowCoord .xy + vec2 (0.0, dy0), shadowCoord .z) +
286
- texture2DShadowLerp (index, texelSize, float (shadowMapSize), shadowCoord .xy + vec2 (dx1, dy0), shadowCoord .z) +
287
- texture2DShadowLerp (index, texelSize, float (shadowMapSize), shadowCoord .xy + vec2 (dx0, 0.0), shadowCoord .z) +
280
+ texture2DShadowLerp (index, texelSize, float (shadowMapSize), shadowCoord .xy + d0, shadowCoord .z) +
281
+ texture2DShadowLerp (index, texelSize, float (shadowMapSize), shadowCoord .xy + vec2 (0.0, d0 .y), shadowCoord .z) +
282
+ texture2DShadowLerp (index, texelSize, float (shadowMapSize), shadowCoord .xy + vec2 (d1 .x, d0 .y), shadowCoord .z) +
283
+ texture2DShadowLerp (index, texelSize, float (shadowMapSize), shadowCoord .xy + vec2 (d0 .x, 0.0), shadowCoord .z) +
288
284
  texture2DShadowLerp (index, texelSize, float (shadowMapSize), shadowCoord .xy, shadowCoord .z) +
289
- texture2DShadowLerp (index, texelSize, float (shadowMapSize), shadowCoord .xy + vec2 (dx1, 0.0), shadowCoord .z) +
290
- texture2DShadowLerp (index, texelSize, float (shadowMapSize), shadowCoord .xy + vec2 (dx0, dy1), shadowCoord .z) +
291
- texture2DShadowLerp (index, texelSize, float (shadowMapSize), shadowCoord .xy + vec2 (0.0, dy1), shadowCoord .z) +
292
- texture2DShadowLerp (index, texelSize, float (shadowMapSize), shadowCoord .xy + vec2 (dx1, dy1), shadowCoord .z)
293
- ) * ( 1.0 / 9.0 );
285
+ texture2DShadowLerp (index, texelSize, float (shadowMapSize), shadowCoord .xy + vec2 (d1 .x, 0.0), shadowCoord .z) +
286
+ texture2DShadowLerp (index, texelSize, float (shadowMapSize), shadowCoord .xy + vec2 (d0 .x, d1 .y), shadowCoord .z) +
287
+ texture2DShadowLerp (index, texelSize, float (shadowMapSize), shadowCoord .xy + vec2 (0.0, d1 .y), shadowCoord .z) +
288
+ texture2DShadowLerp (index, texelSize, float (shadowMapSize), shadowCoord .xy + d1, shadowCoord .z)
289
+ ) * (1.0 / 9.0);
294
290
 
295
291
  return light .shadowIntensity * value;
296
292
 
@@ -259,21 +259,19 @@ getShadowIntensity (const in int index, const in x3d_LightSourceParameters light
259
259
  if (any (greaterThan (abs (shadowCoord .xy - 0.5), vec2 (0.5))))
260
260
  return 0.0;
261
261
 
262
- float dx0 = - texelSize .x;
263
- float dy0 = - texelSize .y;
264
- float dx1 = + texelSize .x;
265
- float dy1 = + texelSize .y;
262
+ vec2 d0 = - texelSize;
263
+ vec2 d1 = texelSize;
266
264
 
267
265
  float value = (
268
- texture2DCompare (index, shadowCoord .xy + vec2 (dx0, dy0), shadowCoord .z) +
269
- texture2DCompare (index, shadowCoord .xy + vec2 (0.0, dy0), shadowCoord .z) +
270
- texture2DCompare (index, shadowCoord .xy + vec2 (dx1, dy0), shadowCoord .z) +
271
- texture2DCompare (index, shadowCoord .xy + vec2 (dx0, 0.0), shadowCoord .z) +
272
- texture2DCompare (index, shadowCoord .xy, shadowCoord .z) +
273
- texture2DCompare (index, shadowCoord .xy + vec2 (dx1, 0.0), shadowCoord .z) +
274
- texture2DCompare (index, shadowCoord .xy + vec2 (dx0, dy1), shadowCoord .z) +
275
- texture2DCompare (index, shadowCoord .xy + vec2 (0.0, dy1), shadowCoord .z) +
276
- texture2DCompare (index, shadowCoord .xy + vec2 (dx1, dy1), shadowCoord .z)
266
+ texture2DCompare (index, shadowCoord .xy + d0, shadowCoord .z) +
267
+ texture2DCompare (index, shadowCoord .xy + vec2 (0.0, d0 .y), shadowCoord .z) +
268
+ texture2DCompare (index, shadowCoord .xy + vec2 (d1 .x, d0 .y), shadowCoord .z) +
269
+ texture2DCompare (index, shadowCoord .xy + vec2 (d0 .x, 0.0), shadowCoord .z) +
270
+ texture2DCompare (index, shadowCoord .xy, shadowCoord .z) +
271
+ texture2DCompare (index, shadowCoord .xy + vec2 (d1 .x, 0.0), shadowCoord .z) +
272
+ texture2DCompare (index, shadowCoord .xy + vec2 (d0 .x, d1 .y), shadowCoord .z) +
273
+ texture2DCompare (index, shadowCoord .xy + vec2 (0.0, d1 .y), shadowCoord .z) +
274
+ texture2DCompare (index, shadowCoord .xy + d1, shadowCoord .z)
277
275
  ) * (1.0 / 9.0);
278
276
 
279
277
  return light .shadowIntensity * value;
@@ -289,22 +287,20 @@ getShadowIntensity (const in int index, const in x3d_LightSourceParameters light
289
287
  if (any (greaterThan (abs (shadowCoord .xy - 0.5), vec2 (0.5))))
290
288
  return 0.0;
291
289
 
292
- float dx0 = - texelSize.x;
293
- float dy0 = - texelSize.y;
294
- float dx1 = + texelSize.x;
295
- float dy1 = + texelSize.y;
290
+ vec2 d0 = - texelSize;
291
+ vec2 d1 = texelSize;
296
292
 
297
293
  float value = (
298
- texture2DShadowLerp (index, texelSize, float (shadowMapSize), shadowCoord .xy + vec2 (dx0, dy0), shadowCoord .z) +
299
- texture2DShadowLerp (index, texelSize, float (shadowMapSize), shadowCoord .xy + vec2 (0.0, dy0), shadowCoord .z) +
300
- texture2DShadowLerp (index, texelSize, float (shadowMapSize), shadowCoord .xy + vec2 (dx1, dy0), shadowCoord .z) +
301
- texture2DShadowLerp (index, texelSize, float (shadowMapSize), shadowCoord .xy + vec2 (dx0, 0.0), shadowCoord .z) +
302
- texture2DShadowLerp (index, texelSize, float (shadowMapSize), shadowCoord .xy, shadowCoord .z) +
303
- texture2DShadowLerp (index, texelSize, float (shadowMapSize), shadowCoord .xy + vec2 (dx1, 0.0), shadowCoord .z) +
304
- texture2DShadowLerp (index, texelSize, float (shadowMapSize), shadowCoord .xy + vec2 (dx0, dy1), shadowCoord .z) +
305
- texture2DShadowLerp (index, texelSize, float (shadowMapSize), shadowCoord .xy + vec2 (0.0, dy1), shadowCoord .z) +
306
- texture2DShadowLerp (index, texelSize, float (shadowMapSize), shadowCoord .xy + vec2 (dx1, dy1), shadowCoord .z)
307
- ) * ( 1.0 / 9.0 );
294
+ texture2DShadowLerp (index, texelSize, float (shadowMapSize), shadowCoord .xy + d0, shadowCoord .z) +
295
+ texture2DShadowLerp (index, texelSize, float (shadowMapSize), shadowCoord .xy + vec2 (0.0, d0 .y), shadowCoord .z) +
296
+ texture2DShadowLerp (index, texelSize, float (shadowMapSize), shadowCoord .xy + vec2 (d1 .x, d0 .y), shadowCoord .z) +
297
+ texture2DShadowLerp (index, texelSize, float (shadowMapSize), shadowCoord .xy + vec2 (d0 .x, 0.0), shadowCoord .z) +
298
+ texture2DShadowLerp (index, texelSize, float (shadowMapSize), shadowCoord .xy, shadowCoord .z) +
299
+ texture2DShadowLerp (index, texelSize, float (shadowMapSize), shadowCoord .xy + vec2 (d1 .x, 0.0), shadowCoord .z) +
300
+ texture2DShadowLerp (index, texelSize, float (shadowMapSize), shadowCoord .xy + vec2 (d0 .x, d1 .y), shadowCoord .z) +
301
+ texture2DShadowLerp (index, texelSize, float (shadowMapSize), shadowCoord .xy + vec2 (0.0, d1 .y), shadowCoord .z) +
302
+ texture2DShadowLerp (index, texelSize, float (shadowMapSize), shadowCoord .xy + d1, shadowCoord .z)
303
+ ) * (1.0 / 9.0);
308
304
 
309
305
  return light .shadowIntensity * value;
310
306
 
@@ -242,6 +242,8 @@ X3DBaseNode .prototype = Object .assign (Object .create (X3DEventObject .prototy
242
242
  },
243
243
  setup: function ()
244
244
  {
245
+ Object .freeze (this [_type]);
246
+
245
247
  for (const field of this [_fields])
246
248
  field .setTainted (false);
247
249
 
@@ -502,14 +504,11 @@ X3DBaseNode .prototype = Object .assign (Object .create (X3DEventObject .prototy
502
504
  },
503
505
  hasRoutes: function ()
504
506
  {
505
- /// Returns true if there are any routes from or to fields of this node otherwise false.
507
+ /// Returns true if there are any routes from or to fields of this node, otherwise false.
506
508
 
507
509
  for (const field of this [_fields])
508
510
  {
509
- if (field .getInputRoutes () .size)
510
- return true;
511
-
512
- if (field .getOutputRoutes () .size)
511
+ if (field .getInputRoutes () .size || field .getOutputRoutes () .size)
513
512
  return true;
514
513
  }
515
514
 
@@ -217,7 +217,7 @@ Object .assign (X3DObject,
217
217
  })(),
218
218
  getInterestId: function (callbackName, object)
219
219
  {
220
- return `${this .getId (object)}.${this .getId (object [callbackName])}`;
220
+ return this .getId (object) + "." + this .getId (object [callbackName]);
221
221
  },
222
222
  });
223
223
 
@@ -134,7 +134,7 @@ function X3DObjectArrayField (value)
134
134
  if (value [0] instanceof Array)
135
135
  value = value [0];
136
136
 
137
- X3DObjectArrayField .prototype .push .apply (this, value);
137
+ this .push (... value);
138
138
 
139
139
  return proxy;
140
140
  }
@@ -164,8 +164,7 @@ X3DObjectArrayField .prototype = Object .assign (Object .create (X3DArrayField .
164
164
  copy = target .create (),
165
165
  array = target .getValue ();
166
166
 
167
- X3DObjectArrayField .prototype .push .apply (copy, array);
168
-
167
+ copy .push (... array);
169
168
  copy .setModificationTime (0);
170
169
 
171
170
  return copy;
@@ -323,47 +322,17 @@ X3DObjectArrayField .prototype = Object .assign (Object .create (X3DArrayField .
323
322
  args .push (field);
324
323
  }
325
324
 
326
- Array .prototype .splice .call (target .getValue (), index, 0, ... args);
327
-
325
+ target .getValue () .splice (index, 0, ... args);
328
326
  target .addEvent ();
329
327
  },
330
328
  remove: function (first, last, value)
331
329
  {
332
330
  const
333
331
  target = this [_target],
334
- array = target .getValue ();
335
-
336
- if (typeof value === "function")
337
- {
338
- first = array .findIndex ((current, index) => index >= first && value (current .valueOf ()))
339
-
340
- if (first !== -1)
341
- {
342
- for (let i = first; ++ i < last; )
343
- {
344
- const current = array [i];
345
-
346
- if (!value (current .valueOf ()))
347
- {
348
- const tmp = array [first];
349
-
350
- array [first ++] = current;
351
- array [i] = tmp;
352
- }
353
- }
354
- }
355
- else
356
- {
357
- first = last;
358
- }
359
-
360
- if (first !== last)
361
- target .addEvent ();
362
-
363
- return first;
364
- }
332
+ array = target .getValue (),
333
+ cmp = typeof value === "function" ? value : v => v === value;
365
334
 
366
- first = array .findIndex ((current, index) => index >= first && current .equals (value))
335
+ first = array .findIndex ((current, index) => index >= first && cmp (current .valueOf ()));
367
336
 
368
337
  if (first !== -1)
369
338
  {
@@ -371,7 +340,7 @@ X3DObjectArrayField .prototype = Object .assign (Object .create (X3DArrayField .
371
340
  {
372
341
  const current = array [i];
373
342
 
374
- if (!current .equals (value))
343
+ if (!cmp (current .valueOf ()))
375
344
  {
376
345
  const tmp = array [first];
377
346
 
@@ -179,7 +179,7 @@ function X3DTypedArrayField (args)
179
179
  this [_tmp] = [ ]; // Array with components size.
180
180
  }
181
181
 
182
- X3DTypedArrayField .prototype .push .call (this, ... args);
182
+ this .push (... args);
183
183
 
184
184
  return proxy;
185
185
  }
@@ -233,7 +233,7 @@ X3DTypedArrayField .prototype = Object .assign (Object .create (X3DArrayField .p
233
233
 
234
234
  copy [_length] = target [_length];
235
235
 
236
- X3DArrayField .prototype .set .call (copy, copyArray, target [_length]);
236
+ X3DArrayField .prototype .set .call (copy, copyArray);
237
237
 
238
238
  copy .setModificationTime (0);
239
239
 
@@ -45,4 +45,4 @@
45
45
  *
46
46
  ******************************************************************************/
47
47
 
48
- export default "8.7.8";
48
+ export default "8.7.9";
@@ -254,11 +254,19 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
254
254
  })(),
255
255
  getSupportedNode: function (typeName)
256
256
  {
257
- return SupportedNodes .getType (String (typeName));
257
+ return SupportedNodes .getNodeTypes () .get (String (typeName));
258
258
  },
259
259
  getSupportedNodes: function ()
260
260
  {
261
- return SupportedNodes .getTypes ();
261
+ return SupportedNodes .getNodeTypes ();
262
+ },
263
+ getAbstractNode: function (typeName)
264
+ {
265
+ return SupportedNodes .getAbstractNodeTypes () .get (String (typeName));
266
+ },
267
+ getAbstractNodes: function ()
268
+ {
269
+ return SupportedNodes .getAbstractNodeTypes ();
262
270
  },
263
271
  createScene: function (profile, component1 /*, ...*/)
264
272
  {
@@ -77,7 +77,7 @@ X3DNode .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
77
77
  const namedNode = executionContext .getNamedNodes () .get (this .getName ());
78
78
 
79
79
  if (namedNode)
80
- return namedNode;
80
+ return namedNode .getValue ();
81
81
  }
82
82
 
83
83
  // Create copy.
@@ -110,7 +110,7 @@ X3DNode .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
110
110
  }
111
111
  catch (error)
112
112
  {
113
- console .error (error .message);
113
+ console .error (error);
114
114
  }
115
115
  }
116
116
  }
@@ -135,7 +135,7 @@ X3DNode .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
135
135
  }
136
136
  catch (error)
137
137
  {
138
- console .log (error .message);
138
+ console .error (error);
139
139
  }
140
140
  }
141
141
 
@@ -1290,7 +1290,7 @@ X3DNode .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
1290
1290
  {
1291
1291
  const parentContext = executionContext .getExecutionContext ();
1292
1292
 
1293
- for (const importedNode of parentContext .getImportedNodes ())
1293
+ for (const importedNode of [... parentContext .getImportedNodes ()])
1294
1294
  {
1295
1295
  try
1296
1296
  {
@@ -1306,7 +1306,7 @@ X3DNode .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
1306
1306
 
1307
1307
  // Remove exported node if any.
1308
1308
 
1309
- for (const exportedNode of executionContext .getExportedNodes ())
1309
+ for (const exportedNode of [... executionContext .getExportedNodes ()])
1310
1310
  {
1311
1311
  if (exportedNode .getLocalNode () === this)
1312
1312
  executionContext .removeExportedNode (exportedNode .getExportedName ());
@@ -1317,20 +1317,20 @@ X3DNode .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
1317
1317
 
1318
1318
  for (const firstParent of new Set (this .getParents ()))
1319
1319
  {
1320
- if (firstParent instanceof Fields .SFNode)
1320
+ if (!(firstParent instanceof Fields .SFNode))
1321
+ continue;
1322
+
1323
+ for (const secondParent of new Set (firstParent .getParents ()))
1321
1324
  {
1322
- for (const secondParent of new Set (firstParent .getParents ()))
1323
- {
1324
- if (secondParent instanceof Fields .MFNode)
1325
- {
1326
- const length = secondParent .length;
1325
+ if (!(secondParent instanceof Fields .MFNode))
1326
+ continue;
1327
1327
 
1328
- secondParent .erase (secondParent .remove (0, length, firstParent), length);
1329
- }
1330
- }
1328
+ const length = secondParent .length;
1331
1329
 
1332
- firstParent .setValue (null);
1330
+ secondParent .erase (secondParent .remove (0, length, firstParent .valueOf ()), length);
1333
1331
  }
1332
+
1333
+ firstParent .setValue (null);
1334
1334
  }
1335
1335
 
1336
1336
  // Call super.dispose, where fields get disposed.
@@ -84,9 +84,9 @@ const AbstractTypes =
84
84
  };
85
85
 
86
86
  for (const typeName in Types)
87
- SupportedNodes .addType (typeName, Types [typeName]);
87
+ SupportedNodes .addNodeType (typeName, Types [typeName]);
88
88
 
89
89
  for (const typeName in AbstractTypes)
90
- SupportedNodes .addAbstractType (typeName, AbstractTypes [typeName]);
90
+ SupportedNodes .addAbstractNodeType (typeName, AbstractTypes [typeName]);
91
91
 
92
92
  export default undefined;
@@ -70,9 +70,9 @@ const AbstractTypes =
70
70
  };
71
71
 
72
72
  for (const typeName in Types)
73
- SupportedNodes .addType (typeName, Types [typeName]);
73
+ SupportedNodes .addNodeType (typeName, Types [typeName]);
74
74
 
75
75
  for (const typeName in AbstractTypes)
76
- SupportedNodes .addAbstractType (typeName, AbstractTypes [typeName]);
76
+ SupportedNodes .addAbstractNodeType (typeName, AbstractTypes [typeName]);
77
77
 
78
78
  export default undefined;
@@ -64,9 +64,9 @@ const AbstractTypes =
64
64
  };
65
65
 
66
66
  for (const typeName in Types)
67
- SupportedNodes .addType (typeName, Types [typeName]);
67
+ SupportedNodes .addNodeType (typeName, Types [typeName]);
68
68
 
69
69
  for (const typeName in AbstractTypes)
70
- SupportedNodes .addAbstractType (typeName, AbstractTypes [typeName]);
70
+ SupportedNodes .addAbstractNodeType (typeName, AbstractTypes [typeName]);
71
71
 
72
72
  export default undefined;
@@ -90,9 +90,9 @@ const AbstractTypes =
90
90
  };
91
91
 
92
92
  for (const typeName in Types)
93
- SupportedNodes .addType (typeName, Types [typeName]);
93
+ SupportedNodes .addNodeType (typeName, Types [typeName]);
94
94
 
95
95
  for (const typeName in AbstractTypes)
96
- SupportedNodes .addAbstractType (typeName, AbstractTypes [typeName]);
96
+ SupportedNodes .addAbstractNodeType (typeName, AbstractTypes [typeName]);
97
97
 
98
98
  export default undefined;
@@ -70,9 +70,9 @@ const AbstractTypes =
70
70
  };
71
71
 
72
72
  for (const typeName in Types)
73
- SupportedNodes .addType (typeName, Types [typeName]);
73
+ SupportedNodes .addNodeType (typeName, Types [typeName]);
74
74
 
75
75
  for (const typeName in AbstractTypes)
76
- SupportedNodes .addAbstractType (typeName, AbstractTypes [typeName]);
76
+ SupportedNodes .addAbstractNodeType (typeName, AbstractTypes [typeName]);
77
77
 
78
78
  export default undefined;
@@ -709,9 +709,7 @@ function remove (array, first, last, range, rfirst, rlast)
709
709
  for (let i = rfirst; i < rlast; ++ i)
710
710
  set .add (range [i]);
711
711
 
712
- function compare (value) { return set .has (value); }
713
-
714
- return array .remove (first, last, compare);
712
+ return array .remove (first, last, value => set .has (value));
715
713
  }
716
714
 
717
715
  export default X3DGroupingNode;
@@ -72,9 +72,9 @@ const AbstractTypes =
72
72
  };
73
73
 
74
74
  for (const typeName in Types)
75
- SupportedNodes .addType (typeName, Types [typeName]);
75
+ SupportedNodes .addNodeType (typeName, Types [typeName]);
76
76
 
77
77
  for (const typeName in AbstractTypes)
78
- SupportedNodes .addAbstractType (typeName, AbstractTypes [typeName]);
78
+ SupportedNodes .addAbstractNodeType (typeName, AbstractTypes [typeName]);
79
79
 
80
80
  export default undefined;
@@ -84,9 +84,9 @@ const AbstractTypes =
84
84
  };
85
85
 
86
86
  for (const typeName in Types)
87
- SupportedNodes .addType (typeName, Types [typeName]);
87
+ SupportedNodes .addNodeType (typeName, Types [typeName]);
88
88
 
89
89
  for (const typeName in AbstractTypes)
90
- SupportedNodes .addAbstractType (typeName, AbstractTypes [typeName]);
90
+ SupportedNodes .addAbstractNodeType (typeName, AbstractTypes [typeName]);
91
91
 
92
92
  export default undefined;
@@ -66,9 +66,9 @@ const AbstractTypes =
66
66
  };
67
67
 
68
68
  for (const typeName in Types)
69
- SupportedNodes .addType (typeName, Types [typeName]);
69
+ SupportedNodes .addNodeType (typeName, Types [typeName]);
70
70
 
71
71
  for (const typeName in AbstractTypes)
72
- SupportedNodes .addAbstractType (typeName, AbstractTypes [typeName]);
72
+ SupportedNodes .addAbstractNodeType (typeName, AbstractTypes [typeName]);
73
73
 
74
74
  export default undefined;
@@ -66,9 +66,9 @@ const AbstractTypes =
66
66
  };
67
67
 
68
68
  for (const typeName in Types)
69
- SupportedNodes .addType (typeName, Types [typeName]);
69
+ SupportedNodes .addNodeType (typeName, Types [typeName]);
70
70
 
71
71
  for (const typeName in AbstractTypes)
72
- SupportedNodes .addAbstractType (typeName, AbstractTypes [typeName]);
72
+ SupportedNodes .addAbstractNodeType (typeName, AbstractTypes [typeName]);
73
73
 
74
74
  export default undefined;
@@ -162,9 +162,7 @@ function remove (array, first, last, range, rfirst, rlast)
162
162
  for (let i = rfirst; i < rlast; ++ i)
163
163
  set .add (range [i]);
164
164
 
165
- function compare (value) { return set .has (value); }
166
-
167
- return array .remove (first, last, compare);
165
+ return array .remove (first, last, value => set .has (value));
168
166
  }
169
167
 
170
168
  export default Contour2D;
@@ -178,9 +178,7 @@ function remove (array, first, last, range, rfirst, rlast)
178
178
  for (let i = rfirst; i < rlast; ++ i)
179
179
  set .add (range [i]);
180
180
 
181
- function compare (value) { return set .has (value); }
182
-
183
- return array .remove (first, last, compare);
181
+ return array .remove (first, last, value => set .has (value));
184
182
  }
185
183
 
186
184
  export default NurbsSet;
@@ -169,9 +169,7 @@ function remove (array, first, last, range, rfirst, rlast)
169
169
  for (let i = rfirst; i < rlast; ++ i)
170
170
  set .add (range [i]);
171
171
 
172
- function compare (value) { return set .has (value); }
173
-
174
- return array .remove (first, last, compare);
172
+ return array .remove (first, last, value => set .has (value));
175
173
  }
176
174
 
177
175
  export default NurbsTrimmedSurface;
@@ -72,9 +72,9 @@ const AbstractTypes =
72
72
  };
73
73
 
74
74
  for (const typeName in Types)
75
- SupportedNodes .addType (typeName, Types [typeName]);
75
+ SupportedNodes .addNodeType (typeName, Types [typeName]);
76
76
 
77
77
  for (const typeName in AbstractTypes)
78
- SupportedNodes .addAbstractType (typeName, AbstractTypes [typeName]);
78
+ SupportedNodes .addAbstractNodeType (typeName, AbstractTypes [typeName]);
79
79
 
80
80
  export default undefined;
@@ -66,9 +66,9 @@ const AbstractTypes =
66
66
  };
67
67
 
68
68
  for (const typeName in Types)
69
- SupportedNodes .addType (typeName, Types [typeName]);
69
+ SupportedNodes .addNodeType (typeName, Types [typeName]);
70
70
 
71
71
  for (const typeName in AbstractTypes)
72
- SupportedNodes .addAbstractType (typeName, AbstractTypes [typeName]);
72
+ SupportedNodes .addAbstractNodeType (typeName, AbstractTypes [typeName]);
73
73
 
74
74
  export default undefined;
@@ -70,9 +70,9 @@ const AbstractTypes =
70
70
  };
71
71
 
72
72
  for (const typeName in Types)
73
- SupportedNodes .addType (typeName, Types [typeName]);
73
+ SupportedNodes .addNodeType (typeName, Types [typeName]);
74
74
 
75
75
  for (const typeName in AbstractTypes)
76
- SupportedNodes .addAbstractType (typeName, AbstractTypes [typeName]);
76
+ SupportedNodes .addAbstractNodeType (typeName, AbstractTypes [typeName]);
77
77
 
78
78
  export default undefined;
@@ -98,9 +98,9 @@ const AbstractTypes =
98
98
  };
99
99
 
100
100
  for (const typeName in Types)
101
- SupportedNodes .addType (typeName, Types [typeName]);
101
+ SupportedNodes .addNodeType (typeName, Types [typeName]);
102
102
 
103
103
  for (const typeName in AbstractTypes)
104
- SupportedNodes .addAbstractType (typeName, AbstractTypes [typeName]);
104
+ SupportedNodes .addAbstractNodeType (typeName, AbstractTypes [typeName]);
105
105
 
106
106
  export default undefined;
@@ -353,13 +353,6 @@ Script .prototype = Object .assign (Object .create (X3DScriptNode .prototype),
353
353
 
354
354
  this .context = this .getContext (sourceText);
355
355
 
356
- // Call initialize function.
357
-
358
- const initialize = this .context .get ("initialize");
359
-
360
- if (typeof initialize === "function")
361
- this .call__ (initialize, "initialize");
362
-
363
356
  // Connect shutdown.
364
357
 
365
358
  const shutdown = this .context .get ("shutdown");
@@ -407,6 +400,13 @@ Script .prototype = Object .assign (Object .create (X3DScriptNode .prototype),
407
400
  }
408
401
  }
409
402
  }
403
+
404
+ // Call initialize function.
405
+
406
+ const initialize = this .context .get ("initialize");
407
+
408
+ if (typeof initialize === "function")
409
+ this .call__ (initialize, "initialize");
410
410
  },
411
411
  call__: function (callback, name)
412
412
  {