x_ite 8.3.0 → 8.3.1

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 (57) hide show
  1. package/README.md +5 -2
  2. package/dist/assets/components/Annotation.js +13 -13
  3. package/dist/assets/components/Annotation.min.js +1 -1
  4. package/dist/assets/components/CADGeometry.js +13 -13
  5. package/dist/assets/components/CADGeometry.min.js +1 -1
  6. package/dist/assets/components/CubeMapTexturing.js +25 -25
  7. package/dist/assets/components/CubeMapTexturing.min.js +1 -1
  8. package/dist/assets/components/DIS.js +13 -13
  9. package/dist/assets/components/DIS.min.js +1 -1
  10. package/dist/assets/components/EventUtilities.js +9 -9
  11. package/dist/assets/components/EventUtilities.min.js +1 -1
  12. package/dist/assets/components/Geometry2D.js +19 -19
  13. package/dist/assets/components/Geometry2D.min.js +1 -1
  14. package/dist/assets/components/Geospatial.js +33 -33
  15. package/dist/assets/components/Geospatial.min.js +1 -1
  16. package/dist/assets/components/HAnim.js +18 -18
  17. package/dist/assets/components/HAnim.min.js +1 -1
  18. package/dist/assets/components/KeyDeviceSensor.js +8 -8
  19. package/dist/assets/components/KeyDeviceSensor.min.js +1 -1
  20. package/dist/assets/components/Layout.js +27 -27
  21. package/dist/assets/components/Layout.min.js +1 -1
  22. package/dist/assets/components/NURBS.js +24 -24
  23. package/dist/assets/components/NURBS.min.js +1 -1
  24. package/dist/assets/components/ParticleSystems.js +23 -23
  25. package/dist/assets/components/ParticleSystems.min.js +1 -1
  26. package/dist/assets/components/Picking.js +19 -19
  27. package/dist/assets/components/Picking.min.js +1 -1
  28. package/dist/assets/components/ProjectiveTextureMapping.js +14 -14
  29. package/dist/assets/components/ProjectiveTextureMapping.min.js +1 -1
  30. package/dist/assets/components/RigidBodyPhysics.js +17 -17
  31. package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
  32. package/dist/assets/components/Scripting.js +28 -28
  33. package/dist/assets/components/Scripting.min.js +1 -1
  34. package/dist/assets/components/Text.js +24 -24
  35. package/dist/assets/components/Text.min.js +1 -1
  36. package/dist/assets/components/Texturing3D.js +27 -27
  37. package/dist/assets/components/Texturing3D.min.js +1 -1
  38. package/dist/assets/components/VolumeRendering.js +19 -19
  39. package/dist/assets/components/VolumeRendering.min.js +1 -1
  40. package/dist/assets/components/X_ITE.js +9 -9
  41. package/dist/assets/components/X_ITE.min.js +1 -1
  42. package/dist/x_ite.css +1 -1
  43. package/dist/x_ite.js +123 -105
  44. package/dist/x_ite.min.js +1 -1
  45. package/dist/x_ite.zip +0 -0
  46. package/docs/_config.yml +1 -1
  47. package/docs/_posts/getting-started.md +5 -2
  48. package/docs/_posts/tutorials/basic-nodes.md +1 -1
  49. package/docs/_posts/tutorials/building-a-x3d-world.md +1 -1
  50. package/docs/_posts/tutorials/building-primitive-shapes.md +2 -2
  51. package/docs/_posts/tutorials/hello-world.md +3 -3
  52. package/docs/_posts/tutorials/improving-performance.md +1 -1
  53. package/docs/_posts/tutorials/writing-program-scripts-with-ecmascript.md +1 -1
  54. package/package.json +1 -1
  55. package/src/x_ite/Browser/VERSION.js +1 -1
  56. package/src/x_ite/Execution/X3DScene.js +74 -58
  57. package/src/x_ite/Parser/JSONParser.js +1 -1
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.3.0
23
+ version: 8.3.1
24
24
 
25
25
  tagline: Step Into The Future # it will display as the sub-title
26
26
 
@@ -819,10 +819,13 @@ There is a ZIP archive available to locally install X_ITE on your server. Compre
819
819
  $ npm install x_ite
