x_ite 8.6.10 → 8.6.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/Makefile +12 -12
  2. package/build/bin/version.pl +6 -0
  3. package/dist/assets/components/Annotation.js +13 -13
  4. package/dist/assets/components/Annotation.min.js +1 -1
  5. package/dist/assets/components/CADGeometry.js +21 -45
  6. package/dist/assets/components/CADGeometry.min.js +1 -1
  7. package/dist/assets/components/CubeMapTexturing.js +25 -25
  8. package/dist/assets/components/CubeMapTexturing.min.js +1 -1
  9. package/dist/assets/components/DIS.js +13 -13
  10. package/dist/assets/components/DIS.min.js +1 -1
  11. package/dist/assets/components/EventUtilities.js +9 -9
  12. package/dist/assets/components/EventUtilities.min.js +1 -1
  13. package/dist/assets/components/Geometry2D.js +19 -19
  14. package/dist/assets/components/Geometry2D.min.js +1 -1
  15. package/dist/assets/components/Geospatial.js +40 -58
  16. package/dist/assets/components/Geospatial.min.js +1 -1
  17. package/dist/assets/components/HAnim.js +18 -18
  18. package/dist/assets/components/HAnim.min.js +1 -1
  19. package/dist/assets/components/KeyDeviceSensor.js +8 -8
  20. package/dist/assets/components/KeyDeviceSensor.min.js +1 -1
  21. package/dist/assets/components/Layout.js +48 -42
  22. package/dist/assets/components/Layout.min.js +1 -1
  23. package/dist/assets/components/NURBS.js +28 -34
  24. package/dist/assets/components/NURBS.min.js +1 -1
  25. package/dist/assets/components/ParticleSystems.js +140 -29
  26. package/dist/assets/components/ParticleSystems.min.js +1 -1
  27. package/dist/assets/components/Picking.js +132 -22
  28. package/dist/assets/components/Picking.min.js +1 -1
  29. package/dist/assets/components/RigidBodyPhysics.js +33 -77
  30. package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
  31. package/dist/assets/components/Scripting.js +28 -28
  32. package/dist/assets/components/Scripting.min.js +1 -1
  33. package/dist/assets/components/Text.js +24 -24
  34. package/dist/assets/components/Text.min.js +1 -1
  35. package/dist/assets/components/TextureProjector.js +14 -14
  36. package/dist/assets/components/TextureProjector.min.js +1 -1
  37. package/dist/assets/components/Texturing3D.js +30 -30
  38. package/dist/assets/components/Texturing3D.min.js +1 -1
  39. package/dist/assets/components/VolumeRendering.js +19 -19
  40. package/dist/assets/components/VolumeRendering.min.js +1 -1
  41. package/dist/assets/components/X_ITE.js +9 -9
  42. package/dist/assets/components/X_ITE.min.js +1 -1
  43. package/dist/x_ite.css +1 -1
  44. package/dist/x_ite.js +645 -786
  45. package/dist/x_ite.min.js +1 -1
  46. package/dist/x_ite.zip +0 -0
  47. package/docs/_config.yml +1 -1
  48. package/docs/_posts/components/Geometry3D/IndexedFaceSet.md +1 -1
  49. package/docs/_posts/components/Lighting/DirectionalLight.md +4 -4
  50. package/docs/_posts/components/Lighting/EnvironmentLight.md +4 -4
  51. package/docs/_posts/components/Lighting/PointLight.md +4 -4
  52. package/docs/_posts/components/Lighting/SpotLight.md +4 -4
  53. package/docs/_posts/components/Rendering/IndexedLineSet.md +1 -1
  54. package/docs/_posts/components/Rendering/IndexedTriangleFanSet.md +1 -1
  55. package/docs/_posts/components/RigidBodyPhysics/RigidBody.md +1 -1
  56. package/docs/_posts/components/RigidBodyPhysics/RigidBodyCollection.md +1 -1
  57. package/docs/_posts/components/RigidBodyPhysics/SingleAxisHingeJoint.md +1 -1
  58. package/docs/_posts/components/RigidBodyPhysics/SliderJoint.md +3 -3
  59. package/docs/_posts/components/X_ITE/BlendMode.md +1 -1
  60. package/docs/_posts/getting-started.md +8 -3
  61. package/docs/_posts/reference/browser-services.md +1 -1
  62. package/docs/_posts/reference/ecmascript-object-and-function-definitions.md +16 -99
  63. package/docs/_posts/what's-new.md +1 -1
  64. package/docs/laboratory/gltf-sample-viewer.html +4 -2
  65. package/package.json +3 -3
  66. package/src/assets/shaders/webgl1/include/Fragment.glsl.js +11 -4
  67. package/src/assets/shaders/webgl2/include/Fragment.glsl.js +11 -4
  68. package/src/lib/jquery.js +6 -1
  69. package/src/standard/Math/Algorithm.js +8 -1
  70. package/src/standard/Math/Geometry/Box3.js +2 -5
  71. package/src/standard/Utility/BitSet.js +33 -0
  72. package/src/x_ite/Base/X3DBaseNode.js +8 -0
  73. package/src/x_ite/Base/X3DObject.js +14 -1
  74. package/src/x_ite/Browser/Core/BrowserOptions.js +27 -29
  75. package/src/x_ite/Browser/Core/BrowserTimings.js +4 -12
  76. package/src/x_ite/Browser/Core/Context.js +1 -1
  77. package/src/x_ite/Browser/Core/X3DCoreContext.js +5 -0
  78. package/src/x_ite/Browser/Navigation/X3DFlyViewer.js +3 -3
  79. package/src/x_ite/Browser/Networking/X3DNetworkingContext.js +20 -15
  80. package/src/x_ite/Browser/PointingDeviceSensor/PointingDevice.js +3 -3
  81. package/src/x_ite/Browser/Rendering/GeometryContext.js +2 -0
  82. package/src/x_ite/Browser/Shape/AlphaMode.js +1 -1
  83. package/src/x_ite/Browser/VERSION.js +1 -1
  84. package/src/x_ite/Browser/X3DBrowser.js +4 -4
  85. package/src/x_ite/Browser/X3DBrowserContext.js +21 -12
  86. package/src/x_ite/Components/CADGeometry/CADFace.js +8 -32
  87. package/src/x_ite/Components/Core/X3DNode.js +1 -1
  88. package/src/x_ite/Components/Core/X3DPrototypeInstance.js +1 -1
  89. package/src/x_ite/Components/EnvironmentalEffects/X3DBackgroundNode.js +115 -139
  90. package/src/x_ite/Components/EnvironmentalEffects/X3DFogObject.js +1 -1
  91. package/src/x_ite/Components/Geometry3D/ElevationGrid.js +10 -31
  92. package/src/x_ite/Components/Geometry3D/IndexedFaceSet.js +3 -6
  93. package/src/x_ite/Components/Geospatial/GeoElevationGrid.js +7 -25
  94. package/src/x_ite/Components/Grouping/StaticGroup.js +19 -0
  95. package/src/x_ite/Components/Grouping/Switch.js +7 -25
  96. package/src/x_ite/Components/Grouping/X3DBoundedObject.js +0 -1
  97. package/src/x_ite/Components/Grouping/X3DGroupingNode.js +1 -1
  98. package/src/x_ite/Components/Layout/Layout.js +12 -10
  99. package/src/x_ite/Components/Layout/LayoutGroup.js +9 -5
  100. package/src/x_ite/Components/NURBS/X3DNurbsSurfaceGeometryNode.js +4 -10
  101. package/src/x_ite/Components/Navigation/LOD.js +7 -25
  102. package/src/x_ite/Components/Navigation/X3DViewpointNode.js +1 -11
  103. package/src/x_ite/Components/ParticleSystems/ParticleSystem.js +4 -3
  104. package/src/x_ite/Components/Rendering/IndexedLineSet.js +11 -33
  105. package/src/x_ite/Components/Rendering/LineSet.js +12 -37
  106. package/src/x_ite/Components/Rendering/PointSet.js +11 -24
  107. package/src/x_ite/Components/Rendering/X3DComposedGeometryNode.js +14 -39
  108. package/src/x_ite/Components/Rendering/X3DLineGeometryNode.js +15 -8
  109. package/src/x_ite/Components/RigidBodyPhysics/CollidableOffset.js +7 -29
  110. package/src/x_ite/Components/RigidBodyPhysics/CollidableShape.js +8 -30
  111. package/src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js +3 -10
  112. package/src/x_ite/Components/Shape/Appearance.js +9 -5
  113. package/src/x_ite/Components/Shape/Material.js +1 -2
  114. package/src/x_ite/Components/Shape/PhysicalMaterial.js +1 -2
  115. package/src/x_ite/Components/Shape/Shape.js +0 -5
  116. package/src/x_ite/Components/Shape/TwoSidedMaterial.js +1 -1
  117. package/src/x_ite/Components/Shape/UnlitMaterial.js +1 -1
  118. package/src/x_ite/Components/Shape/X3DMaterialNode.js +24 -9
  119. package/src/x_ite/Components/Shape/X3DShapeNode.js +21 -18
  120. package/src/x_ite/Components/Texturing/ImageTexture.js +1 -1
  121. package/src/x_ite/Components/Texturing/X3DTexture2DNode.js +2 -0
  122. package/src/x_ite/Fields/SFImage.js +9 -9
  123. package/src/x_ite/Fields/SFInt32.js +2 -2
  124. package/src/x_ite/Fields/SFNode.js +8 -0
  125. package/src/x_ite/Rendering/X3DRenderObject.js +0 -1
  126. package/src/x_ite/{X3DCanvas.js → X3DCanvasElement.js} +23 -4
  127. package/src/x_ite.js +4 -4
  128. package/x_ite.min.html +1 -1
