x_ite 8.6.23 → 8.7.0

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 (114) hide show
  1. package/README.md +2 -0
  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 +34 -39
  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 +32 -32
  23. package/dist/assets/components/NURBS.min.js +1 -1
  24. package/dist/assets/components/ParticleSystems.js +22 -22
  25. package/dist/assets/components/ParticleSystems.min.js +1 -1
  26. package/dist/assets/components/Picking.js +26 -26
  27. package/dist/assets/components/Picking.min.js +1 -1
  28. package/dist/assets/components/RigidBodyPhysics.js +20 -20
  29. package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
  30. package/dist/assets/components/Scripting.js +28 -28
  31. package/dist/assets/components/Scripting.min.js +1 -1
  32. package/dist/assets/components/Text.js +24 -24
  33. package/dist/assets/components/Text.min.js +1 -1
  34. package/dist/assets/components/TextureProjector.js +14 -14
  35. package/dist/assets/components/TextureProjector.min.js +1 -1
  36. package/dist/assets/components/Texturing3D.js +1116 -1685
  37. package/dist/assets/components/Texturing3D.min.js +1 -1
  38. package/dist/assets/components/VolumeRendering.js +25 -25
  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 +313 -271
  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/accessing-the-external-browser.md +1 -1
  48. package/docs/_posts/components/Geospatial/GeoViewpoint.md +41 -0
  49. package/docs/_posts/components/Navigation/OrthoViewpoint.md +41 -0
  50. package/docs/_posts/components/Navigation/Viewpoint.md +41 -0
  51. package/docs/_posts/components/Networking/Inline.md +1 -1
  52. package/docs/_posts/components/X_ITE/BlendMode.md +1 -1
  53. package/docs/_posts/getting-started.md +4 -1
  54. package/docs/_posts/glossary.md +3 -3
  55. package/docs/_posts/laboratory/x3d-file-converter.md +1 -1
  56. package/docs/_posts/reference/browser-services.md +48 -20
  57. package/docs/_posts/reference/field-services-and-objects.md +23 -23
  58. package/docs/_posts/reference/scene-services.md +1 -1
  59. package/docs/_posts/supported-nodes.md +1 -1
  60. package/docs/_posts/tutorials/basic-nodes.md +1 -1
  61. package/docs/_posts/tutorials/building-a-x3d-world.md +1 -1
  62. package/docs/_posts/tutorials/building-primitive-shapes.md +1 -1
  63. package/docs/_posts/tutorials/increasing-rendering-speed.md +1 -1
  64. package/docs/_posts/tutorials/introducing-x3d.md +1 -1
  65. package/docs/_posts/tutorials/overview.md +1 -1
  66. package/docs/_posts/what's-new.md +11 -1
  67. package/package.json +4 -4
  68. package/src/x_ite/Base/X3DBaseNode.js +2 -1
  69. package/src/x_ite/Base/X3DField.js +4 -4
  70. package/src/x_ite/Base/X3DFieldDefinition.js +7 -4
  71. package/src/x_ite/Browser/Core/BrowserOptions.js +12 -4
  72. package/src/x_ite/Browser/Core/X3DCoreContext.js +79 -31
  73. package/src/x_ite/Browser/NURBS/NURBS.js +3 -3
  74. package/src/x_ite/Browser/Shaders/X3DShadersContext.js +2 -2
  75. package/src/x_ite/Browser/Texturing/X3DTexturingContext.js +10 -11
  76. package/src/x_ite/Browser/Time/X3DTimeContext.js +1 -5
  77. package/src/x_ite/Browser/VERSION.js +1 -1
  78. package/src/x_ite/Browser/X3DBrowser.js +58 -31
  79. package/src/x_ite/Browser/X3DBrowserContext.js +0 -4
  80. package/src/x_ite/Components/CubeMapTexturing/ComposedCubeMapTexture.js +9 -14
  81. package/src/x_ite/Components/EnvironmentalEffects/Background.js +6 -6
  82. package/src/x_ite/Components/EnvironmentalEffects/TextureBackground.js +14 -34
  83. package/src/x_ite/Components/EnvironmentalEffects/X3DBackgroundNode.js +9 -36
  84. package/src/x_ite/Components/NURBS/NurbsCurve.js +1 -1
  85. package/src/x_ite/Components/NURBS/NurbsCurve2D.js +1 -1
  86. package/src/x_ite/Components/NURBS/NurbsOrientationInterpolator.js +1 -1
  87. package/src/x_ite/Components/NURBS/NurbsPositionInterpolator.js +1 -1
  88. package/src/x_ite/Components/NURBS/X3DNurbsSurfaceGeometryNode.js +1 -1
  89. package/src/x_ite/Components/Picking/LinePickSensor.js +2 -2
  90. package/src/x_ite/Components/Picking/PointPickSensor.js +2 -2
  91. package/src/x_ite/Components/Picking/PrimitivePickSensor.js +2 -2
  92. package/src/x_ite/Components/Picking/VolumePickSensor.js +2 -2
  93. package/src/x_ite/Components/RigidBodyPhysics/CollisionSensor.js +1 -1
  94. package/src/x_ite/Components/RigidBodyPhysics/MotorJoint.js +1 -1
  95. package/src/x_ite/Components/Shape/X3DOneSidedMaterialNode.js +1 -1
  96. package/src/x_ite/Components/Sound/ListenerPointSource.js +2 -1
  97. package/src/x_ite/Components/Sound/MicrophoneSource.js +2 -1
  98. package/src/x_ite/Components/Sound/OscillatorSource.js +2 -1
  99. package/src/x_ite/Components/Sound/StreamAudioSource.js +2 -1
  100. package/src/x_ite/Components/Sound/X3DSoundProcessingNode.js +3 -0
  101. package/src/x_ite/Components/VolumeRendering/IsoSurfaceVolumeData.js +2 -2
  102. package/src/x_ite/Components/VolumeRendering/SegmentedVolumeData.js +2 -2
  103. package/src/x_ite/Components/VolumeRendering/VolumeData.js +2 -2
  104. package/src/x_ite/Configuration/ComponentInfo.js +7 -4
  105. package/src/x_ite/Configuration/ProfileInfo.js +7 -4
  106. package/src/x_ite/Configuration/UnitInfo.js +5 -5
  107. package/src/x_ite/Execution/X3DScene.js +4 -7
  108. package/src/x_ite/Fields/SFNode.js +5 -5
  109. package/src/x_ite/Fields.js +5 -4
  110. package/src/x_ite/Parser/JSONParser.js +1 -1
  111. package/src/x_ite/Parser/X3DParser.js +1 -1
  112. package/src/x_ite/X3DCanvasElement.js +4 -4
  113. package/src/x_ite.html +1 -1
  114. package/x_ite.min.html +1 -1