820
820
  ```
821
821
 
822
- It can be used in [Electron](https://www.electronjs.org){:target="_blank"} apps in the **renderer process** like this:
822
+ It can be used in [Electron](https://www.electronjs.org){:target="_blank"} apps in a preload script of the **renderer process** like this:
823
823
 
824
824
  ```js
825
- const X3D = require ("x_ite")
825
+ window .addEventListener ("DOMContentLoaded", () =>
826
+ {
827
+ const X3D = require ("x_ite")
828
+ })
826
829
  ```
827
830
 
828
831
  Make sure that contextIsolation is set to **false** when creating a BrowserWindow instance.
@@ -28,7 +28,7 @@ Here is a typical X3D Classic Encoded file with a single node:
28
28
 
29
29
  ```xml
30
30
  <?xml version="1.0" encoding="UTF-8"?>
31
- <X3D profile='Full' version='4.0' xmlns:xsd='https://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-4.0.xsd'>
31
+ <X3D profile='Full' version='4.0' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='http://www.web3d.org/specifications/x3d-4.0.xsd'>
32
32
  <Scene>
33
33
  <PlaneSensor DEF='Sensor'
34
34
  offset='0 2 0'/>
@@ -23,7 +23,7 @@ X3D files contain:
23
23
 
24
24
  ```xml
25
25
  <?xml version="1.0" encoding="UTF-8"?>
26
- <X3D profile='Full' version='4.0' xmlns:xsd='https://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-4.0.xsd'>
26
+ <X3D profile='Full' version='4.0' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='http://www.web3d.org/specifications/x3d-4.0.xsd'>
27
27
  <Scene>
28
28
  <!-- A Cylinder -->
29
29
  <Shape>
@@ -100,7 +100,7 @@ Text { ... }
100
100
 
101
101
  ```xml
102
102
  <?xml version="1.0" encoding="UTF-8"?>
103
- <X3D profile='Full' version='4.0' xmlns:xsd='https://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-4.0.xsd'>
103
+ <X3D profile='Full' version='4.0' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='http://www.web3d.org/specifications/x3d-4.0.xsd'>
104
104
  <Scene>
105
105
  <Shape>
106
106
  <Appearance>