@@ -108,10 +108,7 @@ Switch .prototype = Object .assign (Object .create (X3DGroupingNode .prototype),
108
108
  {
109
109
  const boundedObject = X3DCast (X3DConstants .X3DBoundedObject, this .visibleNode);
110
110
 
111
- if (boundedObject)
112
- return boundedObject .getBBox (bbox, shadows);
113
-
114
- return bbox .set ();
111
+ return boundedObject?.getBBox (bbox, shadows) ?? bbox .set ();
115
112
  }
116
113
 
117
114
  return bbox .set (this ._bboxSize .getValue (), this ._bboxCenter .getValue ());
@@ -165,11 +162,11 @@ Switch .prototype = Object .assign (Object .create (X3DGroupingNode .prototype),
165
162
  },
166
163
  set_cameraObject__: function ()
167
164
  {
168
- this .setCameraObject (!!(this .visibleNode && this .visibleNode .isCameraObject ()));
165
+ this .setCameraObject (!!this .visibleNode?.isCameraObject ());
169
166
  },
170
167
  set_transformSensors__: function ()
171
168
  {
172
- this .setPickableObject (!!(this .getTransformSensors () .size || this .visibleNode && this .visibleNode .isPickableObject ()));
169
+ this .setPickableObject (!!(this .getTransformSensors () .size || this .visibleNode?.isPickableObject ()));
173
170
  },
174
171
  set_visible__: function ()
175
172
  {
@@ -196,11 +193,7 @@ Switch .prototype = Object .assign (Object .create (X3DGroupingNode .prototype),
196
193
  case TraverseType .CAMERA:
197
194
  case TraverseType .SHADOW:
198
195
  {
199
- const visibleNode = this .visibleNode;
200
-
201
- if (visibleNode)
202
- visibleNode .traverse (type, renderObject);
203
-
196
+ this .visibleNode?.traverse (type, renderObject);
204
197
  return;
205
198
  }
206
199
  case TraverseType .PICKING:
@@ -232,25 +225,14 @@ Switch .prototype = Object .assign (Object .create (X3DGroupingNode .prototype),
232
225
  }
233
226
  case TraverseType .COLLISION:
234
227
  {
235
- const visibleNode = this .visibleNode;
236
-
237
- if (visibleNode)
238
- visibleNode .traverse (type, renderObject);
239
-
228
+ this .visibleNode?.traverse (type, renderObject);
240
229
  return;
241
230
  }
242
231
  case TraverseType .DISPLAY:
243
232
  {
244
- const visibleNode = this .visibleNode;
245
-
246
- if (visibleNode)
247
- visibleNode .traverse (type, renderObject);
248
-
249
- const boundedObject = this .boundedObject;
250
-
251
- if (boundedObject)
252
- boundedObject .displayBBox (type, renderObject);
233
+ this .visibleNode?.traverse (type, renderObject);
253
234
 
235
+ this .boundedObject?.displayBBox (type, renderObject);
254
236
  return;
255
237
  }
256
238
  }
@@ -106,7 +106,6 @@ X3DBoundedObject .prototype =
106
106
  const modelViewMatrix = renderObject .getModelViewMatrix ();
107
107
 
108
108
  this .getBBox (bbox);
109
-
110
109
  matrix .set (bbox .center, null, bbox .size);
111
110
 
112
111
  modelViewMatrix .push ();
@@ -105,7 +105,7 @@ X3DGroupingNode .prototype = Object .assign (Object .create (X3DChildNode .proto
105
105
 
106
106
  return bbox .set (this ._bboxSize .getValue (), this ._bboxCenter .getValue ());
107
107
  },
108
- getHidden: function ()
108
+ isHidden: function ()
109
109
  {
110
110
  return this .hidden;
111
111
  },
@@ -56,8 +56,9 @@ import Vector3 from "../../../standard/Math/Numbers/Vector3.js";
56
56
  import Rotation4 from "../../../standard/Math/Numbers/Rotation4.js";
57
57
  import Matrix4 from "../../../standard/Math/Numbers/Matrix4.js";
58
58
 
59
- var
60
- i = 0,
59
+ let i = 0;
60
+
61
+ const
61
62
  LEFT = i++,
62
63
  CENTER = i++,
63
64
  RIGHT = i++,
@@ -441,11 +442,11 @@ Layout .prototype = Object .assign (Object .create (X3DLayoutNode .prototype),
441
442
  },
442
443
  transform: function (type, renderObject)
443
444
  {
444
- var parent = this .parent = renderObject .getParentLayout ();
445
+ const parent = this .parent = renderObject .getParentLayout ();
445
446
 
446
447
  // Calculate rectangleSize
447
448
 
448
- var
449
+ const
449
450
  browser = this .getBrowser (),
450
451
  contentScale = browser .getRenderingProperty ("ContentScale"),
451
452
  matrix = this .matrix,
@@ -488,7 +489,7 @@ Layout .prototype = Object .assign (Object .create (X3DLayoutNode .prototype),
488
489
 
489
490
  // Calculate translation
490
491
 
491
- var translation = this .translation .set (0, 0, 0);
492
+ const translation = this .translation .set (0, 0, 0);
492
493
 
493
494
  switch (this .getAlignX ())
494
495
  {
@@ -524,7 +525,7 @@ Layout .prototype = Object .assign (Object .create (X3DLayoutNode .prototype),
524
525
 
525
526
  // Calculate offset
526
527
 
527
- var offset = this .offset .set (0, 0, 0);
528
+ const offset = this .offset .set (0, 0, 0);
528
529
 
529
530
  switch (this .getOffsetUnitX ())
530
531
  {
@@ -548,13 +549,14 @@ Layout .prototype = Object .assign (Object .create (X3DLayoutNode .prototype),
548
549
 
549
550
  // Calculate scale
550
551
 
551
- var
552
+ const
552
553
  scale = this .scale .set (1, 1, 1),
553
554
  currentTranslation = this .currentTranslation,
554
555
  currentRotation = this .currentRotation,
555
556
  currentScale = this .currentScale;
556
557
 
557
- var modelViewMatrix = renderObject .getModelViewMatrix () .get ();
558
+ const modelViewMatrix = renderObject .getModelViewMatrix () .get ();
559
+
558
560
  modelViewMatrix .get (currentTranslation, currentRotation, currentScale);
559
561
 
560
562
  switch (this .getScaleModeX ())
@@ -612,10 +614,10 @@ Layout .prototype = Object .assign (Object .create (X3DLayoutNode .prototype),
612
614
 
613
615
  // Transform
614
616
 
615
- rectangleCenter .assign (translation) .add (offset);
617
+ rectangleCenter .assign (translation .add (offset));
616
618
 
617
619
  matrix .set (currentTranslation, currentRotation);
618
- matrix .translate (translation .add (offset));
620
+ matrix .translate (translation);
619
621
  matrix .scale (scale);
620
622
 
621
623
  return matrix;
@@ -52,6 +52,7 @@ import X3DGroupingNode from "../Grouping/X3DGroupingNode.js";
52
52
  import X3DCast from "../../Base/X3DCast.js";
53
53
  import TraverseType from "../../Rendering/TraverseType.js";
54
54
  import X3DConstants from "../../Base/X3DConstants.js";
55
+ import Vector3 from "../../../standard/Math/Numbers/Vector3.js";
55
56
  import Matrix4 from "../../../standard/Math/Numbers/Matrix4.js";
56
57
 
57
58
  function LayoutGroup (executionContext)
@@ -62,6 +63,7 @@ function LayoutGroup (executionContext)
62
63
 
63
64
  this .viewportNode = null;
64
65
  this .layoutNode = null;
66
+ this .matrix = new Matrix4 ();
65
67
  this .modelViewMatrix = new Matrix4 ();
66
68
  this .screenMatrix = new Matrix4 ();
67
69
  }
@@ -118,11 +120,13 @@ LayoutGroup .prototype = Object .assign (Object .create (X3DGroupingNode .protot
118
120
  getMatrix: function ()
119
121
  {
120
122
  if (this .layoutNode)
121
- this .matrix .assign (this .modelViewMatrix) .inverse () .multLeft (this .screenMatrix);
122
- else
123
- this .matrix .identity ();
123
+ return this .matrix .assign (this .modelViewMatrix) .inverse () .multLeft (this .screenMatrix);
124
124
 
125
- return this .matrix;
125
+ return this .matrix .identity ();
126
+ },
127
+ getLayout: function ()
128
+ {
129
+ return this .layoutNode;
126
130
  },
127
131
  traverse: function (type, renderObject)
128
132
  {
@@ -139,7 +143,7 @@ LayoutGroup .prototype = Object .assign (Object .create (X3DGroupingNode .protot
139
143
 
140
144
  if (this .layoutNode)
141
145
  {
142
- var modelViewMatrix = renderObject .getModelViewMatrix ();
146
+ const modelViewMatrix = renderObject .getModelViewMatrix ();
143
147
 
144
148
  this .modelViewMatrix .assign (modelViewMatrix .get ());
145
149
  this .screenMatrix .assign (this .layoutNode .transform (type, renderObject));
@@ -89,20 +89,14 @@ X3DNurbsSurfaceGeometryNode .prototype = Object .assign (Object .create (X3DPara
89
89
  },
90
90
  set_texCoord__: function ()
91
91
  {
92
- if (this .texCoordNode)
93
- this .texCoordNode .removeInterest ("requestRebuild", this);
94
-
95
- if (this .nurbsTexCoordNode)
96
- this .nurbsTexCoordNode .removeInterest ("requestRebuild", this);
92
+ this .texCoordNode ?.removeInterest ("requestRebuild", this);
93
+ this .nurbsTexCoordNode?.removeInterest ("requestRebuild", this);
97
94
 
98
95
  this .texCoordNode = X3DCast (X3DConstants .X3DTextureCoordinateNode, this ._texCoord);
99
96
  this .nurbsTexCoordNode = X3DCast (X3DConstants .NurbsTextureCoordinate, this ._texCoord);
100
97
 
101
- if (this .texCoordNode)
102
- this .texCoordNode .addInterest ("requestRebuild", this);
103
-
104
- if (this .nurbsTexCoordNode)
105
- this .nurbsTexCoordNode .addInterest ("requestRebuild", this);
98
+ this .texCoordNode ?.addInterest ("requestRebuild", this);
99
+ this .nurbsTexCoordNode?.addInterest ("requestRebuild", this);
106
100
  },
107
101
  set_controlPoint__: function ()
108
102
  {
@@ -115,10 +115,7 @@ LOD .prototype = Object .assign (Object .create (X3DGroupingNode .prototype),
115
115
  {
116
116
  const boundedObject = X3DCast (X3DConstants .X3DBoundedObject, this .visibleNode);
117
117
 
118
- if (boundedObject)
119
- return boundedObject .getBBox (bbox, shadows);
120
-
121
- return bbox .set ();
118
+ return boundedObject?.getBBox (bbox, shadows) ?? bbox .set ();
122
119
  }
123
120
 
124
121
  return bbox .set (this ._bboxSize .getValue (), this ._bboxCenter .getValue ());
@@ -174,11 +171,11 @@ LOD .prototype = Object .assign (Object .create (X3DGroupingNode .prototype),
174
171
  },
175
172
  set_cameraObject__: function ()
176
173
  {
177
- this .setCameraObject (!!(this .visibleNode && this .visibleNode .isCameraObject ()));
174
+ this .setCameraObject (!!this .visibleNode?.isCameraObject ());
178
175
  },
179
176
  set_transformSensors__: function ()
180
177
  {
181
- this .setPickableObject (!!(this .getTransformSensors () .size || this .visibleNode && this .visibleNode .isPickableObject ()));
178
+ this .setPickableObject (!!(this .getTransformSensors () .size || this .visibleNode?.isPickableObject ()));
182
179
  },
183
180
  set_visible__: function ()
184
181
  {
@@ -250,11 +247,7 @@ LOD .prototype = Object .assign (Object .create (X3DGroupingNode .prototype),
250
247
  case TraverseType .CAMERA:
251
248
  case TraverseType .SHADOW:
252
249
  {
253
- const visibleNode = this .visibleNode;
254
-
255
- if (visibleNode)
256
- visibleNode .traverse (type, renderObject);
257
-
250
+ this .visibleNode?.traverse (type, renderObject);
258
251
  return;
259
252
  }
260
253
  case TraverseType .PICKING:
@@ -286,11 +279,7 @@ LOD .prototype = Object .assign (Object .create (X3DGroupingNode .prototype),
286
279
  }
287
280
  case TraverseType .COLLISION:
288
281
  {
289
- const visibleNode = this .visibleNode;
290
-
291
- if (visibleNode)
292
- visibleNode .traverse (type, renderObject);
293
-
282
+ this .visibleNode?.traverse (type, renderObject);
294
283
  return;
295
284
  }
296
285
  case TraverseType .DISPLAY:
@@ -318,16 +307,9 @@ LOD .prototype = Object .assign (Object .create (X3DGroupingNode .prototype),
318
307
  }
319
308
  }
320
309
 
321
- const visibleNode = this .visibleNode;
322
-
323
- if (visibleNode)
324
- visibleNode .traverse (type, renderObject);
325
-
326
- const boundedObject = this .boundedObject;
327
-
328
- if (boundedObject)
329
- boundedObject .displayBBox (type, renderObject);
310
+ this .visibleNode?.traverse (type, renderObject);
330
311
 
312
+ this .boundedObject?.displayBBox (type, renderObject);
331
313
  return;
332
314
  }
333
315
  }
@@ -279,11 +279,6 @@ X3DViewpointNode .prototype = Object .assign (Object .create (X3DBindableNode .p
279
279
  if (this ._viewAll .getValue ())
280
280
  this .viewAll (layerNode .getBBox (new Box3 ()));
281
281
 
282
- if (this .getBrowser () .getBrowserOption ("StraightenHorizon"))
283
- {
284
- this ._orientationOffset = this .straightenHorizon (this .getUserOrientation ()) .multLeft (this .getOrientation () .copy () .inverse ());
285
- }
286
-
287
282
  // Handle NavigationInfo.
288
283
 
289
284
  const
@@ -382,11 +377,6 @@ X3DViewpointNode .prototype = Object .assign (Object .create (X3DBindableNode .p
382
377
  this ._centerOfRotationOffset = Vector3 .Zero;
383
378
  this ._fieldOfViewScale = 1;
384
379
 
385
- if (this .getBrowser () .getBrowserOption ("StraightenHorizon"))
386
- {
387
- this ._orientationOffset = this .straightenHorizon (this .getUserOrientation ()) .multLeft (this .getOrientation () .copy () .inverse ());
388
- }
389
-
390
380
  this .set_nearDistance__ ();
391
381
  this .set_farDistance__ ();
392
382
  },
@@ -452,7 +442,7 @@ X3DViewpointNode .prototype = Object .assign (Object .create (X3DBindableNode .p
452
442
  {
453
443
  bbox = bbox .copy () .multRight (Matrix4 .inverse (this .getModelMatrix ()));
454
444
 
455
- const minDistance = layerNode .getNavigationInfo () .getNearValue () * 2;
445
+ const minDistance = Math .max (layerNode .getNavigationInfo () .getNearValue () * 2, this .getLookAtDistance (bbox));
456
446
 
457
447
  this .lookAt (layerNode, bbox .center, minDistance, factor, straighten);
458
448
  },
@@ -275,9 +275,10 @@ ParticleSystem .prototype = Object .assign (Object .create (X3DShapeNode .protot
275
275
  }
276
276
  default:
277
277
  {
278
- this .setTransparent (this .getAppearance () .isTransparent () ||
279
- (this .colorRampNode && this .colorRampNode .isTransparent ()) ||
280
- (this .geometryType === GeometryTypes .GEOMETRY && this .geometryNode && this .geometryNode .isTransparent ()));
278
+ this .setTransparent (!!(this .getAppearance () .isTransparent () ||
279
+ this .colorRampNode?.isTransparent () ||
280
+ (this .geometryType === GeometryTypes .GEOMETRY &&
281
+ this .geometryNode?.isTransparent ())));
281
282
  break;
282
283
  }
283
284
  }
@@ -140,57 +140,37 @@ IndexedLineSet .prototype = Object .assign (Object .create (X3DLineGeometryNode
140
140
  },
141
141
  set_fogCoord__: function ()
142
142
  {
143
- if (this .fogCoordNode)
144
- this .fogCoordNode .removeInterest ("requestRebuild", this);
143
+ this .fogCoordNode?.removeInterest ("requestRebuild", this);
145
144
 
146
145
  this .fogCoordNode = X3DCast (X3DConstants .FogCoordinate, this ._fogCoord);
147
146
 
148
- if (this .fogCoordNode)
149
- this .fogCoordNode .addInterest ("requestRebuild", this);
147
+ this .fogCoordNode?.addInterest ("requestRebuild", this);
150
148
  },
151
149
  set_color__: function ()
152
150
  {
153
- if (this .colorNode)
154
- {
155
- this .colorNode .removeInterest ("requestRebuild", this);
156
- this .colorNode ._transparent .removeInterest ("set_transparent__", this);
157
- }
151
+ this .colorNode?.removeInterest ("requestRebuild", this);
158
152
 
159
153
  this .colorNode = X3DCast (X3DConstants .X3DColorNode, this ._color);
160
154
 
161
- if (this .colorNode)
162
- {
163
- this .colorNode .addInterest ("requestRebuild", this);
164
- this .colorNode ._transparent .addInterest ("set_transparent__", this);
155
+ this .colorNode?.addInterest ("requestRebuild", this);
165
156
 
166
- this .set_transparent__ ();
167
- }
168
- else
169
- this .setTransparent (false);
170
- },
171
- set_transparent__: function ()
172
- {
173
- this .setTransparent (this .colorNode .isTransparent ());
157
+ this .setTransparent (this .colorNode?.isTransparent () ?? false);
174
158
  },
175
159
  set_normal__: function ()
176
160
  {
177
- if (this .normalNode)
178
- this .normalNode .removeInterest ("requestRebuild", this);
161
+ this .normalNode?.removeInterest ("requestRebuild", this);
179
162
 
180
163
  this .normalNode = X3DCast (X3DConstants .X3DNormalNode, this ._normal);
181
164
 
182
- if (this .normalNode)
183
- this .normalNode .addInterest ("requestRebuild", this);
165
+ this .normalNode?.addInterest ("requestRebuild", this);
184
166
  },
185
167
  set_coord__: function ()
186
168
  {
187
- if (this .coordNode)
188
- this .coordNode .removeInterest ("requestRebuild", this);
169
+ this .coordNode?.removeInterest ("requestRebuild", this);
189
170
 
190
171
  this .coordNode = X3DCast (X3DConstants .X3DCoordinateNode, this ._coord);
191
172
 
192
- if (this .coordNode)
193
- this .coordNode .addInterest ("requestRebuild", this);
173
+ this .coordNode?.addInterest ("requestRebuild", this);
194
174
  },
195
175
  getColorPerVertexIndex: function (index)
196
176
  {
@@ -284,8 +264,7 @@ IndexedLineSet .prototype = Object .assign (Object .create (X3DLineGeometryNode
284
264
  for (let a = 0; a < numAttribNodes; ++ a)
285
265
  attribNodes [a] .addValue (index, attribArrays [a]);
286
266
 
287
- if (fogCoordNode)
288
- fogCoordNode .addDepth (index, fogDepthArray);
267
+ fogCoordNode?.addDepth (index, fogDepthArray);
289
268
 
290
269
  if (colorNode)
291
270
  {
@@ -295,8 +274,7 @@ IndexedLineSet .prototype = Object .assign (Object .create (X3DLineGeometryNode
295
274
  colorNode .addColor (this .getColorIndex (face), colorArray);
296
275
  }
297
276
 
298
- if (normalNode)
299
- normalNode .addVector (index, normalArray);
277
+ normalNode?.addVector (index, normalArray);
300
278
 
301
279
  coordNode .addPoint (index, vertexArray);
302
280
  }
@@ -134,57 +134,37 @@ LineSet .prototype = Object .assign (Object .create (X3DLineGeometryNode .protot
134
134
  },
135
135
  set_fogCoord__: function ()
136
136
  {
137
- if (this .fogCoordNode)
138
- this .fogCoordNode .removeInterest ("requestRebuild", this);
137
+ this .fogCoordNode?.removeInterest ("requestRebuild", this);
139
138
 
140
139
  this .fogCoordNode = X3DCast (X3DConstants .FogCoordinate, this ._fogCoord);
141
140
 
142
- if (this .fogCoordNode)
143
- this .fogCoordNode .addInterest ("requestRebuild", this);
141
+ this .fogCoordNode?.addInterest ("requestRebuild", this);
144
142
  },
145
143
  set_color__: function ()
146
144
  {
147
- if (this .colorNode)
148
- {
149
- this .colorNode .removeInterest ("requestRebuild", this);
150
- this .colorNode ._transparent .removeInterest ("set_transparent__", this);
151
- }
145
+ this .colorNode?.removeInterest ("requestRebuild", this);
152
146
 
153
147
  this .colorNode = X3DCast (X3DConstants .X3DColorNode, this ._color);
154
148
 
155
- if (this .colorNode)
156
- {
157
- this .colorNode .addInterest ("requestRebuild", this);
158
- this .colorNode ._transparent .addInterest ("set_transparent__", this);
149
+ this .colorNode?.addInterest ("requestRebuild", this);
159
150
 
160
- this .set_transparent__ ();
161
- }
162
- else
163
- this .setTransparent (false);
164
- },
165
- set_transparent__: function ()
166
- {
167
- this .setTransparent (this .colorNode .isTransparent ());
151
+ this .setTransparent (this .colorNode?.isTransparent () ?? false);
168
152
  },
169
153
  set_normal__: function ()
170
154
  {
171
- if (this .normalNode)
172
- this .normalNode .removeInterest ("requestRebuild", this);
155
+ this .normalNode?.removeInterest ("requestRebuild", this);
173
156
 
174
157
  this .normalNode = X3DCast (X3DConstants .X3DNormalNode, this ._normal);
175
158
 
176
- if (this .normalNode)
177
- this .normalNode .addInterest ("requestRebuild", this);
159
+ this .normalNode?.addInterest ("requestRebuild", this);
178
160
  },
179
161
  set_coord__: function ()
180
162
  {
181
- if (this .coordNode)
182
- this .coordNode .removeInterest ("requestRebuild", this);
163
+ this .coordNode?.removeInterest ("requestRebuild", this);
183
164
 
184
165
  this .coordNode = X3DCast (X3DConstants .X3DCoordinateNode, this ._coord);
185
166
 
186
- if (this .coordNode)
187
- this .coordNode .addInterest ("requestRebuild", this);
167
+ this .coordNode?.addInterest ("requestRebuild", this);
188
168
  },
189
169
  build: function ()
190
170
  {
@@ -224,14 +204,9 @@ LineSet .prototype = Object .assign (Object .create (X3DLineGeometryNode .protot
224
204
  for (let a = 0; a < numAttribNodes; ++ a)
225
205
  attribNodes [a] .addValue (index, attribArrays [a]);
226
206
 
227
- if (fogCoordNode)
228
- fogCoordNode .addDepth (index, fogDepthArray);
229
-
230
- if (colorNode)
231
- colorNode .addColor (index, colorArray);
232
-
233
- if (normalNode)
234
- normalNode .addVector (index, normalArray);
207
+ fogCoordNode?.addDepth (index, fogDepthArray);
208
+ colorNode ?.addColor (index, colorArray);
209
+ normalNode ?.addVector (index, normalArray);
235
210
 
236
211
  coordNode .addPoint (index, vertexArray);
237
212
  }
@@ -137,43 +137,35 @@ PointSet .prototype = Object .assign (Object .create (X3DPointGeometryNode .prot
137
137
  },
138
138
  set_fogCoord__: function ()
139
139
  {
140
- if (this .fogCoordNode)
141
- this .fogCoordNode .removeInterest ("requestRebuild", this);
140
+ this .fogCoordNode?.removeInterest ("requestRebuild", this);
142
141
 
143
142
  this .fogCoordNode = X3DCast (X3DConstants .FogCoordinate, this ._fogCoord);
144
143
 
145
- if (this .fogCoordNode)
146
- this .fogCoordNode .addInterest ("requestRebuild", this);
144
+ this .fogCoordNode?.addInterest ("requestRebuild", this);
147
145
  },
148
146
  set_color__: function ()
149
147
  {
150
- if (this .colorNode)
151
- this .colorNode .removeInterest ("requestRebuild", this);
148
+ this .colorNode?.removeInterest ("requestRebuild", this);
152
149
 
153
150
  this .colorNode = X3DCast (X3DConstants .X3DColorNode, this ._color);
154
151
 
155
- if (this .colorNode)
156
- this .colorNode .addInterest ("requestRebuild", this);
152
+ this .colorNode?.addInterest ("requestRebuild", this);
157
153
  },
158
154
  set_normal__: function ()
159
155
  {
160
- if (this .normalNode)
161
- this .normalNode .removeInterest ("requestRebuild", this);
156
+ this .normalNode?.removeInterest ("requestRebuild", this);
162
157
 
163
158
  this .normalNode = X3DCast (X3DConstants .X3DNormalNode, this ._normal);
164
159
 
165
- if (this .normalNode)
166
- this .normalNode .addInterest ("requestRebuild", this);
160
+ this .normalNode?.addInterest ("requestRebuild", this);
167
161
  },
168
162
  set_coord__: function ()
169
163
  {
170
- if (this .coordNode)
171
- this .coordNode .removeInterest ("requestRebuild", this);
164
+ this .coordNode?.removeInterest ("requestRebuild", this);
172
165
 
173
166
  this .coordNode = X3DCast (X3DConstants .X3DCoordinateNode, this ._coord);
174
167
 
175
- if (this .coordNode)
176
- this .coordNode .addInterest ("requestRebuild", this);
168
+ this .coordNode?.addInterest ("requestRebuild", this);
177
169
  },
178
170
  build: function ()
179
171
  {
@@ -200,14 +192,9 @@ PointSet .prototype = Object .assign (Object .create (X3DPointGeometryNode .prot
200
192
  attribNodes [a] .addValue (i, attribArrays [a]);
201
193
  }
202
194
 
203
- if (fogCoordNode)
204
- fogCoordNode .addDepths (fogDepthArray, numPoints);
205
-
206
- if (colorNode)
207
- colorNode .addColors (colorArray, numPoints);
208
-
209
- if (normalNode)
210
- normalNode .addNormals (normalArray, numPoints);
195
+ fogCoordNode?.addDepths (fogDepthArray, numPoints);
196
+ colorNode ?.addColors (colorArray, numPoints);
197
+ normalNode ?.addNormals (normalArray, numPoints);
211
198
 
212
199
  coordNode .addPoints (vertexArray, numPoints);
213
200
  },