x_ite 8.6.11 → 8.6.12

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 (94) hide show
  1. package/dist/assets/components/Annotation.js +13 -13
  2. package/dist/assets/components/Annotation.min.js +1 -1
  3. package/dist/assets/components/CADGeometry.js +21 -45
  4. package/dist/assets/components/CADGeometry.min.js +1 -1
  5. package/dist/assets/components/CubeMapTexturing.js +25 -25
  6. package/dist/assets/components/CubeMapTexturing.min.js +1 -1
  7. package/dist/assets/components/DIS.js +13 -13
  8. package/dist/assets/components/DIS.min.js +1 -1
  9. package/dist/assets/components/EventUtilities.js +9 -9
  10. package/dist/assets/components/EventUtilities.min.js +1 -1
  11. package/dist/assets/components/Geometry2D.js +19 -19
  12. package/dist/assets/components/Geometry2D.min.js +1 -1
  13. package/dist/assets/components/Geospatial.js +33 -33
  14. package/dist/assets/components/Geospatial.min.js +1 -1
  15. package/dist/assets/components/HAnim.js +18 -18
  16. package/dist/assets/components/HAnim.min.js +1 -1
  17. package/dist/assets/components/KeyDeviceSensor.js +8 -8
  18. package/dist/assets/components/KeyDeviceSensor.min.js +1 -1
  19. package/dist/assets/components/Layout.js +48 -42
  20. package/dist/assets/components/Layout.min.js +1 -1
  21. package/dist/assets/components/NURBS.js +24 -24
  22. package/dist/assets/components/NURBS.min.js +1 -1
  23. package/dist/assets/components/ParticleSystems.js +136 -26
  24. package/dist/assets/components/ParticleSystems.min.js +1 -1
  25. package/dist/assets/components/Picking.js +132 -22
  26. package/dist/assets/components/Picking.min.js +1 -1
  27. package/dist/assets/components/RigidBodyPhysics.js +32 -76
  28. package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
  29. package/dist/assets/components/Scripting.js +28 -28
  30. package/dist/assets/components/Scripting.min.js +1 -1
  31. package/dist/assets/components/Text.js +24 -24
  32. package/dist/assets/components/Text.min.js +1 -1
  33. package/dist/assets/components/TextureProjector.js +14 -14
  34. package/dist/assets/components/TextureProjector.min.js +1 -1
  35. package/dist/assets/components/Texturing3D.js +30 -30
  36. package/dist/assets/components/Texturing3D.min.js +1 -1
  37. package/dist/assets/components/VolumeRendering.js +19 -19
  38. package/dist/assets/components/VolumeRendering.min.js +1 -1
  39. package/dist/assets/components/X_ITE.js +9 -9
  40. package/dist/assets/components/X_ITE.min.js +1 -1
  41. package/dist/x_ite.css +1 -1
  42. package/dist/x_ite.js +284 -359
  43. package/dist/x_ite.min.js +1 -1
  44. package/dist/x_ite.zip +0 -0
  45. package/docs/_config.yml +1 -1
  46. package/docs/_posts/components/Geometry3D/IndexedFaceSet.md +1 -1
  47. package/docs/_posts/components/Lighting/DirectionalLight.md +4 -4
  48. package/docs/_posts/components/Lighting/EnvironmentLight.md +4 -4
  49. package/docs/_posts/components/Lighting/PointLight.md +4 -4
  50. package/docs/_posts/components/Lighting/SpotLight.md +4 -4
  51. package/docs/_posts/components/Rendering/IndexedLineSet.md +1 -1
  52. package/docs/_posts/components/Rendering/IndexedTriangleFanSet.md +1 -1
  53. package/docs/_posts/components/RigidBodyPhysics/RigidBody.md +1 -1
  54. package/docs/_posts/components/RigidBodyPhysics/RigidBodyCollection.md +1 -1
  55. package/docs/_posts/components/RigidBodyPhysics/SingleAxisHingeJoint.md +1 -1
  56. package/docs/_posts/components/RigidBodyPhysics/SliderJoint.md +3 -3
  57. package/docs/_posts/components/X_ITE/BlendMode.md +1 -1
  58. package/docs/_posts/getting-started.md +8 -3
  59. package/docs/_posts/reference/browser-services.md +1 -1
  60. package/docs/_posts/reference/ecmascript-object-and-function-definitions.md +16 -99
  61. package/docs/_posts/what's-new.md +1 -1
  62. package/package.json +3 -3
  63. package/src/lib/jquery.js +6 -1
  64. package/src/standard/Math/Geometry/Box3.js +2 -5
  65. package/src/x_ite/Base/X3DBaseNode.js +8 -0
  66. package/src/x_ite/Base/X3DObject.js +14 -1
  67. package/src/x_ite/Browser/Core/BrowserOptions.js +27 -29
  68. package/src/x_ite/Browser/Core/BrowserTimings.js +2 -16
  69. package/src/x_ite/Browser/Core/X3DCoreContext.js +5 -0
  70. package/src/x_ite/Browser/Navigation/X3DFlyViewer.js +3 -3
  71. package/src/x_ite/Browser/Networking/X3DNetworkingContext.js +20 -15
  72. package/src/x_ite/Browser/PointingDeviceSensor/PointingDevice.js +3 -3
  73. package/src/x_ite/Browser/VERSION.js +1 -1
  74. package/src/x_ite/Browser/X3DBrowser.js +2 -2
  75. package/src/x_ite/Browser/X3DBrowserContext.js +21 -12
  76. package/src/x_ite/Components/CADGeometry/CADFace.js +8 -32
  77. package/src/x_ite/Components/Core/X3DNode.js +1 -1
  78. package/src/x_ite/Components/Core/X3DPrototypeInstance.js +1 -1
  79. package/src/x_ite/Components/Grouping/StaticGroup.js +19 -0
  80. package/src/x_ite/Components/Grouping/Switch.js +7 -25
  81. package/src/x_ite/Components/Grouping/X3DBoundedObject.js +0 -1
  82. package/src/x_ite/Components/Layout/Layout.js +12 -10
  83. package/src/x_ite/Components/Layout/LayoutGroup.js +9 -5
  84. package/src/x_ite/Components/Navigation/LOD.js +7 -25
  85. package/src/x_ite/Components/Navigation/X3DViewpointNode.js +1 -1
  86. package/src/x_ite/Components/Rendering/X3DLineGeometryNode.js +15 -8
  87. package/src/x_ite/Components/RigidBodyPhysics/CollidableOffset.js +7 -29
  88. package/src/x_ite/Components/RigidBodyPhysics/CollidableShape.js +7 -29
  89. package/src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js +3 -8
  90. package/src/x_ite/Components/Shape/Shape.js +0 -5
  91. package/src/x_ite/Components/Shape/X3DShapeNode.js +21 -17
  92. package/src/x_ite/Fields/SFNode.js +8 -0
  93. package/src/x_ite/{X3DCanvas.js → X3DCanvasElement.js} +23 -4
  94. package/src/x_ite.js +4 -4