@@ -149,7 +149,7 @@ Shape {
149
149
 
150
150
  ```xml
151
151
  <?xml version="1.0" encoding="UTF-8"?>
152
- <X3D profile='Full' version='4.0' xmlns:xsd='https://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-4.0.xsd'>
152
+ <X3D profile='Full' version='4.0' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='http://www.web3d.org/specifications/x3d-4.0.xsd'>
153
153
  <Scene>
154
154
  <Shape>
155
155
  <Appearance>
@@ -31,7 +31,7 @@ As first a very easy example, we will create a sphere with a texture and a text
31
31
 
32
32
  ```xml
33
33
  <?xml version="1.0" encoding="UTF-8"?>
34
- <X3D profile='Full' version='4.0' xmlns:xsd='https://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-4.0.xsd'>
34
+ <X3D profile='Full' version='4.0' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='http://www.web3d.org/specifications/x3d-4.0.xsd'>
35
35
  <Scene>
36
36
  <Transform>
37
37
  <Shape>
@@ -62,7 +62,7 @@ Now we have a sphere, but we don't see if it is rotating, let's assign a texture
62
62
 
63
63
  ```xml
64
64
  <?xml version="1.0" encoding="UTF-8"?>
65
- <X3D profile='Full' version='4.0' xmlns:xsd='https://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-4.0.xsd'>
65
+ <X3D profile='Full' version='4.0' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='http://www.web3d.org/specifications/x3d-4.0.xsd'>
66
66
  <Scene>
67
67
  <Transform>
68
68
  <Shape>
@@ -119,7 +119,7 @@ Now the sphere looks like an earth and you are very curious how the text will be
119
119
 
120
120
  ```xml
121
121
  <?xml version="1.0" encoding="UTF-8"?>
122
- <X3D profile='Full' version='4.0' xmlns:xsd='https://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-4.0.xsd'>
122
+ <X3D profile='Full' version='4.0' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='http://www.web3d.org/specifications/x3d-4.0.xsd'>
123
123
  <Scene>
124
124
  <Viewpoint
125
125
  description='Home'
@@ -76,7 +76,7 @@ Prototyping objects that are used frequently with a few modifications is another
76
76
 
77
77
  ```xml
78
78
  <?xml version="1.0" encoding="UTF-8"?>
79
- <X3D profile='Full' version='4.0' xmlns:xsd='https://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-4.0.xsd'>
79
+ <X3D profile='Full' version='4.0' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='http://www.web3d.org/specifications/x3d-4.0.xsd'>
80
80
  <head>
81
81
  <meta name='comment' content='World of Titania'/>
82
82
  <meta name='created' content='Fri, 29 Jun 2018 13:24:34 GMT'/>
@@ -337,7 +337,7 @@ ROUTE Bouncer.value_changed TO Ball.set_translation
337
337
 
338
338
  ```xml
339
339
  <?xml version="1.0" encoding="UTF-8"?>
340
- <X3D profile='Full' version='4.0' xmlns:xsd='https://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-4.0.xsd'>
340
+ <X3D profile='Full' version='4.0' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='http://www.web3d.org/specifications/x3d-4.0.xsd'>
341
341
  <Scene>
342
342
  <Transform DEF='Ball'>
343
343
  <Shape>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "x_ite",
3
- "version": "8.3.0",
3
+ "version": "8.3.1",
4
4
  "description": "X_ITE X3D Browser, a framework for integrating and manipulating X3D and VRML scenes in HTML.",
5
5
  "homepage": "https://create3000.github.io/x_ite/",
6
6
  "author": "Holger Seelig <holger.seelig@gmail.com>",
@@ -45,4 +45,4 @@
45
45
  *
46
46
  ******************************************************************************/
47
47
 
48
- export default "8.3.0";
48
+ export default "8.3.1";
@@ -374,7 +374,7 @@ X3DScene .prototype = Object .assign (Object .create (X3DExecutionContext .proto
374
374
  stream .string += " ";
375
375
  stream .string += this .getBrowser () .name;
376
376
  stream .string += " ";
377
- stream .string += "v";
377
+ stream .string += "V";
378
378
  stream .string += this .getBrowser () .version;
379
379
  stream .string += "\n";
380
380
  stream .string += "\n";
@@ -472,7 +472,7 @@ X3DScene .prototype = Object .assign (Object .create (X3DExecutionContext .proto
472
472
  stream .string += "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
473
473
  stream .string += "<!DOCTYPE X3D PUBLIC \"ISO//Web3D//DTD X3D ";
474
474
  stream .string += LATEST_VERSION;
475
- stream .string += "//EN\" \"https://www.web3d.org/specifications/x3d-";
475
+ stream .string += "//EN\" \"http://www.web3d.org/specifications/x3d-";
476
476
  stream .string += LATEST_VERSION;
477
477
  stream .string += ".dtd\">\n";
478
478
 
@@ -486,92 +486,108 @@ X3DScene .prototype = Object .assign (Object .create (X3DExecutionContext .proto
486
486
  stream .string += LATEST_VERSION;
487
487
  stream .string += "'";
488
488
  stream .string += " ";
489
- stream .string += "xmlns:xsd='https://www.w3.org/2001/XMLSchema-instance'";
489
+ stream .string += "xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance'";
490
490
  stream .string += " ";
491
- stream .string += "xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-";
491
+ stream .string += "xsd:noNamespaceSchemaLocation='http://www.web3d.org/specifications/x3d-";
492
492
  stream .string += LATEST_VERSION;
493
493
  stream .string += ".xsd'>\n";
494
494
 
495
495
  generator .IncIndent ();
496
496
 
497
- stream .string += generator .Indent ();
498
- stream .string += "<head>\n";
497
+ if (this .getComponents () .length ||
498
+ this .getUnits () .some (unit => unit .conversionFactor !== 1) ||
499
+ this .getMetaDatas () .size)
500
+ {
501
+ stream .string += generator .Indent ();
502
+ stream .string += "<head>\n";
499
503
 
500
- generator .IncIndent ();
504
+ generator .IncIndent ();
501
505
 
502
- // <head>
506
+ // <head>
503
507
 
504
- this .getComponents () .toXMLStream (stream);
508
+ this .getComponents () .toXMLStream (stream);
505
509
 
506
- for (const unit of this .getUnits ())
507
- {
508
- if (unit .conversionFactor !== 1)
510
+ for (const unit of this .getUnits ())
509
511
  {
510
- unit .toXMLStream (stream);
512
+ if (unit .conversionFactor !== 1)
513
+ {
514
+ unit .toXMLStream (stream);
511
515
 
512
- stream .string += "\n";
516
+ stream .string += "\n";
517
+ }
513
518
  }
519
+
520
+ this .getMetaDatas () .forEach (function (value, key)
521
+ {
522
+ stream .string += generator .Indent ();
523
+ stream .string += "<meta";
524
+ stream .string += " ";
525
+ stream .string += "name='";
526
+ stream .string += generator .XMLEncode (key);
527
+ stream .string += "'";
528
+ stream .string += " ";
529
+ stream .string += "content='";
530
+ stream .string += generator .XMLEncode (value);
531
+ stream .string += "'";
532
+ stream .string += "/>\n";
533
+ });
534
+
535
+ // </head>
536
+
537
+ generator .DecIndent ();
538
+
539
+ stream .string += generator .Indent ();
540
+ stream .string += "</head>\n";
514
541
  }
515
542
 
516
- this .getMetaDatas () .forEach (function (value, key)
543
+ if (this .getExternProtoDeclarations () .length ||
544
+ this .getProtoDeclarations () .length ||
545
+ this .getRootNodes () .length)
517
546
  {
518
547
  stream .string += generator .Indent ();
519
- stream .string += "<meta";
520
- stream .string += " ";
521
- stream .string += "name='";
522
- stream .string += generator .XMLEncode (key);
523
- stream .string += "'";
524
- stream .string += " ";
525
- stream .string += "content='";
526
- stream .string += generator .XMLEncode (value);
527
- stream .string += "'";
528
- stream .string += "/>\n";
529
- });
530
-
531
- // </head>
532
-
533
- generator .DecIndent ();
548
+ stream .string += "<Scene>\n";
534
549
 
535
- stream .string += generator .Indent ();
536
- stream .string += "</head>\n";
537
- stream .string += generator .Indent ();
538
- stream .string += "<Scene>\n";
550
+ generator .IncIndent ();
539
551
 
540
- generator .IncIndent ();
541
-
542
- // <Scene>
552
+ // <Scene>
543
553
 
544
- const exportedNodes = this .getExportedNodes ();
554
+ const exportedNodes = this .getExportedNodes ();
545
555
 
546
- generator .PushExecutionContext (this);
547
- generator .EnterScope ();
548
- generator .ExportedNodes (exportedNodes);
556
+ generator .PushExecutionContext (this);
557
+ generator .EnterScope ();
558
+ generator .ExportedNodes (exportedNodes);
549
559
 
550
- X3DExecutionContext .prototype .toXMLStream .call (this, stream);
560
+ X3DExecutionContext .prototype .toXMLStream .call (this, stream);
551
561
 
552
- for (const exportedNode of exportedNodes)
553
- {
554
- try
562
+ for (const exportedNode of exportedNodes)
555
563
  {
556
- exportedNode .toXMLStream (stream);
564
+ try
565
+ {
566
+ exportedNode .toXMLStream (stream);
557
567
 
558
- stream .string += "\n";
559
- }
560
- catch (error)
561
- {
562
- console .error (error);
568
+ stream .string += "\n";
569
+ }
570
+ catch (error)
571
+ {
572
+ console .error (error);
573
+ }
563
574
  }
564
- }
565
575
 
566
- generator .LeaveScope ();
567
- generator .PopExecutionContext ();
576
+ generator .LeaveScope ();
577
+ generator .PopExecutionContext ();
568
578
 
569
- // </Scene>
579
+ // </Scene>
570
580
 
571
- generator .DecIndent ();
581
+ generator .DecIndent ();
572
582
 
573
- stream .string += generator .Indent ();
574
- stream .string += "</Scene>\n";
583
+ stream .string += generator .Indent ();
584
+ stream .string += "</Scene>\n";
585
+ }
586
+ else
587
+ {
588
+ stream .string += generator .Indent ();
589
+ stream .string += "<Scene/>\n";
590
+ }
575
591
 
576
592
  generator .DecIndent ();
577
593
 
@@ -54,7 +54,7 @@ function JSONParser (scene)
54
54
  {
55
55
  X3DParser .call (this, scene);
56
56
 
57
- this .namespace = "https://www.web3d.org/specifications/x3d-namespace";
57
+ this .namespace = "http://www.web3d.org/specifications/x3d-namespace";
58
58
  }
59
59
 
60
60
  JSONParser .prototype = Object .assign (Object .create (X3DParser .prototype),