x_ite 12.0.0 → 12.0.1
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.
- package/README.md +4 -4
- package/dist/assets/components/AnnotationComponent.js +2 -2
- package/dist/assets/components/AnnotationComponent.min.js +2 -2
- package/dist/assets/components/CADGeometryComponent.js +2 -2
- package/dist/assets/components/CADGeometryComponent.min.js +2 -2
- package/dist/assets/components/CubeMapTexturingComponent.js +2 -2
- package/dist/assets/components/CubeMapTexturingComponent.min.js +2 -2
- package/dist/assets/components/DISComponent.js +2 -2
- package/dist/assets/components/DISComponent.min.js +2 -2
- package/dist/assets/components/EventUtilitiesComponent.js +2 -2
- package/dist/assets/components/EventUtilitiesComponent.min.js +2 -2
- package/dist/assets/components/Geometry2DComponent.js +2 -2
- package/dist/assets/components/Geometry2DComponent.min.js +2 -2
- package/dist/assets/components/GeospatialComponent.js +28 -25
- package/dist/assets/components/GeospatialComponent.min.js +2 -2
- package/dist/assets/components/HAnimComponent.js +2 -2
- package/dist/assets/components/HAnimComponent.min.js +2 -2
- package/dist/assets/components/KeyDeviceSensorComponent.js +2 -2
- package/dist/assets/components/KeyDeviceSensorComponent.min.js +2 -2
- package/dist/assets/components/LayoutComponent.js +2 -2
- package/dist/assets/components/LayoutComponent.min.js +2 -2
- package/dist/assets/components/NURBSComponent.js +247 -245
- package/dist/assets/components/NURBSComponent.min.js +2 -2
- package/dist/assets/components/ParticleSystemsComponent.js +8 -4
- package/dist/assets/components/ParticleSystemsComponent.min.js +2 -2
- package/dist/assets/components/PickingComponent.js +33 -58
- package/dist/assets/components/PickingComponent.min.js +2 -2
- package/dist/assets/components/RigidBodyPhysicsComponent.js +2 -2
- package/dist/assets/components/RigidBodyPhysicsComponent.min.js +2 -2
- package/dist/assets/components/ScriptingComponent.js +4 -3
- package/dist/assets/components/ScriptingComponent.min.js +2 -2
- package/dist/assets/components/TextComponent.js +3 -3
- package/dist/assets/components/TextComponent.min.js +2 -2
- package/dist/assets/components/TextureProjectionComponent.js +8 -10
- package/dist/assets/components/TextureProjectionComponent.min.js +2 -2
- package/dist/assets/components/Texturing3DComponent.js +3571 -3569
- package/dist/assets/components/Texturing3DComponent.min.js +2 -2
- package/dist/assets/components/VolumeRenderingComponent.js +2 -2
- package/dist/assets/components/VolumeRenderingComponent.min.js +2 -2
- package/dist/assets/components/WebXRComponent.js +5 -4
- package/dist/assets/components/WebXRComponent.min.js +2 -2
- package/dist/assets/components/X_ITEComponent.js +12 -9
- package/dist/assets/components/X_ITEComponent.min.js +2 -2
- package/dist/example.html +1 -1
- package/dist/x_ite.css +1 -1
- package/dist/x_ite.js +81285 -81345
- package/dist/x_ite.min.js +2 -2
- package/dist/x_ite.min.mjs +2 -2
- package/dist/x_ite.mjs +80660 -80720
- package/dist/x_ite.zip +0 -0
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* X_ITE v12.0.
|
|
2
|
-
const e=window[Symbol.for("X_ITE.X3D-12.0.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 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.X3DConstants;var y=t.n(u);const m=e.Namespace;var _=t.n(m);let w=0;const S={MATCH_ANY:w++,MATCH_EVERY:w++,MATCH_ONLY_ONE:w++},k=_().add("MatchCriterion",S);let f=0;const O={BOUNDS:f++,GEOMETRY:f++},b=_().add("IntersectionType",O);let T=0;const N={ANY:T++,CLOSEST:T++,ALL:T++,ALL_SORTED:T++},C=_().add("SortOrder",N),P=e.Matrix4;var G=t.n(P);const M=e.QuickSort;var B=t.n(M);const v=e.ObjectCache;const x=t.n(v)()(G());function A(e,t){return e.distance<t.distance}function F(e){g().call(this,e),this.addType(y().X3DPickSensorNode),this.objectType=new Set,this.intersectionType=b.BOUNDS,this.sortOrder=C.CLOSEST,this.pickTargetNodes=new Set,this.modelMatrices=[],this.targets=[],this.targets.size=0,this.pickedTargets=[],this.pickedTargetsSorter=new(B())(this.pickedTargets,A),this.pickedGeometries=new(o().MFNode)}Object.assign(Object.setPrototypeOf(F.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 C.ANY:i.length=1,n[0]=this.getPickedGeometry(i[0]),n.length=1;break;case C.CLOSEST:this.pickedTargetsSorter.sort(0,i.length),i.length=1,n[0]=this.getPickedGeometry(i[0]),n.length=1;break;case C.ALL:{const e=i.length;for(let t=0;t<e;++t)n[t]=this.getPickedGeometry(i[t]);n.length=e;break}case C.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(y().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(y().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",k.MATCH_ANY],["MATCH_EVERY",k.MATCH_EVERY],["MATCH_ONLY_ONE",k.MATCH_ONLY_ONE]]);return function(){this.matchCriterion=e.get(this._matchCriterion.getValue())??k.MATCH_ANY}})(),set_intersectionType__:(()=>{const e=new Map([["BOUNDS",b.BOUNDS],["GEOMETRY",b.GEOMETRY]]);return function(){this.intersectionType=e.get(this._intersectionType.getValue())??b.BOUNDS}})(),set_sortOrder__:(()=>{const e=new Map([["ANY",C.ANY],["CLOSEST",C.CLOSEST],["ALL",C.ALL],["ALL_SORTED",C.ALL_SORTED]]);return function(){this.sortOrder=e.get(this._sortOrder.getValue())??C.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 y().Inline:case y().Shape:case y().X3DGroupingNode:this.pickTargetNodes.add(t);break;default:continue}}catch{}},traverse(e,t){this.modelMatrices.push(x.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(G()),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)x.push(e);this.modelMatrices.length=0,this.targets.size=0}}),Object.defineProperties(F,d().getStaticProperties("X3DPickSensorNode","Picking",1));const j=F,L=_().add("X3DPickSensorNode",j),V=e.Vector3;var D=t.n(V);const E=e.Box3;var I=t.n(E);const z=e.Line3;var R=t.n(z);function Y(e){L.call(this,e),this.addType(y().LinePickSensor)}Object.assign(Object.setPrototypeOf(Y.prototype,L.prototype),{initialize(){L.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 y().IndexedLineSet:case y().LineSet:this.pickingGeometryNode=e;break;default:continue}}catch{}},process:(()=>{const e=new(I()),t=new(I()),i=new(D()),n=new(D()),s=new(G()),r=new(D()),c=new(D()),a=new(R()),p=new(D()),h=new(D()),d=[],l=[],g=new(D()),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 b.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 b.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).norm()<=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}}}L.prototype.process.call(this)}})()}),Object.defineProperties(Y,{...d().getStaticProperties("LinePickSensor","Picking",1,"children","3.2"),fieldDefinitions:{value:new(p())([new(c())(y().inputOutput,"metadata",new(o().SFNode)),new(c())(y().inputOutput,"description",new(o().SFString)),new(c())(y().inputOutput,"enabled",new(o().SFBool)(!0)),new(c())(y().inputOutput,"objectType",new(o().MFString)("ALL")),new(c())(y().inputOutput,"matchCriterion",new(o().SFString)("MATCH_ANY")),new(c())(y().initializeOnly,"intersectionType",new(o().SFString)("BOUNDS")),new(c())(y().initializeOnly,"sortOrder",new(o().SFString)("CLOSEST")),new(c())(y().inputOutput,"pickingGeometry",new(o().SFNode)),new(c())(y().inputOutput,"pickTarget",new(o().MFNode)),new(c())(y().outputOnly,"isActive",new(o().SFBool)),new(c())(y().outputOnly,"pickedTextureCoordinate",new(o().MFVec3f)),new(c())(y().outputOnly,"pickedNormal",new(o().MFVec3f)),new(c())(y().outputOnly,"pickedPoint",new(o().MFVec3f)),new(c())(y().outputOnly,"pickedGeometry",new(o().MFNode))]),enumerable:!0}});const H=Y,X=_().add("LinePickSensor",H),U=e.X3DGroupingNode;var q=t.n(U);function W(e){this.addType(y().X3DPickableObject),this.objectType=new Set}Object.assign(W.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(W,d().getStaticProperties("X3DPickableObject","Picking",1));const K=W,Q=_().add("X3DPickableObject",K),J=e.TraverseType;var Z=t.n(J);function $(e){q().call(this,e),Q.call(this,e),this.addType(y().PickableGroup),this.pickSensorNodes=new Set}Object.assign(Object.setPrototypeOf($.prototype,q().prototype),Q.prototype,{initialize(){q().prototype.initialize.call(this),Q.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!==Z().PICKING)return void q().prototype.traverse.call(this,e,t);if(!this._pickable.getValue()){if(this.getTransformSensors().size){const e=t.getModelViewMatrix().get();for(const t of this.getTransformSensors())t.collect(e)}return}if(this.getObjectType().has("NONE"))return;const i=this.getBrowser(),n=i.getPickable();if(this.getObjectType().has("ALL"))return n.push(!0),q().prototype.traverse.call(this,e,t),void n.pop();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 k.MATCH_ANY:if(0===t)continue;break;case k.MATCH_EVERY:if(t!==pickSensor.getObjectType().size)continue;break;case k.MATCH_ONLY_ONE:if(1!==t)continue}}s.add(e)}n.push(!0),o.push(s),q().prototype.traverse.call(this,e,t),o.pop(),n.pop(),s.clear()},dispose(){Q.prototype.dispose.call(this),q().prototype.dispose.call(this)}}),Object.defineProperties($,{...d().getStaticProperties("PickableGroup","Picking",1,"children","3.2"),fieldDefinitions:{value:new(p())([new(c())(y().inputOutput,"metadata",new(o().SFNode)),new(c())(y().inputOutput,"description",new(o().SFString)),new(c())(y().inputOutput,"pickable",new(o().SFBool)(!0)),new(c())(y().inputOutput,"objectType",new(o().MFString)("ALL")),new(c())(y().inputOutput,"visible",new(o().SFBool)(!0)),new(c())(y().inputOutput,"bboxDisplay",new(o().SFBool)),new(c())(y().initializeOnly,"bboxSize",new(o().SFVec3f)(-1,-1,-1)),new(c())(y().initializeOnly,"bboxCenter",new(o().SFVec3f)),new(c())(y().inputOnly,"addChildren",new(o().MFNode)),new(c())(y().inputOnly,"removeChildren",new(o().MFNode)),new(c())(y().inputOutput,"children",new(o().MFNode))]),enumerable:!0}});const ee=$,te=_().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(D()),t=new(oe()),i=new(D())(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(G());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=_().add("VolumePicker",pe);function de(e){L.call(this,e),this.addType(y().PointPickSensor),this.picker=new he,this.compoundShapes=[]}Object.assign(Object.setPrototypeOf(de.prototype,L.prototype),{initialize(){L.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()(y().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,s=this.pickingGeometryNode?.getCoord(),o=s?.getSize()??0;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(D()));e.point=c,t.setValue(c.x,c.y,c.z),i.setOrigin(t),e.addChildShape(i,o),n.push(e)}n.length=o}})(),process:(()=>{const e=new(I()),t=new(I()),i=new(D()),n=new(D()),s=new(ce().btTransform),r=new(ce().btVector3),c=new(D()),a=new(oe()),p=new(D())(1),h=new(o().MFVec3f);return function(){if(this.pickingGeometryNode){const o=this.getModelMatrices(),d=this.getTargets();switch(this.getIntersectionType()){case b.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 b.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}}}L.prototype.process.call(this)}})()}),Object.defineProperties(de,{...d().getStaticProperties("PointPickSensor","Picking",1,"children","3.2"),fieldDefinitions:{value:new(p())([new(c())(y().inputOutput,"metadata",new(o().SFNode)),new(c())(y().inputOutput,"description",new(o().SFString)),new(c())(y().inputOutput,"enabled",new(o().SFBool)(!0)),new(c())(y().inputOutput,"objectType",new(o().MFString)("ALL")),new(c())(y().inputOutput,"matchCriterion",new(o().SFString)("MATCH_ANY")),new(c())(y().initializeOnly,"intersectionType",new(o().SFString)("BOUNDS")),new(c())(y().initializeOnly,"sortOrder",new(o().SFString)("CLOSEST")),new(c())(y().inputOutput,"pickingGeometry",new(o().SFNode)),new(c())(y().inputOutput,"pickTarget",new(o().MFNode)),new(c())(y().outputOnly,"isActive",new(o().SFBool)),new(c())(y().outputOnly,"pickedPoint",new(o().MFVec3f)),new(c())(y().outputOnly,"pickedGeometry",new(o().MFNode))]),enumerable:!0}});const le=de,ge=_().add("PointPickSensor",le);function ue(e){L.call(this,e),this.addType(y().PrimitivePickSensor),this.picker=new he}Object.assign(Object.setPrototypeOf(ue.prototype,L.prototype),{initialize(){L.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 y().Box:case y().Cone:case y().Cylinder:case y().Sphere:this.pickingGeometryNode=e;break;default:continue}}catch{}},process:(()=>{const e=new(I()),t=new(I()),i=new(D()),n=new(D());return function(){if(this.pickingGeometryNode){const s=this.getModelMatrices(),o=this.getTargets();switch(this.getIntersectionType()){case b.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 b.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}}}L.prototype.process.call(this)}})()}),Object.defineProperties(ue,{...d().getStaticProperties("PrimitivePickSensor","Picking",2,"children","3.2"),fieldDefinitions:{value:new(p())([new(c())(y().inputOutput,"metadata",new(o().SFNode)),new(c())(y().inputOutput,"description",new(o().SFString)),new(c())(y().inputOutput,"enabled",new(o().SFBool)(!0)),new(c())(y().inputOutput,"objectType",new(o().MFString)("ALL")),new(c())(y().inputOutput,"matchCriterion",new(o().SFString)("MATCH_ANY")),new(c())(y().initializeOnly,"intersectionType",new(o().SFString)("BOUNDS")),new(c())(y().initializeOnly,"sortOrder",new(o().SFString)("CLOSEST")),new(c())(y().inputOutput,"pickingGeometry",new(o().SFNode)),new(c())(y().inputOutput,"pickTarget",new(o().MFNode)),new(c())(y().outputOnly,"isActive",new(o().SFBool)),new(c())(y().outputOnly,"pickedGeometry",new(o().MFNode))]),enumerable:!0}});const ye=ue,me=_().add("PrimitivePickSensor",ye);function _e(e){L.call(this,e),this.addType(y().VolumePickSensor),this.picker=new he}Object.assign(Object.setPrototypeOf(_e.prototype,L.prototype),{initialize(){L.prototype.initialize.call(this),this._pickingGeometry.addInterest("set_pickingGeometry__",this),this.set_pickingGeometry__()},set_pickingGeometry__(){this.pickingGeometryNode=ne()(y().X3DGeometryNode,this._pickingGeometry)},process:(()=>{const e=new(I()),t=new(I()),i=new(D()),n=new(D());return function(){if(this.pickingGeometryNode){const s=this.getModelMatrices(),o=this.getTargets();switch(this.getIntersectionType()){case b.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 b.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}}}L.prototype.process.call(this)}})()}),Object.defineProperties(_e,{...d().getStaticProperties("VolumePickSensor","Picking",3,"children","3.2"),fieldDefinitions:{value:new(p())([new(c())(y().inputOutput,"metadata",new(o().SFNode)),new(c())(y().inputOutput,"description",new(o().SFString)),new(c())(y().inputOutput,"enabled",new(o().SFBool)(!0)),new(c())(y().inputOutput,"objectType",new(o().MFString)("ALL")),new(c())(y().inputOutput,"matchCriterion",new(o().SFString)("MATCH_ANY")),new(c())(y().initializeOnly,"intersectionType",new(o().SFString)("BOUNDS")),new(c())(y().initializeOnly,"sortOrder",new(o().SFString)("CLOSEST")),new(c())(y().inputOutput,"pickingGeometry",new(o().SFNode)),new(c())(y().inputOutput,"pickTarget",new(o().MFNode)),new(c())(y().outputOnly,"isActive",new(o().SFBool)),new(c())(y().outputOnly,"pickedGeometry",new(o().MFNode))]),enumerable:!0}});const we=_e,Se=_().add("VolumePickSensor",we);n().add({name:"Picking",concreteNodes:[X,te,ge,me,Se],abstractNodes:[L,Q]});_().add("PickingComponent",undefined)})();
|
|
1
|
+
/* X_ITE v12.0.1 */
|
|
2
|
+
const e=window[Symbol.for("X_ITE.X3D-12.0.1")];(()=>{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.X3DConstants;var y=t.n(u);const m=e.Namespace;var _=t.n(m);let w=0;const S={MATCH_ANY:w++,MATCH_EVERY:w++,MATCH_ONLY_ONE:w++},k=_().add("MatchCriterion",S);let f=0;const O={BOUNDS:f++,GEOMETRY:f++},b=_().add("IntersectionType",O);let T=0;const N={ANY:T++,CLOSEST:T++,ALL:T++,ALL_SORTED:T++},C=_().add("SortOrder",N),P=e.Matrix4;var M=t.n(P);const G=e.QuickSort;var B=t.n(G);const v=e.ObjectCache;const A=t.n(v)()(M());function F(e,t){return e.distance<t.distance}function j(e){g().call(this,e),this.addType(y().X3DPickSensorNode),this.objectType=new Set,this.intersectionType=b.BOUNDS,this.sortOrder=C.CLOSEST,this.pickTargetNodes=new Set,this.modelMatrices=[],this.targets=[],this.targets.size=0,this.pickedTargets=[],this.pickedTargetsSorter=new(B())(this.pickedTargets,F),this.pickedGeometries=new(o().MFNode)}Object.assign(Object.setPrototypeOf(j.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 C.CLOSEST:this.pickedTargetsSorter.sort(0,i.length);case C.ANY:{n[0]=null;const e=i.length;for(let t=0;t<e&&!(n[0]=this.getPickedGeometry(i[t]));++t);n.length=1;break}case C.ALL_SORTED:this.pickedTargetsSorter.sort(0,i.length);case C.ALL:{const e=i.length;for(let t=0;t<e;++t)n[t]=this.getPickedGeometry(i[t]);n.length=e;break}}return n.assign(n.filter(e=>e)),n},getPickedGeometry(e){const t=e.geometryNode;return t.isPrivate()||t.getExecutionContext().isPrivate()?null:t},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",k.MATCH_ANY],["MATCH_EVERY",k.MATCH_EVERY],["MATCH_ONLY_ONE",k.MATCH_ONLY_ONE]]);return function(){this.matchCriterion=e.get(this._matchCriterion.getValue())??k.MATCH_ANY}})(),set_intersectionType__:(()=>{const e=new Map([["BOUNDS",b.BOUNDS],["GEOMETRY",b.GEOMETRY]]);return function(){this.intersectionType=e.get(this._intersectionType.getValue())??b.BOUNDS}})(),set_sortOrder__:(()=>{const e=new Map([["ANY",C.ANY],["CLOSEST",C.CLOSEST],["ALL",C.ALL],["ALL_SORTED",C.ALL_SORTED]]);return function(){this.sortOrder=e.get(this._sortOrder.getValue())??C.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 y().Inline:case y().Shape:case y().X3DGroupingNode:this.pickTargetNodes.add(t);break;default:continue}}catch{}},traverse(e,t){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 i=this.targets;let n;i.size<i.length?n=i[i.size]:(n={modelMatrix:new(M()),pickedPoint:[],intersections:[]},i.push(n)),++i.size,n.intersected=!1,n.geometryNode=e,n.pickedPoint.length=0,n.intersections.length=0,n.modelMatrix.assign(t)}},process(){for(const e of this.modelMatrices)A.push(e);this.modelMatrices.length=0,this.targets.size=0}}),Object.defineProperties(j,d().getStaticProperties("X3DPickSensorNode","Picking",1));const x=j,L=_().add("X3DPickSensorNode",x),V=e.Vector3;var D=t.n(V);const E=e.Box3;var z=t.n(E);const I=e.Line3;var R=t.n(I);function Y(e){L.call(this,e),this.addType(y().LinePickSensor)}Object.assign(Object.setPrototypeOf(Y.prototype,L.prototype),{initialize(){L.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 y().IndexedLineSet:case y().LineSet:this.pickingGeometryNode=e;break;default:continue}}catch{}},process:(()=>{const e=new(z()),t=new(z()),i=new(D()),n=new(D()),s=new(M()),r=new(D()),c=new(D()),a=new(R()),p=new(D()),h=new(D()),d=[],l=[],g=new(D()),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 b.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;r!==this._isActive.getValue()&&(this._isActive=r),this._pickedGeometry.equals(s)||(this._pickedGeometry=s);break}case b.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).norm()<=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}}}L.prototype.process.call(this)}})()}),Object.defineProperties(Y,{...d().getStaticProperties("LinePickSensor","Picking",1,"children","3.2"),fieldDefinitions:{value:new(p())([new(c())(y().inputOutput,"metadata",new(o().SFNode)),new(c())(y().inputOutput,"description",new(o().SFString)),new(c())(y().inputOutput,"enabled",new(o().SFBool)(!0)),new(c())(y().inputOutput,"objectType",new(o().MFString)("ALL")),new(c())(y().inputOutput,"matchCriterion",new(o().SFString)("MATCH_ANY")),new(c())(y().initializeOnly,"intersectionType",new(o().SFString)("BOUNDS")),new(c())(y().initializeOnly,"sortOrder",new(o().SFString)("CLOSEST")),new(c())(y().inputOutput,"pickingGeometry",new(o().SFNode)),new(c())(y().inputOutput,"pickTarget",new(o().MFNode)),new(c())(y().outputOnly,"isActive",new(o().SFBool)),new(c())(y().outputOnly,"pickedTextureCoordinate",new(o().MFVec3f)),new(c())(y().outputOnly,"pickedNormal",new(o().MFVec3f)),new(c())(y().outputOnly,"pickedPoint",new(o().MFVec3f)),new(c())(y().outputOnly,"pickedGeometry",new(o().MFNode))]),enumerable:!0}});const H=Y,X=_().add("LinePickSensor",H),U=e.X3DGroupingNode;var q=t.n(U);function W(e){this.addType(y().X3DPickableObject),this.objectType=new Set}Object.assign(W.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(W,d().getStaticProperties("X3DPickableObject","Picking",1));const K=W,Q=_().add("X3DPickableObject",K),J=e.TraverseType;var Z=t.n(J);function $(e){q().call(this,e),Q.call(this,e),this.addType(y().PickableGroup),this.pickSensorNodes=new Set}Object.assign(Object.setPrototypeOf($.prototype,q().prototype),Q.prototype,{initialize(){q().prototype.initialize.call(this),Q.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!==Z().PICKING)return void q().prototype.traverse.call(this,e,t);if(!this._pickable.getValue()){if(this.getTransformSensors().size){const e=t.getModelViewMatrix().get();for(const t of this.getTransformSensors())t.collect(e)}return}if(this.getObjectType().has("NONE"))return;const i=this.getBrowser(),n=i.getPickable();if(this.getObjectType().has("ALL"))return n.push(!0),q().prototype.traverse.call(this,e,t),void n.pop();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 k.MATCH_ANY:if(0===t)continue;break;case k.MATCH_EVERY:if(t!==pickSensor.getObjectType().size)continue;break;case k.MATCH_ONLY_ONE:if(1!==t)continue}}s.add(e)}n.push(!0),o.push(s),q().prototype.traverse.call(this,e,t),o.pop(),n.pop(),s.clear()},dispose(){Q.prototype.dispose.call(this),q().prototype.dispose.call(this)}}),Object.defineProperties($,{...d().getStaticProperties("PickableGroup","Picking",1,"children","3.2"),fieldDefinitions:{value:new(p())([new(c())(y().inputOutput,"metadata",new(o().SFNode)),new(c())(y().inputOutput,"description",new(o().SFString)),new(c())(y().inputOutput,"pickable",new(o().SFBool)(!0)),new(c())(y().inputOutput,"objectType",new(o().MFString)("ALL")),new(c())(y().inputOutput,"visible",new(o().SFBool)(!0)),new(c())(y().inputOutput,"bboxDisplay",new(o().SFBool)),new(c())(y().initializeOnly,"bboxSize",new(o().SFVec3f)(-1,-1,-1)),new(c())(y().initializeOnly,"bboxCenter",new(o().SFVec3f)),new(c())(y().inputOnly,"addChildren",new(o().MFNode)),new(c())(y().inputOnly,"removeChildren",new(o().MFNode)),new(c())(y().inputOutput,"children",new(o().MFNode))]),enumerable:!0}});const ee=$,te=_().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(D()),t=new(oe()),i=new(D())(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(M());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=_().add("VolumePicker",pe);function de(e){L.call(this,e),this.addType(y().PointPickSensor),this.picker=new he,this.compoundShapes=[]}Object.assign(Object.setPrototypeOf(de.prototype,L.prototype),{initialize(){L.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()(y().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,s=this.pickingGeometryNode?.getCoord(),o=s?.getSize()??0;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(D()));e.point=c,t.setValue(c.x,c.y,c.z),i.setOrigin(t),e.addChildShape(i,o),n.push(e)}n.length=o}})(),process:(()=>{const e=new(z()),t=new(z()),i=new(D()),n=new(D()),s=new(ce().btTransform),r=new(ce().btVector3),c=new(D()),a=new(oe()),p=new(D())(1),h=new(o().MFVec3f);return function(){if(this.pickingGeometryNode){const o=this.getModelMatrices(),d=this.getTargets();switch(this.getIntersectionType()){case b.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 b.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}}}L.prototype.process.call(this)}})()}),Object.defineProperties(de,{...d().getStaticProperties("PointPickSensor","Picking",1,"children","3.2"),fieldDefinitions:{value:new(p())([new(c())(y().inputOutput,"metadata",new(o().SFNode)),new(c())(y().inputOutput,"description",new(o().SFString)),new(c())(y().inputOutput,"enabled",new(o().SFBool)(!0)),new(c())(y().inputOutput,"objectType",new(o().MFString)("ALL")),new(c())(y().inputOutput,"matchCriterion",new(o().SFString)("MATCH_ANY")),new(c())(y().initializeOnly,"intersectionType",new(o().SFString)("BOUNDS")),new(c())(y().initializeOnly,"sortOrder",new(o().SFString)("CLOSEST")),new(c())(y().inputOutput,"pickingGeometry",new(o().SFNode)),new(c())(y().inputOutput,"pickTarget",new(o().MFNode)),new(c())(y().outputOnly,"isActive",new(o().SFBool)),new(c())(y().outputOnly,"pickedPoint",new(o().MFVec3f)),new(c())(y().outputOnly,"pickedGeometry",new(o().MFNode))]),enumerable:!0}});const le=de,ge=_().add("PointPickSensor",le);function ue(e){L.call(this,e),this.addType(y().PrimitivePickSensor),this.picker=new he}Object.assign(Object.setPrototypeOf(ue.prototype,L.prototype),{initialize(){L.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 y().Box:case y().Cone:case y().Cylinder:case y().Sphere:this.pickingGeometryNode=e;break;default:continue}}catch{}},process:(()=>{const e=new(z()),t=new(z()),i=new(D()),n=new(D());return function(){if(this.pickingGeometryNode){const s=this.getModelMatrices(),o=this.getTargets();switch(this.getIntersectionType()){case b.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 b.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}}}L.prototype.process.call(this)}})()}),Object.defineProperties(ue,{...d().getStaticProperties("PrimitivePickSensor","Picking",2,"children","3.2"),fieldDefinitions:{value:new(p())([new(c())(y().inputOutput,"metadata",new(o().SFNode)),new(c())(y().inputOutput,"description",new(o().SFString)),new(c())(y().inputOutput,"enabled",new(o().SFBool)(!0)),new(c())(y().inputOutput,"objectType",new(o().MFString)("ALL")),new(c())(y().inputOutput,"matchCriterion",new(o().SFString)("MATCH_ANY")),new(c())(y().initializeOnly,"intersectionType",new(o().SFString)("BOUNDS")),new(c())(y().initializeOnly,"sortOrder",new(o().SFString)("CLOSEST")),new(c())(y().inputOutput,"pickingGeometry",new(o().SFNode)),new(c())(y().inputOutput,"pickTarget",new(o().MFNode)),new(c())(y().outputOnly,"isActive",new(o().SFBool)),new(c())(y().outputOnly,"pickedGeometry",new(o().MFNode))]),enumerable:!0}});const ye=ue,me=_().add("PrimitivePickSensor",ye);function _e(e){L.call(this,e),this.addType(y().VolumePickSensor),this.picker=new he}Object.assign(Object.setPrototypeOf(_e.prototype,L.prototype),{initialize(){L.prototype.initialize.call(this),this._pickingGeometry.addInterest("set_pickingGeometry__",this),this.set_pickingGeometry__()},set_pickingGeometry__(){this.pickingGeometryNode=ne()(y().X3DGeometryNode,this._pickingGeometry)},process:(()=>{const e=new(z()),t=new(z()),i=new(D()),n=new(D());return function(){if(this.pickingGeometryNode){const s=this.getModelMatrices(),o=this.getTargets();switch(this.getIntersectionType()){case b.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 b.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}}}L.prototype.process.call(this)}})()}),Object.defineProperties(_e,{...d().getStaticProperties("VolumePickSensor","Picking",3,"children","3.2"),fieldDefinitions:{value:new(p())([new(c())(y().inputOutput,"metadata",new(o().SFNode)),new(c())(y().inputOutput,"description",new(o().SFString)),new(c())(y().inputOutput,"enabled",new(o().SFBool)(!0)),new(c())(y().inputOutput,"objectType",new(o().MFString)("ALL")),new(c())(y().inputOutput,"matchCriterion",new(o().SFString)("MATCH_ANY")),new(c())(y().initializeOnly,"intersectionType",new(o().SFString)("BOUNDS")),new(c())(y().initializeOnly,"sortOrder",new(o().SFString)("CLOSEST")),new(c())(y().inputOutput,"pickingGeometry",new(o().SFNode)),new(c())(y().inputOutput,"pickTarget",new(o().MFNode)),new(c())(y().outputOnly,"isActive",new(o().SFBool)),new(c())(y().outputOnly,"pickedGeometry",new(o().MFNode))]),enumerable:!0}});const we=_e,Se=_().add("VolumePickSensor",we);n().add({name:"Picking",concreteNodes:[X,te,ge,me,Se],abstractNodes:[L,Q]});_().add("PickingComponent",undefined)})();
|