@@ -7,7 +7,7 @@ tags: [Supported, Nodes, Components, Profiles]
7
7
  ---
8
8
  ## Overview
9
9
 
10
- X_ITE supports a certain number of X3D nodes. Objects in a X3D scene are also called nodes. These nodes are grouped into components and the components are grouped in profiles.
10
+ X_ITE supports a certain number of X3D nodes. Objects in an X3D scene are also called nodes. These nodes are grouped into components and the components are grouped in profiles.
11
11
 
12
12
  The following lists outlines the profiles and nodes that are supported in X_ITE.
13
13
 
@@ -253,7 +253,7 @@ DEF LookAtHouse Viewpoint {
253
253
 
254
254
  Beside the Viewpoint node there is also an [OrthoViewpoint](../components/navigation/orthoviewpoint) node to define an orthographic camera.
255
255
 
256
- If you define more than once viewpoint in a X3D file, the first viewpoint defined will be bound if the world is loaded. To bind one of the other viewpoints send a *set\_bind* event with the value TRUE to the viewpoint. You must use a [Script](../components/scripting/script) node for that or use a Anchor node with the name of the viewpoint in the *url* field preceded by '#'.
256
+ If you define more than once viewpoint in an X3D file, the first viewpoint defined will be bound if the world is loaded. To bind one of the other viewpoints send a *set\_bind* event with the value TRUE to the viewpoint. You must use a [Script](../components/scripting/script) node for that or use a Anchor node with the name of the viewpoint in the *url* field preceded by '#'.
257
257
 
258
258
  ### XML Encoding
259
259
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- title: Building a X3D World
2
+ title: Building an X3D World
3
3
  date: 2022-11-28
4
4
  nav: tutorials-shapes-geometry-and-appearance
5
5
  categories: [Tutorials]
@@ -7,7 +7,7 @@ tags: [Building, Primitive, Shapes]
7
7
  ---
8
8
  ## Motivation
9
9
 
10
- Shapes are the building blocks of a X3D world. Primitive Shapes are standard building blocks:
10
+ Shapes are the building blocks of an X3D world. Primitive Shapes are standard building blocks:
11
11
 
12
12
  - [Box](../components/geometry3d/box)
13
13
  - [Cone](../components/geometry3d/cone)
@@ -32,7 +32,7 @@ Effective use of textures can be a relative inexpensive way to add interest and
32
32
 
33
33
  ### Use Lights Sparingly
34
34
 
35
- Lights are expensive in terms of performance. On most platforms, a X3D file should contain no more than two or three local lights per shape. Placing a directional light under a Transform node with the *global* field set to FALSE localizes the effect of the light.
35
+ Lights are expensive in terms of performance. On most platforms, an X3D file should contain no more than two or three local lights per shape. Placing a directional light under a Transform node with the *global* field set to FALSE localizes the effect of the light.
36
36
 
37
37
  ### Use Fewer Nodes
38
38
 
@@ -21,7 +21,7 @@ X3D is:
21
21
 
22
22
  ## What do I need to use X3D?
23
23
 
24
- You can view X3D files using a X3D browser:
24
+ You can view X3D files using an X3D browser:
25
25
 
26
26
  - A X3D standalone application
27
27
  - A X3D JavaScript plug-in like to an HTML browser
@@ -23,7 +23,7 @@ Simple, fast and efficient, our X3D tutorials give you all the tips and tricks t
23
23
  Shapes, Geometry, and Appearance
24
24
 
25
25
  - [Introducing X3D](introducing-x3d)
26
- - [Building a X3D World](building-a-x3d-world)
26
+ - [Building an X3D World](building-a-x3d-world)
27
27
  - [Building Primitive Shapes ](building-primitive-shapes)
28
28
  - [Transforming Shapes](transforming-shapes)
29
29
  - [Controlling Appearance with Materials ](controlling-appearance-with-materials)
@@ -5,6 +5,16 @@ nav: main
5
5
  categories: []
6
6
  tags: [New, Releases]
7
7
  ---
8
+ ## X_ITE v8.7.0 Released
9
+
10
+ *Leipzig, 14th May 2023:* This release comes with a breaking change: `Browser.createX3DFromString` is now asynchronous and returns now a Promise. This ensures that all components are loaded, and all necessary nodes can be provided.
11
+
12
+ In addition, there is now an [automated test suite](https://github.com/create3000/x_ite-tests){:target="_blank"}, which is being expanded on a daily basis.
13
+
14
+ ### Breaking Changes
15
+
16
+ - `Browser.createX3DFromString` now returns a Promise.
17
+
8
18
  ## X_ITE v8.5.2 Released
9
19
 
10
20
  *Leipzig, 28th January 2023:* Now, X_ITE has support for SVG as well as STL support. When a scene is parsed you can, instead of a number use special constants like PI or PI3_4.
@@ -960,7 +970,7 @@ You can tune the *shadowIntensity*. It is the intensity of the shadow. 0 means n
960
970
 
961
971
  ## X_ITE v4.1.3 Released
962
972
 
963
- *Leipzig, 25th December 2017:* There is now the new BlendMode node in X_ITE available, which gives X3D authors the ability to specify the WebGL blend modes for a node. The node is a X3DAppearance child node and can be assigned the the new *blendMode* field of a Appearance node. Shader authors have now more control over particle systems, there are three new build in variables available in shaders: *x3d\_ParticleId, x3d\_ParticleLife, x3d\_ParticleElapsedTime, x3d\_ParticlePosition.* For more information have a look at <custom-shaders>.
973
+ *Leipzig, 25th December 2017:* There is now the new BlendMode node in X_ITE available, which gives X3D authors the ability to specify the WebGL blend modes for a node. The node is an X3DAppearance child node and can be assigned the the new *blendMode* field of a Appearance node. Shader authors have now more control over particle systems, there are three new build in variables available in shaders: *x3d\_ParticleId, x3d\_ParticleLife, x3d\_ParticleElapsedTime, x3d\_ParticlePosition.* For more information have a look at <custom-shaders>.
964
974
 
965
975
  ## X_ITE v4.1.2 Released
966
976
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "x_ite",
3
- "version": "8.6.23",
3
+ "version": "8.7.0",
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>",
@@ -59,7 +59,7 @@
59
59
  "css-element-queries": "^1.2.3",
60
60
  "dicom-parser": "^1.8.21",
61
61
  "jpeg-js": "^0.4.4",
62
- "jpeg-lossless-decoder-js": "^2.0.4",
62
+ "jpeg-lossless-decoder-js": "^2.0.5",
63
63
  "jquery": "^3.6.4",
64
64
  "jquery-fullscreen-plugin": "^1.1.5",
65
65
  "jquery-mousewheel": "^3.1.13",
@@ -71,8 +71,8 @@
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.80.0",
75
- "webpack-cli": "^5.0.2",
74
+ "webpack": "^5.82.1",
75
+ "webpack-cli": "^5.1.1",
76
76
  "webpack-shell-plugin-next": "^2.3.1"
77
77
  },
78
78
  "scripts": {
@@ -318,6 +318,8 @@ X3DBaseNode .prototype = Object .assign (Object .create (X3DEventObject .prototy
318
318
  {
319
319
  get: function () { return field; },
320
320
  set: function (value) { field .setValue (value); },
321
+ configurable: true,
322
+ enumerable: false,
321
323
  });
322
324
 
323
325
  if (!this .isPrivate ())
@@ -372,7 +374,6 @@ X3DBaseNode .prototype = Object .assign (Object .create (X3DEventObject .prototy
372
374
  {
373
375
  get: function () { return field; },
374
376
  set: function (value) { field .setValue (value); },
375
- enumerable: true,
376
377
  });
377
378
 
378
379
  if (field .isInitializable ())
@@ -123,15 +123,15 @@ X3DField .prototype = Object .assign (Object .create (X3DChildObject .prototype)
123
123
  },
124
124
  isInitializable: function ()
125
125
  {
126
- return this [_accessType] & X3DConstants .initializeOnly;
126
+ return !! (this [_accessType] & X3DConstants .initializeOnly);
127
127
  },
128
128
  isInput: function ()
129
129
  {
130
- return this [_accessType] & X3DConstants .inputOnly;
130
+ return !! (this [_accessType] & X3DConstants .inputOnly);
131
131
  },
132
132
  isOutput: function ()
133
133
  {
134
- return this [_accessType] & X3DConstants .outputOnly;
134
+ return !! (this [_accessType] & X3DConstants .outputOnly);
135
135
  },
136
136
  isReadable: function ()
137
137
  {
@@ -139,7 +139,7 @@ X3DField .prototype = Object .assign (Object .create (X3DChildObject .prototype)
139
139
  },
140
140
  isWritable: function ()
141
141
  {
142
- return this [_accessType] !== X3DConstants .initializeOnly;
142
+ return this [_accessType] !== X3DConstants .outputOnly;
143
143
  },
144
144
  setUnit: function (value)
145
145
  {
@@ -49,10 +49,13 @@ import X3DObject from "./X3DObject.js";
49
49
 
50
50
  function X3DFieldDefinition (accessType, name, value)
51
51
  {
52
- this .accessType = accessType;
53
- this .dataType = value .getType ();
54
- this .name = name;
55
- this .value = value;
52
+ Object .defineProperties (this,
53
+ {
54
+ accessType: { value: accessType, enumerable: true },
55
+ dataType: { value: value .getType (), enumerable: true },
56
+ name: { value: name, enumerable: true },
57
+ value: { value: value },
58
+ });
56
59
  }
57
60
 
58
61
  X3DFieldDefinition .prototype = Object .assign (Object .create (X3DObject .prototype),
@@ -80,7 +80,7 @@ BrowserOptions .prototype = Object .assign (Object .create (X3DBaseNode .prototy
80
80
  new X3DFieldDefinition (X3DConstants .inputOutput, "Antialiased", new Fields .SFBool (true)),
81
81
  new X3DFieldDefinition (X3DConstants .inputOutput, "TextureQuality", new Fields .SFString ("MEDIUM")),
82
82
  new X3DFieldDefinition (X3DConstants .inputOutput, "PrimitiveQuality", new Fields .SFString ("MEDIUM")),
83
- new X3DFieldDefinition (X3DConstants .inputOutput, "QualityWhenMoving", new Fields .SFString ("MEDIUM")),
83
+ new X3DFieldDefinition (X3DConstants .inputOutput, "QualityWhenMoving", new Fields .SFString ("SAME")),
84
84
  new X3DFieldDefinition (X3DConstants .inputOutput, "Shading", new Fields .SFString ("GOURAUD")),
85
85
  new X3DFieldDefinition (X3DConstants .inputOutput, "MotionBlur", new Fields .SFBool ()),
86
86
  new X3DFieldDefinition (X3DConstants .inputOutput, "Cache", new Fields .SFBool (true)),
@@ -131,6 +131,12 @@ BrowserOptions .prototype = Object .assign (Object .create (X3DBaseNode .prototy
131
131
  this ._Multisampling .addInterest ("set_multisampling__", this);
132
132
  this ._Timings .addInterest ("set_timings__", this);
133
133
 
134
+ this .set_antialiased__ (this ._Antialiased);
135
+ this .set_shading__ (this ._Shading);
136
+ this .set_contentScale__ (this ._ContentScale);
137
+ this .set_logarithmicDepthBuffer__ (this ._LogarithmicDepthBuffer);
138
+ this .set_multisampling__ (this ._Multisampling);
139
+
134
140
  this .configure ();
135
141
  },
136
142
  configure: (function ()
@@ -168,9 +174,11 @@ BrowserOptions .prototype = Object .assign (Object .create (X3DBaseNode .prototy
168
174
  attribute = $.toLowerCaseFirst (name),
169
175
  value = browser .getElement () .attr (attribute);
170
176
 
171
- browser .attributeChangedCallback (attribute, null, value);
172
-
173
- continue;
177
+ if (value !== undefined)
178
+ {
179
+ browser .attributeChangedCallback (attribute, null, value);
180
+ continue;
181
+ }
174
182
  }
175
183
 
176
184
  if (restorable .has (name))
@@ -113,10 +113,10 @@ function X3DCoreContext (element)
113
113
  this [_localStorage] = new DataStorage (localStorage, "X_ITE.X3DBrowser(" + this [_instanceId] + ").");
114
114
  this [_mobile] = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i .test (navigator .userAgent);
115
115
 
116
- this [_browserTimings] = new BrowserTimings (this .getPrivateScene ());
116
+ this [_renderingProperties] = new RenderingProperties (this .getPrivateScene ());
117
117
  this [_browserOptions] = new BrowserOptions (this .getPrivateScene ());
118
118
  this [_browserProperties] = new BrowserProperties (this .getPrivateScene ());
119
- this [_renderingProperties] = new RenderingProperties (this .getPrivateScene ());
119
+ this [_browserTimings] = new BrowserTimings (this .getPrivateScene ());
120
120
  this [_notification] = new Notification (this .getPrivateScene ());
121
121
  this [_contextMenu] = new ContextMenu (this .getPrivateScene ());
122
122
 
@@ -136,45 +136,53 @@ X3DCoreContext .prototype =
136
136
  {
137
137
  // Setup browser nodes.
138
138
 
139
- this [_browserTimings] .setup ();
139
+ this [_renderingProperties] .setup ();
140
140
  this [_browserOptions] .setup ();
141
141
  this [_browserProperties] .setup ();
142
- this [_renderingProperties] .setup ();
142
+ this [_browserTimings] .setup ();
143
143
  this [_notification] .setup ();
144
144
  this [_contextMenu] .setup ();
145
145
 
146
- // Define src and url property.
146
+ // Define properties of X3DCanvasElement.
147
147
 
148
- Object .defineProperty (this .getElement () .get (0), "src",
148
+ Object .defineProperties (this .getElement () .get (0),
149
149
  {
150
- get: () =>
151
- {
152
- return this .getExecutionContext () .getWorldURL ();
153
- },
154
- set: (value) =>
150
+ browser:
155
151
  {
156
- this .loadURL (new Fields .MFString (value), new Fields .MFString ());
152
+ value: this,
153
+ enumerable: true,
157
154
  },
158
- enumerable: true,
159
- });
160
-
161
- Object .defineProperty (this .getElement () .get (0), "url",
162
- {
163
- get: () =>
155
+ src:
164
156
  {
165
- return new Fields .MFString (this .getExecutionContext () .getWorldURL ());
157
+ get: () =>
158
+ {
159
+ return this .getExecutionContext () .getWorldURL ();
160
+ },
161
+ set: (value) =>
162
+ {
163
+ this .loadURL (new Fields .MFString (value), new Fields .MFString ());
164
+ },
165
+ enumerable: true,
166
166
  },
167
- set: (value) =>
167
+ url:
168
168
  {
169
- this .loadURL (value, new Fields .MFString ());
169
+ get: () =>
170
+ {
171
+ return new Fields .MFString (this .getExecutionContext () .getWorldURL ());
172
+ },
173
+ set: (value) =>
174
+ {
175
+ this .loadURL (value, new Fields .MFString ());
176
+ },
177
+ enumerable: true,
170
178
  },
171
- enumerable: true,
172
179
  });
173
180
 
174
181
  // Configure browser event handlers.
175
182
 
176
- this .getElement () .on ("keydown.X3DCoreContext", this [_keydown] .bind (this));
177
- this .getElement () .on ("keyup.X3DCoreContext", this [_keyup] .bind (this));
183
+ this .getElement ()
184
+ .on ("keydown.X3DCoreContext", this [_keydown] .bind (this))
185
+ .on ("keyup.X3DCoreContext", this [_keyup] .bind (this));
178
186
  },
179
187
  getInstanceId: function ()
180
188
  {
@@ -310,6 +318,21 @@ X3DCoreContext .prototype =
310
318
  this .setBrowserOption ("Notifications", this .parseBooleanAttribute (newValue, true));
311
319
  break;
312
320
  }
321
+ case "onerror":
322
+ case "oninitialized":
323
+ case "onshutdown":
324
+ {
325
+ try
326
+ {
327
+ this .getElement () [0] [name] = new Function ("event", newValue);
328
+ }
329
+ catch (error)
330
+ {
331
+ console .error (error);
332
+ }
333
+
334
+ break;
335
+ }
313
336
  case "splashScreen":
314
337
  case "splashscreen":
315
338
  {
@@ -325,7 +348,9 @@ X3DCoreContext .prototype =
325
348
  }
326
349
  case "src":
327
350
  {
328
- this .loadURL (new Fields .MFString (newValue), new Fields .MFString ());
351
+ if (newValue)
352
+ this .loadURL (new Fields .MFString (newValue), new Fields .MFString ());
353
+
329
354
  break;
330
355
  }
331
356
  case "timings":
@@ -335,7 +360,9 @@ X3DCoreContext .prototype =
335
360
  }
336
361
  case "url":
337
362
  {
338
- this .loadURL (this .parseUrlAttribute (newValue), new Fields .MFString ());
363
+ if (newValue)
364
+ this .loadURL (this .parseUrlAttribute (newValue), new Fields .MFString ());
365
+
339
366
  break;
340
367
  }
341
368
  }
@@ -358,13 +385,34 @@ X3DCoreContext .prototype =
358
385
 
359
386
  return url;
360
387
  },
361
- callBrowserEventHandler: function (events)
388
+ callBrowserEventHandler: (function ()
362
389
  {
363
- const element = this .getElement ();
390
+ const build_in = new Set (["error", "load"]);
364
391
 
365
- for (const event of events .split (" "))
366
- element .trigger (event);
367
- },
392
+ return function (events)
393
+ {
394
+ const element = this .getElement () [0];
395
+
396
+ for (const name of events .split (" "))
397
+ {
398
+ // Order is attribute, then dispatch.
399
+
400
+ const event = new CustomEvent (name);
401
+
402
+ try
403
+ {
404
+ if (!build_in .has (name))
405
+ element [`on${name}`] ?.(event);
406
+ }
407
+ catch (error)
408
+ {
409
+ console .error (error);
410
+ }
411
+
412
+ element .dispatchEvent (event);
413
+ }
414
+ };
415
+ })(),
368
416
  getShiftKey: function ()
369
417
  {
370
418
  return this ._shiftKey .getValue ();
@@ -320,7 +320,7 @@ const NURBS = {
320
320
  controlPoints = result || [ ],
321
321
  controlPointArray = controlPoint .getValue (),
322
322
  dimension = controlPoint .length,
323
- haveWeights = Boolean (weights),
323
+ haveWeights = !! weights,
324
324
  Vector = haveWeights ? Vector3 : Vector2;
325
325
 
326
326
  if (controlPoints .haveWeights !== haveWeights)
@@ -353,7 +353,7 @@ const NURBS = {
353
353
  const
354
354
  controlPoints = result || [ ],
355
355
  dimension = controlPointNode .getSize (),
356
- haveWeights = Boolean (weights),
356
+ haveWeights = !! weights,
357
357
  Vector = haveWeights ? Vector4 : Vector3;
358
358
 
359
359
  if (controlPoints .haveWeights !== haveWeights)
@@ -384,7 +384,7 @@ const NURBS = {
384
384
  {
385
385
  const
386
386
  controlPoints = result || [ ],
387
- haveWeights = Boolean (weights),
387
+ haveWeights = !! weights,
388
388
  Vector = haveWeights ? Vector4 : Vector3;
389
389
 
390
390
  if (controlPoints .haveWeights !== haveWeights)
@@ -160,7 +160,7 @@ X3DShadersContext .prototype =
160
160
  version = gl .getVersion ();
161
161
 
162
162
  const vertexShader = new ShaderPart (this .getPrivateScene ());
163
- vertexShader ._url .push (vs .startsWith ("data:") ? vs : "data:x-shader/x-vertex," + Shaders .vertex [version] [vs]);
163
+ vertexShader ._url .push (encodeURI (vs .startsWith ("data:") ? vs : "data:x-shader/x-vertex," + Shaders .vertex [version] [vs]));
164
164
  vertexShader .setPrivate (true);
165
165
  vertexShader .setName (name + "Vertex");
166
166
  vertexShader .setOptions (options);
@@ -168,7 +168,7 @@ X3DShadersContext .prototype =
168
168
 
169
169
  const fragmentShader = new ShaderPart (this .getPrivateScene ());
170
170
  fragmentShader ._type = "FRAGMENT";
171
- fragmentShader ._url .push (fs .startsWith ("data:") ? fs : "data:x-shader/x-fragment," + Shaders .fragment [version] [fs]);
171
+ fragmentShader ._url .push (encodeURI (fs .startsWith ("data:") ? fs : "data:x-shader/x-fragment," + Shaders .fragment [version] [fs]));
172
172
  fragmentShader .setPrivate (true);
173
173
  fragmentShader .setName (name + "Fragment");
174
174
  fragmentShader .setOptions (options);
@@ -52,9 +52,6 @@ import TextureQuality from "../Core/TextureQuality.js";
52
52
 
53
53
  const
54
54
  _maxTextures = Symbol (),
55
- _maxTextureSize = Symbol (),
56
- _maxCombinedTextureUnits = Symbol (),
57
- _textureMemory = Symbol (),
58
55
  _combinedTextureUnits = Symbol (),
59
56
  _texture2DUnits = Symbol (),
60
57
  _texture3DUnits = Symbol (),
@@ -89,13 +86,11 @@ X3DTexturingContext .prototype =
89
86
 
90
87
  gl .pixelStorei (gl .UNPACK_ALIGNMENT, 1);
91
88
 
92
- this [_maxTextureSize] = gl .getParameter (gl .MAX_TEXTURE_SIZE);
93
- this [_maxCombinedTextureUnits] = gl .getParameter (gl .MAX_COMBINED_TEXTURE_IMAGE_UNITS);
94
- this [_textureMemory] = NaN;
95
-
96
89
  // Get texture Units
97
90
 
98
- this [_combinedTextureUnits] = [...Array (this [_maxCombinedTextureUnits]) .keys ()];
91
+ const maxCombinedTextureUnits = gl .getParameter (gl .MAX_COMBINED_TEXTURE_IMAGE_UNITS);
92
+
93
+ this [_combinedTextureUnits] = [...Array (maxCombinedTextureUnits) .keys ()];
99
94
  this [_texture2DUnits] = [this [_combinedTextureUnits] .pop ()];
100
95
  this [_texture3DUnits] = [this [_combinedTextureUnits] .pop ()];
101
96
  this [_textureCubeUnits] = [this [_combinedTextureUnits] .pop ()];
@@ -160,11 +155,15 @@ X3DTexturingContext .prototype =
160
155
  },
161
156
  getMaxTextureSize: function ()
162
157
  {
163
- return this [_maxTextureSize];
158
+ const gl = this .getContext ();
159
+
160
+ return gl .getParameter (gl .MAX_TEXTURE_SIZE);
164
161
  },
165
162
  getMaxCombinedTextureUnits: function ()
166
163
  {
167
- return this [_maxCombinedTextureUnits];
164
+ const gl = this .getContext ();
165
+
166
+ return gl .getParameter (gl .MAX_COMBINED_TEXTURE_IMAGE_UNITS)
168
167
  },
169
168
  popTexture2DUnit: function ()
170
169
  {
@@ -253,7 +252,7 @@ X3DTexturingContext .prototype =
253
252
  },
254
253
  getTextureMemory: function ()
255
254
  {
256
- return this [_textureMemory];
255
+ return NaN;
257
256
  },
258
257
  getDefaultTextureProperties: function ()
259
258
  {
@@ -55,7 +55,7 @@ const
55
55
 
56
56
  function X3DTimeContext ()
57
57
  {
58
- this [_currentTime] = 0;
58
+ this [_currentTime] = Date .now () / 1000;
59
59
  this [_currentFrameRate] = 60;
60
60
  this [_currentPosition] = new Vector3 (0, 0, 0);
61
61
  this [_currentSpeed] = 0;
@@ -63,10 +63,6 @@ function X3DTimeContext ()
63
63
 
64
64
  X3DTimeContext .prototype =
65
65
  {
66
- initialize: function ()
67
- {
68
- this .advanceTime ();
69
- },
70
66
  getCurrentTime: function ()
71
67
  {
72
68
  return this [_currentTime];
@@ -45,4 +45,4 @@
45
45
  *
46
46
  ******************************************************************************/
47
47
 
48
- export default "8.6.23";
48
+ export default "8.7.0";