@rr0/ufoathome 0.195.0 → 0.196.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.
- package/dist-embed-scene/rr0-scene.mjs +4 -4
- package/dist-embed-sighting/CaseMessages_en-G5J5w1_d.js +1 -0
- package/dist-embed-sighting/CaseMessages_es-D7Rp1_1K.js +1 -0
- package/dist-embed-sighting/CaseMessages_fr-B8eZ1NIJ.js +1 -0
- package/dist-embed-sighting/CaseMessages_it-Cu02nVVo.js +1 -0
- package/dist-embed-sighting/{CaseReportExport-BeKawC8S.js → CaseReportExport-CdRgJb5M.js} +1 -1
- package/dist-embed-sighting/rr0-sighting.mjs +343 -324
- package/dist-embed-sighting-editor/{AdsbLolArchiveProvider--KjPxNqw.js → AdsbLolArchiveProvider-BqEnqRP0.js} +1 -1
- package/dist-embed-sighting-editor/{BallesterGuaspAssessor-BTmq0r-G.js → BallesterGuaspAssessor-BL_yzudf.js} +1 -1
- package/dist-embed-sighting-editor/{BeamEditor-CI8-9VOc.js → BeamEditor-DA29mfqm.js} +1 -1
- package/dist-embed-sighting-editor/{BeamSystem-odg570aR.js → BeamSystem-DYohqXlF.js} +1 -1
- package/dist-embed-sighting-editor/{BirdEditor-DV3ndYff.js → BirdEditor-CAoRqqRV.js} +1 -1
- package/dist-embed-sighting-editor/{BirdFlock-O7K_g8y7.js → BirdFlock-TI63ZAKZ.js} +1 -1
- package/dist-embed-sighting-editor/{CaseEditorMessages_en-CoFukfwf.js → CaseEditorMessages_en-BPdxQsTX.js} +1 -1
- package/dist-embed-sighting-editor/{CaseEditorMessages_es-DZptbzB7.js → CaseEditorMessages_es-B48BAICC.js} +1 -1
- package/dist-embed-sighting-editor/{CaseEditorMessages_fr-DXl2GNmR.js → CaseEditorMessages_fr-DTWi9mIY.js} +1 -1
- package/dist-embed-sighting-editor/{CaseEditorMessages_it-ss10VmRM.js → CaseEditorMessages_it-CMLxgu8y.js} +1 -1
- package/dist-embed-sighting-editor/CaseElement-AXaERD8m.js +112 -0
- package/dist-embed-sighting-editor/CaseMessages_en-G5J5w1_d.js +1 -0
- package/dist-embed-sighting-editor/CaseMessages_es-D7Rp1_1K.js +1 -0
- package/dist-embed-sighting-editor/CaseMessages_fr-B8eZ1NIJ.js +1 -0
- package/dist-embed-sighting-editor/CaseMessages_it-Cu02nVVo.js +1 -0
- package/dist-embed-sighting-editor/{CaseReportExport-DisXbZ3b.js → CaseReportExport-CDZp6xGk.js} +2 -2
- package/dist-embed-sighting-editor/{ContrailSystem-BddkU7fj.js → ContrailSystem-B0cQbaHc.js} +1 -1
- package/dist-embed-sighting-editor/{ControlPasses-CNlCUT1L.js → ControlPasses-BvS8haeS.js} +1 -1
- package/dist-embed-sighting-editor/{CoverageAssessor-DjY8iKp5.js → CoverageAssessor-DD1kSvun.js} +1 -1
- package/dist-embed-sighting-editor/{DroneEditor-DRsM2ash.js → DroneEditor-BRB2-dAw.js} +1 -1
- package/dist-embed-sighting-editor/{DroneFlight-Fr4Vgso3.js → DroneFlight-BpnBgJ9K.js} +1 -1
- package/dist-embed-sighting-editor/{Flightradar24Provider-BxeduRam.js → Flightradar24Provider-D5OdIL0L.js} +1 -1
- package/dist-embed-sighting-editor/{GLTFLoader-C6nlGTTi.js → GLTFLoader-DuqJVU4y.js} +1 -1
- package/dist-embed-sighting-editor/{HeadlightSystem-DI5wHYZu.js → HeadlightSystem-BejdfHqe.js} +1 -1
- package/dist-embed-sighting-editor/{HynekAssessor-DlXalbph.js → HynekAssessor-CwzpS7YP.js} +1 -1
- package/dist-embed-sighting-editor/{LanternEditor-M887ltwe.js → LanternEditor-BnXAwLuQ.js} +1 -1
- package/dist-embed-sighting-editor/{LaserBeam-Drpkr84G.js → LaserBeam-tqM2fwHf.js} +1 -1
- package/dist-embed-sighting-editor/{LaunchEditor-BjAk4XZR.js → LaunchEditor-vwecAGwH.js} +1 -1
- package/dist-embed-sighting-editor/{LaunchPlume-CrzPcqw7.js → LaunchPlume-DWyU0YyJ.js} +1 -1
- package/dist-embed-sighting-editor/{LaunchSimulation-C1ZWpKZT.js → LaunchSimulation-C_OJQoKC.js} +1 -1
- package/dist-embed-sighting-editor/{ModelSource-Bko_3OJt.js → ModelSource-D1Wt6VYS.js} +1 -1
- package/dist-embed-sighting-editor/{ModelThumbnails-DSshyLu2.js → ModelThumbnails-C_8KCF7H.js} +1 -1
- package/dist-embed-sighting-editor/{ModelViewer-_yhAYvNy.js → ModelViewer-Cy-6IZBY.js} +1 -1
- package/dist-embed-sighting-editor/{ModuleConformance-B6iFVb8X.js → ModuleConformance-DYi4XZdB.js} +2 -2
- package/dist-embed-sighting-editor/{ModuleSession-jKFl1FMo.js → ModuleSession-BDbaoiCf.js} +2 -2
- package/dist-embed-sighting-editor/ModuleThree-DRf9SEr_.js +1 -0
- package/dist-embed-sighting-editor/{ModulesPanelElement-VPRCdjmv.js → ModulesPanelElement-hDjGLhRa.js} +3 -3
- package/dist-embed-sighting-editor/{NearestApproach-O8k2n_qL.js → NearestApproach-D6tQo7dk.js} +1 -1
- package/dist-embed-sighting-editor/{PoherAssessor-sTJEnlmb.js → PoherAssessor-BTYpHucH.js} +1 -1
- package/dist-embed-sighting-editor/{RailwaySystem-BZqNSSFA.js → RailwaySystem-D_8D64Bu.js} +1 -1
- package/dist-embed-sighting-editor/{ReentryEditor-DfDGpL5C.js → ReentryEditor-D7HxkvKP.js} +2 -2
- package/dist-embed-sighting-editor/{ReentrySimulation-BuUK0niI.js → ReentrySimulation-Bom073AV.js} +1 -1
- package/dist-embed-sighting-editor/{ReferenceSystem-DvcQp167.js → ReferenceSystem-D_eueNAb.js} +1 -1
- package/dist-embed-sighting-editor/{SightingElement-Bdkf99VT.js → SightingElement-DukKlaH1.js} +4 -4
- package/dist-embed-sighting-editor/{SkyLantern-B7UlFgmB.js → SkyLantern-BDpxvmY3.js} +1 -1
- package/dist-embed-sighting-editor/{TraceSystem-vZF4B5EC.js → TraceSystem-B1mmypS3.js} +2 -2
- package/dist-embed-sighting-editor/{WaterSystem-DSWmZbiL.js → WaterSystem-mZ-f2CcD.js} +2 -2
- package/dist-embed-sighting-editor/rr0-sighting-editor.mjs +370 -359
- package/dist-embed-sighting-editor/{trafficRuntime-C5BXL-G6.js → trafficRuntime-CvK_m6bC.js} +1 -1
- package/dist-embed-ufoathome/{AdsbLolArchiveProvider-veDw9Mxo.js → AdsbLolArchiveProvider-BAZqWk1I.js} +1 -1
- package/dist-embed-ufoathome/{BallesterGuaspAssessor-BVygSN0R.js → BallesterGuaspAssessor-D5DnaJGn.js} +1 -1
- package/dist-embed-ufoathome/{BeamEditor-eDeeNBE9.js → BeamEditor-DmuKTRqU.js} +1 -1
- package/dist-embed-ufoathome/{BeamSystem-B5u4ithz.js → BeamSystem-KHzcEosy.js} +1 -1
- package/dist-embed-ufoathome/{BodyEditor-23Dua2K5.js → BodyEditor-Blkm_Xmd.js} +1 -1
- package/dist-embed-ufoathome/{CaseEditorElement-DYMt7oB4.js → CaseEditorElement-BTZu9wey.js} +33 -29
- package/dist-embed-ufoathome/{CaseEditorMessages_en-CoFukfwf.js → CaseEditorMessages_en-BPdxQsTX.js} +1 -1
- package/dist-embed-ufoathome/{CaseEditorMessages_es-DZptbzB7.js → CaseEditorMessages_es-B48BAICC.js} +1 -1
- package/dist-embed-ufoathome/{CaseEditorMessages_fr-DXl2GNmR.js → CaseEditorMessages_fr-DTWi9mIY.js} +1 -1
- package/dist-embed-ufoathome/{CaseEditorMessages_it-ss10VmRM.js → CaseEditorMessages_it-CMLxgu8y.js} +1 -1
- package/dist-embed-ufoathome/CaseElement-Cr3vTWdf.js +112 -0
- package/dist-embed-ufoathome/CaseMessages_en-G5J5w1_d.js +1 -0
- package/dist-embed-ufoathome/CaseMessages_es-D7Rp1_1K.js +1 -0
- package/dist-embed-ufoathome/CaseMessages_fr-B8eZ1NIJ.js +1 -0
- package/dist-embed-ufoathome/CaseMessages_it-Cu02nVVo.js +1 -0
- package/dist-embed-ufoathome/{CaseReportExport-Cgs2Y0v3.js → CaseReportExport-CyuSf3U_.js} +3 -3
- package/dist-embed-ufoathome/{CaseTimeline-BwCuVg5N.js → ColumnResize-DifCqMt1.js} +14 -7
- package/dist-embed-ufoathome/{ContrailSystem-CtQPQFyc.js → ContrailSystem-DqZ8PoEd.js} +1 -1
- package/dist-embed-ufoathome/{ControlPasses-B_uf1Wmh.js → ControlPasses-BtU_MVQU.js} +1 -1
- package/dist-embed-ufoathome/{CoverageAssessor-JQCFe16i.js → CoverageAssessor-DkVligEj.js} +1 -1
- package/dist-embed-ufoathome/{Flightradar24Provider-BR8_7wmx.js → Flightradar24Provider-GYjtvwah.js} +1 -1
- package/dist-embed-ufoathome/{GLTFLoader-DrBMau2Y.js → GLTFLoader-DzEwUqtj.js} +1 -1
- package/dist-embed-ufoathome/{GeoJsonExport-wUgEVyel.js → GeoJsonExport-B1i0YjqN.js} +1 -1
- package/dist-embed-ufoathome/{GeographicFigures-CpbFopao.js → GeographicFigures-D5ZCRN0K.js} +1 -1
- package/dist-embed-ufoathome/{HeadlightSystem-YXD1Zdpn.js → HeadlightSystem-x2xYh-cs.js} +1 -1
- package/dist-embed-ufoathome/{HynekAssessor-BV2nWUx8.js → HynekAssessor-DOUPfuRV.js} +1 -1
- package/dist-embed-ufoathome/{InterviewEditorElement-DiT6FZnj.js → InterviewEditorElement-Dt-KQiv0.js} +1 -1
- package/dist-embed-ufoathome/{InterviewElement-DFcCnZtF.js → InterviewElement-BPsBLXlf.js} +1 -1
- package/dist-embed-ufoathome/{KmlExport-wWr2S8H-.js → KmlExport-JEXMAssj.js} +1 -1
- package/dist-embed-ufoathome/{LaserBeam-CejB0H9v.js → LaserBeam-Cy9lfcCE.js} +1 -1
- package/dist-embed-ufoathome/{LaunchEditor-ConcMLIe.js → LaunchEditor-zWZhMyLf.js} +1 -1
- package/dist-embed-ufoathome/{LaunchPlume-BQEYjeSf.js → LaunchPlume-CcUQvACB.js} +1 -1
- package/dist-embed-ufoathome/{LaunchSimulation-BIiU6D8P.js → LaunchSimulation-DRH0rTE7.js} +1 -1
- package/dist-embed-ufoathome/{ModelSource-B93j0IA6.js → ModelSource-Dljnl-RW.js} +1 -1
- package/dist-embed-ufoathome/{ModelThumbnails-3U8M50_n.js → ModelThumbnails-DeaPuKSb.js} +1 -1
- package/dist-embed-ufoathome/{ModelViewer-Cnxj0Oi9.js → ModelViewer-B-ZLBTmq.js} +1 -1
- package/dist-embed-ufoathome/{ModuleConformance-BlrRirPF.js → ModuleConformance-Bd8yK7Ic.js} +2 -2
- package/dist-embed-ufoathome/{ModuleSession-Cdilmebx.js → ModuleSession-DXdpVejH.js} +3 -3
- package/dist-embed-ufoathome/{ModuleThree-Dpv5uvYp.js → ModuleThree-BL59t48W.js} +1 -1
- package/dist-embed-ufoathome/{ModulesPanelElement-CwgqBVUI.js → ModulesPanelElement-6KUAMJcl.js} +3 -3
- package/dist-embed-ufoathome/{NearestApproach-CQ2w9ctm.js → NearestApproach-wbFbwOAh.js} +1 -1
- package/dist-embed-ufoathome/{PictureRegistration-DOSDjiOf.js → PictureRegistration-CfSYGbeh.js} +1 -1
- package/dist-embed-ufoathome/{PoherAssessor-C8g5YvJi.js → PoherAssessor-CVIeQpd7.js} +1 -1
- package/dist-embed-ufoathome/{RailwaySystem-D8B965iv.js → RailwaySystem-DTXetaSg.js} +1 -1
- package/dist-embed-ufoathome/{ReentryEditor-CEbb0oLd.js → ReentryEditor-7Fxkxq-Q.js} +1 -1
- package/dist-embed-ufoathome/{ReentrySimulation-D_JX7wWS.js → ReentrySimulation-T3H0mJI3.js} +1 -1
- package/dist-embed-ufoathome/{ReferenceSystem-xm8mzWiT.js → ReferenceSystem-CJaq2UzO.js} +1 -1
- package/dist-embed-ufoathome/{ShareDialogElement-BBMLOqSW.js → ShareDialogElement-ClhewPap.js} +11 -11
- package/dist-embed-ufoathome/{SightingElement-e9ZcWa58.js → SightingElement-BtHQ5LDE.js} +4 -4
- package/dist-embed-ufoathome/{TraceSystem-BL6qfrHF.js → TraceSystem-B42kzZXG.js} +1 -1
- package/dist-embed-ufoathome/{VideoButton-DA48Qz2E.js → VideoButton-DhanY6AD.js} +1 -1
- package/dist-embed-ufoathome/{WaterSystem-BLy0L9qC.js → WaterSystem-DyJivqCq.js} +1 -1
- package/dist-embed-ufoathome/rr0-ufoathome.mjs +3 -3
- package/dist-embed-ufoathome/{surroundingsSources-Dlyt6moH.js → surroundingsSources-DEMGw8rm.js} +1 -1
- package/dist-embed-ufoathome/{trafficRuntime-B_bwWY8d.js → trafficRuntime-BJFdLEcT.js} +1 -1
- package/package.json +1 -1
- package/dist-embed-sighting/CaseMessages_en-BbbbikHH.js +0 -1
- package/dist-embed-sighting/CaseMessages_es-AHBxl8Ka.js +0 -1
- package/dist-embed-sighting/CaseMessages_fr-CD33PQCH.js +0 -1
- package/dist-embed-sighting/CaseMessages_it-DyMACGSU.js +0 -1
- package/dist-embed-sighting-editor/CaseElement-CVi_yfyW.js +0 -100
- package/dist-embed-sighting-editor/CaseMessages_en-BbbbikHH.js +0 -1
- package/dist-embed-sighting-editor/CaseMessages_es-AHBxl8Ka.js +0 -1
- package/dist-embed-sighting-editor/CaseMessages_fr-CD33PQCH.js +0 -1
- package/dist-embed-sighting-editor/CaseMessages_it-DyMACGSU.js +0 -1
- package/dist-embed-sighting-editor/ModuleThree-Fvr5G-Yh.js +0 -1
- package/dist-embed-ufoathome/CaseElement-C6KVIESP.js +0 -100
- package/dist-embed-ufoathome/CaseMessages_en-BbbbikHH.js +0 -1
- package/dist-embed-ufoathome/CaseMessages_es-AHBxl8Ka.js +0 -1
- package/dist-embed-ufoathome/CaseMessages_fr-CD33PQCH.js +0 -1
- package/dist-embed-ufoathome/CaseMessages_it-DyMACGSU.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{aV as A,bF as F,bs as L,G as y,b4 as I,V as M,bG as N,bH as E,bI as z,m as D,aY as U,bJ as C,bK as P,bL as T,bM as B,bb as V,bN as O}from"./rr0-sighting-editor.mjs";class r{static LIFT_M=.05;static RENDER_ORDER=1.04;static LEVEL_QUANTILE=.2;static BODY_ALBEDO=[.035,.045,.04];static IOR=1.33;static ROUGHNESS=.08;static MAX_SAMPLES=48;static REFLECTION_SCALE=.5;group=new A;material=new F({color:new L(...r.BODY_ALBEDO),roughness:r.ROUGHNESS,metalness:0,ior:r.IOR,polygonOffset:!0,polygonOffsetFactor:-2,polygonOffsetUnits:-2});levels=new Map;reflectionTarget;reflectionUniforms={uWaterReflection:{value:null},uWaterReflectionMatrix:{value:new y},uWaterReflectionOn:{value:0}};mirrorCamera=new I;eye=new M;ahead=new M;up=new M;plane=new N;clip=new E;q=new E;size=new z;bias=new y().set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);constructor(){this.group.name="water",this.material.onBeforeCompile=t=>{Object.assign(t.uniforms,this.reflectionUniforms),t.vertexShader=t.vertexShader.replace("#include <common>",`#include <common>
|
|
2
2
|
varying vec3 vWaterWorld;`).replace("#include <project_vertex>",`#include <project_vertex>
|
|
3
3
|
vWaterWorld = (modelMatrix * vec4(transformed, 1.0)).xyz;`),t.fragmentShader=t.fragmentShader.replace("#include <common>",`#include <common>
|
|
4
4
|
varying vec3 vWaterWorld;
|
|
@@ -16,4 +16,4 @@ vWaterWorld = (modelMatrix * vec4(transformed, 1.0)).xyz;`),t.fragmentShader=t.f
|
|
|
16
16
|
outgoingLight = outgoingLight * (1.0 - mirrored.a * fresnel) + mirrored.rgb * fresnel;
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
#include <opaque_fragment>`)}}set(t,o,e,f,i,a){this.clear();for(const l of t){const h=l.rings.map(n=>r.clip(n.map(u=>D(u.lat,u.lng,o,e)),i)),c=h[0];if(!c||c.length<3)continue;const d=h.slice(1).filter(n=>n.length>=3),p=r.level(c,d,f,a);if(p===void 0)continue;const s=r.geometry(c,d,p+r.LIFT_M);if(!s)continue;const g=new
|
|
19
|
+
#include <opaque_fragment>`)}}set(t,o,e,f,i,a){this.clear();for(const l of t){const h=l.rings.map(n=>r.clip(n.map(u=>D(u.lat,u.lng,o,e)),i)),c=h[0];if(!c||c.length<3)continue;const d=h.slice(1).filter(n=>n.length>=3),p=r.level(c,d,f,a);if(p===void 0)continue;const s=r.geometry(c,d,p+r.LIFT_M);if(!s)continue;const g=new U(s,this.material);g.name=`water ${l.id}`,g.renderOrder=r.RENDER_ORDER,g.receiveShadow=!0,this.group.add(g),this.levels.set(g,{y:p+r.LIFT_M,areaM2:Math.abs(C.area(c.map(n=>new z(n.x,n.z))))})}}get count(){return this.group.children.length}clear(){for(const t of[...this.group.children])t.geometry.dispose(),this.group.remove(t);this.levels.clear()}dispose(){this.clear(),this.material.dispose(),this.reflectionTarget?.dispose()}reflectBodies(t,o,e,f,i,a){const l=this.reflectionUniforms;l.uWaterReflectionOn.value=0;let h;for(const[v,R]of this.levels)v.visible&&(!h||R.areaM2>h.areaM2)&&(h=R);if(!i||!h)return;this.group.updateWorldMatrix(!0,!1);const c=h.y+this.group.position.y;if(e.updateMatrixWorld(),this.eye.setFromMatrixPosition(e.matrixWorld),this.eye.y<=c)return;t.getDrawingBufferSize(this.size);const d=Math.max(16,Math.round(this.size.x*r.REFLECTION_SCALE)),p=Math.max(16,Math.round(this.size.y*r.REFLECTION_SCALE));(!this.reflectionTarget||this.reflectionTarget.width!==d||this.reflectionTarget.height!==p)&&(this.reflectionTarget?.dispose(),this.reflectionTarget=new P(d,p,{type:B,minFilter:T,magFilter:T}));const s=this.mirrorCamera,g=v=>v.setY(2*c-v.y);s.position.copy(g(this.eye.clone())),e.getWorldDirection(this.ahead);const n=g(this.eye.clone().add(this.ahead));this.up.set(0,1,0).applyQuaternion(e.quaternion),s.up.set(this.up.x,-this.up.y,this.up.z),s.lookAt(n),s.fov=a??e.fov,s.aspect=e.aspect,s.near=e.near,s.far=e.far,s.updateProjectionMatrix(),s.updateMatrixWorld(),this.clipAtLevel(s,c),l.uWaterReflectionMatrix.value.copy(this.bias).multiply(s.projectionMatrix).multiply(s.matrixWorldInverse),o.traverseVisible(v=>{v.isLight&&v.layers.enable(f)});const u=t.getRenderTarget(),m=t.autoClear,x=t.shadowMap.autoUpdate,w=o.background,b=t.getClearAlpha();t.getClearColor(r.clearColor),o.background=null,t.shadowMap.autoUpdate=!1,t.setRenderTarget(this.reflectionTarget),t.setClearColor(0,0),t.autoClear=!0,s.layers.set(f),t.render(o,s),t.setRenderTarget(u),t.setClearColor(r.clearColor,b),t.autoClear=m,t.shadowMap.autoUpdate=x,o.background=w,l.uWaterReflection.value=this.reflectionTarget.texture,l.uWaterReflectionOn.value=1}static clearColor=new L;clipAtLevel(t,o){this.plane.setFromNormalAndCoplanarPoint(new M(0,1,0),new M(0,o,0)).applyMatrix4(t.matrixWorldInverse),this.clip.set(this.plane.normal.x,this.plane.normal.y,this.plane.normal.z,this.plane.constant);const e=t.projectionMatrix.elements;this.q.set((Math.sign(this.clip.x)+e[8])/e[0],(Math.sign(this.clip.y)+e[9])/e[5],-1,(1+e[10])/e[14]),this.clip.multiplyScalar(2/this.clip.dot(this.q)),e[2]=this.clip.x,e[6]=this.clip.y,e[10]=this.clip.z+1,e[14]=this.clip.w}static level(t,o,e,f){const i=t.map(n=>n.x),a=t.map(n=>n.z),[l,h,c,d]=[Math.min(...i),Math.max(...i),Math.min(...a),Math.max(...a)],p=Math.max(f,(h-l)/r.MAX_SAMPLES,(d-c)/r.MAX_SAMPLES,.5),s=[];for(let n=c+p/2;n<d;n+=p)for(let u=l+p/2;u<h;u+=p){const m={x:u,z:n};if(!r.contains(t,m)||o.some(w=>r.contains(w,m)))continue;const x=e(u,n);Number.isFinite(x)&&s.push(x)}if(s.length===0)for(const n of t)s.push(e(n.x,n.z));const g=s.filter(Number.isFinite).sort((n,u)=>n-u);if(g.length!==0)return g[Math.floor((g.length-1)*r.LEVEL_QUANTILE)]}static clip(t,o){let e=t;const f=[{inside:i=>i.x>=-o,cross:(i,a)=>r.atX(i,a,-o)},{inside:i=>i.x<=o,cross:(i,a)=>r.atX(i,a,o)},{inside:i=>i.z>=-o,cross:(i,a)=>r.atZ(i,a,-o)},{inside:i=>i.z<=o,cross:(i,a)=>r.atZ(i,a,o)}];for(const i of f){const a=[];for(let l=0;l<e.length;l++){const h=e[l],c=e[(l+e.length-1)%e.length];i.inside(h)?(i.inside(c)||a.push(i.cross(c,h)),a.push(h)):i.inside(c)&&a.push(i.cross(c,h))}if(e=a,e.length===0)break}return e}static atX(t,o,e){return{x:e,z:t.z+(o.z-t.z)*(e-t.x)/(o.x-t.x)}}static atZ(t,o,e){return{x:t.x+(o.x-t.x)*(e-t.z)/(o.z-t.z),z:e}}static contains(t,o){let e=!1;for(let f=0,i=t.length-1;f<t.length;i=f++){const a=t[f],l=t[i];a.z>o.z!=l.z>o.z&&o.x<(l.x-a.x)*(o.z-a.z)/(l.z-a.z)+a.x&&(e=!e)}return e}static geometry(t,o,e){const f=s=>new z(s.x,s.z),i=t.map(f),a=o.map(s=>s.map(f)),l=C.triangulateShape(i,a);if(l.length===0)return;const h=[...i,...a.flat()],c=[];for(const[s,g,n]of l){const[u,m,x]=[h[s],h[g],h[n]],w=(m.y-u.y)*(x.x-u.x)-(m.x-u.x)*(x.y-u.y)>0;for(const b of w?[u,m,x]:[u,x,m])c.push(b.x,e,b.y)}const d=new V;d.setAttribute("position",new O(c,3));const p=new Float32Array(c.length);for(let s=1;s<p.length;s+=3)p[s]=1;return d.setAttribute("normal",new O(p,3)),d.computeBoundingSphere(),d}}export{r as WaterSystem};
|