x_ite 10.1.0 → 10.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/README.md +18 -18
  2. package/dist/LICENSE.md +4 -0
  3. package/dist/X3DUOM.xml +69 -11
  4. package/dist/assets/components/{Annotation.js → AnnotationComponent.js} +138 -260
  5. package/dist/assets/components/AnnotationComponent.min.js +2 -0
  6. package/dist/assets/components/{CADGeometry.js → CADGeometryComponent.js} +177 -299
  7. package/dist/assets/components/CADGeometryComponent.min.js +2 -0
  8. package/dist/assets/components/{CubeMapTexturing.js → CubeMapTexturingComponent.js} +218 -257
  9. package/dist/assets/components/CubeMapTexturingComponent.min.js +2 -0
  10. package/dist/assets/components/DISComponent.js +994 -0
  11. package/dist/assets/components/DISComponent.min.js +2 -0
  12. package/dist/assets/components/{EventUtilities.js → EventUtilitiesComponent.js} +121 -274
  13. package/dist/assets/components/EventUtilitiesComponent.min.js +2 -0
  14. package/dist/assets/components/{Geometry2D.js → Geometry2DComponent.js} +233 -371
  15. package/dist/assets/components/Geometry2DComponent.min.js +2 -0
  16. package/dist/assets/components/{Geospatial.js → GeospatialComponent.js} +449 -676
  17. package/dist/assets/components/GeospatialComponent.min.js +2 -0
  18. package/dist/assets/components/{HAnim.js → HAnimComponent.js} +277 -387
  19. package/dist/assets/components/HAnimComponent.min.js +2 -0
  20. package/dist/assets/components/{KeyDeviceSensor.js → KeyDeviceSensorComponent.js} +71 -114
  21. package/dist/assets/components/KeyDeviceSensorComponent.min.js +2 -0
  22. package/dist/assets/components/{Layout.js → LayoutComponent.js} +234 -339
  23. package/dist/assets/components/LayoutComponent.min.js +2 -0
  24. package/dist/assets/components/{NURBS.js → NURBSComponent.js} +351 -654
  25. package/dist/assets/components/NURBSComponent.min.js +2 -0
  26. package/dist/assets/components/{ParticleSystems.js → ParticleSystemsComponent.js} +345 -674
  27. package/dist/assets/components/ParticleSystemsComponent.min.js +2 -0
  28. package/dist/assets/components/{Picking.js → PickingComponent.js} +245 -472
  29. package/dist/assets/components/PickingComponent.min.js +2 -0
  30. package/dist/assets/components/{RigidBodyPhysics.js → RigidBodyPhysicsComponent.js} +496 -804
  31. package/dist/assets/components/RigidBodyPhysicsComponent.min.js +2 -0
  32. package/dist/assets/components/ScriptingComponent.js +899 -0
  33. package/dist/assets/components/ScriptingComponent.min.js +2 -0
  34. package/dist/assets/components/{Text.js → TextComponent.js} +199 -251
  35. package/dist/assets/components/TextComponent.min.js +2 -0
  36. package/dist/assets/components/{TextureProjection.js → TextureProjectionComponent.js} +144 -190
  37. package/dist/assets/components/TextureProjectionComponent.min.js +2 -0
  38. package/dist/assets/components/{Texturing3D.js → Texturing3DComponent.js} +224 -386
  39. package/dist/assets/components/Texturing3DComponent.min.js +2 -0
  40. package/dist/assets/components/{VolumeRendering.js → VolumeRenderingComponent.js} +316 -603
  41. package/dist/assets/components/VolumeRenderingComponent.min.js +2 -0
  42. package/dist/assets/components/{X_ITE.js → X_ITEComponent.js} +1250 -1347
  43. package/dist/assets/components/X_ITEComponent.min.js +2 -0
  44. package/dist/assets/fonts/PT_Sans/OFL.txt +94 -0
  45. package/dist/assets/fonts/PT_Sans/PTSans-Bold.ttf +0 -0
  46. package/dist/assets/fonts/PT_Sans/PTSans-BoldItalic.ttf +0 -0
  47. package/dist/assets/fonts/PT_Sans/PTSans-Italic.ttf +0 -0
  48. package/dist/assets/fonts/PT_Sans/PTSans-Regular.ttf +0 -0
  49. package/dist/assets/images/XR.svg +74 -0
  50. package/dist/assets/lib/mikktspace_bg.wasm +0 -0
  51. package/dist/example.html +1 -1
  52. package/dist/x_ite.css +1 -1
  53. package/dist/x_ite.d.ts +128 -22
  54. package/dist/x_ite.js +3575 -6278
  55. package/dist/x_ite.min.js +2 -1
  56. package/dist/x_ite.min.mjs +2 -1
  57. package/dist/x_ite.mjs +3575 -6278
  58. package/dist/x_ite.zip +0 -0
  59. package/package.json +7 -5
  60. package/dist/assets/components/Annotation.min.js +0 -1
  61. package/dist/assets/components/CADGeometry.min.js +0 -1
  62. package/dist/assets/components/CubeMapTexturing.min.js +0 -1
  63. package/dist/assets/components/DIS.js +0 -1104
  64. package/dist/assets/components/DIS.min.js +0 -1
  65. package/dist/assets/components/EventUtilities.min.js +0 -1
  66. package/dist/assets/components/Geometry2D.min.js +0 -1
  67. package/dist/assets/components/Geospatial.min.js +0 -1
  68. package/dist/assets/components/HAnim.min.js +0 -1
  69. package/dist/assets/components/KeyDeviceSensor.min.js +0 -1
  70. package/dist/assets/components/Layout.min.js +0 -1
  71. package/dist/assets/components/NURBS.min.js +0 -1
  72. package/dist/assets/components/ParticleSystems.min.js +0 -1
  73. package/dist/assets/components/Picking.min.js +0 -1
  74. package/dist/assets/components/RigidBodyPhysics.min.js +0 -1
  75. package/dist/assets/components/Scripting.js +0 -927
  76. package/dist/assets/components/Scripting.min.js +0 -1
  77. package/dist/assets/components/Text.min.js +0 -1
  78. package/dist/assets/components/TextureProjection.min.js +0 -1
  79. package/dist/assets/components/Texturing3D.min.js +0 -1
  80. package/dist/assets/components/VolumeRendering.min.js +0 -1
  81. package/dist/assets/components/X_ITE.min.js +0 -1
  82. /package/dist/assets/fonts/{DroidSerif Apache License.txt → Droid/DroidSerif Apache License.txt} +0 -0
  83. /package/dist/assets/fonts/{DroidSerif-Bold.ttf → Droid/DroidSerif-Bold.ttf} +0 -0
  84. /package/dist/assets/fonts/{DroidSerif-BoldItalic.ttf → Droid/DroidSerif-BoldItalic.ttf} +0 -0
  85. /package/dist/assets/fonts/{DroidSerif-Italic.ttf → Droid/DroidSerif-Italic.ttf} +0 -0
  86. /package/dist/assets/fonts/{DroidSerif-Regular.ttf → Droid/DroidSerif-Regular.ttf} +0 -0
  87. /package/dist/assets/fonts/{Ubuntu LICENCE.txt → Ubuntu/Ubuntu LICENCE.txt} +0 -0
  88. /package/dist/assets/fonts/{Ubuntu-B.ttf → Ubuntu/Ubuntu-B.ttf} +0 -0
  89. /package/dist/assets/fonts/{Ubuntu-BI.ttf → Ubuntu/Ubuntu-BI.ttf} +0 -0
  90. /package/dist/assets/fonts/{Ubuntu-R.ttf → Ubuntu/Ubuntu-R.ttf} +0 -0
  91. /package/dist/assets/fonts/{Ubuntu-RI.ttf → Ubuntu/Ubuntu-RI.ttf} +0 -0
  92. /package/dist/assets/fonts/{UbuntuMono-B.ttf → Ubuntu/UbuntuMono-B.ttf} +0 -0
  93. /package/dist/assets/fonts/{UbuntuMono-BI.ttf → Ubuntu/UbuntuMono-BI.ttf} +0 -0
  94. /package/dist/assets/fonts/{UbuntuMono-R.ttf → Ubuntu/UbuntuMono-R.ttf} +0 -0
  95. /package/dist/assets/fonts/{UbuntuMono-RI.ttf → Ubuntu/UbuntuMono-RI.ttf} +0 -0
