x_ite 8.10.1 → 8.11.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 (137) hide show
  1. package/Makefile +3 -0
  2. package/build/bin/version.pl +28 -20
  3. package/build/docs/glTF-samples.pl +151 -0
  4. package/build/docs/nodes.pl +1 -1
  5. package/build/src/nodes.pl +41 -0
  6. package/dist/assets/components/Annotation.js +13 -13
  7. package/dist/assets/components/Annotation.min.js +1 -1
  8. package/dist/assets/components/CADGeometry.js +13 -13
  9. package/dist/assets/components/CADGeometry.min.js +1 -1
  10. package/dist/assets/components/CubeMapTexturing.js +30 -26
  11. package/dist/assets/components/CubeMapTexturing.min.js +1 -1
  12. package/dist/assets/components/DIS.js +14 -14
  13. package/dist/assets/components/DIS.min.js +1 -1
  14. package/dist/assets/components/EventUtilities.js +9 -9
  15. package/dist/assets/components/EventUtilities.min.js +1 -1
  16. package/dist/assets/components/Geometry2D.js +19 -19
  17. package/dist/assets/components/Geometry2D.min.js +1 -1
  18. package/dist/assets/components/Geospatial.js +33 -33
  19. package/dist/assets/components/Geospatial.min.js +1 -1
  20. package/dist/assets/components/HAnim.js +394 -30
  21. package/dist/assets/components/HAnim.min.js +1 -1
  22. package/dist/assets/components/KeyDeviceSensor.js +8 -8
  23. package/dist/assets/components/KeyDeviceSensor.min.js +1 -1
  24. package/dist/assets/components/Layout.js +26 -26
  25. package/dist/assets/components/Layout.min.js +1 -1
  26. package/dist/assets/components/NURBS.js +24 -24
  27. package/dist/assets/components/NURBS.min.js +1 -1
  28. package/dist/assets/components/ParticleSystems.js +73 -74
  29. package/dist/assets/components/ParticleSystems.min.js +1 -1
  30. package/dist/assets/components/Picking.js +18 -18
  31. package/dist/assets/components/Picking.min.js +1 -1
  32. package/dist/assets/components/RigidBodyPhysics.js +18 -18
  33. package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
  34. package/dist/assets/components/Scripting.js +37 -37
  35. package/dist/assets/components/Scripting.min.js +1 -1
  36. package/dist/assets/components/Text.js +55 -63
  37. package/dist/assets/components/Text.min.js +1 -1
  38. package/dist/assets/components/TextureProjector.js +14 -14
  39. package/dist/assets/components/TextureProjector.min.js +1 -1
  40. package/dist/assets/components/Texturing3D.js +35 -31
  41. package/dist/assets/components/Texturing3D.min.js +1 -1
  42. package/dist/assets/components/VolumeRendering.js +20 -20
  43. package/dist/assets/components/VolumeRendering.min.js +1 -1
  44. package/dist/assets/components/X_ITE.js +9 -9
  45. package/dist/assets/components/X_ITE.min.js +1 -1
  46. package/dist/x_ite.css +1 -1
  47. package/dist/x_ite.js +1456 -844
  48. package/dist/x_ite.min.js +1 -1
  49. package/dist/x_ite.zip +0 -0
  50. package/docs/_config.yml +2 -2
  51. package/docs/_posts/components/Core/MetadataBoolean.md +6 -4
  52. package/docs/_posts/components/Core/MetadataDouble.md +6 -4
  53. package/docs/_posts/components/Core/MetadataFloat.md +6 -4
  54. package/docs/_posts/components/Core/MetadataInteger.md +6 -4
  55. package/docs/_posts/components/Core/MetadataSet.md +6 -4
  56. package/docs/_posts/components/Core/MetadataString.md +6 -4
  57. package/docs/_posts/components/DIS/DISEntityTypeMapping.md +1 -1
  58. package/docs/_posts/components/HAnim/HAnimMotion.md +48 -48
  59. package/docs/_posts/components/RigidBodyPhysics/Contact.md +1 -1
  60. package/docs/_posts/getting-started.md +45 -35
  61. package/docs/_posts/reference/browser-services.md +6 -0
  62. package/docs/_tabs/playground.html +215 -15
  63. package/docs/assets/css/style.scss +35 -2
  64. package/docs/assets/js/example.js +95 -3
  65. package/docs/laboratory/gltf-sample-viewer.html +603 -235
  66. package/package.json +2 -2
  67. package/src/assets/shaders/Types.glsl.js +4 -0
  68. package/src/assets/shaders/webgl1/include/Hatch.glsl.js +2 -3
  69. package/src/assets/shaders/webgl2/Compose.fs.js +29 -0
  70. package/src/assets/shaders/webgl2/Compose.vs.js +14 -0
  71. package/src/assets/shaders/webgl2/include/Fragment.glsl.js +24 -2
  72. package/src/assets/shaders/webgl2/include/Hatch.glsl.js +2 -3
  73. package/src/assets/shaders/webgl2/include/Stipple.glsl.js +5 -3
  74. package/src/bookmarks.js +92 -5
  75. package/src/examples.js +1 -0
  76. package/src/standard/Math/Numbers/Quaternion.js +191 -13
  77. package/src/standard/Math/Numbers/Rotation4.js +23 -0
  78. package/src/standard/Time/{MicroTime.js → Time.js} +21 -28
  79. package/src/x_ite/Base/X3DChildObject.js +5 -4
  80. package/src/x_ite/Browser/Core/BrowserOptions.js +71 -60
  81. package/src/x_ite/Browser/Core/Context.js +2 -2
  82. package/src/x_ite/Browser/Core/X3DCoreContext.js +6 -0
  83. package/src/x_ite/Browser/DOMIntegration.js +0 -17
  84. package/src/x_ite/Browser/Navigation/ExamineViewer.js +5 -4
  85. package/src/x_ite/Browser/Navigation/X3DFlyViewer.js +7 -4
  86. package/src/x_ite/Browser/Rendering/X3DRenderingContext.js +20 -15
  87. package/src/x_ite/Browser/Shaders/Shaders.js +19 -15
  88. package/src/x_ite/Browser/Text/X3DTextContext.js +16 -16
  89. package/src/x_ite/Browser/Time/X3DTimeContext.js +3 -2
  90. package/src/x_ite/Browser/VERSION.js +1 -1
  91. package/src/x_ite/Browser/VolumeRendering/VolumeMaterial.js +2 -2
  92. package/src/x_ite/Browser/X3DBrowser.js +1 -2
  93. package/src/x_ite/Browser/X3DBrowserContext.js +0 -5
  94. package/src/x_ite/Components/Core/MetadataBoolean.js +8 -1
  95. package/src/x_ite/Components/Core/MetadataDouble.js +8 -1
  96. package/src/x_ite/Components/Core/MetadataFloat.js +8 -1
  97. package/src/x_ite/Components/Core/MetadataInteger.js +8 -1
  98. package/src/x_ite/Components/Core/MetadataSet.js +8 -1
  99. package/src/x_ite/Components/Core/MetadataString.js +8 -1
  100. package/src/x_ite/Components/Core/X3DPrototypeInstance.js +9 -6
  101. package/src/x_ite/Components/CubeMapTexturing/ImageCubeMapTexture.js +2 -1
  102. package/src/x_ite/Components/DIS/DISEntityTypeMapping.js +1 -1
  103. package/src/x_ite/Components/EnvironmentalEffects/X3DBackgroundNode.js +5 -1
  104. package/src/x_ite/Components/Grouping/X3DGroupingNode.js +2 -0
  105. package/src/x_ite/Components/HAnim/HAnimHumanoid.js +34 -2
  106. package/src/x_ite/Components/HAnim/HAnimMotion.js +331 -15
  107. package/src/x_ite/Components/Lighting/DirectionalLight.js +1 -3
  108. package/src/x_ite/Components/Lighting/PointLight.js +1 -3
  109. package/src/x_ite/Components/Lighting/SpotLight.js +1 -3
  110. package/src/x_ite/Components/Networking/X3DUrlObject.js +5 -4
  111. package/src/x_ite/Components/ParticleSystems/ParticleSystem.js +47 -51
  112. package/src/x_ite/Components/Rendering/X3DGeometryNode.js +4 -2
  113. package/src/x_ite/Components/RigidBodyPhysics/Contact.js +1 -1
  114. package/src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js +1 -1
  115. package/src/x_ite/Components/Shape/FillProperties.js +4 -0
  116. package/src/x_ite/Components/Shape/LineProperties.js +4 -0
  117. package/src/x_ite/Components/Shape/PointProperties.js +4 -0
  118. package/src/x_ite/Components/Shape/X3DMaterialNode.js +44 -20
  119. package/src/x_ite/Components/Sound/AudioClip.js +2 -1
  120. package/src/x_ite/Components/Text/X3DFontStyleNode.js +13 -23
  121. package/src/x_ite/Components/Texturing/ImageTexture.js +2 -1
  122. package/src/x_ite/Components/Texturing/MovieTexture.js +2 -1
  123. package/src/x_ite/Components/Texturing3D/ImageTextureAtlas.js +2 -1
  124. package/src/x_ite/Components/Time/TimeSensor.js +25 -24
  125. package/src/x_ite/Components/Time/X3DTimeDependentNode.js +5 -4
  126. package/src/x_ite/Execution/BindableList.js +3 -3
  127. package/src/x_ite/Execution/X3DScene.js +2 -0
  128. package/src/x_ite/Parser/XMLParser.js +12 -2
  129. package/src/x_ite/Rendering/MultiSampleFrameBuffer.js +264 -26
  130. package/src/x_ite/Rendering/PointingBuffer.js +5 -7
  131. package/src/x_ite/Rendering/TextureBuffer.js +6 -14
  132. package/src/x_ite/Rendering/X3DRenderObject.js +28 -28
  133. package/src/x_ite/X3D.js +0 -1
  134. package/src/x_ite/X3DCanvasElement.js +2 -0
  135. package/src/x_ite.html +23 -24
  136. package/x_ite.min.html +23 -24
  137. /package/build/{bin → docs}/tags.pl +0 -0
