@rr0/ufoathome 0.185.3 → 0.187.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/{AdsbLolArchiveProvider-CzTJVwX_.js → AdsbLolArchiveProvider-DdUpO-EA.js} +1 -1
- package/dist-embed-scene/{BeamEditor-B1rrWZ8t.js → BeamEditor-RO5pPyvd.js} +1 -1
- package/dist-embed-scene/BeamSystem-Ab_wCPf_.js +1 -0
- package/dist-embed-scene/BirdKindMessages_en-c_-L7frF.js +1 -0
- package/dist-embed-scene/BirdKindMessages_es-8Zo2t0o4.js +1 -0
- package/dist-embed-scene/BirdKindMessages_fr-C1TuqqEj.js +1 -0
- package/dist-embed-scene/BirdKindMessages_it-DQZcrCkf.js +1 -0
- package/dist-embed-scene/ContrailSystem-BYqjhyyF.js +1 -0
- package/dist-embed-scene/ControlPasses-BZIhjZfW.js +29 -0
- package/dist-embed-scene/FlareKindMessages_en-j3CY_TxX.js +1 -0
- package/dist-embed-scene/FlareKindMessages_es-CZgrFIOO.js +1 -0
- package/dist-embed-scene/FlareKindMessages_fr-B2MezoN2.js +1 -0
- package/dist-embed-scene/FlareKindMessages_it-CmZmb3RP.js +1 -0
- package/dist-embed-scene/{Flightradar24Provider-ae0_oe2g.js → Flightradar24Provider-DnJbUJ3f.js} +1 -1
- package/dist-embed-scene/GLTFLoader-BmUyASZK.js +1 -0
- package/dist-embed-scene/HeadlightSystem-DOQSyusn.js +34 -0
- package/dist-embed-scene/{LanternEditor-DbaHa2ey.js → LanternEditor-B6YtPdnz.js} +1 -1
- package/dist-embed-scene/LanternKindMessages_en-CQXdJ-k6.js +1 -0
- package/dist-embed-scene/LanternKindMessages_es-BOO6kPjs.js +1 -0
- package/dist-embed-scene/LanternKindMessages_fr-D7tQa_tQ.js +1 -0
- package/dist-embed-scene/LanternKindMessages_it-B8J-29Mj.js +1 -0
- package/dist-embed-scene/{LaserBeam-DW1f0LPn.js → LaserBeam-BS0xtrAx.js} +1 -1
- package/dist-embed-scene/{LaunchEditor-M8G5W83U.js → LaunchEditor-C6-Ovt8V.js} +1 -1
- package/dist-embed-scene/{LaunchPlume-BtEO63Vx.js → LaunchPlume-GdjoMQQa.js} +1 -1
- package/dist-embed-scene/{LaunchSimulation-xgRnC8OK.js → LaunchSimulation-C_x89oL_.js} +1 -1
- package/dist-embed-scene/{ModuleSession-BGUJHOk9.js → ModuleSession-CwJVkcpn.js} +2 -2
- package/dist-embed-scene/ModuleThree-BHjFJ_bC.js +1 -0
- package/dist-embed-scene/{ParameterForm-DMplRkcQ.js → ParameterForm-BEITBqB0.js} +1 -1
- package/dist-embed-scene/{RailwaySystem-C3Y0a9aT.js → RailwaySystem-8h9OGJkr.js} +1 -1
- package/dist-embed-scene/{ReentryEditor-FFxrv4q7.js → ReentryEditor-BAC0cNg_.js} +1 -1
- package/dist-embed-scene/{ReentrySimulation-xFQ_R53U.js → ReentrySimulation-DCNhQGDE.js} +1 -1
- package/dist-embed-scene/ReferenceSystem-BTDpVH4u.js +1 -0
- package/dist-embed-scene/{RoadMarkings-C3oJCHLk.js → RoadMarkings-DAs6evab.js} +1 -1
- package/dist-embed-scene/{SceneNames_en-CIzANCLW.js → SceneNames_en-BLm2h3zy.js} +1 -1
- package/dist-embed-scene/{SceneNames_es-DntR6o9V.js → SceneNames_es-DrJ24RvP.js} +1 -1
- package/dist-embed-scene/{SceneNames_fr-7wmERMPd.js → SceneNames_fr-CddH0oWD.js} +1 -1
- package/dist-embed-scene/{SceneNames_it-Bxtenoxp.js → SceneNames_it-DL3AbXlk.js} +1 -1
- package/dist-embed-scene/{TimelineTracks-CZBILU3f.js → TimelineTracks-B73gWzRB.js} +1 -1
- package/dist-embed-scene/{TraceSystem-BD6YpW6g.js → TraceSystem-vEBDgerB.js} +2 -2
- package/dist-embed-scene/{UfoMessages_en-AS8tBKJW.js → UfoMessages_en-BzK4iS9N.js} +1 -1
- package/dist-embed-scene/WaterSystem-QZGlpcQ7.js +19 -0
- package/dist-embed-scene/rr0-scene.mjs +271 -265
- package/dist-embed-scene/{sightingSchema-B8Xs45w9.js → sightingSchema-Dz2hCtcS.js} +1 -1
- package/dist-embed-sighting/{AdsbLolArchiveProvider-D9EKDsic.js → AdsbLolArchiveProvider-BYOz5Wdl.js} +1 -1
- package/dist-embed-sighting/{BeamEditor-Cod7HUNj.js → BeamEditor-mDSavUYe.js} +2 -2
- package/dist-embed-sighting/BeamSystem-5WJWP1Ad.js +1 -0
- package/dist-embed-sighting/BirdKindMessages_en-c_-L7frF.js +1 -0
- package/dist-embed-sighting/BirdKindMessages_es-8Zo2t0o4.js +1 -0
- package/dist-embed-sighting/BirdKindMessages_fr-C1TuqqEj.js +1 -0
- package/dist-embed-sighting/BirdKindMessages_it-DQZcrCkf.js +1 -0
- package/dist-embed-sighting/{CaseReportExport-lbuI40c8.js → CaseReportExport-B9N0s2JX.js} +1 -1
- package/dist-embed-sighting/ContrailSystem-C1pCwq7H.js +1 -0
- package/dist-embed-sighting/ControlPasses-B78JMfGN.js +29 -0
- package/dist-embed-sighting/FlareKindMessages_en-j3CY_TxX.js +1 -0
- package/dist-embed-sighting/FlareKindMessages_es-CZgrFIOO.js +1 -0
- package/dist-embed-sighting/FlareKindMessages_fr-B2MezoN2.js +1 -0
- package/dist-embed-sighting/FlareKindMessages_it-CmZmb3RP.js +1 -0
- package/dist-embed-sighting/{Flightradar24Provider-DQ-bvlMM.js → Flightradar24Provider-RjrQ963H.js} +1 -1
- package/dist-embed-sighting/GLTFLoader-BrNCkGT3.js +1 -0
- package/dist-embed-sighting/{HeadlightSystem-B4RR270O.js → HeadlightSystem-LMaOhpkj.js} +1 -1
- package/dist-embed-sighting/{LanternEditor-9zPknaGj.js → LanternEditor-Czo3tup9.js} +1 -1
- package/dist-embed-sighting/LanternKindMessages_en-CQXdJ-k6.js +1 -0
- package/dist-embed-sighting/LanternKindMessages_es-BOO6kPjs.js +1 -0
- package/dist-embed-sighting/LanternKindMessages_fr-D7tQa_tQ.js +1 -0
- package/dist-embed-sighting/LanternKindMessages_it-B8J-29Mj.js +1 -0
- package/dist-embed-sighting/{LaserBeam-CFUYJu2F.js → LaserBeam-BuVmy_0s.js} +1 -1
- package/dist-embed-sighting/{LaunchEditor-GiZERDOz.js → LaunchEditor-DZ2V0dHc.js} +1 -1
- package/dist-embed-sighting/{LaunchPlume-CuDQMA8K.js → LaunchPlume-Quo7JzI8.js} +1 -1
- package/dist-embed-sighting/LaunchSimulation-DZ4pDnrh.js +1 -0
- package/dist-embed-sighting/{ModuleSession-CY6DsJx0.js → ModuleSession-xCJtw_IT.js} +2 -2
- package/dist-embed-sighting/ModuleThree-D1QGUDll.js +1 -0
- package/dist-embed-sighting/{ParameterForm-BHITM-mQ.js → ParameterForm-GKeZmZAL.js} +4 -4
- package/dist-embed-sighting/RailwaySystem-m2A18WjN.js +41 -0
- package/dist-embed-sighting/{ReentryEditor-C_AN8aTr.js → ReentryEditor-CnYz3Q7Q.js} +2 -2
- package/dist-embed-sighting/{ReentrySimulation-sBnymskP.js → ReentrySimulation-BnYP6UwW.js} +1 -1
- package/dist-embed-sighting/ReferenceSystem-C1iPC-1U.js +1 -0
- package/dist-embed-sighting/{TimelineTracks-B7EcGLEf.js → TimelineTracks-BjJwL-DC.js} +1 -1
- package/dist-embed-sighting/{TraceSystem-BkUPo1Xf.js → TraceSystem-ZNrHrAPL.js} +2 -2
- package/dist-embed-sighting/WaterSystem-BtEY0XLc.js +19 -0
- package/dist-embed-sighting/rr0-sighting.mjs +248 -242
- package/dist-embed-sighting/{sightingSchema-B8Xs45w9.js → sightingSchema-Dz2hCtcS.js} +1 -1
- package/dist-embed-sighting-editor/BirdKindMessages_en-c_-L7frF.js +1 -0
- package/dist-embed-sighting-editor/BirdKindMessages_es-8Zo2t0o4.js +1 -0
- package/dist-embed-sighting-editor/BirdKindMessages_fr-C1TuqqEj.js +1 -0
- package/dist-embed-sighting-editor/BirdKindMessages_it-DQZcrCkf.js +1 -0
- package/dist-embed-sighting-editor/{CaseReportExport-QyaWB9n9.js → CaseReportExport-RjSpSvFT.js} +1 -1
- package/dist-embed-sighting-editor/{ControlPasses-BsZQ-_CW.js → ControlPasses-D9A8NPRi.js} +1 -1
- package/dist-embed-sighting-editor/FlareKindMessages_en-j3CY_TxX.js +1 -0
- package/dist-embed-sighting-editor/FlareKindMessages_es-CZgrFIOO.js +1 -0
- package/dist-embed-sighting-editor/FlareKindMessages_fr-B2MezoN2.js +1 -0
- package/dist-embed-sighting-editor/FlareKindMessages_it-CmZmb3RP.js +1 -0
- package/dist-embed-sighting-editor/{GLTFLoader-D7spTlJl.js → GLTFLoader-GAmboVFk.js} +1 -1
- package/dist-embed-sighting-editor/{HeadlightSystem-DZN_EX7x.js → HeadlightSystem-CDAFEIP8.js} +1 -1
- package/dist-embed-sighting-editor/{InterviewEditorElement-CD-k5bQB.js → InterviewEditorElement-Bq8INvJ8.js} +2 -2
- package/dist-embed-sighting-editor/LanternKindMessages_en-CQXdJ-k6.js +1 -0
- package/dist-embed-sighting-editor/LanternKindMessages_es-BOO6kPjs.js +1 -0
- package/dist-embed-sighting-editor/LanternKindMessages_fr-D7tQa_tQ.js +1 -0
- package/dist-embed-sighting-editor/LanternKindMessages_it-B8J-29Mj.js +1 -0
- package/dist-embed-sighting-editor/{ModuleConformance-D7QNv2-c.js → ModuleConformance-Qm-EHVoc.js} +2 -2
- package/dist-embed-sighting-editor/{ModuleSession-DTZs4At5.js → ModuleSession-BZ3xmE8Y.js} +2 -2
- package/dist-embed-sighting-editor/ModuleThree-BFSbIe18.js +1 -0
- package/dist-embed-sighting-editor/{ModulesPanelElement-9x7kP_Tx.js → ModulesPanelElement-DuyRnhEj.js} +3 -3
- package/dist-embed-sighting-editor/{RailwaySystem-BxHS7Jka.js → RailwaySystem-DG0WQQfc.js} +1 -1
- package/dist-embed-sighting-editor/{ReferenceSystem-ZQRGSWgC.js → ReferenceSystem-DMmt1GR2.js} +1 -1
- package/dist-embed-sighting-editor/{SightingFileEditor-BXWkp08k.js → SightingFileEditor-6F5VGGUe.js} +1 -1
- package/dist-embed-sighting-editor/{TraceSystem-DAa5Lzof.js → TraceSystem-eEbqZeYs.js} +1 -1
- package/dist-embed-sighting-editor/WaterSystem-CbmcniYb.js +19 -0
- package/dist-embed-sighting-editor/rr0-sighting-editor.mjs +220 -214
- package/dist-embed-sighting-editor/{sightingSchema-B8Xs45w9.js → sightingSchema-Dz2hCtcS.js} +1 -1
- package/package.json +1 -1
- package/dist-embed-scene/BeamSystem-BxfhSMvb.js +0 -1
- package/dist-embed-scene/BirdKindMessages_en-DvojmvJ5.js +0 -1
- package/dist-embed-scene/BirdKindMessages_es-CTyGOBqo.js +0 -1
- package/dist-embed-scene/BirdKindMessages_fr-DqcvqMrp.js +0 -1
- package/dist-embed-scene/BirdKindMessages_it-CIRyyI_k.js +0 -1
- package/dist-embed-scene/ContrailSystem-Bn--uCNU.js +0 -1
- package/dist-embed-scene/ControlPasses-X_kTXa-p.js +0 -29
- package/dist-embed-scene/FlareKindMessages_en-BroHgiwr.js +0 -1
- package/dist-embed-scene/FlareKindMessages_es-SraQyQ3Y.js +0 -1
- package/dist-embed-scene/FlareKindMessages_fr-Dy5SlSna.js +0 -1
- package/dist-embed-scene/FlareKindMessages_it-CF39wmrC.js +0 -1
- package/dist-embed-scene/GLTFLoader-CZ-8eVJ4.js +0 -1
- package/dist-embed-scene/HeadlightSystem-l2XbBvXf.js +0 -34
- package/dist-embed-scene/LanternKindMessages_en-fUfoRYC0.js +0 -1
- package/dist-embed-scene/LanternKindMessages_es-Chyc607D.js +0 -1
- package/dist-embed-scene/LanternKindMessages_fr-CDem7PTY.js +0 -1
- package/dist-embed-scene/LanternKindMessages_it-yOojym1u.js +0 -1
- package/dist-embed-scene/ModuleThree-BljKXj42.js +0 -1
- package/dist-embed-scene/ReferenceSystem-Dyc08-lR.js +0 -1
- package/dist-embed-scene/WaterSystem-DbyWlKho.js +0 -1
- package/dist-embed-sighting/BeamSystem-BZ2f4hh1.js +0 -1
- package/dist-embed-sighting/BirdKindMessages_en-DvojmvJ5.js +0 -1
- package/dist-embed-sighting/BirdKindMessages_es-CTyGOBqo.js +0 -1
- package/dist-embed-sighting/BirdKindMessages_fr-DqcvqMrp.js +0 -1
- package/dist-embed-sighting/BirdKindMessages_it-CIRyyI_k.js +0 -1
- package/dist-embed-sighting/ContrailSystem-CqpZgLkb.js +0 -1
- package/dist-embed-sighting/ControlPasses-BnlLorfW.js +0 -29
- package/dist-embed-sighting/FlareKindMessages_en-BroHgiwr.js +0 -1
- package/dist-embed-sighting/FlareKindMessages_es-SraQyQ3Y.js +0 -1
- package/dist-embed-sighting/FlareKindMessages_fr-Dy5SlSna.js +0 -1
- package/dist-embed-sighting/FlareKindMessages_it-CF39wmrC.js +0 -1
- package/dist-embed-sighting/GLTFLoader-DPrksej_.js +0 -1
- package/dist-embed-sighting/LanternKindMessages_en-fUfoRYC0.js +0 -1
- package/dist-embed-sighting/LanternKindMessages_es-Chyc607D.js +0 -1
- package/dist-embed-sighting/LanternKindMessages_fr-CDem7PTY.js +0 -1
- package/dist-embed-sighting/LanternKindMessages_it-yOojym1u.js +0 -1
- package/dist-embed-sighting/LaunchSimulation-Fpwvzpf1.js +0 -1
- package/dist-embed-sighting/ModuleThree-EigESy50.js +0 -1
- package/dist-embed-sighting/RailwaySystem-C1nfRJfj.js +0 -41
- package/dist-embed-sighting/ReferenceSystem-Cn6gWxGT.js +0 -1
- package/dist-embed-sighting/WaterSystem-DrSAhM5g.js +0 -1
- package/dist-embed-sighting-editor/BirdKindMessages_en-DvojmvJ5.js +0 -1
- package/dist-embed-sighting-editor/BirdKindMessages_es-CTyGOBqo.js +0 -1
- package/dist-embed-sighting-editor/BirdKindMessages_fr-DqcvqMrp.js +0 -1
- package/dist-embed-sighting-editor/BirdKindMessages_it-CIRyyI_k.js +0 -1
- package/dist-embed-sighting-editor/FlareKindMessages_en-BroHgiwr.js +0 -1
- package/dist-embed-sighting-editor/FlareKindMessages_es-SraQyQ3Y.js +0 -1
- package/dist-embed-sighting-editor/FlareKindMessages_fr-Dy5SlSna.js +0 -1
- package/dist-embed-sighting-editor/FlareKindMessages_it-CF39wmrC.js +0 -1
- package/dist-embed-sighting-editor/LanternKindMessages_en-fUfoRYC0.js +0 -1
- package/dist-embed-sighting-editor/LanternKindMessages_es-Chyc607D.js +0 -1
- package/dist-embed-sighting-editor/LanternKindMessages_fr-CDem7PTY.js +0 -1
- package/dist-embed-sighting-editor/LanternKindMessages_it-yOojym1u.js +0 -1
- package/dist-embed-sighting-editor/ModuleThree-COSQVAvF.js +0 -1
- package/dist-embed-sighting-editor/WaterSystem-C7hE-tnY.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ah as e}from"./rr0-scene.mjs";const t={play:"Play",clickToPlay:"Click to play",pause:"Pause",noDuration:"No observation duration",currentPosition:"Current position",duration:"Duration",switchToElapsed:"click to show elapsed time",switchToClockTime:"click to show the time of day",fullscreen:"Fullscreen",exitFullscreen:"Exit fullscreen",recordVideo:"Record a video of the observation",recordingVideo:"Video being made: {percent} %. Click to stop it",videoFailed:"The video could not be made: {reason}",videoSize:"Size",videoSizeScreen:"As on screen ({size})",videoCaption:"Caption",videoTime:"Time",videoMap:"Map",videoStart:"Record",videoKit:"Generative AI kit",videoKitHint:"A zip to make a realistic video of this reconstruction with a video generator (Runway, Kling, Luma…): the film without captions, its depth, the phenomenon's mask, a prompt and instructions.",videoFrom:"Start",videoTo:"End",videoHere:"Here",videoHereHint:"Where the playback is",videoDescription:"Reconstruction made with UFO@home from the witness's account: a simulation, not a recording of the observation.",mute:"Mute",volume:"Volume",unmute:"Unmute",noSound:"No sound recorded",moments:"Moments",moreControls:"More controls",fewerControls:"Fewer controls",showObserverMap:"Show where the witness was",hideObserverMap:"Hide where the witness was",mapImageryUnavailable:"Aerial imagery unavailable",zoomMapIn:"Zoom in",zoomMapOut:"Zoom out",fitMap:"Back to the whole path",placeObserverHere:"Put the witness here",showReferences:"Show the pictures of the place",hideReferences:"Hide the pictures of the place",showTraces:"Show the investigator's lines",hideTraces:"Hide the investigator's lines",referenceOpacity:"Picture opacity",referencesMenu:"Pictures of the place",showMilestones:"Show the account's moments",hideMilestones:"Hide the account's moments",observerHere:"The witness, here",decorHere:"Scenery",recordingIssues:"{count} problem(s) in this recording: it may not play as its author meant",issueTemplates:e.EN};export{t as ufoMessages_en};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import{G as b,d as F,C as E,e as L,g as D,V as M,h as I,i as C,j as R,k as N,m as U,S as T,W as B,n as O,H as P,B as V,F as A}from"./rr0-scene.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 b;material=new F({color:new E(...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 L},uWaterReflectionOn:{value:0}};mirrorCamera=new D;eye=new M;ahead=new M;up=new M;plane=new I;clip=new C;q=new C;size=new R;bias=new L().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
|
+
varying vec3 vWaterWorld;`).replace("#include <project_vertex>",`#include <project_vertex>
|
|
3
|
+
vWaterWorld = (modelMatrix * vec4(transformed, 1.0)).xyz;`),t.fragmentShader=t.fragmentShader.replace("#include <common>",`#include <common>
|
|
4
|
+
varying vec3 vWaterWorld;
|
|
5
|
+
uniform sampler2D uWaterReflection;
|
|
6
|
+
uniform mat4 uWaterReflectionMatrix;
|
|
7
|
+
uniform float uWaterReflectionOn;`).replace("#include <opaque_fragment>",`
|
|
8
|
+
if (uWaterReflectionOn > 0.5) {
|
|
9
|
+
vec4 at = uWaterReflectionMatrix * vec4(vWaterWorld, 1.0);
|
|
10
|
+
vec2 uv = at.xy / at.w;
|
|
11
|
+
if (at.w > 0.0 && uv.x >= 0.0 && uv.x <= 1.0 && uv.y >= 0.0 && uv.y <= 1.0) {
|
|
12
|
+
vec4 mirrored = texture2D(uWaterReflection, uv);
|
|
13
|
+
float facing = clamp(dot(normal, normalize(vViewPosition)), 0.0, 1.0);
|
|
14
|
+
float fresnel = 0.02 + 0.98 * pow(1.0 - facing, 5.0);
|
|
15
|
+
// Premultiplied: drawn over a picture cleared to nothing, an edge's colour is already its coverage's share.
|
|
16
|
+
outgoingLight = outgoingLight * (1.0 - mirrored.a * fresnel) + mirrored.rgb * fresnel;
|
|
17
|
+
}
|
|
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=>N(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(T.area(c.map(n=>new R(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,y]of this.levels)v.visible&&(!h||y.areaM2>h.areaM2)&&(h=y);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 B(d,p,{type:P,minFilter:O,magFilter:O}));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,z=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,z),t.autoClear=m,t.shadowMap.autoUpdate=x,o.background=w,l.uWaterReflection.value=this.reflectionTarget.texture,l.uWaterReflectionOn.value=1}static clearColor=new E;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 R(s.x,s.z),i=t.map(f),a=o.map(s=>s.map(f)),l=T.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 z of w?[u,m,x]:[u,x,m])c.push(z.x,e,z.y)}const d=new V;d.setAttribute("position",new A(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 A(p,3)),d.computeBoundingSphere(),d}}export{r as WaterSystem};
|