@@ -46,6 +46,7 @@
46
46
  ******************************************************************************/
47
47
 
48
48
  import X3DGeometryNode from "./X3DGeometryNode.js";
49
+ import VertexArray from "../../Rendering/VertexArray.js";
49
50
  import ViewVolume from "../../../standard/Math/Geometry/ViewVolume.js";
50
51
  import Vector2 from "../../../standard/Math/Numbers/Vector2.js";
51
52
  import Vector4 from "../../../standard/Math/Numbers/Vector4.js";
@@ -60,9 +61,10 @@ function X3DLineGeometryNode (executionContext)
60
61
  browser = this .getBrowser (),
61
62
  gl = browser .getContext ();
62
63
 
63
- this .lineStipples = new Float32Array ();
64
- this .lineStippleBuffer = gl .createBuffer ();
65
- this .trianglesBuffer = gl .createBuffer ();
64
+ this .lineStipples = new Float32Array ();
65
+ this .lineStippleBuffer = gl .createBuffer ();
66
+ this .trianglesBuffer = gl .createBuffer ();
67
+ this .thickVertexArrayObject = new VertexArray (gl);
66
68
 
67
69
  this .setGeometryType (1);
68
70
  this .setPrimitiveMode (gl .LINES);
@@ -80,6 +82,12 @@ X3DLineGeometryNode .prototype = Object .assign (Object .create (X3DGeometryNode
80
82
  {
81
83
  return false;
82
84
  },
85
+ updateVertexArrays: function ()
86
+ {
87
+ X3DGeometryNode .prototype .updateVertexArrays .call (this);
88
+
89
+ this .thickVertexArrayObject .update ();
90
+ },
83
91
  buildTexCoords: function ()
84
92
  {
85
93
  // Line stipple support.
@@ -91,8 +99,7 @@ X3DLineGeometryNode .prototype = Object .assign (Object .create (X3DGeometryNode
91
99
  gl = this .getBrowser () .getContext (),
92
100
  numLines = this .getVertices () .length / 8;
93
101
 
94
- if (this .lineStipples .length !== numLines * 6)
95
- this .lineStipples = new Float32Array (numLines * 6);
102
+ this .lineStipples = new Float32Array (numLines * 6);
96
103
 
97
104
  gl .bindBuffer (gl .ARRAY_BUFFER, this .lineStippleBuffer);
98
105
  gl .bufferData (gl .ARRAY_BUFFER, this .lineStipples, gl .DYNAMIC_DRAW);
@@ -154,7 +161,7 @@ X3DLineGeometryNode .prototype = Object .assign (Object .create (X3DGeometryNode
154
161
  {
155
162
  // Setup vertex attributes.
156
163
 
157
- if (this .vertexArrayObject .enable (shaderNode))
164
+ if (this .thickVertexArrayObject .enable (shaderNode))
158
165
  {
159
166
  const
160
167
  stride = 15 * Float32Array .BYTES_PER_ELEMENT,
@@ -239,7 +246,7 @@ X3DLineGeometryNode .prototype = Object .assign (Object .create (X3DGeometryNode
239
246
 
240
247
  // Setup vertex attributes.
241
248
 
242
- if (this .vertexArrayObject .enable (transformShaderNode))
249
+ if (this .thickVertexArrayObject .enable (transformShaderNode))
243
250
  {
244
251
  const
245
252
  lineStippleStride = 6 * Float32Array .BYTES_PER_ELEMENT,
@@ -315,7 +322,7 @@ X3DLineGeometryNode .prototype = Object .assign (Object .create (X3DGeometryNode
315
322
 
316
323
  // Setup vertex attributes.
317
324
 
318
- if (this .vertexArrayObject .enable (shaderNode))
325
+ if (this .thickVertexArrayObject .enable (shaderNode))
319
326
  {
320
327
  const
321
328
  stride = 15 * Float32Array .BYTES_PER_ELEMENT,
@@ -100,14 +100,7 @@ CollidableOffset .prototype = Object .assign (Object .create (X3DNBodyCollidable
100
100
  getBBox: function (bbox, shadows)
101
101
  {
102
102
  if (this ._bboxSize .getValue () .equals (this .getDefaultBBoxSize ()))
103
- {
104
- const boundedObject = this .visibleNode;
105
-
106
- if (boundedObject)
107
- return boundedObject .getBBox (bbox, shadows);
108
-
109
- return bbox .set ();
110
- }
103
+ return this .visibleNode?.getBBox (bbox, shadows) .multRight (this .getMatrix ()) ?? bbox .set ();
111
104
 
112
105
  return bbox .set (this ._bboxSize .getValue (), this ._bboxCenter .getValue ());
113
106
  },
@@ -157,7 +150,7 @@ CollidableOffset .prototype = Object .assign (Object .create (X3DNBodyCollidable
157
150
  },
158
151
  set_cameraObject__: function ()
159
152
  {
160
- this .setCameraObject (!!(this .visibleNode && this .visibleNode .isCameraObject ()));
153
+ this .setCameraObject (!!this .visibleNode?.isCameraObject ());
161
154
  },
162
155
  set_visible__: function ()
163
156
  {
@@ -198,10 +191,7 @@ CollidableOffset .prototype = Object .assign (Object .create (X3DNBodyCollidable
198
191
  modelViewMatrix .push ();
199
192
  modelViewMatrix .multLeft (this .getMatrix ());
200
193
 
201
- const visibleNode = this .visibleNode;
202
-
203
- if (visibleNode)
204
- visibleNode .traverse (type, renderObject);
194
+ this .visibleNode?.traverse (type, renderObject);
205
195
 
206
196
  modelViewMatrix .pop ();
207
197
  return;
@@ -217,10 +207,7 @@ CollidableOffset .prototype = Object .assign (Object .create (X3DNBodyCollidable
217
207
  modelViewMatrix .push ();
218
208
  modelViewMatrix .multLeft (this .getMatrix ());
219
209
 
220
- const visibleNode = this .visibleNode;
221
-
222
- if (visibleNode)
223
- visibleNode .traverse (type, renderObject);
210
+ this .visibleNode?.traverse (type, renderObject);
224
211
 
225
212
  modelViewMatrix .pop ();
226
213
  pickingHierarchy .pop ();
@@ -233,10 +220,7 @@ CollidableOffset .prototype = Object .assign (Object .create (X3DNBodyCollidable
233
220
  modelViewMatrix .push ();
234
221
  modelViewMatrix .multLeft (this .getMatrix ());
235
222
 
236
- const visibleNode = this .visibleNode;
237
-
238
- if (visibleNode)
239
- visibleNode .traverse (type, renderObject);
223
+ this .visibleNode?.traverse (type, renderObject);
240
224
 
241
225
  modelViewMatrix .pop ();
242
226
  break;
@@ -248,15 +232,9 @@ CollidableOffset .prototype = Object .assign (Object .create (X3DNBodyCollidable
248
232
  modelViewMatrix .push ();
249
233
  modelViewMatrix .multLeft (this .getMatrix ());
250
234
 
251
- const visibleNode = this .visibleNode;
252
-
253
- if (visibleNode)
254
- visibleNode .traverse (type, renderObject);
255
-
256
- const boundedObject = this .boundedObject;
235
+ this .visibleNode?.traverse (type, renderObject);
257
236
 
258
- if (boundedObject)
259
- boundedObject .displayBBox (type, renderObject);
237
+ this .boundedObject?.displayBBox (type, renderObject);
260
238
 
261
239
  modelViewMatrix .pop ();
262
240
  return;
@@ -107,14 +107,7 @@ CollidableShape .prototype = Object .assign (Object .create (X3DNBodyCollidableN
107
107
  getBBox: function (bbox, shadows)
108
108
  {
109
109
  if (this ._bboxSize .getValue () .equals (this .getDefaultBBoxSize ()))
110
- {
111
- const boundedObject = this .visibleNode;
112
-
113
- if (boundedObject)
114
- return boundedObject .getBBox (bbox, shadows);
115
-
116
- return bbox .set ();
117
- }
110
+ return this .visibleNode?.getBBox (bbox, shadows) .multRight (this .getMatrix ()) ?? bbox .set ();
118
111
 
119
112
  return bbox .set (this ._bboxSize .getValue (), this ._bboxCenter .getValue ());
120
113
  },
@@ -222,7 +215,7 @@ CollidableShape .prototype = Object .assign (Object .create (X3DNBodyCollidableN
222
215
  },
223
216
  set_cameraObject__: function ()
224
217
  {
225
- this .setCameraObject (!!(this .visibleNode && this .visibleNode .isCameraObject ()));
218
+ this .setCameraObject (!!this .visibleNode?.isCameraObject ());
226
219
  },
227
220
  set_visible__: function ()
228
221
  {
@@ -428,10 +421,7 @@ CollidableShape .prototype = Object .assign (Object .create (X3DNBodyCollidableN
428
421
  modelViewMatrix .push ();
429
422
  modelViewMatrix .multLeft (this .getMatrix ());
430
423
 
431
- const visibleNode = this .visibleNode;
432
-
433
- if (visibleNode)
434
- visibleNode .traverse (type, renderObject);
424
+ this .visibleNode?.traverse (type, renderObject);
435
425
 
436
426
  modelViewMatrix .pop ();
437
427
  return;
@@ -447,10 +437,7 @@ CollidableShape .prototype = Object .assign (Object .create (X3DNBodyCollidableN
447
437
  modelViewMatrix .push ();
448
438
  modelViewMatrix .multLeft (this .getMatrix ());
449
439
 
450
- const visibleNode = this .visibleNode;
451
-
452
- if (visibleNode)
453
- visibleNode .traverse (type, renderObject);
440
+ this .visibleNode?.traverse (type, renderObject);
454
441
 
455
442
  modelViewMatrix .pop ();
456
443
  pickingHierarchy .pop ();
@@ -463,10 +450,7 @@ CollidableShape .prototype = Object .assign (Object .create (X3DNBodyCollidableN
463
450
  modelViewMatrix .push ();
464
451
  modelViewMatrix .multLeft (this .getMatrix ());
465
452
 
466
- const visibleNode = this .visibleNode;
467
-
468
- if (visibleNode)
469
- visibleNode .traverse (type, renderObject);
453
+ this .visibleNode?.traverse (type, renderObject);
470
454
 
471
455
  modelViewMatrix .pop ();
472
456
  return;
@@ -478,15 +462,9 @@ CollidableShape .prototype = Object .assign (Object .create (X3DNBodyCollidableN
478
462
  modelViewMatrix .push ();
479
463
  modelViewMatrix .multLeft (this .getMatrix ());
480
464
 
481
- const visibleNode = this .visibleNode;
482
-
483
- if (visibleNode)
484
- visibleNode .traverse (type, renderObject);
485
-
486
- const boundedObject = this .boundedObject;
465
+ this .visibleNode?.traverse (type, renderObject);
487
466
 
488
- if (boundedObject)
489
- boundedObject .displayBBox (type, renderObject);
467
+ this .boundedObject?.displayBBox (type, renderObject);
490
468
 
491
469
  modelViewMatrix .pop ();
492
470
  return;
@@ -306,13 +306,13 @@ X3DProgrammableShaderObject .prototype =
306
306
 
307
307
  if (attribute < 0)
308
308
  {
309
- this [`enable${name}Attribute`] = Function .prototype;
310
- this [`${lcfirst (name)}AttributeDivisor`] = Function .prototype;
309
+ this [`enable${name}Attribute`] = Function .prototype;
310
+ this [`${$.toLowerCaseFirst (name)}AttributeDivisor`] = Function .prototype;
311
311
  }
312
312
  else
313
313
  {
314
314
  delete this [`enable${name}Attribute`];
315
- delete this [`${lcfirst (name)}AttributeDivisor`];
315
+ delete this [`${$.toLowerCaseFirst (name)}AttributeDivisor`];
316
316
  }
317
317
  }
318
318
 
@@ -1322,9 +1322,4 @@ X3DProgrammableShaderObject .prototype =
1322
1322
  dispose: function () { },
1323
1323
  };
1324
1324
 
1325
- function lcfirst (string)
1326
- {
1327
- return string [0] .toLowerCase () + string .slice (1);
1328
- }
1329
-
1330
1325
  export default X3DProgrammableShaderObject;
@@ -51,11 +51,6 @@ import FieldDefinitionArray from "../../Base/FieldDefinitionArray.js";
51
51
  import X3DShapeNode from "./X3DShapeNode.js";
52
52
  import TraverseType from "../../Rendering/TraverseType.js";
53
53
  import X3DConstants from "../../Base/X3DConstants.js";
54
- import Algorithm from "../../../standard/Math/Algorithm.js";
55
- import Vector3 from "../../../standard/Math/Numbers/Vector3.js";
56
- import Matrix4 from "../../../standard/Math/Numbers/Matrix4.js";
57
- import Line3 from "../../../standard/Math/Geometry/Line3.js";
58
- import QuickSort from "../../../standard/Math/Algorithms/QuickSort.js";
59
54
 
60
55
  function Shape (executionContext)
61
56
  {
@@ -74,15 +74,15 @@ X3DShapeNode .prototype = Object .assign (Object .create (X3DChildNode .prototyp
74
74
  X3DChildNode .prototype .initialize .call (this);
75
75
  X3DBoundedObject .prototype .initialize .call (this);
76
76
 
77
- this ._bboxSize .addInterest ("set_bbox__", this);
78
- this ._bboxCenter .addInterest ("set_bbox__", this);
79
- this ._appearance .addInterest ("set_apparance__", this);
80
- this ._geometry .addInterest ("set_geometry__", this);
77
+ this ._bboxSize .addInterest ("set_bbox__", this);
78
+ this ._bboxCenter .addInterest ("set_bbox__", this);
79
+ this ._appearance .addInterest ("set_appearance__", this);
80
+ this ._geometry .addInterest ("set_geometry__", this);
81
81
 
82
82
  this ._appearance .addInterest ("set_transparent__", this);
83
83
  this ._geometry .addInterest ("set_transparent__", this);
84
84
 
85
- this .set_apparance__ ();
85
+ this .set_appearance__ ();
86
86
  this .set_geometry__ ();
87
87
  this .set_transparent__ ();
88
88
  },
@@ -110,7 +110,7 @@ X3DShapeNode .prototype = Object .assign (Object .create (X3DChildNode .prototyp
110
110
  },
111
111
  getAppearance: function ()
112
112
  {
113
- return this .apparanceNode;
113
+ return this .appearanceNode;
114
114
  },
115
115
  getGeometry: function ()
116
116
  {
@@ -135,25 +135,29 @@ X3DShapeNode .prototype = Object .assign (Object .create (X3DChildNode .prototyp
135
135
  this .bbox .set ();
136
136
  }
137
137
  else
138
+ {
138
139
  this .bbox .set (this ._bboxSize .getValue (), this ._bboxCenter .getValue ());
140
+ }
139
141
 
140
142
  this .bboxSize .assign (this .bbox .size);
141
143
  this .bboxCenter .assign (this .bbox .center);
142
144
  },
143
- set_apparance__: function ()
145
+ set_appearance__: function ()
144
146
  {
145
- if (this .apparanceNode)
146
- this .apparanceNode ._transparent .removeInterest ("set_transparent__", this);
147
+ if (this .appearanceNode)
148
+ this .appearanceNode ._transparent .removeInterest ("set_transparent__", this);
147
149
 
148
- this .apparanceNode = X3DCast (X3DConstants .X3DAppearanceNode, this ._appearance);
150
+ this .appearanceNode = X3DCast (X3DConstants .X3DAppearanceNode, this ._appearance);
149
151
 
150
- if (this .apparanceNode)
152
+ if (this .appearanceNode)
151
153
  {
152
- this .apparanceNode ._alphaMode .addInterest ("set_transparent__", this);
153
- this .apparanceNode ._transparent .addInterest ("set_transparent__", this);
154
+ this .appearanceNode ._alphaMode .addInterest ("set_transparent__", this);
155
+ this .appearanceNode ._transparent .addInterest ("set_transparent__", this);
154
156
  }
155
157
  else
156
- this .apparanceNode = this .getBrowser () .getDefaultAppearance ();
158
+ {
159
+ this .appearanceNode = this .getBrowser () .getDefaultAppearance ();
160
+ }
157
161
  },
158
162
  set_geometry__: function ()
159
163
  {
@@ -175,13 +179,13 @@ X3DShapeNode .prototype = Object .assign (Object .create (X3DChildNode .prototyp
175
179
  },
176
180
  set_transparent__: function ()
177
181
  {
178
- if (this .apparanceNode .getAlphaMode () === AlphaMode .AUTO)
182
+ if (this .appearanceNode .getAlphaMode () === AlphaMode .AUTO)
179
183
  {
180
- this .transparent = !!(this .apparanceNode .isTransparent () || this .geometryNode?.isTransparent ());
184
+ this .transparent = !!(this .appearanceNode .isTransparent () || this .geometryNode?.isTransparent ());
181
185
  }
182
186
  else
183
187
  {
184
- this .transparent = this .apparanceNode .isTransparent ();
188
+ this .transparent = this .appearanceNode .isTransparent ();
185
189
  }
186
190
  },
187
191
  dispose: function ()
@@ -361,6 +361,14 @@ SFNode .prototype = Object .assign (Object .create (X3DField .prototype),
361
361
  if (value)
362
362
  value .removeCloneCount (count);
363
363
  },
364
+ getNodeUserData: function (key)
365
+ {
366
+ return this [_target] .getValue () .getUserData (key);
367
+ },
368
+ setNodeUserData: function (key, value)
369
+ {
370
+ this [_target] .getValue () .setUserData (key, value);
371
+ },
364
372
  valueOf: function ()
365
373
  {
366
374
  const
@@ -48,11 +48,11 @@
48
48
  import X3DBrowser from "./Browser/X3DBrowser.js";
49
49
  import URLs from "./Browser/Networking/URLs.js";
50
50
 
51
- class X3DCanvas extends HTMLElement
51
+ class X3DCanvasElement extends HTMLElement
52
52
  {
53
53
  static define ()
54
54
  {
55
- customElements .define ("x3d-canvas", X3DCanvas);
55
+ customElements .define ("x3d-canvas", X3DCanvasElement);
56
56
  }
57
57
 
58
58
  constructor ()
@@ -76,7 +76,10 @@ class X3DCanvas extends HTMLElement
76
76
 
77
77
  shadow .appendChild (link);
78
78
 
79
- this .browser = new X3DBrowser (this);
79
+ Object .defineProperty (this, "browser",
80
+ {
81
+ value: new X3DBrowser (this),
82
+ })
80
83
  }
81
84
 
82
85
  connectedCallback ()
@@ -99,6 +102,7 @@ class X3DCanvas extends HTMLElement
99
102
  "splashScreen",
100
103
  "splashscreen",
101
104
  "src",
105
+ "timings",
102
106
  "url",
103
107
  ];
104
108
  }
@@ -107,9 +111,24 @@ class X3DCanvas extends HTMLElement
107
111
  {
108
112
  this .browser .attributeChangedCallback (name, oldValue, newValue);
109
113
  }
114
+
115
+ captureStream (... args)
116
+ {
117
+ return this .browser .getCanvas () [0] .captureStream (... args);
118
+ }
119
+
120
+ toBlob (... args)
121
+ {
122
+ return this .browser .getCanvas () [0] .toBlob (... args);
123
+ }
124
+
125
+ toDataURL (... args)
126
+ {
127
+ return this .browser .getCanvas () [0] .toDataURL (... args);
128
+ }
110
129
  }
111
130
 
112
131
  // IE fix.
113
132
  document .createElement ("X3DCanvas");
114
133
 
115
- export default X3DCanvas;
134
+ export default X3DCanvasElement;
package/src/x_ite.js CHANGED
@@ -45,15 +45,15 @@
45
45
  *
46
46
  ******************************************************************************/
47
47
 
48
- import X3D from "./x_ite/X3D.js";
49
- import X3DCanvas from "./x_ite/X3DCanvas.js";
50
- import shim from "./shim.js";
48
+ import X3D from "./x_ite/X3D.js";
49
+ import X3DCanvasElement from "./x_ite/X3DCanvasElement.js";
50
+ import shim from "./shim.js";
51
51
 
52
52
  // Assign X3D to global namespace.
53
53
 
54
54
  window [Symbol .for ("X_ITE.X3D")] = X3D;
55
55
 
56
- X3DCanvas .define ();
56
+ X3DCanvasElement .define ();
57
57
 
58
58
  X3D ();
59
59