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
@@ -88,9 +88,9 @@ function X3DBaseNode (executionContext, browser = executionContext .getBrowser (
88
88
 
89
89
  // Create fields.
90
90
 
91
- this .addChildObjects ("name_changed", new Fields .SFTime (),
92
- "typeName_changed", new Fields .SFTime (),
93
- "parents_changed", new Fields .SFTime ())
91
+ this .addChildObjects (X3DConstants .outputOnly, "name_changed", new Fields .SFTime (),
92
+ X3DConstants .outputOnly, "typeName_changed", new Fields .SFTime (),
93
+ X3DConstants .outputOnly, "parents_changed", new Fields .SFTime ())
94
94
 
95
95
  for (const fieldDefinition of this [_fieldDefinitions])
96
96
  this .addPredefinedField (fieldDefinition);
@@ -144,6 +144,64 @@ Object .assign (Object .setPrototypeOf (X3DBaseNode .prototype, X3DChildObject .
144
144
  {
145
145
  return this [_type];
146
146
  },
147
+ create (executionContext = this [_executionContext])
148
+ {
149
+ return new (this .constructor) (executionContext);
150
+ },
151
+ copy (executionContext)
152
+ {
153
+ const copy = this .create (executionContext);
154
+
155
+ for (const field of this [_predefinedFields])
156
+ copy .getPredefinedFields () .get (field .getName ()) .assign (field);
157
+
158
+ if (this .canUserDefinedFields ())
159
+ {
160
+ for (const field of this [_userDefinedFields])
161
+ copy .addUserDefinedField (field .getAccessType (), field .getName (), field .copy ());
162
+ }
163
+
164
+ copy .setup ();
165
+
166
+ return copy;
167
+ },
168
+ // replaceWith (replacement, cache = false)
169
+ // {
170
+ // cache = cache && SFNodeCache .get (this);
171
+
172
+ // for (const parent of new Set (this .getParents ()))
173
+ // {
174
+ // if (parent instanceof Fields .SFNode && parent !== cache)
175
+ // parent .setValue (replacement)
176
+ // }
177
+ // },
178
+ setup ()
179
+ {
180
+ Object .freeze (this [_type]);
181
+
182
+ this [_fieldDefinitions] .addParent (this);
183
+ this [_predefinedFields] .addParent (this);
184
+ this [_userDefinedFields] .addParent (this);
185
+
186
+ for (const field of this [_childObjects])
187
+ field .setTainted (false);
188
+
189
+ for (const field of this [_predefinedFields])
190
+ field .setTainted (false);
191
+
192
+ for (const field of this [_userDefinedFields])
193
+ field .setTainted (false);
194
+
195
+ this .initialize ();
196
+
197
+ this [_initialized] = true;
198
+ },
199
+ initialize ()
200
+ { },
201
+ isInitialized ()
202
+ {
203
+ return this [_initialized];
204
+ },
147
205
  getInnerNode ()
148
206
  {
149
207
  return this;
@@ -180,7 +238,7 @@ Object .assign (Object .setPrototypeOf (X3DBaseNode .prototype, X3DChildObject .
180
238
 
181
239
  // Add isLive event.
182
240
 
183
- this .addChildObjects ("live", new Fields .SFBool (this .getLiveState ()));
241
+ this .addChildObjects (X3DConstants .outputOnly, "live", new Fields .SFBool (this .getLiveState ()));
184
242
 
185
243
  // Event processing is done manually and immediately, so:
186
244
  this ._live .removeParent (this);
@@ -234,66 +292,19 @@ Object .assign (Object .setPrototypeOf (X3DBaseNode .prototype, X3DChildObject .
234
292
  }
235
293
  }
236
294
  },
237
- create (executionContext = this [_executionContext])
295
+ addChildObjects (/* accessType, name, field, ... */)
238
296
  {
239
- return new (this .constructor) (executionContext);
297
+ for (let i = 0, length = arguments .length; i < length; i += 3)
298
+ this .addChildObject (arguments [i], arguments [i + 1], arguments [i + 2]);
240
299
  },
241
- setup ()
242
- {
243
- Object .freeze (this [_type]);
244
-
245
- this [_fieldDefinitions] .addParent (this);
246
- this [_predefinedFields] .addParent (this);
247
- this [_userDefinedFields] .addParent (this);
248
-
249
- for (const field of this [_childObjects])
250
- field .setTainted (false);
251
-
252
- for (const field of this [_predefinedFields])
253
- field .setTainted (false);
254
-
255
- for (const field of this [_userDefinedFields])
256
- field .setTainted (false);
257
-
258
- this .initialize ();
259
-
260
- this [_initialized] = true;
261
- },
262
- initialize ()
263
- { },
264
- isInitialized ()
265
- {
266
- return this [_initialized];
267
- },
268
- copy (executionContext)
269
- {
270
- const copy = this .create (executionContext);
271
-
272
- for (const field of this [_predefinedFields])
273
- copy .getPredefinedFields () .get (field .getName ()) .assign (field);
274
-
275
- if (this .canUserDefinedFields ())
276
- {
277
- for (const field of this [_userDefinedFields])
278
- copy .addUserDefinedField (field .getAccessType (), field .getName (), field .copy ());
279
- }
280
-
281
- copy .setup ();
282
-
283
- return copy;
284
- },
285
- addChildObjects (/* name, field, ... */)
286
- {
287
- for (let i = 0, length = arguments .length; i < length; i += 2)
288
- this .addChildObject (arguments [i], arguments [i + 1]);
289
- },
290
- addChildObject (name, field)
300
+ addChildObject (accessType, name, field)
291
301
  {
292
302
  this [_childObjects] .push (field);
293
303
 
294
304
  field .setTainted (true);
295
305
  field .addParent (this);
296
306
  field .setName (name);
307
+ field .setAccessType (accessType);
297
308
 
298
309
  Object .defineProperty (this, `_${name}`,
299
310
  {
@@ -502,6 +513,12 @@ Object .assign (Object .setPrototypeOf (X3DBaseNode .prototype, X3DChildObject .
502
513
  if (field .isTainted ())
503
514
  return;
504
515
 
516
+ // if (this .getTypeName () === "IndexedQuadSet")
517
+ // {
518
+ // console .log (field .getName ());
519
+ // console .trace ();
520
+ // }
521
+
505
522
  field .setTainted (true);
506
523
 
507
524
  this .addEventObject (field, Events .create (field));
@@ -100,14 +100,14 @@ if (DEVELOPMENT)
100
100
  this .setModificationTime (Date .now ());
101
101
 
102
102
  for (const parent of this [_parents] .values ())
103
- parent .deref () .addEvent (this);
103
+ parent .deref () ?.addEvent (this);
104
104
  },
105
105
  addEventObject (field, event)
106
106
  {
107
107
  this .setModificationTime (Date .now ());
108
108
 
109
109
  for (const parent of this [_parents] .values ())
110
- parent .deref () .addEventObject (this, event);
110
+ parent .deref () ?.addEventObject (this, event);
111
111
  },
112
112
  processEvent ()
113
113
  {
@@ -119,7 +119,7 @@ if (DEVELOPMENT)
119
119
  let cloneCount = 0;
120
120
 
121
121
  for (const weakRef of this [_parents] .values ())
122
- cloneCount += weakRef .deref () .collectCloneCount ();
122
+ cloneCount += weakRef .deref () ?.collectCloneCount ();
123
123
 
124
124
  return cloneCount;
125
125
  },
@@ -154,6 +154,8 @@ if (DEVELOPMENT)
154
154
  for (const weakRef of this [_parents] .values ())
155
155
  parents .add (weakRef .deref ())
156
156
 
157
+ parents .delete (undefined);
158
+
157
159
  return parents;
158
160
  },
159
161
  parentsChanged () { },
@@ -160,10 +160,9 @@ Object .assign (Object .setPrototypeOf (X3DObjectArrayField .prototype, X3DArray
160
160
  {
161
161
  const
162
162
  target = this [_target],
163
- copy = target .create (),
164
- array = target .getValue ();
163
+ copy = target .create ();
165
164
 
166
- copy .push (... array);
165
+ copy .assign (target);
167
166
  copy .setModificationTime (0);
168
167
 
169
168
  return copy;
@@ -330,10 +329,13 @@ Object .assign (Object .setPrototypeOf (X3DObjectArrayField .prototype, X3DArray
330
329
  const
331
330
  target = this [_target],
332
331
  values = target .getValue () .splice (index, deleteCount),
333
- result = new (target .constructor) (... values);
332
+ result = new (target .constructor) ();
334
333
 
335
334
  for (const value of values)
335
+ {
336
+ result .push (value);
336
337
  target .removeChildObject (value);
338
+ }
337
339
 
338
340
  target .addEvent ();
339
341
 
@@ -106,7 +106,7 @@ const extensions = [
106
106
 
107
107
  const Context =
108
108
  {
109
- create (canvas, version, preserveDrawingBuffer)
109
+ create (canvas, version, preserveDrawingBuffer, mobile)
110
110
  {
111
111
  const options = { preserveDrawingBuffer: preserveDrawingBuffer };
112
112
 
@@ -143,6 +143,11 @@ const Context =
143
143
  if (!gl)
144
144
  throw new Error ("Couldn't create WebGL context.");
145
145
 
146
+ // Load extensions.
147
+
148
+ for (const extension of extensions)
149
+ gl .getExtension (extension);
150
+
146
151
  // Feature detection:
147
152
 
148
153
  // If the aliased lineWidth ranges are both 1, gl .lineWidth is probably not possible,
@@ -185,10 +190,15 @@ const Context =
185
190
  }
186
191
  }
187
192
 
188
- // Load extensions.
193
+ if (mobile)
194
+ {
195
+ const color_buffer_half_float = gl .getExtension ("EXT_color_buffer_half_float");
189
196
 
190
- for (const extension of extensions)
191
- gl .getExtension (extension);
197
+ Object .defineProperty (gl, "RGBA32F",
198
+ {
199
+ value: gl .getVersion () === 1 ? color_buffer_half_float .RGBA16F_EXT : gl .RGBA16F,
200
+ });
201
+ }
192
202
 
193
203
  // Async functions
194
204
 
@@ -45,8 +45,9 @@
45
45
  *
46
46
  ******************************************************************************/
47
47
 
48
- import SFString from "../../Fields/SFString.js";
49
- import X3DBaseNode from "../../Base/X3DBaseNode.js";
48
+ import SFString from "../../Fields/SFString.js";
49
+ import X3DBaseNode from "../../Base/X3DBaseNode.js";
50
+ import X3DConstants from "../../Base/X3DConstants.js";
50
51
 
51
52
  $.fn.textWidth = function (string)
52
53
  {
@@ -65,7 +66,7 @@ function Notification (executionContext)
65
66
  {
66
67
  X3DBaseNode .call (this, executionContext);
67
68
 
68
- this .addChildObjects ("string", new SFString ());
69
+ this .addChildObjects (X3DConstants .inputOutput, "string", new SFString ());
69
70
  }
70
71
 
71
72
  Object .assign (Object .setPrototypeOf (Notification .prototype, X3DBaseNode .prototype),
@@ -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 Context from "./Context.js";
50
51
  import BrowserTimings from "./BrowserTimings.js";
@@ -121,15 +122,14 @@ function X3DCoreContext (element)
121
122
  $("<div></div>") .addClass ("x_ite-private-spinner-text") .appendTo (progress);
122
123
 
123
124
  this [_instanceId] = ++ instanceId;
125
+ this [_localStorage] = new DataStorage (localStorage, "X_ITE.X3DBrowser(" + this [_instanceId] + ").");
126
+ this [_mobile] = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i .test (navigator .userAgent);
124
127
  this [_element] = element;
125
128
  this [_surface] = surface;
126
129
  this [_canvas] = $("<canvas></canvas>") .addClass ("x_ite-private-canvas") .prependTo (surface);
127
- this [_context] = Context .create (this [_canvas] [0], WEBGL_LATEST_VERSION, element .attr ("preserveDrawingBuffer") === "true");
130
+ this [_context] = Context .create (this [_canvas] [0], WEBGL_LATEST_VERSION, element .attr ("preserveDrawingBuffer") === "true", this [_mobile]);
128
131
  this [_splashScreen] = splashScreen;
129
132
 
130
- this [_localStorage] = new DataStorage (localStorage, "X_ITE.X3DBrowser(" + this [_instanceId] + ").");
131
- this [_mobile] = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i .test (navigator .userAgent);
132
-
133
133
  this [_renderingProperties] = new RenderingProperties (this .getPrivateScene ());
134
134
  this [_browserOptions] = new BrowserOptions (this .getPrivateScene ());
135
135
  this [_browserProperties] = new BrowserProperties (this .getPrivateScene ());
@@ -141,10 +141,10 @@ function X3DCoreContext (element)
141
141
  this [_pixelPerPoint] = inches .height () / 720 || 1;
142
142
  inches .remove ();
143
143
 
144
- this .addChildObjects ("controlKey", new Fields .SFBool (),
145
- "shiftKey", new Fields .SFBool (),
146
- "altKey", new Fields .SFBool (),
147
- "altGrKey", new Fields .SFBool ());
144
+ this .addChildObjects (X3DConstants .outputOnly, "controlKey", new Fields .SFBool (),
145
+ X3DConstants .outputOnly, "shiftKey", new Fields .SFBool (),
146
+ X3DConstants .outputOnly, "altKey", new Fields .SFBool (),
147
+ X3DConstants .outputOnly, "altGrKey", new Fields .SFBool ());
148
148
  }
149
149
 
150
150
  Object .assign (X3DCoreContext .prototype,
@@ -45,14 +45,15 @@
45
45
  *
46
46
  ******************************************************************************/
47
47
 
48
- import X3DBaseNode from "../../Base/X3DBaseNode.js";
49
- import Fields from "../../Fields.js";
48
+ import X3DBaseNode from "../../Base/X3DBaseNode.js";
49
+ import X3DConstants from "../../Base/X3DConstants.js";
50
+ import Fields from "../../Fields.js";
50
51
 
51
52
  function Arc2DOptions (executionContext)
52
53
  {
53
54
  X3DBaseNode .call (this, executionContext);
54
55
 
55
- this .addChildObjects ("dimension", new Fields .SFInt32 (40))
56
+ this .addChildObjects (X3DConstants .inputOutput, "dimension", new Fields .SFInt32 (40))
56
57
  }
57
58
 
58
59
  Object .setPrototypeOf (Arc2DOptions .prototype, X3DBaseNode .prototype);
@@ -45,14 +45,15 @@
45
45
  *
46
46
  ******************************************************************************/
47
47
 
48
- import X3DBaseNode from "../../Base/X3DBaseNode.js";
49
- import Fields from "../../Fields.js";
48
+ import X3DBaseNode from "../../Base/X3DBaseNode.js";
49
+ import X3DConstants from "../../Base/X3DConstants.js";
50
+ import Fields from "../../Fields.js";
50
51
 
51
52
  function ArcClose2DOptions (executionContext)
52
53
  {
53
54
  X3DBaseNode .call (this, executionContext);
54
55
 
55
- this .addChildObjects ("dimension", new Fields .SFInt32 (40))
56
+ this .addChildObjects (X3DConstants .inputOutput, "dimension", new Fields .SFInt32 (40))
56
57
  }
57
58
 
58
59
  Object .setPrototypeOf (ArcClose2DOptions .prototype, X3DBaseNode .prototype);
@@ -45,18 +45,18 @@
45
45
  *
46
46
  ******************************************************************************/
47
47
 
48
- import X3DBaseNode from "../../Base/X3DBaseNode.js";
49
- import Fields from "../../Fields.js";
50
- import X3DGeometryNode from "../../Components/Rendering/X3DGeometryNode.js";
51
- import Complex from "../../../standard/Math/Numbers/Complex.js";
48
+ import Fields from "../../Fields.js";
49
+ import X3DBaseNode from "../../Base/X3DBaseNode.js";
50
+ import X3DConstants from "../../Base/X3DConstants.js";
51
+ import Complex from "../../../standard/Math/Numbers/Complex.js";
52
52
 
53
53
  function Circle2DOptions (executionContext)
54
54
  {
55
55
  X3DBaseNode .call (this, executionContext);
56
56
 
57
- this .addChildObjects ("dimension", new Fields .SFInt32 (40))
57
+ this .addChildObjects (X3DConstants .inputOutput, "dimension", new Fields .SFInt32 (40))
58
58
 
59
- this .vertices = X3DGeometryNode .createArray ();
59
+ this .vertices = new Fields .MFFloat ();
60
60
  }
61
61
 
62
62
  Object .assign (Object .setPrototypeOf (Circle2DOptions .prototype, X3DBaseNode .prototype),
@@ -45,22 +45,21 @@
45
45
  *
46
46
  ******************************************************************************/
47
47
 
48
- import X3DBaseNode from "../../Base/X3DBaseNode.js";
49
- import Fields from "../../Fields.js";
50
- import X3DGeometryNode from "../../Components/Rendering/X3DGeometryNode.js";
51
- import Complex from "../../../standard/Math/Numbers/Complex.js";
52
- import Vector3 from "../../../standard/Math/Numbers/Vector3.js";
48
+ import Fields from "../../Fields.js";
49
+ import X3DBaseNode from "../../Base/X3DBaseNode.js";
50
+ import X3DConstants from "../../Base/X3DConstants.js";
51
+ import Complex from "../../../standard/Math/Numbers/Complex.js";
53
52
 
54
53
  function Disk2DOptions (executionContext)
55
54
  {
56
55
  X3DBaseNode .call (this, executionContext);
57
56
 
58
- this .addChildObjects ("dimension", new Fields .SFInt32 (40))
57
+ this .addChildObjects (X3DConstants .inputOutput, "dimension", new Fields .SFInt32 (40))
59
58
 
60
- this .circleVertices = X3DGeometryNode .createArray ();
61
- this .diskTexCoords = X3DGeometryNode .createArray ();
62
- this .diskNormals = X3DGeometryNode .createArray ();
63
- this .diskVertices = X3DGeometryNode .createArray ();
59
+ this .circleVertices = new Fields .MFFloat ();
60
+ this .diskTexCoords = new Fields .MFFloat ();
61
+ this .diskNormals = new Fields .MFFloat ();
62
+ this .diskVertices = new Fields .MFFloat ();
64
63
  }
65
64
 
66
65
  Object .assign (Object .setPrototypeOf (Disk2DOptions .prototype, X3DBaseNode .prototype),
@@ -45,15 +45,16 @@
45
45
  *
46
46
  ******************************************************************************/
47
47
 
48
- import Fields from "../../Fields.js";
49
- import X3DBaseNode from "../../Base/X3DBaseNode.js";
48
+ import Fields from "../../Fields.js";
49
+ import X3DConstants from "../../Base/X3DConstants.js";
50
+ import X3DBaseNode from "../../Base/X3DBaseNode.js";
50
51
 
51
52
  function ConeOptions (executionContext)
52
53
  {
53
54
  X3DBaseNode .call (this, executionContext);
54
55
 
55
- this .addChildObjects ("xDimension", new Fields .SFInt32 (20),
56
- "yDimension", new Fields .SFInt32 (1))
56
+ this .addChildObjects (X3DConstants .inputOutput, "xDimension", new Fields .SFInt32 (20),
57
+ X3DConstants .inputOutput, "yDimension", new Fields .SFInt32 (1))
57
58
  }
58
59
 
59
60
  Object .setPrototypeOf (ConeOptions .prototype, X3DBaseNode .prototype);
@@ -45,15 +45,16 @@
45
45
  *
46
46
  ******************************************************************************/
47
47
 
48
- import Fields from "../../Fields.js";
49
- import X3DBaseNode from "../../Base/X3DBaseNode.js";
48
+ import Fields from "../../Fields.js";
49
+ import X3DConstants from "../../Base/X3DConstants.js";
50
+ import X3DBaseNode from "../../Base/X3DBaseNode.js";
50
51
 
51
52
  function CylinderOptions (executionContext)
52
53
  {
53
54
  X3DBaseNode .call (this, executionContext);
54
55
 
55
- this .addChildObjects ("xDimension", new Fields .SFInt32 (20),
56
- "yDimension", new Fields .SFInt32 (1))
56
+ this .addChildObjects (X3DConstants .inputOutput, "xDimension", new Fields .SFInt32 (20),
57
+ X3DConstants .inputOutput, "yDimension", new Fields .SFInt32 (1))
57
58
  }
58
59
 
59
60
  Object .setPrototypeOf (CylinderOptions .prototype, X3DBaseNode .prototype);
@@ -46,6 +46,7 @@
46
46
  ******************************************************************************/
47
47
 
48
48
  import Fields from "../../Fields.js";
49
+ import X3DConstants from "../../Base/X3DConstants.js";
49
50
  import X3DBaseNode from "../../Base/X3DBaseNode.js";
50
51
  import IndexedFaceSet from "../../Components/Geometry3D/IndexedFaceSet.js";
51
52
  import Coordinate from "../../Components/Rendering/Coordinate.js";
@@ -56,8 +57,8 @@ function IcoSphereOptions (executionContext)
56
57
  {
57
58
  X3DBaseNode .call (this, executionContext);
58
59
 
59
- this .addChildObjects ("type", new Fields .SFString ("ICOSAHEDRON"),
60
- "order", new Fields .SFInt32 (2))
60
+ this .addChildObjects (X3DConstants .inputOutput, "type", new Fields .SFString ("ICOSAHEDRON"),
61
+ X3DConstants .inputOutput, "order", new Fields .SFInt32 (2))
61
62
  }
62
63
 
63
64
  Object .assign (Object .setPrototypeOf (IcoSphereOptions .prototype, X3DBaseNode .prototype),
@@ -46,6 +46,7 @@
46
46
  ******************************************************************************/
47
47
 
48
48
  import Fields from "../../Fields.js";
49
+ import X3DConstants from "../../Base/X3DConstants.js";
49
50
  import X3DBaseNode from "../../Base/X3DBaseNode.js";
50
51
  import IndexedFaceSet from "../../Components/Geometry3D/IndexedFaceSet.js";
51
52
  import Coordinate from "../../Components/Rendering/Coordinate.js";
@@ -58,8 +59,8 @@ function QuadSphereOptions (executionContext)
58
59
  {
59
60
  X3DBaseNode .call (this, executionContext);
60
61
 
61
- this .addChildObjects ("xDimension", new Fields .SFInt32 (32),
62
- "yDimension", new Fields .SFInt32 (15))
62
+ this .addChildObjects (X3DConstants .inputOutput, "xDimension", new Fields .SFInt32 (32),
63
+ X3DConstants .inputOutput, "yDimension", new Fields .SFInt32 (15))
63
64
  }
64
65
 
65
66
  Object .assign (Object .setPrototypeOf (QuadSphereOptions .prototype, X3DBaseNode .prototype),
@@ -45,10 +45,10 @@
45
45
  *
46
46
  ******************************************************************************/
47
47
 
48
+ import Fields from "../../Fields.js";
48
49
  import X3DTextGeometry from "../Text/X3DTextGeometry.js";
49
50
  import TextAlignment from "../Text/TextAlignment.js";
50
51
  import PixelTexture from "../../Components/Texturing/PixelTexture.js";
51
- import X3DGeometryNode from "../../Components/Rendering/X3DGeometryNode.js";
52
52
  import Vector3 from "../../../standard/Math/Numbers/Vector3.js";
53
53
  import Matrix4 from "../../../standard/Math/Numbers/Matrix4.js";
54
54
  import Box3 from "../../../standard/Math/Geometry/Box3.js";
@@ -60,7 +60,7 @@ function ScreenText (text, fontStyle)
60
60
 
61
61
  text .setTransparent (true);
62
62
 
63
- this .texCoordArray = X3DGeometryNode .createArray ();
63
+ this .texCoordArray = new Fields .MFFloat ();
64
64
  this .textureNode = new PixelTexture (text .getExecutionContext ());
65
65
  this .canvas = $("<canvas></canvas>");
66
66
  this .context = this .canvas [0] .getContext ("2d", { willReadFrequently: true });
@@ -166,7 +166,7 @@ Object .assign (Object .setPrototypeOf (ExamineViewer .prototype, X3DViewer .pro
166
166
 
167
167
  this .pressTime = Date .now ();
168
168
 
169
- const [x, y] = this .getPointer (event);
169
+ const { x, y } = this .getBrowser () .getPointerFromEvent (event);
170
170
 
171
171
  if (!this .isPointerInRectangle (x, y))
172
172
  return;
@@ -274,7 +274,7 @@ Object .assign (Object .setPrototypeOf (ExamineViewer .prototype, X3DViewer .pro
274
274
  event .preventDefault ();
275
275
  event .stopImmediatePropagation ();
276
276
 
277
- const [x, y] = this .getPointer (event);
277
+ const { x, y } = this .getBrowser () .getPointerFromEvent (event);
278
278
 
279
279
  this .disconnect ();
280
280
  this .lookAtBBox (x, y, this .getStraightenHorizon ());
@@ -285,7 +285,7 @@ Object .assign (Object .setPrototypeOf (ExamineViewer .prototype, X3DViewer .pro
285
285
 
286
286
  return function (event)
287
287
  {
288
- const [x, y] = this .getPointer (event);
288
+ const { x, y } = this .getBrowser () .getPointerFromEvent (event);
289
289
 
290
290
  switch (this .getButton (this .button))
291
291
  {
@@ -339,7 +339,7 @@ Object .assign (Object .setPrototypeOf (ExamineViewer .prototype, X3DViewer .pro
339
339
 
340
340
  return function (event)
341
341
  {
342
- const [x, y] = this .getPointer (event);
342
+ const { x, y } = this .getBrowser () .getPointerFromEvent (event);
343
343
 
344
344
  if (!this .isPointerInRectangle (x, y))
345
345
  return;
@@ -119,7 +119,7 @@ Object .assign (Object .setPrototypeOf (LookAtViewer .prototype, X3DViewer .prot
119
119
  if (this .button >= 0)
120
120
  return;
121
121
 
122
- const [x, y] = this .getPointer (event);
122
+ const { x, y } = this .getBrowser () .getPointerFromEvent (event);
123
123
 
124
124
  if (!this .isPointerInRectangle (x, y))
125
125
  return;
@@ -180,7 +180,7 @@ Object .assign (Object .setPrototypeOf (LookAtViewer .prototype, X3DViewer .prot
180
180
  event .preventDefault ();
181
181
  event .stopImmediatePropagation ();
182
182
 
183
- const [x, y] = this .getPointer (event);
183
+ const { x, y } = this .getBrowser () .getPointerFromEvent (event);
184
184
 
185
185
  this .disconnect ();
186
186
  this .lookAtPoint (x, y, this .getStraightenHorizon ());
@@ -191,7 +191,7 @@ Object .assign (Object .setPrototypeOf (LookAtViewer .prototype, X3DViewer .prot
191
191
 
192
192
  this .event = event;
193
193
 
194
- const [x, y] = this .getPointer (event);
194
+ const { x, y } = this .getBrowser () .getPointerFromEvent (event);
195
195
 
196
196
  switch (this .button)
197
197
  {
@@ -219,7 +219,7 @@ Object .assign (Object .setPrototypeOf (LookAtViewer .prototype, X3DViewer .prot
219
219
 
220
220
  return function (event)
221
221
  {
222
- const [x, y] = this .getPointer (event);
222
+ const { x, y } = this .getBrowser () .getPointerFromEvent (event);
223
223
 
224
224
  if (!this .isPointerInRectangle (x, y))
225
225
  return;
@@ -92,7 +92,7 @@ Object .assign (Object .setPrototypeOf (PlaneViewer .prototype, X3DViewer .proto
92
92
  if (this .button >= 0)
93
93
  return;
94
94
 
95
- const [x, y] = this .getPointer (event);
95
+ const { x, y } = this .getBrowser () .getPointerFromEvent (event);
96
96
 
97
97
  if (!this .isPointerInRectangle (x, y))
98
98
  return;
@@ -143,7 +143,7 @@ Object .assign (Object .setPrototypeOf (PlaneViewer .prototype, X3DViewer .proto
143
143
  },
144
144
  mousemove (event)
145
145
  {
146
- const [x, y] = this .getPointer (event);
146
+ const { x, y } = this .getBrowser () .getPointerFromEvent (event);
147
147
 
148
148
  switch (this .getButton (this .button))
149
149
  {
@@ -171,7 +171,7 @@ Object .assign (Object .setPrototypeOf (PlaneViewer .prototype, X3DViewer .proto
171
171
  },
172
172
  mousewheel (event)
173
173
  {
174
- const [x, y] = this .getPointer (event);
174
+ const { x, y } = this .getBrowser () .getPointerFromEvent (event);
175
175
 
176
176
  if (!this .isPointerInRectangle (x, y))
177
177
  return;