x_ite 8.6.17 → 8.6.18

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 (100) 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 +28 -28
  6. package/dist/assets/components/CubeMapTexturing.min.js +1 -1
  7. package/dist/assets/components/DIS.js +13 -21
  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 -39
  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 +24 -24
  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 +24 -23
  26. package/dist/assets/components/Picking.min.js +1 -1
  27. package/dist/assets/components/RigidBodyPhysics.js +20 -20
  28. package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
  29. package/dist/assets/components/Scripting.js +121 -193
  30. package/dist/assets/components/Scripting.min.js +1 -1
  31. package/dist/assets/components/Text.js +30 -31
  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 +174 -174
  36. package/dist/assets/components/Texturing3D.min.js +1 -1
  37. package/dist/assets/components/VolumeRendering.js +35 -33
  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 +407 -404
  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/docs/_posts/reference/prototype-services.md +2 -2
  47. package/package.json +2 -2
  48. package/src/x_ite/Base/X3DBaseNode.js +8 -23
  49. package/src/x_ite/Base/X3DEventObject.js +1 -1
  50. package/src/x_ite/Base/X3DField.js +17 -18
  51. package/src/x_ite/Base/X3DObject.js +5 -1
  52. package/src/x_ite/Base/X3DObjectArrayField.js +12 -11
  53. package/src/x_ite/Base/X3DTypedArrayField.js +3 -3
  54. package/src/x_ite/Browser/Networking/X3DNetworkingContext.js +8 -6
  55. package/src/x_ite/Browser/PointingDeviceSensor/X3DPointingDeviceSensorContext.js +2 -2
  56. package/src/x_ite/Browser/VERSION.js +1 -1
  57. package/src/x_ite/Browser/VolumeRendering/X3DVolumeRenderingContext.js +2 -2
  58. package/src/x_ite/Browser/X3DBrowser.js +17 -39
  59. package/src/x_ite/Components/Core/X3DNode.js +2 -2
  60. package/src/x_ite/Components/Core/X3DPrototypeInstance.js +3 -8
  61. package/src/x_ite/Components/CubeMapTexturing/ImageCubeMapTexture.js +3 -3
  62. package/src/x_ite/Components/DIS/DISEntityTypeMapping.js +0 -8
  63. package/src/x_ite/Components/EnvironmentalSensor/ProximitySensor.js +14 -12
  64. package/src/x_ite/Components/EnvironmentalSensor/TransformSensor.js +3 -3
  65. package/src/x_ite/Components/EnvironmentalSensor/VisibilitySensor.js +1 -1
  66. package/src/x_ite/Components/EnvironmentalSensor/X3DEnvironmentalSensorNode.js +1 -1
  67. package/src/x_ite/Components/Geospatial/GeoMetadata.js +0 -6
  68. package/src/x_ite/Components/Networking/Anchor.js +36 -33
  69. package/src/x_ite/Components/Networking/Inline.js +3 -3
  70. package/src/x_ite/Components/Networking/X3DUrlObject.js +74 -23
  71. package/src/x_ite/Components/Picking/X3DPickSensorNode.js +6 -5
  72. package/src/x_ite/Components/RigidBodyPhysics/CollisionSensor.js +2 -2
  73. package/src/x_ite/Components/Scripting/Script.js +93 -165
  74. package/src/x_ite/Components/Shaders/ComposedShader.js +3 -18
  75. package/src/x_ite/Components/Shaders/PackagedShader.js +0 -2
  76. package/src/x_ite/Components/Shaders/ShaderPart.js +4 -4
  77. package/src/x_ite/Components/Shaders/ShaderProgram.js +0 -2
  78. package/src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js +3 -4
  79. package/src/x_ite/Components/Sound/AudioClip.js +3 -3
  80. package/src/x_ite/Components/Text/Text.js +2 -3
  81. package/src/x_ite/Components/Text/X3DFontStyleNode.js +4 -4
  82. package/src/x_ite/Components/Texturing/ImageTexture.js +3 -3
  83. package/src/x_ite/Components/Texturing/MovieTexture.js +3 -3
  84. package/src/x_ite/Components/Texturing3D/ImageTexture3D.js +3 -3
  85. package/src/x_ite/Components/Texturing3D/ImageTextureAtlas.js +3 -3
  86. package/src/x_ite/Components/Time/X3DTimeDependentNode.js +31 -25
  87. package/src/x_ite/Components/VolumeRendering/IsoSurfaceVolumeData.js +1 -1
  88. package/src/x_ite/Components/VolumeRendering/SegmentedVolumeData.js +1 -1
  89. package/src/x_ite/Components/VolumeRendering/VolumeData.js +1 -1
  90. package/src/x_ite/Components/VolumeRendering/X3DVolumeDataNode.js +11 -9
  91. package/src/x_ite/Execution/X3DExecutionContext.js +30 -32
  92. package/src/x_ite/Execution/X3DScene.js +6 -6
  93. package/src/x_ite/Fields/ArrayFields.js +2 -1
  94. package/src/x_ite/Fields/SFImage.js +0 -1
  95. package/src/x_ite/Fields/SFNode.js +4 -5
  96. package/src/x_ite/Parser/GLTF2Parser.js +45 -45
  97. package/src/x_ite/Parser/VRMLParser.js +2 -2
  98. package/src/x_ite/Parser/XMLParser.js +3 -3
  99. package/src/x_ite/Prototype/X3DExternProtoDeclaration.js +2 -2
  100. package/src/x_ite/Prototype/X3DProtoDeclarationNode.js +1 -1