@@ -0,0 +1,2 @@
1
+ /* X_ITE v10.3.0 */
2
+ const e=window[Symbol.for("X_ITE.X3D-10.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 k=e.Namespace;var w=t.n(k);let S=0;const O={MATCH_ANY:S++,MATCH_EVERY:S++,MATCH_ONLY_ONE:S++},f=w().add("MatchCriterion",O);let b=0;const T={BOUNDS:b++,GEOMETRY:b++},N=w().add("IntersectionType",T);let C=0;const P={ANY:C++,CLOSEST:C++,ALL:C++,ALL_SORTED:C++},G=w().add("SortOrder",P),M=e.Matrix4;var v=t.n(M);const B=e.QuickSort;var x=t.n(B);const j=e.ObjectCache;var A,F,L,V=t.n(j)()(v());function D(e,t){return e.distance<t.distance}function E(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,D),this.pickedGeometries=new(o().MFNode)}Object.assign(Object.setPrototypeOf(E.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(),s=n.getPrivateScene().createNode("Shape",!1),o=n.getPrivateScene().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:function(){var e=this.targets,t=e.size,i=this.pickedTargets,n=this.pickedGeometries;i.length=0;for(var s=0;s<t;++s){var o=e[s];o.intersected&&i.push(o)}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:s=0;for(var r=i.length;s<r;++s)n[s]=this.getPickedGeometry(i[s]);n.length=r;break;case G.ALL_SORTED:for(this.pickedTargetsSorter.sort(0,i.length),s=0,r=i.length;s<r;++s)n[s]=this.getPickedGeometry(i[s]);n.length=r}return n},getPickedGeometry(e){var t=this.getExecutionContext(),i=e.geometryNode;if(i.getExecutionContext()===t)return i;if((o=i.getExecutionContext()).getType().includes(_().X3DPrototypeInstance)&&o.getExecutionContext()===t)return o;for(var n=e.pickingHierarchy,s=n.length-1;s>=0;--s){var o,r=n[s];if(r.getExecutionContext()===t)return r;if((o=r.getExecutionContext()).getType().includes(_().X3DPrototypeInstance)&&o.getExecutionContext()===t)return o}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(var e=0,t=this._objectType.length;e<t;++e)this.objectType.add(this._objectType[e]);this.set_live__()},set_matchCriterion__:(L=new Map([["MATCH_ANY",f.MATCH_ANY],["MATCH_EVERY",f.MATCH_EVERY],["MATCH_ONLY_ONE",f.MATCH_ONLY_ONE]]),function(){this.matchCriterion=L.get(this._matchCriterion.getValue()),void 0===this.matchCriterion&&(this.matchCriterion=MatchCriterionType.MATCH_ANY)}),set_intersectionType__:(F=new Map([["BOUNDS",N.BOUNDS],["GEOMETRY",N.GEOMETRY]]),function(){this.intersectionType=F.get(this._intersectionType.getValue()),void 0===this.intersectionType&&(this.intersectionType=N.BOUNDS)}),set_sortOrder__:(A=new Map([["ANY",G.ANY],["CLOSEST",G.CLOSEST],["ALL",G.ALL],["ALL_SORTED",G.ALL_SORTED]]),function(){this.sortOrder=A.get(this._sortOrder.getValue()),void 0===this.sortOrder&&(this.sortOrder=G.CLOSEST)}),set_pickTarget__(){this.pickTargetNodes.clear();for(var e=0,t=this._pickTarget.length;e<t;++e)try{for(var i=this._pickTarget[e].getValue().getInnerNode(),n=i.getType(),s=n.length-1;s>=0;--s)switch(n[s]){case _().Inline:case _().Shape:case _().X3DGroupingNode:this.pickTargetNodes.add(i);break;default:continue}}catch{}},traverse(e,t){e===y().PICKING&&this.isPickableObject()&&this.modelMatrices.push(V.pop().assign(t.getModelViewMatrix().get()))},collect(e,t,i){var n=this.pickTargetNodes;if(i.some((e=>n.has(e)))){var s=this.targets;if(s.size<s.length)var o=s[s.size];else{o={modelMatrix:new(v()),pickingHierarchy:[],pickedPoint:[],intersections:[]};s.push(o)}++s.size,o.intersected=!1,o.geometryNode=e,o.pickedPoint.length=0,o.intersections.length=0,o.modelMatrix.assign(t);for(var r=o.pickingHierarchy,c=0,a=i.length;c<a;++c)r[c]=i[c];r.length=a}},process(){for(var e=this.modelMatrices,t=0,i=e.length;t<i;++t)V.push(e[t]);this.modelMatrices.length=0,this.targets.size=0}}),Object.defineProperties(E,l().getStaticProperties("X3DPickSensorNode","Picking",1));const z=E,I=w().add("X3DPickSensorNode",z),R=e.Vector3;var Y=t.n(R);const H=e.Box3;var X=t.n(H);const U=e.Line3;var q=t.n(U);function W(e){I.call(this,e),this.addType(_().LinePickSensor),this.pickingGeometryNode=null}Object.assign(Object.setPrototypeOf(W.prototype,I.prototype),{initialize(){I.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(X()),t=new(X()),i=new(Y()),n=new(Y()),s=new(v()),r=new(Y()),c=new(Y()),a=new(q())(Y().Zero,Y().zAxis),h=new(Y()),p=new(Y()),l=[],d=[],g=new(Y()),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 k=this.getPickedGeometries(),w=!!k.length;k.assign(k.filter((e=>e))),w!==this._isActive.getValue()&&(this._isActive=w),this._pickedGeometry.equals(k)||(this._pickedGeometry=k);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}}}I.prototype.process.call(this)}})()}),Object.defineProperties(W,{...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 K=W,Q=w().add("LinePickSensor",K),Z=e.X3DGroupingNode;var J=t.n(Z);function $(e){this.addType(_().X3DPickableObject),this.objectType=new Set}Object.assign($.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($,l().getStaticProperties("X3DPickableObject","Picking",1));const ee=$,te=w().add("X3DPickableObject",ee);function ie(e){J().call(this,e),te.call(this,e),this.addType(_().PickableGroup),this.pickSensorNodes=new Set}Object.assign(Object.setPrototypeOf(ie.prototype,J().prototype),te.prototype,{initialize(){J().prototype.initialize.call(this),te.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),J().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),J().prototype.traverse.call(this,e,t),o.pop(),n.pop(),s.clear()}}}else J().prototype.traverse.call(this,e,t)},dispose(){te.prototype.dispose.call(this),J().prototype.dispose.call(this)}}),Object.defineProperties(ie,{...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 ne=ie,se=w().add("PickableGroup",ne),oe=e.X3DCast;var re=t.n(oe);const ce=e.Rotation4;var ae=t.n(ce);const he=e.AmmoClass;var pe=t.n(he);function le(){this.broadphase=new(pe().btDbvtBroadphase),this.collisionConfiguration=new(pe().btDefaultCollisionConfiguration),this.dispatcher=new(pe().btCollisionDispatcher)(this.collisionConfiguration),this.collisionWorld=new(pe().btCollisionWorld)(this.dispatcher,this.broadphase,this.collisionConfiguration),this.compoundShape1=new(pe().btCompoundShape),this.motionState1=new(pe().btDefaultMotionState),this.constructionInfo1=new(pe().btRigidBodyConstructionInfo)(0,this.motionState1,this.compoundShape1),this.rigidBody1=new(pe().btRigidBody)(this.constructionInfo1),this.compoundShape2=new(pe().btCompoundShape),this.motionState2=new(pe().btDefaultMotionState),this.constructionInfo2=new(pe().btRigidBodyConstructionInfo)(0,this.motionState2,this.compoundShape2),this.rigidBody2=new(pe().btRigidBody)(this.constructionInfo2),this.collisionWorld.addCollisionObject(this.rigidBody1),this.collisionWorld.addCollisionObject(this.rigidBody2)}Object.assign(le.prototype,{constuctor:le,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(Y()),t=new(ae()),i=new(Y())(1,1,1),n=new(pe().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(pe().btTransform),t=new(pe().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 de=le,ge=w().add("VolumePicker",de);function ue(e){I.call(this,e),this.addType(_().PointPickSensor),this.pickingGeometryNode=null,this.picker=new ge,this.compoundShapes=[]}Object.assign(Object.setPrototypeOf(ue.prototype,I.prototype),{initialize(){I.prototype.initialize.call(this),this._pickingGeometry.addInterest("set_pickingGeometry__",this),this.set_pickingGeometry__()},set_pickingGeometry__(){this.pickingGeometryNode?._rebuild.removeInterest("set_geometry__",this),this.pickingGeometryNode=re()(_().PointSet,this._pickingGeometry),this.pickingGeometryNode?._rebuild.addInterest("set_geometry__",this),this.set_geometry__()},set_geometry__:(()=>{const e=new(pe().btVector3)(1,1,1),t=new(pe().btVector3),i=new(pe().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(pe().btCompoundShape),o=new(pe().btSphereShape)(0),c=s.get1Point(r,new(Y()));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(X()),t=new(X()),i=new(Y()),n=new(Y()),s=new(pe().btTransform),r=new(pe().btVector3),c=new(Y()),a=new(ae()),h=new(Y())(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}}}I.prototype.process.call(this)}})()}),Object.defineProperties(ue,{...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 ye=ue,me=w().add("PointPickSensor",ye);function _e(e){I.call(this,e),this.addType(_().PrimitivePickSensor),this.pickingGeometryNode=null,this.picker=new ge}Object.assign(Object.setPrototypeOf(_e.prototype,I.prototype),{initialize(){I.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(X()),t=new(X()),i=new(Y()),n=new(Y());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}}}I.prototype.process.call(this)}})()}),Object.defineProperties(_e,{...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 ke=_e,we=w().add("PrimitivePickSensor",ke);function Se(e){I.call(this,e),this.addType(_().VolumePickSensor),this.pickingGeometryNode=null,this.picker=new ge}Object.assign(Object.setPrototypeOf(Se.prototype,I.prototype),{initialize(){I.prototype.initialize.call(this),this._pickingGeometry.addInterest("set_pickingGeometry__",this),this.set_pickingGeometry__()},set_pickingGeometry__(){this.pickingGeometryNode=re()(_().X3DGeometryNode,this._pickingGeometry)},process:(()=>{const e=new(X()),t=new(X()),i=new(Y()),n=new(Y());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}}}I.prototype.process.call(this)}})()}),Object.defineProperties(Se,{...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 Oe=Se,fe=w().add("VolumePickSensor",Oe);n().add({name:"Picking",concreteNodes:[Q,se,me,we,fe],abstractNodes:[I,te]});w().add("PickingComponent",undefined)})();