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.
- package/dist/assets/components/Annotation.js +13 -13
- package/dist/assets/components/Annotation.min.js +1 -1
- package/dist/assets/components/CADGeometry.js +13 -13
- package/dist/assets/components/CADGeometry.min.js +1 -1
- package/dist/assets/components/CubeMapTexturing.js +28 -28
- package/dist/assets/components/CubeMapTexturing.min.js +1 -1
- package/dist/assets/components/DIS.js +13 -21
- package/dist/assets/components/DIS.min.js +1 -1
- package/dist/assets/components/EventUtilities.js +9 -9
- package/dist/assets/components/EventUtilities.min.js +1 -1
- package/dist/assets/components/Geometry2D.js +19 -19
- package/dist/assets/components/Geometry2D.min.js +1 -1
- package/dist/assets/components/Geospatial.js +33 -39
- package/dist/assets/components/Geospatial.min.js +1 -1
- package/dist/assets/components/HAnim.js +18 -18
- package/dist/assets/components/HAnim.min.js +1 -1
- package/dist/assets/components/KeyDeviceSensor.js +8 -8
- package/dist/assets/components/KeyDeviceSensor.min.js +1 -1
- package/dist/assets/components/Layout.js +27 -27
- package/dist/assets/components/Layout.min.js +1 -1
- package/dist/assets/components/NURBS.js +24 -24
- package/dist/assets/components/NURBS.min.js +1 -1
- package/dist/assets/components/ParticleSystems.js +22 -22
- package/dist/assets/components/ParticleSystems.min.js +1 -1
- package/dist/assets/components/Picking.js +24 -23
- package/dist/assets/components/Picking.min.js +1 -1
- package/dist/assets/components/RigidBodyPhysics.js +20 -20
- package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
- package/dist/assets/components/Scripting.js +121 -193
- package/dist/assets/components/Scripting.min.js +1 -1
- package/dist/assets/components/Text.js +30 -31
- package/dist/assets/components/Text.min.js +1 -1
- package/dist/assets/components/TextureProjector.js +14 -14
- package/dist/assets/components/TextureProjector.min.js +1 -1
- package/dist/assets/components/Texturing3D.js +174 -174
- package/dist/assets/components/Texturing3D.min.js +1 -1
- package/dist/assets/components/VolumeRendering.js +35 -33
- package/dist/assets/components/VolumeRendering.min.js +1 -1
- package/dist/assets/components/X_ITE.js +9 -9
- package/dist/assets/components/X_ITE.min.js +1 -1
- package/dist/x_ite.css +1 -1
- package/dist/x_ite.js +407 -404
- package/dist/x_ite.min.js +1 -1
- package/dist/x_ite.zip +0 -0
- package/docs/_config.yml +1 -1
- package/docs/_posts/reference/prototype-services.md +2 -2
- package/package.json +2 -2
- package/src/x_ite/Base/X3DBaseNode.js +8 -23
- package/src/x_ite/Base/X3DEventObject.js +1 -1
- package/src/x_ite/Base/X3DField.js +17 -18
- package/src/x_ite/Base/X3DObject.js +5 -1
- package/src/x_ite/Base/X3DObjectArrayField.js +12 -11
- package/src/x_ite/Base/X3DTypedArrayField.js +3 -3
- package/src/x_ite/Browser/Networking/X3DNetworkingContext.js +8 -6
- package/src/x_ite/Browser/PointingDeviceSensor/X3DPointingDeviceSensorContext.js +2 -2
- package/src/x_ite/Browser/VERSION.js +1 -1
- package/src/x_ite/Browser/VolumeRendering/X3DVolumeRenderingContext.js +2 -2
- package/src/x_ite/Browser/X3DBrowser.js +17 -39
- package/src/x_ite/Components/Core/X3DNode.js +2 -2
- package/src/x_ite/Components/Core/X3DPrototypeInstance.js +3 -8
- package/src/x_ite/Components/CubeMapTexturing/ImageCubeMapTexture.js +3 -3
- package/src/x_ite/Components/DIS/DISEntityTypeMapping.js +0 -8
- package/src/x_ite/Components/EnvironmentalSensor/ProximitySensor.js +14 -12
- package/src/x_ite/Components/EnvironmentalSensor/TransformSensor.js +3 -3
- package/src/x_ite/Components/EnvironmentalSensor/VisibilitySensor.js +1 -1
- package/src/x_ite/Components/EnvironmentalSensor/X3DEnvironmentalSensorNode.js +1 -1
- package/src/x_ite/Components/Geospatial/GeoMetadata.js +0 -6
- package/src/x_ite/Components/Networking/Anchor.js +36 -33
- package/src/x_ite/Components/Networking/Inline.js +3 -3
- package/src/x_ite/Components/Networking/X3DUrlObject.js +74 -23
- package/src/x_ite/Components/Picking/X3DPickSensorNode.js +6 -5
- package/src/x_ite/Components/RigidBodyPhysics/CollisionSensor.js +2 -2
- package/src/x_ite/Components/Scripting/Script.js +93 -165
- package/src/x_ite/Components/Shaders/ComposedShader.js +3 -18
- package/src/x_ite/Components/Shaders/PackagedShader.js +0 -2
- package/src/x_ite/Components/Shaders/ShaderPart.js +4 -4
- package/src/x_ite/Components/Shaders/ShaderProgram.js +0 -2
- package/src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js +3 -4
- package/src/x_ite/Components/Sound/AudioClip.js +3 -3
- package/src/x_ite/Components/Text/Text.js +2 -3
- package/src/x_ite/Components/Text/X3DFontStyleNode.js +4 -4
- package/src/x_ite/Components/Texturing/ImageTexture.js +3 -3
- package/src/x_ite/Components/Texturing/MovieTexture.js +3 -3
- package/src/x_ite/Components/Texturing3D/ImageTexture3D.js +3 -3
- package/src/x_ite/Components/Texturing3D/ImageTextureAtlas.js +3 -3
- package/src/x_ite/Components/Time/X3DTimeDependentNode.js +31 -25
- package/src/x_ite/Components/VolumeRendering/IsoSurfaceVolumeData.js +1 -1
- package/src/x_ite/Components/VolumeRendering/SegmentedVolumeData.js +1 -1
- package/src/x_ite/Components/VolumeRendering/VolumeData.js +1 -1
- package/src/x_ite/Components/VolumeRendering/X3DVolumeDataNode.js +11 -9
- package/src/x_ite/Execution/X3DExecutionContext.js +30 -32
- package/src/x_ite/Execution/X3DScene.js +6 -6
- package/src/x_ite/Fields/ArrayFields.js +2 -1
- package/src/x_ite/Fields/SFImage.js +0 -1
- package/src/x_ite/Fields/SFNode.js +4 -5
- package/src/x_ite/Parser/GLTF2Parser.js +45 -45
- package/src/x_ite/Parser/VRMLParser.js +2 -2
- package/src/x_ite/Parser/XMLParser.js +3 -3
- package/src/x_ite/Prototype/X3DExternProtoDeclaration.js +2 -2
- package/src/x_ite/Prototype/X3DProtoDeclarationNode.js +1 -1
package/dist/x_ite.zip
CHANGED
|
Binary file
|
package/docs/_config.yml
CHANGED
|
@@ -87,9 +87,9 @@ The value is one of the *_STATE* properties defined in the X3DConstants object.
|
|
|
87
87
|
|
|
88
88
|
Creates a new default instance of the extern prototype.
|
|
89
89
|
|
|
90
|
-
#### void **loadNow** ()
|
|
90
|
+
#### Promise\<void\> **loadNow** ()
|
|
91
91
|
|
|
92
|
-
Triggers the
|
|
92
|
+
Triggers the loading of the extern prototype. It returns a Promise that is resolved when the extern prototype is completely loaded and all instances are updated.
|
|
93
93
|
|
|
94
94
|
#### String **toVRMLString** (\[options\])
|
|
95
95
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "x_ite",
|
|
3
|
-
"version": "8.6.
|
|
3
|
+
"version": "8.6.18",
|
|
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>",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"opentype.js": "^1.3.4",
|
|
72
72
|
"pako": "^2.1.0",
|
|
73
73
|
"string-replace-webpack-plugin": "^0.1.3",
|
|
74
|
-
"webpack": "^5.
|
|
74
|
+
"webpack": "^5.79.0",
|
|
75
75
|
"webpack-cli": "^5.0.1",
|
|
76
76
|
"webpack-shell-plugin-next": "^2.3.1"
|
|
77
77
|
},
|
|
@@ -245,22 +245,15 @@ X3DBaseNode .prototype = Object .assign (Object .create (X3DEventObject .prototy
|
|
|
245
245
|
{
|
|
246
246
|
return new (this .constructor) (executionContext || this [_executionContext]);
|
|
247
247
|
},
|
|
248
|
-
setup:
|
|
248
|
+
setup: function ()
|
|
249
249
|
{
|
|
250
|
-
const
|
|
251
|
-
|
|
252
|
-
return function ()
|
|
253
|
-
{
|
|
254
|
-
Object .defineProperty (this, "setup", attributes);
|
|
255
|
-
|
|
256
|
-
for (const field of this [_fields])
|
|
257
|
-
field .setTainted (false);
|
|
250
|
+
for (const field of this [_fields])
|
|
251
|
+
field .setTainted (false);
|
|
258
252
|
|
|
259
|
-
|
|
253
|
+
this .initialize ();
|
|
260
254
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
})(),
|
|
255
|
+
this [_initialized] = true;
|
|
256
|
+
},
|
|
264
257
|
initialize: function ()
|
|
265
258
|
{ },
|
|
266
259
|
isInitialized: function ()
|
|
@@ -313,10 +306,6 @@ X3DBaseNode .prototype = Object .assign (Object .create (X3DEventObject .prototy
|
|
|
313
306
|
{
|
|
314
307
|
return this [_fieldDefinitions];
|
|
315
308
|
},
|
|
316
|
-
getFieldsAreEnumerable: function ()
|
|
317
|
-
{
|
|
318
|
-
return false;
|
|
319
|
-
},
|
|
320
309
|
addField: function (fieldDefinition)
|
|
321
310
|
{
|
|
322
311
|
const
|
|
@@ -336,7 +325,7 @@ X3DBaseNode .prototype = Object .assign (Object .create (X3DEventObject .prototy
|
|
|
336
325
|
{
|
|
337
326
|
get: function () { return field; },
|
|
338
327
|
set: function (value) { field .setValue (value); },
|
|
339
|
-
enumerable:
|
|
328
|
+
enumerable: false,
|
|
340
329
|
configurable: true, // false : non deletable
|
|
341
330
|
});
|
|
342
331
|
|
|
@@ -520,10 +509,6 @@ X3DBaseNode .prototype = Object .assign (Object .create (X3DEventObject .prototy
|
|
|
520
509
|
{
|
|
521
510
|
return this [_fields];
|
|
522
511
|
},
|
|
523
|
-
getSourceText: function ()
|
|
524
|
-
{
|
|
525
|
-
return null;
|
|
526
|
-
},
|
|
527
512
|
hasRoutes: function ()
|
|
528
513
|
{
|
|
529
514
|
/// Returns true if there are any routes from or to fields of this node otherwise false.
|
|
@@ -605,7 +590,7 @@ X3DBaseNode .prototype = Object .assign (Object .create (X3DEventObject .prototy
|
|
|
605
590
|
for (const field of this [_childObjects])
|
|
606
591
|
field .dispose ();
|
|
607
592
|
|
|
608
|
-
for (const field of this
|
|
593
|
+
for (const field of this [_fields])
|
|
609
594
|
field .dispose ();
|
|
610
595
|
|
|
611
596
|
X3DEventObject .prototype .dispose .call (this);
|
|
@@ -83,8 +83,8 @@ X3DEventObject .prototype = Object .assign (Object .create (X3DChildObject .prot
|
|
|
83
83
|
|
|
84
84
|
// Register for processEvent
|
|
85
85
|
|
|
86
|
-
browser .addBrowserEvent ();
|
|
87
86
|
browser .addTaintedField (field, event);
|
|
87
|
+
browser .addBrowserEvent ();
|
|
88
88
|
|
|
89
89
|
// Register for eventsProcessed
|
|
90
90
|
|
|
@@ -68,8 +68,6 @@ function X3DField (value)
|
|
|
68
68
|
X3DChildObject .call (this);
|
|
69
69
|
|
|
70
70
|
this [_value] = value;
|
|
71
|
-
|
|
72
|
-
return this;
|
|
73
71
|
}
|
|
74
72
|
|
|
75
73
|
X3DField .prototype = Object .assign (Object .create (X3DChildObject .prototype),
|
|
@@ -367,32 +365,31 @@ X3DField .prototype = Object .assign (Object .create (X3DChildObject .prototype)
|
|
|
367
365
|
if (field !== this)
|
|
368
366
|
this .set (field .getValue (), field .length);
|
|
369
367
|
|
|
370
|
-
// Process interests
|
|
368
|
+
// Process interests.
|
|
371
369
|
|
|
372
370
|
this .processInterests ();
|
|
373
371
|
|
|
374
|
-
// Process routes
|
|
372
|
+
// Process routes.
|
|
375
373
|
|
|
376
374
|
let first = true;
|
|
377
375
|
|
|
378
|
-
|
|
376
|
+
for (const fieldInterest of this [_fieldInterests])
|
|
379
377
|
{
|
|
380
|
-
|
|
378
|
+
if (first)
|
|
379
|
+
{
|
|
380
|
+
first = false;
|
|
381
|
+
fieldInterest .addEventObject (this, event);
|
|
382
|
+
}
|
|
383
|
+
else
|
|
381
384
|
{
|
|
382
|
-
|
|
383
|
-
{
|
|
384
|
-
first = false;
|
|
385
|
-
fieldInterest .addEventObject (this, event);
|
|
386
|
-
}
|
|
387
|
-
else
|
|
388
|
-
fieldInterest .addEventObject (this, Events .copy (event));
|
|
385
|
+
fieldInterest .addEventObject (this, Events .copy (event));
|
|
389
386
|
}
|
|
390
387
|
}
|
|
391
388
|
|
|
392
389
|
if (first)
|
|
393
390
|
Events .push (event);
|
|
394
391
|
|
|
395
|
-
// Process field callbacks
|
|
392
|
+
// Process field callbacks.
|
|
396
393
|
|
|
397
394
|
if (this [_fieldCallbacks] .size)
|
|
398
395
|
{
|
|
@@ -403,16 +400,18 @@ X3DField .prototype = Object .assign (Object .create (X3DChildObject .prototype)
|
|
|
403
400
|
})(),
|
|
404
401
|
addCloneCount: Function .prototype,
|
|
405
402
|
removeCloneCount: Function .prototype,
|
|
406
|
-
valueOf: function ()
|
|
407
|
-
{
|
|
408
|
-
return this;
|
|
409
|
-
},
|
|
410
403
|
fromString: function (string, scene)
|
|
411
404
|
{
|
|
412
405
|
// Function will be overridden in VRMLParser.
|
|
413
406
|
},
|
|
414
407
|
dispose: function ()
|
|
415
408
|
{
|
|
409
|
+
this [_references] .clear ();
|
|
410
|
+
this [_referencesCallbacks] .clear ();
|
|
411
|
+
this [_fieldInterests] .clear ();
|
|
412
|
+
this [_fieldCallbacks] .clear ();
|
|
413
|
+
this [_routeCallbacks] .clear ();
|
|
414
|
+
|
|
416
415
|
for (const route of new Set (this [_inputRoutes]))
|
|
417
416
|
route .dispose ();
|
|
418
417
|
|
|
@@ -183,7 +183,11 @@ X3DObject .prototype =
|
|
|
183
183
|
{
|
|
184
184
|
generator .string = "[object " + this .getTypeName () + "]";
|
|
185
185
|
},
|
|
186
|
-
dispose: function ()
|
|
186
|
+
dispose: function ()
|
|
187
|
+
{
|
|
188
|
+
this [_interests] .clear ();
|
|
189
|
+
this [_userData] .clear ();
|
|
190
|
+
},
|
|
187
191
|
};
|
|
188
192
|
|
|
189
193
|
for (const key of Reflect .ownKeys (X3DObject .prototype))
|
|
@@ -188,7 +188,7 @@ X3DObjectArrayField .prototype = Object .assign (Object .create (X3DArrayField .
|
|
|
188
188
|
|
|
189
189
|
for (let i = 0; i < length; ++ i)
|
|
190
190
|
{
|
|
191
|
-
if (!
|
|
191
|
+
if (!a [i] .equals (b [i]))
|
|
192
192
|
return false;
|
|
193
193
|
}
|
|
194
194
|
|
|
@@ -361,7 +361,7 @@ X3DObjectArrayField .prototype = Object .assign (Object .create (X3DArrayField .
|
|
|
361
361
|
{
|
|
362
362
|
const current = values [i];
|
|
363
363
|
|
|
364
|
-
if (!
|
|
364
|
+
if (!value (current .valueOf ()))
|
|
365
365
|
{
|
|
366
366
|
const tmp = values [first];
|
|
367
367
|
|
|
@@ -385,7 +385,7 @@ X3DObjectArrayField .prototype = Object .assign (Object .create (X3DArrayField .
|
|
|
385
385
|
{
|
|
386
386
|
const current = values [i];
|
|
387
387
|
|
|
388
|
-
if (!
|
|
388
|
+
if (!current .equals (value))
|
|
389
389
|
{
|
|
390
390
|
const tmp = values [first];
|
|
391
391
|
|
|
@@ -413,25 +413,26 @@ X3DObjectArrayField .prototype = Object .assign (Object .create (X3DArrayField .
|
|
|
413
413
|
|
|
414
414
|
return values .map (function (value) { return value .valueOf () });
|
|
415
415
|
},
|
|
416
|
-
resize: function (size, value,
|
|
416
|
+
resize: function (size, value, silently)
|
|
417
417
|
{
|
|
418
418
|
const
|
|
419
419
|
target = this [_target],
|
|
420
|
-
array = target .getValue ()
|
|
420
|
+
array = target .getValue (),
|
|
421
|
+
length = array .length;
|
|
421
422
|
|
|
422
|
-
if (size <
|
|
423
|
+
if (size < length)
|
|
423
424
|
{
|
|
424
|
-
for (let i = size
|
|
425
|
+
for (let i = size; i < length; ++ i)
|
|
425
426
|
target .removeChildObject (array [i]);
|
|
426
427
|
|
|
427
428
|
array .length = size;
|
|
428
429
|
|
|
429
|
-
if (!
|
|
430
|
+
if (!silently)
|
|
430
431
|
target .addEvent ();
|
|
431
432
|
}
|
|
432
|
-
else if (size >
|
|
433
|
+
else if (size > length)
|
|
433
434
|
{
|
|
434
|
-
for (let i =
|
|
435
|
+
for (let i = length; i < size; ++ i)
|
|
435
436
|
{
|
|
436
437
|
const field = new (target .getSingleType ()) ();
|
|
437
438
|
|
|
@@ -442,7 +443,7 @@ X3DObjectArrayField .prototype = Object .assign (Object .create (X3DArrayField .
|
|
|
442
443
|
array .push (field);
|
|
443
444
|
}
|
|
444
445
|
|
|
445
|
-
if (!
|
|
446
|
+
if (!silently)
|
|
446
447
|
target .addEvent ();
|
|
447
448
|
}
|
|
448
449
|
},
|
|
@@ -603,7 +603,7 @@ X3DTypedArrayField .prototype = Object .assign (Object .create (X3DArrayField .p
|
|
|
603
603
|
|
|
604
604
|
return values .slice ();
|
|
605
605
|
},
|
|
606
|
-
resize: function (newLength, value,
|
|
606
|
+
resize: function (newLength, value, silently)
|
|
607
607
|
{
|
|
608
608
|
const
|
|
609
609
|
target = this [_target],
|
|
@@ -619,7 +619,7 @@ X3DTypedArrayField .prototype = Object .assign (Object .create (X3DArrayField .p
|
|
|
619
619
|
if (components > 1)
|
|
620
620
|
target [_cache] .length = newLength;
|
|
621
621
|
|
|
622
|
-
if (!
|
|
622
|
+
if (!silently)
|
|
623
623
|
target .addEvent ();
|
|
624
624
|
}
|
|
625
625
|
else if (newLength > length)
|
|
@@ -644,7 +644,7 @@ X3DTypedArrayField .prototype = Object .assign (Object .create (X3DArrayField .p
|
|
|
644
644
|
}
|
|
645
645
|
}
|
|
646
646
|
|
|
647
|
-
if (!
|
|
647
|
+
if (!silently)
|
|
648
648
|
target .addEvent ();
|
|
649
649
|
}
|
|
650
650
|
|
|
@@ -114,11 +114,10 @@ X3DNetworkingContext .prototype =
|
|
|
114
114
|
{
|
|
115
115
|
this [_loading] = value;
|
|
116
116
|
|
|
117
|
-
this .setLoadCount (0);
|
|
118
|
-
|
|
119
117
|
if (value)
|
|
120
118
|
{
|
|
121
|
-
this .
|
|
119
|
+
if (!this [_loadingObjects] .has (this))
|
|
120
|
+
this .resetLoadCount ();
|
|
122
121
|
|
|
123
122
|
this .getShadow () .find (".x_ite-private-world-info") .remove ();
|
|
124
123
|
|
|
@@ -142,6 +141,10 @@ X3DNetworkingContext .prototype =
|
|
|
142
141
|
{
|
|
143
142
|
return this [_loading];
|
|
144
143
|
},
|
|
144
|
+
getDisplayLoadCount: function ()
|
|
145
|
+
{
|
|
146
|
+
return [... this [_loadingObjects]] .reduce ((v, o) => v + !(o .isPrivate ?.() ?? true), 0);
|
|
147
|
+
},
|
|
145
148
|
addLoadingObject: function (object)
|
|
146
149
|
{
|
|
147
150
|
if (this [_loadingObjects] .has (object))
|
|
@@ -162,6 +165,7 @@ X3DNetworkingContext .prototype =
|
|
|
162
165
|
this [_loadingObjects] .delete (object);
|
|
163
166
|
|
|
164
167
|
this .setLoadCount (this [_loadingObjects] .size);
|
|
168
|
+
this .setCursor (this .getCursor ());
|
|
165
169
|
},
|
|
166
170
|
setLoadCount: function (value)
|
|
167
171
|
{
|
|
@@ -180,9 +184,7 @@ X3DNetworkingContext .prototype =
|
|
|
180
184
|
},
|
|
181
185
|
[_set_loadCount]: function ()
|
|
182
186
|
{
|
|
183
|
-
const loadingDisplay =
|
|
184
|
-
.filter (o => o .isPrivate)
|
|
185
|
-
.reduce ((v, o) => v + !o .isPrivate (), 0);
|
|
187
|
+
const loadingDisplay = this .getDisplayLoadCount ();
|
|
186
188
|
|
|
187
189
|
if (this ._loadCount .getValue () || this [_loading])
|
|
188
190
|
{
|
|
@@ -135,9 +135,9 @@ X3DPointingDeviceSensorContext .prototype =
|
|
|
135
135
|
break;
|
|
136
136
|
default:
|
|
137
137
|
{
|
|
138
|
-
if (this .
|
|
138
|
+
if (this .getDisplayLoadCount ())
|
|
139
139
|
div .css ("cursor", "wait");
|
|
140
|
-
else if (this [_pointingDevice]
|
|
140
|
+
else if (this [_pointingDevice] ?.isOver)
|
|
141
141
|
div .css ("cursor", "pointer");
|
|
142
142
|
else
|
|
143
143
|
div .css ("cursor", "default");
|
|
@@ -59,9 +59,9 @@ function X3DVolumeRenderingContext () { }
|
|
|
59
59
|
|
|
60
60
|
X3DVolumeRenderingContext .prototype =
|
|
61
61
|
{
|
|
62
|
-
getDefaultVoxels: function (
|
|
62
|
+
getDefaultVoxels: function ()
|
|
63
63
|
{
|
|
64
|
-
this [_defaultVoxelsNode] =
|
|
64
|
+
this [_defaultVoxelsNode] = this .getPrivateScene () .createNode ("PixelTexture3D", false);
|
|
65
65
|
this [_defaultVoxelsNode] ._image = [1, 1, 1, 1, 255];
|
|
66
66
|
this [_defaultVoxelsNode] .repeatS = true;
|
|
67
67
|
this [_defaultVoxelsNode] .repeatT = true;
|
|
@@ -87,7 +87,6 @@ function X3DBrowser (element)
|
|
|
87
87
|
|
|
88
88
|
X3DBrowserContext .call (this, element);
|
|
89
89
|
|
|
90
|
-
this [_reject] = Function .prototype;
|
|
91
90
|
this [_browserCallbacks] = new Map ();
|
|
92
91
|
this [_console] = document .getElementsByClassName ("x_ite-console");
|
|
93
92
|
|
|
@@ -244,6 +243,7 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
|
|
|
244
243
|
if (argument instanceof ComponentInfo)
|
|
245
244
|
return this .loadComponents ([argument .name]);
|
|
246
245
|
|
|
246
|
+
// Load array of component names.
|
|
247
247
|
return loadComponents (this, [... argument], new Set ());
|
|
248
248
|
};
|
|
249
249
|
})(),
|
|
@@ -285,11 +285,9 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
|
|
|
285
285
|
{
|
|
286
286
|
return new Promise ((resolve, reject) =>
|
|
287
287
|
{
|
|
288
|
-
this [
|
|
289
|
-
|
|
290
|
-
if (this [_fileLoader])
|
|
291
|
-
this [_fileLoader] .abort ();
|
|
288
|
+
this [_fileLoader] ?.abort ();
|
|
292
289
|
|
|
290
|
+
this [_reject] ?.("Replacing world aborted.");
|
|
293
291
|
this [_reject] = reject;
|
|
294
292
|
|
|
295
293
|
// Remove world.
|
|
@@ -480,16 +478,15 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
|
|
|
480
478
|
this ._loadCount .removeInterest ("checkLoadCount", this);
|
|
481
479
|
this .prepareEvents () .removeInterest ("updateInitialized", this);
|
|
482
480
|
|
|
483
|
-
|
|
484
|
-
this [_fileLoader] .abort ();
|
|
481
|
+
this [_fileLoader] ?.abort ();
|
|
485
482
|
|
|
486
483
|
// Start loading.
|
|
487
484
|
|
|
488
|
-
this .setBrowserLoading (true);
|
|
489
|
-
this .addLoadingObject (this);
|
|
490
|
-
|
|
491
485
|
const fileLoader = this [_fileLoader] = new FileLoader (this .getWorld ());
|
|
492
486
|
|
|
487
|
+
this .setBrowserLoading (true);
|
|
488
|
+
this .addLoadingObject (fileLoader);
|
|
489
|
+
|
|
493
490
|
fileLoader .createX3DFromURL (url, parameter, (scene) =>
|
|
494
491
|
{
|
|
495
492
|
if (fileLoader !== this [_fileLoader])
|
|
@@ -503,8 +500,10 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
|
|
|
503
500
|
|
|
504
501
|
if (scene)
|
|
505
502
|
{
|
|
503
|
+
this .addLoadingObject (this); // Prevent resetLoadCount.
|
|
506
504
|
this .replaceWorld (scene) .then (resolve) .catch (reject);
|
|
507
505
|
this .removeLoadingObject (this);
|
|
506
|
+
this .removeLoadingObject (fileLoader);
|
|
508
507
|
}
|
|
509
508
|
else
|
|
510
509
|
{
|
|
@@ -530,7 +529,7 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
|
|
|
530
529
|
}
|
|
531
530
|
|
|
532
531
|
this .changeViewpoint (fragment);
|
|
533
|
-
this .removeLoadingObject (
|
|
532
|
+
this .removeLoadingObject (fileLoader);
|
|
534
533
|
this .setBrowserLoading (false);
|
|
535
534
|
|
|
536
535
|
resolve ();
|
|
@@ -548,7 +547,7 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
|
|
|
548
547
|
else
|
|
549
548
|
location = url;
|
|
550
549
|
|
|
551
|
-
this .removeLoadingObject (
|
|
550
|
+
this .removeLoadingObject (fileLoader);
|
|
552
551
|
this .setBrowserLoading (false);
|
|
553
552
|
|
|
554
553
|
resolve ();
|
|
@@ -648,10 +647,7 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
|
|
|
648
647
|
},
|
|
649
648
|
viewAll: function (layerNode)
|
|
650
649
|
{
|
|
651
|
-
layerNode = X3DCast (X3DConstants .X3DLayerNode, layerNode);
|
|
652
|
-
|
|
653
|
-
if (!layerNode)
|
|
654
|
-
layerNode = this .getActiveLayer ();
|
|
650
|
+
layerNode = X3DCast (X3DConstants .X3DLayerNode, layerNode) ?? this .getActiveLayer ();
|
|
655
651
|
|
|
656
652
|
if (!layerNode)
|
|
657
653
|
return;
|
|
@@ -660,13 +656,7 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
|
|
|
660
656
|
},
|
|
661
657
|
firstViewpoint: function (layerNode)
|
|
662
658
|
{
|
|
663
|
-
layerNode = X3DCast (X3DConstants .X3DLayerNode, layerNode);
|
|
664
|
-
|
|
665
|
-
if (!layerNode)
|
|
666
|
-
layerNode = this .getActiveLayer ();
|
|
667
|
-
|
|
668
|
-
if (!layerNode)
|
|
669
|
-
return;
|
|
659
|
+
layerNode = X3DCast (X3DConstants .X3DLayerNode, layerNode) ?? this .getActiveLayer ();
|
|
670
660
|
|
|
671
661
|
const viewpoints = layerNode .getUserViewpoints ();
|
|
672
662
|
|
|
@@ -675,10 +665,7 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
|
|
|
675
665
|
},
|
|
676
666
|
previousViewpoint: function (layerNode)
|
|
677
667
|
{
|
|
678
|
-
layerNode = X3DCast (X3DConstants .X3DLayerNode, layerNode);
|
|
679
|
-
|
|
680
|
-
if (!layerNode)
|
|
681
|
-
layerNode = this .getActiveLayer ();
|
|
668
|
+
layerNode = X3DCast (X3DConstants .X3DLayerNode, layerNode) ?? this .getActiveLayer ();
|
|
682
669
|
|
|
683
670
|
if (!layerNode)
|
|
684
671
|
return;
|
|
@@ -707,10 +694,7 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
|
|
|
707
694
|
},
|
|
708
695
|
nextViewpoint: function (layerNode)
|
|
709
696
|
{
|
|
710
|
-
layerNode = X3DCast (X3DConstants .X3DLayerNode, layerNode);
|
|
711
|
-
|
|
712
|
-
if (!layerNode)
|
|
713
|
-
layerNode = this .getActiveLayer ();
|
|
697
|
+
layerNode = X3DCast (X3DConstants .X3DLayerNode, layerNode) ?? this .getActiveLayer ();
|
|
714
698
|
|
|
715
699
|
if (!layerNode)
|
|
716
700
|
return;
|
|
@@ -739,10 +723,7 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
|
|
|
739
723
|
},
|
|
740
724
|
lastViewpoint: function (layerNode)
|
|
741
725
|
{
|
|
742
|
-
layerNode = X3DCast (X3DConstants .X3DLayerNode, layerNode);
|
|
743
|
-
|
|
744
|
-
if (!layerNode)
|
|
745
|
-
layerNode = this .getActiveLayer ();
|
|
726
|
+
layerNode = X3DCast (X3DConstants .X3DLayerNode, layerNode) ?? this .getActiveLayer ();
|
|
746
727
|
|
|
747
728
|
if (!layerNode)
|
|
748
729
|
return;
|
|
@@ -760,10 +741,7 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
|
|
|
760
741
|
layerNode = this .getActiveLayer ();
|
|
761
742
|
}
|
|
762
743
|
|
|
763
|
-
layerNode = X3DCast (X3DConstants .X3DLayerNode, layerNode);
|
|
764
|
-
|
|
765
|
-
if (!layerNode)
|
|
766
|
-
layerNode = this .getActiveLayer ();
|
|
744
|
+
layerNode = X3DCast (X3DConstants .X3DLayerNode, layerNode) ?? this .getActiveLayer ();
|
|
767
745
|
|
|
768
746
|
if (!layerNode)
|
|
769
747
|
return;
|
|
@@ -208,9 +208,9 @@ X3DNode .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
|
|
|
208
208
|
|
|
209
209
|
return false;
|
|
210
210
|
},
|
|
211
|
-
|
|
211
|
+
getSourceText: function ()
|
|
212
212
|
{
|
|
213
|
-
return
|
|
213
|
+
return null;
|
|
214
214
|
},
|
|
215
215
|
traverse: function () { },
|
|
216
216
|
toStream: function (generator)
|
|
@@ -276,11 +276,6 @@ X3DPrototypeInstance .prototype = Object .assign (Object .create (X3DNode .proto
|
|
|
276
276
|
|
|
277
277
|
protoNode ._name_changed .addFieldInterest (this ._typeName_changed);
|
|
278
278
|
|
|
279
|
-
const outerNode = this .getExecutionContext () .getOuterNode ();
|
|
280
|
-
|
|
281
|
-
if (outerNode ?.getType () .includes (X3DConstants .X3DProtoDeclaration))
|
|
282
|
-
return;
|
|
283
|
-
|
|
284
279
|
if (protoNode .isExternProto)
|
|
285
280
|
{
|
|
286
281
|
if (this [_protoNode] .checkLoadState () === X3DConstants .COMPLETE_STATE)
|
|
@@ -290,7 +285,7 @@ X3DPrototypeInstance .prototype = Object .assign (Object .create (X3DNode .proto
|
|
|
290
285
|
else
|
|
291
286
|
{
|
|
292
287
|
protoNode ._updateInstances .addInterest ("construct", this);
|
|
293
|
-
protoNode .requestImmediateLoad ();
|
|
288
|
+
protoNode .requestImmediateLoad () .catch (Function .prototype);
|
|
294
289
|
}
|
|
295
290
|
}
|
|
296
291
|
else
|
|
@@ -1017,11 +1012,11 @@ X3DPrototypeInstance .prototype = Object .assign (Object .create (X3DNode .proto
|
|
|
1017
1012
|
},
|
|
1018
1013
|
dispose: function ()
|
|
1019
1014
|
{
|
|
1015
|
+
this [_protoNode] ._name_changed .removeFieldInterest (this ._typeName_changed);
|
|
1020
1016
|
this [_protoNode] ._updateInstances .removeInterest ("construct", this);
|
|
1021
1017
|
this [_protoNode] ._updateInstances .removeInterest ("update", this);
|
|
1022
1018
|
|
|
1023
|
-
|
|
1024
|
-
this [_body] .dispose ();
|
|
1019
|
+
this [_body] ?.dispose ();
|
|
1025
1020
|
|
|
1026
1021
|
X3DNode .prototype .dispose .call (this);
|
|
1027
1022
|
},
|
|
@@ -127,13 +127,13 @@ ImageCubeMapTexture .prototype = Object .assign (Object .create (X3DEnvironmentT
|
|
|
127
127
|
this .image .on ("abort error", this .setError .bind (this));
|
|
128
128
|
this .image .prop ("crossOrigin", "Anonymous");
|
|
129
129
|
|
|
130
|
-
this .requestImmediateLoad ();
|
|
130
|
+
this .requestImmediateLoad () .catch (Function .prototype);
|
|
131
131
|
},
|
|
132
|
-
|
|
132
|
+
unloadData: function ()
|
|
133
133
|
{
|
|
134
134
|
this .clearTexture ();
|
|
135
135
|
},
|
|
136
|
-
|
|
136
|
+
loadData: function ()
|
|
137
137
|
{
|
|
138
138
|
this .urlStack .setValue (this ._url);
|
|
139
139
|
this .loadNext ();
|
|
@@ -99,14 +99,6 @@ DISEntityTypeMapping .prototype = Object .assign (Object .create (X3DInfoNode .p
|
|
|
99
99
|
X3DInfoNode .prototype .initialize .call (this);
|
|
100
100
|
X3DUrlObject .prototype .initialize .call (this);
|
|
101
101
|
},
|
|
102
|
-
requestImmediateLoad: function (cache = true)
|
|
103
|
-
{ },
|
|
104
|
-
requestUnload: function ()
|
|
105
|
-
{ },
|
|
106
|
-
set_load__: function ()
|
|
107
|
-
{ },
|
|
108
|
-
set_url__: function ()
|
|
109
|
-
{ },
|
|
110
102
|
dispose: function ()
|
|
111
103
|
{
|
|
112
104
|
X3DUrlObject .prototype .dispose .call (this);
|