@@ -46,6 +46,7 @@
46
46
  ******************************************************************************/
47
47
 
48
48
  import X3DObject from "./X3DObject.js";
49
+ import Time from "../../standard/Time/Time.js";
49
50
  import DEVELOPMENT from "../DEVELOPMENT.js";
50
51
 
51
52
  const
@@ -97,14 +98,14 @@ if (DEVELOPMENT)
97
98
  },
98
99
  addEvent ()
99
100
  {
100
- this .setModificationTime (Date .now ());
101
+ this .setModificationTime (Time .now ());
101
102
 
102
103
  for (const parent of this [_parents] .values ())
103
104
  parent .deref () ?.addEvent (this);
104
105
  },
105
106
  addEventObject (field, event)
106
107
  {
107
- this .setModificationTime (Date .now ());
108
+ this .setModificationTime (Time .now ());
108
109
 
109
110
  for (const parent of this [_parents] .values ())
110
111
  parent .deref () ?.addEventObject (this, event);
@@ -204,14 +205,14 @@ else
204
205
  },
205
206
  addEvent ()
206
207
  {
207
- this .setModificationTime (Date .now ());
208
+ this .setModificationTime (Time .now ());
208
209
 
209
210
  for (const parent of this [_parents])
210
211
  parent .addEvent (this);
211
212
  },