@@ -109,13 +109,13 @@ ImageTextureAtlas .prototype = Object .assign (Object .create (X3DTexture3DNode
109
109
  this .image .on ("abort error", this .setError .bind (this));
110
110
  this .image .prop ("crossOrigin", "Anonymous");
111
111
 
112
- this .requestImmediateLoad ();
112
+ this .requestImmediateLoad () .catch (Function .prototype);
113
113
  },
114
- unLoadNow: function ()
114
+ unloadData: function ()
115
115
  {
116
116
  this .clearTexture ();
117
117
  },
118
- loadNow: function ()
118
+ loadData: function ()
119
119
  {
120
120
  this .urlStack .setValue (this ._url);
121
121
  this .loadNext ();
@@ -63,10 +63,7 @@ function X3DTimeDependentNode (executionContext)
63
63
  this .start = 0;
64
64
  this .pause = 0;
65
65
  this .pauseInterval = 0;
66
- this .startTimeout = null;
67
- this .pauseTimeout = null;
68
- this .resumeTimeout = null;
69
- this .stopTimeout = null;
66
+ this .timeouts = new Map ();
70
67
  this .disabled = false;
71
68
  }
72
69
 
@@ -165,13 +162,13 @@ X3DTimeDependentNode .prototype = Object .assign (Object .create (X3DChildNode .
165
162
 
166
163
  if (this ._enabled .getValue ())
167
164
  {
168
- this .removeTimeout ("startTimeout");
165
+ this .removeTimeout ("start");
169
166
 
170
167
  if (this .startTimeValue <= this .getBrowser () .getCurrentTime ())
171
168
  this .do_start ();
172
169
 
173
170
  else
174
- this .addTimeout ("startTimeout", "do_start", this .startTimeValue);
171
+ this .addTimeout ("start", "do_start", this .startTimeValue);
175
172
  }
176
173
  },
177
174
  set_pauseTime__: function ()
@@ -180,7 +177,7 @@ X3DTimeDependentNode .prototype = Object .assign (Object .create (X3DChildNode .
180
177
 
181
178
  if (this ._enabled .getValue ())
182
179
  {
183
- this .removeTimeout ("pauseTimeout");
180
+ this .removeTimeout ("pause");
184
181
 
185
182
  if (this .pauseTimeValue <= this .resumeTimeValue)
186
183
  return;
@@ -189,7 +186,7 @@ X3DTimeDependentNode .prototype = Object .assign (Object .create (X3DChildNode .
189
186
  this .do_pause ();
190
187
 
191
188
  else
192
- this .addTimeout ("pauseTimeout", "do_pause", this .pauseTimeValue);
189
+ this .addTimeout ("pause", "do_pause", this .pauseTimeValue);
193
190
  }
194
191
  },
195
192
  set_resumeTime__: function ()
@@ -198,7 +195,7 @@ X3DTimeDependentNode .prototype = Object .assign (Object .create (X3DChildNode .
198
195
 
199
196
  if (this ._enabled .getValue ())
200
197
  {
201
- this .removeTimeout ("resumeTimeout");
198
+ this .removeTimeout ("resume");
202
199
 
203
200
  if (this .resumeTimeValue <= this .pauseTimeValue)
204
201
  return;
@@ -207,7 +204,7 @@ X3DTimeDependentNode .prototype = Object .assign (Object .create (X3DChildNode .
207
204
  this .do_resume ();
208
205
 
209
206
  else
210
- this .addTimeout ("resumeTimeout", "do_resume", this .resumeTimeValue);
207
+ this .addTimeout ("resume", "do_resume", this .resumeTimeValue);
211
208
  }
212
209
  },
213
210
  set_stopTime__: function ()
@@ -216,7 +213,7 @@ X3DTimeDependentNode .prototype = Object .assign (Object .create (X3DChildNode .
216
213
 
217
214
  if (this ._enabled .getValue ())
218
215
  {
219
- this .removeTimeout ("stopTimeout");
216
+ this .removeTimeout ("stop");
220
217
 
221
218
  if (this .stopTimeValue <= this .startTimeValue)
222
219
  return;
@@ -225,7 +222,7 @@ X3DTimeDependentNode .prototype = Object .assign (Object .create (X3DChildNode .
225
222
  this .do_stop ();
226
223
 
227
224
  else
228
- this .addTimeout ("stopTimeout", "do_stop", this .stopTimeValue);
225
+ this .addTimeout ("stop", "do_stop", this .stopTimeValue);
229
226
  }
230
227
  },
231
228
  do_start: function ()
@@ -319,24 +316,29 @@ X3DTimeDependentNode .prototype = Object .assign (Object .create (X3DChildNode .
319
316
  this .getBrowser () .timeEvents () .removeInterest ("set_time" ,this);
320
317
  }
321
318
  },
322
- timeout: function (callback)
323
- {
324
- if (this ._enabled .getValue ())
325
- {
326
- this .getBrowser () .advanceTime ();
327
-
328
- this [callback] ();
329
- }
330
- },
331
319
  addTimeout: function (name, callback, time)
332
320
  {
333
321
  this .removeTimeout (name);
334
- this [name] = setTimeout (this .timeout .bind (this, callback), (time - this .getBrowser () .getCurrentTime ()) * 1000);
322
+
323
+ this .timeouts .set (name, setTimeout (this .processTimeout .bind (this, callback), (time - this .getBrowser () .getCurrentTime ()) * 1000));
335
324
  },
336
325
  removeTimeout: function (name)
337
326
  {
338
- clearTimeout (this [name]);
339
- this [name] = null;
327
+ clearTimeout (this .timeouts .get (name));
328
+
329
+ this .timeouts .delete (name);
330
+ },
331
+ processTimeout: function (callback)
332
+ {
333
+ if (!this ._enabled .getValue ())
334
+ return;
335
+
336
+ if (!(this .getLive () .getValue () || this ._isEvenLive .getValue ()))
337
+ return;
338
+
339
+ this .getBrowser () .advanceTime ();
340
+
341
+ this [callback] ();
340
342
  },
341
343
  set_loop: Function .prototype,
342
344
  set_start: Function .prototype,
@@ -344,7 +346,11 @@ X3DTimeDependentNode .prototype = Object .assign (Object .create (X3DChildNode .
344
346
  set_resume: Function .prototype,
345
347
  set_stop: Function .prototype,
346
348
  set_time: Function .prototype,
347
- dispose: Function .prototype,
349
+ dispose: function ()
350
+ {
351
+ for (const name of [... this .timeouts .keys ()])
352
+ this .removeTimeout (name);
353
+ },
348
354
  });
349
355
 
350
356
  export default X3DTimeDependentNode;
@@ -158,7 +158,7 @@ IsoSurfaceVolumeData .prototype = Object .assign (Object .create (X3DVolumeDataN
158
158
  if (this .voxelsNode)
159
159
  this .getAppearance () ._texture = this ._voxels;
160
160
  else
161
- this .getAppearance () ._texture = this .getBrowser () .getDefaultVoxels (this .getExecutionContext ());
161
+ this .getAppearance () ._texture = this .getBrowser () .getDefaultVoxels ();
162
162
  },
163
163
  createShader: function (options, vs, fs)
164
164
  {
@@ -160,7 +160,7 @@ SegmentedVolumeData .prototype = Object .assign (Object .create (X3DVolumeDataNo
160
160
  if (this .voxelsNode)
161
161
  this .getAppearance () ._texture = this ._voxels;
162
162
  else
163
- this .getAppearance () ._texture = this .getBrowser () .getDefaultVoxels (this .getExecutionContext ());
163
+ this .getAppearance () ._texture = this .getBrowser () .getDefaultVoxels ();
164
164
  },
165
165
  createShader: function (options, vs, fs)
166
166
  {
@@ -136,7 +136,7 @@ VolumeData .prototype = Object .assign (Object .create (X3DVolumeDataNode .proto
136
136
  if (this .voxelsNode)
137
137
  this .getAppearance () ._texture = this ._voxels;
138
138
  else
139
- this .getAppearance () ._texture = this .getBrowser () .getDefaultVoxels (this .getExecutionContext ());
139
+ this .getAppearance () ._texture = this .getBrowser () .getDefaultVoxels ();
140
140
  },
141
141
  createShader: function (options, vs, fs)
142
142
  {
@@ -60,15 +60,17 @@ function X3DVolumeDataNode (executionContext)
60
60
 
61
61
  this .addType (X3DConstants .X3DVolumeDataNode);
62
62
 
63
- this .proximitySensorNode = executionContext .createNode ("ProximitySensor", { setup: false, warn: false });
64
- this .transformNode = executionContext .createNode ("Transform", { setup: false, warn: false });
65
- this .shapeNode = executionContext .createNode ("Shape", { setup: false, warn: false });
66
- this .appearanceNode = executionContext .createNode ("Appearance", { setup: false, warn: false });
67
- this .textureTransformNode = executionContext .createNode ("TextureTransform3D", { setup: false, warn: false });
68
- this .geometryNode = executionContext .createNode ("QuadSet", { setup: false, warn: false });
69
- this .textureCoordinateNode = executionContext .createNode ("TextureCoordinate3D", { setup: false, warn: false });
70
- this .coordinateNode = executionContext .createNode ("Coordinate", { setup: false, warn: false });
71
- this .volumeMaterialNode = new VolumeMaterial (executionContext, this);
63
+ const browser = this .getBrowser ();
64
+
65
+ this .proximitySensorNode = browser .getPrivateScene () .createNode ("ProximitySensor", false);
66
+ this .transformNode = browser .getPrivateScene () .createNode ("Transform", false);
67
+ this .shapeNode = browser .getPrivateScene () .createNode ("Shape", false);
68
+ this .appearanceNode = browser .getPrivateScene () .createNode ("Appearance", false);
69
+ this .textureTransformNode = browser .getPrivateScene () .createNode ("TextureTransform3D", false);
70
+ this .geometryNode = browser .getPrivateScene () .createNode ("QuadSet", false);
71
+ this .textureCoordinateNode = browser .getPrivateScene () .createNode ("TextureCoordinate3D", false);
72
+ this .coordinateNode = browser .getPrivateScene () .createNode ("Coordinate", false);
73
+ this .volumeMaterialNode = new VolumeMaterial (browser .getPrivateScene (), this);
72
74
  this .textureNormalMatrixArray = new Float32Array (9);
73
75
 
74
76
  this .setCameraObject (true);
@@ -105,7 +105,7 @@ X3DExecutionContext .prototype = Object .assign (Object .create (X3DBaseNode .pr
105
105
  {
106
106
  X3DBaseNode .prototype .initialize .call (this);
107
107
 
108
- if (! this .isScene ())
108
+ if (!this .isScene ())
109
109
  this ._sceneGraph_changed .addInterest ("set_sceneGraph", this)
110
110
  },
111
111
  set_sceneGraph: function ()
@@ -141,13 +141,13 @@ X3DExecutionContext .prototype = Object .assign (Object .create (X3DBaseNode .pr
141
141
  {
142
142
  return this .getExecutionContext () .getProfile ();
143
143
  },
144
- getComponents: function ()
144
+ hasComponent: function (name)
145
145
  {
146
- return this .getExecutionContext () .getComponents ();
146
+ return this .getExecutionContext () .hasComponent (name);
147
147
  },
148
- hasComponent: function (componentName)
148
+ getComponents: function ()
149
149
  {
150
- return this .getExecutionContext () .hasComponent (componentName);
150
+ return this .getExecutionContext () .getComponents ();
151
151
  },
152
152
  fromUnit: function (category, value)
153
153
  {
@@ -161,7 +161,7 @@ X3DExecutionContext .prototype = Object .assign (Object .create (X3DBaseNode .pr
161
161
  {
162
162
  return this .getExecutionContext () .getUnits ();
163
163
  },
164
- createNode: function (typeName, { setup = true, warn = true } = { })
164
+ createNode: function (typeName, setup = true /* non-public argument */)
165
165
  {
166
166
  typeName = String (typeName);
167
167
 
@@ -169,7 +169,7 @@ X3DExecutionContext .prototype = Object .assign (Object .create (X3DBaseNode .pr
169
169
  {
170
170
  const Type = this .getBrowser () .getSupportedNode (typeName);
171
171
 
172
- if (! Type)
172
+ if (!Type)
173
173
  return null;
174
174
 
175
175
  const specificationRange = Type .prototype .getSpecificationRange ();
@@ -180,7 +180,7 @@ X3DExecutionContext .prototype = Object .assign (Object .create (X3DBaseNode .pr
180
180
  if (this .getSpecificationVersion () > specificationRange [1])
181
181
  return null;
182
182
 
183
- if (warn && !this .hasComponent (Type .prototype .getComponentName ()))
183
+ if (!this .hasComponent (Type .prototype .getComponentName ()))
184
184
  console .warn (`Node type '${typeName}' does not match component/profile statements in '${this .getWorldURL ()}'.`);
185
185
 
186
186
  return new Type (this);
@@ -189,7 +189,7 @@ X3DExecutionContext .prototype = Object .assign (Object .create (X3DBaseNode .pr
189
189
  {
190
190
  const Type = this .getBrowser () .getSupportedNode (typeName);
191
191
 
192
- if (! Type)
192
+ if (!Type)
193
193
  throw new Error (`Unknown node type '${typeName}'.`);
194
194
 
195
195
  const specificationRange = Type .prototype .getSpecificationRange ();
@@ -200,7 +200,7 @@ X3DExecutionContext .prototype = Object .assign (Object .create (X3DBaseNode .pr
200
200
  if (this .getSpecificationVersion () > specificationRange [1])
201
201
  throw new Error (`Node type '${typeName}' does not match specification version in '${this .getWorldURL ()}.`);
202
202
 
203
- if (warn && !this .hasComponent (Type .prototype .getComponentName ()))
203
+ if (!this .hasComponent (Type .prototype .getComponentName ()))
204
204
  console .warn (`Node type '${typeName}' does not match component/profile statements in '${this .getWorldURL ()}'.`);
205
205
 
206
206
  const baseNode = new Type (this);
@@ -210,7 +210,7 @@ X3DExecutionContext .prototype = Object .assign (Object .create (X3DBaseNode .pr
210
210
  return SFNodeCache .get (baseNode);
211
211
  }
212
212
  },
213
- createProto: function (name, { setup = true } = { })
213
+ createProto: function (name, setup = true /* non-public argument */)
214
214
  {
215
215
  name = String (name);
216
216
 
@@ -221,12 +221,12 @@ X3DExecutionContext .prototype = Object .assign (Object .create (X3DBaseNode .pr
221
221
  const proto = executionContext .protos .get (name);
222
222
 
223
223
  if (proto)
224
- return proto .createInstance (this, { setup: setup });
224
+ return proto .createInstance (this, setup);
225
225
 
226
226
  const externproto = executionContext .externprotos .get (name);
227
227
 
228
228
  if (externproto)
229
- return externproto .createInstance (this, { setup: setup });
229
+ return externproto .createInstance (this, setup);
230
230
 
231
231
  if (executionContext .isScene ())
232
232
  break;
@@ -251,7 +251,7 @@ X3DExecutionContext .prototype = Object .assign (Object .create (X3DBaseNode .pr
251
251
  name = String (name);
252
252
  node = X3DCast (X3DConstants .X3DNode, node, false);
253
253
 
254
- if (! node)
254
+ if (!node)
255
255
  throw new Error ("Couldn't update named node: node must be of type X3DNode.");
256
256
 
257
257
  if (node .getExecutionContext () !== this)
@@ -279,7 +279,7 @@ X3DExecutionContext .prototype = Object .assign (Object .create (X3DBaseNode .pr
279
279
 
280
280
  const node = this [_namedNodes] .get (name);
281
281
 
282
- if (! node)
282
+ if (!node)
283
283
  return;
284
284
 
285
285
  node .setName ("");
@@ -326,7 +326,7 @@ X3DExecutionContext .prototype = Object .assign (Object .create (X3DBaseNode .pr
326
326
  exportedName = String (exportedName);
327
327
  importedName = importedName === undefined ? exportedName : String (importedName);
328
328
 
329
- if (! inlineNode)
329
+ if (!inlineNode)
330
330
  throw new Error ("Node must be of type Inline node.");
331
331
 
332
332
  if (inlineNode .getExecutionContext () !== this)
@@ -354,7 +354,7 @@ X3DExecutionContext .prototype = Object .assign (Object .create (X3DBaseNode .pr
354
354
 
355
355
  const importedNode = this [_importedNodes] .get (importedName);
356
356
 
357
- if (! importedNode)
357
+ if (!importedNode)
358
358
  return;
359
359
 
360
360
  importedNode .dispose ();
@@ -400,7 +400,7 @@ X3DExecutionContext .prototype = Object .assign (Object .create (X3DBaseNode .pr
400
400
  {
401
401
  node = X3DCast (X3DConstants .X3DNode, node, false);
402
402
 
403
- if (! node)
403
+ if (!node)
404
404
  throw new Error ("Couldn't get local name: node must be of type X3DNode.");
405
405
 
406
406
  if (node .getExecutionContext () === this)
@@ -441,7 +441,7 @@ X3DExecutionContext .prototype = Object .assign (Object .create (X3DBaseNode .pr
441
441
  {
442
442
  name = String (name);
443
443
 
444
- if (! (proto instanceof X3DProtoDeclaration))
444
+ if (!(proto instanceof X3DProtoDeclaration))
445
445
  throw new Error ("Couldn't add proto declaration: proto must be of type X3DProtoDeclaration.");
446
446
 
447
447
  if (this [_protos] .get (name))
@@ -461,7 +461,7 @@ X3DExecutionContext .prototype = Object .assign (Object .create (X3DBaseNode .pr
461
461
  {
462
462
  name = String (name);
463
463
 
464
- if (! (proto instanceof X3DProtoDeclaration))
464
+ if (!(proto instanceof X3DProtoDeclaration))
465
465
  throw new Error ("Couldn't add proto declaration: proto must be of type X3DProtoDeclaration.");
466
466
 
467
467
  name = String (name);
@@ -505,7 +505,7 @@ X3DExecutionContext .prototype = Object .assign (Object .create (X3DBaseNode .pr
505
505
  {
506
506
  name = String (name);
507
507
 
508
- if (! (externproto instanceof X3DExternProtoDeclaration))
508
+ if (!(externproto instanceof X3DExternProtoDeclaration))
509
509
  throw new Error ("Couldn't add extern proto declaration: extern proto must be of type X3DExternProtoDeclaration.");
510
510
 
511
511
  if (this [_externprotos] .get (name))
@@ -525,7 +525,7 @@ X3DExecutionContext .prototype = Object .assign (Object .create (X3DBaseNode .pr
525
525
  {
526
526
  name = String (name);
527
527
 
528
- if (! (externproto instanceof X3DExternProtoDeclaration))
528
+ if (!(externproto instanceof X3DExternProtoDeclaration))
529
529
  throw new Error ("Couldn't add extern proto declaration: extern proto must be of type X3DExternProtoDeclaration.");
530
530
 
531
531
  name = String (name);
@@ -561,10 +561,10 @@ X3DExecutionContext .prototype = Object .assign (Object .create (X3DBaseNode .pr
561
561
  destinationNode = X3DCast (X3DConstants .X3DNode, destinationNode, false);
562
562
  destinationField = String (destinationField);
563
563
 
564
- if (! sourceNode)
564
+ if (!sourceNode)
565
565
  throw new Error ("Bad ROUTE specification: source node must be of type X3DNode.");
566
566
 
567
- if (! destinationNode)
567
+ if (!destinationNode)
568
568
  throw new Error ("Bad ROUTE specification: destination node must be of type X3DNode.");
569
569
 
570
570
  // Imported nodes handling.
@@ -629,10 +629,10 @@ X3DExecutionContext .prototype = Object .assign (Object .create (X3DBaseNode .pr
629
629
  sourceField = sourceNode .getField (sourceField),
630
630
  destinationField = destinationNode .getField (destinationField);
631
631
 
632
- if (! sourceField .isOutput ())
632
+ if (!sourceField .isOutput ())
633
633
  throw new Error ("Field named '" + sourceField .getName () + "' in node named '" + sourceNode .getName () + "' of type " + sourceNode .getTypeName () + " is not an output field.");
634
634
 
635
- if (! destinationField .isInput ())
635
+ if (!destinationField .isInput ())
636
636
  throw new Error ("Field named '" + destinationField .getName () + "' in node named '" + destinationNode .getName () + "' of type " + destinationNode .getTypeName () + " is not an input field.");
637
637
 
638
638
  if (sourceField .getType () !== destinationField .getType ())
@@ -665,7 +665,7 @@ X3DExecutionContext .prototype = Object .assign (Object .create (X3DBaseNode .pr
665
665
  {
666
666
  route = this .getRoute .apply (this, arguments);
667
667
 
668
- if (! route)
668
+ if (!route)
669
669
  return false;
670
670
  }
671
671
 
@@ -745,10 +745,10 @@ X3DExecutionContext .prototype = Object .assign (Object .create (X3DBaseNode .pr
745
745
  destinationNode = X3DCast (X3DConstants .X3DNode, destinationNode, false);
746
746
  destinationField = String (destinationField)
747
747
 
748
- if (! sourceNode)
748
+ if (!sourceNode)
749
749
  throw new Error ("Bad ROUTE specification: sourceNode must be of type X3DNode.");
750
750
 
751
- if (! destinationNode)
751
+ if (!destinationNode)
752
752
  throw new Error ("Bad ROUTE specification: destinationNode must be of type X3DNode.");
753
753
 
754
754
  sourceField = sourceNode .getField (sourceField);
@@ -930,9 +930,7 @@ X3DExecutionContext .prototype = Object .assign (Object .create (X3DBaseNode .pr
930
930
  },
931
931
  dispose: function ()
932
932
  {
933
- this ._rootNodes .dispose ();
934
-
935
- for (const route of this [_routes])
933
+ for (const route of [... this [_routes]])
936
934
  this .deleteRoute (route);
937
935
 
938
936
  X3DBaseNode .prototype .dispose .call (this);
@@ -153,15 +153,19 @@ X3DScene .prototype = Object .assign (Object .create (X3DExecutionContext .proto
153
153
  {
154
154
  return this [_profile];
155
155
  },
156
+ hasComponent: function (name)
157
+ {
158
+ return (this [_profile] ?.components .has (name) ?? true) || this [_components] .has (name);
159
+ },
156
160
  addComponent: function (component)
157
161
  {
158
162
  this [_components] .add (component .name, component);
159
163
 
160
164
  this ._components_changed = this .getBrowser () .getCurrentTime ();
161
165
  },
162
- removeComponent: function (component)
166
+ removeComponent: function (name)
163
167
  {
164
- this [_components] .remove (component .name);
168
+ this [_components] .remove (name);
165
169
 
166
170
  this ._components_changed = this .getBrowser () .getCurrentTime ();
167
171
  },
@@ -169,10 +173,6 @@ X3DScene .prototype = Object .assign (Object .create (X3DExecutionContext .proto
169
173
  {
170
174
  return this [_components];
171
175
  },
172
- hasComponent: function (componentName)
173
- {
174
- return (this [_profile] ?.components .has (componentName) ?? true) || this [_components] .has (componentName);
175
- },
176
176
  updateUnit: function (category, name, conversionFactor)
177
177
  {
178
178
  // Private function.
@@ -409,7 +409,8 @@ MFNode .prototype = Object .assign (Object .create (X3DObjectArrayField .prototy
409
409
  {
410
410
  const target = this .getTarget ();
411
411
 
412
- target .resize (0);
412
+ target .resize (0, undefined, true);
413
+ target .processInterests ();
413
414
 
414
415
  X3DObjectArrayField .prototype .dispose .call (target);
415
416
  },
@@ -147,7 +147,6 @@ function SFImage (width, height, comp, array)
147
147
 
148
148
  this .getValue () .getArray () .addParent (this);
149
149
  this .addInterest ("set_size__", this);
150
- return this;
151
150
  }
152
151
 
153
152
  SFImage .prototype = Object .assign (Object .create (X3DField .prototype),
@@ -347,8 +347,7 @@ SFNode .prototype = Object .assign (Object .create (X3DField .prototype),
347
347
 
348
348
  target [_cloneCount] += count;
349
349
 
350
- if (value)
351
- value .addCloneCount (count);
350
+ value ?.addCloneCount (count);
352
351
  },
353
352
  removeCloneCount: function (count)
354
353
  {
@@ -358,8 +357,7 @@ SFNode .prototype = Object .assign (Object .create (X3DField .prototype),
358
357
 
359
358
  target [_cloneCount] -= count;
360
359
 
361
- if (value)
362
- value .removeCloneCount (count);
360
+ value ?.removeCloneCount (count);
363
361
  },
364
362
  getNodeUserData: function (key)
365
363
  {
@@ -471,7 +469,8 @@ SFNode .prototype = Object .assign (Object .create (X3DField .prototype),
471
469
  {
472
470
  const target = this [_target];
473
471
 
474
- target .setValue (null);
472
+ target .set (null);
473
+ target .processInterests ();
475
474
 
476
475
  X3DField .prototype .dispose .call (target);
477
476
  },