x_ite 11.3.0 → 11.3.2

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 (52) hide show
  1. package/README.md +4 -4
  2. package/dist/assets/components/AnnotationComponent.js +2 -2
  3. package/dist/assets/components/AnnotationComponent.min.js +2 -2
  4. package/dist/assets/components/CADGeometryComponent.js +33 -22
  5. package/dist/assets/components/CADGeometryComponent.min.js +2 -2
  6. package/dist/assets/components/CubeMapTexturingComponent.js +4 -7
  7. package/dist/assets/components/CubeMapTexturingComponent.min.js +2 -2
  8. package/dist/assets/components/DISComponent.js +2 -2
  9. package/dist/assets/components/DISComponent.min.js +2 -2
  10. package/dist/assets/components/EventUtilitiesComponent.js +2 -2
  11. package/dist/assets/components/EventUtilitiesComponent.min.js +2 -2
  12. package/dist/assets/components/Geometry2DComponent.js +2 -2
  13. package/dist/assets/components/Geometry2DComponent.min.js +2 -2
  14. package/dist/assets/components/GeospatialComponent.js +182 -194
  15. package/dist/assets/components/GeospatialComponent.min.js +2 -2
  16. package/dist/assets/components/HAnimComponent.js +2 -2
  17. package/dist/assets/components/HAnimComponent.min.js +2 -2
  18. package/dist/assets/components/KeyDeviceSensorComponent.js +3 -3
  19. package/dist/assets/components/KeyDeviceSensorComponent.min.js +2 -2
  20. package/dist/assets/components/LayoutComponent.js +25 -9
  21. package/dist/assets/components/LayoutComponent.min.js +2 -2
  22. package/dist/assets/components/NURBSComponent.js +3 -3
  23. package/dist/assets/components/NURBSComponent.min.js +2 -2
  24. package/dist/assets/components/ParticleSystemsComponent.js +8 -8
  25. package/dist/assets/components/ParticleSystemsComponent.min.js +2 -2
  26. package/dist/assets/components/PickingComponent.js +71 -109
  27. package/dist/assets/components/PickingComponent.min.js +2 -2
  28. package/dist/assets/components/RigidBodyPhysicsComponent.js +207 -188
  29. package/dist/assets/components/RigidBodyPhysicsComponent.min.js +2 -2
  30. package/dist/assets/components/ScriptingComponent.js +2 -2
  31. package/dist/assets/components/ScriptingComponent.min.js +2 -2
  32. package/dist/assets/components/TextComponent.js +6 -6
  33. package/dist/assets/components/TextComponent.min.js +2 -2
  34. package/dist/assets/components/TextureProjectionComponent.js +2 -2
  35. package/dist/assets/components/TextureProjectionComponent.min.js +2 -2
  36. package/dist/assets/components/Texturing3DComponent.js +105 -105
  37. package/dist/assets/components/Texturing3DComponent.min.js +2 -2
  38. package/dist/assets/components/VolumeRenderingComponent.js +2 -2
  39. package/dist/assets/components/VolumeRenderingComponent.min.js +2 -2
  40. package/dist/assets/components/WebXRComponent.js +3 -3
  41. package/dist/assets/components/WebXRComponent.min.js +2 -2
  42. package/dist/assets/components/X_ITEComponent.js +5 -5
  43. package/dist/assets/components/X_ITEComponent.min.js +2 -2
  44. package/dist/assets/images/XR.svg +1 -92
  45. package/dist/example.html +1 -1
  46. package/dist/x_ite.css +1 -1
  47. package/dist/x_ite.js +54071 -54010
  48. package/dist/x_ite.min.js +2 -2
  49. package/dist/x_ite.min.mjs +2 -2
  50. package/dist/x_ite.mjs +56735 -56674
  51. package/dist/x_ite.zip +0 -0
  52. package/package.json +2 -2