212
213
  addEventObject (field, event)
213
214
  {
214
- this .setModificationTime (Date .now ());
215
+ this .setModificationTime (Time .now ());
215
216
 
216
217
  for (const parent of this [_parents])
217
218
  parent .addEventObject (this, event);
@@ -83,27 +83,29 @@ Object .assign (Object .setPrototypeOf (BrowserOptions .prototype, X3DBaseNode .
83
83
  Timings: this ._Timings .getValue (),
84
84
  });
85
85
 
86
- this ._Rubberband .addInterest ("set_rubberband__", this);
87
- this ._Antialiased .addInterest ("set_antialiased__", this);
88
- this ._PrimitiveQuality .addInterest ("set_primitiveQuality__", this);
89
- this ._TextureQuality .addInterest ("set_textureQuality__", this);
90
- this ._Shading .addInterest ("set_shading__", this);
91
- this ._StraightenHorizon .addInterest ("set_straightenHorizon__", this);
92
- this ._AutoUpdate .addInterest ("set_autoUpdate__", this);
93
- this ._ContentScale .addInterest ("set_contentScale__", this);
94
- this ._LogarithmicDepthBuffer .addInterest ("set_logarithmicDepthBuffer__", this);
95
- this ._Multisampling .addInterest ("set_multisampling__", this);
96
- this ._Timings .addInterest ("set_timings__", this);
97
-
98
- this .set_antialiased__ (this ._Antialiased);
99
- this .set_shading__ (this ._Shading);
100
- this .set_contentScale__ (this ._ContentScale);
101
- this .set_logarithmicDepthBuffer__ (this ._LogarithmicDepthBuffer);
102
- this .set_multisampling__ (this ._Multisampling);
103
-
104
- this .configure ();
86
+ this ._Rubberband .addInterest ("set_rubberband__", this);
87
+ this ._Antialiased .addInterest ("set_antialiased__", this);
88
+ this ._PrimitiveQuality .addInterest ("set_primitiveQuality__", this);
89
+ this ._TextureQuality .addInterest ("set_textureQuality__", this);
90
+ this ._Shading .addInterest ("set_shading__", this);
91
+ this ._StraightenHorizon .addInterest ("set_straightenHorizon__", this);
92
+ this ._AutoUpdate .addInterest ("set_autoUpdate__", this);
93
+ this ._ContentScale .addInterest ("set_contentScale__", this);
94
+ this ._LogarithmicDepthBuffer .addInterest ("set_logarithmicDepthBuffer__", this);
95
+ this ._Multisampling .addInterest ("set_multisampling__", this);
96
+ this ._OrderIndependentTransparency .addInterest ("set_orderIndependentTransparency__", this);
97
+ this ._Timings .addInterest ("set_timings__", this);
98
+
99
+ this .set_antialiased__ (this ._Antialiased);
100
+ this .set_shading__ (this ._Shading);
101
+ this .set_contentScale__ (this ._ContentScale);
102
+ this .set_logarithmicDepthBuffer__ (this ._LogarithmicDepthBuffer);
103
+ this .set_multisampling__ (this ._Multisampling);
104
+ this .set_orderIndependentTransparency__ (this ._OrderIndependentTransparency);
105
+
106
+ this .reset ();
105
107
  },
