x_ite 8.9.5 → 8.10.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 (196) hide show
  1. package/build/bin/tests.pl +1 -1
  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 +26 -26
  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 +35 -34
  13. package/dist/assets/components/Geometry2D.min.js +1 -1
  14. package/dist/assets/components/Geospatial.js +37 -37
  15. package/dist/assets/components/Geospatial.min.js +1 -1
  16. package/dist/assets/components/HAnim.js +370 -208
  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 -30
  21. package/dist/assets/components/Layout.min.js +1 -1
  22. package/dist/assets/components/NURBS.js +26 -26
  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 +18 -18
  27. package/dist/assets/components/Picking.min.js +1 -1
  28. package/dist/assets/components/RigidBodyPhysics.js +23 -23
  29. package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
  30. package/dist/assets/components/Scripting.js +37 -37
  31. package/dist/assets/components/Scripting.min.js +1 -1
  32. package/dist/assets/components/Text.js +31 -31
  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 +33 -33
  37. package/dist/assets/components/Texturing3D.min.js +1 -1
  38. package/dist/assets/components/VolumeRendering.js +18 -18
  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 +8088 -7729
  44. package/dist/x_ite.min.js +1 -1
  45. package/dist/x_ite.zip +0 -0
  46. package/docs/_config.yml +5 -5
  47. package/docs/_posts/components/Core/MetadataBoolean.md +1 -1
  48. package/docs/_posts/components/Core/MetadataDouble.md +1 -1
  49. package/docs/_posts/components/Core/MetadataFloat.md +1 -1
  50. package/docs/_posts/components/Core/MetadataInteger.md +1 -1
  51. package/docs/_posts/components/Core/MetadataSet.md +1 -1
  52. package/docs/_posts/components/Core/MetadataString.md +1 -1
  53. package/docs/_posts/components/Core/WorldInfo.md +1 -1
  54. package/docs/_posts/components/EventUtilities/BooleanFilter.md +2 -2
  55. package/docs/_posts/components/EventUtilities/BooleanSequencer.md +2 -2
  56. package/docs/_posts/components/EventUtilities/BooleanToggle.md +2 -2
  57. package/docs/_posts/components/EventUtilities/BooleanTrigger.md +2 -2
  58. package/docs/_posts/components/EventUtilities/IntegerSequencer.md +2 -2
  59. package/docs/_posts/components/EventUtilities/IntegerTrigger.md +2 -2
  60. package/docs/_posts/components/EventUtilities/TimeTrigger.md +2 -2
  61. package/docs/_posts/components/Geometry2D/Arc2D.md +1 -1
  62. package/docs/_posts/components/Geometry2D/ArcClose2D.md +1 -1
  63. package/docs/_posts/components/Geometry2D/Circle2D.md +1 -1
  64. package/docs/_posts/components/Geometry2D/Disk2D.md +1 -1
  65. package/docs/_posts/components/Geometry2D/Polyline2D.md +1 -1
  66. package/docs/_posts/components/Geometry2D/Polypoint2D.md +1 -1
  67. package/docs/_posts/components/Geometry2D/Rectangle2D.md +1 -1
  68. package/docs/_posts/components/HAnim/HAnimHumanoid.md +17 -17
  69. package/docs/_posts/components/Interpolation/ColorInterpolator.md +1 -1
  70. package/docs/_posts/components/Interpolation/CoordinateInterpolator.md +1 -1
  71. package/docs/_posts/components/Interpolation/CoordinateInterpolator2D.md +1 -1
  72. package/docs/_posts/components/Interpolation/NormalInterpolator.md +1 -1
  73. package/docs/_posts/components/Interpolation/OrientationInterpolator.md +1 -1
  74. package/docs/_posts/components/Interpolation/PositionInterpolator.md +1 -1
  75. package/docs/_posts/components/Interpolation/PositionInterpolator2D.md +1 -1
  76. package/docs/_posts/components/Interpolation/ScalarInterpolator.md +1 -1
  77. package/docs/_posts/components/KeyDeviceSensor/KeySensor.md +1 -1
  78. package/docs/_posts/components/KeyDeviceSensor/StringSensor.md +1 -1
  79. package/docs/_posts/components/Networking/LoadSensor.md +1 -1
  80. package/docs/_posts/components/PointingDeviceSensor/CylinderSensor.md +1 -1
  81. package/docs/_posts/components/PointingDeviceSensor/PlaneSensor.md +1 -1
  82. package/docs/_posts/components/PointingDeviceSensor/TouchSensor.md +1 -1
  83. package/docs/_posts/components/Text/Text.md +1 -1
  84. package/docs/_posts/components/Time/TimeSensor.md +1 -1
  85. package/docs/_posts/reference/browser-services.md +6 -6
  86. package/docs/laboratory/gltf-sample-viewer.html +1 -1
  87. package/package.json +1 -1
  88. package/src/assets/shaders/webgl1/Depth.vs.js +4 -4
  89. package/src/assets/shaders/webgl1/Pointing.fs.js +1 -1
  90. package/src/assets/shaders/webgl2/Depth.vs.js +7 -4
  91. package/src/assets/shaders/webgl2/LineTransform.vs.js +24 -12
  92. package/src/assets/shaders/webgl2/Pointing.fs.js +1 -1
  93. package/src/assets/shaders/webgl2/Pointing.vs.js +12 -9
  94. package/src/assets/shaders/webgl2/include/Particle.glsl.js +5 -15
  95. package/src/assets/shaders/webgl2/include/Skin.glsl.js +88 -0
  96. package/src/assets/shaders/webgl2/include/Utils.glsl.js +13 -0
  97. package/src/assets/shaders/webgl2/include/Vertex.glsl.js +17 -8
  98. package/src/bookmarks.js +54 -2
  99. package/src/tests.js +0 -360
  100. package/src/x_ite/Base/X3DArrayField.js +18 -3
  101. package/src/x_ite/Base/X3DBaseNode.js +73 -56
  102. package/src/x_ite/Base/X3DChildObject.js +5 -3
  103. package/src/x_ite/Base/X3DObjectArrayField.js +6 -4
  104. package/src/x_ite/Browser/Core/Context.js +14 -4
  105. package/src/x_ite/Browser/Core/Notification.js +4 -3
  106. package/src/x_ite/Browser/Core/X3DCoreContext.js +8 -8
  107. package/src/x_ite/Browser/Geometry2D/Arc2DOptions.js +4 -3
  108. package/src/x_ite/Browser/Geometry2D/ArcClose2DOptions.js +4 -3
  109. package/src/x_ite/Browser/Geometry2D/Circle2DOptions.js +6 -6
  110. package/src/x_ite/Browser/Geometry2D/Disk2DOptions.js +9 -10
  111. package/src/x_ite/Browser/Geometry3D/ConeOptions.js +5 -4
  112. package/src/x_ite/Browser/Geometry3D/CylinderOptions.js +5 -4
  113. package/src/x_ite/Browser/Geometry3D/IcoSphereOptions.js +3 -2
  114. package/src/x_ite/Browser/Geometry3D/QuadSphereOptions.js +3 -2
  115. package/src/x_ite/Browser/Layout/ScreenText.js +2 -2
  116. package/src/x_ite/Browser/Navigation/ExamineViewer.js +4 -4
  117. package/src/x_ite/Browser/Navigation/LookAtViewer.js +4 -4
  118. package/src/x_ite/Browser/Navigation/PlaneViewer.js +3 -3
  119. package/src/x_ite/Browser/Navigation/X3DFlyViewer.js +3 -3
  120. package/src/x_ite/Browser/Navigation/X3DNavigationContext.js +6 -5
  121. package/src/x_ite/Browser/Navigation/X3DViewer.js +2 -13
  122. package/src/x_ite/Browser/Networking/X3DNetworkingContext.js +5 -4
  123. package/src/x_ite/Browser/PointingDeviceSensor/PointingDevice.js +8 -18
  124. package/src/x_ite/Browser/PointingDeviceSensor/X3DPointingDeviceSensorContext.js +17 -5
  125. package/src/x_ite/Browser/Rendering/X3DRenderingContext.js +6 -5
  126. package/src/x_ite/Browser/Shaders/Shaders.js +4 -0
  127. package/src/x_ite/Browser/Shape/X3DShapeContext.js +3 -3
  128. package/src/x_ite/Browser/Sound/X3DSoundContext.js +4 -3
  129. package/src/x_ite/Browser/Text/PolygonText.js +2 -2
  130. package/src/x_ite/Browser/Texturing/X3DTexturingContext.js +1 -1
  131. package/src/x_ite/Browser/VERSION.js +1 -1
  132. package/src/x_ite/Browser/X3DBrowser.js +49 -17
  133. package/src/x_ite/Browser/X3DBrowserContext.js +8 -7
  134. package/src/x_ite/Components/Core/X3DChildNode.js +2 -5
  135. package/src/x_ite/Components/Core/X3DPrototypeInstance.js +14 -16
  136. package/src/x_ite/Components/CubeMapTexturing/ComposedCubeMapTexture.js +1 -1
  137. package/src/x_ite/Components/EnvironmentalSensor/X3DEnvironmentalSensorNode.js +1 -1
  138. package/src/x_ite/Components/Geometry3D/ElevationGrid.js +5 -2
  139. package/src/x_ite/Components/Geometry3D/Extrusion.js +24 -13
  140. package/src/x_ite/Components/Geometry3D/IndexedFaceSet.js +5 -2
  141. package/src/x_ite/Components/Geospatial/GeoElevationGrid.js +2 -2
  142. package/src/x_ite/Components/Geospatial/GeoViewpoint.js +2 -2
  143. package/src/x_ite/Components/Grouping/X3DBoundedObject.js +1 -2
  144. package/src/x_ite/Components/HAnim/HAnimHumanoid.js +314 -161
  145. package/src/x_ite/Components/HAnim/HAnimJoint.js +37 -25
  146. package/src/x_ite/Components/Layering/X3DLayerNode.js +2 -2
  147. package/src/x_ite/Components/NURBS/NurbsOrientationInterpolator.js +1 -1
  148. package/src/x_ite/Components/NURBS/NurbsPositionInterpolator.js +1 -1
  149. package/src/x_ite/Components/Navigation/NavigationInfo.js +4 -4
  150. package/src/x_ite/Components/Navigation/OrthoViewpoint.js +1 -1
  151. package/src/x_ite/Components/Navigation/X3DViewpointNode.js +12 -12
  152. package/src/x_ite/Components/Networking/X3DUrlObject.js +18 -11
  153. package/src/x_ite/Components/Rendering/IndexedLineSet.js +17 -14
  154. package/src/x_ite/Components/Rendering/LineSet.js +16 -13
  155. package/src/x_ite/Components/Rendering/PointSet.js +16 -12
  156. package/src/x_ite/Components/Rendering/X3DColorNode.js +1 -3
  157. package/src/x_ite/Components/Rendering/X3DComposedGeometryNode.js +3 -0
  158. package/src/x_ite/Components/Rendering/X3DGeometryNode.js +48 -77
  159. package/src/x_ite/Components/Rendering/X3DLineGeometryNode.js +31 -12
  160. package/src/x_ite/Components/Rendering/X3DPointGeometryNode.js +3 -0
  161. package/src/x_ite/Components/RigidBodyPhysics/RigidBody.js +3 -3
  162. package/src/x_ite/Components/RigidBodyPhysics/X3DNBodyCollidableNode.js +2 -2
  163. package/src/x_ite/Components/RigidBodyPhysics/X3DRigidJointNode.js +1 -1
  164. package/src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js +24 -7
  165. package/src/x_ite/Components/Shaders/X3DVertexAttributeNode.js +1 -1
  166. package/src/x_ite/Components/Shape/FillProperties.js +1 -3
  167. package/src/x_ite/Components/Shape/X3DAppearanceNode.js +1 -3
  168. package/src/x_ite/Components/Shape/X3DMaterialNode.js +8 -6
  169. package/src/x_ite/Components/Shape/X3DOneSidedMaterialNode.js +0 -2
  170. package/src/x_ite/Components/Sound/AudioClip.js +1 -1
  171. package/src/x_ite/Components/Sound/BufferAudioSource.js +1 -1
  172. package/src/x_ite/Components/Sound/ListenerPointSource.js +2 -2
  173. package/src/x_ite/Components/Sound/MicrophoneSource.js +2 -2
  174. package/src/x_ite/Components/Sound/OscillatorSource.js +2 -2
  175. package/src/x_ite/Components/Sound/Sound.js +1 -1
  176. package/src/x_ite/Components/Sound/StreamAudioSource.js +2 -2
  177. package/src/x_ite/Components/Sound/X3DSoundProcessingNode.js +1 -1
  178. package/src/x_ite/Components/Text/X3DFontStyleNode.js +4 -4
  179. package/src/x_ite/Components/Texturing/MultiTexture.js +1 -1
  180. package/src/x_ite/Components/Texturing/PixelTexture.js +1 -1
  181. package/src/x_ite/Components/Texturing/X3DSingleTextureCoordinateNode.js +2 -2
  182. package/src/x_ite/Components/Texturing/X3DTextureNode.js +1 -3
  183. package/src/x_ite/Components/Texturing3D/ComposedTexture3D.js +2 -2
  184. package/src/x_ite/Components/Texturing3D/PixelTexture3D.js +1 -1
  185. package/src/x_ite/Components/Time/TimeSensor.js +1 -1
  186. package/src/x_ite/Components/Time/X3DTimeDependentNode.js +2 -2
  187. package/src/x_ite/Execution/X3DExecutionContext.js +3 -4
  188. package/src/x_ite/Execution/X3DScene.js +4 -4
  189. package/src/x_ite/Execution/X3DWorld.js +1 -1
  190. package/src/x_ite/Parser/GLTF2Parser.js +196 -116
  191. package/src/x_ite/Parser/X3DOptimizer.js +47 -18
  192. package/src/x_ite/Prototype/X3DExternProtoDeclaration.js +4 -4
  193. package/src/x_ite/Prototype/X3DProtoDeclarationNode.js +1 -1
  194. package/src/x_ite/Rendering/X3DRenderObject.js +20 -12
  195. package/src/x_ite.html +36 -10
  196. package/x_ite.min.html +36 -10