@@ -1,5 +1,5 @@
1
- /* X_ITE v11.3.0 */
2
- const __X_ITE_X3D__ = window [Symbol .for ("X_ITE.X3D-11.3.0")];
1
+ /* X_ITE v11.3.2 */
2
+ const __X_ITE_X3D__ = window [Symbol .for ("X_ITE.X3D-11.3.2")];
3
3
  /******/ (() => { // webpackBootstrap
4
4
  /******/ "use strict";
5
5
  /******/ // The require scope
@@ -328,6 +328,8 @@ function X3DPickSensorNode (executionContext)
328
328
 
329
329
  this .addType ((external_X_ITE_X3D_X3DConstants_default()).X3DPickSensorNode);
330
330
 
331
+ // Private properties
332
+
331
333
  this .objectType = new Set ();
332
334
  this .intersectionType = Picking_IntersectionType .BOUNDS;
333
335
  this .sortOrder = Picking_SortOrder .CLOSEST;
@@ -466,7 +468,9 @@ Object .assign (Object .setPrototypeOf (X3DPickSensorNode .prototype, (external_
466
468
  }
467
469
  case Picking_SortOrder .ALL:
468
470
  {
469
- for (var i = 0, length = pickedTargets .length; i < length; ++ i)
471
+ const length = pickedTargets .length;
472
+
473
+ for (let i = 0; i < length; ++ i)
470
474
  pickedGeometries [i] = this .getPickedGeometry (pickedTargets [i]);
471
475
 
472
476
  pickedGeometries .length = length;
@@ -474,9 +478,11 @@ Object .assign (Object .setPrototypeOf (X3DPickSensorNode .prototype, (external_
474
478
  }
475
479
  case Picking_SortOrder .ALL_SORTED:
476
480
  {
477
- this .pickedTargetsSorter .sort (0, pickedTargets .length);
481
+ const length = pickedTargets .length;
478
482
 
479
- for (var i = 0, length = pickedTargets .length; i < length; ++ i)
483
+ this .pickedTargetsSorter .sort (0, length);
484
+
485
+ for (let i = 0; i < length; ++ i)
480
486
  pickedGeometries [i] = this .getPickedGeometry (pickedTargets [i]);
481
487
 
482
488
  pickedGeometries .length = length;
@@ -538,10 +544,8 @@ Object .assign (Object .setPrototypeOf (X3DPickSensorNode .prototype, (external_
538
544
  {
539
545
  this .objectType .clear ();
540
546
 
541
- for (let i = 0, length = this ._objectType .length; i < length; ++ i)
542
- {
543
- this .objectType .add (this ._objectType [i]);
544
- }
547
+ for (const objectType of this ._objectType)
548
+ this .objectType .add (objectType);
545
549
 
546
550
  this .set_live__ ();
547
551
  },
@@ -555,10 +559,8 @@ Object .assign (Object .setPrototypeOf (X3DPickSensorNode .prototype, (external_
555
559
 
556
560
  return function ()
557
561
  {
558
- this .matchCriterion = matchCriterions .get (this ._matchCriterion .getValue ());
559
-
560
- if (this .matchCriterion === undefined)
561
- this .matchCriterion = MatchCriterionType .MATCH_ANY;
562
+ this .matchCriterion = matchCriterions .get (this ._matchCriterion .getValue ())
563
+ ?? Picking_MatchCriterion .MATCH_ANY;
562
564
  };
563
565
  })(),
564
566
  set_intersectionType__: (() =>
@@ -570,10 +572,8 @@ Object .assign (Object .setPrototypeOf (X3DPickSensorNode .prototype, (external_
570
572
 
571
573
  return function ()
572
574
  {
573
- this .intersectionType = intersectionTypes .get (this ._intersectionType .getValue ());
574
-
575
- if (this .intersectionType === undefined)
576
- this .intersectionType = Picking_IntersectionType .BOUNDS;
575
+ this .intersectionType = intersectionTypes .get (this ._intersectionType .getValue ())
576
+ ?? Picking_IntersectionType .BOUNDS;
577
577
  };
578
578
  })(),
579
579
  set_sortOrder__: (() =>
@@ -587,23 +587,21 @@ Object .assign (Object .setPrototypeOf (X3DPickSensorNode .prototype, (external_
587
587
 
588
588
  return function ()
589
589
  {
590
- this .sortOrder = sortOrders .get (this ._sortOrder .getValue ());
591
-
592
- if (this .sortOrder === undefined)
593
- this .sortOrder = Picking_SortOrder .CLOSEST;
590
+ this .sortOrder = sortOrders .get (this ._sortOrder .getValue ())
591
+ ?? Picking_SortOrder .CLOSEST;
594
592
  };
595
593
  })(),
596
594
  set_pickTarget__ ()
597
595
  {
598
596
  this .pickTargetNodes .clear ();
599
597
 
600
- for (let i = 0, length = this ._pickTarget .length; i < length; ++ i)
598
+ for (const node of this ._pickTarget)
601
599
  {
602
600
  try
603
601
  {
604
602
  const
605
- node = this ._pickTarget [i] .getValue () .getInnerNode (),
606
- type = node .getType ();
603
+ innerNode = node .getValue () .getInnerNode (),
604
+ type = innerNode .getType ();
607
605
 
608
606
  for (let t = type .length - 1; t >= 0; -- t)
609
607
  {
@@ -613,7 +611,7 @@ Object .assign (Object .setPrototypeOf (X3DPickSensorNode .prototype, (external_
613
611
  case (external_X_ITE_X3D_X3DConstants_default()).Shape:
614
612
  case (external_X_ITE_X3D_X3DConstants_default()).X3DGroupingNode:
615
613
  {
616
- this .pickTargetNodes .add (node);
614
+ this .pickTargetNodes .add (innerNode);
617
615
  break;
618
616
  }
619
617
  default:
@@ -674,10 +672,8 @@ Object .assign (Object .setPrototypeOf (X3DPickSensorNode .prototype, (external_
674
672
  },
675
673
  process ()
676
674
  {
677
- const modelMatrices = this .modelMatrices;
678
-
679
- for (let m = 0, mLength = modelMatrices .length; m < mLength; ++ m)
680
- ModelMatrixCache .push (modelMatrices [m]);
675
+ for (const modelMatrix of this .modelMatrices)
676
+ ModelMatrixCache .push (modelMatrix);
681
677
 
682
678
  this .modelMatrices .length = 0;
683
679
  this .targets .size = 0;
@@ -838,16 +834,12 @@ Object .assign (Object .setPrototypeOf (LinePickSensor .prototype, Picking_X3DPi
838
834
  {
839
835
  // Intersect bboxes.
840
836
 
841
- for (let m = 0, mLength = modelMatrices .length; m < mLength; ++ m)
837
+ for (const modelMatrix of modelMatrices)
842
838
  {
843
- const modelMatrix = modelMatrices [m];
844
-
845
839
  pickingBBox .assign (this .pickingGeometryNode .getBBox ()) .multRight (modelMatrix);
846
840
 
847
- for (let t = 0, tLength = targets .size; t < tLength; ++ t)
841
+ for (const target of targets)
848
842
  {
849
- const target = targets [t];
850
-
851
843
  targetBBox .assign (target .geometryNode .getBBox ()) .multRight (target .modelMatrix);
852
844
 
853
845
  if (pickingBBox .intersectsBox (targetBBox))
@@ -881,16 +873,13 @@ Object .assign (Object .setPrototypeOf (LinePickSensor .prototype, Picking_X3DPi
881
873
  {
882
874
  // Intersect geometry.
883
875
 
884
- for (let m = 0, mLength = modelMatrices .length; m < mLength; ++ m)
876
+ for (const modelMatrix of modelMatrices)
885
877
  {
886
- const modelMatrix = modelMatrices [m];
887
-
888
878
  pickingBBox .assign (this .pickingGeometryNode .getBBox ()) .multRight (modelMatrix);
889
879
 
890
- for (let t = 0, tLength = targets .size; t < tLength; ++ t)
880
+ for (const target of targets)
891
881
  {
892
882
  const
893
- target = targets [t],
894
883
  geometryNode = target .geometryNode,
895
884
  vertices = this .pickingGeometryNode .getVertices ();
896
885
 
@@ -957,15 +946,13 @@ Object .assign (Object .setPrototypeOf (LinePickSensor .prototype, Picking_X3DPi
957
946
  pickedNormal .length = 0;
958
947
  pickedPoint .length = 0;
959
948
 
960
- for (let t = 0, tLength = pickedTargets .length; t < tLength; ++ t)
949
+ for (const pickedTarget of pickedTargets)
961
950
  {
962
- const pickedIntersections = pickedTargets [t] .intersections;
951
+ const pickedIntersections = pickedTarget .intersections;
963
952
 
964
- for (let i = 0, iLength = pickedIntersections .length; i < iLength; ++ i)
953
+ for (const intersection of pickedIntersections)
965
954
  {
966
- const
967
- intersection = pickedIntersections [i],
968
- t = intersection .texCoord;
955
+ const t = intersection .texCoord;
969
956
 
970
957
  texCoord .set (t .x, t .y, t .z);
971
958
 
@@ -1081,6 +1068,8 @@ function X3DPickableObject (executionContext)
1081
1068
  {
1082
1069
  this .addType ((external_X_ITE_X3D_X3DConstants_default()).X3DPickableObject);
1083
1070
 
1071
+ // Private properties
1072
+
1084
1073
  this .objectType = new Set ();
1085
1074
  }
1086
1075
 
@@ -1100,12 +1089,11 @@ Object .assign (X3DPickableObject .prototype,
1100
1089
  {
1101
1090
  this .objectType .clear ();
1102
1091
 
1103
- for (var i = 0, length = this ._objectType .length; i < length; ++ i)
1104
- {
1105
- this .objectType .add (this ._objectType [i]);
1106
- }
1092
+ for (const objectType of this ._objectType)
1093
+ this .objectType .add (objectType);
1107
1094
  },
1108
- dispose () { },
1095
+ dispose ()
1096
+ { },
1109
1097
  });
1110
1098
 
1111
1099
  Object .defineProperties (X3DPickableObject, external_X_ITE_X3D_X3DNode_default().getStaticProperties ("X3DPickableObject", "Picking", 1));
@@ -1179,6 +1167,8 @@ function PickableGroup (executionContext)
1179
1167
 
1180
1168
  this .addType ((external_X_ITE_X3D_X3DConstants_default()).PickableGroup);
1181
1169
 
1170
+ // Private properties
1171
+
1182
1172
  this .pickSensorNodes = new Set ();
1183
1173
  }
1184
1174
 
@@ -1190,15 +1180,9 @@ Object .assign (Object .setPrototypeOf (PickableGroup .prototype, (external_X_IT
1190
1180
  external_X_ITE_X3D_X3DGroupingNode_default().prototype .initialize .call (this);
1191
1181
  Picking_X3DPickableObject .prototype .initialize .call (this);
1192
1182
 
1193
- this ._pickable .addInterest ("set_pickable__", this);
1194
-
1195
- this .set_pickable__ ();
1183
+ this ._pickable .addInterest ("set_pickableObjects__", this);
1196
1184
  },
1197
1185
  set_pickableObjects__ ()
1198
- {
1199
- this .set_pickable__ ();
1200
- },
1201
- set_pickable__ ()
1202
1186
  {
1203
1187
  this .setPickableObject (this ._pickable .getValue () || this .getTransformSensors () .size);
1204
1188
  },
@@ -1581,8 +1565,10 @@ function PointPickSensor (executionContext)
1581
1565
 
1582
1566
  this .addType ((external_X_ITE_X3D_X3DConstants_default()).PointPickSensor);
1583
1567
 
1584
- this .picker = new Picking_VolumePicker ();
1585
- this .compoundShapes = [ ];
1568
+ // Private properties
1569
+
1570
+ this .picker = new Picking_VolumePicker ();
1571
+ this .compoundShapes = [ ];
1586
1572
  }
1587
1573
 
1588
1574
  Object .assign (Object .setPrototypeOf (PointPickSensor .prototype, Picking_X3DPickSensorNode .prototype),
@@ -1696,16 +1682,12 @@ Object .assign (Object .setPrototypeOf (PointPickSensor .prototype, Picking_X3DP
1696
1682
  {
1697
1683
  // Intersect bboxes.
1698
1684
 
1699
- for (let m = 0, mLength = modelMatrices .length; m < mLength; ++ m)
1685
+ for (const modelMatrix of modelMatrices)
1700
1686
  {
1701
- const modelMatrix = modelMatrices [m];
1702
-
1703
1687
  pickingBBox .assign (this .pickingGeometryNode .getBBox ()) .multRight (modelMatrix);
1704
1688
 
1705
- for (let t = 0, tLength = targets .size; t < tLength; ++ t)
1689
+ for (const target of targets)
1706
1690
  {
1707
- const target = targets [t];
1708
-
1709
1691
  targetBBox .assign (target .geometryNode .getBBox ()) .multRight (target .modelMatrix);
1710
1692
 
1711
1693
  if (pickingBBox .intersectsBox (targetBBox))
@@ -1743,10 +1725,8 @@ Object .assign (Object .setPrototypeOf (PointPickSensor .prototype, Picking_X3DP
1743
1725
  picker = this .picker,
1744
1726
  compoundShapes = this .compoundShapes;
1745
1727
 
1746
- for (let m = 0, mLength = modelMatrices .length; m < mLength; ++ m)
1728
+ for (const modelMatrix of modelMatrices)
1747
1729
  {
1748
- const modelMatrix = modelMatrices [m];
1749
-
1750
1730
  pickingBBox .assign (this .pickingGeometryNode .getBBox ()) .multRight (modelMatrix);
1751
1731
 
1752
1732
  modelMatrix .get (translation, rotation, scale);
@@ -1754,17 +1734,13 @@ Object .assign (Object .setPrototypeOf (PointPickSensor .prototype, Picking_X3DP
1754
1734
  picker .getTransform (translation, rotation, transform);
1755
1735
  localScaling .setValue (scale .x, scale .y, scale .z);
1756
1736
 
1757
- for (let c = 0, cLength = compoundShapes .length; c < cLength; ++ c)
1737
+ for (const compoundShape of compoundShapes)
1758
1738
  {
1759
- const compoundShape = compoundShapes [c];
1760
-
1761
1739
  picker .setChildShape1Components (transform, localScaling, compoundShape);
1762
1740
 
1763
- for (let t = 0, tLength = targets .size; t < tLength; ++ t)
1741
+ for (const target of targets)
1764
1742
  {
1765
- const
1766
- target = targets [t],
1767
- targetShape = this .getPickShape (target .geometryNode);
1743
+ const targetShape = this .getPickShape (target .geometryNode);
1768
1744
 
1769
1745
  targetBBox .assign (target .geometryNode .getBBox ()) .multRight (target .modelMatrix);
1770
1746
 
@@ -1801,12 +1777,10 @@ Object .assign (Object .setPrototypeOf (PointPickSensor .prototype, Picking_X3DP
1801
1777
 
1802
1778
  pickedPoint .length = 0;
1803
1779
 
1804
- for (let t = 0, tLength = pickedTargets .length; t < tLength; ++ t)
1780
+ for (const pickedTarget of pickedTargets)
1805
1781
  {
1806
- const pp = pickedTargets [t] .pickedPoint;
1807
-
1808
- for (let p = 0, pLength = pp .length; p < pLength; ++ p)
1809
- pickedPoint .push (pp [p]);
1782
+ for (const pp of pickedTarget .pickedPoint)
1783
+ pickedPoint .push (pp);
1810
1784
  }
1811
1785
 
1812
1786
  if (!this ._pickedPoint .equals (pickedPoint))
@@ -1914,6 +1888,8 @@ function PrimitivePickSensor (executionContext)
1914
1888
 
1915
1889
  this .addType ((external_X_ITE_X3D_X3DConstants_default()).PrimitivePickSensor);
1916
1890
 
1891
+ // Private properties
1892
+
1917
1893
  this .picker = new Picking_VolumePicker ();
1918
1894
  }
1919
1895
 
@@ -1979,16 +1955,12 @@ Object .assign (Object .setPrototypeOf (PrimitivePickSensor .prototype, Picking_
1979
1955
  {
1980
1956
  // Intersect bboxes.
1981
1957
 
1982
- for (let m = 0, mLength = modelMatrices .length; m < mLength; ++ m)
1958
+ for (const modelMatrix of modelMatrices)
1983
1959
  {
1984
- const modelMatrix = modelMatrices [m];
1985
-
1986
1960
  pickingBBox .assign (this .pickingGeometryNode .getBBox ()) .multRight (modelMatrix);
1987
1961
 
1988
- for (let t = 0, tLength = targets .size; t < tLength; ++ t)
1962
+ for (const target of targets)
1989
1963
  {
1990
- const target = targets [t];
1991
-
1992
1964
  targetBBox .assign (target .geometryNode .getBBox ()) .multRight (target .modelMatrix);
1993
1965
 
1994
1966
  if (pickingBBox .intersectsBox (targetBBox))
@@ -2024,21 +1996,17 @@ Object .assign (Object .setPrototypeOf (PrimitivePickSensor .prototype, Picking_
2024
1996
 
2025
1997
  const picker = this .picker;
2026
1998
 
2027
- for (let m = 0, mLength = modelMatrices .length; m < mLength; ++ m)
1999
+ for (const modelMatrix of modelMatrices)
2028
2000
  {
2029
- const
2030
- modelMatrix = modelMatrices [m],
2031
- pickingShape = this .getPickShape (this .pickingGeometryNode);
2001
+ const pickingShape = this .getPickShape (this .pickingGeometryNode);
2032
2002
 
2033
2003
  pickingBBox .assign (this .pickingGeometryNode .getBBox ()) .multRight (modelMatrix);
2034
2004
 
2035
2005
  picker .setChildShape1 (modelMatrix, pickingShape .getCompoundShape ());
2036
2006
 
2037
- for (let t = 0, tLength = targets .size; t < tLength; ++ t)
2007
+ for (const target of targets)
2038
2008
  {
2039
- const
2040
- target = targets [t],
2041
- targetShape = this .getPickShape (target .geometryNode);
2009
+ const targetShape = this .getPickShape (target .geometryNode);
2042
2010
 
2043
2011
  targetBBox .assign (target .geometryNode .getBBox ()) .multRight (target .modelMatrix);
2044
2012
 
@@ -2171,6 +2139,8 @@ function VolumePickSensor (executionContext)
2171
2139
 
2172
2140
  this .addType ((external_X_ITE_X3D_X3DConstants_default()).VolumePickSensor);
2173
2141
 
2142
+ // Private properties
2143
+
2174
2144
  this .picker = new Picking_VolumePicker ();
2175
2145
  }
2176
2146
 
@@ -2210,16 +2180,12 @@ Object .assign (Object .setPrototypeOf (VolumePickSensor .prototype, Picking_X3D
2210
2180
  {
2211
2181
  // Intersect bboxes.
2212
2182
 
2213
- for (let m = 0, mLength = modelMatrices .length; m < mLength; ++ m)
2183
+ for (const modelMatrix of modelMatrices)
2214
2184
  {
2215
- const modelMatrix = modelMatrices [m];
2216
-
2217
2185
  pickingBBox .assign (this .pickingGeometryNode .getBBox ()) .multRight (modelMatrix);
2218
2186
 
2219
- for (let t = 0, tLength = targets .size; t < tLength; ++ t)
2187
+ for (const target of targets)
2220
2188
  {
2221
- const target = targets [t];
2222
-
2223
2189
  targetBBox .assign (target .geometryNode .getBBox ()) .multRight (target .modelMatrix);
2224
2190
 
2225
2191
  if (pickingBBox .intersectsBox (targetBBox))
@@ -2255,21 +2221,17 @@ Object .assign (Object .setPrototypeOf (VolumePickSensor .prototype, Picking_X3D
2255
2221
 
2256
2222
  const picker = this .picker;
2257
2223
 
2258
- for (let m = 0, mLength = modelMatrices .length; m < mLength; ++ m)
2224
+ for (const modelMatrix of modelMatrices)
2259
2225
  {
2260
- const
2261
- modelMatrix = modelMatrices [m],
2262
- pickingShape = this .getPickShape (this .pickingGeometryNode);
2226
+ const pickingShape = this .getPickShape (this .pickingGeometryNode);
2263
2227
 
2264
2228
  pickingBBox .assign (this .pickingGeometryNode .getBBox ()) .multRight (modelMatrix);
2265
2229
 
2266
2230
  picker .setChildShape1 (modelMatrix, pickingShape .getCompoundShape ());
2267
2231
 
2268
- for (let t = 0, tLength = targets .size; t < tLength; ++ t)
2232
+ for (const target of targets)
2269
2233
  {
2270
- const
2271
- target = targets [t],
2272
- targetShape = this .getPickShape (target .geometryNode);
2234
+ const targetShape = this .getPickShape (target .geometryNode);
2273
2235
 
2274
2236
  targetBBox .assign (target .geometryNode .getBBox ()) .multRight (target .modelMatrix);
2275
2237
 
@@ -1,2 +1,2 @@
1
- /* X_ITE v11.3.0 */
2
- const e=window[Symbol.for("X_ITE.X3D-11.3.0")];(()=>{var t={n:e=>{var i=e&&e.__esModule?()=>e.default:()=>e;return t.d(i,{a:i}),i},d:(e,i)=>{for(var n in i)t.o(i,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:i[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const i=e.Components;var n=t.n(i);const s=e.Fields;var o=t.n(s);const r=e.X3DFieldDefinition;var c=t.n(r);const a=e.FieldDefinitionArray;var h=t.n(a);const p=e.X3DNode;var l=t.n(p);const d=e.X3DSensorNode;var g=t.n(d);const u=e.TraverseType;var y=t.n(u);const m=e.X3DConstants;var _=t.n(m);const w=e.Namespace;var k=t.n(w);let S=0;const O={MATCH_ANY:S++,MATCH_EVERY:S++,MATCH_ONLY_ONE:S++},f=k().add("MatchCriterion",O);let b=0;const T={BOUNDS:b++,GEOMETRY:b++},N=k().add("IntersectionType",T);let C=0;const P={ANY:C++,CLOSEST:C++,ALL:C++,ALL_SORTED:C++},G=k().add("SortOrder",P),M=e.Matrix4;var v=t.n(M);const B=e.QuickSort;var x=t.n(B);const j=e.ObjectCache;const A=t.n(j)()(v());function F(e,t){return e.distance<t.distance}function L(e){g().call(this,e),this.addType(_().X3DPickSensorNode),this.objectType=new Set,this.intersectionType=N.BOUNDS,this.sortOrder=G.CLOSEST,this.pickTargetNodes=new Set,this.modelMatrices=[],this.targets=[],this.targets.size=0,this.pickedTargets=[],this.pickedTargetsSorter=new(x())(this.pickedTargets,F),this.pickedGeometries=new(o().MFNode)}Object.assign(Object.setPrototypeOf(L.prototype,g().prototype),{initialize(){this.getLive().addInterest("set_live__",this),this._enabled.addInterest("set_live__",this),this._objectType.addInterest("set_objectType__",this),this._matchCriterion.addInterest("set_matchCriterion__",this),this._intersectionType.addInterest("set_intersectionType__",this),this._sortOrder.addInterest("set_sortOrder__",this),this._pickTarget.addInterest("set_pickTarget__",this),this.set_objectType__(),this.set_matchCriterion__(),this.set_intersectionType__(),this.set_sortOrder__(),this.set_pickTarget__()},getObjectType(){return this.objectType},getMatchCriterion(){return this.matchCriterion},getIntersectionType(){return this.intersectionType},getSortOrder(){return this.sortOrder},getModelMatrices(){return this.modelMatrices},getTargets(){return this.targets},getPickShape:(()=>{const e=new WeakMap;return function(t){const i=e.get(t);if(void 0!==i)return i;const n=this.getBrowser().getPrivateScene(),s=n.createNode("Shape",!1),o=n.createNode("CollidableShape",!1);return s.setPrivate(!0),o.setPrivate(!0),o.setConvex(!0),s._geometry=t,o._shape=s,s.setup(),o.setup(),e.set(t,o),o}})(),getPickedGeometries(){const e=this.targets,t=e.size,i=this.pickedTargets,n=this.pickedGeometries;i.length=0;for(let n=0;n<t;++n){const t=e[n];t.intersected&&i.push(t)}if(0===i.length)return n.length=0,n;switch(this.sortOrder){case G.ANY:i.length=1,n[0]=this.getPickedGeometry(i[0]),n.length=1;break;case G.CLOSEST:this.pickedTargetsSorter.sort(0,i.length),i.length=1,n[0]=this.getPickedGeometry(i[0]),n.length=1;break;case G.ALL:for(var s=0,o=i.length;s<o;++s)n[s]=this.getPickedGeometry(i[s]);n.length=o;break;case G.ALL_SORTED:this.pickedTargetsSorter.sort(0,i.length);for(s=0,o=i.length;s<o;++s)n[s]=this.getPickedGeometry(i[s]);n.length=o}return n},getPickedGeometry(e){const t=this.getExecutionContext(),i=e.geometryNode;if(i.getExecutionContext()===t)return i;const n=i.getExecutionContext();if(n.getType().includes(_().X3DPrototypeInstance)&&n.getExecutionContext()===t)return n;const s=e.pickingHierarchy;for(let e=s.length-1;e>=0;--e){const i=s[e];if(i.getExecutionContext()===t)return i;const n=i.getExecutionContext();if(n.getType().includes(_().X3DPrototypeInstance)&&n.getExecutionContext()===t)return n}return null},getPickedTargets(){return this.pickedTargets},set_live__(){this.getLive().getValue()&&this._enabled.getValue()&&!this.objectType.has("NONE")?(this.getBrowser().addPickSensor(this),this.setPickableObject(!0)):(this.getBrowser().removePickSensor(this),this.setPickableObject(!1))},set_objectType__(){this.objectType.clear();for(let e=0,t=this._objectType.length;e<t;++e)this.objectType.add(this._objectType[e]);this.set_live__()},set_matchCriterion__:(()=>{const e=new Map([["MATCH_ANY",f.MATCH_ANY],["MATCH_EVERY",f.MATCH_EVERY],["MATCH_ONLY_ONE",f.MATCH_ONLY_ONE]]);return function(){this.matchCriterion=e.get(this._matchCriterion.getValue()),void 0===this.matchCriterion&&(this.matchCriterion=MatchCriterionType.MATCH_ANY)}})(),set_intersectionType__:(()=>{const e=new Map([["BOUNDS",N.BOUNDS],["GEOMETRY",N.GEOMETRY]]);return function(){this.intersectionType=e.get(this._intersectionType.getValue()),void 0===this.intersectionType&&(this.intersectionType=N.BOUNDS)}})(),set_sortOrder__:(()=>{const e=new Map([["ANY",G.ANY],["CLOSEST",G.CLOSEST],["ALL",G.ALL],["ALL_SORTED",G.ALL_SORTED]]);return function(){this.sortOrder=e.get(this._sortOrder.getValue()),void 0===this.sortOrder&&(this.sortOrder=G.CLOSEST)}})(),set_pickTarget__(){this.pickTargetNodes.clear();for(let e=0,t=this._pickTarget.length;e<t;++e)try{const t=this._pickTarget[e].getValue().getInnerNode(),i=t.getType();for(let e=i.length-1;e>=0;--e)switch(i[e]){case _().Inline:case _().Shape:case _().X3DGroupingNode:this.pickTargetNodes.add(t);break;default:continue}}catch{}},traverse(e,t){e===y().PICKING&&this.isPickableObject()&&this.modelMatrices.push(A.pop().assign(t.getModelViewMatrix().get()))},collect(e,t,i){const n=this.pickTargetNodes;if(i.some((e=>n.has(e)))){const n=this.targets;if(n.size<n.length)var s=n[n.size];else{s={modelMatrix:new(v()),pickingHierarchy:[],pickedPoint:[],intersections:[]};n.push(s)}++n.size,s.intersected=!1,s.geometryNode=e,s.pickedPoint.length=0,s.intersections.length=0,s.modelMatrix.assign(t);const o=s.pickingHierarchy;for(let e=0,t=i.length;e<t;++e)o[e]=i[e];o.length=length}},process(){const e=this.modelMatrices;for(let t=0,i=e.length;t<i;++t)A.push(e[t]);this.modelMatrices.length=0,this.targets.size=0}}),Object.defineProperties(L,l().getStaticProperties("X3DPickSensorNode","Picking",1));const V=L,D=k().add("X3DPickSensorNode",V),E=e.Vector3;var z=t.n(E);const I=e.Box3;var R=t.n(I);const Y=e.Line3;var H=t.n(Y);function X(e){D.call(this,e),this.addType(_().LinePickSensor)}Object.assign(Object.setPrototypeOf(X.prototype,D.prototype),{initialize(){D.prototype.initialize.call(this),this._pickingGeometry.addInterest("set_pickingGeometry__",this),this.set_pickingGeometry__()},set_pickingGeometry__(){this.pickingGeometryNode=null;try{const e=this._pickingGeometry.getValue().getInnerNode(),t=e.getType();for(let i=t.length-1;i>=0;--i)switch(t[i]){case _().IndexedLineSet:case _().LineSet:this.pickingGeometryNode=e;break;default:continue}}catch{}},process:(()=>{const e=new(R()),t=new(R()),i=new(z()),n=new(z()),s=new(v()),r=new(z()),c=new(z()),a=new(H()),h=new(z()),p=new(z()),l=[],d=[],g=new(z()),u=new(o().MFVec3f),y=new(o().MFVec3f),m=new(o().MFVec3f);return function(){if(this.pickingGeometryNode){const o=this.getModelMatrices(),_=this.getTargets();switch(this.getIntersectionType()){case N.BOUNDS:{for(let s=0,r=o.length;s<r;++s){const r=o[s];e.assign(this.pickingGeometryNode.getBBox()).multRight(r);for(let s=0,o=_.size;s<o;++s){const o=_[s];t.assign(o.geometryNode.getBBox()).multRight(o.modelMatrix),e.intersectsBox(t)&&(i.assign(e.center),n.assign(t.center),o.intersected=!0,o.distance=i.distance(n))}}const s=this.getPickedGeometries(),r=!!s.length;s.assign(s.filter((e=>e))),r!==this._isActive.getValue()&&(this._isActive=r),this._pickedGeometry.equals(s)||(this._pickedGeometry=s);break}case N.GEOMETRY:{for(let g=0,u=o.length;g<u;++g){const u=o[g];e.assign(this.pickingGeometryNode.getBBox()).multRight(u);for(let o=0,g=_.size;o<g;++o){const g=_[o],y=g.geometryNode,m=this.pickingGeometryNode.getVertices();t.assign(y.getBBox()).multRight(g.modelMatrix),s.assign(g.modelMatrix).inverse().multLeft(u);for(let e=0,t=m.length;e<t;e+=8)if(s.multVecMatrix(r.set(m[e+0],m[e+1],m[e+2])),s.multVecMatrix(c.set(m[e+4],m[e+5],m[e+6])),a.setPoints(r,c),d.length=0,y.intersectsLine(a,g.modelMatrix,l,d))for(let e=0,t=d.length;e<t;++e){const t=d[e];h.assign(t.point).subtract(r),p.assign(t.point).subtract(c);h.add(p).magnitude()<=r.distance(c)&&g.intersections.push(t)}g.intersections.length&&(i.assign(e.center),n.assign(t.center),g.intersected=!0,g.distance=i.distance(n))}}const w=this.getPickedGeometries(),k=!!w.length;w.assign(w.filter((e=>e))),k!==this._isActive.getValue()&&(this._isActive=k),this._pickedGeometry.equals(w)||(this._pickedGeometry=w);const S=this.getPickedTargets();u.length=0,y.length=0,m.length=0;for(let e=0,t=S.length;e<t;++e){const t=S[e].intersections;for(let e=0,i=t.length;e<i;++e){const i=t[e],n=i.texCoord;g.set(n.x,n.y,n.z),u.push(g),y.push(i.normal),m.push(i.point)}}this._pickedTextureCoordinate.equals(u)||(this._pickedTextureCoordinate=u),this._pickedNormal.equals(y)||(this._pickedNormal=y),this._pickedPoint.equals(m)||(this._pickedPoint=m);break}}}D.prototype.process.call(this)}})()}),Object.defineProperties(X,{...l().getStaticProperties("LinePickSensor","Picking",1,"children","3.2"),fieldDefinitions:{value:new(h())([new(c())(_().inputOutput,"metadata",new(o().SFNode)),new(c())(_().inputOutput,"description",new(o().SFString)),new(c())(_().inputOutput,"enabled",new(o().SFBool)(!0)),new(c())(_().inputOutput,"objectType",new(o().MFString)("ALL")),new(c())(_().inputOutput,"matchCriterion",new(o().SFString)("MATCH_ANY")),new(c())(_().initializeOnly,"intersectionType",new(o().SFString)("BOUNDS")),new(c())(_().initializeOnly,"sortOrder",new(o().SFString)("CLOSEST")),new(c())(_().outputOnly,"isActive",new(o().SFBool)),new(c())(_().outputOnly,"pickedTextureCoordinate",new(o().MFVec3f)),new(c())(_().outputOnly,"pickedNormal",new(o().MFVec3f)),new(c())(_().outputOnly,"pickedPoint",new(o().MFVec3f)),new(c())(_().inputOutput,"pickingGeometry",new(o().SFNode)),new(c())(_().inputOutput,"pickTarget",new(o().MFNode)),new(c())(_().outputOnly,"pickedGeometry",new(o().MFNode))]),enumerable:!0}});const U=X,q=k().add("LinePickSensor",U),W=e.X3DGroupingNode;var K=t.n(W);function Q(e){this.addType(_().X3DPickableObject),this.objectType=new Set}Object.assign(Q.prototype,{initialize(){this._objectType.addInterest("set_objectType__",this),this.set_objectType__()},getObjectType(){return this.objectType},set_objectType__(){this.objectType.clear();for(var e=0,t=this._objectType.length;e<t;++e)this.objectType.add(this._objectType[e])},dispose(){}}),Object.defineProperties(Q,l().getStaticProperties("X3DPickableObject","Picking",1));const J=Q,Z=k().add("X3DPickableObject",J);function $(e){K().call(this,e),Z.call(this,e),this.addType(_().PickableGroup),this.pickSensorNodes=new Set}Object.assign(Object.setPrototypeOf($.prototype,K().prototype),Z.prototype,{initialize(){K().prototype.initialize.call(this),Z.prototype.initialize.call(this),this._pickable.addInterest("set_pickable__",this),this.set_pickable__()},set_pickableObjects__(){this.set_pickable__()},set_pickable__(){this.setPickableObject(this._pickable.getValue()||this.getTransformSensors().size)},traverse(e,t){if(e===y().PICKING){if(this._pickable.getValue()){if(this.getObjectType().has("NONE"))return;const i=this.getBrowser(),n=i.getPickable();if(this.getObjectType().has("ALL"))n.push(!0),K().prototype.traverse.call(this,e,t),n.pop();else{const s=this.pickSensorNodes,o=i.getPickSensors();for(const e of o.at(-1)){if(!e.getObjectType().has("ALL")){let t=0;for(const i of this.getObjectType())if(e.getObjectType().has(i)){++t;break}switch(e.getMatchCriterion()){case f.MATCH_ANY:if(0===t)continue;break;case f.MATCH_EVERY:if(t!==pickSensor.getObjectType().size)continue;break;case f.MATCH_ONLY_ONE:if(1!==t)continue}}s.add(e)}n.push(!0),o.push(s),K().prototype.traverse.call(this,e,t),o.pop(),n.pop(),s.clear()}}}else K().prototype.traverse.call(this,e,t)},dispose(){Z.prototype.dispose.call(this),K().prototype.dispose.call(this)}}),Object.defineProperties($,{...l().getStaticProperties("PickableGroup","Picking",1,"children","3.2"),fieldDefinitions:{value:new(h())([new(c())(_().inputOutput,"metadata",new(o().SFNode)),new(c())(_().inputOutput,"description",new(o().SFString)),new(c())(_().inputOutput,"pickable",new(o().SFBool)(!0)),new(c())(_().inputOutput,"objectType",new(o().MFString)("ALL")),new(c())(_().inputOutput,"visible",new(o().SFBool)(!0)),new(c())(_().inputOutput,"bboxDisplay",new(o().SFBool)),new(c())(_().initializeOnly,"bboxSize",new(o().SFVec3f)(-1,-1,-1)),new(c())(_().initializeOnly,"bboxCenter",new(o().SFVec3f)),new(c())(_().inputOnly,"addChildren",new(o().MFNode)),new(c())(_().inputOnly,"removeChildren",new(o().MFNode)),new(c())(_().inputOutput,"children",new(o().MFNode))]),enumerable:!0}});const ee=$,te=k().add("PickableGroup",ee),ie=e.X3DCast;var ne=t.n(ie);const se=e.Rotation4;var oe=t.n(se);const re=e.AmmoClass;var ce=t.n(re);function ae(){this.broadphase=new(ce().btDbvtBroadphase),this.collisionConfiguration=new(ce().btDefaultCollisionConfiguration),this.dispatcher=new(ce().btCollisionDispatcher)(this.collisionConfiguration),this.collisionWorld=new(ce().btCollisionWorld)(this.dispatcher,this.broadphase,this.collisionConfiguration),this.compoundShape1=new(ce().btCompoundShape),this.motionState1=new(ce().btDefaultMotionState),this.constructionInfo1=new(ce().btRigidBodyConstructionInfo)(0,this.motionState1,this.compoundShape1),this.rigidBody1=new(ce().btRigidBody)(this.constructionInfo1),this.compoundShape2=new(ce().btCompoundShape),this.motionState2=new(ce().btDefaultMotionState),this.constructionInfo2=new(ce().btRigidBodyConstructionInfo)(0,this.motionState2,this.compoundShape2),this.rigidBody2=new(ce().btRigidBody)(this.constructionInfo2),this.collisionWorld.addCollisionObject(this.rigidBody1),this.collisionWorld.addCollisionObject(this.rigidBody2)}Object.assign(ae.prototype,{constuctor:ae,setChildShape1(e,t){this.setChildShape(this.compoundShape1,e,t)},setChildShape2(e,t){this.setChildShape(this.compoundShape2,e,t)},setChildShape1Components(e,t,i){this.setChildShapeComponents(this.compoundShape1,e,t,i)},setChildShape2Components(e,t,i){this.setChildShapeComponents(this.compoundShape2,e,t,i)},setChildShape:(()=>{const e=new(z()),t=new(oe()),i=new(z())(1,1,1),n=new(ce().btVector3)(0,0,0);return function(s,o,r){s.getNumChildShapes()&&s.removeChildShapeByIndex(0),r.getNumChildShapes()&&(o.get(e,t,i),n.setValue(i.x,i.y,i.z),r.setLocalScaling(n),s.addChildShape(this.getTransform(e,t),r))}})(),setChildShapeComponents(e,t,i,n){e.getNumChildShapes()&&e.removeChildShapeByIndex(0),n.getNumChildShapes()&&(n.setLocalScaling(i),e.addChildShape(t,n))},contactTest(){this.collisionWorld.performDiscreteCollisionDetection();const e=this.dispatcher.getNumManifolds();for(let t=0;t<e;++t){const e=this.dispatcher.getManifoldByIndexInternal(t),i=e.getNumContacts();for(let t=0;t<i;++t){if(e.getContactPoint(t).getDistance()<=0)return!0}}return!1},getTransform:(()=>{const e=new(ce().btTransform),t=new(ce().btVector3)(0,0,0),i=new(v());return function(n,s,o){const r=o||e;return i.set(n,s),t.setValue(i[12],i[13],i[14]),r.getBasis().setValue(i[0],i[4],i[8],i[1],i[5],i[9],i[2],i[6],i[10]),r.setOrigin(t),r}})()});const he=ae,pe=k().add("VolumePicker",he);function le(e){D.call(this,e),this.addType(_().PointPickSensor),this.picker=new pe,this.compoundShapes=[]}Object.assign(Object.setPrototypeOf(le.prototype,D.prototype),{initialize(){D.prototype.initialize.call(this),this._pickingGeometry.addInterest("set_pickingGeometry__",this),this.set_pickingGeometry__()},set_pickingGeometry__(){this.pickingGeometryNode?._rebuild.removeInterest("set_geometry__",this),this.pickingGeometryNode=ne()(_().PointSet,this._pickingGeometry),this.pickingGeometryNode?._rebuild.addInterest("set_geometry__",this),this.set_geometry__()},set_geometry__:(()=>{const e=new(ce().btVector3)(1,1,1),t=new(ce().btVector3),i=new(ce().btTransform);return function(){const n=this.compoundShapes;if(this.pickingGeometryNode){const s=this.pickingGeometryNode.getCoord();if(s){const o=s.getSize();for(let r=0;r<o;++r)if(r<n.length){const o=n[r],c=s.get1Point(r,o.point);t.setValue(c.x,c.y,c.z),i.setOrigin(t),o.setLocalScaling(e),o.updateChildTransform(0,i)}else{const e=new(ce().btCompoundShape),o=new(ce().btSphereShape)(0),c=s.get1Point(r,new(z()));e.point=c,t.setValue(c.x,c.y,c.z),i.setOrigin(t),e.addChildShape(i,o),n.push(e)}n.length=o}else n.length=0}else n.length=0}})(),process:(()=>{const e=new(R()),t=new(R()),i=new(z()),n=new(z()),s=new(ce().btTransform),r=new(ce().btVector3),c=new(z()),a=new(oe()),h=new(z())(1,1,1),p=new(o().MFVec3f);return function(){if(this.pickingGeometryNode){const o=this.getModelMatrices(),l=this.getTargets();switch(this.getIntersectionType()){case N.BOUNDS:{for(let s=0,r=o.length;s<r;++s){const r=o[s];e.assign(this.pickingGeometryNode.getBBox()).multRight(r);for(let s=0,o=l.size;s<o;++s){const o=l[s];t.assign(o.geometryNode.getBBox()).multRight(o.modelMatrix),e.intersectsBox(t)&&(i.assign(e.center),n.assign(t.center),o.intersected=!0,o.distance=i.distance(n))}}const s=this.getPickedGeometries(),r=!!s.length;s.assign(s.filter((e=>e))),r!==this._isActive.getValue()&&(this._isActive=r),this._pickedGeometry.equals(s)||(this._pickedGeometry=s);break}case N.GEOMETRY:{const d=this.picker,g=this.compoundShapes;for(let p=0,u=o.length;p<u;++p){const u=o[p];e.assign(this.pickingGeometryNode.getBBox()).multRight(u),u.get(c,a,h),d.getTransform(c,a,s),r.setValue(h.x,h.y,h.z);for(let o=0,c=g.length;o<c;++o){const c=g[o];d.setChildShape1Components(s,r,c);for(let s=0,o=l.size;s<o;++s){const o=l[s],r=this.getPickShape(o.geometryNode);t.assign(o.geometryNode.getBBox()).multRight(o.modelMatrix),d.setChildShape2(o.modelMatrix,r.getCompoundShape()),d.contactTest()&&(i.assign(e.center),n.assign(t.center),o.intersected=!0,o.distance=i.distance(n),o.pickedPoint.push(c.point))}}}const u=this.getPickedGeometries(),y=!!u.length;u.assign(u.filter((e=>e))),y!==this._isActive.getValue()&&(this._isActive=y),this._pickedGeometry.equals(u)||(this._pickedGeometry=u);const m=this.getPickedTargets();p.length=0;for(let e=0,t=m.length;e<t;++e){const t=m[e].pickedPoint;for(let e=0,i=t.length;e<i;++e)p.push(t[e])}this._pickedPoint.equals(p)||(this._pickedPoint=p);break}}}D.prototype.process.call(this)}})()}),Object.defineProperties(le,{...l().getStaticProperties("PointPickSensor","Picking",1,"children","3.2"),fieldDefinitions:{value:new(h())([new(c())(_().inputOutput,"metadata",new(o().SFNode)),new(c())(_().inputOutput,"description",new(o().SFString)),new(c())(_().inputOutput,"enabled",new(o().SFBool)(!0)),new(c())(_().inputOutput,"objectType",new(o().MFString)("ALL")),new(c())(_().inputOutput,"matchCriterion",new(o().SFString)("MATCH_ANY")),new(c())(_().initializeOnly,"intersectionType",new(o().SFString)("BOUNDS")),new(c())(_().initializeOnly,"sortOrder",new(o().SFString)("CLOSEST")),new(c())(_().outputOnly,"isActive",new(o().SFBool)),new(c())(_().outputOnly,"pickedPoint",new(o().MFVec3f)),new(c())(_().inputOutput,"pickingGeometry",new(o().SFNode)),new(c())(_().inputOutput,"pickTarget",new(o().MFNode)),new(c())(_().outputOnly,"pickedGeometry",new(o().MFNode))]),enumerable:!0}});const de=le,ge=k().add("PointPickSensor",de);function ue(e){D.call(this,e),this.addType(_().PrimitivePickSensor),this.picker=new pe}Object.assign(Object.setPrototypeOf(ue.prototype,D.prototype),{initialize(){D.prototype.initialize.call(this),this._pickingGeometry.addInterest("set_pickingGeometry__",this),this.set_pickingGeometry__()},set_pickingGeometry__(){this.pickingGeometryNode=null;try{const e=this._pickingGeometry.getValue().getInnerNode(),t=e.getType();for(let i=t.length-1;i>=0;--i)switch(t[i]){case _().Box:case _().Cone:case _().Cylinder:case _().Sphere:this.pickingGeometryNode=e;break;default:continue}}catch{}},process:(()=>{const e=new(R()),t=new(R()),i=new(z()),n=new(z());return function(){if(this.pickingGeometryNode){const s=this.getModelMatrices(),o=this.getTargets();switch(this.getIntersectionType()){case N.BOUNDS:{for(let r=0,c=s.length;r<c;++r){const c=s[r];e.assign(this.pickingGeometryNode.getBBox()).multRight(c);for(let s=0,r=o.size;s<r;++s){const r=o[s];t.assign(r.geometryNode.getBBox()).multRight(r.modelMatrix),e.intersectsBox(t)&&(i.assign(e.center),n.assign(t.center),r.intersected=!0,r.distance=i.distance(n))}}const r=this.getPickedGeometries(),c=!!r.length;r.assign(r.filter((e=>e))),c!==this._isActive.getValue()&&(this._isActive=c),this._pickedGeometry.equals(r)||(this._pickedGeometry=r);break}case N.GEOMETRY:{const r=this.picker;for(let c=0,a=s.length;c<a;++c){const a=s[c],h=this.getPickShape(this.pickingGeometryNode);e.assign(this.pickingGeometryNode.getBBox()).multRight(a),r.setChildShape1(a,h.getCompoundShape());for(let s=0,c=o.size;s<c;++s){const c=o[s],a=this.getPickShape(c.geometryNode);t.assign(c.geometryNode.getBBox()).multRight(c.modelMatrix),r.setChildShape2(c.modelMatrix,a.getCompoundShape()),r.contactTest()&&(i.assign(e.center),n.assign(t.center),c.intersected=!0,c.distance=i.distance(n))}}const c=this.getPickedGeometries(),a=!!c.length;c.assign(c.filter((e=>e))),a!==this._isActive.getValue()&&(this._isActive=a),this._pickedGeometry.equals(c)||(this._pickedGeometry=c);break}}}D.prototype.process.call(this)}})()}),Object.defineProperties(ue,{...l().getStaticProperties("PrimitivePickSensor","Picking",2,"children","3.2"),fieldDefinitions:{value:new(h())([new(c())(_().inputOutput,"metadata",new(o().SFNode)),new(c())(_().inputOutput,"description",new(o().SFString)),new(c())(_().inputOutput,"enabled",new(o().SFBool)(!0)),new(c())(_().inputOutput,"objectType",new(o().MFString)("ALL")),new(c())(_().inputOutput,"matchCriterion",new(o().SFString)("MATCH_ANY")),new(c())(_().initializeOnly,"intersectionType",new(o().SFString)("BOUNDS")),new(c())(_().initializeOnly,"sortOrder",new(o().SFString)("CLOSEST")),new(c())(_().outputOnly,"isActive",new(o().SFBool)),new(c())(_().inputOutput,"pickingGeometry",new(o().SFNode)),new(c())(_().inputOutput,"pickTarget",new(o().MFNode)),new(c())(_().outputOnly,"pickedGeometry",new(o().MFNode))]),enumerable:!0}});const ye=ue,me=k().add("PrimitivePickSensor",ye);function _e(e){D.call(this,e),this.addType(_().VolumePickSensor),this.picker=new pe}Object.assign(Object.setPrototypeOf(_e.prototype,D.prototype),{initialize(){D.prototype.initialize.call(this),this._pickingGeometry.addInterest("set_pickingGeometry__",this),this.set_pickingGeometry__()},set_pickingGeometry__(){this.pickingGeometryNode=ne()(_().X3DGeometryNode,this._pickingGeometry)},process:(()=>{const e=new(R()),t=new(R()),i=new(z()),n=new(z());return function(){if(this.pickingGeometryNode){const s=this.getModelMatrices(),o=this.getTargets();switch(this.getIntersectionType()){case N.BOUNDS:{for(let r=0,c=s.length;r<c;++r){const c=s[r];e.assign(this.pickingGeometryNode.getBBox()).multRight(c);for(let s=0,r=o.size;s<r;++s){const r=o[s];t.assign(r.geometryNode.getBBox()).multRight(r.modelMatrix),e.intersectsBox(t)&&(i.assign(e.center),n.assign(t.center),r.intersected=!0,r.distance=i.distance(n))}}const r=this.getPickedGeometries(),c=!!r.length;r.assign(r.filter((e=>e))),c!==this._isActive.getValue()&&(this._isActive=c),this._pickedGeometry.equals(r)||(this._pickedGeometry=r);break}case N.GEOMETRY:{const r=this.picker;for(let c=0,a=s.length;c<a;++c){const a=s[c],h=this.getPickShape(this.pickingGeometryNode);e.assign(this.pickingGeometryNode.getBBox()).multRight(a),r.setChildShape1(a,h.getCompoundShape());for(let s=0,c=o.size;s<c;++s){const c=o[s],a=this.getPickShape(c.geometryNode);t.assign(c.geometryNode.getBBox()).multRight(c.modelMatrix),r.setChildShape2(c.modelMatrix,a.getCompoundShape()),r.contactTest()&&(i.assign(e.center),n.assign(t.center),c.intersected=!0,c.distance=i.distance(n))}}const c=this.getPickedGeometries(),a=!!c.length;c.assign(c.filter((e=>e))),a!==this._isActive.getValue()&&(this._isActive=a),this._pickedGeometry.equals(c)||(this._pickedGeometry=c);break}}}D.prototype.process.call(this)}})()}),Object.defineProperties(_e,{...l().getStaticProperties("VolumePickSensor","Picking",3,"children","3.2"),fieldDefinitions:{value:new(h())([new(c())(_().inputOutput,"metadata",new(o().SFNode)),new(c())(_().inputOutput,"description",new(o().SFString)),new(c())(_().inputOutput,"enabled",new(o().SFBool)(!0)),new(c())(_().inputOutput,"objectType",new(o().MFString)("ALL")),new(c())(_().inputOutput,"matchCriterion",new(o().SFString)("MATCH_ANY")),new(c())(_().initializeOnly,"intersectionType",new(o().SFString)("BOUNDS")),new(c())(_().initializeOnly,"sortOrder",new(o().SFString)("CLOSEST")),new(c())(_().outputOnly,"isActive",new(o().SFBool)),new(c())(_().inputOutput,"pickingGeometry",new(o().SFNode)),new(c())(_().inputOutput,"pickTarget",new(o().MFNode)),new(c())(_().outputOnly,"pickedGeometry",new(o().MFNode))]),enumerable:!0}});const we=_e,ke=k().add("VolumePickSensor",we);n().add({name:"Picking",concreteNodes:[q,te,ge,me,ke],abstractNodes:[D,Z]});k().add("PickingComponent",undefined)})();
1
+ /* X_ITE v11.3.2 */
2
+ const e=window[Symbol.for("X_ITE.X3D-11.3.2")];(()=>{var t={n:e=>{var i=e&&e.__esModule?()=>e.default:()=>e;return t.d(i,{a:i}),i},d:(e,i)=>{for(var n in i)t.o(i,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:i[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const i=e.Components;var n=t.n(i);const s=e.Fields;var o=t.n(s);const r=e.X3DFieldDefinition;var c=t.n(r);const a=e.FieldDefinitionArray;var p=t.n(a);const h=e.X3DNode;var d=t.n(h);const l=e.X3DSensorNode;var g=t.n(l);const u=e.TraverseType;var y=t.n(u);const m=e.X3DConstants;var _=t.n(m);const w=e.Namespace;var S=t.n(w);let k=0;const f={MATCH_ANY:k++,MATCH_EVERY:k++,MATCH_ONLY_ONE:k++},O=S().add("MatchCriterion",f);let b=0;const T={BOUNDS:b++,GEOMETRY:b++},N=S().add("IntersectionType",T);let C=0;const P={ANY:C++,CLOSEST:C++,ALL:C++,ALL_SORTED:C++},G=S().add("SortOrder",P),M=e.Matrix4;var B=t.n(M);const v=e.QuickSort;var x=t.n(v);const j=e.ObjectCache;const A=t.n(j)()(B());function F(e,t){return e.distance<t.distance}function L(e){g().call(this,e),this.addType(_().X3DPickSensorNode),this.objectType=new Set,this.intersectionType=N.BOUNDS,this.sortOrder=G.CLOSEST,this.pickTargetNodes=new Set,this.modelMatrices=[],this.targets=[],this.targets.size=0,this.pickedTargets=[],this.pickedTargetsSorter=new(x())(this.pickedTargets,F),this.pickedGeometries=new(o().MFNode)}Object.assign(Object.setPrototypeOf(L.prototype,g().prototype),{initialize(){this.getLive().addInterest("set_live__",this),this._enabled.addInterest("set_live__",this),this._objectType.addInterest("set_objectType__",this),this._matchCriterion.addInterest("set_matchCriterion__",this),this._intersectionType.addInterest("set_intersectionType__",this),this._sortOrder.addInterest("set_sortOrder__",this),this._pickTarget.addInterest("set_pickTarget__",this),this.set_objectType__(),this.set_matchCriterion__(),this.set_intersectionType__(),this.set_sortOrder__(),this.set_pickTarget__()},getObjectType(){return this.objectType},getMatchCriterion(){return this.matchCriterion},getIntersectionType(){return this.intersectionType},getSortOrder(){return this.sortOrder},getModelMatrices(){return this.modelMatrices},getTargets(){return this.targets},getPickShape:(()=>{const e=new WeakMap;return function(t){const i=e.get(t);if(void 0!==i)return i;const n=this.getBrowser().getPrivateScene(),s=n.createNode("Shape",!1),o=n.createNode("CollidableShape",!1);return s.setPrivate(!0),o.setPrivate(!0),o.setConvex(!0),s._geometry=t,o._shape=s,s.setup(),o.setup(),e.set(t,o),o}})(),getPickedGeometries(){const e=this.targets,t=e.size,i=this.pickedTargets,n=this.pickedGeometries;i.length=0;for(let n=0;n<t;++n){const t=e[n];t.intersected&&i.push(t)}if(0===i.length)return n.length=0,n;switch(this.sortOrder){case G.ANY:i.length=1,n[0]=this.getPickedGeometry(i[0]),n.length=1;break;case G.CLOSEST:this.pickedTargetsSorter.sort(0,i.length),i.length=1,n[0]=this.getPickedGeometry(i[0]),n.length=1;break;case G.ALL:{const e=i.length;for(let t=0;t<e;++t)n[t]=this.getPickedGeometry(i[t]);n.length=e;break}case G.ALL_SORTED:{const e=i.length;this.pickedTargetsSorter.sort(0,e);for(let t=0;t<e;++t)n[t]=this.getPickedGeometry(i[t]);n.length=e;break}}return n},getPickedGeometry(e){const t=this.getExecutionContext(),i=e.geometryNode;if(i.getExecutionContext()===t)return i;const n=i.getExecutionContext();if(n.getType().includes(_().X3DPrototypeInstance)&&n.getExecutionContext()===t)return n;const s=e.pickingHierarchy;for(let e=s.length-1;e>=0;--e){const i=s[e];if(i.getExecutionContext()===t)return i;const n=i.getExecutionContext();if(n.getType().includes(_().X3DPrototypeInstance)&&n.getExecutionContext()===t)return n}return null},getPickedTargets(){return this.pickedTargets},set_live__(){this.getLive().getValue()&&this._enabled.getValue()&&!this.objectType.has("NONE")?(this.getBrowser().addPickSensor(this),this.setPickableObject(!0)):(this.getBrowser().removePickSensor(this),this.setPickableObject(!1))},set_objectType__(){this.objectType.clear();for(const e of this._objectType)this.objectType.add(e);this.set_live__()},set_matchCriterion__:(()=>{const e=new Map([["MATCH_ANY",O.MATCH_ANY],["MATCH_EVERY",O.MATCH_EVERY],["MATCH_ONLY_ONE",O.MATCH_ONLY_ONE]]);return function(){this.matchCriterion=e.get(this._matchCriterion.getValue())??O.MATCH_ANY}})(),set_intersectionType__:(()=>{const e=new Map([["BOUNDS",N.BOUNDS],["GEOMETRY",N.GEOMETRY]]);return function(){this.intersectionType=e.get(this._intersectionType.getValue())??N.BOUNDS}})(),set_sortOrder__:(()=>{const e=new Map([["ANY",G.ANY],["CLOSEST",G.CLOSEST],["ALL",G.ALL],["ALL_SORTED",G.ALL_SORTED]]);return function(){this.sortOrder=e.get(this._sortOrder.getValue())??G.CLOSEST}})(),set_pickTarget__(){this.pickTargetNodes.clear();for(const e of this._pickTarget)try{const t=e.getValue().getInnerNode(),i=t.getType();for(let e=i.length-1;e>=0;--e)switch(i[e]){case _().Inline:case _().Shape:case _().X3DGroupingNode:this.pickTargetNodes.add(t);break;default:continue}}catch{}},traverse(e,t){e===y().PICKING&&this.isPickableObject()&&this.modelMatrices.push(A.pop().assign(t.getModelViewMatrix().get()))},collect(e,t,i){const n=this.pickTargetNodes;if(i.some((e=>n.has(e)))){const n=this.targets;if(n.size<n.length)var s=n[n.size];else{s={modelMatrix:new(B()),pickingHierarchy:[],pickedPoint:[],intersections:[]};n.push(s)}++n.size,s.intersected=!1,s.geometryNode=e,s.pickedPoint.length=0,s.intersections.length=0,s.modelMatrix.assign(t);const o=s.pickingHierarchy;for(let e=0,t=i.length;e<t;++e)o[e]=i[e];o.length=length}},process(){for(const e of this.modelMatrices)A.push(e);this.modelMatrices.length=0,this.targets.size=0}}),Object.defineProperties(L,d().getStaticProperties("X3DPickSensorNode","Picking",1));const V=L,D=S().add("X3DPickSensorNode",V),E=e.Vector3;var I=t.n(E);const z=e.Box3;var R=t.n(z);const Y=e.Line3;var H=t.n(Y);function X(e){D.call(this,e),this.addType(_().LinePickSensor)}Object.assign(Object.setPrototypeOf(X.prototype,D.prototype),{initialize(){D.prototype.initialize.call(this),this._pickingGeometry.addInterest("set_pickingGeometry__",this),this.set_pickingGeometry__()},set_pickingGeometry__(){this.pickingGeometryNode=null;try{const e=this._pickingGeometry.getValue().getInnerNode(),t=e.getType();for(let i=t.length-1;i>=0;--i)switch(t[i]){case _().IndexedLineSet:case _().LineSet:this.pickingGeometryNode=e;break;default:continue}}catch{}},process:(()=>{const e=new(R()),t=new(R()),i=new(I()),n=new(I()),s=new(B()),r=new(I()),c=new(I()),a=new(H()),p=new(I()),h=new(I()),d=[],l=[],g=new(I()),u=new(o().MFVec3f),y=new(o().MFVec3f),m=new(o().MFVec3f);return function(){if(this.pickingGeometryNode){const o=this.getModelMatrices(),_=this.getTargets();switch(this.getIntersectionType()){case N.BOUNDS:{for(const s of o){e.assign(this.pickingGeometryNode.getBBox()).multRight(s);for(const s of _)t.assign(s.geometryNode.getBBox()).multRight(s.modelMatrix),e.intersectsBox(t)&&(i.assign(e.center),n.assign(t.center),s.intersected=!0,s.distance=i.distance(n))}const s=this.getPickedGeometries(),r=!!s.length;s.assign(s.filter((e=>e))),r!==this._isActive.getValue()&&(this._isActive=r),this._pickedGeometry.equals(s)||(this._pickedGeometry=s);break}case N.GEOMETRY:{for(const g of o){e.assign(this.pickingGeometryNode.getBBox()).multRight(g);for(const o of _){const u=o.geometryNode,y=this.pickingGeometryNode.getVertices();t.assign(u.getBBox()).multRight(o.modelMatrix),s.assign(o.modelMatrix).inverse().multLeft(g);for(let e=0,t=y.length;e<t;e+=8)if(s.multVecMatrix(r.set(y[e+0],y[e+1],y[e+2])),s.multVecMatrix(c.set(y[e+4],y[e+5],y[e+6])),a.setPoints(r,c),l.length=0,u.intersectsLine(a,o.modelMatrix,d,l))for(let e=0,t=l.length;e<t;++e){const t=l[e];p.assign(t.point).subtract(r),h.assign(t.point).subtract(c);p.add(h).magnitude()<=r.distance(c)&&o.intersections.push(t)}o.intersections.length&&(i.assign(e.center),n.assign(t.center),o.intersected=!0,o.distance=i.distance(n))}}const w=this.getPickedGeometries(),S=!!w.length;w.assign(w.filter((e=>e))),S!==this._isActive.getValue()&&(this._isActive=S),this._pickedGeometry.equals(w)||(this._pickedGeometry=w);const k=this.getPickedTargets();u.length=0,y.length=0,m.length=0;for(const e of k){const t=e.intersections;for(const e of t){const t=e.texCoord;g.set(t.x,t.y,t.z),u.push(g),y.push(e.normal),m.push(e.point)}}this._pickedTextureCoordinate.equals(u)||(this._pickedTextureCoordinate=u),this._pickedNormal.equals(y)||(this._pickedNormal=y),this._pickedPoint.equals(m)||(this._pickedPoint=m);break}}}D.prototype.process.call(this)}})()}),Object.defineProperties(X,{...d().getStaticProperties("LinePickSensor","Picking",1,"children","3.2"),fieldDefinitions:{value:new(p())([new(c())(_().inputOutput,"metadata",new(o().SFNode)),new(c())(_().inputOutput,"description",new(o().SFString)),new(c())(_().inputOutput,"enabled",new(o().SFBool)(!0)),new(c())(_().inputOutput,"objectType",new(o().MFString)("ALL")),new(c())(_().inputOutput,"matchCriterion",new(o().SFString)("MATCH_ANY")),new(c())(_().initializeOnly,"intersectionType",new(o().SFString)("BOUNDS")),new(c())(_().initializeOnly,"sortOrder",new(o().SFString)("CLOSEST")),new(c())(_().outputOnly,"isActive",new(o().SFBool)),new(c())(_().outputOnly,"pickedTextureCoordinate",new(o().MFVec3f)),new(c())(_().outputOnly,"pickedNormal",new(o().MFVec3f)),new(c())(_().outputOnly,"pickedPoint",new(o().MFVec3f)),new(c())(_().inputOutput,"pickingGeometry",new(o().SFNode)),new(c())(_().inputOutput,"pickTarget",new(o().MFNode)),new(c())(_().outputOnly,"pickedGeometry",new(o().MFNode))]),enumerable:!0}});const U=X,q=S().add("LinePickSensor",U),W=e.X3DGroupingNode;var K=t.n(W);function Q(e){this.addType(_().X3DPickableObject),this.objectType=new Set}Object.assign(Q.prototype,{initialize(){this._objectType.addInterest("set_objectType__",this),this.set_objectType__()},getObjectType(){return this.objectType},set_objectType__(){this.objectType.clear();for(const e of this._objectType)this.objectType.add(e)},dispose(){}}),Object.defineProperties(Q,d().getStaticProperties("X3DPickableObject","Picking",1));const J=Q,Z=S().add("X3DPickableObject",J);function $(e){K().call(this,e),Z.call(this,e),this.addType(_().PickableGroup),this.pickSensorNodes=new Set}Object.assign(Object.setPrototypeOf($.prototype,K().prototype),Z.prototype,{initialize(){K().prototype.initialize.call(this),Z.prototype.initialize.call(this),this._pickable.addInterest("set_pickableObjects__",this)},set_pickableObjects__(){this.setPickableObject(this._pickable.getValue()||this.getTransformSensors().size)},traverse(e,t){if(e===y().PICKING){if(this._pickable.getValue()){if(this.getObjectType().has("NONE"))return;const i=this.getBrowser(),n=i.getPickable();if(this.getObjectType().has("ALL"))n.push(!0),K().prototype.traverse.call(this,e,t),n.pop();else{const s=this.pickSensorNodes,o=i.getPickSensors();for(const e of o.at(-1)){if(!e.getObjectType().has("ALL")){let t=0;for(const i of this.getObjectType())if(e.getObjectType().has(i)){++t;break}switch(e.getMatchCriterion()){case O.MATCH_ANY:if(0===t)continue;break;case O.MATCH_EVERY:if(t!==pickSensor.getObjectType().size)continue;break;case O.MATCH_ONLY_ONE:if(1!==t)continue}}s.add(e)}n.push(!0),o.push(s),K().prototype.traverse.call(this,e,t),o.pop(),n.pop(),s.clear()}}}else K().prototype.traverse.call(this,e,t)},dispose(){Z.prototype.dispose.call(this),K().prototype.dispose.call(this)}}),Object.defineProperties($,{...d().getStaticProperties("PickableGroup","Picking",1,"children","3.2"),fieldDefinitions:{value:new(p())([new(c())(_().inputOutput,"metadata",new(o().SFNode)),new(c())(_().inputOutput,"description",new(o().SFString)),new(c())(_().inputOutput,"pickable",new(o().SFBool)(!0)),new(c())(_().inputOutput,"objectType",new(o().MFString)("ALL")),new(c())(_().inputOutput,"visible",new(o().SFBool)(!0)),new(c())(_().inputOutput,"bboxDisplay",new(o().SFBool)),new(c())(_().initializeOnly,"bboxSize",new(o().SFVec3f)(-1,-1,-1)),new(c())(_().initializeOnly,"bboxCenter",new(o().SFVec3f)),new(c())(_().inputOnly,"addChildren",new(o().MFNode)),new(c())(_().inputOnly,"removeChildren",new(o().MFNode)),new(c())(_().inputOutput,"children",new(o().MFNode))]),enumerable:!0}});const ee=$,te=S().add("PickableGroup",ee),ie=e.X3DCast;var ne=t.n(ie);const se=e.Rotation4;var oe=t.n(se);const re=e.AmmoClass;var ce=t.n(re);function ae(){this.broadphase=new(ce().btDbvtBroadphase),this.collisionConfiguration=new(ce().btDefaultCollisionConfiguration),this.dispatcher=new(ce().btCollisionDispatcher)(this.collisionConfiguration),this.collisionWorld=new(ce().btCollisionWorld)(this.dispatcher,this.broadphase,this.collisionConfiguration),this.compoundShape1=new(ce().btCompoundShape),this.motionState1=new(ce().btDefaultMotionState),this.constructionInfo1=new(ce().btRigidBodyConstructionInfo)(0,this.motionState1,this.compoundShape1),this.rigidBody1=new(ce().btRigidBody)(this.constructionInfo1),this.compoundShape2=new(ce().btCompoundShape),this.motionState2=new(ce().btDefaultMotionState),this.constructionInfo2=new(ce().btRigidBodyConstructionInfo)(0,this.motionState2,this.compoundShape2),this.rigidBody2=new(ce().btRigidBody)(this.constructionInfo2),this.collisionWorld.addCollisionObject(this.rigidBody1),this.collisionWorld.addCollisionObject(this.rigidBody2)}Object.assign(ae.prototype,{constuctor:ae,setChildShape1(e,t){this.setChildShape(this.compoundShape1,e,t)},setChildShape2(e,t){this.setChildShape(this.compoundShape2,e,t)},setChildShape1Components(e,t,i){this.setChildShapeComponents(this.compoundShape1,e,t,i)},setChildShape2Components(e,t,i){this.setChildShapeComponents(this.compoundShape2,e,t,i)},setChildShape:(()=>{const e=new(I()),t=new(oe()),i=new(I())(1,1,1),n=new(ce().btVector3)(0,0,0);return function(s,o,r){s.getNumChildShapes()&&s.removeChildShapeByIndex(0),r.getNumChildShapes()&&(o.get(e,t,i),n.setValue(i.x,i.y,i.z),r.setLocalScaling(n),s.addChildShape(this.getTransform(e,t),r))}})(),setChildShapeComponents(e,t,i,n){e.getNumChildShapes()&&e.removeChildShapeByIndex(0),n.getNumChildShapes()&&(n.setLocalScaling(i),e.addChildShape(t,n))},contactTest(){this.collisionWorld.performDiscreteCollisionDetection();const e=this.dispatcher.getNumManifolds();for(let t=0;t<e;++t){const e=this.dispatcher.getManifoldByIndexInternal(t),i=e.getNumContacts();for(let t=0;t<i;++t){if(e.getContactPoint(t).getDistance()<=0)return!0}}return!1},getTransform:(()=>{const e=new(ce().btTransform),t=new(ce().btVector3)(0,0,0),i=new(B());return function(n,s,o){const r=o||e;return i.set(n,s),t.setValue(i[12],i[13],i[14]),r.getBasis().setValue(i[0],i[4],i[8],i[1],i[5],i[9],i[2],i[6],i[10]),r.setOrigin(t),r}})()});const pe=ae,he=S().add("VolumePicker",pe);function de(e){D.call(this,e),this.addType(_().PointPickSensor),this.picker=new he,this.compoundShapes=[]}Object.assign(Object.setPrototypeOf(de.prototype,D.prototype),{initialize(){D.prototype.initialize.call(this),this._pickingGeometry.addInterest("set_pickingGeometry__",this),this.set_pickingGeometry__()},set_pickingGeometry__(){this.pickingGeometryNode?._rebuild.removeInterest("set_geometry__",this),this.pickingGeometryNode=ne()(_().PointSet,this._pickingGeometry),this.pickingGeometryNode?._rebuild.addInterest("set_geometry__",this),this.set_geometry__()},set_geometry__:(()=>{const e=new(ce().btVector3)(1,1,1),t=new(ce().btVector3),i=new(ce().btTransform);return function(){const n=this.compoundShapes;if(this.pickingGeometryNode){const s=this.pickingGeometryNode.getCoord();if(s){const o=s.getSize();for(let r=0;r<o;++r)if(r<n.length){const o=n[r],c=s.get1Point(r,o.point);t.setValue(c.x,c.y,c.z),i.setOrigin(t),o.setLocalScaling(e),o.updateChildTransform(0,i)}else{const e=new(ce().btCompoundShape),o=new(ce().btSphereShape)(0),c=s.get1Point(r,new(I()));e.point=c,t.setValue(c.x,c.y,c.z),i.setOrigin(t),e.addChildShape(i,o),n.push(e)}n.length=o}else n.length=0}else n.length=0}})(),process:(()=>{const e=new(R()),t=new(R()),i=new(I()),n=new(I()),s=new(ce().btTransform),r=new(ce().btVector3),c=new(I()),a=new(oe()),p=new(I())(1,1,1),h=new(o().MFVec3f);return function(){if(this.pickingGeometryNode){const o=this.getModelMatrices(),d=this.getTargets();switch(this.getIntersectionType()){case N.BOUNDS:{for(const s of o){e.assign(this.pickingGeometryNode.getBBox()).multRight(s);for(const s of d)t.assign(s.geometryNode.getBBox()).multRight(s.modelMatrix),e.intersectsBox(t)&&(i.assign(e.center),n.assign(t.center),s.intersected=!0,s.distance=i.distance(n))}const s=this.getPickedGeometries(),r=!!s.length;s.assign(s.filter((e=>e))),r!==this._isActive.getValue()&&(this._isActive=r),this._pickedGeometry.equals(s)||(this._pickedGeometry=s);break}case N.GEOMETRY:{const l=this.picker,g=this.compoundShapes;for(const h of o){e.assign(this.pickingGeometryNode.getBBox()).multRight(h),h.get(c,a,p),l.getTransform(c,a,s),r.setValue(p.x,p.y,p.z);for(const o of g){l.setChildShape1Components(s,r,o);for(const s of d){const r=this.getPickShape(s.geometryNode);t.assign(s.geometryNode.getBBox()).multRight(s.modelMatrix),l.setChildShape2(s.modelMatrix,r.getCompoundShape()),l.contactTest()&&(i.assign(e.center),n.assign(t.center),s.intersected=!0,s.distance=i.distance(n),s.pickedPoint.push(o.point))}}}const u=this.getPickedGeometries(),y=!!u.length;u.assign(u.filter((e=>e))),y!==this._isActive.getValue()&&(this._isActive=y),this._pickedGeometry.equals(u)||(this._pickedGeometry=u);const m=this.getPickedTargets();h.length=0;for(const e of m)for(const t of e.pickedPoint)h.push(t);this._pickedPoint.equals(h)||(this._pickedPoint=h);break}}}D.prototype.process.call(this)}})()}),Object.defineProperties(de,{...d().getStaticProperties("PointPickSensor","Picking",1,"children","3.2"),fieldDefinitions:{value:new(p())([new(c())(_().inputOutput,"metadata",new(o().SFNode)),new(c())(_().inputOutput,"description",new(o().SFString)),new(c())(_().inputOutput,"enabled",new(o().SFBool)(!0)),new(c())(_().inputOutput,"objectType",new(o().MFString)("ALL")),new(c())(_().inputOutput,"matchCriterion",new(o().SFString)("MATCH_ANY")),new(c())(_().initializeOnly,"intersectionType",new(o().SFString)("BOUNDS")),new(c())(_().initializeOnly,"sortOrder",new(o().SFString)("CLOSEST")),new(c())(_().outputOnly,"isActive",new(o().SFBool)),new(c())(_().outputOnly,"pickedPoint",new(o().MFVec3f)),new(c())(_().inputOutput,"pickingGeometry",new(o().SFNode)),new(c())(_().inputOutput,"pickTarget",new(o().MFNode)),new(c())(_().outputOnly,"pickedGeometry",new(o().MFNode))]),enumerable:!0}});const le=de,ge=S().add("PointPickSensor",le);function ue(e){D.call(this,e),this.addType(_().PrimitivePickSensor),this.picker=new he}Object.assign(Object.setPrototypeOf(ue.prototype,D.prototype),{initialize(){D.prototype.initialize.call(this),this._pickingGeometry.addInterest("set_pickingGeometry__",this),this.set_pickingGeometry__()},set_pickingGeometry__(){this.pickingGeometryNode=null;try{const e=this._pickingGeometry.getValue().getInnerNode(),t=e.getType();for(let i=t.length-1;i>=0;--i)switch(t[i]){case _().Box:case _().Cone:case _().Cylinder:case _().Sphere:this.pickingGeometryNode=e;break;default:continue}}catch{}},process:(()=>{const e=new(R()),t=new(R()),i=new(I()),n=new(I());return function(){if(this.pickingGeometryNode){const s=this.getModelMatrices(),o=this.getTargets();switch(this.getIntersectionType()){case N.BOUNDS:{for(const r of s){e.assign(this.pickingGeometryNode.getBBox()).multRight(r);for(const s of o)t.assign(s.geometryNode.getBBox()).multRight(s.modelMatrix),e.intersectsBox(t)&&(i.assign(e.center),n.assign(t.center),s.intersected=!0,s.distance=i.distance(n))}const r=this.getPickedGeometries(),c=!!r.length;r.assign(r.filter((e=>e))),c!==this._isActive.getValue()&&(this._isActive=c),this._pickedGeometry.equals(r)||(this._pickedGeometry=r);break}case N.GEOMETRY:{const r=this.picker;for(const c of s){const s=this.getPickShape(this.pickingGeometryNode);e.assign(this.pickingGeometryNode.getBBox()).multRight(c),r.setChildShape1(c,s.getCompoundShape());for(const s of o){const o=this.getPickShape(s.geometryNode);t.assign(s.geometryNode.getBBox()).multRight(s.modelMatrix),r.setChildShape2(s.modelMatrix,o.getCompoundShape()),r.contactTest()&&(i.assign(e.center),n.assign(t.center),s.intersected=!0,s.distance=i.distance(n))}}const c=this.getPickedGeometries(),a=!!c.length;c.assign(c.filter((e=>e))),a!==this._isActive.getValue()&&(this._isActive=a),this._pickedGeometry.equals(c)||(this._pickedGeometry=c);break}}}D.prototype.process.call(this)}})()}),Object.defineProperties(ue,{...d().getStaticProperties("PrimitivePickSensor","Picking",2,"children","3.2"),fieldDefinitions:{value:new(p())([new(c())(_().inputOutput,"metadata",new(o().SFNode)),new(c())(_().inputOutput,"description",new(o().SFString)),new(c())(_().inputOutput,"enabled",new(o().SFBool)(!0)),new(c())(_().inputOutput,"objectType",new(o().MFString)("ALL")),new(c())(_().inputOutput,"matchCriterion",new(o().SFString)("MATCH_ANY")),new(c())(_().initializeOnly,"intersectionType",new(o().SFString)("BOUNDS")),new(c())(_().initializeOnly,"sortOrder",new(o().SFString)("CLOSEST")),new(c())(_().outputOnly,"isActive",new(o().SFBool)),new(c())(_().inputOutput,"pickingGeometry",new(o().SFNode)),new(c())(_().inputOutput,"pickTarget",new(o().MFNode)),new(c())(_().outputOnly,"pickedGeometry",new(o().MFNode))]),enumerable:!0}});const ye=ue,me=S().add("PrimitivePickSensor",ye);function _e(e){D.call(this,e),this.addType(_().VolumePickSensor),this.picker=new he}Object.assign(Object.setPrototypeOf(_e.prototype,D.prototype),{initialize(){D.prototype.initialize.call(this),this._pickingGeometry.addInterest("set_pickingGeometry__",this),this.set_pickingGeometry__()},set_pickingGeometry__(){this.pickingGeometryNode=ne()(_().X3DGeometryNode,this._pickingGeometry)},process:(()=>{const e=new(R()),t=new(R()),i=new(I()),n=new(I());return function(){if(this.pickingGeometryNode){const s=this.getModelMatrices(),o=this.getTargets();switch(this.getIntersectionType()){case N.BOUNDS:{for(const r of s){e.assign(this.pickingGeometryNode.getBBox()).multRight(r);for(const s of o)t.assign(s.geometryNode.getBBox()).multRight(s.modelMatrix),e.intersectsBox(t)&&(i.assign(e.center),n.assign(t.center),s.intersected=!0,s.distance=i.distance(n))}const r=this.getPickedGeometries(),c=!!r.length;r.assign(r.filter((e=>e))),c!==this._isActive.getValue()&&(this._isActive=c),this._pickedGeometry.equals(r)||(this._pickedGeometry=r);break}case N.GEOMETRY:{const r=this.picker;for(const c of s){const s=this.getPickShape(this.pickingGeometryNode);e.assign(this.pickingGeometryNode.getBBox()).multRight(c),r.setChildShape1(c,s.getCompoundShape());for(const s of o){const o=this.getPickShape(s.geometryNode);t.assign(s.geometryNode.getBBox()).multRight(s.modelMatrix),r.setChildShape2(s.modelMatrix,o.getCompoundShape()),r.contactTest()&&(i.assign(e.center),n.assign(t.center),s.intersected=!0,s.distance=i.distance(n))}}const c=this.getPickedGeometries(),a=!!c.length;c.assign(c.filter((e=>e))),a!==this._isActive.getValue()&&(this._isActive=a),this._pickedGeometry.equals(c)||(this._pickedGeometry=c);break}}}D.prototype.process.call(this)}})()}),Object.defineProperties(_e,{...d().getStaticProperties("VolumePickSensor","Picking",3,"children","3.2"),fieldDefinitions:{value:new(p())([new(c())(_().inputOutput,"metadata",new(o().SFNode)),new(c())(_().inputOutput,"description",new(o().SFString)),new(c())(_().inputOutput,"enabled",new(o().SFBool)(!0)),new(c())(_().inputOutput,"objectType",new(o().MFString)("ALL")),new(c())(_().inputOutput,"matchCriterion",new(o().SFString)("MATCH_ANY")),new(c())(_().initializeOnly,"intersectionType",new(o().SFString)("BOUNDS")),new(c())(_().initializeOnly,"sortOrder",new(o().SFString)("CLOSEST")),new(c())(_().outputOnly,"isActive",new(o().SFBool)),new(c())(_().inputOutput,"pickingGeometry",new(o().SFNode)),new(c())(_().inputOutput,"pickTarget",new(o().MFNode)),new(c())(_().outputOnly,"pickedGeometry",new(o().MFNode))]),enumerable:!0}});const we=_e,Se=S().add("VolumePickSensor",we);n().add({name:"Picking",concreteNodes:[q,te,ge,me,Se],abstractNodes:[D,Z]});S().add("PickingComponent",undefined)})();