106
- configure: (() =>
108
+ reset: (() =>
107
109
  {
108
110
  const attributes = new Set ([
109
111
  "Antialiased",
@@ -114,6 +116,7 @@ Object .assign (Object .setPrototypeOf (BrowserOptions .prototype, X3DBaseNode .
114
116
  "Debug",
115
117
  "Multisampling",
116
118
  "Notifications",
119
+ "OrderIndependentTransparency",
117
120
  "SplashScreen",
118
121
  ]);
119
122
 
@@ -247,24 +250,6 @@ Object .assign (Object .setPrototypeOf (BrowserOptions .prototype, X3DBaseNode .
247
250
  if (straightenHorizon .getValue ())
248
251
  this .getBrowser () .getActiveLayer () ?.straightenView ();
249
252
  },
250
- updateContentScale ()
251
- {
252
- const
253
- browser = this .getBrowser (),
254
- media = window .matchMedia (`(resolution: ${window .devicePixelRatio}dppx)`),
255
- update = this .updateContentScale .bind (this);
256
-
257
- if (this .removeUpdateContentScale)
258
- this .removeUpdateContentScale ();
259
-
260
- this .removeUpdateContentScale = function () { media .removeEventListener ("change", update) };
261
-
262
- media .addEventListener ("change", update);
263
-
264
- browser .getRenderingProperties () ._ContentScale = window .devicePixelRatio;
265
-
266
- browser .reshape ();
267
- },
268
253
  set_autoUpdate__ (autoUpdate)
269
254
  {
270
255
  const events = ["resize", "scroll", "load"]
@@ -313,6 +298,24 @@ Object .assign (Object .setPrototypeOf (BrowserOptions .prototype, X3DBaseNode .
313
298
 
314
299
  browser .reshape ();
315
300
  },
301
+ updateContentScale ()
302
+ {
303
+ const
304
+ browser = this .getBrowser (),
305
+ media = window .matchMedia (`(resolution: ${window .devicePixelRatio}dppx)`),
306
+ update = this .updateContentScale .bind (this);
307
+
308
+ if (this .removeUpdateContentScale)
309
+ this .removeUpdateContentScale ();
310
+
311
+ this .removeUpdateContentScale = function () { media .removeEventListener ("change", update) };
312
+
313
+ media .addEventListener ("change", update);
314
+
315
+ browser .getRenderingProperties () ._ContentScale = window .devicePixelRatio;
316
+
317
+ browser .reshape ();
318
+ },
316
319
  set_logarithmicDepthBuffer__ (logarithmicDepthBuffer)
317
320
  {
318
321
  const
@@ -328,8 +331,15 @@ Object .assign (Object .setPrototypeOf (BrowserOptions .prototype, X3DBaseNode .
328
331
  samples = Algorithm .clamp (multisampling .getValue (), 0, browser .getMaxSamples ());
329
332
 
330
333
  browser .getRenderingProperties () ._Multisampling = this ._Antialiased .getValue () ? samples : 0;
331
- browser .getRenderingProperties () ._Antialiased = browser .getAntialiased ();
334
+ browser .getRenderingProperties () ._Antialiased = samples > 0;
335
+
336
+ browser .reshape ();
337
+ },
338
+ set_orderIndependentTransparency__ ()
339
+ {
340
+ const browser = this .getBrowser ();
332
341
 
342
+ browser .getShaders () .clear ();
333
343
  browser .reshape ();
334
344
  },
335
345
  set_timings__ (timings)
@@ -348,27 +358,28 @@ Object .defineProperties (BrowserOptions,
348
358
  fieldDefinitions:
349
359
  {
350
360
  value: new FieldDefinitionArray ([
351
- new X3DFieldDefinition (X3DConstants .inputOutput, "SplashScreen", new Fields .SFBool (true)),
352
- new X3DFieldDefinition (X3DConstants .inputOutput, "Dashboard", new Fields .SFBool (true)),
353
- new X3DFieldDefinition (X3DConstants .inputOutput, "Rubberband", new Fields .SFBool (true)),
354
- new X3DFieldDefinition (X3DConstants .inputOutput, "EnableInlineViewpoints", new Fields .SFBool (true)),
355
- new X3DFieldDefinition (X3DConstants .inputOutput, "Antialiased", new Fields .SFBool (true)),
356
- new X3DFieldDefinition (X3DConstants .inputOutput, "TextureQuality", new Fields .SFString ("MEDIUM")),
357
- new X3DFieldDefinition (X3DConstants .inputOutput, "PrimitiveQuality", new Fields .SFString ("MEDIUM")),
358
- new X3DFieldDefinition (X3DConstants .inputOutput, "QualityWhenMoving", new Fields .SFString ("SAME")),
359
- new X3DFieldDefinition (X3DConstants .inputOutput, "Shading", new Fields .SFString ("GOURAUD")),
360
- new X3DFieldDefinition (X3DConstants .inputOutput, "MotionBlur", new Fields .SFBool ()),
361
- new X3DFieldDefinition (X3DConstants .inputOutput, "AutoUpdate", new Fields .SFBool (false)),
362
- new X3DFieldDefinition (X3DConstants .inputOutput, "Cache", new Fields .SFBool (true)),
363
- new X3DFieldDefinition (X3DConstants .inputOutput, "ContentScale", new Fields .SFDouble (1)),
364
- new X3DFieldDefinition (X3DConstants .inputOutput, "ContextMenu", new Fields .SFBool (true)),
365
- new X3DFieldDefinition (X3DConstants .inputOutput, "Debug", new Fields .SFBool ()),
366
- new X3DFieldDefinition (X3DConstants .inputOutput, "Gravity", new Fields .SFDouble (9.80665)),
367
- new X3DFieldDefinition (X3DConstants .inputOutput, "LogarithmicDepthBuffer", new Fields .SFBool ()),
368
- new X3DFieldDefinition (X3DConstants .inputOutput, "Notifications", new Fields .SFBool (true)),
369
- new X3DFieldDefinition (X3DConstants .inputOutput, "Multisampling", new Fields .SFInt32 (4)),
370
- new X3DFieldDefinition (X3DConstants .inputOutput, "StraightenHorizon", new Fields .SFBool (true)),
371
- new X3DFieldDefinition (X3DConstants .inputOutput, "Timings", new Fields .SFBool ()),
361
+ new X3DFieldDefinition (X3DConstants .inputOutput, "SplashScreen", new Fields .SFBool (true)),
362
+ new X3DFieldDefinition (X3DConstants .inputOutput, "Dashboard", new Fields .SFBool (true)),
363
+ new X3DFieldDefinition (X3DConstants .inputOutput, "Rubberband", new Fields .SFBool (true)),
364
+ new X3DFieldDefinition (X3DConstants .inputOutput, "EnableInlineViewpoints", new Fields .SFBool (true)),
365
+ new X3DFieldDefinition (X3DConstants .inputOutput, "Antialiased", new Fields .SFBool (true)),
366
+ new X3DFieldDefinition (X3DConstants .inputOutput, "TextureQuality", new Fields .SFString ("MEDIUM")),
367
+ new X3DFieldDefinition (X3DConstants .inputOutput, "PrimitiveQuality", new Fields .SFString ("MEDIUM")),
368
+ new X3DFieldDefinition (X3DConstants .inputOutput, "QualityWhenMoving", new Fields .SFString ("SAME")),
369
+ new X3DFieldDefinition (X3DConstants .inputOutput, "Shading", new Fields .SFString ("GOURAUD")),
370
+ new X3DFieldDefinition (X3DConstants .inputOutput, "MotionBlur", new Fields .SFBool ()),
371
+ new X3DFieldDefinition (X3DConstants .inputOutput, "AutoUpdate", new Fields .SFBool ()),
372
+ new X3DFieldDefinition (X3DConstants .inputOutput, "Cache", new Fields .SFBool (true)),
373
+ new X3DFieldDefinition (X3DConstants .inputOutput, "ContentScale", new Fields .SFDouble (1)),
374
+ new X3DFieldDefinition (X3DConstants .inputOutput, "ContextMenu", new Fields .SFBool (true)),
375
+ new X3DFieldDefinition (X3DConstants .inputOutput, "Debug", new Fields .SFBool ()),
376
+ new X3DFieldDefinition (X3DConstants .inputOutput, "Gravity", new Fields .SFDouble (9.80665)),
377
+ new X3DFieldDefinition (X3DConstants .inputOutput, "LogarithmicDepthBuffer", new Fields .SFBool ()),
378
+ new X3DFieldDefinition (X3DConstants .inputOutput, "Notifications", new Fields .SFBool (true)),
379
+ new X3DFieldDefinition (X3DConstants .inputOutput, "Multisampling", new Fields .SFInt32 (4)),
380
+ new X3DFieldDefinition (X3DConstants .inputOutput, "OrderIndependentTransparency", new Fields .SFBool ()),
381
+ new X3DFieldDefinition (X3DConstants .inputOutput, "StraightenHorizon", new Fields .SFBool (true)),
382
+ new X3DFieldDefinition (X3DConstants .inputOutput, "Timings", new Fields .SFBool ()),
372
383
  ]),
373
384
  enumerable: true,
374
385
  },
@@ -117,7 +117,7 @@ const Context =
117
117
  gl = canvas .getContext ("webgl2", { ... options, antialias: false });
118
118
 
119
119
  if (gl)
120
- gl .getVersion = function () { return 2; };
120
+ gl .getVersion = () => 2;
121
121
  }
122
122
 
123
123
  if (version >= 1 && !gl)
@@ -127,7 +127,7 @@ const Context =
127
127
 
128
128
  if (gl)
129
129
  {
130
- gl .getVersion = function () { return 1; };
130
+ gl .getVersion = () => 1;
131
131
 
132
132
  {
133
133
  const ext = gl .getExtension ("OES_vertex_array_object");
@@ -350,6 +350,12 @@ Object .assign (X3DCoreContext .prototype,
350
350
 
351
351
  break;
352
352
  }
353
+ case "orderIndependentTransparency":
354
+ case "orderindependenttransparency":
355
+ {
356
+ this .setBrowserOption ("OrderIndependentTransparency", this .parseBooleanAttribute (newValue, false));
357
+ break;
358
+ }
353
359
  case "splashScreen":
354
360
  case "splashscreen":
355
361
  {
@@ -359,9 +359,6 @@ class DOMIntegration
359
359
  return;
360
360
 
361
361
  field .addInterest ("fieldCallback", this, element);
362
-
363
- if (this .trace)
364
- field .addInterest ("fieldTraceCallback", this, element);
365
362
  }
366
363
 
367
364
  fieldCallback (element, field)
@@ -381,20 +378,6 @@ class DOMIntegration
381
378
 
382
379
  element .dispatchEvent (event);
383
380
  }
384
-
385
- fieldTraceCallback (element, field)
386
- {
387
- const
388
- now = Date .now (),
389
- timeStamp = node .getBrowser () .getCurrentTime (),
390
- dt = now - timeStamp * 1000,
391
- node = $.data (element, "node");
392
-
393
- console .log ("%f: at %f dt of %s ms %s '%s' %s: %s",
394
- now, timeStamp, dt .toFixed (3),
395
- node .getTypeName (), node .getName (),
396
- field .getName (), field .valueOf ());
397
- }
398
381
  };
399
382
 
400
383
  export default DOMIntegration;
@@ -56,6 +56,7 @@ import TimeSensor from "../../Components/Time/TimeSensor.js";
56
56
  import Vector2 from "../../../standard/Math/Numbers/Vector2.js";
57
57
  import Vector3 from "../../../standard/Math/Numbers/Vector3.js";
58
58
  import Rotation4 from "../../../standard/Math/Numbers/Rotation4.js";
59
+ import Time from "../../../standard/Time/Time.js";
59
60
 
60
61
  typeof jquery_mousewheel; // import plugin
61
62
 
@@ -164,7 +165,7 @@ Object .assign (Object .setPrototypeOf (ExamineViewer .prototype, X3DViewer .pro
164
165
  if (this .button >= 0)
165
166
  return;
166
167
 
167
- this .pressTime = Date .now ();
168
+ this .pressTime = Time .now ();
168
169
 
169
170
  const { x, y } = this .getBrowser () .getPointerFromEvent (event);
170
171
 
@@ -247,7 +248,7 @@ Object .assign (Object .setPrototypeOf (ExamineViewer .prototype, X3DViewer .pro
247
248
 
248
249
  this .getBrowser () .setCursor ("DEFAULT");
249
250
 
250
- if (Math .abs (this .rotation .angle) > SPIN_ANGLE && Date .now () - this .motionTime < SPIN_RELEASE_TIME)
251
+ if (Math .abs (this .rotation .angle) > SPIN_ANGLE && Time .now () - this .motionTime < SPIN_RELEASE_TIME)
251
252
  this .addSpinning (this .rotation);
252
253
 
253
254
  this ._isActive = false;
@@ -301,13 +302,13 @@ Object .assign (Object .setPrototypeOf (ExamineViewer .prototype, X3DViewer .pro
301
302
 
302
303
  this .rotation .setFromToVec (toVector, this .fromVector);
303
304
 
304
- if (Math .abs (this .rotation .angle) < SPIN_ANGLE && Date .now () - this .pressTime < MOTION_TIME)
305
+ if (Math .abs (this .rotation .angle) < SPIN_ANGLE && Time .now () - this .pressTime < MOTION_TIME)
305
306
  return;
306
307
 
307
308
  this .addRotate (this .rotation);
308
309
 
309
310
  this .fromVector .assign (toVector);
310
- this .motionTime = Date .now ();
311
+ this .motionTime = Time .now ();
311
312
  break;
312
313
  }
313
314
  case 1:
@@ -53,6 +53,7 @@ import Vector3 from "../../../standard/Math/Numbers/Vector3.js";
53
53
  import Rotation4 from "../../../standard/Math/Numbers/Rotation4.js";
54
54
  import Matrix4 from "../../../standard/Math/Numbers/Matrix4.js";
55
55
  import Camera from "../../../standard/Math/Geometry/Camera.js";
56
+ import Time from "../../../standard/Time/Time.js";
56
57
 
57
58
  typeof jquery_mousewheel; // import plugin
58
59
 
@@ -417,7 +418,7 @@ Object .assign (Object .setPrototypeOf (X3DFlyViewer .prototype, X3DViewer .prot
417
418
  const
418
419
  navigationInfo = this .getNavigationInfo (),
419
420
  viewpoint = this .getActiveViewpoint (),
420
- now = Date .now (),
421
+ now = Time .now (),
421
422
  dt = (now - this .startTime) / 1000;
422
423
 
423
424
  upVector .assign (viewpoint .getUpVector ());
@@ -487,7 +488,7 @@ Object .assign (Object .setPrototypeOf (X3DFlyViewer .prototype, X3DViewer .prot
487
488
  const
488
489
  navigationInfo = this .getNavigationInfo (),
489
490
  viewpoint = this .getActiveViewpoint (),
490
- now = Date .now (),
491
+ now = Time .now (),
491
492
  dt = (now - this .startTime) / 1000,
492
493
  upVector = viewpoint .getUpVector ();
493
494
 
@@ -525,7 +526,7 @@ Object .assign (Object .setPrototypeOf (X3DFlyViewer .prototype, X3DViewer .prot
525
526
  this .getBrowser () .prepareEvents () .addInterest ("fly", this);
526
527
  this .getBrowser () .addBrowserEvent ();
527
528
 
528
- this .startTime = Date .now ();
529
+ this .startTime = Time .now ();
529
530
  },
530
531
  addPan ()
531
532
  {
@@ -536,7 +537,7 @@ Object .assign (Object .setPrototypeOf (X3DFlyViewer .prototype, X3DViewer .prot
536
537
  this .getBrowser () .prepareEvents () .addInterest ("pan", this);
537
538
  this .getBrowser () .addBrowserEvent ();
538
539
 
539
- this .startTime = Date .now ();
540
+ this .startTime = Time .now ();
540
541
  },
541
542
  addRoll: (() =>
542
543
  {
@@ -692,6 +693,8 @@ Object .assign (Object .setPrototypeOf (X3DFlyViewer .prototype, X3DViewer .prot
692
693
 
693
694
  gl .uniform3f (shaderNode .x3d_EmissiveColor, 1, 1, 1);
694
695
  gl .drawArrays (gl .LINES, 0, this .lineCount);
696
+
697
+ gl .enable (gl .DEPTH_TEST);
695
698
  };
696
699
  })(),
697
700
  disconnect ()
@@ -49,11 +49,12 @@ import MultiSampleFrameBuffer from "../../Rendering/MultiSampleFrameBuffer.js";
49
49
  import Vector4 from "../../../standard/Math/Numbers/Vector4.js";
50
50
 
51
51
  const
52
- _viewport = Symbol (),
53
- _frameBuffer = Symbol (),
54
- _resizer = Symbol (),
55
- _localObjects = Symbol (),
56
- _depthShaders = Symbol ();
52
+ _viewport = Symbol (),
53
+ _frameBuffer = Symbol (),
54
+ _resizer = Symbol (),
55
+ _localObjects = Symbol (),
56
+ _composeShader = Symbol (),
57
+ _depthShaders = Symbol ();
57
58
 
58
59
  function X3DRenderingContext ()
59
60
  {
@@ -72,6 +73,7 @@ Object .assign (X3DRenderingContext .prototype,
72
73
  const gl = this .getContext ();
73
74
 
74
75
  gl .enable (gl .SCISSOR_TEST);
76
+ gl .enable (gl .DEPTH_TEST);
75
77
  gl .depthFunc (gl .LEQUAL);
76
78
  gl .clearDepth (1);
77
79
 
@@ -123,12 +125,6 @@ Object .assign (X3DRenderingContext .prototype,
123
125
 
124
126
  return gl .getParameter (gl .VERSION);
125
127
  },
126
- getAntialiased ()
127
- {
128
- const gl = this .getContext ();
129
-
130
- return gl .getParameter (gl .SAMPLES) > 0 || (gl .getVersion () > 1 && this .getRenderingProperty ("Multisampling") > 0);
131
- },
132
128
  getMaxSamples ()
133
129
  {
134
130
  const gl = this .getContext ();
@@ -166,6 +162,13 @@ Object .assign (X3DRenderingContext .prototype,
166
162
  {
167
163
  return this [_frameBuffer];
168
164
  },
165
+ getComposeShader ()
166
+ {
167
+ if (this [_composeShader])
168
+ return this [_composeShader];
169
+
170
+ return this [_composeShader] = this .createShader ("ComposeShader", "Compose", "Compose");
171
+ },
169
172
  getDepthShader (numClipPlanes, shapeNode, humanoidNode)
170
173
  {
171
174
  const geometryContext = shapeNode .getGeometryContext ();
@@ -231,6 +234,7 @@ Object .assign (X3DRenderingContext .prototype,
231
234
  $canvas = this .getCanvas (),
232
235
  contentScale = this .getRenderingProperty ("ContentScale"),
233
236
  samples = this .getRenderingProperty ("Multisampling"),
237
+ oit = this .getBrowserOption ("OrderIndependentTransparency"),
234
238
  width = $canvas .width () * contentScale,
235
239
  height = $canvas .height () * contentScale,
236
240
  canvas = $canvas [0];
@@ -241,12 +245,13 @@ Object .assign (X3DRenderingContext .prototype,
241
245
  this [_viewport] [2] = width;
242
246
  this [_viewport] [3] = height;
243
247
 
244
- if (width !== this [_frameBuffer] .getWidth () ||
245
- height !== this [_frameBuffer] .getHeight () ||
246
- samples !== this [_frameBuffer] .getSamples ())
248
+ if (width !== this [_frameBuffer] .getWidth () ||
249
+ height !== this [_frameBuffer] .getHeight () ||
250
+ samples !== this [_frameBuffer] .getSamples () ||
251
+ oit !== this [_frameBuffer] .getOrderIndependentTransparency ())
247
252
  {
248
253
  this [_frameBuffer] .dispose ();
249
- this [_frameBuffer] = new MultiSampleFrameBuffer (this, width, height, samples);
254
+ this [_frameBuffer] = new MultiSampleFrameBuffer (this, width, height, samples, oit);
250
255
  }
251
256
 
252
257
  this .addBrowserEvent ();
@@ -76,36 +76,38 @@ import Point2 from "../../../assets/shaders/webgl2/include/Point
76
76
  import PointSize2 from "../../../assets/shaders/webgl2/include/PointSize.glsl.js";
77
77
  import Shadow2 from "../../../assets/shaders/webgl2/include/Shadow.glsl.js";
78
78
  import Skin2 from "../../../assets/shaders/webgl2/include/Skin.glsl.js";
79
- import Stipple2 from "../../../assets/shaders/webgl2/include/Stipple.glsl.js";
80
79
  import SpotFactor2 from "../../../assets/shaders/webgl2/include/SpotFactor.glsl.js";
80
+ import Stipple2 from "../../../assets/shaders/webgl2/include/Stipple.glsl.js";
81
81
  import Texture2 from "../../../assets/shaders/webgl2/include/Texture.glsl.js";
82
82
  import Utils2 from "../../../assets/shaders/webgl2/include/Utils.glsl.js";
83
83
  import Vertex2 from "../../../assets/shaders/webgl2/include/Vertex.glsl.js";
84
84
 
85
85
  /* WebGL 1 */
86
86
  import DefaultVertex1 from "../../../assets/shaders/webgl1/Default.vs.js";
87
- import PointingVertex1 from "../../../assets/shaders/webgl1/Pointing.vs.js";
88
- import DepthVertex1 from "../../../assets/shaders/webgl1/Depth.vs.js";
89
- import GouraudVertex1 from "../../../assets/shaders/webgl1/Gouraud.vs.js";
90
- import PointingFragment1 from "../../../assets/shaders/webgl1/Pointing.fs.js";
91
87
  import DepthFragment1 from "../../../assets/shaders/webgl1/Depth.fs.js";
88
+ import DepthVertex1 from "../../../assets/shaders/webgl1/Depth.vs.js";
92
89
  import GouraudFragment1 from "../../../assets/shaders/webgl1/Gouraud.fs.js";
90
+ import GouraudVertex1 from "../../../assets/shaders/webgl1/Gouraud.vs.js";
93
91
  import PBRFragment1 from "../../../assets/shaders/webgl1/PBR.fs.js";
94
92
  import PhongFragment1 from "../../../assets/shaders/webgl1/Phong.fs.js";
93
+ import PointingFragment1 from "../../../assets/shaders/webgl1/Pointing.fs.js";
94
+ import PointingVertex1 from "../../../assets/shaders/webgl1/Pointing.vs.js";
95
95
  import UnlitFragment1 from "../../../assets/shaders/webgl1/Unlit.fs.js";
96
96
 
97
97
  /* WebGL 2 */
98
+ import ComposeFragment2 from "../../../assets/shaders/webgl2/Compose.fs.js";
99
+ import ComposeVertex2 from "../../../assets/shaders/webgl2/Compose.vs.js";
98
100
  import DefaultVertex2 from "../../../assets/shaders/webgl2/Default.vs.js";
99
- import PointingVertex2 from "../../../assets/shaders/webgl2/Pointing.vs.js";
100
- import DepthVertex2 from "../../../assets/shaders/webgl2/Depth.vs.js";
101
- import GouraudVertex2 from "../../../assets/shaders/webgl2/Gouraud.vs.js";
102
- import LineTransformVertex2 from "../../../assets/shaders/webgl2/LineTransform.vs.js";
103
- import PointingFragment2 from "../../../assets/shaders/webgl2/Pointing.fs.js";
104
101
  import DepthFragment2 from "../../../assets/shaders/webgl2/Depth.fs.js";
102
+ import DepthVertex2 from "../../../assets/shaders/webgl2/Depth.vs.js";
105
103
  import GouraudFragment2 from "../../../assets/shaders/webgl2/Gouraud.fs.js";
104
+ import GouraudVertex2 from "../../../assets/shaders/webgl2/Gouraud.vs.js";
106
105
  import LineTransformFragment2 from "../../../assets/shaders/webgl2/LineTransform.fs.js";
106
+ import LineTransformVertex2 from "../../../assets/shaders/webgl2/LineTransform.vs.js";
107
107
  import PBRFragment2 from "../../../assets/shaders/webgl2/PBR.fs.js";
108
108
  import PhongFragment2 from "../../../assets/shaders/webgl2/Phong.fs.js";
109
+ import PointingFragment2 from "../../../assets/shaders/webgl2/Pointing.fs.js";
110
+ import PointingVertex2 from "../../../assets/shaders/webgl2/Pointing.vs.js";
109
111
  import UnlitFragment2 from "../../../assets/shaders/webgl2/Unlit.fs.js";
110
112
 
111
113
  const Shaders = {
@@ -141,8 +143,8 @@ const Shaders = {
141
143
  PointSize: PointSize2,
142
144
  Shadow: Shadow2,
143
145
  Skin: Skin2,
144
- Stipple: Stipple2,
145
146
  SpotFactor: SpotFactor2,
147
+ Stipple: Stipple2,
146
148
  Texture: Texture2,
147
149
  Utils: Utils2,
148
150
  Vertex: Vertex2,
@@ -151,34 +153,36 @@ const Shaders = {
151
153
  vertex: {
152
154
  1: {
153
155
  Default: DefaultVertex1,
154
- Pointing: PointingVertex1,
155
156
  Depth: DepthVertex1,
156
157
  Gouraud: GouraudVertex1,
158
+ Pointing: PointingVertex1,
157
159
  },
158
160
  2: {
161
+ Compose: ComposeVertex2,
159
162
  Default: DefaultVertex2,
160
- Pointing: PointingVertex2,
161
163
  Depth: DepthVertex2,
162
164
  Gouraud: GouraudVertex2,
163
165
  LineTransform: LineTransformVertex2,
166
+ Pointing: PointingVertex2,
164
167
  },
165
168
  },
166
169
  fragment: {
167
170
  1: {
168
- Pointing: PointingFragment1,
169
171
  Depth: DepthFragment1,
170
172
  Gouraud: GouraudFragment1,
171
173
  PBR: PBRFragment1,
172
174
  Phong: PhongFragment1,
175
+ Pointing: PointingFragment1,
173
176
  Unlit: UnlitFragment1,
174
177
  },
175
178
  2: {
176
- Pointing: PointingFragment2,
179
+ Compose: ComposeFragment2,
177
180
  Depth: DepthFragment2,
178
181
  Gouraud: GouraudFragment2,
179
182
  LineTransform: LineTransformFragment2,
180
183
  PBR: PBRFragment2,
181
184
  Phong: PhongFragment2,
185
+ Pointing: PointingFragment2,
182
186
  Unlit: UnlitFragment2,
183
187
  },
184
188
  },
@@ -72,27 +72,27 @@ Object .assign (X3DTextContext .prototype,
72
72
 
73
73
  return this [_defaultFontStyle];
74
74
  },
75
- getFont (url)
75
+ getFont (url, cache = true)
76
76
  {
77
- url = url .toString ();
77
+ return new Promise ((resolve, reject) =>
78
+ {
79
+ url = url .toString ();
78
80
 
79
- let deferred = this [_fontCache] .get (url);
81
+ let deferred = this [_fontCache] .get (url);
80
82
 
81
- if (deferred === undefined)
82
- {
83
- this [_fontCache] .set (url, deferred = $.Deferred ());
83
+ if (!deferred)
84
+ {
85
+ this [_fontCache] .set (url, deferred = $.Deferred ());
84
86
 
85
- opentype .load (url, this .setFont .bind (this, deferred));
86
- }
87
+ fetch (url, { cache: cache ? "default" : "reload"})
88
+ .then (response => response .arrayBuffer ())
89
+ .then (buffer => opentype .parse (buffer))
90
+ .then (font => deferred .resolve (font))
91
+ .catch (error => deferred .reject (error));
92
+ }
87
93
 
88
- return deferred;
89
- },
90
- setFont (deferred, error, font)
91
- {
92
- if (error)
93
- deferred .reject (error);
94
- else
95
- deferred .resolve (font);
94
+ deferred .done (resolve) .fail (reject);
95
+ });
96
96
  },
97
97
  getGlyph (font, primitiveQuality, glyphIndex)
98
98
  {
@@ -46,6 +46,7 @@
46
46
  ******************************************************************************/
47
47
 
48
48
  import Vector3 from "../../../standard/Math/Numbers/Vector3.js";
49
+ import Time from "../../../standard/Time/Time.js";
49
50
 
50
51
  const
51
52
  _currentTime = Symbol (),
@@ -55,7 +56,7 @@ const
55
56
 
56
57
  function X3DTimeContext ()
57
58
  {
58
- this [_currentTime] = Date .now () / 1000;
59
+ this [_currentTime] = Time .now () / 1000;
59
60
  this [_currentFrameRate] = 60;
60
61
  this [_currentPosition] = new Vector3 (0, 0, 0);
61
62
  this [_currentSpeed] = 0;
@@ -82,7 +83,7 @@ Object .assign (X3DTimeContext .prototype,
82
83
  return function ()
83
84
  {
84
85
  const
85
- time = Date .now () / 1000,
86
+ time = Time .now () / 1000,
86
87
  interval = time - this [_currentTime];
87
88
 
88
89
  this [_currentTime] = time;
@@ -45,4 +45,4 @@
45
45
  *
46
46
  ******************************************************************************/
47
47
 
48
- export default "8.10.1";
48
+ export default "8.11.0";
@@ -69,13 +69,13 @@ Object .assign (Object .setPrototypeOf (VolumeMaterial .prototype, UnlitMaterial
69
69
 
70
70
  let key = "";
71
71
 
72
- key += fogNode ? fogNode .getFogType () : 0;
72
+ key += fogNode ?.getFogType () ?? 0;
73
73
  key += ".";
74
74
  key += objectsCount [0]; // Clip planes
75
75
  key += ".";
76
76
  key += objectsCount [1]; // Lights
77
77
 
78
- return this .volumeShaderNodes .get (key) || this .createShader (key, geometryContext, renderContext);
78
+ return this .volumeShaderNodes .get (key) ?? this .createShader (key, geometryContext, renderContext);
79
79
  },
80
80
  createShader (key, geometryContext, renderContext)
81
81
  {