@@ -138,7 +138,7 @@ Object .assign (Object .setPrototypeOf (X3DFlyViewer .prototype, X3DViewer .prot
138
138
 
139
139
  this .event = event;
140
140
 
141
- const [x, y] = this .getPointer (event);
141
+ const { x, y } = this .getBrowser () .getPointerFromEvent (event);
142
142
 
143
143
  if (!this .isPointerInRectangle (x, y))
144
144
  return;
@@ -246,7 +246,7 @@ Object .assign (Object .setPrototypeOf (X3DFlyViewer .prototype, X3DViewer .prot
246
246
 
247
247
  this .event = event;
248
248
 
249
- const [x, y] = this .getPointer (event);
249
+ const { x, y } = this .getBrowser () .getPointerFromEvent (event);
250
250
 
251
251
  switch (this .getButton (this .button))
252
252
  {
@@ -293,7 +293,7 @@ Object .assign (Object .setPrototypeOf (X3DFlyViewer .prototype, X3DViewer .prot
293
293
  },
294
294
  mousewheel (event)
295
295
  {
296
- const [x, y] = this .getPointer (event);
296
+ const { x, y } = this .getBrowser () .getPointerFromEvent (event);
297
297
 
298
298
  if (!this .isPointerInRectangle (x, y))
299
299
  return;
@@ -45,6 +45,7 @@
45
45
  *
46
46
  ******************************************************************************/
47
47
 
48
+ import X3DConstants from "../../Base/X3DConstants.js";
48
49
  import Fields from "../../Fields.js";
49
50
  import ExamineViewer from "./ExamineViewer.js";
50
51
  import WalkViewer from "./WalkViewer.js";
@@ -76,11 +77,11 @@ function getHeadlight (browser)
76
77
 
77
78
  function X3DNavigationContext ()
78
79
  {
79
- this .addChildObjects ("activeLayer", new Fields .SFNode (),
80
- "activeNavigationInfo", new Fields .SFNode (),
81
- "activeViewpoint", new Fields .SFNode (),
82
- "availableViewers", new Fields .MFString (),
83
- "viewer", new Fields .SFString ("EXAMINE"));
80
+ this .addChildObjects (X3DConstants .outputOnly, "activeLayer", new Fields .SFNode (),
81
+ X3DConstants .outputOnly, "activeNavigationInfo", new Fields .SFNode (),
82
+ X3DConstants .outputOnly, "activeViewpoint", new Fields .SFNode (),
83
+ X3DConstants .outputOnly, "availableViewers", new Fields .MFString (),
84
+ X3DConstants .outputOnly, "viewer", new Fields .SFString ("EXAMINE"));
84
85
 
85
86
  this [_activeCollisions] = new Set ();
86
87
  this [_viewerNode] = new NoneViewer (this .getPrivateScene ());
@@ -95,17 +95,6 @@ Object .assign (Object .setPrototypeOf (X3DViewer .prototype, X3DBaseNode .proto
95
95
 
96
96
  return button;
97
97
  },
98
- getPointer (event)
99
- {
100
- const
101
- browser = this .getBrowser (),
102
- rect = browser .getSurface () [0] .getBoundingClientRect (),
103
- viewport = browser .getViewport (),
104
- x = (event .pageX - rect .left) / rect .width * viewport [2],
105
- y = (rect .height - (event .pageY - rect .top)) / rect .height * viewport [3];
106
-
107
- return [x, y];
108
- },
109
98
  isPointerInRectangle: (() =>
110
99
  {
111
100
  const pointer = new Vector2 (0, 0);
@@ -172,7 +161,7 @@ Object .assign (Object .setPrototypeOf (X3DViewer .prototype, X3DBaseNode .proto
172
161
  viewpoint = this .getActiveViewpoint (),
173
162
  hit = this .getBrowser () .getHit ();
174
163
 
175
- viewpoint .lookAtPoint (this .getActiveLayer (), hit .point, 2 - 1.618034, straightenHorizon);
164
+ viewpoint .lookAtPoint (this .getActiveLayer (), hit .point, 1, 2 - 1.618034, straightenHorizon);
176
165
  },
177
166
  lookAtBBox (x, y, straightenHorizon)
178
167
  {
@@ -187,7 +176,7 @@ Object .assign (Object .setPrototypeOf (X3DViewer .prototype, X3DBaseNode .proto
187
176
  .multRight (hit .modelViewMatrix)
188
177
  .multRight (viewpoint .getCameraSpaceMatrix ());
189
178
 
190
- viewpoint .lookAtBBox (this .getActiveLayer (), bbox, 2 - 1.618034, straightenHorizon);
179
+ viewpoint .lookAtBBox (this .getActiveLayer (), bbox, 1, 2 - 1.618034, straightenHorizon);
191
180
  },
192
181
  touch (x, y)
193
182
  {
@@ -45,9 +45,10 @@
45
45
  *
46
46
  ******************************************************************************/
47
47
 
48
- import Fields from "../../Fields.js";
49
- import URLs from "./URLs.js";
50
- import _ from "../../../locale/gettext.js";
48
+ import X3DConstants from "../../Base/X3DConstants.js";
49
+ import Fields from "../../Fields.js";
50
+ import URLs from "./URLs.js";
51
+ import _ from "../../../locale/gettext.js";
51
52
 
52
53
  const
53
54
  _loadingDisplay = Symbol (),
@@ -71,7 +72,7 @@ function getBaseURI (element)
71
72
 
72
73
  function X3DNetworkingContext ()
73
74
  {
74
- this .addChildObjects ("loadCount", new Fields .SFInt32 ());
75
+ this .addChildObjects (X3DConstants .outputOnly, "loadCount", new Fields .SFInt32 ());
75
76
 
76
77
  this [_loadingDisplay] = 0;
77
78
  this [_loadingTotal] = 0;
@@ -76,17 +76,6 @@ Object .assign (Object .setPrototypeOf (PointingDevice .prototype, X3DBaseNode .
76
76
  element .on ("touchstart.PointingDevice" + this .getId (), this .touchstart .bind (this));
77
77
  element .on ("touchend.PointingDevice" + this .getId (), this .touchend .bind (this));
78
78
  },
79
- getPointer (event)
80
- {
81
- const
82
- browser = this .getBrowser (),
83
- rect = browser .getSurface () [0] .getBoundingClientRect (),
84
- viewport = browser .getViewport (),
85
- x = (event .pageX - rect .left) / rect .width * viewport [2],
86
- y = (rect .height - (event .pageY - rect .top)) / rect .height * viewport [3];
87
-
88
- return [x, y];
89
- },
90
79
  mousewheel (event)
91
80
  {
92
81
  // event .preventDefault () must be done in the all viewers.
@@ -104,14 +93,15 @@ Object .assign (Object .setPrototypeOf (PointingDevice .prototype, X3DBaseNode .
104
93
 
105
94
  if (event .button === 0)
106
95
  {
107
- const [x, y] = this .getPointer (event);
96
+ const { x, y } = browser .getPointerFromEvent (event);
108
97
 
109
98
  element .off ("mousemove.PointingDevice" + this .getId ());
110
99
 
111
- $(document) .on ("mouseup.PointingDevice" + this .getId (), this .mouseup .bind (this));
112
- $(document) .on ("mousemove.PointingDevice" + this .getId (), this .mousemove .bind (this));
113
- $(document) .on ("touchend.PointingDevice" + this .getId (), this .touchend .bind (this));
114
- $(document) .on ("touchmove.PointingDevice" + this .getId (), this .touchmove .bind (this));
100
+ $(document)
101
+ .on ("mouseup.PointingDevice" + this .getId (), this .mouseup .bind (this))
102
+ .on ("mousemove.PointingDevice" + this .getId (), this .mousemove .bind (this))
103
+ .on ("touchend.PointingDevice" + this .getId (), this .touchend .bind (this))
104
+ .on ("touchmove.PointingDevice" + this .getId (), this .touchmove .bind (this));
115
105
 
116
106
  if (browser .buttonPressEvent (x, y))
117
107
  {
@@ -133,7 +123,7 @@ Object .assign (Object .setPrototypeOf (PointingDevice .prototype, X3DBaseNode .
133
123
  browser = this .getBrowser (),
134
124
  element = browser .getSurface ();
135
125
 
136
- const [x, y] = this .getPointer (event);
126
+ const { x, y } = browser .getPointerFromEvent (event);
137
127
 
138
128
  $(document) .off (".PointingDevice" + this .getId ());
139
129
  element .on ("mousemove.PointingDevice" + this .getId (), this .mousemove .bind (this));
@@ -162,7 +152,7 @@ Object .assign (Object .setPrototypeOf (PointingDevice .prototype, X3DBaseNode .
162
152
 
163
153
  this .motionTime = browser .getCurrentTime ();
164
154
 
165
- const [x, y] = this .getPointer (event);
155
+ const { x, y } = browser .getPointerFromEvent (event);
166
156
 
167
157
  this .onmotion (x, y);
168
158
  },
@@ -153,6 +153,17 @@ Object .assign (X3DPointingDeviceSensorContext .prototype,
153
153
  {
154
154
  return this [_pointer];
155
155
  },
156
+ getPointerFromEvent ({ pageX, pageY })
157
+ {
158
+ const
159
+ offset = this .getSurface () .offset (),
160
+ rect = this .getSurface () [0] .getBoundingClientRect (),
161
+ viewport = this .getViewport (),
162
+ x = (pageX - offset .left) / rect .width * viewport [2],
163
+ y = (1 - (pageY - offset .top) / rect .height) * viewport [3];
164
+
165
+ return new Vector2 (x, y);
166
+ },
156
167
  isPointerInRectangle (rectangle, pointer = this [_pointer])
157
168
  {
158
169
  return pointer .x >= rectangle .x &&
@@ -320,7 +331,7 @@ Object .assign (X3DPointingDeviceSensorContext .prototype,
320
331
  for (const sensor of this [_activeSensors])
321
332
  sensor .set_motion__ (hit);
322
333
  },
323
- getPointingShader (numClipPlanes, shapeNode)
334
+ getPointingShader (numClipPlanes, shapeNode, humanoidNode)
324
335
  {
325
336
  const geometryContext = shapeNode .getGeometryContext ();
326
337
 
@@ -330,6 +341,7 @@ Object .assign (X3DPointingDeviceSensorContext .prototype,
330
341
  key += ".";
331
342
  key += shapeNode .getShapeKey ();
332
343
  key += geometryContext .geometryType;
344
+ key += humanoidNode ? 1 : 0;
333
345
 
334
346
  if (geometryContext .geometryType >= 2)
335
347
  {
@@ -346,9 +358,9 @@ Object .assign (X3DPointingDeviceSensorContext .prototype,
346
358
  key += appearanceNode .getMaterial () .getTextureBits () .toString (4); // Textures for point and line.
347
359
  }
348
360
 
349
- return this [_pointingShaders] .get (key) || this .createPointingShader (key, numClipPlanes, shapeNode);
361
+ return this [_pointingShaders] .get (key) || this .createPointingShader (key, numClipPlanes, shapeNode, humanoidNode);
350
362
  },
351
- createPointingShader (key, numClipPlanes, shapeNode)
363
+ createPointingShader (key, numClipPlanes, shapeNode, humanoidNode)
352
364
  {
353
365
  const
354
366
  appearanceNode = shapeNode .getAppearance (),
@@ -369,8 +381,8 @@ Object .assign (X3DPointingDeviceSensorContext .prototype,
369
381
  if (appearanceNode .getStyleProperties (geometryContext .geometryType))
370
382
  options .push ("X3D_STYLE_PROPERTIES");
371
383
 
372
- if (+appearanceNode .getTextureBits () || +appearanceNode .getMaterial () .getTextureBits ())
373
- options .push ("X3D_TEXTURE", "X3D_NUM_TEXTURE_COORDINATES 1")
384
+ if (humanoidNode)
385
+ options .push ("X3D_SKINNING");
374
386
 
375
387
  const shaderNode = this .createShader ("PointingShader", "Pointing", "Pointing", options);
376
388
 
@@ -166,7 +166,7 @@ Object .assign (X3DRenderingContext .prototype,
166
166
  {
167
167
  return this [_frameBuffer];
168
168
  },
169
- getDepthShader (numClipPlanes, shapeNode)
169
+ getDepthShader (numClipPlanes, shapeNode, humanoidNode)
170
170
  {
171
171
  const geometryContext = shapeNode .getGeometryContext ();
172
172
 
@@ -176,6 +176,7 @@ Object .assign (X3DRenderingContext .prototype,
176
176
  key += ".";
177
177
  key += shapeNode .getShapeKey ();
178
178
  key += geometryContext .geometryType;
179
+ key += humanoidNode ? 1 : 0;
179
180
 
180
181
  if (geometryContext .geometryType >= 2)
181
182
  {
@@ -192,9 +193,9 @@ Object .assign (X3DRenderingContext .prototype,
192
193
  key += appearanceNode .getMaterial () .getTextureBits () .toString (4); // Textures for point and line.
193
194
  }
194
195
 
195
- return this [_depthShaders] .get (key) || this .createDepthShader (key, numClipPlanes, shapeNode);
196
+ return this [_depthShaders] .get (key) || this .createDepthShader (key, numClipPlanes, shapeNode, humanoidNode);
196
197
  },
197
- createDepthShader (key, numClipPlanes, shapeNode)
198
+ createDepthShader (key, numClipPlanes, shapeNode, humanoidNode)
198
199
  {
199
200
  const
200
201
  appearanceNode = shapeNode .getAppearance (),
@@ -215,8 +216,8 @@ Object .assign (X3DRenderingContext .prototype,
215
216
  if (appearanceNode .getStyleProperties (geometryContext .geometryType))
216
217
  options .push ("X3D_STYLE_PROPERTIES");
217
218
 
218
- if (+appearanceNode .getTextureBits () || +appearanceNode .getMaterial () .getTextureBits ())
219
- options .push ("X3D_TEXTURE", "X3D_NUM_TEXTURE_COORDINATES 1")
219
+ if (humanoidNode)
220
+ options .push ("X3D_SKINNING");
220
221
 
221
222
  const shaderNode = this .createShader ("DepthShader", "Depth", "Depth", options);
222
223
 
@@ -75,9 +75,11 @@ import Perlin2 from "../../../assets/shaders/webgl2/include/Perli
75
75
  import Point2 from "../../../assets/shaders/webgl2/include/Point.glsl.js";
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
+ import Skin2 from "../../../assets/shaders/webgl2/include/Skin.glsl.js";
78
79
  import Stipple2 from "../../../assets/shaders/webgl2/include/Stipple.glsl.js";
79
80
  import SpotFactor2 from "../../../assets/shaders/webgl2/include/SpotFactor.glsl.js";
80
81
  import Texture2 from "../../../assets/shaders/webgl2/include/Texture.glsl.js";
82
+ import Utils2 from "../../../assets/shaders/webgl2/include/Utils.glsl.js";
81
83
  import Vertex2 from "../../../assets/shaders/webgl2/include/Vertex.glsl.js";
82
84
 
83
85
  /* WebGL 1 */
@@ -138,9 +140,11 @@ const Shaders = {
138
140
  Point: Point2,
139
141
  PointSize: PointSize2,
140
142
  Shadow: Shadow2,
143
+ Skin: Skin2,
141
144
  Stipple: Stipple2,
142
145
  SpotFactor: SpotFactor2,
143
146
  Texture: Texture2,
147
+ Utils: Utils2,
144
148
  Vertex: Vertex2,
145
149
  },
146
150
  },
@@ -179,9 +179,9 @@ Object .assign (X3DShapeContext .prototype,
179
179
  ];
180
180
 
181
181
  const transformFeedbackVaryings = [
182
- "lineStipple0", "fogDepth0", "color0", "normal0", "vertex0",
183
- "lineStipple1", "fogDepth1", "color1", "normal1", "vertex1",
184
- "lineStipple2", "fogDepth2", "color2", "normal2", "vertex2",
182
+ "coordIndex0", "lineStipple0", "fogDepth0", "color0", "normal0", "vertex0",
183
+ "coordIndex1", "lineStipple1", "fogDepth1", "color1", "normal1", "vertex1",
184
+ "coordIndex2", "lineStipple2", "fogDepth2", "color2", "normal2", "vertex2",
185
185
  ];
186
186
 
187
187
  this [_lineTransformShaderNode] = this .createShader ("LineTransformShader", "LineTransform", "LineTransform", [ ], uniformNames, transformFeedbackVaryings);
@@ -45,12 +45,13 @@
45
45
  *
46
46
  ******************************************************************************/
47
47
 
48
- import Fields from "../../Fields.js";
48
+ import X3DConstants from "../../Base/X3DConstants.js";
49
+ import Fields from "../../Fields.js";
49
50
 
50
51
  function X3DSoundContext ()
51
52
  {
52
- this .addChildObjects ("volume", new Fields .SFFloat (1),
53
- "mute", new Fields .SFBool ());
53
+ this .addChildObjects (X3DConstants .outputOnly, "volume", new Fields .SFFloat (1),
54
+ X3DConstants .outputOnly, "mute", new Fields .SFBool ());
54
55
  }
55
56
 
56
57
  export default X3DSoundContext;
@@ -45,9 +45,9 @@
45
45
  *
46
46
  ******************************************************************************/
47
47
 
48
+ import Fields from "../../Fields.js";
48
49
  import PrimitiveQuality from "../Core/PrimitiveQuality.js";
49
50
  import X3DTextGeometry from "./X3DTextGeometry.js";
50
- import X3DGeometryNode from "../../Components/Rendering/X3DGeometryNode.js";
51
51
  import Vector3 from "../../../standard/Math/Numbers/Vector3.js";
52
52
  import Matrix4 from "../../../standard/Math/Numbers/Matrix4.js";
53
53
  import Bezier from "../../../standard/Math/Algorithms/Bezier.js";
@@ -59,7 +59,7 @@ function PolygonText (text, fontStyle)
59
59
 
60
60
  text ._transparent = false;
61
61
 
62
- this .texCoordArray = X3DGeometryNode .createArray ();
62
+ this .texCoordArray = new Fields .MFFloat ();
63
63
  }
64
64
 
65
65
  Object .assign (Object .setPrototypeOf (PolygonText .prototype, X3DTextGeometry .prototype),
@@ -90,7 +90,7 @@ Object .assign (X3DTexturingContext .prototype,
90
90
 
91
91
  const maxCombinedTextureUnits = gl .getParameter (gl .MAX_COMBINED_TEXTURE_IMAGE_UNITS);
92
92
 
93
- this [_combinedTextureUnits] = [...Array (maxCombinedTextureUnits) .keys ()];
93
+ this [_combinedTextureUnits] = [...Array (maxCombinedTextureUnits) .keys ()] .reverse ();
94
94
  this [_texture2DUnits] = [this [_combinedTextureUnits] .pop ()];
95
95
  this [_texture3DUnits] = [this [_combinedTextureUnits] .pop ()];
96
96
  this [_textureCubeUnits] = [this [_combinedTextureUnits] .pop ()];
@@ -45,4 +45,4 @@
45
45
  *
46
46
  ******************************************************************************/
47
47
 
48
- export default "8.9.5";
48
+ export default "8.10.0";
@@ -96,9 +96,16 @@ function X3DBrowser (element)
96
96
  this [_supportedComponents] = SupportedComponents .copy ();
97
97
  this [_concreteNodes] = ConcreteNodes .copy ();
98
98
  this [_abstractNodes] = AbstractNodes .copy ();
99
- this [_browserCallbacks] = new Map ();
100
99
  this [_console] = document .getElementsByClassName ("x_ite-console");
101
100
 
101
+ this [_browserCallbacks] = new Map ([
102
+ [X3DConstants .CONNECTION_ERROR, new Map ()],
103
+ [X3DConstants .BROWSER_EVENT, new Map ()],
104
+ [X3DConstants .INITIALIZED_EVENT, new Map ()],
105
+ [X3DConstants .SHUTDOWN_EVENT, new Map ()],
106
+ [X3DConstants .INITIALIZED_ERROR, new Map ()],
107
+ ]);
108
+
102
109
  this .setup ();
103
110
  };
104
111
 
@@ -216,7 +223,7 @@ Object .assign (Object .setPrototypeOf (X3DBrowser .prototype, X3DBrowserContext
216
223
 
217
224
  if (component)
218
225
  {
219
- return new ComponentInfo (name,
226
+ return new ComponentInfo (component .name,
220
227
  Algorithm .clamp (level || component .level, 1, component .level),
221
228
  component .title,
222
229
  component .providerUrl,
@@ -666,30 +673,52 @@ Object .assign (Object .setPrototypeOf (X3DBrowser .prototype, X3DBrowserContext
666
673
  {
667
674
  // The string describes the name of the callback function to be called within the current ECMAScript context.
668
675
  },
669
- addBrowserCallback (key, object)
676
+ addBrowserCallback (... args)
670
677
  {
671
- this [_browserCallbacks] .set (key, object);
678
+ switch (args .length)
679
+ {
680
+ case 2:
681
+ {
682
+ const [key, object] = args;
683
+
684
+ this [_browserCallbacks] .forEach (map => map .set (key, object));
685
+ break;
686
+ }
687
+ case 3:
688
+ {
689
+ const [key, event, object] = args;
690
+
691
+ this [_browserCallbacks] .get (event) .set (key, object);
692
+ break;
693
+ }
694
+ }
672
695
  },
673
- removeBrowserCallback (key)
696
+ removeBrowserCallback (key, event)
674
697
  {
675
- this [_browserCallbacks] .delete (key);
698
+ if (arguments .length === 2)
699
+ this [_browserCallbacks] .get (event) .delete (key);
700
+ else
701
+ this [_browserCallbacks] .forEach (map => map .delete (key));
676
702
  },
677
- getBrowserCallbacks ()
703
+ getBrowserCallbacks (event)
678
704
  {
679
- return this [_browserCallbacks];
705
+ if (arguments .length === 1)
706
+ return this [_browserCallbacks] .get (event);
707
+ else
708
+ return new Map ([... this [_browserCallbacks]] .flatMap (([event, map]) => [... map]));
680
709
  },
681
710
  callBrowserCallbacks: (() =>
682
711
  {
683
- const browserCallbacks = [ ];
712
+ const values = [ ];
684
713
 
685
- return function (browserEvent)
714
+ return function (event)
686
715
  {
687
- if (this [_browserCallbacks] .size)
716
+ const browserCallbacks = this [_browserCallbacks] .get (event);
717
+
718
+ if (browserCallbacks .size)
688
719
  {
689
- for (const browserCallback of MapUtilities .values (browserCallbacks, this [_browserCallbacks]))
690
- {
691
- browserCallback (browserEvent);
692
- }
720
+ for (const callback of MapUtilities .values (values, browserCallbacks))
721
+ callback (event);
693
722
  }
694
723
  };
695
724
  })(),
@@ -749,14 +778,17 @@ Object .assign (Object .setPrototypeOf (X3DBrowser .prototype, X3DBrowserContext
749
778
  {
750
779
  return this .getRenderingProperties () .getField (name) .getValue ();
751
780
  },
752
- viewAll (layerNode)
781
+ viewAll (layerNode, transitionTime = 1)
753
782
  {
783
+ if (arguments .length === 1 && typeof layerNode === "number")
784
+ transitionTime = layerNode;
785
+
754
786
  layerNode = X3DCast (X3DConstants .X3DLayerNode, layerNode) ?? this .getActiveLayer ();
755
787
 
756
788
  if (!layerNode)
757
789
  return;
758
790
 
759
- layerNode .viewAll (1, this .getBrowserOption ("StraightenHorizon"));
791
+ layerNode .viewAll (transitionTime, 1, this .getBrowserOption ("StraightenHorizon"));
760
792
  },
761
793
  firstViewpoint (layerNode)
762
794
  {
@@ -46,6 +46,7 @@
46
46
  ******************************************************************************/
47
47
 
48
48
  import SFTime from "../Fields/SFTime.js";
49
+ import X3DConstants from "../Base/X3DConstants.js";
49
50
  import X3DBaseNode from "../Base/X3DBaseNode.js";
50
51
  import X3DCoreContext from "./Core/X3DCoreContext.js";
51
52
  import X3DEnvironmentalEffectsContext from "./EnvironmentalEffects/X3DEnvironmentalEffectsContext.js";
@@ -117,13 +118,13 @@ function X3DBrowserContext (element)
117
118
  for (const browserContext of browserContexts)
118
119
  browserContext .call (this);
119
120
 
120
- this .addChildObjects ("initialized", new SFTime (),
121
- "shutdown", new SFTime (),
122
- "prepareEvents", new SFTime (),
123
- "timeEvents", new SFTime (),
124
- "sensorEvents", new SFTime (),
125
- "displayEvents", new SFTime (),
126
- "finishedEvents", new SFTime ());
121
+ this .addChildObjects (X3DConstants .outputOnly, "initialized", new SFTime (),
122
+ X3DConstants .outputOnly, "shutdown", new SFTime (),
123
+ X3DConstants .outputOnly, "prepareEvents", new SFTime (),
124
+ X3DConstants .outputOnly, "timeEvents", new SFTime (),
125
+ X3DConstants .outputOnly, "sensorEvents", new SFTime (),
126
+ X3DConstants .outputOnly, "displayEvents", new SFTime (),
127
+ X3DConstants .outputOnly, "finishedEvents", new SFTime ());
127
128
 
128
129
  this [_changedTime] = 0;
129
130
  this [_previousTime] = 0;
@@ -58,11 +58,8 @@ function X3DChildNode (executionContext)
58
58
 
59
59
  this .addType (X3DConstants .X3DChildNode);
60
60
 
61
- this .addChildObjects ("isCameraObject", new Fields .SFBool (),
62
- "isPickableObject", new Fields .SFBool ());
63
-
64
- this ._isCameraObject .setAccessType (X3DConstants .outputOnly);
65
- this ._isPickableObject .setAccessType (X3DConstants .outputOnly);
61
+ this .addChildObjects (X3DConstants .outputOnly, "isCameraObject", new Fields .SFBool (),
62
+ X3DConstants .outputOnly, "isPickableObject", new Fields .SFBool ());
66
63
  }
67
64
 
68
65
  Object .assign (Object .setPrototypeOf (X3DChildNode .prototype, X3DNode .prototype),
@@ -96,6 +96,19 @@ Object .assign (Object .setPrototypeOf (X3DPrototypeInstance .prototype, X3DNode
96
96
 
97
97
  if (protoNode .isExternProto)
98
98
  {
99
+ if (protoNode .checkLoadState () !== X3DConstants .COMPLETE_STATE)
100
+ {
101
+ this [_body] = null;
102
+
103
+ if (this .isInitialized ())
104
+ X3DChildObject .prototype .addEvent .call (this);
105
+
106
+ protoNode ._updateInstances .addInterest ("construct", this);
107
+ protoNode .requestImmediateLoad () .catch (Function .prototype);
108
+
109
+ return;
110
+ }
111
+
99
112
  for (const protoField of proto .getUserDefinedFields ())
100
113
  {
101
114
  try
@@ -233,22 +246,7 @@ Object .assign (Object .setPrototypeOf (X3DPrototypeInstance .prototype, X3DNode
233
246
 
234
247
  protoNode ._name_changed .addFieldInterest (this ._typeName_changed);
235
248
 
236
- if (protoNode .isExternProto && protoNode .checkLoadState () !== X3DConstants .COMPLETE_STATE)
237
- {
238
- this [_body] = null;
239
-
240
- if (this .isInitialized ())
241
- X3DChildObject .prototype .addEvent .call (this);
242
-
243
- protoNode ._updateInstances .addInterest ("construct", this);
244
- protoNode .requestImmediateLoad () .catch (Function .prototype);
245
-
246
- return;
247
- }
248
- else
249
- {
250
- this .construct ();
251
- }
249
+ this .construct ();
252
250
  },
253
251
  getBody ()
254
252
  {
@@ -69,7 +69,7 @@ function ComposedCubeMapTexture (executionContext)
69
69
  this .addAlias ("bottom", this ._bottomTexture);
70
70
  }
71
71
 
72
- this .addChildObjects ("update", new Fields .SFTime ());
72
+ this .addChildObjects (X3DConstants .inputOutput, "update", new Fields .SFTime ());
73
73
 
74
74
  this .textureNodes = [null, null, null, null, null, null];
75
75
  this .textureBits = new BitSet ();
@@ -56,7 +56,7 @@ function X3DEnvironmentalSensorNode (executionContext)
56
56
 
57
57
  this .addType (X3DConstants .X3DEnvironmentalSensorNode);
58
58
 
59
- this .addChildObjects ("traversed", new Fields .SFBool (true));
59
+ this .addChildObjects (X3DConstants .outputOnly, "traversed", new Fields .SFBool (true));
60
60
 
61
61
  this ._size .setUnit ("length");
62
62
  this ._center .setUnit ("length");
@@ -223,8 +223,8 @@ Object .assign (Object .setPrototypeOf (ElevationGrid .prototype, X3DGeometryNod
223
223
  normals .push (normal);
224
224
  }
225
225
 
226
- // if (!this ._normalPerVertex .getValue ())
227
- // return normals;
226
+ if (!this ._normalPerVertex .getValue ())
227
+ return normals;
228
228
 
229
229
  return this .refineNormals (normalIndex, normals, this ._creaseAngle .getValue ());
230
230
  },
@@ -293,6 +293,7 @@ Object .assign (Object .setPrototypeOf (ElevationGrid .prototype, X3DGeometryNod
293
293
  colorPerVertex = this ._colorPerVertex .getValue (),
294
294
  normalPerVertex = this ._normalPerVertex .getValue (),
295
295
  coordIndex = this .createCoordIndex (),
296
+ coordIndicesArray = this .getCoordIndices (),
296
297
  attribNodes = this .getAttrib (),
297
298
  numAttribNodes = attribNodes .length,
298
299
  attribArrays = this .getAttribs (),
@@ -332,6 +333,8 @@ Object .assign (Object .setPrototypeOf (ElevationGrid .prototype, X3DGeometryNod
332
333
  index = coordIndex [c],
333
334
  point = points [index];
334
335
 
336
+ coordIndicesArray .push (index);
337
+
335
338
  for (let a = 0; a < numAttribNodes; ++ a)
336
339
  attribNodes [a] .addValue (index, attribArrays [a]);
337
340