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.
- package/Makefile +1 -4
- package/README.md +1 -1
- package/build/bin/components.js +45 -0
- 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 +25 -25
- package/dist/assets/components/CubeMapTexturing.min.js +1 -1
- package/dist/assets/components/DIS.js +13 -13
- 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 -33
- 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 +18 -18
- package/dist/assets/components/Picking.min.js +1 -1
- package/dist/assets/components/RigidBodyPhysics.js +18 -18
- package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
- package/dist/assets/components/Scripting.js +28 -28
- package/dist/assets/components/Scripting.min.js +1 -1
- package/dist/assets/components/Text.js +24 -24
- 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 +30 -30
- package/dist/assets/components/Texturing3D.min.js +1 -1
- package/dist/assets/components/VolumeRendering.js +19 -19
- 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 +796 -654
- package/dist/x_ite.min.js +1 -1
- package/dist/x_ite.zip +0 -0
- package/docs/_config.yml +2 -2
- package/docs/_posts/dom-integration.md +14 -12
- package/docs/_posts/getting-started.md +31 -29
- package/docs/_posts/reference/ecmascript-object-and-function-definitions.md +1 -1
- package/docs/_posts/reference/scene-services.md +6 -3
- package/docs/_posts/report-a-bug.md +5 -3
- package/docs/_posts/setup-a-localhost-server.md +7 -7
- package/docs/_posts/tutorials/writing-program-scripts-with-ecmascript.md +1 -1
- package/docs/_tabs/playground.html +31 -28
- package/package.json +1 -1
- package/src/locale/de.po.js +9 -0
- package/src/locale/fr.po.js +31 -25
- package/src/tests.js +1 -0
- package/src/x_ite/Base/X3DBaseNode.js +2 -12
- package/src/x_ite/Base/X3DInfoArray.js +0 -2
- package/src/x_ite/Base/X3DObjectArrayField.js +0 -2
- package/src/x_ite/Base/X3DTypedArrayField.js +0 -2
- package/src/x_ite/Browser/Core/BrowserTimings.js +147 -67
- package/src/x_ite/Browser/Core/ContextMenu.js +2 -2
- package/src/x_ite/Browser/Core/X3DCoreContext.js +6 -2
- package/src/x_ite/Browser/Navigation/ExamineViewer.js +3 -0
- package/src/x_ite/Browser/Navigation/LookAtViewer.js +3 -0
- package/src/x_ite/Browser/Networking/X3DNetworkingContext.js +13 -5
- package/src/x_ite/Browser/VERSION.js +1 -1
- package/src/x_ite/Browser/X3DBrowser.js +14 -22
- package/src/x_ite/Browser/X3DBrowserContext.js +0 -1
- package/src/x_ite/Components/Core/X3DNode.js +40 -9
- package/src/x_ite/Components/Core/X3DPrototypeInstance.js +5 -5
- package/src/x_ite/Configuration/ComponentInfo.js +2 -1
- package/src/x_ite/Configuration/ProfileInfo.js +1 -0
- package/src/x_ite/Configuration/UnitInfo.js +3 -5
- package/src/x_ite/Execution/BindableList.js +34 -27
- package/src/x_ite/Execution/BindableStack.js +15 -17
- package/src/x_ite/Execution/X3DExecutionContext.js +11 -21
- package/src/x_ite/Execution/X3DExportedNode.js +1 -3
- package/src/x_ite/Execution/X3DImportedNode.js +2 -6
- package/src/x_ite/Execution/X3DScene.js +30 -28
- package/src/x_ite/Fields/ArrayFields.js +4 -4
- package/src/x_ite/Fields/SFColor.js +0 -3
- package/src/x_ite/Fields/SFColorRGBA.js +0 -4
- package/src/x_ite/Fields/SFImage.js +0 -4
- package/src/x_ite/Fields/SFMatrix3.js +0 -1
- package/src/x_ite/Fields/SFMatrix4.js +0 -1
- package/src/x_ite/Fields/SFRotation.js +0 -4
- package/src/x_ite/Fields/SFString.js +7 -4
- package/src/x_ite/Fields/SFVec2.js +0 -2
- package/src/x_ite/Fields/SFVec3.js +0 -3
- package/src/x_ite/Fields/SFVec4.js +0 -4
- package/src/x_ite/InputOutput/FileLoader.js +13 -18
- package/src/x_ite/InputOutput/Generator.js +86 -16
- package/src/x_ite/Prototype/X3DExternProtoDeclaration.js +6 -11
- package/src/x_ite/Prototype/X3DProtoDeclaration.js +5 -8
- package/src/x_ite/Routing/X3DRoute.js +1 -5
- package/src/x_ite/X3DCanvasElement.js +2 -0
- package/src/x_ite.css +5 -1
- package/src/x_ite.html +4 -36
- package/x_ite.min.html +4 -36
|
@@ -460,6 +460,13 @@ X3DNode .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
|
|
|
460
460
|
generator .string += generator .Indent ();
|
|
461
461
|
generator .string += "<";
|
|
462
462
|
generator .string += this .getTypeName ();
|
|
463
|
+
|
|
464
|
+
if (generator .html && this .getTypeName () === "Script")
|
|
465
|
+
{
|
|
466
|
+
generator .string += generator .Space ();
|
|
467
|
+
generator .string += "type='model/x3d+xml'";
|
|
468
|
+
}
|
|
469
|
+
|
|
463
470
|
generator .string += generator .Space ();
|
|
464
471
|
generator .string += "USE='";
|
|
465
472
|
generator .string += generator .XMLEncode (name);
|
|
@@ -478,7 +485,16 @@ X3DNode .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
|
|
|
478
485
|
}
|
|
479
486
|
}
|
|
480
487
|
|
|
481
|
-
generator .
|
|
488
|
+
if (generator .closingTags)
|
|
489
|
+
{
|
|
490
|
+
generator .string += "></";
|
|
491
|
+
generator .string += this .getTypeName ();
|
|
492
|
+
generator .string += ">";
|
|
493
|
+
}
|
|
494
|
+
else
|
|
495
|
+
{
|
|
496
|
+
generator .string += "/>";
|
|
497
|
+
}
|
|
482
498
|
|
|
483
499
|
generator .LeaveScope ();
|
|
484
500
|
return;
|
|
@@ -489,6 +505,12 @@ X3DNode .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
|
|
|
489
505
|
generator .string += "<";
|
|
490
506
|
generator .string += this .getTypeName ();
|
|
491
507
|
|
|
508
|
+
if (generator .html && this .getTypeName () === "Script")
|
|
509
|
+
{
|
|
510
|
+
generator .string += generator .Space ();
|
|
511
|
+
generator .string += "type='model/x3d+xml'";
|
|
512
|
+
}
|
|
513
|
+
|
|
492
514
|
if (name .length)
|
|
493
515
|
{
|
|
494
516
|
generator .AddNode (this);
|
|
@@ -522,7 +544,7 @@ X3DNode .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
|
|
|
522
544
|
|
|
523
545
|
let cdata = this .getSourceText ();
|
|
524
546
|
|
|
525
|
-
if (cdata &&
|
|
547
|
+
if (cdata ?.length === 0 || (generator .html && this .getTypeName () !== "Script"))
|
|
526
548
|
cdata = null;
|
|
527
549
|
|
|
528
550
|
generator .IncIndent ();
|
|
@@ -572,7 +594,7 @@ X3DNode .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
|
|
|
572
594
|
generator .string += field .getName ();
|
|
573
595
|
generator .string += "='";
|
|
574
596
|
|
|
575
|
-
field .toXMLStream (generator);
|
|
597
|
+
field .toXMLStream (generator, field === this .getSourceText ());
|
|
576
598
|
|
|
577
599
|
generator .string += "'";
|
|
578
600
|
break;
|
|
@@ -591,7 +613,16 @@ X3DNode .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
|
|
|
591
613
|
|
|
592
614
|
if ((!this .canUserDefinedFields () || !userDefinedFields .length) && (!references .length || sharedNode) && !childNodes .length && !cdata)
|
|
593
615
|
{
|
|
594
|
-
generator .
|
|
616
|
+
if (generator .closingTags)
|
|
617
|
+
{
|
|
618
|
+
generator .string += "></";
|
|
619
|
+
generator .string += this .getTypeName ();
|
|
620
|
+
generator .string += ">";
|
|
621
|
+
}
|
|
622
|
+
else
|
|
623
|
+
{
|
|
624
|
+
generator .string += "/>";
|
|
625
|
+
}
|
|
595
626
|
}
|
|
596
627
|
else
|
|
597
628
|
{
|
|
@@ -640,7 +671,7 @@ X3DNode .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
|
|
|
640
671
|
|
|
641
672
|
if (!field .isInitializable () || field .isDefaultValue ())
|
|
642
673
|
{
|
|
643
|
-
generator .string += "/>";
|
|
674
|
+
generator .string += generator .closingTags ? "></field>" : "/>";
|
|
644
675
|
generator .string += generator .TidyBreak ();
|
|
645
676
|
}
|
|
646
677
|
else
|
|
@@ -680,7 +711,7 @@ X3DNode .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
|
|
|
680
711
|
field .toXMLStream (generator);
|
|
681
712
|
|
|
682
713
|
generator .string += "'";
|
|
683
|
-
generator .string += "/>";
|
|
714
|
+
generator .string += generator .closingTags ? "></field>" : "/>";
|
|
684
715
|
generator .string += generator .TidyBreak ();
|
|
685
716
|
break;
|
|
686
717
|
}
|
|
@@ -692,7 +723,7 @@ X3DNode .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
|
|
|
692
723
|
if (generator .ExecutionContext ())
|
|
693
724
|
references .push (field);
|
|
694
725
|
|
|
695
|
-
generator .string += "/>";
|
|
726
|
+
generator .string += generator .closingTags ? "></field>" : "/>";
|
|
696
727
|
generator .string += generator .TidyBreak ();
|
|
697
728
|
}
|
|
698
729
|
}
|
|
@@ -722,7 +753,7 @@ X3DNode .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
|
|
|
722
753
|
generator .string += "protoField='";
|
|
723
754
|
generator .string += generator .XMLEncode (protoField .getName ());
|
|
724
755
|
generator .string += "'";
|
|
725
|
-
generator .string += "/>";
|
|
756
|
+
generator .string += generator .closingTags ? "></connect>" : "/>";
|
|
726
757
|
generator .string += generator .TidyBreak ();
|
|
727
758
|
}
|
|
728
759
|
}
|
|
@@ -750,7 +781,7 @@ X3DNode .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
|
|
|
750
781
|
for (const value of cdata)
|
|
751
782
|
{
|
|
752
783
|
generator .string += "<![CDATA[";
|
|
753
|
-
generator .string +=
|
|
784
|
+
generator .string += value;
|
|
754
785
|
generator .string += "]]>";
|
|
755
786
|
generator .string += generator .TidyBreak ();
|
|
756
787
|
}
|
|
@@ -405,7 +405,7 @@ X3DPrototypeInstance .prototype = Object .assign (Object .create (X3DNode .proto
|
|
|
405
405
|
}
|
|
406
406
|
}
|
|
407
407
|
|
|
408
|
-
generator .string += "/>";
|
|
408
|
+
generator .string += generator .closingTags ? "></ProtoInstance>" : "/>";
|
|
409
409
|
|
|
410
410
|
generator .LeaveScope ();
|
|
411
411
|
return;
|
|
@@ -446,7 +446,7 @@ X3DPrototypeInstance .prototype = Object .assign (Object .create (X3DNode .proto
|
|
|
446
446
|
|
|
447
447
|
if (fields .length === 0)
|
|
448
448
|
{
|
|
449
|
-
generator .string += "/>";
|
|
449
|
+
generator .string += generator .closingTags ? "></ProtoInstance>" : "/>";
|
|
450
450
|
}
|
|
451
451
|
else
|
|
452
452
|
{
|
|
@@ -494,7 +494,7 @@ X3DPrototypeInstance .prototype = Object .assign (Object .create (X3DNode .proto
|
|
|
494
494
|
|
|
495
495
|
if (field .length === 0)
|
|
496
496
|
{
|
|
497
|
-
generator .string += "/>";
|
|
497
|
+
generator .string += generator .closingTags ? "></fieldValue>" : "/>";
|
|
498
498
|
generator .string += generator .TidyBreak ();
|
|
499
499
|
}
|
|
500
500
|
else
|
|
@@ -568,7 +568,7 @@ X3DPrototypeInstance .prototype = Object .assign (Object .create (X3DNode .proto
|
|
|
568
568
|
field .toXMLStream (generator);
|
|
569
569
|
|
|
570
570
|
generator .string += "'";
|
|
571
|
-
generator .string += "/>";
|
|
571
|
+
generator .string += generator .closingTags ? "></fieldValue>" : "/>";
|
|
572
572
|
generator .string += generator .TidyBreak ();
|
|
573
573
|
break;
|
|
574
574
|
}
|
|
@@ -604,7 +604,7 @@ X3DPrototypeInstance .prototype = Object .assign (Object .create (X3DNode .proto
|
|
|
604
604
|
generator .string += "protoField='";
|
|
605
605
|
generator .string += generator .XMLEncode (protoField .getName ());
|
|
606
606
|
generator .string += "'";
|
|
607
|
-
generator .string += "/>";
|
|
607
|
+
generator .string += generator .closingTags ? "></connect>" : "/>";
|
|
608
608
|
generator .string += generator .TidyBreak ();
|
|
609
609
|
}
|
|
610
610
|
}
|
|
@@ -68,6 +68,7 @@ ComponentInfo .prototype = Object .assign (Object .create (X3DObject .prototype)
|
|
|
68
68
|
},
|
|
69
69
|
toVRMLStream: function (generator)
|
|
70
70
|
{
|
|
71
|
+
generator .string += generator .Indent ();
|
|
71
72
|
generator .string += "COMPONENT";
|
|
72
73
|
generator .string += generator .Space ();
|
|
73
74
|
generator .string += this .name;
|
|
@@ -88,7 +89,7 @@ ComponentInfo .prototype = Object .assign (Object .create (X3DObject .prototype)
|
|
|
88
89
|
generator .string += "level='";
|
|
89
90
|
generator .string += this .level;
|
|
90
91
|
generator .string += "'";
|
|
91
|
-
generator .string += "/>";
|
|
92
|
+
generator .string += generator .closingTags ? "></component>" : "/>";
|
|
92
93
|
},
|
|
93
94
|
toJSONStream: function (generator)
|
|
94
95
|
{
|
|
@@ -64,6 +64,7 @@ ProfileInfo .prototype = Object .assign (Object .create (X3DObject .prototype),
|
|
|
64
64
|
},
|
|
65
65
|
toVRMLStream: function (generator)
|
|
66
66
|
{
|
|
67
|
+
generator .string += generator .Indent ();
|
|
67
68
|
generator .string += "PROFILE";
|
|
68
69
|
generator .string += generator .Space ();
|
|
69
70
|
generator .string += this .name;
|
|
@@ -51,7 +51,6 @@ function UnitInfo (category, name, conversionFactor)
|
|
|
51
51
|
{
|
|
52
52
|
Object .defineProperty (this, "category", {
|
|
53
53
|
value: category,
|
|
54
|
-
writable: false,
|
|
55
54
|
});
|
|
56
55
|
|
|
57
56
|
this .name = name;
|
|
@@ -67,6 +66,7 @@ UnitInfo .prototype = Object .assign (Object .create (X3DObject .prototype),
|
|
|
67
66
|
},
|
|
68
67
|
toVRMLStream: function (generator)
|
|
69
68
|
{
|
|
69
|
+
generator .string += generator .Indent ();
|
|
70
70
|
generator .string += "UNIT";
|
|
71
71
|
generator .string += generator .Space ();
|
|
72
72
|
generator .string += this .category;
|
|
@@ -91,7 +91,7 @@ UnitInfo .prototype = Object .assign (Object .create (X3DObject .prototype),
|
|
|
91
91
|
generator .string += "conversionFactor='";
|
|
92
92
|
generator .string += this .conversionFactor;
|
|
93
93
|
generator .string += "'";
|
|
94
|
-
generator .string += "/>";
|
|
94
|
+
generator .string += generator .closingTags ? "></unit>" : "/>";
|
|
95
95
|
},
|
|
96
96
|
toJSONStream: function (generator, _throw)
|
|
97
97
|
{
|
|
@@ -134,7 +134,7 @@ UnitInfo .prototype = Object .assign (Object .create (X3DObject .prototype),
|
|
|
134
134
|
generator .string += '"';
|
|
135
135
|
generator .string += ':';
|
|
136
136
|
generator .string += generator .TidySpace ();
|
|
137
|
-
generator .string +=
|
|
137
|
+
generator .string += this .conversionFactor;
|
|
138
138
|
generator .string += generator .TidyBreak ();
|
|
139
139
|
|
|
140
140
|
generator .string += generator .DecIndent ();
|
|
@@ -149,8 +149,6 @@ for (const key of Reflect .ownKeys (UnitInfo .prototype))
|
|
|
149
149
|
Object .defineProperty (UnitInfo .prototype, "conversion_factor",
|
|
150
150
|
{
|
|
151
151
|
get: function () { return this .conversionFactor; },
|
|
152
|
-
enumerable: false,
|
|
153
|
-
configurable: false
|
|
154
152
|
});
|
|
155
153
|
|
|
156
154
|
export default UnitInfo;
|
|
@@ -52,10 +52,11 @@ function BindableList (executionContext, defaultNode)
|
|
|
52
52
|
{
|
|
53
53
|
X3DBaseNode .call (this, executionContext);
|
|
54
54
|
|
|
55
|
-
this .
|
|
56
|
-
this .
|
|
57
|
-
this .
|
|
58
|
-
this .
|
|
55
|
+
this .updateTime = 0;
|
|
56
|
+
this .nodes = [ defaultNode ];
|
|
57
|
+
this .collectedNodes = [ defaultNode ];
|
|
58
|
+
this .changedNodes = [ ];
|
|
59
|
+
this .removedNodes = [ ];
|
|
59
60
|
}
|
|
60
61
|
|
|
61
62
|
BindableList .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
|
|
@@ -67,14 +68,14 @@ BindableList .prototype = Object .assign (Object .create (X3DBaseNode .prototype
|
|
|
67
68
|
},
|
|
68
69
|
get: function ()
|
|
69
70
|
{
|
|
70
|
-
return this .
|
|
71
|
+
return this .nodes;
|
|
71
72
|
},
|
|
72
73
|
getBound: function (name)
|
|
73
74
|
{
|
|
74
|
-
const length = this .
|
|
75
|
+
const length = this .nodes .length;
|
|
75
76
|
|
|
76
77
|
if (length === 1)
|
|
77
|
-
return this .
|
|
78
|
+
return this .nodes [0]; // Return default viewpoint.
|
|
78
79
|
|
|
79
80
|
const enableInlineBindables = false;
|
|
80
81
|
|
|
@@ -85,7 +86,7 @@ BindableList .prototype = Object .assign (Object .create (X3DBaseNode .prototype
|
|
|
85
86
|
for (let i = 1; i < length; ++ i)
|
|
86
87
|
{
|
|
87
88
|
const
|
|
88
|
-
node = this .
|
|
89
|
+
node = this .nodes [i],
|
|
89
90
|
scene = node .getExecutionContext () .getOuterNode () ?.getScene () ?? node .getScene ();
|
|
90
91
|
|
|
91
92
|
if (!enableInlineBindables && !scene .isMainScene ())
|
|
@@ -101,7 +102,7 @@ BindableList .prototype = Object .assign (Object .create (X3DBaseNode .prototype
|
|
|
101
102
|
for (let i = 1; i < length; ++ i)
|
|
102
103
|
{
|
|
103
104
|
const
|
|
104
|
-
node = this .
|
|
105
|
+
node = this .nodes [i],
|
|
105
106
|
scene = node .getExecutionContext () .getOuterNode () ?.getScene () ?? node .getScene ();
|
|
106
107
|
|
|
107
108
|
if (!enableInlineBindables && !scene .isMainScene ())
|
|
@@ -116,7 +117,7 @@ BindableList .prototype = Object .assign (Object .create (X3DBaseNode .prototype
|
|
|
116
117
|
for (let i = 1; i < length; ++ i)
|
|
117
118
|
{
|
|
118
119
|
const
|
|
119
|
-
node = this .
|
|
120
|
+
node = this .nodes [i],
|
|
120
121
|
scene = node .getExecutionContext () .getOuterNode () ?.getScene () ?? node .getScene ();
|
|
121
122
|
|
|
122
123
|
if (!enableInlineBindables && !scene .isMainScene ())
|
|
@@ -125,46 +126,52 @@ BindableList .prototype = Object .assign (Object .create (X3DBaseNode .prototype
|
|
|
125
126
|
return node;
|
|
126
127
|
}
|
|
127
128
|
|
|
128
|
-
return this .
|
|
129
|
+
return this .nodes [0]; // Return default viewpoint.
|
|
129
130
|
},
|
|
130
131
|
push: function (node)
|
|
131
132
|
{
|
|
132
|
-
return this .
|
|
133
|
+
return this .collectedNodes .push (node);
|
|
133
134
|
},
|
|
134
135
|
update: function (layerNode, stack)
|
|
135
136
|
{
|
|
136
137
|
const
|
|
137
|
-
|
|
138
|
-
|
|
138
|
+
collectedNodes = this .collectedNodes,
|
|
139
|
+
changedNodes = this .changedNodes,
|
|
140
|
+
removedNodes = this .removedNodes;
|
|
139
141
|
|
|
140
|
-
|
|
142
|
+
for (const node of collectedNodes)
|
|
141
143
|
{
|
|
142
|
-
|
|
144
|
+
if (node ._set_bind .getModificationTime () > this .updateTime)
|
|
145
|
+
changedNodes .push (node);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
if (!equals (collectedNodes, this .nodes))
|
|
149
|
+
{
|
|
150
|
+
// Unbind nodes not in current list (collectedNodes);
|
|
143
151
|
|
|
144
|
-
for (const node of this .
|
|
152
|
+
for (const node of this .nodes)
|
|
145
153
|
{
|
|
146
|
-
if (
|
|
147
|
-
{
|
|
154
|
+
if (collectedNodes .indexOf (node) === -1)
|
|
148
155
|
removedNodes .push (node);
|
|
149
|
-
}
|
|
150
156
|
}
|
|
151
157
|
|
|
152
|
-
// Swap
|
|
158
|
+
// Swap nodes.
|
|
153
159
|
|
|
154
|
-
const tmp = this .
|
|
160
|
+
const tmp = this .nodes;
|
|
155
161
|
|
|
156
|
-
this .
|
|
157
|
-
this .
|
|
162
|
+
this .nodes = collectedNodes;
|
|
163
|
+
this .collectedNodes = tmp;
|
|
158
164
|
}
|
|
159
165
|
|
|
160
|
-
// Clear collected
|
|
166
|
+
// Clear collected nodes.
|
|
161
167
|
|
|
162
|
-
this .
|
|
168
|
+
this .collectedNodes .length = 1;
|
|
163
169
|
|
|
164
170
|
// Update stack.
|
|
165
171
|
|
|
166
172
|
stack .update (layerNode, removedNodes, changedNodes)
|
|
167
173
|
|
|
174
|
+
changedNodes .length = 0;
|
|
168
175
|
removedNodes .length = 0;
|
|
169
176
|
|
|
170
177
|
// Advance updateTime time.
|
|
@@ -176,7 +183,7 @@ BindableList .prototype = Object .assign (Object .create (X3DBaseNode .prototype
|
|
|
176
183
|
for (const key of Reflect .ownKeys (BindableList .prototype))
|
|
177
184
|
Object .defineProperty (BindableList .prototype, key, { enumerable: false });
|
|
178
185
|
|
|
179
|
-
// Compares two
|
|
186
|
+
// Compares two nodess.
|
|
180
187
|
|
|
181
188
|
function equals (lhs, rhs)
|
|
182
189
|
{
|
|
@@ -51,7 +51,7 @@ function BindableStack (executionContext, defaultNode)
|
|
|
51
51
|
{
|
|
52
52
|
X3DBaseNode .call (this, executionContext);
|
|
53
53
|
|
|
54
|
-
this .
|
|
54
|
+
this .nodes = [ defaultNode ];
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
BindableStack .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
|
|
@@ -63,18 +63,18 @@ BindableStack .prototype = Object .assign (Object .create (X3DBaseNode .prototyp
|
|
|
63
63
|
},
|
|
64
64
|
get: function ()
|
|
65
65
|
{
|
|
66
|
-
return this .
|
|
66
|
+
return this .nodes;
|
|
67
67
|
},
|
|
68
68
|
top: function ()
|
|
69
69
|
{
|
|
70
|
-
return this .
|
|
70
|
+
return this .nodes .at (-1);
|
|
71
71
|
},
|
|
72
72
|
pushOnTop: function (node)
|
|
73
73
|
{
|
|
74
|
-
if (node !== this .
|
|
74
|
+
if (node !== this .nodes [0])
|
|
75
75
|
{
|
|
76
|
-
this .
|
|
77
|
-
this .
|
|
76
|
+
this .nodes .at (-1) ._isBound = false;
|
|
77
|
+
this .nodes .push (node);
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
// Don't do set_bind.
|
|
@@ -92,25 +92,25 @@ BindableStack .prototype = Object .assign (Object .create (X3DBaseNode .prototyp
|
|
|
92
92
|
|
|
93
93
|
const
|
|
94
94
|
fromNode = this .top (),
|
|
95
|
-
boundNode = this .
|
|
95
|
+
boundNode = this .nodes .at (-1);
|
|
96
96
|
|
|
97
97
|
// Remove invisible nodes and unbind them if needed.
|
|
98
98
|
|
|
99
99
|
for (const removedNode of removedNodes)
|
|
100
100
|
{
|
|
101
|
-
const index = this .
|
|
101
|
+
const index = this .nodes .indexOf (removedNode);
|
|
102
102
|
|
|
103
103
|
if (index > 0)
|
|
104
|
-
this .
|
|
104
|
+
this .nodes .splice (index, 1);
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
// Unbind nodes with set_bind false and pop top node.
|
|
108
108
|
|
|
109
|
-
if (boundNode !== this .
|
|
109
|
+
if (boundNode !== this .nodes [0])
|
|
110
110
|
{
|
|
111
111
|
if (changedNodes .some (node => ! node ._set_bind .getValue () && node === boundNode))
|
|
112
112
|
{
|
|
113
|
-
this .
|
|
113
|
+
this .nodes .pop ();
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
|
|
@@ -120,20 +120,18 @@ BindableStack .prototype = Object .assign (Object .create (X3DBaseNode .prototyp
|
|
|
120
120
|
{
|
|
121
121
|
if (bindNode ._set_bind .getValue ())
|
|
122
122
|
{
|
|
123
|
-
const index = this .
|
|
123
|
+
const index = this .nodes .indexOf (bindNode);
|
|
124
124
|
|
|
125
125
|
if (index > -1)
|
|
126
|
-
|
|
127
|
-
this .array .splice (index, 1);
|
|
128
|
-
}
|
|
126
|
+
this .nodes .splice (index, 1);
|
|
129
127
|
|
|
130
|
-
this .
|
|
128
|
+
this .nodes .push (bindNode);
|
|
131
129
|
}
|
|
132
130
|
}
|
|
133
131
|
|
|
134
132
|
// Bind top node if not bound.
|
|
135
133
|
|
|
136
|
-
const top = this .
|
|
134
|
+
const top = this .nodes .at (-1);
|
|
137
135
|
|
|
138
136
|
if (top !== boundNode)
|
|
139
137
|
{
|
|
@@ -942,73 +942,63 @@ for (const key of Reflect .ownKeys (X3DExecutionContext .prototype))
|
|
|
942
942
|
|
|
943
943
|
Object .defineProperty (X3DExecutionContext .prototype, "specificationVersion",
|
|
944
944
|
{
|
|
945
|
-
get: function () { return this .getSpecificationVersion ()
|
|
945
|
+
get: function () { return this .getSpecificationVersion () },
|
|
946
946
|
enumerable: true,
|
|
947
|
-
configurable: false
|
|
948
947
|
});
|
|
949
948
|
|
|
950
949
|
Object .defineProperty (X3DExecutionContext .prototype, "encoding",
|
|
951
950
|
{
|
|
952
|
-
get: function () { return this .getEncoding ()
|
|
951
|
+
get: function () { return this .getEncoding () },
|
|
953
952
|
enumerable: true,
|
|
954
|
-
configurable: false
|
|
955
953
|
});
|
|
956
954
|
|
|
957
955
|
Object .defineProperty (X3DExecutionContext .prototype, "profile",
|
|
958
956
|
{
|
|
959
|
-
get: function () { return this .getProfile ()
|
|
957
|
+
get: function () { return this .getProfile () },
|
|
960
958
|
enumerable: true,
|
|
961
|
-
configurable: false
|
|
962
959
|
});
|
|
963
960
|
|
|
964
961
|
Object .defineProperty (X3DExecutionContext .prototype, "components",
|
|
965
962
|
{
|
|
966
|
-
get: function () { return this .getComponents ()
|
|
963
|
+
get: function () { return this .getComponents () },
|
|
967
964
|
enumerable: true,
|
|
968
|
-
configurable: false
|
|
969
965
|
});
|
|
970
966
|
|
|
971
967
|
Object .defineProperty (X3DExecutionContext .prototype, "worldURL",
|
|
972
968
|
{
|
|
973
|
-
get: function () { return this .getWorldURL ()
|
|
969
|
+
get: function () { return this .getWorldURL () },
|
|
974
970
|
enumerable: true,
|
|
975
|
-
configurable: false
|
|
976
971
|
});
|
|
977
972
|
|
|
978
973
|
Object .defineProperty (X3DExecutionContext .prototype, "units",
|
|
979
974
|
{
|
|
980
|
-
get: function () { return this .getUnits ()
|
|
975
|
+
get: function () { return this .getUnits () },
|
|
981
976
|
enumerable: true,
|
|
982
|
-
configurable: false
|
|
983
977
|
});
|
|
984
978
|
|
|
985
979
|
Object .defineProperty (X3DExecutionContext .prototype, "rootNodes",
|
|
986
980
|
{
|
|
987
|
-
get:
|
|
988
|
-
set: function (value) { this .setRootNodes (value)
|
|
981
|
+
get: X3DExecutionContext .prototype .getRootNodes,
|
|
982
|
+
set: function (value) { this .setRootNodes (value) },
|
|
989
983
|
enumerable: true,
|
|
990
|
-
configurable: false
|
|
991
984
|
});
|
|
992
985
|
|
|
993
986
|
Object .defineProperty (X3DExecutionContext .prototype, "protos",
|
|
994
987
|
{
|
|
995
|
-
get:
|
|
988
|
+
get: X3DExecutionContext .prototype .getProtoDeclarations,
|
|
996
989
|
enumerable: true,
|
|
997
|
-
configurable: false
|
|
998
990
|
});
|
|
999
991
|
|
|
1000
992
|
Object .defineProperty (X3DExecutionContext .prototype, "externprotos",
|
|
1001
993
|
{
|
|
1002
|
-
get:
|
|
994
|
+
get: X3DExecutionContext .prototype .getExternProtoDeclarations,
|
|
1003
995
|
enumerable: true,
|
|
1004
|
-
configurable: false
|
|
1005
996
|
});
|
|
1006
997
|
|
|
1007
998
|
Object .defineProperty (X3DExecutionContext .prototype, "routes",
|
|
1008
999
|
{
|
|
1009
|
-
get:
|
|
1000
|
+
get: X3DExecutionContext .prototype .getRoutes,
|
|
1010
1001
|
enumerable: true,
|
|
1011
|
-
configurable: false
|
|
1012
1002
|
});
|
|
1013
1003
|
|
|
1014
1004
|
export default X3DExecutionContext;
|
|
@@ -107,7 +107,7 @@ X3DExportedNode .prototype = Object .assign (Object .create (X3DObject .prototyp
|
|
|
107
107
|
generator .string += "'";
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
generator .string += "/>";
|
|
110
|
+
generator .string += generator .closingTags ? "></EXPORT>" : "/>";
|
|
111
111
|
},
|
|
112
112
|
toJSONStream: function (generator)
|
|
113
113
|
{
|
|
@@ -177,7 +177,6 @@ Object .defineProperty (X3DExportedNode .prototype, "exportedName",
|
|
|
177
177
|
return SFNodeCache .get (this [_exportedName]);
|
|
178
178
|
},
|
|
179
179
|
enumerable: true,
|
|
180
|
-
configurable: false
|
|
181
180
|
});
|
|
182
181
|
|
|
183
182
|
Object .defineProperty (X3DExportedNode .prototype, "localNode",
|
|
@@ -187,7 +186,6 @@ Object .defineProperty (X3DExportedNode .prototype, "localNode",
|
|
|
187
186
|
return SFNodeCache .get (this [_localNode]);
|
|
188
187
|
},
|
|
189
188
|
enumerable: true,
|
|
190
|
-
configurable: false
|
|
191
189
|
});
|
|
192
190
|
|
|
193
191
|
export default X3DExportedNode;
|
|
@@ -267,7 +267,7 @@ X3DImportedNode .prototype = Object .assign (Object .create (X3DNode .prototype)
|
|
|
267
267
|
generator .string += "'";
|
|
268
268
|
}
|
|
269
269
|
|
|
270
|
-
generator .string += "/>";
|
|
270
|
+
generator .string += generator .closingTags ? "></IMPORT>" : "/>";
|
|
271
271
|
|
|
272
272
|
try
|
|
273
273
|
{
|
|
@@ -316,7 +316,7 @@ X3DImportedNode .prototype = Object .assign (Object .create (X3DNode .prototype)
|
|
|
316
316
|
generator .string += "toField='";
|
|
317
317
|
generator .string += generator .XMLEncode (destinationField);
|
|
318
318
|
generator .string += "'";
|
|
319
|
-
generator .string += "/>";
|
|
319
|
+
generator .string += generator .closingTags ? "></ROUTE>" : "/>";
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
322
|
}
|
|
@@ -520,7 +520,6 @@ Object .defineProperty (X3DImportedNode .prototype, "inlineNode",
|
|
|
520
520
|
return SFNodeCache .get (this [_inlineNode]);
|
|
521
521
|
},
|
|
522
522
|
enumerable: true,
|
|
523
|
-
configurable: false
|
|
524
523
|
});
|
|
525
524
|
|
|
526
525
|
Object .defineProperty (X3DImportedNode .prototype, "exportedName",
|
|
@@ -530,7 +529,6 @@ Object .defineProperty (X3DImportedNode .prototype, "exportedName",
|
|
|
530
529
|
return this [_exportedName];
|
|
531
530
|
},
|
|
532
531
|
enumerable: true,
|
|
533
|
-
configurable: false
|
|
534
532
|
});
|
|
535
533
|
|
|
536
534
|
Object .defineProperty (X3DImportedNode .prototype, "exportedNode",
|
|
@@ -540,7 +538,6 @@ Object .defineProperty (X3DImportedNode .prototype, "exportedNode",
|
|
|
540
538
|
return this [_inlineNode] .getInternalScene () .getExportedNode (this [_exportedName]);
|
|
541
539
|
},
|
|
542
540
|
enumerable: true,
|
|
543
|
-
configurable: false
|
|
544
541
|
});
|
|
545
542
|
|
|
546
543
|
Object .defineProperty (X3DImportedNode .prototype, "importedName",
|
|
@@ -550,7 +547,6 @@ Object .defineProperty (X3DImportedNode .prototype, "importedName",
|
|
|
550
547
|
return this [_importedName];
|
|
551
548
|
},
|
|
552
549
|
enumerable: true,
|
|
553
|
-
configurable: false
|
|
554
550
|
});
|
|
555
551
|
|
|
556
552
|
export default X3DImportedNode;
|