@korial29/tiny-fps 1.14.0 → 1.16.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 (45) hide show
  1. package/dist/assets/{room-Dov6cUCN.js → room-CVIx5hx8.js} +56 -2
  2. package/dist/brick-BSIQdeSz.js +1 -0
  3. package/dist/index.js +8 -8
  4. package/dist/landfall-DqMPx3EL.js +21 -0
  5. package/dist/local.js +1 -1
  6. package/dist/paint-Ck7ZtE7l.js +4 -0
  7. package/dist/room.js +1 -1
  8. package/dist/server.js +1 -1
  9. package/dist/{stone-BqYQDnkI.js → stone-Bdq5eUwO.js} +1 -1
  10. package/dist/{textures-BQ8WtdV5.js → textures-BkEnQMsT.js} +1 -1
  11. package/dist/tranquility-CtgYmGVn.js +1 -0
  12. package/dist/types/client/buggy/body.d.ts +2 -0
  13. package/dist/types/client/buggy/constants.d.ts +17 -0
  14. package/dist/types/client/buggy/index.d.ts +2 -0
  15. package/dist/types/client/buggy/pods.d.ts +2 -0
  16. package/dist/types/client/buggy/wheel.d.ts +19 -0
  17. package/dist/types/client/dust.d.ts +5 -0
  18. package/dist/types/client/gait/moves.d.ts +1 -1
  19. package/dist/types/client/hulk/cabin.d.ts +10 -31
  20. package/dist/types/client/hulk/common.d.ts +16 -1
  21. package/dist/types/client/hulk/hold.d.ts +4 -0
  22. package/dist/types/client/hulk/inside.d.ts +7 -1
  23. package/dist/types/client/hulk/pilot.d.ts +4 -0
  24. package/dist/types/client/hulk/seats.d.ts +17 -0
  25. package/dist/types/client/hulk/shapes.d.ts +16 -0
  26. package/dist/types/client/hulk/trim.d.ts +24 -0
  27. package/dist/types/client/hulk/types.d.ts +2 -0
  28. package/dist/types/client/hulk.d.ts +5 -0
  29. package/dist/types/client/hunter/animation.d.ts +1 -1
  30. package/dist/types/client/render/scene.d.ts +4 -1
  31. package/dist/types/client/render/shader.d.ts +1 -1
  32. package/dist/types/client/rover/body.d.ts +2 -0
  33. package/dist/types/client/rover/constants.d.ts +29 -0
  34. package/dist/types/client/rover/draw.d.ts +52 -0
  35. package/dist/types/client/rover/mesh.d.ts +15 -0
  36. package/dist/types/client/rover/parts.d.ts +12 -0
  37. package/dist/types/client/rover.d.ts +5 -49
  38. package/dist/types/shared/beach.d.ts +13 -0
  39. package/dist/types/shared/types.d.ts +4 -0
  40. package/dist/types/shared/world.d.ts +4 -0
  41. package/package.json +1 -1
  42. package/dist/brick-CfuEIQ9e.js +0 -1
  43. package/dist/landfall-CjRDmBHh.js +0 -21
  44. package/dist/paint-DbTB8EPG.js +0 -4
  45. package/dist/tranquility-DJe_6Y_T.js +0 -1
@@ -0,0 +1,4 @@
1
+ import{$ as e,$n as t,$t as n,An as r,B as i,Bn as a,Cn as o,Ct as s,Dn as c,Dt as l,F as u,G as d,Gn as f,H as p,Hn as m,Ht as h,In as g,J as _,K as v,Kn as y,Mn as b,Nn as x,On as S,Pn as C,Q as w,Qn as T,Qt as E,Sn as ee,Tt as te,Vn as ne,X as re,Xn as ie,Xt as ae,Y as D,Zn as O,Zt as oe,_n as se,_t as ce,ar as k,ct as le,dr as A,dt as ue,en as de,fn as fe,fr as pe,ft as me,gn as j,gt as M,hn as he,ht as ge,ir as _e,jn as ve,kn as ye,lr as N,mn as be,mt as xe,nr as Se,or as Ce,ot as we,p as Te,pn as Ee,pt as De,q as Oe,st as ke,ut as Ae,vn as je,vt as Me,wn as Ne,wt as Pe,xn as Fe,yn as Ie,zn as Le}from"./brick-BSIQdeSz.js";var P=125,[Re,ze]=_e,{METAL:F,STEEL:Be,PAINT:Ve,WOOD:He,STONE:Ue,GRATE:We}=pe,Ge=[1,.42,.08],I={sea:0,shore:30,trees:90,east:110,cape:-6,water:0},Ke={east:I.trees+5,cape:I.cape-4},L={r:7,sunk:2,sections:[[6,36],[44,74],[82,106]],axis:[4,6.25,7.5],spine:2.5,skin:.85},qe=e=>{let t=Math.max(1-e*e/(L.r*L.r),0);return Math.max(L.r*Math.sqrt(Math.sqrt(t*Math.sqrt(t))),e>0?L.spine:0)},Je=[-4,-2.05,-1.75,0,1.95,2.25,3.6,5,5.5,6,6.5,7],R=[-1.75,2.25,L.r],Ye=(Je.map(e=>[e,qe(e)]),[{cut:[[6,7,.7,9],[7,13,.76],[13,20,.9],[20,36,1]],floor:-4.75,holes:[[0,14,20,3],[1,24,29,9],[2,13,18.5,2.3]],tears:[[21,30,-1.75,1.95],[31,36,2.25,5]],fair:[[30,36,3]],crates:[[18.3,-1],[24.2,0],[16.8,1]]},{cut:[[44,74,1]],floor:-5,holes:[[0,51.5,56,3.2],[0,67,70.5,9],[1,44,48,9],[1,60.5,65.5,3],[2,44,47,9],[2,53,58,2.2]],tears:[[57.5,60.5,-4,-2.05],[47.5,55,-1.75,1.95],[64,71,2.25,5]],fair:[[44,47.5,3.2],[55,71,4.4],[71,74,3]],crates:[[54.3,-1],[60.7,0],[56.3,1]]},{cut:[[82,90,1],[90,97,.85]],floor:-5,holes:[[0,86.5,90,3],[1,82,85,9],[2,87.5,91.5,2]],tears:[[84.5,91,-1.75,1.95]],fair:[[82,84.5,2.7],[91,95,1.5]],crates:[[88.3,-1],[83.3,0],[87.7,1]]}]),Xe={floor:L.axis[1]+Ye[1].floor,ceil:L.axis[1]+Je[1],half:4.525,x:L.sections[1],door:Ye[1].tears[0],lintel:Je[1]-Ye[1].floor,walls:[],way:2.4},Ze={root:[45,71],lead:[[71,0],[69,8],[64,18],[61.5,26],[60,26],[59,38],[60.5,38],[59,42],[57.5,46.5],[54,47.5]],trail:[[45,0],[46.5,10],[50,30],[52.5,44],[54,47.5]],span:.78,pieces:[[0,14,0,8.5,6.4,0],[16,30,2,6.8,3.6,.17],[32,47.5,4,3.3,1.6,-.2]],rails:[53.5,58]},Qe=[[38.5,150.3,2.7,19,.78],[4.5,137,2.5,9]],$e=[60,219,4],et=1.25,tt=[[38,237,3.5,2.6,1],[57,242,3,2.2,2],[47,251,4,3,3],[66,254,4.5,3.6,4],[78,241,4,3.4,5],[33,256,2.8,1.8,6],[87,250,5.5,5,7],[97,243,6,6.5,8],[100,256,7.5,9,9],[89,262,7,7,10]],nt=(e,t,r)=>{let i=t=>E(e,t,151),a=2*i(1)-1,[o,s]=[(1-a*a)/(1+a*a),2*a/(1+a*a)],c=r-h(r),[l,u]=[t*(.85+.3*i(2)),t*(.6+.3*i(3))],d=h(r)+.7*r,f=[4,8].map(e=>{let[t,n,r]=[2*i(e)-1,.35*i(e+1),2*i(e+2)-1],a=Math.sqrt(t*t+n*n+r*r);return[t/a,n/a,r/a,.7+.2*i(e+3)]}),p=e=>{let t=(e[0]*o+e[2]*s)/l,n=(e[2]*o-e[0]*s)/u,r=e[1]/c,[i,a,d]=[t*t*t*t,r*r*r*r,n*n*n*n];return .25/Math.sqrt(Math.sqrt(i+a+d))+.75/Math.sqrt(Math.sqrt(Math.sqrt(i*i+a*a+d*d)))},m=t=>{if(t[1]<0){let e=Math.sqrt(t[0]*t[0]+t[2]*t[2]);return e<1e-6?d:Math.min(m([t[0]/e,0,t[2]/e])/e,d/-t[1])}let r=p(t);for(let[e,n,i,a]of f){let o=t[0]*e+t[1]*n+t[2]*i;if(o>.001){let t=a*p([e,n,i])/o,s=Math.max(.2-Math.abs(r-t),0)/.2;r=Math.min(r,t)-.05*s*s}}return r*(.95+.08*n(1.3*t[0]+e,1.3*t[2]+1.1*t[1],e+3))};return{reach:m}},rt=Array.from({length:28},(e,t)=>[I.trees+3*E(t,1,7),134+4*t+2*E(t,2,7),.22+.1*E(t,3,7)]),it=e=>Math.min(Math.max(e,0),1),at=e=>it(e)*it(e)*(3-2*it(e)),ot=(e,t)=>Math.sqrt(e*e+t*t),st=[[57,132,61,138,Xe.floor-.95],[56,171,66,175,1.3],[44,209,76,229,et]],ct=[1.5,1.2],lt=(e,t)=>{let r=Math.abs(t-P),{shore:i,trees:a}=I,o=e>i?2.5*(e-i)/(a-i):(e-i)/10;o+=.9*at((e-46)/24)*(n(e/13,r/13,5)-.45)*at((r-14)/10),o+=at((e-i)/14)*(1-at((e-102)/8))*(ct[1]*it(1-Math.abs(r-12)/5)-ct[0]*(1-at((r-2)/7))),o+=1.8*it(1-ot(e-110,r)/9);for(let[t,n,i,a,s]of st){let c=ot(Math.max(t-e,e-i,0),Math.max(n-P-r,P+r-a,0));o=s+(o-s)*at((c-6)/6)}return o},ut=(e,t)=>{let[n,r]=[Math.floor(e/4),Math.floor((t-1)/4)],[i,a]=[e/4-n,(t-1)/4-r],o=(e,t)=>Math.fround(lt(4*(n+e),1+4*(r+t))),[s,c]=[o(0,0),o(1,1)];return i>=a?s+(o(1,0)-s)*i+(c-o(1,0))*a:s+(o(0,1)-s)*a+(c-o(0,1))*i},z=(e,t,n,r,i,a,o,s)=>({min:[e,t,n],max:[r,i,a],top:o,side:o,...s?{tint:s}:{}}),dt=e=>({...e,ghost:!0}),ft=e=>({...e,min:[e.min[0],e.min[1],250-e.max[2]],max:[e.max[0],e.max[1],250-e.min[2]],...e.tint?{tint:e.tint===Re?ze:e.tint}:{}}),pt=([e,t,n])=>[e,t,250-n],mt=(e,...t)=>[...e,...e.map(pt),...t],B=[],ht=[],V=(e,t,n)=>(e.push({kind:t,min:n.min,max:n.max}),dt(n)),gt=(e,t,n,r)=>{let i=[0,.25,.5,.75,1].flatMap(i=>[0,.25,.5,.75,1].map(a=>ut(e+(n-e)*i,t+(r-t)*a)));return[Math.max(...i),Math.min(...i)]},H=(e,t,n,r,i,a,o,s)=>{let[c,l]=gt(t,n,r,i);return V(B,e,z(t,l-.5,n,r,Math.round(32*(c+a))/32,i,o,s))},U=e=>[(e.min[0]+e.max[0])/2,e.max[1],(e.min[2]+e.max[2])/2],_t=(e,t,n,r,i,a,o,s=0)=>{let c=[],l=t,u=(o,s,l)=>{let[u,d]=[Math.max(o,t),Math.min(s,n)];if(d>u&&l<a)for(let[t,n]of l>0?[[-a,-l],[l,a]]:[[-a,a]])c.push(V(ht,e,z(u,r,P+t,d,i,P+n,e==`deck`?We:F)))};for(let[e,t,r]of[...o,[n,n,0]])u(l,e,s),u(e,t,r),l=Math.max(l,t);return c},vt=L.axis.map(e=>e+L.r),yt=L.sections.slice(1).map(([e],t)=>{let n=L.sections[t][1],[r,i]=gt(n,123.5,e,126.5),a=Math.round(32*(Math.max(r,I.water)+1.875))/32;return{x:(n+e)/2,top:a,heap:z(n,i-.5,123.5,e,a,126.5,Be,Ge)}}),bt=L.sections.flatMap(([e,t],n)=>[n&&[e,e+1],n<2&&[t-1,t]].filter(e=>e).map(e=>{let[t,r]=e,i=L.axis[n],a=Math.round(16*qe(Ye[n].floor))/16-L.skin;return z(t,i+Ye[n].floor,P-a,r,i+Je[1],P+a,F)})),xt=[36,74].flatMap(e=>{let[t,n]=gt(e,128,e+1.2,130.5),r=z(e,n-.5,128,e+1.2,Math.round(32*(t+1.4))/32,130.5,Be);return[r,ft(r)]}),St=z(.5,-.3,121,5,.4,129,F),Ct=[...Ye.flatMap(({cut:e,floor:t,holes:n,tears:r,fair:i,crates:a},o)=>{let s=L.axis[o],c=[t,...Je.filter(e=>e>t+.5)];return[...e.flatMap(([e,a,o,l=L.skin])=>{let u=e=>Math.round(16*o*qe(e))/16;return[..._t(`deck`,e,a,s-L.r,s+t,u(t),[]),...c.slice(1).flatMap((d,f)=>{let p=c[f],m=R.indexOf(d),h=d<L.r?u(m<0?(p+d)/2:d):o*L.spine,g=p<R[0]?t:p<R[1]?R[0]:R[1];return[...m<0?_t(`skin`,e,a,s+p,s+d,h,r.filter(e=>e[2]<=p&&e[3]>=d).map(([e,t])=>[e,t,99]),Math.min(u(d),u(g))-l):_t(`deck`,e,a,s+p,s+d,h,n.filter(e=>e[0]==m).map(([,e,t,n])=>[e,t,Math.min(n,h-l)])),...p>=0&&d<=R[1]?i.flatMap(([t,n,r])=>_t(`fairing`,Math.max(t,e),Math.min(n,a),s+p,s+d,L.r+r,[],h)):[]]})]}),...a.map(([e,n])=>{let r=s+(R[n]??t);return V(ht,`crate`,z(e,r,124.25,e+1.5,r+[1,1.4,2][n+1],125.75,He))})]}),...yt.map(e=>V(ht,`heap`,e.heap)),...xt.map(e=>V(ht,`frame`,e)),...bt.map(e=>V(ht,`jam`,e)),V(ht,`raft`,St),dt(z(Ke.east,-10,Ke.cape-2,Ke.east+2,40,250-Ke.cape+2,Ue))],wt=e=>.6-.45*e/47.5,Tt=(e,t)=>{let n=e.findIndex(e=>e[1]>t),[r,i]=[e[n-1],e[n]];return r[0]+(i[0]-r[0])*(t-r[1])/(i[1]-r[1])},Et=Array.from({length:6},(e,t)=>{let[n,r,i,,a]=Qe[0],o=n-7.5+2.5*t,s=r+a*(o+1.25-n);return H(`fallen`,o,s-i-.2,o+2.5,s+i+.2,3.5,F,t?void 0:Ge)}),Dt=[...[U(Et[3]),[Qe[1][0]-1.5,1.3,Qe[1][1]+3.5]].flatMap(([e,t,n])=>[[e,t,n,42,1.3,7],[e,t,250-n,42,1.3,7]]),...L.sections.flatMap(([e,t],n)=>[n&&e-.6,n<2&&t+.6].filter(e=>e).map(e=>[+e,L.axis[n]+4.2,125,28,.9,4]))],Ot=[.55,2.3],kt=(()=>{let[e,t,n,r]=Qe[1];return V(B,`engine`,z(e-n,-5,t-r/2,e+n,1.4,t+r/2,F,Ge))})(),At=[V(B,`float`,z(16,-1.6,141,22,.35,144,F)),V(B,`float`,z(10,-.2,138,13,.5,141,F)),V(B,`float`,z(23,-1.6,132.6,26,.2,135,F))],jt=V(B,`pod`,z($e[0]-3,.75,$e[1]-3,$e[0]+3,4.25,$e[1]+3,F)),Mt=V(B,`dais`,z($e[0]-2,.75,$e[1]-10,$e[0]+2,1.3,$e[1]-6,Ve,Re)),W=(e,t,n=.4,r)=>H(`crate`,e-1.5,t-1.5,e+1.5,t+1.5,n,He,r),Nt=(e,t)=>[z(e-2.6,4.85,t-2.1,e+2.6,5,t+2.1,Ve,Re),...[-1,1].flatMap(n=>[-1,1].map(r=>z(e+2.5*n-.1,.75,t+2*r-.1,e+2.5*n+.1,4.85,t+2*r+.1,Be)))].map(e=>V(B,`shelter`,e)),[Pt,Ft]=[W(49,221),W(71,221)],[It,Lt]=[W(84,185,.4,Re),W(33,153,.4,Re)],Rt=H(`panel`,67,184.5,70.5,188,.65,F),zt=H(`container`,68.5,176,71.1,182,1.875,F,Ge),Bt=H(`gear`,68.6,170.6,71,173,2.9,Be,[.95,.75,.1]),Vt=H(`container`,64,164.5,67.5,168,2.6,F,Ge),Ht=H(`gear`,67.6,169.6,72,170.6,1.2,Be),G={camp:[W(76,213),W(40,217)],west:[H(`panel`,44.5,191.5,47.5,194.5,.5,F),H(`container`,33,173.7,39,176.3,2.2,F,Ge),H(`panel`,41,163.5,44,166.5,.4,F),H(`panel`,25.5,159.5,28.5,162.5,.5,F),H(`panel`,50.5,139.5,53.5,142.5,.4,F),H(`container`,49.5,132.4,52.5,135,2.6,F,Ge)],east:[H(`panel`,62.5,145.5,65.5,148.5,.4,F),W(80,171),W(85.5,165),W(84,153),H(`panel`,84.5,135.5,87.5,138.5,.4,F)],cover:[H(`panel`,78,156.6,83,157,2.6,F),H(`panel`,30,166.6,35,167,2.2,F),H(`container`,76,190,82,192.6,2.6,F,Ge)]},Ut=(e,t,n,r,i,a)=>{let{reach:o}=nt(i,n,r),s=gt(e-.8*n,t-.8*n,e+.8*n,t+.8*n),c=ut(e,t)+h(r),l=c+o([0,1,0])-.1,u=(e,t,n)=>{let r=Math.sqrt(e*e+t*t+n*n)||1;return r<=o([e/r,t/r,n/r])},d=(e,t)=>{if(!u(e,t,0))return;let r=r=>{let[i,a]=[0,1.6*n];for(let n=0;n<9;n++){let n=(i+a)/2;u(e,t,r*n)?i=n:a=n}return r*i};return[r(-1),r(1)]},f=[],[p,m]=[n<5?1:n<8?2:3,r<5?1:r<12?2:3];for(let r=s[1]-.5;r<l-.3;r+=m){let i=Math.min(r+m,l);for(let o=-1.5*n;o<1.5*n;o+=p){let n=[.1,.5,.9].flatMap(e=>[Math.max(r,s[1])+.05,i].map(t=>d(o+p*e,t-c)));if(n.every(e=>e)){let s=t+Math.max(...n.map(e=>e[0])),c=Math.min(t+Math.min(...n.map(e=>e[1])),a);c-s>.4&&f.push([e+o,r,s,e+o+p,i,c])}}}return f},Wt=tt.map(([e,t,n,r,i])=>({at:[e,ut(e,t),t],R:n,H:r,s:i,parts:Ut(e,t,n,r,i,250-Ke.cape)})),Gt=[...Ze.pieces.flatMap(([e,t,n,r,i,a],o)=>{let s=(e,t=n)=>P+L.r+Ye[1].fair[1][2]+Ze.span*e+t,c=Math.ceil((s(t)-s(e))/1.4),l=Math.max(c,Math.ceil((r-i)/.15-1e-9)+1),u=Ze.pieces[o-1];return[...Array.from({length:l},(n,o)=>{let u=e+(t-e)*(o+.5)/l,d=a*c*((o+.5)/l-.5),[f,p]=[Ze.trail,Ze.lead].map(e=>Math.round(8*(Tt(e,u)+d))/8),[m,h]=[o,o+1].map(n=>s(e+(t-e)*n/l)),g=r+(i-r)*o/(l-1);return V(B,`wingpiece`,z(f,g-wt(u),m,p,g,h,F))}),...u?Ze.rails.map(t=>{let n=Math.min(u[4],r);return V(B,`rail`,z(t-.225,n-.45,s(u[1],u[2]),t+.225,n,s(e),Be))}):[]]}),...Et,kt,...At,jt,Mt,Pt,Ft,...Nt(49,221),...Nt(71,221),It,Lt,Rt,zt,Bt,Ht,Vt,...Object.values(G).flat(),...rt.map(([e,t,n])=>{let r=ut(e,t);return dt(z(e-n,r-1,t-n,e+n,r+9,t+n,He))}),...Wt.flatMap(e=>e.parts).map(([e,t,n,r,i,a])=>dt(z(e,t,n,r,i,a,Ue))),dt(z(-60,-10,250-Ke.cape,Ke.east+2,40,250-Ke.cape+2,Ue))],Kt={hull:L.sections.map(([e,t],n)=>[e,t,L.axis[n]]),pieces:[...ht,...B,...B.map(({kind:e,min:t,max:n})=>({kind:e,min:[t[0],t[1],250-n[2]],max:[n[0],n[1],250-t[2]]}))],crags:[...Wt,...Wt.map(e=>({...e,at:[e.at[0],e.at[1],250-e.at[2]],parts:e.parts.map(([e,t,n,r,i,a])=>[e,t,250-a,r,i,250-n])}))]},qt=[46,54,62,70].flatMap(e=>[[e,et,226,0],[e+4,et,229,0]]),Jt=e=>{let t=t=>e?t:pt(t);return{base:t(U(Mt)),spawns:e?qt:qt.map(([e,t,n])=>[e,t,250-n,Math.PI]),rack:t(U(Pt)),blade:t(U(Ft)),rifle:t(U(It)),rail:t(U(Lt))}},Yt=[79,222],Xt=[70.5,L.axis[1]+R[1],128],Zt={navy:[.09,.12,.25],leather:[.26,.21,.18],carpet:[.2,.22,.33],red:[.4,.07,.06],green:[.08,.2,.1],tan:[.45,.31,.16]},Qt={armor:!0,name:`Landfall`,tag:`Beach · wreck`,lore:`A ship came down across a Caribbean beach, its tail in the lagoon and its nose in the trees. The survivors camp at either end of the sand and fight over the wreck between them.`,brushes:[...Gt,...Gt.map(ft),...Ct],tints:Object.values(Zt),teams:[Jt(!0),Jt(!1)],packs:mt([U(G.camp[0]),U(G.west[2]),U(G.west[4]),U(At[0]),U(G.east[3])],...yt.map(({x:e,top:t})=>[e,t,P])),ammo:mt([U(Rt),U(zt),U(Bt),U(G.west[0]),U(G.west[1]),U(G.west[3]),U(G.east[0]),U(G.east[1]),U(G.east[4])],[51,Xe.floor,P],[67,Xe.floor,P]),cells:mt([U(G.camp[1]),U(Vt),U(At[1]),U(G.east[2]),Xt],[59,Xe.floor,P]),vests:mt([U(kt)],[63,vt[1],P]),rovers:[[Yt[0],et,Yt[1],0],[Yt[0],et,250-Yt[1],Math.PI]],floor:-1.4,water:I.water,fires:Dt.map(([e,t,n,,r])=>[e,t,n,.6*r+Ot[0],Ot[1]]),relief:{hole:[0,0,0,0],bound:[56,P,100,185],cell:4,origin:[0,1],at:lt},sun:{dir:[-.47,.83,.3],color:[3.2,3,2.6]},sky:[[.1,.32,.75],[.55,.75,.9]],fog:[.6,.78,.9,.0012],scenery:`beach`},K={DROP:1.3,H:2.6,R:1.6,BODY:[4.8,0,-4.8],HITS:[4.5,0,-4.5],HIT:2.6,ACC:24,STRAFE:14,LIFT:16,BOOST:1.7,VMAX:48,DRIFT:.25,HOLD:1.5,HOVER:3,SKID:3,TURN:4,YRATE:1.9,PRATE:1.5,RESP:8,PMAX:1.25,BANK:.4,SLIDE:.3,RMAX:.8,RRESP:5,CEIL:g.TOP,EDGE:.88,WARN:20,PUSH:3,BRAKE:4,OVER:12,ENTER_R:6,ENTER_H:4,GUN_COOL:6,GUN_RANGE:160,GUN_AIM:80,MISSILES:4,MISSILE_COOL:30,RELOAD:300,MISSILE_SPEED:60,CRASH:12,CRASH_HP:4,BOUNCE:.3},$t=[[-2.6,-.2,-.9],[2.6,-.2,-.9]],en=[[-3.4,-.7,-2.9],[3.4,-.7,-2.9]],tn=[[.9,-2.7,-5.3,.14,-.12],[2.6,-2.6,-5.5,.12,-.1],[6.4,-4.9,-6.1,-.7,-.78]],nn=/* @__PURE__ */ new Map,rn=e=>{let t=nn.get(e);if(t)return t;let n=e<tn[1][0]?0:1,[r,i]=[tn[n],tn[n+1]],a=(e-r[0])/(i[0]-r[0]),o=r.map((e,t)=>e+(i[t]-e)*a);return nn.set(e,o),o},an=.1,on=[.9,2.6,3.9,5.15,6.4].slice(1).map((e,t,n)=>{let r=t?n[t-1]:.9,[i,a]=[rn(r),rn(e)];return[[r,e+an],[Math.min(i[4],a[4])-an,Math.max(i[3],a[3])+an],[Math.min(i[2],a[2])-an,Math.max(i[1],a[1])+an]]}),sn=[[1.4,3.2,1.1],[3.2,5.8,.75]],cn=.4,ln=5.6,un=.8,dn=Math.max(...K.BODY.map(e=>Math.abs(e)+K.DROP+K.R),ln+Math.abs(rn(ln)[4])+Math.max(Math.abs(rn(ln)[1]),Math.abs(rn(ln)[2]))+un),fn=[[3.2,0],[4.8,0],[6.4,-1],[6.4,1]],pn=[0,.05,-.2],mn=K.R+.9,q=1/60,hn=Math.fround,{sin:gn,cos:_n,min:J,max:Y,abs:vn,sqrt:yn}=Math,bn=(e,t,n)=>J(Y(e,t),n),xn=`x y z vx vy vz yaw pitch roll wy wp wr steer`.split(` `),Sn=e=>{let[t,n,r,i,a,o]=[gn(e.yaw),_n(e.yaw),gn(e.pitch),_n(e.pitch),gn(e.roll),_n(e.roll)],s=[n,0,-t],c=[t*r,i,n*r];return[[s[0]*o-c[0]*a,s[1]*o-c[1]*a,s[2]*o-c[2]*a],[c[0]*o+s[0]*a,c[1]*o+s[1]*a,c[2]*o+s[2]*a],[-t*i,r,-n*i]]},Cn=/* @__PURE__ */ new WeakMap,X=(e,t,n,r)=>{let[i,a,o]=(e=>{let t=Cn.get(e);if(t&&t.yaw===e.yaw&&t.pitch===e.pitch&&t.roll===e.roll)return t.axes;let n={yaw:e.yaw,pitch:e.pitch,roll:e.roll,axes:Sn(e)};return Cn.set(e,n),n.axes})(e);return[e.x+i[0]*t+a[0]*n+o[0]*r,e.y+i[1]*t+a[1]*n+o[1]*r,e.z+i[2]*t+a[2]*n+o[2]*r]},wn=(e=[])=>e.map(([e,t,n,r])=>({x:hn(e),y:hn(t+K.DROP),z:hn(n),vx:0,vy:0,vz:0,yaw:hn(M(r)),pitch:0,roll:0,wy:0,wp:0,wr:0,steer:0,driver:255,rider:255,ship:!0,hp:Se.HP,wreck:0,nades:K.MISSILES})),Tn=e=>{let[t,n]=[K.BODY[0],K.BODY[2]].map(t=>X(e,0,-K.DROP,t));return{a:t,b:n,r:K.R,h:K.H}},En=e=>[-1,1].flatMap(t=>sn.map(([n,r,i])=>{let[a,o]=[n,r].map(n=>{let[,r,i,,a]=rn(n);return X(e,t*n,a-.05,(r+i)/2)});return{a,b:o,r:i,h:cn}})),Dn=e=>e<=g.SEAM?e:g.SEAM*(g.ALT/g.SEAM)**(Math.min(e-g.SEAM,g.TOP-g.SEAM)/(g.TOP-g.SEAM)),On=(e,t)=>{let n=(e.y-K.CEIL+K.WARN)/K.WARN,r=kn(e,t);return[Y(0,n),r?Y(0,(r[0]-r[1]+K.WARN)/K.WARN):0]},kn=(e,t)=>{if(!t.relief)return;let[n,r,i,a]=t.relief.bound,[o,s]=[e.x-n,e.z-r],c=yn(o*o+s*s);if(!c)return[0,K.EDGE*J(i,a),1,0];let[l,u]=[o/c,s/c];return[c,K.EDGE/yn(l*l/(i*i)+u*u/(a*a)),l,u]},An=(e,t,n,r,i)=>{let a=i;for(let i of Pe(e,t,n,K.R)){let{min:o,max:s}=e.def.brushes[i];t>o[0]-K.R&&t<s[0]+K.R&&n>o[2]-K.R&&n<s[2]+K.R&&o[1]>r&&o[1]<a&&(a=o[1])}return a},jn=(e,t,n=!0)=>{let r=n?[t[0]-e.x,t[1]-e.y,t[2]-e.z]:t;return Sn(e).map(e=>e[0]*r[0]+e[1]*r[1]+e[2]*r[2])},Mn=[-1,1].flatMap(e=>on.map(([t,n,r])=>[e>0?t:[-t[1],-t[0]],n,r])),Nn=(e,t=!0)=>{let[n,r]=[e&N.LEFT,e&N.RIGHT];return n&&!r?k.LEFT:r&&!n?k.RIGHT:t&&e&N.FORWARD?k.THRUST:k.SLASH},Pn=(e,n=j)=>{let i=n[e.cut??0],a=n===O,o=a?t:S;return e.heavy?{...i,ticks:Math.round((i.ticks-i.hold)*o),strike:Math.round((i.strike-i.hold)*o),reach:i.reach+(a?T:b),arc:i.arc*ye,hp:i.hp+r}:i},Fn=(e,t,n,{reach:r,arc:i}=Pn(t))=>{let[a,o]=Ae(t.yaw),c=[t.x,t.y+.7*De(t),t.z];return n.filter(n=>{let[l,u]=[n.x-t.x,n.z-t.z],d=Math.hypot(l,u);return!(d-.4>r||t.y>=n.y+De(n)||n.y>=t.y+De(t))&&(d>.4?Math.abs(Math.atan2(a*u-o*l,a*l+o*u)):0)<=i+(d>.4?Math.asin(.4/d):Math.PI)&&!s(e,c,[n.x,n.y+.7*De(n),n.z])})},In=(e,t,n)=>{let[r,i]=Ae(e.yaw),a,c=o;for(let o of t){let[t,l]=[o.x-e.x,o.z-e.z],u=Math.hypot(t,l),d=u<.001||Math.acos(Math.min(1,(t*r+l*i)/u))<=Fe;!o.down&&!o.lock&&o.mode!==A.RIDE&&(n?!s(n,[e.x,e.y+1.3,e.z],[o.x,o.y+1.3,o.z]):o.hp<=ee)&&u<=c&&Math.abs(o.y-e.y)<1.8&&d&&([a,c]=[o,u])}return a},Ln=e=>{if(e.mode===A.GROUND){if(e.cut===k.LUNGE){let[t,n]=Ae(e.yaw);e.vx=13*t,e.vz=13*n,e.dash=60,e.ev|=Ce.DASH}else e.cut===k.LEAP&&(e.vy=C,e.ev|=Ce.JUMP)}},Rn=(e,t,n,r,i=!0,a=[],o=l[0])=>{zn=!1;let s=Vn(e,t,n,r,i,a,o);return zn&&Bn(e),s},zn=!1,Bn=e=>{[e.ammo,e.side,e.mag,e.sideMag]=[e.side??-1,e.ammo,e.sideMag??0,e.mag??0]},Vn=(e,t,n,r,i,a,o)=>{let s=e.down>0,c=!s&&(e.lock??0)>0,l=e.exec?Ie.TICKS:Ne,u=!e.wield||e.exec===Ie.KILLER;if(c&&u&&e.lock>l-20&&(e.vx||e.vz)?(we(e,n,a),e.ev=e.lock==l?Ce.DASH:0,e.lock<=l-20+1&&(e.vx=e.vz=0)):xe(e,s||c?{...t,keys:0}:t,n,r,a,o),e.hp=Math.min(e.ev&Ce.RESPAWN?o.hp:e.hp,o.hp),e.heat=Math.max(0,(e.heat??0)-(e.zapping?0:e.hot?1:2)),e.hot=!!e.hot&&e.heat>0,e.zapping=!1,e.zap=!!e.stun&&!!e.zap,(s||c)&&(e.burst=0),s)return e.down>0&&!--e.down&&ce(e,n,r,o),0;if(c)return Gn(e,t);let d=!!(t.keys&N.FIRE)&&!e.pressed;e.pressed=!!(t.keys&N.FIRE);let f=t=>n.def.teams.some(n=>!!n[t]&&((e,t)=>{let[n,r]=[e.x-t[0],e.z-t[2]];return n*n+r*r<1.44&&Math.abs(e.y-t[1])<1})(e,n[t])),p=o.gear;p||([e.ammo,e.rail,e.rifle,e.blade,e.nades]=[-1,-1,-1,!1,0]);let h=o.hunter,g=f(`rack`)||!!h&&f(`blade`);h&&(e.nades=0,e.clip=Math.max(0,(e.clip??0)-1),e.rifle=(e.rifle??-1)>=0?0:-1,(e.rail??-1)>=0&&(e.cap=Math.min(e.cap??o.cap,o.cap),e.rail=Math.min(e.rail,90),e.cap>=o.cap?e.rail=0:e.rail>1?e.rail--:(e.cap++,e.rail=e.cap<o.cap?90:0))),i&&p&&g&&!e.rack&&(h&&f(`rack`)?[e.side,e.sideMag]=[60,15]:[e.ammo,e.mag]=[o.ammo,o.mag]),e.rack=g,e.blade=!!o.katana||!!e.blade||i&&p&&f(`blade`);let _=f(`rail`);i&&p&&_&&!e.inRail&&([e.rail,e.cap]=[h?0:o.rail,o.cap]),e.inRail=_;let v=f(`rifle`);i&&p&&v&&!e.inRifle&&(h?[e.rifle,e.clip]=e.rifle<0?[0,0]:[e.rifle,e.clip]:[e.rifle,e.clip,e.nades]=[o.rifle,o.clip,3]),e.inRifle=v,e.ammo=Math.min(e.ammo,o.ammo),e.side=h?Math.min(e.side??-1,60):-1,e.sideMag=Math.min(e.sideMag??0,Math.max(e.side,0),15),e.rail=e.rail===void 0?e.rail:Math.min(e.rail,o.rail),e.rifle=e.rifle===void 0?e.rifle:Math.min(e.rifle,o.rifle),[e.mag,e.cap,e.clip]=[Math.min(e.mag??0,o.mag),Math.min(e.cap??0,o.cap),h?e.clip:Math.min(e.clip??0,o.clip)],e.cool=Math.max(0,e.cool-1),e.lob=Math.max(0,(e.lob??0)-1);let b=e.mode===A.HANG||e.mode===A.CLIMB||e.mode===A.SWIM,S=o.xeno?O:j,{ticks:C,hold:w}=S[e.cut??0],T=!!e.swing&&!e.heavy&&C-e.swing===w,E=i&&!b,ee=!!(t.keys&(o.xeno?N.BLADE:N.FIRE));if(o.xeno&&T&&!E)[e.swing,e.charge]=[0,0];else if(T&&E&&ee&&(e.wield||o.xeno))e.charge=Math.min((e.charge??0)+1,ve);else if(T&&E&&(e.charge??0)>=x)[e.heavy,e.charge]=[!0,o.xeno?e.charge:0],e.swing=Pn(e,S).ticks;else if(o.xeno&&T&&E&&!ee&&(e.charge??0)>0)e.charge=0,e.swing=C-w-1;else{e.charge=T||o.xeno&&!e.heavy?0:e.charge;let t=e.swing??0,n=Pn(e,S),r=m[e.cut??0]??m[0];e.swing=Math.max(0,o.haste>1&&(i=>i==t-1&&(i==n.ticks-n.strike||i==r.ticks-r.strike||!e.heavy&&i==C-w))(t-1)?t-1:t-o.haste),e.heavy=!!e.swing&&!!e.heavy,e.charge=o.xeno&&!e.heavy?0:e.charge}o.xeno&&T&&E&&!ee&&e.heavy&&e.cut===ie.LEAP&&e.mode===A.GROUND&&(e.vy=10,e.ev|=Ce.JUMP),e.mag=Math.min(e.mag??0,Math.max(e.ammo,0));let te=[e.ammo>=0,!!e.blade,(e.rail??-1)>=0,(e.rifle??-1)>=0,e.side>=0],ne=h&&t.keys&N.FISTS?4:t.keys&N.BLADE?1:t.keys&N.RAIL?2:t.keys&N.RIFLE?3:0,re=p&&!h&&!!(t.keys&N.FISTS)&&!(e.swing&&e.wield),ae=h&&te[1]?1:te.indexOf(!0),D=e.swing&&e.wield?1:re?-1:te[ne]?ne:ae;D!=(e.fists?-1:e.sided?4:e.rifled?3:e.railed?2:+!!e.wield)&&(e.reload=0),e.swing&&D>=0&&!e.wield&&(e.swing=0),[e.wield,e.railed,e.rifled,e.fists,e.sided]=[D==1,D==2,D==3,re,D==4],D==4&&(Bn(e),zn=!0);let oe=h&&D==0;if(!i)return[e.charge,e.reload]=[o.xeno?e.charge:0,0],0;let[se,le,ue,de]=D==3?[`clip`,o.clip,e.rifle,96]:D==2?[`cap`,o.cap,e.rail,90]:[`mag`,D==4?15:o.mag,e.ammo,78],[fe,pe]=[e[se]??0,Math.min(le,ue)];e.reload?--e.reload||(e[se]=pe):D>=0&&D!=1&&(!h||D!=2)&&!b&&fe<pe&&(!fe||t.keys&N.RELOAD)&&([e.reload,e.charge]=[de,0]);let me=D<0,M=o.xeno?Pn(e,O):me?m[e.cut??0]??m[0]:Pn(e);if(e.swing&&M.ticks-e.swing===M.strike)return 2;if(o.xeno)return Wn(e,t,d,b),0;(me||e.wield&&!T||e.railed||e.rifled||b||e.reload||!e.wield&&!e.mag)&&(e.charge=0);let ge=!(D!=0&&D!=4||oe||b||e.reload||e.charge||!e.mag);if(e.burst=ge?e.burst??0:0,ge&&!e.cool&&(e.burst||t.keys&N.SPECIAL))return e.burst=(e.burst||3)-1,e.power=1,e.ammo--,e.mag--,e.shots=e.shots+1&255,e.cool=e.burst?Math.ceil(o.cool/2):Math.min(15,2*o.cool),1;if(e.railed&&!h&&t.keys&N.SPECIAL&&!b&&!e.reload&&!e.hot&&e.cap>=y)return e.rail-=y,e.cap-=y,[e.heat,e.hot]=[120,!0],e.shots=e.shots+1&255,7;if(e.rifled&&t.keys&N.SPECIAL&&!b&&e.nades&&!e.lob)return e.nades--,[e.lob,e.cool]=[60,7],e.shots=e.shots+1&255,5;if(e.wield&&t.keys&N.SPECIAL&&!b&&!e.swing)return e.cut=t.keys&N.FIRE?Nn(t.keys,!o.hunter)+4:(t.keys&(N.LEFT|N.RIGHT))===N.LEFT?k.ARC_L:k.ARC_R,[e.swing,e.charge]=[j[e.cut].ticks,0],Ln(e),0;if(t.keys&N.FIRE&&!b){if(me)e.swing?d&&e.cut<he.HOOK&&M.ticks-e.swing>M.strike&&(e.cut++,e.swing=m[e.cut].ticks):(e.cut=(e=>e.mode===A.SLIDE||e.dash>50)(e)||e.mode===A.GROUND&&t.keys&N.SPRINT&&e.vx*e.vx+e.vz*e.vz>o.run*o.run?he.LUNGE:he.JAB,[e.heavy,e.swing]=[!1,m[e.cut].ticks]);else if(e.wield&&!e.swing)e.cut=Nn(t.keys,!o.hunter),[e.swing,e.charge]=[j[e.cut].ticks,0],Ln(e);else if(e.rifled&&h){if(!e.clip)return e.clip=120,e.shots=e.shots+1&255,6}else if(e.rifled){if(!e.cool&&e.clip&&!e.reload)return e.rifle--,e.clip--,e.cool=o.rifleCool,e.shots=e.shots+1&255,4}else if(e.railed&&h){if(!e.cool&&e.cap)return e.cool=15,e.cap--,e.rail=90,e.shots=e.shots+1&255,3}else if(e.railed){if(e.cap&&!e.reload&&!e.hot)return e.heat=(e.heat??0)+1,e.hot=e.heat>=120,e.cool||=(e.rail--,e.cap--,2),e.zapping=!0,3}else if(!e.wield&&!e.cool&&e.mag&&!e.reload){if(oe)return e.power=1,e.ammo--,e.mag--,e.charge=0,e.cool=o.cool,e.shots=e.shots+1&255,1;e.charge=Math.min((e.charge??0)+1,60)}}else if(e.charge)return e.power=Math.min(Jn(e.charge),e.mag),e.charge=0,e.ammo-=e.power,e.mag-=e.power,e.shots=e.shots+1&255,e.cool=o.cool,1;return 0},Hn=[1.2,.7],Un=(e,t,n,r)=>{let[i,a,o,s]=[Math.cos(n),Math.sin(n),Math.cos(t),Math.sin(t)],c=[0,1,2].map(t=>r[t]-e[t]),l=-c[0]*s*i+c[1]*a-c[2]*o*i,u=c[0]*o-c[2]*s,d=c[0]*s*a+c[1]*i+c[2]*o*a;return l>0&&Math.abs(u)<Hn[0]*l&&Math.abs(d)<Hn[1]*l},Wn=(e,t,n,r)=>{if(r)return;let i=O[e.cut??0],a=e.cut===he.CLAW_L||e.cut===he.CLAW_R,o=!!(t.keys&N.BLADE),s=i.ticks-(e.swing??0),c=o&&!!(t.keys&N.SPECIAL)&&!!e.swing&&!a&&!e.heavy&&(e.cut??0)<4&&s<i.strike;if(o&&(!e.swing&&!e.charge||c)){let n=Nn(t.keys);e.cut=t.keys&N.SPECIAL?n===k.LEFT||n===k.RIGHT?ie.SPIN:ie.LEAP:n;let r=!(t.keys&N.DASH);[e.heavy,e.swing,e.charge]=r?[!1,O[e.cut].ticks-O[e.cut].hold,1]:[!1,O[e.cut].ticks,0]}else t.keys&N.FIRE&&(!e.swing||n&&a&&i.ticks-e.swing>i.strike)&&(e.cut=e.cut===he.CLAW_L?he.CLAW_R:he.CLAW_L,[e.heavy,e.swing]=[!1,O[e.cut].ticks])},Gn=(e,t)=>{if(e.exec)return qn(e);let n=!!(t.keys&N.FIRE);return e.pushes=(e.pushes??0)+ +(n&&!e.pressed)&255,e.pressed=n,e.away=t.keys&(N.LEFT|N.RIGHT|N.BACK)?Math.min((e.away??0)+1,24):0,e.lock=Math.max(1,e.lock-1),[e.wield,e.swing,e.charge]=[!!e.blade,0,0],0},Kn=e=>!!e.lock&&!e.exec,qn=e=>{e.lock=Math.max(1,e.lock-1),e.away=e.pushes=0;let t=Ie.TICKS-e.lock,n=Ie.CUTS.indexOf(t),r=e.exec===Ie.KILLER&&!!e.wield;return e.cut=r&&n>=0?[k.THRUST,k.SLASH][n]:e.cut,e.swing=r&&n>=0?j[e.cut].ticks:Math.max(0,(e.swing??0)-1),[e.wield,e.charge,e.heavy]=[r,0,!1],0},Jn=e=>e<10?1:1+Math.floor(4*(e-10)/50),Yn=(e,t=0,n=!1)=>{let[r,i]=e.rifled?(a=e.shots,[f*Math.sin(2.4*a),f*Math.cos(1.7*a)]):[0,0];var a;let[o,s]=[e.yaw+r,e.pitch+i],[c,l,u,d]=[Math.sin(o),Math.cos(o),Math.sin(s),Math.cos(s)];return{id:e.shots,by:e.id,team:t,x:e.x,y:e.y+ke(e),z:e.z,dx:-c*d,dy:u,dz:-l*d,left:e.rifled?60:n?90:80,burst:!1,power:e.rifled?0:n?8:e.power??1}},Xn=(e,t=0)=>({...Yn({...e,rifled:!1},t),power:9,left:28}),Zn=(e,t=0)=>({...Yn(e,t),id:128^e.shots,left:Ee,power:1,arc:e.cut}),Qn=e=>e.arc?be:e.power===9||e.power===10?52:e.power===8?600:e.power===6?120:e.power===0?400:80,$n=(e,t,n,r,i)=>{let[a,o]=[e[0]-n.x,e[2]-n.z],s=t[0]*t[0]+t[2]*t[2],c=a*t[0]+o*t[2],l=c*c-s*(a*a+o*o-r*r),[u,d]=[0,1/0];if(s>1e-12){if(l<0)return 1/0;[u,d]=[(-c-Math.sqrt(l))/s,(-c+Math.sqrt(l))/s]}else if(a*a+o*o>r*r)return 1/0;let[f,p]=[n.y-e[1],n.y+i-e[1]];if(t[1])[u,d]=[Math.max(u,Math.min(f/t[1],p/t[1])),Math.min(d,Math.max(f/t[1],p/t[1]))];else if(f>0||p<0)return 1/0;return u<=d&&d>=0?Math.max(u,0):1/0},er=(e,t=0)=>({...Yn({...e,rifled:!1},t),left:150,power:7,v:36}),tr=e=>!e.wield&&(e.lob??0)>53,nr=(e,t,n)=>{let r=Math.fround,[i,a,o]=[t.dx*t.v,t.dy*t.v-(t.missile?0:me(e))/60,t.dz*t.v],s=Math.sqrt(i*i+a*a+o*o)||1;[t.dx,t.dy,t.dz,t.v]=[r(i/s),r(a/s),r(o/s),r(s)];let l=((e,t,n,r)=>{let i=[t.x,t.y,t.z],a=[t.dx,t.dy,t.dz],o=Math.min(n,t.left),s=t.power===9||t.power===10,l=s?se:t.power===8?c:Le,u=e.def.seam!==void 0&&a[1]?(e.def.seam-i[1])/a[1]:1/0,d,f=te(e,i,a,u>1e-6?Math.min(o,u):o,l);for(let e of r){let n=$n(i,a,e,ne+(t.arc?fe:s?je:l),De(e));n<f&&([f,d]=[n,e])}return t.burst=f<o,t.left-=f,[t.x,t.y,t.z]=[i[0]+a[0]*f,i[1]+a[1]*f,i[2]+a[2]*f],d})(e,t,t.v/60,n);return[t.x,t.y,t.z,t.left]=[r(t.x),r(t.y),r(t.z),r(t.left)],t.burst||=t.left<=0,l},Z={A:1.25,B:1,WR:.5,L0:.6,CMAX:.5,K:30,D:2,KP2:1.2,KR2:.7,HC:.7,ENGINE:12,VMAX:23.2,VREV:8,BRAKE:14,ROLL:.6,HB:6,BOOST:10,VBOOST:34,MU:1.1,MUL:1.2,HBG:.35,HBY:1.5,SK:2.5,SV:10,SMAX:.55,SRATE:3.5,YMAX:2.4,YRESP:10,AK:5,AC:3,AD:.5,TILT:.9,RB:1.05,BODY:[1.15,0,-1.15],BODY_H:1.5,WHEEL_STEP:.6,BOUNCE:.3,CRASH:10,CRASH_HP:3,ENTER_R:3,SPLAT_MIN:6,SPLAT_KILL:12,GUN_COOL:8,GUN_RANGE:90,GUN_AIM:50},rr=[[-1.05,.18,.6],[1.05,.18,.6]],ir=[[-.45,-.35,.1],[.45,-.35,.1]],ar=[1,1,-1,-1].map(e=>e*Z.A),or=[-1,1,-1,1].map(e=>e*Z.B),sr=Z.L0+Z.WR,cr=Z.RB+ne+.15,lr=`x y z vx vy vz yaw pitch roll wy wp wr steer`.split(` `),Q=1/60,ur=Math.fround,{sin:dr,cos:fr,min:pr,max:mr,abs:hr,sqrt:gr}=Math,$=(e,t,n)=>pr(mr(e,t),n),_r=(e,t,n,r=0)=>{let[i,a]=Ae(e.yaw),[o,s]=[t*fr(e.pitch),n*fr(e.roll)];return[e.x+i*o-a*s,e.y+r+t*dr(e.pitch)-n*dr(e.roll),e.z+a*o+i*s]},vr=(e,t)=>ar.map((n,r)=>{let[i,a,o]=_r(e,n,or[r]);return[i,a,o,sr+le(t,i,o,a-Z.L0+Z.WHEEL_STEP)-a]}),yr=(e,t)=>vr(e,t).map(([e,t,n,r])=>{let i=$(r,0,Z.CMAX);return[e,t-Z.L0+i,n,i]}),br=e=>Z.BODY.map(t=>_r(e,t,0,-sr)),xr=e=>{if(e.ship)return Tn(e);let[t,,n]=br(e);return{a:t,b:n,r:Z.RB,h:Z.BODY_H}},Sr=e=>e.ship?(e=>[Tn(e),...En(e)])(e):[xr(e)],Cr=e=>{e.ship||([e.vx,e.vz]=[ur(e.vx*Se.SKID),ur(e.vz*Se.SKID)])},wr=(e,t)=>e.filter(e=>!(t.down&&e.wreck)).flatMap(Sr),Tr=e=>[...Er(e),...wn(e.def.ships)],Er=e=>(e.def.rovers??[]).map(([e,t,n,r])=>({x:ur(e),y:ur(t+sr),z:ur(n),vx:0,vy:0,vz:0,yaw:ur(M(r)),pitch:0,roll:0,wy:0,wp:0,wr:0,steer:0,driver:255,rider:255,hp:Se.HP,wreck:0})),Dr=(e,t)=>{let[n,r]=[e.def.rovers?.length??0,e.def.ships?.length??0];return t<n?+(2*t>=n):+(2*(t-n)>=r)},Or=(e,t,n,r)=>{if(e.ship)return((e,t,n,r)=>{let i=((e,t,n)=>{let[r,i]=[jn(e,t),jn(e,n,!1)],a=1/0;for(let e of Mn){let[t,n]=[0,1/0];for(let a=0;a<3&&t<=n;a++){let[o,s]=e[a];if(vn(i[a])<1e-9){(r[a]<o||r[a]>s)&&(t=1/0);continue}let[c,l]=[(o-r[a])/i[a],(s-r[a])/i[a]];t=Y(t,J(c,l)),n=J(n,Y(c,l))}t<=n&&t<a&&(a=t)}return a})(e,t,n);for(let a of K.HITS){let o=X(e,0,0,a),[s,c,l]=[t[0]-o[0],t[1]-o[1],t[2]-o[2]],u=s*n[0]+c*n[1]+l*n[2],d=u*u-(s*s+c*c+l*l-K.HIT*K.HIT);if(d<0)continue;let f=Y(0,-u-yn(d));f<=r&&f<i&&(i=f)}return i<=r?i:1/0})(e,t,n,r);let i=pr(...br(e).map(([e,r,i])=>$n(t,n,{x:e,y:r,z:i},Z.RB,Z.BODY_H)));return i<=r?i:1/0},kr=(e,t,n,r=[],i)=>{if(e.ship)return((e,t,n,r=[],i)=>{let a=t?t.keys:0,o=e=>a&e?1:0,s=o(N.FORWARD)-o(N.BACK),c=o(N.RIGHT)-o(N.LEFT),l=o(N.JUMP)-o(N.CROUCH),u=o(N.SPRINT)&&s>0?K.BOOST:1,d=e.steer<0;if(t){let n=M(t.yaw-e.yaw+Math.PI)-Math.PI,r=bn(t.pitch,d?0:-K.PMAX,K.PMAX),i=J(1,K.RESP*q);e.wy+=(bn(K.TURN*n,-K.YRATE,K.YRATE)-e.wy)*i,e.wp+=(bn(K.TURN*(r-e.pitch),-K.PRATE,K.PRATE)-e.wp)*i}else e.wy*=1-J(1,K.RESP*q),e.wp=d?-K.TURN*e.pitch:e.wp*(1-J(1,K.RESP*q));e.wr=((d?0:bn(-K.BANK*e.wy+K.SLIDE*c,-K.RMAX,K.RMAX))-e.roll)*K.RRESP;let[f,p,m,h]=[gn(e.yaw),_n(e.yaw),gn(e.pitch),_n(e.pitch)],g=t?[-f*h*s*K.ACC*u+p*c*K.STRAFE,m*s*K.ACC*u+l*K.LIFT,-p*h*s*K.ACC*u-f*c*K.STRAFE]:[0,-me(n),0],_=e.y-K.CEIL;g[1]>0&&(g[1]*=bn(-_/K.WARN,0,1)),_>0&&(g[1]-=K.PUSH*_,e.vy>0&&(e.vy*=1-J(1,K.BRAKE*q)));let v=kn(e,n);if(v){let[t,n,r,i]=v,a=g[0]*r+g[2]*i,o=t-n;if(a>0){let e=1-bn(-o/K.WARN,0,1);g[0]-=a*r*e,g[2]-=a*i*e}if(o>0){g[0]-=K.PUSH*o*r,g[2]-=K.PUSH*o*i;let t=e.vx*r+e.vz*i;if(t>0){let n=t*J(1,K.BRAKE*q);e.vx-=n*r,e.vz-=n*i}}}let y=t?K.ACC/K.VMAX:K.DRIFT,b=y+(!t||s||c?0:K.HOLD),x=y+(!t||s||l?0:K.HOVER);if(e.vx+=(g[0]-e.vx*b)*q,e.vy+=(g[1]-e.vy*x)*q,e.vz+=(g[2]-e.vz*b)*q,d){let t=1-J(1,K.SKID*q);e.vx*=s||c?1:t,e.vz*=s||c?1:t}if(e.x+=e.vx*q,e.y+=e.vy*q,e.z+=e.vz*q,e.yaw=M(e.yaw+e.wy*q),e.pitch=bn(e.pitch+e.wp*q,-K.PMAX,K.PMAX),e.roll+=e.wr*q,e.y=J(e.y,K.CEIL+K.OVER),v){let[t,r,i,a]=kn(e,n);t>r+K.OVER&&(e.x-=i*(t-r-K.OVER),e.z-=a*(t-r-K.OVER))}let S=[e.vx,e.vy,e.vz],C=0;for(let t of K.BODY){let[r,i,a]=X(e,0,-K.DROP,t);C=Y(C,le(n,r,a,i+.6)-i)}e.steer=0,C>0&&(e.y+=C,e.vy=Y(e.vy,0),e.steer=e.vy>.5?0:-1);let w=0;for(let t of[-1,1])for(let[r,i]of fn){let[,a,o,,s]=rn(r),[c,l,u]=X(e,t*r,s,i<0?o:i>0?a:(a+o)/2);w=Y(w,le(n,c,u,l+1)-l)}w>0&&(e.y+=w,e.vy=Y(e.vy,0));for(let t of K.BODY){let[r,i,a]=X(e,0,-K.DROP,t),o=An(n,r,a,i+.6,i+K.H);o<i+K.H&&(e.y-=i+K.H-o,e.vy=J(e.vy,0))}for(let t of K.BODY){let[r,i,a]=X(e,0,-K.DROP,t),[o,s]=Me({x:r,y:i+.6,z:a},n,K.H-.6,K.R),c=o*o+s*s;if(c){e.x+=o,e.z+=s;let t=J(0,e.vx*o+e.vz*s)/c;e.vx-=t*o,e.vz-=t*s}}for(let t of[-1,1]){let[,r,i,,a]=rn(ln),[o,s,c]=X(e,t*ln,a,(r+i)/2),[l,u]=Me({x:o,y:s,z:c},n,cn,un),d=l*l+u*u;if(d){e.x+=l,e.z+=u;let t=J(0,e.vx*l+e.vz*u)/d;e.vx-=t*l,e.vz-=t*u}}if(r.length){let[,t,n,,i]=rn(ln),a=[...K.BODY.map(e=>[0,-K.DROP,e,K.R,K.H]),[-5.6,i,(t+n)/2,un,cn],[ln,i,(t+n)/2,un,cn]];for(let t of r)if(ge(t,e.x,e.z,dn+t.r))for(let[n,r,i,o,s]of a){let[a,c,l]=X(e,n,r,i),u=o+t.r;if(!ge(t,a,l,u))continue;let[d,f,p]=ue(t,a,l),m=yn(d*d+f*f);if(m>=u-1e-4||p>=c+s||p+t.h<=c)continue;let[h,g]=m?[d/m,f/m]:[_n(e.yaw),-gn(e.yaw)];e.x+=h*(u-m),e.z+=g*(u-m);let _=J(0,e.vx*h+e.vz*g)*(1+K.BOUNCE);e.vx-=_*h,e.vz-=_*g}}ae(e,n);let T=yn((e.vx-S[0])**2+((e.vy-S[1])/2)**2+(e.vz-S[2])**2);i&&T>K.CRASH&&i(T),vn(e.roll)<1e-6&&(e.roll=0);for(let t of xn)e[t]=hn(e[t]);return e.y<n.def.floor})(e,t,n,r.filter(t=>t!==e).flatMap(Sr),i);let{A:a,B:o,CMAX:s,K:c,D:l,KP2:u,KR2:d,HC:f,MU:p,MUL:m,TILT:h}=Z,g=me(n),_=t?t.keys:0,v=(_&N.FORWARD?1:0)-(_&N.BACK?1:0),y=_&N.JUMP,b=v>0&&_&N.SPRINT,[x,S]=Ae(e.yaw),[C,w]=[fr(e.pitch),fr(e.roll)],T=vr(e,n),[E,ee,te,ne]=T.map(([,e,,t])=>t+e-sr),re=T.some(e=>e[3]<-s),ie=re?0:(E+ee-te-ne)/(4*a*C),D=re?0:(ee+ne-E-te)/(4*o*w),O=1/gr(ie*ie+D*D+1),oe=-(ie*x-D*S)*O,se=-(ie*S+D*x)*O,ce=()=>e.vx*oe+e.vy*O+e.vz*se,k=mr(0,...T.map(e=>e[3]-s));if(k){e.y+=k;let t=pr(0,ce());e.vx-=t*oe,e.vy-=t*O,e.vz-=t*se}let A=ce(),[de,fe,pe]=[0,0,0];T.forEach(([,,,t],n)=>{if(t>k){let r=mr(0,c*(t-k)-l*(A+(ar[n]*C*e.wp-or[n]*w*e.wr)*O));de+=r,fe+=r*ar[n],pe+=r*or[n]}}),e.vx+=de*oe*Q,e.vy+=(de*O-g)*Q,e.vz+=de*se*Q,e.wp+=fe/u*Q,e.wr-=pe/d*Q;let j=pr(de/g,2);if(j>0){let n=e.vx*x+e.vz*S,r=e.vz*x-e.vx*S,i=t?M(t.yaw-e.yaw+Math.PI)-Math.PI:0,o=$(Z.SK*i/(1+hr(n)/Z.SV),-Z.SMAX,Z.SMAX),s=Z.SRATE*Q;e.steer+=$((n+v<0?-o:o)-e.steer,-s,s);let c=$(n*e.steer/(2*a),-Z.YMAX,Z.YMAX)*(y?Z.HBY:1);e.wy+=(c-e.wy)*Z.YRESP*Q*pr(1,j);let l=g*j*Q,h=$((v*n<0?v*Z.BRAKE:v*Z.ENGINE*mr(0,1-hr(n)/(v>0?Z.VMAX:Z.VREV)))*Q,-m*l,m*l);b&&(h+=Z.BOOST*$(1-n/Z.VBOOST,0,1)*Q);let _=(Z.ROLL+(y||!t?Z.HB:0))*j*Q;h-=$(n+h,-_,_);let C=p*l*(y?Z.HBG:1),w=-$(r,-C,C);e.vx+=h*x-w*S,e.vz+=h*S+w*x,e.wp+=h*f/u,e.wr-=w*f/d}else e.wp-=(Z.AK*e.pitch+Z.AC*e.wp)*Q,e.wr-=(Z.AK*e.roll+Z.AC*e.wr)*Q;e.wp*=1-Z.AD*Q,e.wr*=1-Z.AD*Q,e.x+=e.vx*Q,e.y+=e.vy*Q,e.z+=e.vz*Q,e.yaw=M(e.yaw+e.wy*Q),e.pitch=$(e.pitch+e.wp*Q,-h,h),e.roll=$(e.roll+e.wr*Q,-h,h),hr(e.pitch)===h&&e.pitch*e.wp>0&&(e.wp=0),hr(e.roll)===h&&e.roll*e.wr>0&&(e.wr=0);let[he,_e]=[e.vx,e.vz];for(let t of Z.BODY){let[r,i,a]=_r(e,t,0,-sr),[o,s]=Me({x:r,y:mr(i,E,ee,te,ne),z:a},n,Z.BODY_H,Z.RB),c=o*o+s*s;if(c){e.x+=o,e.z+=s;let t=pr(0,e.vx*o+e.vz*s)/c;e.vx-=t*o,e.vz-=t*s}}for(let t of r)if(t!==e)for(let n of Sr(t))for(let r of Z.BODY){let[i,a,o]=_r(e,r,0,-sr),s=Z.RB+n.r;if(!ge(n,i,o,s))continue;let[c,l,u]=ue(n,i,o),d=gr(c*c+l*l);if(d>=s-1e-4||u>=a+Z.BODY_H||u+n.h<=a)continue;let[f,p]=Ae(t.yaw),[m,h]=d?[c/d,l/d]:[-p,f];e.x+=m*(s-d),e.z+=h*(s-d);let g=pr(0,e.vx*m+e.vz*h)*(1+Z.BOUNCE);e.vx-=g*m,e.vz-=g*h}ae(e,n);let ve=gr((e.vx-he)**2+(e.vz-_e)**2);i&&ve>Z.CRASH&&i(ve);for(let t of lr)e[t]=ur(e[t]);return e.y<n.def.floor},Ar=(e,t,n)=>{let[r,i,a]=t.ship?pn:ir[n];[e.x,e.y,e.z]=(t.ship?X(t,r,i,a):_r(t,a,r,i)).map(ur),e.vx=t.vx,e.vy=t.vy,e.vz=t.vz},jr=(e,t,n,r,i,o=[],s)=>{let c=(n.keys&N.USE)!==0&&(e.held&N.USE)===0,l=kr(t,n,r,o,s);return Rn(e,n,r,i,!1),e.mode===A.RIDE?(Ar(e,t,0),c&&((e,t,n,r)=>{t.driver=255,e.mode=A.AIR,e.t=0,e.coyote=0,[e.vx,e.vy,e.vz]=[t.vx,t.vy,t.vz];let i=t.ship?-mn:-cr,[o,s]=t.ship?[K.DROP,K.H]:[sr,Z.BODY_H];for(let[n,c]of[[i,-o],[-i,-o],[0,s-o]]){let i=t.ship?pn[2]:ir[0][2],[o,s,l]=t.ship?X(t,n,c,i):_r(t,i,n,c);Object.assign(e,{x:o,y:s,z:l}),ae(e,r);let u=le(r,e.x,e.z,t.y);e.y=mr(s,u);let[d,f]=Me(e,r,a,ne);if(!n||u>s-1&&!d&&!f)break}[e.x,e.y,e.z,e.vx,e.vz]=[e.x,e.y,e.z,e.vx,e.vz].map(ur)})(e,t,0,r)):t.driver=255,l},Mr=(e,t)=>(e.x-t.x)**2+(e.z-t.z)**2,Nr=(e,t)=>{let[n,r]=e.ship?[K.ENTER_R,K.ENTER_H]:[Z.ENTER_R,Z.ENTER_R];return!e.wreck&&Math.abs(e.y-t.y)<=r&&Mr(e,t)<=n*n},Pr=(e,t)=>e.driver!==255||t?e.rider!==255||e.ship?-1:1:0,Fr=(e,t,n,r)=>{let[i,a,o,s]=[Math.sin(t),Math.cos(t),Math.sin(n),Math.cos(n)],c=[-i*s,o,-a*s],l=e.ship?K.GUN_RANGE:Z.GUN_RANGE,u=r?r([e.x,e.y,e.z],c,l):1/0,d=u<l?mr(u,8):(e=>e.ship?K.GUN_AIM:Z.GUN_AIM)(e);return[e.x+c[0]*d,e.y+c[1]*d,e.z+c[2]*d]},{A:Ir,B:Lr,WR:Rr,L0:zr}=Z,Br=[[Ir,-Lr],[Ir,Lr],[-Ir,-Lr],[-Ir,Lr]],Vr=[.74,.75,.78],Hr=[.5,.52,.56],Ur=[.24,.25,.28],Wr=[.09,.095,.11],Gr=[.9,.62,.17,u],Kr=[.4,.41,.44],qr=[1,.95,.8],Jr=[1,.1,.06],Yr=[.3,.8,1],Xr=Rr-.025,Zr=Rr+.025,Qr=.15,$r=Rr+.1,ei=Lr-.2,ti=[.46,.42],ni=.42,ri=[.5,-.2,2.1],ii=[-.45,.3,.6],ai=2.5,oi=(e,t,n)=>[e,t,-n],si=(e,[t,n,r,i],a,o)=>{let[s,c]=[w(n,t),w(r,t)],l=d([s[1]*c[2]-s[2]*c[1],s[2]*c[0]-s[0]*c[2],s[0]*c[1]-s[1]*c[0]],o)<0,u=e.length;Te(e,t,l?r:n,l?n:r,a),i&&Te(e,t,l?i:r,l?r:i,a);for(let t=u+8;a[3]&&t<e.length;t+=10)e[t]=a[3]},ci=(e,t,n,r,a,o)=>{let s=[...t,...n],c=s.reduce(i).map(e=>e/s.length),l=(t,n)=>si(e,t,n,w(Oe(t[0],t[2],.5),c));t.forEach((e,i)=>{let a=(i+1)%t.length;l([e,t[a],n[a],n[i]],r[i%r.length])}),a&&l(t,a),o&&l(n,o)},li=(e,t,n,r,i)=>[oi(-t,n,e),oi(t,n,e),oi(r,i,e),oi(-r,i,e)],ui=e=>v(re([[1,0],[1,1]],e),[1,1,1]),di=ui(3),fi=ui(4),pi=(e,t,n,r,i,a)=>{let o=w(r,n);D(e,t,n,r,Math.abs(o[1])>Math.abs(o[0])?[1,0,0]:[0,1,0],1,i,a)},mi=-1.09,hi=[16,48,120,280,600,1100],[gi,_i]=[.08,-40],[vi,yi]=[[.64,.59,.48],[.3,.25,.15]],bi=[.1,.2,.12],xi=(e,t,n)=>Math.min(Math.max(e,t),n),Si=v(re([[0,-1],[1,0],[0,1]],4),[1,1,1]),[Ci,wi]=[72,17],Ti=/* @__PURE__ */ new WeakMap,Ei=t=>{let r=Ti.get(t);if(r)return r;let i=t.relief&&de(t.relief),[a,o,s,c,l]=i?[i.x0,i.z0,i.cell,i.nx,i.nz]:[I.sea,0,10,(I.east-I.sea)/10+1,26],u=hi.length,d=(e,t)=>[...hi.map(t=>e-t).reverse(),...Array.from({length:t},(t,n)=>e+n*s),...hi.map(n=>e+(t-1)*s+n)],[f,m]=[d(a,c),d(o,l)],[h,g]=[f.length,m.length],v=new Float64Array(h*g);for(let e=0;e<g;e++)for(let t=0;t<h;t++){let[n,r]=[xi(t-u,0,c-1),xi(e-u,0,l-1)],o=i?i.h[n+r*c]:I.water+.1*(a+n*s-I.shore);v[t+e*h]=Math.max(o-gi*Math.max(a-f[t],0),_i)}let y=(e,t)=>v[xi(e,0,h-1)+xi(t,0,g-1)*h],b=[],x=[];for(let t=0;t<g;t++)for(let r=0;r<h;r++){let[a,o,s]=[f[r],m[t],y(r,t)],[c,l]=[Math.max(r-1,0),Math.min(r+1,h-1)],[u,d]=[Math.max(t-1,0),Math.min(t+1,g-1)],p=i?e([(y(c,t)-y(l,t))/(f[l]-f[c]),1,(y(r,u)-y(r,d))/(m[d]-m[u])]):[0,1,0],_=.92+.16*n(a/11,o/11,5),v=xi((a-I.trees-2)/14,0,1),S=vi.map((e,t)=>(e+(yi[t]-e)*v)*_);b.push([a,i?s:I.water-.02,o,...p,S[0],S[1],-1.09,S[2]]),x.push([a,I.water+.05,o,0,1,0,I.water+.05-s,0,-5,0])}let S=[[],[]],C=i?.hole??[0,0,0,0];for(let e=0;e<g-1;e++)for(let t=0;t<h-1;t++){let[n,r,i,a]=[t+e*h,t+1+e*h,t+1+(e+1)*h,t+(e+1)*h];f[t]>=C[0]&&f[t+1]<=C[2]&&m[e]>=C[1]&&m[e+1]<=C[3]||S[0].push(...b[n],...b[i],...b[r],...b[n],...b[a],...b[i]),Math.min(v[n],v[r],v[i],v[a])<I.water+.05&&S[1].push(...x[n],...x[i],...x[r],...x[n],...x[a],...x[i])}if((e=>{let[t,r,i,a]=[28,I.sea-840,125,560],o=e=>{let r=e/t;return 70*(4*r*(1-r))**.7*(.45+.75*n(5*r,3,9))},s=(e,n)=>[r-60*n,n?o(e):I.water-1,i+(e/t-.5)*a,.6,.8,0,bi[0],bi[1],-1,bi[2]];for(let n=0;n<t;n++)e.push(...s(n,0),...s(n+1,0),...s(n+1,1),...s(n,0),...s(n+1,1),...s(n,1))})(S[0]),i){let e={relief:i};((e,t)=>{let[n,r]=[I.shore+4,L.sections[2][1]];for(let i=0;i<Ci;i++){let a=e=>E(i,e,31),[o,s]=[n+(r-n)*a(1),3+(wi-3)*a(2)*a(2)];if(s<L.r+1.5&&L.sections.some(([e,t])=>o>e&&o<t))continue;let[c,l,u]=[125+(a(3)<.5?s:-s),.12+.3*a(4)*a(4),.03+.04*a(5)];_(e,Si,[o,t(o,c)+.2*l,c],p(7*a(5),0),[0,0,0],[l*(.6+a(6)),.7*l,l],[u,u,u])}})(S[0],(t,n)=>oe(e,t,n))}return Ti.set(t,S),S},Di=e=>Ei(e)[0],Oi=e=>Ei(e)[1],ki=`0.05+0.05*sin(T*.55+q.y*.13+4.*vn(q*.05))`,Ai=`if(d.y>0.){vec2 q=d.xz/(d.y+.1)*2.+T*.003;float f=vn(q)+.5*vn(q*2.3+5.)+.25*vn(q*5.1);
2
+ f=smoothstep(1.05,1.4,f)*smoothstep(0.,.05,d.y)*(1.-smoothstep(.12,.4,d.y));
3
+ s=mix(s,vec3(1.22,1.2,1.17)*(.8+.3*max(dot(d,O),0.)),f*.9);}`,ji=e=>`{vec2 q=P.xz;float d=C.x-(${ki});if(d<0.)discard;\nfloat ds=length(P-E),pf=length(fwidth(q)),fz=${e},fo;vec3 V=(E-P)/ds;\nvec2 w=q+1.5*vn(q*.09+T*.04),gd=vec2(0);\nfor(int i=0;i<(ds<18.?7:5);i++){float k=.6*exp(.66*float(i)),a=(float(i)-2.)*.8;vec2 dr=vec2(cos(a),sin(a));\ngd+=dr*cos(k*dot(dr,w)-T*sqrt(k)*1.3+a*5.)*(1.-smoothstep(.15,.6,k*pf))*(i<5?.055:.04-.04*smoothstep(6.,18.,ds));}\ngd*=.35+.65*smoothstep(0.,.6,d);\nvec3 n=normalize(vec3(-gd.x,1,-gd.y));float fr=.02+.6*pow(clamp(1.-dot(n,V),0.,1.),5.);\nfloat fn=vn(q*1.7+vec2(T*.12,0))*vn(q*5.-vec2(T*.2,T*.07));\nfo=smoothstep(.03+.06*fn,0.,d)+smoothstep(.3,.55,fn+.3*sin(d*14.+T*.8+3.*vn(q*.3)))*(1.-smoothstep(.05,.4,d));\nfo=min(fo,1.)*(1.-smoothstep(.3,1.2,pf)*.5);\nvec3 tr=exp(-vec3(.42,.07,.055)*d*2.4);\nif(Z>1.5){o=vec4(tr*(1.-fr)*(1.-fo)*(1.-fz),1);return;}\nvec4 sq=W*vec4(P,1);sq.xyz=sq.xyz*.5+.5;\nfloat sv=mix(texture(D,vec4(sq.xy,0,sq.z-.0004)),1.,smoothstep(.8,1.,max(max(abs(sq.x-.5),abs(sq.y-.5)),abs(sq.z-.5))*2.));\nvec3 lw=e(X*max(O.y,0.)*sv+H[0]),r=reflect(-V,n);r.y=abs(r.y)+.25;r=normalize(r);\nvec3 sc=mix(vec3(.02,.42,.5),vec3(.004,.09,.3),1.-exp(-d*.18))*lw*(1.-tr.g*tr.g);\nvec3 c=(sc*(1.-fr)+(K1(r,0.)+sv*X*2.*pow(max(dot(n,nz(O+V)),0.),600.))*fr)*(1.-fo)+fo*.9*lw;\nc=mix(c,F.rgb,fz);if(Vn>0)c=hv(c);o=vec4(c,1);return;}`,Mi=[(L.sections[1][0]+L.sections[1][1])/2,L.sections[2][1]-2],Ni=`{vec2 q=P.xz;float y=P.y-${I.water}.,f1=1.-smoothstep(.3,1.,pw*9.),f2=1.-smoothstep(.3,1.,pw*2.5),f3=1.-smoothstep(.3,1.,pw*80.);\nbw=1.-smoothstep(.08,.3+.12*vn(q*.4),y);\nfloat rp=sin((dot(q,vec2(.95,.3))+1.2*vn(q*.3))*18.)*smoothstep(.3,.7,vn(q*.07+5.))*f1*(1.-.6*bw);\nfloat dr=dot(q,vec2(.27,.86))+2.5*vn(q*.04);\nh+=smoothstep(.4,1.6,y)*(.24*(sin(dr)+.35*sin(2.*dr))*smoothstep(.2,.7,vn(q*.025+7.))+.9*vn(q*.06))+.018*rp+f2*.04*(vn(q*2.2)-.5)+f1*.012*(vn(q*6.+3.)-.5)+(1.-smoothstep(.3,1.,pw*40.))*.006*(vn(q*28.)-.5);\nc*=(.88+.24*vn(q*.13+9.))*(1.+.05*rp+f3*.16*(vn(q*170.)-.5)+f1*.07*(vn(q*37.)-.5));\nc*=mix(vec3(1),vec3(.52,.47,.4),bw);\nif(y<0.){vec2 u=q*3.+vn(q*.8)*2.;float ca=vn(u+T*.3)-vn(u+7.-T*.25);c*=1.+.45*f2*pow(max(1.-abs(ca)*2.5,0.),6.)*smoothstep(0.,-.3,y);}\nfloat wl=0.05-(${ki});bw*=.35+.65*smoothstep(wl+.12,wl,y);float cz=abs(q.y-125.);if(cz<40.){\nfloat ht=max(max(1.-abs(q.x-${Mi[0]}.)/26.,1.-abs(q.x-${Mi[1]}.)/14.),0.),\nwd=cz/(1.+1.2*smoothstep(${Mi[1]-14}.,${Mi[1]+6}.,q.x))+6.*vn(vec2(q.x*.06,q.y*.15))+30.\n-30.*smoothstep(8.,20.,q.x)*(1.-smoothstep(${Mi[1]+8}.,${Mi[1]+26}.,q.x))-3.*ht;\nc*=mix(vec3(1),vec3(.13,.09,.07),(1.-smoothstep(18.,29.,wd))*(.7+.3*vn(q*.7)));\nif(wd<19.){vec2 u=q*2.5+2.*vn(q*.3),ic=floor(u),fc=fract(u);float d1=9.,d2=9.,id=0.;\nfor(int j=0;j<9;j++){vec2 g=vec2(j%3,j/3)-1.,o=ic+g,pt=g+vec2(h3(vec3(o,1)),h3(vec3(o,2)))-fc;float d=dot(pt,pt);\nif(d<d1){d2=d1;d1=d;id=h3(vec3(o,3));}else if(d<d2)d2=d;}\nfloat fk=1.-smoothstep(.3,1.,pw*8.),e=sqrt(d2)-sqrt(d1),fe=fk*min(19.-wd,1.),ck=mix(1.,smoothstep(0.,.1,e),fe),cb=mix(1.,smoothstep(0.,.25,e),fe),a=step(wd+1.5*id,18.),gl=a*smoothstep(.8,.86,vn(q*.3));\nh=cb*mix(h,.02+f2*.012*vn(q*5.),a)*(1.-gl);c*=.4+.6*ck;\nc=mix(c,vec3(1,.94,.88)*(.03+.05*id+.2*ck*vn(q*2.5)*vn(q*9.))*ck*(1.-.7*gl)+vec3(2.,.4,.05)*(1.-ck)*fk*ht*step(.75,id)*smoothstep(9.,4.,cz),a);\nbw=mix(bw,gl,a);}}}`,Pi=`c+=bw*k*(.02+.3*fr);`,Fi=-1.05,Ii=.25,Li=`{vec2 q=vec2(P.x,abs(n.y)>.7?P.z:P.y*1.3)*.5,d=abs(fract(q)-.5);hk=smoothstep(.25,.55,C.x);
4
+ c*=1.-.4*hk*smoothstep(.006+pw,.006,min(d.x,d.y))*(1.-smoothstep(.02,.09,pw));if(dot(n,E-P)<0.){c*=.18;hk=0.;}}`,Ri=e=>`{float ds=length(P-E),fz=${e};vec3 V=(E-P)/ds,n=normalize(N)*sign(dot(N,V));float fr=.07+.8*pow(max(1.-abs(dot(n,V)),0.),4.);\nif(Z>1.5){o=vec4(vec3(.56,.7,.68)*(1.-fr)*(1.-fz),1);return;}\nvec3 c=(K1(reflect(-V,n),0.)+X*3.*pow(max(dot(n,nz(O+V)),0.),300.))*fr;c=mix(c,F.rgb,fz);if(Vn>0)c=hv(c);o=vec4(c,1);return;}`,zi=`c+=hk*(mix(vec3(.8,.72,.56),k,smoothstep(-.3,.05,r.y))*(.06+.35*fr)+vec3(.15,.135,.105)*clamp(.5-m.y,0.,1.));`,Bi=-1.098,Vi=`{bool rf=abs(n.y)>.5;vec2 q=rf?P.xz:vec2(P.x+P.z,P.y);float f=1.-smoothstep(.002,.008,pw),w=sin(q.x*785.)*sin(q.y*785.),te;\nif(rf)te=vn(q*.45+3.)+.35*vn(q*.9+17.)-.08*vn(q*6.)-.04*vn(q*19.)-.88;\nelse{float d=${5 .toFixed(3)}-P.y,l=.25+.5*vn(vec2(q.x*2.2,1.))+.12*vn(vec2(q.x*9.,2.))+.05*vn(vec2(q.x*31.,3.));te=max(d-l,(vn(vec2(q.x*7.,d*1.2))-.72)*smoothstep(l-.6,l,d))*2.;}\nif(te>0.)discard;\nh+=f*.004*w+.02*(vn(q*2.5)-.5);c*=(1.+.18*f*w)*(.78+.34*vn(q*1.3+4.))*mix(1.,.62,smoothstep(.5,.8,vn(q*.7+11.)))*mix(.45,1.,smoothstep(0.,.06,-te));}`;export{jr as $,ai as A,R as At,Zr as B,rt as Bt,Hr as C,$t as Ct,ni as D,X as Dt,ei as E,On as Et,Kr as F,L as Ft,Z as G,wt as Gt,Rr as H,nt as Ht,Yr as I,Kt as It,Pr as J,Fr as K,Ur as L,Je as Lt,Qr as M,Qe as Mt,qr as N,Dt as Nt,Wr as O,Qt as Ot,ri as P,I as Pt,Tr as Q,Jr as R,tt as Rt,Ir as S,K as St,Xr as T,Dn as Tt,ii as U,Tt as Ut,Vr as V,Ze as Vt,rr as W,qe as Wt,Dr as X,Mr as Y,Nr as Z,fi as _,In as _t,Li as a,$n as at,pi as b,pn as bt,Ni as c,er as ct,ji as d,nr as dt,Ar as et,Pi as f,Zn as ft,oi as g,Rn as gt,di as h,Kn as ht,Fi as i,yr as it,Gr as j,Ke as jt,$r as k,Zt as kt,mi as l,tr as lt,Di as m,Jn as mt,Ii as n,wr as nt,Bi as o,Xn as ot,Oi as p,Un as pt,kr as q,zi as r,Or as rt,Vi as s,Yn as st,Ri as t,Cr as tt,Ai as u,Qn as ut,ci as v,Fn as vt,Br as w,tn as wt,li as x,en as xt,si as y,Pn as yt,ti as z,Ye as zt};
package/dist/room.js CHANGED
@@ -1 +1 @@
1
- export { n as MAPS, r as RULES, t as Room } from "./assets/room-Dov6cUCN.js";
1
+ export { n as MAPS, r as RULES, t as Room } from "./assets/room-CVIx5hx8.js";
package/dist/server.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as Room } from "./assets/room-Dov6cUCN.js";
1
+ import { t as Room } from "./assets/room-CVIx5hx8.js";
2
2
  import { WebSocketServer } from "ws";
3
3
  // src/server/index.ts
4
4
  /** `/demo` → "demo", `/` → "default". Undecodable paths are kept as is. */
@@ -1 +1 @@
1
- import{$ as e,Q as t,dr as n,r}from"./brick-CfuEIQ9e.js";var i=e=>(e=Math.min(Math.max(e,0),1))*e*(3-2*e),a=[1,2,3,4,6].map(t=>{let n=(1+Math.sqrt(5))/2,r=[[-1,n,0],[1,n,0],[-1,-n,0],[1,-n,0],[0,-1,n],[0,1,n],[0,-1,-n],[0,1,-n],[n,0,-1],[n,0,1],[-n,0,-1],[-n,0,1]].map(t=>e(t));return[[0,11,5],[0,5,1],[0,1,7],[0,7,10],[0,10,11],[1,5,9],[5,11,4],[11,10,2],[10,7,6],[7,1,8],[3,9,4],[3,4,2],[3,2,6],[3,6,8],[3,8,9],[4,9,5],[2,4,11],[6,2,10],[8,6,7],[9,8,1]].map(e=>e.map(e=>r[e])).flatMap(([n,r,i])=>{let a=(a,o)=>e(n.map((e,n)=>e+((r[n]-e)*a+(i[n]-e)*o)/t)),o=[];for(let e=0;e<t;e++)for(let n=0;e+n<t;n++)o.push([a(e,n),a(e+1,n),a(e,n+1)]),e+n<t-1&&o.push([a(e+1,n),a(e+1,n+1),a(e,n+1)]);return o})}),o=(o,s,c,l,u,d,f,p)=>{let m=/* @__PURE__ */ new Map,h=(typeof s==`number`?a[s-1]:s).map(e=>e.map(e=>{let t=(e=>e.map(e=>Math.round(1e4*e)).join())(e),n=m.get(t);if(!n){let r=c(e);n={p:r,n:[0,0,0],low:!!p&&r[1]<p(r[0],r[2])-.05},m.set(t,n)}return n}));for(let e of h){let n=r(t(e[1].p,e[0].p),t(e[2].p,e[0].p));e.forEach(e=>e.n=[e.n[0]+n[0],e.n[1]+n[1],e.n[2]+n[2]])}for(let a of h){if(a.every(e=>e.low))continue;let s=r(t(a[1].p,a[0].p),t(a[2].p,a[0].p)),c=Math.abs(s[1])>Math.max(Math.abs(s[0]),Math.abs(s[2])),p=Math.abs(s[0])>Math.abs(s[2]);for(let{p:t,n:r}of a){let a=Math.hypot(...r)>1e-12?e(r):[0,1,0];o.push(...t,...a,...c?[t[0],t[2]]:p?[t[2]+3*d,t[1]]:[t[0]+3*d,t[1]],n.ROCK,.85*f*(.55+.45*i((t[1]-l)/(.3*(u-l)))))}}};export{o as t};
1
+ import{$ as e,Q as t,fr as n,r}from"./brick-BSIQdeSz.js";var i=e=>(e=Math.min(Math.max(e,0),1))*e*(3-2*e),a=[1,2,3,4,6].map(t=>{let n=(1+Math.sqrt(5))/2,r=[[-1,n,0],[1,n,0],[-1,-n,0],[1,-n,0],[0,-1,n],[0,1,n],[0,-1,-n],[0,1,-n],[n,0,-1],[n,0,1],[-n,0,-1],[-n,0,1]].map(t=>e(t));return[[0,11,5],[0,5,1],[0,1,7],[0,7,10],[0,10,11],[1,5,9],[5,11,4],[11,10,2],[10,7,6],[7,1,8],[3,9,4],[3,4,2],[3,2,6],[3,6,8],[3,8,9],[4,9,5],[2,4,11],[6,2,10],[8,6,7],[9,8,1]].map(e=>e.map(e=>r[e])).flatMap(([n,r,i])=>{let a=(a,o)=>e(n.map((e,n)=>e+((r[n]-e)*a+(i[n]-e)*o)/t)),o=[];for(let e=0;e<t;e++)for(let n=0;e+n<t;n++)o.push([a(e,n),a(e+1,n),a(e,n+1)]),e+n<t-1&&o.push([a(e+1,n),a(e+1,n+1),a(e,n+1)]);return o})}),o=(o,s,c,l,u,d,f,p)=>{let m=/* @__PURE__ */ new Map,h=(typeof s==`number`?a[s-1]:s).map(e=>e.map(e=>{let t=(e=>e.map(e=>Math.round(1e4*e)).join())(e),n=m.get(t);if(!n){let r=c(e);n={p:r,n:[0,0,0],low:!!p&&r[1]<p(r[0],r[2])-.05},m.set(t,n)}return n}));for(let e of h){let n=r(t(e[1].p,e[0].p),t(e[2].p,e[0].p));e.forEach(e=>e.n=[e.n[0]+n[0],e.n[1]+n[1],e.n[2]+n[2]])}for(let a of h){if(a.every(e=>e.low))continue;let s=r(t(a[1].p,a[0].p),t(a[2].p,a[0].p)),c=Math.abs(s[1])>Math.max(Math.abs(s[0]),Math.abs(s[2])),p=Math.abs(s[0])>Math.abs(s[2]);for(let{p:t,n:r}of a){let a=Math.hypot(...r)>1e-12?e(r):[0,1,0];o.push(...t,...a,...c?[t[0],t[2]]:p?[t[2]+3*d,t[1]]:[t[0]+3*d,t[1]],n.ROCK,.85*f*(.55+.45*i((t[1]-l)/(.3*(u-l)))))}}};export{o as t};
@@ -1 +1 @@
1
- import{dr as e}from"./brick-CfuEIQ9e.js";var t,n=Object.keys(e).length,r=(e,t,n)=>{let r=Math.imul(e,374761393)+Math.imul(t,668265263)+Math.imul(n,144665)|0;return r=Math.imul(r^r>>>13,1274126177),((r^r>>>16)>>>0)/4294967296},i=(e,t,n,i)=>{let[a,o]=[Math.floor(e),Math.floor(t)],[s,c]=[e-a,t-o].map(e=>e*e*(3-2*e)),l=(e,t)=>r((a+e)%n,(o+t)%n,i);return(l(0,0)*(1-s)+l(1,0)*s)*(1-c)+(l(0,1)*(1-s)+l(1,1)*s)*c},a=(e,t,n,r,a)=>{let[o,s]=[0,.5];for(let c=0;c<r;c++,s/=2)o+=s*i(e*(1<<c),t*(1<<c),n<<c,a+c);return o/(1-2*s)},o=(e,t,n)=>e.map((e,r)=>e+(t[r]-e)*n),s=(e,t)=>e.map(e=>e*t),c=e=>Math.min(Math.max(e,0),1),l=2*Math.PI,u=[];u[e.BRICK]=(e,t)=>{let n=Math.floor(8*t),a=4*e+.5*(1&n),[o,l,u]=[Math.floor(a)%4,a%1,8*t%1],d=i(16*e,16*t,16,5),f=.8+.4*d;return l<.05||u<.1?[s([165,160,150],.7+.3*f),.1+.1*d]:[s([170,78,56],(.8+.4*r(o,n,1))*f*(.85+.15*u)),.7+.2*d+.1*c(12*Math.min(l-.05,u-.1))]},u[e.TILE]=(e,t)=>{let[n,a]=[Math.floor(4*e),Math.floor(4*t)],[o,l]=[4*e%1,4*t%1],u=i(16*e,16*t,16,7),d=.9+.2*u;return o<.05||l<.05?[s([85,85,80],d),.1]:[s([196,190,172],d*(.88+.08*(n+a&1)+.1*r(n,a,2))),.8+.1*u+.1*c(14*(Math.min(o,l)-.05))]},u[e.LAVA]=(e,t)=>{let n=a(4*e,4*t,4,4,11),r=Math.max(0,1-7*Math.abs(n-.5))**2;return[o(o([55,8,4],[230,70,8],n),[255,215,90],r),.5]},u[e.STONE]=(e,t)=>{let n=a(8*e,8*t,8,4,3);return[s([128,124,120],.45+.7*(1.3*n+.1*r(Math.floor(128*e),Math.floor(128*t),4))),c(1.4*n-.2)]},u[e.METAL]=(e,t)=>{let[n,a,l,u]=[Math.floor(2*e),Math.floor(2*t),2*e%1,2*t%1],d=c(6*(i(8*e,8*t,8,13)-.68)),f=e=>.4*Math.min(Math.max(Math.round((e-.1)/.4),0),2)+.1,[p,m]=[f(l),f(u)],h=p==m&&p==.5?1:Math.hypot(l-p,u-m),g=c(1-h/.07),_=s([98,108,124],(.9+.2*i(32*e,32*t,32,9)+.12*r(n,a,6))*(1+.3*g)*(.65+.35*c((h-.06)/.04)));return Math.min(l,u,1-l,1-u)<.03?[s([40,44,50],1+d),.05]:[o(_,[105,68,45],.7*d),.5+.1*(1-d)+.4*g]},u[e.WOOD]=(e,t)=>{let n=Math.floor(8*t),a=2*e+2*r(n,0,8),[s,u,d]=[Math.floor(a)%2,a%1,8*t%1],f=r(n,s,3),p=.5+.5*Math.sin(l*(40*t+2.5*i(4*e,4*t,4,21)+7*f));return d<.08||u<.015?[[28,18,10],.05]:[o([92,58,32],[158,106,62],.6*p+.35*f),.7+.15*p+.15*c(15*(d-.08))]},u[e.MOSS]=(e,t)=>{let n=Math.floor(4*t),l=2*e+.5*(1&n),[u,d,f]=[Math.floor(l)%2,l%1,4*t%1],p=Math.min(d,1-d,.5*(f<.5?f:1-f)),m=d<.04||f<.06,h=c(12*(.3*a(12*e,12*t,12,3,17)-.03-p)),g=i(64*e,64*t,64,19),_=s([128,126,118],(.7+.4*r(u,n,5))*(.7+.5*i(16*e,16*t,16,15)));return[o(m?s(_,.45):_,o([52,100,34],[96,148,56],g),h),m?.1+.6*h*g:.6+.2*c(30*p)+.2*h*g]},u[e.GRATE]=(e,t)=>{let[n,r]=[8*e%1,8*t%1],a=Math.max(Math.abs(n-.5),Math.abs(r-.5)),l=Math.min(Math.abs(n-.5),Math.abs(r-.5))>.43,u=i(16*e,16*t,16,23);return a<.36?[[9,9,12],0]:[s(o([104,108,116],[96,80,68],c(4*(u-.55))),(l?1.25:1)-2.2*(.5-a)+.2*u),l?1:.6+.4*c(12*(a-.36))]},u[e.CONCRETE]=(e,t)=>{let[n,i]=[2*e%1,2*t%1],o=a(4*e,4*t,4,3,41),c=r(Math.floor(128*e),Math.floor(128*t),43)>.992,l=Math.hypot(n%.5-.25,i%.5-.25)<.02,u=(.94+.1*o+.03*r(Math.floor(2*e),Math.floor(2*t),44))*(c||l?.9:1);return n<.015||i<.015?[s([160,164,172],u),.3]:[s([206,209,214],u),l?.5:.8+.2*o-(c?.15:0)]},u[e.GLASS]=(e,t)=>{let n=2*e%1,r=((n+.7*t)%1-.5)/.12,i=Math.exp(-r*r);return n<.03||t<.03?[s([150,158,170],1-.3*n),.9]:[o(o([7,20,44],[48,88,136],t**2),[120,160,200],.18*i),.4]},u[e.STEEL]=(e,t)=>{let n=Math.floor(128*t),a=.5*r(n,3,31)+.5*i(8*e,0,8,n+7),o=4*e%1;return o<.03?[[60,66,76],.1]:[s([176,184,196],.8+.35*a+(o>.97?.15:0)),.6+.2*a]},u[e.PAINT]=(e,t)=>{let[n,i]=[2*e%1,2*t%1],a=r(Math.floor(128*e),Math.floor(128*t),47);return n<.02||i<.02?[[200,200,206],.3]:[s([246,246,248],.96+.06*a),.85+.04*a]},u[e.ROCK]=(e,t)=>{let n=a(4*e,4*t,4,4,21),l=c(8*(i(2*e,2*t,2,24)-.55))*Math.max(0,1-110*Math.abs(a(2*e,2*t,2,3,23)-.5)),[u,d]=[Math.floor(64*e),Math.floor(64*t)],[f,p]=[64*e%1-.5,64*t%1-.5],m=r(u,d,25),h=m<.06?c(1-Math.hypot(f,p)/(.2+3*m)):0,g=m>.96?.35:0;return[o(o(o(s([84,82,79],.65+.6*n+.1*r(Math.floor(128*e),Math.floor(128*t),27)),[150,146,140],g),[30,29,28],.7*h),[26,25,24],.7*l),c(.35+.5*n-.3*h-.25*l)]};var d,f,p=()=>t??=m(),m=()=>{let e=new Uint8ClampedArray(128*n*128*4);return u.forEach((t,n)=>{for(let r=0;r<16384;r++){let[i,a]=t(r%128/128,Math.floor(r/128)/128);e.set([...i,255*a],4*(128*n*128+r))}}),e},[h,g]=[6,16],_=()=>{for(;v(););return d},v=()=>{if(d)return!1;let e=(f??=function*(){let e=h,t=e*g,n=3,r=Float64Array.from({length:e*e*e*3},()=>.1+.8*(n=16807*n%2147483647)/2147483647),i=new Uint8Array(t*t*t);for(let n=0;n<t;n++){n%8==7&&(yield);let a=(n+.5)/g,o=Math.floor(a);for(let s=0;s<t;s++){let c=(s+.5)/g,l=Math.floor(c);for(let u=0;u<t;u++){let d=(u+.5)/g,f=Math.floor(d),p=9,m=9;for(let t=o-1;t<=o+1;t++)for(let n=l-1;n<=l+1;n++)for(let i=f-1;i<=f+1;i++){let o=3*((i+e)%e+(n+e)%e*e+(t+e)%e*e*e),s=d-i-r[o],l=c-n-r[o+1],u=a-t-r[o+2],f=s*s+l*l+u*u;f<p?(m=p,p=f):f<m&&(m=f)}i[u+(s+n*t)*t]=255*Math.min(Math.sqrt(m)-Math.sqrt(p),1)}}}return i}()).next();return e.done&&([d,f]=[e.value,void 0]),!e.done};export{_ as a,r as i,h as n,v as o,g as r,p as s,n as t};
1
+ import{fr as e}from"./brick-BSIQdeSz.js";var t,n=Object.keys(e).length,r=(e,t,n)=>{let r=Math.imul(e,374761393)+Math.imul(t,668265263)+Math.imul(n,144665)|0;return r=Math.imul(r^r>>>13,1274126177),((r^r>>>16)>>>0)/4294967296},i=(e,t,n,i)=>{let[a,o]=[Math.floor(e),Math.floor(t)],[s,c]=[e-a,t-o].map(e=>e*e*(3-2*e)),l=(e,t)=>r((a+e)%n,(o+t)%n,i);return(l(0,0)*(1-s)+l(1,0)*s)*(1-c)+(l(0,1)*(1-s)+l(1,1)*s)*c},a=(e,t,n,r,a)=>{let[o,s]=[0,.5];for(let c=0;c<r;c++,s/=2)o+=s*i(e*(1<<c),t*(1<<c),n<<c,a+c);return o/(1-2*s)},o=(e,t,n)=>e.map((e,r)=>e+(t[r]-e)*n),s=(e,t)=>e.map(e=>e*t),c=e=>Math.min(Math.max(e,0),1),l=2*Math.PI,u=[];u[e.BRICK]=(e,t)=>{let n=Math.floor(8*t),a=4*e+.5*(1&n),[o,l,u]=[Math.floor(a)%4,a%1,8*t%1],d=i(16*e,16*t,16,5),f=.8+.4*d;return l<.05||u<.1?[s([165,160,150],.7+.3*f),.1+.1*d]:[s([170,78,56],(.8+.4*r(o,n,1))*f*(.85+.15*u)),.7+.2*d+.1*c(12*Math.min(l-.05,u-.1))]},u[e.TILE]=(e,t)=>{let[n,a]=[Math.floor(4*e),Math.floor(4*t)],[o,l]=[4*e%1,4*t%1],u=i(16*e,16*t,16,7),d=.9+.2*u;return o<.05||l<.05?[s([85,85,80],d),.1]:[s([196,190,172],d*(.88+.08*(n+a&1)+.1*r(n,a,2))),.8+.1*u+.1*c(14*(Math.min(o,l)-.05))]},u[e.LAVA]=(e,t)=>{let n=a(4*e,4*t,4,4,11),r=Math.max(0,1-7*Math.abs(n-.5))**2;return[o(o([55,8,4],[230,70,8],n),[255,215,90],r),.5]},u[e.STONE]=(e,t)=>{let n=a(8*e,8*t,8,4,3);return[s([128,124,120],.45+.7*(1.3*n+.1*r(Math.floor(128*e),Math.floor(128*t),4))),c(1.4*n-.2)]},u[e.METAL]=(e,t)=>{let[n,a,l,u]=[Math.floor(2*e),Math.floor(2*t),2*e%1,2*t%1],d=c(6*(i(8*e,8*t,8,13)-.68)),f=e=>.4*Math.min(Math.max(Math.round((e-.1)/.4),0),2)+.1,[p,m]=[f(l),f(u)],h=p==m&&p==.5?1:Math.hypot(l-p,u-m),g=c(1-h/.07),_=s([98,108,124],(.9+.2*i(32*e,32*t,32,9)+.12*r(n,a,6))*(1+.3*g)*(.65+.35*c((h-.06)/.04)));return Math.min(l,u,1-l,1-u)<.03?[s([40,44,50],1+d),.05]:[o(_,[105,68,45],.7*d),.5+.1*(1-d)+.4*g]},u[e.WOOD]=(e,t)=>{let n=Math.floor(8*t),a=2*e+2*r(n,0,8),[s,u,d]=[Math.floor(a)%2,a%1,8*t%1],f=r(n,s,3),p=.5+.5*Math.sin(l*(40*t+2.5*i(4*e,4*t,4,21)+7*f));return d<.08||u<.015?[[28,18,10],.05]:[o([92,58,32],[158,106,62],.6*p+.35*f),.7+.15*p+.15*c(15*(d-.08))]},u[e.MOSS]=(e,t)=>{let n=Math.floor(4*t),l=2*e+.5*(1&n),[u,d,f]=[Math.floor(l)%2,l%1,4*t%1],p=Math.min(d,1-d,.5*(f<.5?f:1-f)),m=d<.04||f<.06,h=c(12*(.3*a(12*e,12*t,12,3,17)-.03-p)),g=i(64*e,64*t,64,19),_=s([128,126,118],(.7+.4*r(u,n,5))*(.7+.5*i(16*e,16*t,16,15)));return[o(m?s(_,.45):_,o([52,100,34],[96,148,56],g),h),m?.1+.6*h*g:.6+.2*c(30*p)+.2*h*g]},u[e.GRATE]=(e,t)=>{let[n,r]=[8*e%1,8*t%1],a=Math.max(Math.abs(n-.5),Math.abs(r-.5)),l=Math.min(Math.abs(n-.5),Math.abs(r-.5))>.43,u=i(16*e,16*t,16,23);return a<.36?[[9,9,12],0]:[s(o([104,108,116],[96,80,68],c(4*(u-.55))),(l?1.25:1)-2.2*(.5-a)+.2*u),l?1:.6+.4*c(12*(a-.36))]},u[e.CONCRETE]=(e,t)=>{let[n,i]=[2*e%1,2*t%1],o=a(4*e,4*t,4,3,41),c=r(Math.floor(128*e),Math.floor(128*t),43)>.992,l=Math.hypot(n%.5-.25,i%.5-.25)<.02,u=(.94+.1*o+.03*r(Math.floor(2*e),Math.floor(2*t),44))*(c||l?.9:1);return n<.015||i<.015?[s([160,164,172],u),.3]:[s([206,209,214],u),l?.5:.8+.2*o-(c?.15:0)]},u[e.GLASS]=(e,t)=>{let n=2*e%1,r=((n+.7*t)%1-.5)/.12,i=Math.exp(-r*r);return n<.03||t<.03?[s([150,158,170],1-.3*n),.9]:[o(o([7,20,44],[48,88,136],t**2),[120,160,200],.18*i),.4]},u[e.STEEL]=(e,t)=>{let n=Math.floor(128*t),a=.5*r(n,3,31)+.5*i(8*e,0,8,n+7),o=4*e%1;return o<.03?[[60,66,76],.1]:[s([176,184,196],.8+.35*a+(o>.97?.15:0)),.6+.2*a]},u[e.PAINT]=(e,t)=>{let[n,i]=[2*e%1,2*t%1],a=r(Math.floor(128*e),Math.floor(128*t),47);return n<.02||i<.02?[[200,200,206],.3]:[s([246,246,248],.96+.06*a),.85+.04*a]},u[e.ROCK]=(e,t)=>{let n=a(4*e,4*t,4,4,21),l=c(8*(i(2*e,2*t,2,24)-.55))*Math.max(0,1-110*Math.abs(a(2*e,2*t,2,3,23)-.5)),[u,d]=[Math.floor(64*e),Math.floor(64*t)],[f,p]=[64*e%1-.5,64*t%1-.5],m=r(u,d,25),h=m<.06?c(1-Math.hypot(f,p)/(.2+3*m)):0,g=m>.96?.35:0;return[o(o(o(s([84,82,79],.65+.6*n+.1*r(Math.floor(128*e),Math.floor(128*t),27)),[150,146,140],g),[30,29,28],.7*h),[26,25,24],.7*l),c(.35+.5*n-.3*h-.25*l)]},u[e.FABRIC]=(e,t)=>{let[n,i]=[Math.floor(128*e),Math.floor(128*t)],a=+((n+i)%4<2),o=r(n,i,51),[l,u]=[n%16-7.5,i%16-7.5],d=+(Math.abs(Math.abs(l)+Math.abs(u)-4)<1.2);return[s([232,232,236],.78+.1*a+.08*o+.2*d),c(.3+.45*a+.2*o)]},u[e.HIDE]=(e,t)=>{let[n,i]=[Math.floor(128*e),Math.floor(128*t)],o=r(n>>2,i>>2,53),l=3&n&&3&i?0:1,u=a(4*e,4*t,4,3,55),[d,f]=[n%64,i%64],p=d<2||f<2;return[s([228,226,224],p?.55:(.82+.1*o-.08*l)*(.9+.2*u)*(d==4&&(3&i)<2||f==4&&(3&n)<2?1.15:1)),p?.1:c(.35+.35*o-.2*l+.2*u)]};var d,f,p=()=>t??=m(),m=()=>{let e=new Uint8ClampedArray(128*n*128*4);return u.forEach((t,n)=>{for(let r=0;r<16384;r++){let[i,a]=t(r%128/128,Math.floor(r/128)/128);e.set([...i,255*a],4*(128*n*128+r))}}),e},[h,g]=[6,16],_=()=>{for(;v(););return d},v=()=>{if(d)return!1;let e=(f??=function*(){let e=h,t=e*g,n=3,r=Float64Array.from({length:e*e*e*3},()=>.1+.8*(n=16807*n%2147483647)/2147483647),i=new Uint8Array(t*t*t);for(let n=0;n<t;n++){n%8==7&&(yield);let a=(n+.5)/g,o=Math.floor(a);for(let s=0;s<t;s++){let c=(s+.5)/g,l=Math.floor(c);for(let u=0;u<t;u++){let d=(u+.5)/g,f=Math.floor(d),p=9,m=9;for(let t=o-1;t<=o+1;t++)for(let n=l-1;n<=l+1;n++)for(let i=f-1;i<=f+1;i++){let o=3*((i+e)%e+(n+e)%e*e+(t+e)%e*e*e),s=d-i-r[o],l=c-n-r[o+1],u=a-t-r[o+2],f=s*s+l*l+u*u;f<p?(m=p,p=f):f<m&&(m=f)}i[u+(s+n*t)*t]=255*Math.min(Math.sqrt(m)-Math.sqrt(p),1)}}}return i}()).next();return e.done&&([d,f]=[e.value,void 0]),!e.done};export{_ as a,r as i,h as n,v as o,g as r,p as s,n as t};
@@ -0,0 +1 @@
1
+ import{$ as e,Bt as t,F as n,Ft as r,G as i,Gt as a,Ht as o,J as s,K as c,Lt as l,Nt as u,P as d,Pt as f,Q as p,Rt as m,Ut as h,V as g,Vt as _,Wt as v,X as y,Y as b,Z as x,Zt as S,a as C,an as w,cn as ee,d as te,dn as T,en as ne,fr as E,i as D,in as re,k as ie,ln as ae,lr as oe,n as O,nn as se,o as ce,on as le,q as ue,r as k,rn as de,rt as A,sn as fe,t as pe,tn as me,tt as he,u as ge,un as j,zt as M}from"./brick-BSIQdeSz.js";import{i as N}from"./textures-BkEnQMsT.js";import{t as _e}from"./stone-Bdq5eUwO.js";var ve=[.8,.82,.86],ye=[.35,.36,.4],be=me.filter(e=>e.min[1]===2.48&&e.max[1]===4),[P,F]=se,I=[P,0,F],L=22.4,xe=[-.6,.6,.53],Se=[[2,1],[0,2],[0,1]],Ce=[1.25,1.3,1.4],we=[.56,.48,.28],Te=[.04,.04,.05],{CONCRETE:Ee,METAL:De,PAINT:Oe}=E,[R,ke,z,B,Ae,je]=[[.86,.87,.9],[.55,.57,.6],[.32,.33,.36],[.07,.075,.085],[.42,.52,.66],[.2,.13,.08]],[V,H,Me,Ne,Pe,Fe]=[[.3,.8,1],[.35,1,.5],[1,.7,.25],[1,.2,.15],[.7,.35,1],[1,.35,.85]],Ie=(e,t,n,r=1,[i,a]=Se[1])=>{for(let o of[0,1,2,0,2,3])e.push(...t[o],...xe),typeof n==`number`?e.push(t[o][i],t[o][a],n,r):e.push(n[0],n[1],-2,n[2])},U=(e,t,n,r,i,a,o)=>Ie(e,[[0,0],[1,0],[1,1],[0,1]].map(([e,a])=>{let o=[0,0,0],[s,c]=[(t+1)%3,(t+2)%3];return[o[t],o[s],o[c]]=[n,(e?i:r)[s],(a?i:r)[c]],o}),a,o,Se[t]),Le=(e,{min:t,max:n,top:r,side:i},a=0)=>{for(let o=0;o<3;o++)U(e,o,t[o],t,n,i,a+(o==1?.4:1.25-.15*o)),U(e,o,n[o],t,n,o==1?r:i,a+(o==1?1.85:1.25-.15*o))},Re=(e,t)=>{let n=e.length;t();let r=he(e,0);for(let t=n;t<e.length;t+=10){if(r[t+8]==-1){let e=2.2*(.72+.28*r[t+4]-.12*Math.abs(r[t+3]));r[t+6]*=e,r[t+7]*=e,r[t+9]*=e}[r[t+3],r[t+4],r[t+5]]=xe}},ze=(e,t,n,r,i,a)=>{for(let[o,s,c]of[[r,r+.1,0],[i-.1,i,0],[r,i,a-.1]])U(e,t,n,[o,c,o],[s,a,s],Ce)},Be=(e,t,n,r,i,a,o,s=[])=>{[...s,[i,i,0]].forEach(([i,c,l],u)=>{let[d,f]=[[0,0,0],[0,a,0]];[d[2-t],f[2-t]]=[u?s[u-1][1]:r,i],U(e,t,n,d,f,Oe,o),c>i&&([d[1],d[2-t],f[2-t]]=[l,i,c],U(e,t,n,d,f,Oe,o))})},Ve=[[-1,96.2,242.65,98.6,242.7,1,2.3,3],[-1,96.2,229.3,98.6,229.35,1,2.3,1],[-1,61.4,242.65,63.8,242.7,1,2.3,3],[-1,61.4,229.3,63.8,229.35,1,2.3,1],[-1,73.3,252.4,73.35,255.4,4.3,5.5,0],[-1,86.65,252.4,86.7,255.4,4.3,5.5,2],[-1,73.3,216.6,73.35,219.6,1,2.3,0],[-1,86.65,216.6,86.7,219.6,1,2.3,2]],He=(t,n,r,i,a,o)=>{let s=he(t,0);for(let c=n;c<t.length;c+=10){let t=[0,1,2].map(e=>s[c+e]-r[e]),n=t[0]*i[0]+t[1]*i[1]+t[2]*i[2];[s[c+3],s[c+4],s[c+5]]=e([0,1,2].map(e=>i[e]+o*(t[e]-n*i[e])/a)),s[c+8]=d}},Ue=[[-A/4-Math.asin(ae[0][2]/L),-A/4+Math.asin(ae[0][2]/L),ae[0][3]],[-Math.acos((j[1].min[0]-P)/L),Math.asin((j[0].max[2]-F)/L),ae[1][3]]],We=e=>e.filter((t,n)=>{let r=n-n%30;return Math.max(e[r],e[r+10],e[r+20])>-.49}),Ge=We(c(y([[1,0],[1,1]],12),ve)),Ke=We(c(y([[1.06,0],[1.06,.3]],12),ye)),[W,qe]=se,Je=22.4,G=A/48,Ye=[.4,.42,.46],Xe=[.27,.29,.33],[K,Ze,Qe,$e,et,tt,nt]=[[.16,.17,.2],[.6,.62,.66],[1,.8,.45],[.7,.9,1],[1,.6,.2],[1,.12,.08],[.35,1,.5]],rt=[.6,.64,.48],it=c(y([[1,0],[1,1]],6),[1,1,1]),at=c(y([[0,-1],[1,0],[0,1]],6),[1,1,1]),ot=c(y([[0,0],[1,.4],[.93,.42],[0,.12]],12),[.82,.84,.88]),st=(e,t,n,r,i=Ze)=>b(e,it,t,n,rt,1,r,i),ct=(e,t,n,r,i=2.2)=>{let a=e.length;s(e,at,t,pe,[0,0,0],n,r),i&&ge(e,a,i)},lt=(e,t,n)=>C(e,1.8,()=>D(e,[[t-.15,.03,n-.15],[t+.15,.03,n-.15],[t+.15,.03,n+.15],[t-.15,.03,n+.15]],$e,[t,-5,n])),ut=e=>[Je*Math.cos(e*A/40),12*Math.sin(e*A/40)],q=(t,n,r=.02)=>{let i=Math.max(n-5,0),a=Math.floor(i),[o,s]=[ut(a),ut(a+1)],[c,l]=[o[0]+(s[0]-o[0])*(i-a),o[1]+(s[1]-o[1])*(i-a)],u=e([c/Je/Je,l/144,0]),d=c*Math.cos(G/2)/Math.cos((t%G+G)%G-G/2)+r*u[0];return[W+d*Math.cos(t),Math.min(n,5)+l+r*u[1],qe+d*Math.sin(t)]},dt=Ue.map(([e,t])=>[e-.03,t+.03]),ft=e=>!dt.some(([t,n])=>[e,e-A].some(e=>e>t&&e<n)),pt=[...Array.from({length:35},(e,t)=>(2*t+1)*A/70).filter(e=>ft(e-.03)&&ft(e+.03)).map(e=>{let[t,n]=[Math.cos(e),Math.sin(e)];return[W+22.419999999999998*t,4.02,qe+22.419999999999998*n,t,n,.38,0]}),...ee.flatMap(({min:e,max:t})=>[-1,1].flatMap(n=>[-2,2].map(r=>[(n>0?t[0]:e[0])+.02*n,3.1,(e[2]+t[2])/2+r,n,0,.45,1]))).filter(([e,,t])=>!j.some(n=>e>n.min[0]-.5&&e<n.max[0]+.5&&t>n.min[2]-.6&&t<n.max[2]+.6))],mt=(e,[t,n,r,i,a],o,s,c)=>D(e,Array.from({length:12},(e,c)=>{let l=o*Math.cos(c*A/12);return[t+s*i-a*l,n+o*Math.sin(c*A/12),r+s*a+i*l]}),c,[t-i,n,r-a]),ht=(e,[t,n,r,i,a],o,s)=>{let c=e.length,l=e=>{let c=o*Math.cos(e*A/12);return[t+s*i-a*c,n+o*Math.sin(e*A/12),r+s*a+i*c]},u=[t+s*i,n,r+s*a];for(let o=0;o<12;o++)D(e,[u,l(o),l(o+1)],Qe,[t-i,n,r-a]);ge(e,c,.7),He(e,c,u,[i,0,a],o,.8)},[gt,J]=[160,280],Y=[80,0,140],_t=Y,vt=e([.3,.62,-.75]),X=e=>(e=Math.min(Math.max(e,0),1))*e*(3-2*e),Z=(e,t,n)=>{let[r,i]=[Math.floor(e),Math.floor(t)],[a,o]=[e-r,t-i].map(e=>e*e*(3-2*e)),s=(e,t)=>N(r+e,i+t,n);return(s(0,0)*(1-a)+s(1,0)*a)*(1-o)+(s(0,1)*(1-a)+s(1,1)*a)*o},yt=(e,t,n)=>.55*Z(e,t,n)+.3*Z(2*e,2*t,n+1)+.15*Z(4*e,4*t,n+2),bt=c(y([[1,0],[1,1]],6),[.5,.52,.56]),xt=c(y([[0,-1],[1,0],[0,1]],6),[1,1,1]),St=c(y([[0,0],[.5,1.6],[.85,3.5],[1,6],[1,10],[.8,12.5],[.55,14],[0,14]],12),[.9,.9,.92]),Ct=c(y([[0,0],[2.2,.6],[0,.9]],12),[.8,.82,.86]),wt=(t,n,r)=>{let i=e=>e[0]*n[0]+e[1]*n[1]+e[2]*n[2]-r,a=[],o=t.map(e=>{let t=[];return e.forEach((n,r)=>{let o=e[(r+1)%e.length],[s,c]=[i(n),i(o)];if(s<=0&&t.push(n),s*c<0){let e=s/(s-c),r=[n[0]+(o[0]-n[0])*e,n[1]+(o[1]-n[1])*e,n[2]+(o[2]-n[2])*e];t.push(r),a.some(e=>Math.abs(e[0]-r[0])+Math.abs(e[1]-r[1])+Math.abs(e[2]-r[2])<1e-9)||a.push(r)}}),t}).filter(e=>e.length>2);if(a.length>2){let t=a.reduce((e,t)=>e.map((e,n)=>e+t[n]/a.length),[0,0,0]),r=e(k(n,Math.abs(n[1])<.9?[0,1,0]:[1,0,0])),i=k(n,r),s=e=>{let n=[e[0]-t[0],e[1]-t[1],e[2]-t[2]];return Math.atan2(n[0]*i[0]+n[1]*i[1]+n[2]*i[2],n[0]*r[0]+n[1]*r[1]+n[2]*r[2])};o.push(a.sort((e,t)=>s(e)-s(t)))}return o},Tt=[0,1,2].flatMap(e=>[-1,1].map(t=>[[-1,-1],[1,-1],[1,1],[-1,1]].map(([n,r])=>{let i=[0,0,0];return i[e]=1.2*t,i[(e+1)%3]=1.2*n,i[(e+2)%3]=1.2*r,i}))),Et=(t,n,[r,i,a],o,s,c=!0)=>{let l=(e,t)=>N(e,t,o),u=wt(Tt,[0,-1,0],.35),d=(e,t,n)=>{let r=Math.sqrt(1-e*e);u=wt(u,[r*Math.cos(t),e,r*Math.sin(t)],n)};d(.92+.08*l(0,1),A*l(0,2),.72+.15*l(0,3));for(let[e,t,n,r,i,a]of[[7,-.4,.2,.62,.2,0],[8,-.05,.25,.74,.18,.3],[6,.45,.3,.6,.2,.6],[c?14:0,-.22,.2,.78,.1,.5],[c?12:0,.24,.2,.76,.1,.15],[c?9:0,.66,.2,.74,.1,.4]])for(let o=0;o<e;o++){let s=10*e+o;d(t+n*l(s,1),A*((o+a+.45*l(s,2))/e),r+i*l(s,3))}let[f,p]=[.8+.4*N(o,1,9),A*N(o,2,9)],[m,h]=[Math.cos(p),Math.sin(p)],g=([e,t,o])=>{let[s,c]=[e*r*f,o*a*(2-f)];return[n[0]+s*m-c*h,n[1]+t*i,n[2]+s*h+c*m]};u.forEach((r,i)=>{let a=r.map(g).filter((e,t,n)=>Math.hypot(...e.map((e,r)=>e-n[(t+n.length-1)%n.length][r]))>1e-5);if(a.length<3)return;let o=e(k([a[1][0]-a[0][0],a[1][1]-a[0][1],a[1][2]-a[0][2]],[a[2][0]-a[0][0],a[2][1]-a[0][1],a[2][2]-a[0][2]]));o[0]*(a[0][0]-n[0])+o[1]*(a[0][1]-n[1])+o[2]*(a[0][2]-n[2])<0&&(a.reverse(),o.forEach((e,t)=>o[t]=-e));let c=e(k(o,Math.abs(o[1])<.9?[0,1,0]:[1,0,0])),u=k(o,c),d=.85*s*(.88+.24*l(i,7))*(.8+.2*Math.sqrt(Math.max(o[1]+1,0)/2)),f=e=>[...e,...o,e[0]*c[0]+e[1]*c[1]+e[2]*c[2]+7*l(0,5),e[0]*u[0]+e[1]*u[1]+e[2]*u[2]+7*l(0,6),E.ROCK,d];for(let e=1;e<a.length-1;e++)t.push(...f(a[0]),...f(a[e]),...f(a[e+1]))})},Dt=(t,n,r,a,o,s,c)=>{let l=k(p(n[1],n[0]),p(n[2],n[0]));if(Math.hypot(...l)<1e-9)return;l=e(l),i(l,p(n[0],r))<0&&(n.reverse(),l=l.map(e=>-e));let u=(n[0][1]+n[1][1]+n[2][1])/3,d=.85*c*(.86+.28*N(t.length,s,7))*(.55+.45*X((u-a)/(.3*(o-a))))*(.82+.18*Math.max(l[1],0));for(let e of n)t.push(...e,...l,...Math.abs(l[1])>.7?[e[0],e[2]]:Math.abs(l[0])>Math.abs(l[2])?[e[2]+3*s,e[1]]:[e[0]+3*s,e[1]],E.ROCK,d)},Ot=(e,t,n,r,i,a)=>{let[o,s,c,l,u,d]=t[0],f=[(o+l)/2,n+.3*(u-n),(c+d)/2],[p,m]=[(i>1?.54:.5)*(l-o),(i>1?.54:.5)*(d-c)];_e(e,i>2?5:i>1?3:l-o>1.4?2:1,e=>{let t=e[1]>0?u-f[1]:f[1]-s,n=[e[0]/p,e[1]/t,e[2]/m].map(e=>e*e),a=i>1?1/Math.sqrt(Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2])):1/Math.sqrt(n[0]+n[1]+n[2]),o=a*(.93+.14*Z(1.3*e[0]+r,1.3*e[2]+e[1],r));return[f[0]+e[0]*o,Math.min(f[1]+e[1]*a,u),f[2]+e[2]*o]},n,u,r,a)},kt=(e,t,n)=>{s(e,c(y([[13,0],[13,.27],[0,.27]],32),[.13,.13,.15]),[t,0,n],pe,[0,0,0],1),te(e,[t,.29,n],7.6,8,[.8,.8,.82]);for(let r=0;r<24;r++){let i=r*A/24,[a,o]=[t+11.6*Math.cos(i),n+11.6*Math.sin(i)],s=(e,t)=>[a+e,.31,o+t];C(e,1.8,()=>D(e,[s(-.25,-.25),s(.25,-.25),s(.25,.25),s(-.25,.25)],r%3?[1,.95,.8]:[1,.45,.1],[a,-5,o]))}},At=(e,t,n,r,i=10,a=[1,.93,.75])=>{s(e,bt,[t,r,n],pe,[0,0,0],[.2,.2,i]),s(e,bt,[t,r,n],pe,[0,0,0],[.5,.5,.5]),C(e,ce,()=>s(e,xt,[t,r+i+.4,n],pe,[0,0,0],[.55,.55,.45],a))},jt=(e,t)=>{let n=(n,r)=>{let[i,a]=[t[n],A*(r+.5*n)/e];return[Math.sqrt(1-i*i)*Math.cos(a),i,Math.sqrt(1-i*i)*Math.sin(a)]},r=[];for(let i=0;i<e;i++){r.push([[0,1,0],n(0,i+1),n(0,i)]);for(let e=0;e+1<t.length;e++)r.push([n(e,i),n(e,i+1),n(e+1,i)],[n(e+1,i),n(e,i+1),n(e+1,i+1)])}return r},Mt=[jt(6,[-.35]),jt(5,[.45,-.35]),jt(9,[.62,.1,-.35])],Nt=[.08,.2,.45],Pt=(e,t,n,r,i,a,o)=>{Ot(e,[[t,a-4,n,r,a,i]],a-3.4,o,3,.9),Ot(e,[[t+.15,-17,n+.15,r-.15,a-3,i-.15]],-15,o+9,2,.5)},Ft=[[0,.02,.6],[.55,.04,.72],[.88,.2,1.05],[1,.24,1.12],[1.4,.015,1]],It=({brushes:e},t,n,r)=>!e.some(e=>e.max[1]>0&&Math.hypot(Math.max(e.min[0]-t,t-e.max[0],0),Math.max(e.min[2]-n,n-e.max[2],0))<r+.5)&&[0,1,2,3,4].every(i=>{let[a,o]=i?[t+r*Math.cos(1.57*i),n+r*Math.sin(1.57*i)]:[t,n];return Math.abs(a-Y[0])<=Y[0]-.5&&Math.abs(o-Y[2])<=Y[2]-.5&&e.some(e=>e.max[1]==0&&a>e.min[0]&&a<e.max[0]&&o>e.min[2]&&o<e.max[2])}),Lt=(e,t)=>{let n=[0,20,40,60,80,120,160,200,240];return[...n.map(t=>e-t).reverse(),...Array.from({length:(t-e)/20-1},(t,n)=>e+20*(n+1)),...n.map(e=>t+e)]},Rt=[[0,0,0,1],[-.6,-.25,0,.9],[-3,-.2,.7,.95],[-7,.1,.9,.85],[-7.4,.8,.9,.5],[-14,1,1.2,.55],[-14.5,1.7,1.2,.3],[-22,2.1,1.5,.34],[-30,5.6,1.5,.12]],zt=(()=>{let e=e=>r[Math.min(Math.max(e,0),r.length-1)],t=[[0,140]];for(let n=0;n<=r.length;n++){let[r,i]=[e(n-1),e(n)];Math.abs(r-i)>.5?t.push([n,148+r],[n,148+i]):t.push([n,148+Math.min(r,i)-.12*N(n,1,71)])}return[...t,[r.length,140]]})(),Bt=[[640,75,4,.17,.02,3],[690,95,3,.16,.03,5],[740,115,3,.15,.04,8]],Vt=(e,t,n,r)=>{let i=(i,a)=>Z(e*n/i+7*r,t*n/i-3*r,r+a),a=n=>{let i=A*N(r,n,97);return e*Math.cos(i)+t*Math.sin(i)},o=Math.max(X((a(1)-.93)/.07),.8*X((a(2)-.95)/.05)),s=Math.max(X((a(3)-.985)/.015),X((a(4)-.985)/.015)),c=1-Math.abs(2*i(150,2)-1);return(.42+.2*i(520,1)+.14*c*c+.24*o)*(1-.5*s)+.1*(i(60,3)-.5)+.04*(i(24,4)-.5)};function*Ht(n){let a=[];(e=>{(e=>{(e=>{let t=Array.from({length:9},(e,t)=>{let n=(t+1)/10*(A/4);return[L*Math.cos(n),5+12*Math.sin(n)]}),n=[];s(n,c(y([[L,0],[L,5],...t,[0,17]],48),ve),[P,0,F],pe,[0,0,0],1);let r=(e,t)=>(t?Math.ceil:Math.floor)(e*48/A)*A/48;for(let t=0;t<n.length;t+=30){let[i,a,o]=[t,t+10,t+20],s=Math.atan2(n[i+2]+n[a+2]+n[o+2]-3*F,n[i]+n[a]+n[o]-3*P);if(Math.max(n[i+1],n[a+1],n[o+1])>5.01||!Ue.some(([e,t])=>s>r(e,0)&&s<r(t,1)))for(let r=t;r<t+30;r++)e.push(n[r])}let i=(e,t)=>[P+L*Math.cos(e),t,F+L*Math.sin(e),Math.cos(e),0,Math.sin(e),ve[0],ve[1],-1,ve[2]];for(let[t,n,a]of Ue){let o=[r(t,0),t];for(let e=Math.ceil(t*48/A);e*A/48<n;e++)o.push(e*A/48);o.push(n,r(n,1)),o.slice(1).forEach((t,n)=>{let r=o[n],s=n&&n<o.length-2?a:0;e.push(...i(r,s),...i(t,s),...i(t,5),...i(r,s),...i(t,5),...i(r,5))})}let a=(e,t,n)=>[P+(L+n)*Math.cos(e),t,F+(L+n)*Math.sin(e)];for(let t=0;t<70;t++){let n=t*A/70,r=n>A/2?n-A:n;if(Ue.some(([e,t])=>r>e-.04&&r<t+.04))continue;let i=(e,t,r,i)=>[[-e,t],[e,t],[e,r],[-e,r]].map(([e,t])=>a(n+e/L,t,i));D(e,i(.72,1.5,2.9,.04),[.06,.06,.08],[P,2.2,F]);let o=e.length;C(e,.56,()=>D(e,i(.6,1.7,2.7,.07),[1,.85,.5],[P,2.2,F])),He(e,o,a(n,2.2,.07),[Math.cos(n),0,Math.sin(n)],.6,.25)}let[,o,l,u,d]=ae[0],f=F+o-d;for(let[t,n,r]of[[-l-.3,-l-.02,0],[l+.02,l+.3,0],[-l-.3,l+.3,u]])O(e,[P+t,r,f-.1],[P+n,u+.3,f+.5],ye),U(e,2,f-.12,[P+t+.09,r+.09,0],[P+n-.09,u+.21,0],Ce)})(e),(e=>{let t=[...re,...re.map(([e,t])=>[t,e]).reverse()];for(let[n,r]of t)U(e,1,.02,[P-n,0,F-r],[P+n,0,F+r],Ee,1.85);let n=t.flatMap(([e,n],r)=>[[e,n],...t[r+1]?[[t[r+1][0],n]]:[]]),r=[...n,...n.map(([e,t])=>[-e,t]).reverse(),...n.map(([e,t])=>[-e,-t]),...n.map(([e,t])=>[e,-t]).reverse()];r.forEach((t,n)=>{let i=r[(n+1)%r.length],a=t[0]==i[0]?0:2,o=2-a,[s,c]=[I[a]+t[a/2],Math.sign(t[a/2])],[l,u]=[t[o/2],i[o/2]].sort((e,t)=>e-t),d=ae.find(e=>e[a/2]==t[a/2]&&e[o/2]>l&&e[o/2]<u),[f,p,m,h]=d?[d[o/2],d[2],d[3],d[4]]:[l,0,0,0],g=(t,n,r,i,l,u=0,d=0)=>{let[f,p]=[[0,r,0],[0,i,0]];[f[o],p[o]]=[I[o]+t,I[o]+n],U(e,a,s-c*d,f,p,l,u)};Be(e,a,s,I[o]+l,I[o]+u,8,1.7,d&&[[I[o]+f-p,I[o]+f+p,m]]),g(l,u,0,.25,Te,0,.02),g(l,u,7.4,7.6,Ce,0,.03);let _=u-l>6?Math.floor((u-l)/2.4):0;for(let e=0;e<_;e++){let t=l+(u-l)*(e+.5)/_;for(let e of[1.5,4.9])(e>m||Math.abs(t-f)>p+.8)&&(g(t-.72,t+.72,e,e+1.4,Te,0,.02),g(t-.6,t+.6,e+.2,e+1.2,we,0,.04))}let v=Math.ceil((u-l)/4.2);for(let n=0;n<v;n++){let r=(e,n)=>{let r=[0,8,0];[r[a],r[o]]=[t[a/2],l+(u-l)*e/v];let i=n?21.55/Math.hypot(r[0],r[2]):1;return[P+r[0]*i,8,F+r[2]*i]};Ie(e,[r(n,0),r(n+1,0),r(n+1,1),r(n,1)],Ee,1)}if(d){let[t,n]=[[0,0,0],[0,m,0]];[t[a],n[a]]=[s,s+c*h].sort((e,t)=>e-t),[t[o],n[o]]=[I[o]+f-p,I[o]+f+p],U(e,o,t[o],t,n,Oe,1.4),U(e,o,n[o],t,n,Oe,1.4),U(e,1,m,t,n,Oe,.9),U(e,1,.02,t,n,Ee,1.85),ze(e,a,s-.03*c,t[o],n[o],m)}});let[i,a,o]=[32,6,Math.asin(3/11.7)],s=(e,t)=>{let[n,r]=[o+(A/4-o)*t/a,e*A/i],s=(L-.3)*Math.cos(n);return[P+s*Math.cos(r),5+11.7*Math.sin(n),F+s*Math.sin(r)]};for(let t=0;t<a;t++)for(let n=0;n<i;n++){let r=.31-.028*t-.018*(n+t&1);Ie(e,[s(n,t),s(n+1,t),s(n+1,t+1),s(n,t+1)],[r,r,1.06*r])}for(let t=0;t<16;t+=2){let n=e=>[P+3*Math.cos(e*A/16),16.2,F+3*Math.sin(e*A/16)];Ie(e,[[P,16.2,F],n(t),n(t+1),n(t+2)],Ce)}de.forEach(t=>Le(e,t))})(e),(e=>{j.forEach(({min:t,max:n},r)=>{let i=r?2:0,[a,o,s]=[t[i],r?j[0].min[2]:n[i],(t[2-i]+n[2-i])/2],c=e=>i?[s,1.75,e]:[e,1.75,s],l=(n[2-i]-t[2-i])/2+.1;b(e,Ge,c(a),c(o),[0,1,0],1,[1.75,l]);for(let t=5;t<o-a-1;t+=5)b(e,Ke,c(a+t),c(a+t+.3),[0,1,0],.3,[1.75,l]);Be(e,2-i,t[2-i]+T+.02,a,o,w,1.4),Be(e,2-i,n[2-i]-T-.02,r?a:j[1].min[0],o,w,1.4),U(e,1,w-.01,t,n,Oe,.9);let[u,d]=[[...t],[...n]];[u[2-i],d[2-i]]=[s-.15,s+.15],U(e,1,w-.02,u,d,Ce)})})(e),(e=>{for(let{min:t,max:n}of ee){let r=[(t[0]+n[0])/2,2.5,(t[2]+n[2])/2];for(let i of[-1,1]){let a=i>0?n[2]:t[2];for(let n=0;n<7;n++){let o=t[0]+1+2*n;if(be.some(e=>Math.abs(e.min[2]-a)<1&&o+.72>e.min[0]&&o-.72<e.max[0]))continue;let s=(e,t,n,r)=>[[-e,t],[e,t],[e,n],[-e,n]].map(([e,t])=>[o+e,t,a+i*r]);D(e,s(.72,2.6,3.8,.02),[.06,.06,.08],r);let c=e.length;C(e,.5,()=>D(e,s(.6,2.7,3.7,.04),[.9,.95,1],r)),He(e,c,[o,3.2,a+.04*i],[0,0,i],.6,.25),Ie(e,s(.56,2.6,3.8,-T-.04),Te),Ie(e,s(.46,2.7,3.7,-T-.06),[.45,.48,.5])}}for(let r of[0,2])for(let[i,a]of[[t[r],T+.02],[n[r]-T,-.02]])Be(e,r,i+a,t[2-r]+T,n[2-r]-T,4,1.5,be.filter(e=>Math.abs(e.min[r]-i)<.01).map(e=>[e.min[2-r],e.max[2-r],w]));U(e,1,3.99,t,n,Oe,.9);for(let i=0;i<3;i++){let a=t[0]+(n[0]-t[0])*(i+.5)/3;U(e,1,3.98,[a-1.2,0,r[2]-.3],[a+1.2,0,r[2]+.3],Ce)}}})(e);for(let{min:t,max:n}of[...ee,...j])U(e,1,.02,t,n,De,1.99);for(let{min:t,max:n}of be){let r=n[0]-t[0]<1?0:2;for(let i of[t[r]-.02,n[r]+.02])ze(e,r,i,t[2-r],n[2-r],t[1])}})(e),(e=>{(e=>{let t=(t,n=Ye)=>D(e,t,n,[W,5,qe]),n=(e,n,r,i,a,o)=>{for(let s=e;s<n-1e-9;){let e=Math.min(n,(Math.floor(s/G+1e-9)+1)*G);t([q(s,r,o),q(e,r,o),q(e,i,o),q(s,i,o)],a),s=e}};for(let[t,r]of[[dt[0][1],dt[1][0]],[dt[1][1],dt[0][0]+A]])n(t,r,0,.45,K),C(e,1.6,()=>n(t,r,.16,.3,$e,.035)),n(t,r,3.18,3.32);n(0,A,4.55,5.01,K,.03),[.4,1.9,2.5,3.7,5.2].forEach(e=>n(e,e+.05,4.68,4.86,Ze,.045));for(let e=0;e<70;e++){let n=(e+.5)*A/70,r=.07/Je;ft(n)&&[0,2].includes(e%5)&&t([q(n-r,.45),q(n+r,.45),q(n+r,4.55),q(n-r,4.55)])}let r=(e,n=.1,r,i=.03)=>e.slice(1).forEach(([a,o],s)=>{let[c,l]=e[s],u=Math.max(Math.abs(a-c),Math.abs(o-l)),d=(e,t)=>{let[r,s]=[c+(a-c)*e/u,l+(o-l)*e/u];return a==c?q(r*G+t*n/ut(s)[0],5+s,i):q(r*G,5+s+t*n/2.5,i)};for(let e=0;e<u;e++)t([d(e,-1),d(e,1),d(e+1,1),d(e+1,-1)],r)});for(let t=0;t<12;t++){let n=4*t;r([[n,0],[n,9]],.22,Xe,.05),1&t?(C(e,1.6,()=>r([[n,1],[n,8]],.04,$e,.065)),r([[n,4],[n+2,2],[n+4,4]]),r([[n,6],[n+1,7],[n+3,7],[n+4,6]])):(r([[n,2],[n+1,3],[n+3,3],[n+4,2]]),r([[n+1,3],[n+1,5],[n+2,6],[n+3,5],[n+3,3]]))}n(0,A,13.75,14.15,Xe,.05),C(e,1.6,()=>n(0,A,13.9,14,$e,.065));for(let[t,r]of[[5,0],[22,1],[34,0]])n(t*G+.02,(t+2)*G-.02,5.25+r,5.8+r,K,.03),C(e,2,()=>n(t*G+.04,t*G+.05,5.65+r,5.72+r,nt,.045));let[,i,a,o,s]=ae[0],c=qe+i-s;for(let[t,n,r]of[[-a-.62,-a-.3,0],[a+.3,a+.62,0],[-a-.62,a+.62,o+.3]])O(e,[W+t,r,c-.04],[W+n,o+.62,c+.6],K),C(e,1.5,()=>D(e,[[t+.1,r+.1],[n-.1,r+.1],[n-.1,o+.52],[t+.1,o+.52]].map(([e,t])=>[W+e,t,c-.055]),et,[W,1,qe]));for(let t=1;t<7;t++)for(let n of[-2.6,2.6])lt(e,W+n,c-2.5*t);let l=(e,t=0,n=0)=>[W+t,e,qe+n];ct(e,l(17),.7,K,0),st(e,l(17),l(25.099999999999998),.11),[1.9,1.5,1.1].forEach((t,n)=>{let r=20+1.6*n;st(e,1&n?l(r,0,-t):l(r,-t),1&n?l(r,0,t):l(r,t),.06)}),ct(e,l(25.4),.34,tt)})(e),(e=>{j.forEach(({min:t,max:n},r)=>{let i=r?2:0,a=2-i,[o,s]=[t[i],r?j[0].min[2]:n[i]];for(let r=1;o+5*r/3<s-1;r++)if(r%3){let[s,c]=[[0,0,0],[0,3.53,0]];[s[i],c[i]]=[o+5*r/3-.06,o+5*r/3+.06];for(let r of[0,1]){s[a]=r?n[a]:t[a]-.12,c[a]=s[a]+.12,O(e,s,c,Ye,12|(i?32:2)>>r);let o=r?c[a]+.015:s[a]-.015;C(e,1.8,()=>D(e,[[s[i]+.015,2.7],[c[i]-.015,2.7],[c[i]-.015,2.9],[s[i]+.015,2.9]].map(([e,t])=>{let n=[0,t,0];return[n[i],n[a]]=[e,o],n}),$e,[(t[0]+n[0])/2,2.8,(t[2]+n[2])/2]))}[s[a],c[a],s[1]]=[t[a]-.12,n[a]+.12,3.5],O(e,s,c,Ye,4|(i?48:3))}})})(e),(e=>{ee.forEach(({min:t,max:n},r)=>{for(let r of[0,2]){let i=2-r;for(let a of[-1,1]){let o=a>0?n[r]:t[r],s=(r?1:16)*(a>0?1:2),c=(e,t,n)=>{let s=[0,t,0];return[s[r],s[i]]=[o+a*n,e],s},l=(t,n,r,i=0)=>O(e,t.map((e,t)=>Math.min(e,n[t])),t.map((e,t)=>Math.max(e,n[t])),r,i),u=(t,n,r,i,a,o)=>D(e,[c(t,n,a),c(r,n,a),c(r,i,a),c(t,i,a)],o,c(t,n,-1)),[d]=be.filter(e=>Math.abs((a>0?e.max[r]:e.min[r])-o)<.01&&e.min[i]>t[i]&&e.max[i]<n[i]).map(e=>{let t=(e.min[i]+e.max[i])/2;return e.max[i]-e.min[i]>3?[t-2.25,t+2.25,3.62,0]:[t-1.32,t+1.32,w+.14,t]});l(c(t[i]-.06,4.7,0),c(n[i]+.06,5,.06),K,s|(r?48:3));for(let[e,r]of d?[[t[i],d[0]],[d[1],n[i]]]:[[t[i],n[i]]])l(c(e,0,0),c(r,.3,.04),Ye,4|s);let f=(t[i]+n[i])/2;for(let i of r?[1,-1]:[]){let r=i>0?t[0]:n[0],a=d?d[i>0?0:1]:f-.8*i;(a-r)*i>4.2&&(u(r,1,r+3*i,1.1,.02,Ye),u(r+4*i,2,a,2.1,.02,Ye),D(e,[c(r+3*i,1,.02),c(r+4*i,2,.02),c(r+4*i,2.1,.02),c(r+3*i,1.1,.02)],Ye,c(r,1,-1)))}if(r&&C(e,1.6,()=>u(t[0]+.3,4.82,n[0]-.3,4.9,.075,$e)),!r&&!d){u(f-1.1,.9,f+1.1,1.9,.02,K);for(let e=0;e<4;e++)u(f-1,1.05+.2*e,f+1,1.15+.2*e,.035,Ze)}if(d?.[3]){let t=d[3];l(c(t-.5,2.95,0),c(t+.5,3.05,.22),K,s),C(e,1.8,()=>l(c(t-.4,2.83,0),c(t+.4,2.95,.12),Qe,8|s)),l(c(t-.05,4.1,0),c(t+.05,4.2,.5),K,s),l(c(t-.5,4.2,.32),c(t+.5,4.42,.5),Ze),C(e,2,()=>u(t-.42,4.27,t-.3,4.35,.515,nt)),st(e,c(t+.35,4.42,.41),c(t+.35,5.4,.41),.03),ct(e,c(t+.35,5.45,.41),.07,tt);for(let n of[1.5,3.5,5.5])for(let r of[t-1.5,t+1.5]){let[t,,i]=c(r,0,n);lt(e,t,i)}}}}if(r){let r=n[0]-.7;O(e,[r-.3,5,t[2]+2],[r+.3,5.2,n[2]-2],K),[3.4,4.6,2.8].forEach((n,i)=>{let a=t[2]+2.5+1.5*i;st(e,[r,5.2,a],[r,5.2+n,a],.04),ct(e,[r,5.26+n,a],.07,1&i?tt:$e)})}else{let r=[n[0]-1.4,6.35,t[2]+1.4],i=e=>[r[0]+.6*e,r[1]+.8*e,r[2]];O(e,[r[0]-.4,5,r[2]-.4],[r[0]+.4,5.12,r[2]+.4],K),st(e,[r[0],5,r[2]],r,.16),ct(e,r,.26,K,0),b(e,ot,i(.1),i(1.1),rt,1,1.15),st(e,i(.2),i(1.05),.03),ct(e,i(1.1),.08,tt)}})})(e),(e=>{for(let t of pt){let n=t[5];if(mt(e,t,n+.1,0,K),ht(e,t,n,.015),t[6]){let r=e.length,i=[t[0],t[1],t[2],-t[3],-t[4]];mt(e,i,n+.1,T+.06,[.04,.04,.05]),mt(e,i,n,T+.08,[.45,.48,.5]);for(let t=r;t<e.length;t+=10)[e[t+3],e[t+4],e[t+5],e[t+8]]=[...xe,-2]}}})(e)})(e);for(let[t,n]of f.pads.slice(0,f.pads.length/2))kt(e,t,n);for(let[t,n]of f.masts.slice(0,f.masts.length/2))At(e,t,n,0)})(a),n.relief&&((t,n)=>{let{at:r}=n.relief,i=zt,a=(e,t)=>Math.max(r(e,Math.max(t,148)),0),o=e=>X(4*(Z(e/6,.5,82)-.35))*(.55+.45*Z(e/1.7,.5,83)),s=([e,t],n)=>{let[r,i,s]=Rt[n];return[e,n?r:a(e,t),t-i-s*o(e)*+!!n]};for(let n=0;n<i.length-1;n++){let[r,a]=[i[n],i[n+1]];for(let i=0;i<Rt.length-1;i++){let c=[s(r,i),s(a,i),s(a,i+1),s(r,i+1)];for(let[s,l,u]of n+i&1?[[0,1,2],[0,2,3]]:[[0,1,3],[1,2,3]]){let d=k(p(c[l],c[s]),p(c[u],c[s]));if(Math.hypot(...d)<1e-9)continue;d=e(d),d=d[2]>0||Math.abs(d[2])<1e-9&&d[1]<0?d.map(e=>-e):d;let f=Rt[i][3]*(.82+.3*N(n,i,73))*(.7+.3*o((r[0]+a[0])/2));for(let e of[c[s],c[l],c[u]])t.push(...e,...d,e[0]+e[2],e[1],E.ROCK,f)}}}f.pillars.forEach(([e,n,r,i,a],o)=>n>140&&Pt(t,e,n,r,i,a,o+400)),D(t,[[-2,-30,140],[162,-30,140],[162,-30,158],[-2,-30,158]],[.012,.012,.015]);for(let e=0;e<9;e++){let n=6+17*e+8*N(e,1,77);C(t,.1,()=>D(t,[[n,-29.9,140],[n+9+6*N(e,2,77),-29.9,140],[n+5,-29.9,140.25+.3*N(e,3,77)]],[.2,.55,1]));let r=1.5+2.5*N(e,4,77);Et(t,[n,-29.6,142.5+5*N(e,5,77)],[r,.7*r,r],e+200,.25,!1)}})(a,n);let d=n.relief?.at??(()=>0);f.crags.forEach(e=>((e,{at:[t,n,r],R:i,H:a,s},c)=>{let{reach:l}=h(s,i,a),u=[t,n+o(a),r];_e(e,i<1.5?3:i<2.5?4:5,e=>{let t=l(e);return[u[0]+e[0]*t,u[1]+e[1]*t,u[2]+e[2]*t]},n,n+a,s,.8+.4*N(s,5,41),c)})(a,e,d));let g=a.concat((e=>{let t=[];for(let n=0;n<e.length;n+=30)for(let r of[0,2,1]){let i=n+10*r;t.push(e[i],e[i+1],J-e[i+2],e[i+3],e[i+4],-e[i+5],...e.slice(i+6,i+10))}return t})(a));yield,n.relief&&((e,t)=>{for(let[n,i,a,o,s]of(e=>{let t=ne(e.relief),[n,i,a,o]=t.bound,s=(e,n)=>{if(e>t.hole[0]-.3&&e<t.hole[2]+.3&&n>t.hole[1]-.3&&n<t.hole[3]+.3||t.pits.some(t=>e>=t[0]-.3&&e<=t[2]+.3&&n>=t[1]-.3&&n<=t[3]+.3))return NaN;let[r,i]=[(e-t.x0)/t.cell,(n-t.z0)/t.cell],[a,o]=[Math.floor(r),Math.floor(i)],[s,c]=[r-a,i-o],l=a+o*t.nx,[u,d,f,p]=[t.h[l],t.h[l+1],t.h[l+t.nx],t.h[l+t.nx+1]];return s>=c?u+(d-u)*s+(p-d)*c:u+(f-u)*c+(p-f)*s},c=[],l=(e,t,r,l=1)=>{if(((e,t)=>{let r=t-J/2,c=([t,n,i,a])=>Math.hypot(Math.max(t-e,e-i,0),Math.max(n-r,r-a,0));return r>.3&&Math.hypot((e-n)/a,(t-i)/o)<.97&&!u.some(e=>c(e)<2.5)&&!_.some(e=>c(e)<1)&&!f.pits.some(n=>Math.abs(e-n.x)<M+.5&&Math.abs(t-n.z)<M+.5)&&!f.crags.some(n=>Math.hypot(e-n.at[0],t-n.at[2])<1.3*n.R)&&Number.isFinite(s(e,t))})(e,t)){let n=N(r,3,211);c.push([e,s(e,t),t,n<.62?0:n<.945+.055*(1-l)?1:2,r])}};f.sites.forEach(([e,t,n],r)=>{for(let i=0;i<Math.round(8+5*n);i++){let a=e=>N(r,5*i+e,201),o=n*(.1+1.7*a(1)*a(1));l(e+o*Math.cos(A*a(2)),t+o*Math.sin(A*a(2)),1e3*r+i)}}),f.crags.forEach(({at:[e,,t],R:n},r)=>{for(let i=0;i<Math.round(8+5*n);i++){let a=e=>N(r,5*i+e,215),o=n*(1.32+.75*a(1)*a(1));l(e+o*Math.cos(A*a(2)),t+o*Math.sin(A*a(2)),5e5+1e3*r+i)}}),f.bowls.forEach(([e,t,n],r)=>{for(let i=0;t>=J/2&&i<Math.round(1.1*n);i++){let a=e=>N(r,5*i+e,203),o=i%5<2?.94+.16*a(1):1.15+1.25*a(1)*a(1);l(e+o*n*Math.cos(A*a(2)),t+o*n*Math.sin(A*a(2)),1e5+1e3*r+i)}});for(let e=0;e<60;e++){let t=t=>N(e,t,205),n=1+158*t(1),i=r[Math.floor(n)];l(n,J/2+8+Math.max(i,0)+.5+2.5*t(2)*t(2),2e5+e,.5)}for(let e=0;e<18;e++){let t=t=>N(e,t,207),[r,i,s]=[n+a*(1.8*t(1)-.9),J/2+4+(o-8)*t(2),A*t(3)];for(let n=0;n<10+12*t(4);n++)s+=.5*(N(e,10+n,208)-.5),[r,i]=[r+(1+1.4*N(e,40+n,208))*Math.cos(s),i+(1+1.4*N(e,40+n,208))*Math.sin(s)],l(r+.8*(N(e,70+n,208)-.5),i+.8*(N(e,100+n,208)-.5),3e5+100*e+n,.6)}for(let e=0;e<520;e++){let t=t=>N(e,t,209),[r,i]=[n+a*(2*t(1)-1),J/2+o*t(2)];(Z(r/20,i/20,77)>.62||t(3)<.04)&&l(r,i,4e5+e,.7)}return[...c,...c.map(([e,,t,n,r])=>[e,s(e,J-t),J-t,n,r])]})(t)){let t=e=>N(s,e,213),r=Nt[o]*(.88+.24*t(1)),[c,l,u]=[r/2,r/2*(.65+.35*t(2)),r*(.5+.3*t(3))],[d,f]=[Math.cos(A*t(4)),Math.sin(A*t(4))],p=i+.1*u;_e(e,Mt[o],e=>{let[t,r]=[e[0]*d+e[2]*f,e[2]*d-e[0]*f],i=(.9+.2*Z(1.3*e[0]+s,1.3*e[2]+e[1],s%97))/Math.hypot(t/c,2*e[1]/u,r/l);return[n+e[0]*i,p+e[1]*i,a+e[2]*i]},i,p+u/2,s,.5+.25*t(5))}})(g,n);for(let[e,t,n,r,i]of f.pillars)t<140&&r>140&&Pt(g,e,t,n,r,i,401);return((e,t)=>{let n={relief:t.relief&&ne(t.relief)},r=(e,r,i)=>!t.relief||Array.from({length:17},(e,t)=>t*A/16).every((t,a)=>S(n,e+(a?i*Math.cos(t):0),r+(a?i*Math.sin(t):0))===0);for(let n=0,i=0;i<72&&n<900;n++){let[a,o,s]=[gt*N(n,1,61),J*N(n,2,61),.6+2*N(n,3,61)**2];if(!It(t,a,o,1.5*s)||!r(a,o,1.5*s)||Math.abs(o-Y[2])<24||(t.rovers??[]).some(([e,,t])=>Math.hypot(a-e,o-t)<6))continue;i++;let c=(e,t)=>{let[r,i,c]=Ft[e],[l,u]=[r*(e&&e<4?.86+.28*N(n,t%12,67):1),e===2||e===3?i*(.55+.45*N(n,t%12,68)):i],d=t*A/12,[f,p]=[Math.cos(d),Math.sin(d)],[m,h]=[Ft[Math.max(e-1,0)],Ft[Math.min(e+1,Ft.length-1)]],g=-3*(h[1]-m[1])/((h[0]-m[0])*s),_=Math.hypot(g,1),[v,y]=[a+f*l*s,o+p*l*s];return[v,u,y,g*f/_,1/_,g*p/_,v,y,E.STONE,c]};for(let t=0;t<Ft.length-1;t++)for(let n=0;n<12;n++){let[r,i,a,o]=[c(t,n),c(t+1,n),c(t+1,n+1),c(t,n+1)];e.push(...r,...a,...i,...r,...o,...a)}}})(g,n),yield,n.relief&&(((t,n)=>{let{at:r}=n.relief,i=(e,t)=>r(e,Math.max(t,148));for(let n of[1,-1]){let r=(t,r)=>{let a=e([i(t-1,r)-i(t+1,r),2,n*(i(t,r-1)-i(t,r+1))]);return[t,Math.max(i(t,r),0),140+n*(r-140),...a,t,140+n*(r-140),E.STONE,1]};for(let e=0;e<zt.length-1;e++){let[n,i]=[zt[e],zt[e+1]];if(n[0]!==i[0]){let[e,a,o,s]=[r(n[0],156),r(i[0],156),r(i[0],i[1]),r(n[0],n[1])];t.push(...e,...o,...a,...e,...s,...o)}}}})(g,n),(n=>{for(let[r,{x:i,z:a,level:o,rows:s}]of f.pits.entries()){let c=(e,t)=>s[e]?.[2+t]??0,u=Array.from({length:s.length+1},(e,t)=>[s[0][0]+t,-Math.min(c(t-1,0),c(t,0)),Math.min(c(t-1,1),c(t,1))]),d=(e,t)=>[e,o,t,0,1,0,e,t,E.STONE,.6+.4*X((Math.hypot(e-i,t-a)-m)/3)],f=(e,t,r,i)=>n.push(...e,...r,...t,...e,...i,...r);for(let[e,t]of[[a-M,a-m],[a+m,a+M]])for(let n=i-M;n<i+M;n+=2)f(d(n,e),d(n+2,e),d(n+2,t),d(n,t));for(let t=0;t<u.length-1;t++){let[[s,c,p],[m,h,g]]=[u[t],u[t+1]];f(d(i-M,s),d(i+c,s),d(i+h,m),d(i-M,m)),f(d(i+p,s),d(i+M,s),d(i+M,m),d(i+g,m));for(let s of[1,2]){let c=[o,o-.6,o-5,o-10,l],d=(e,t)=>[i+e[s]+(s>1?-1:1)*(t&&t<4?.9*N(e[0],t,83+s)-.25:0),c[t],e[0]];for(let f=0;f<4;f++){let p=[d(u[t],f),d(u[t+1],f),d(u[t+1],f+1),d(u[t],f+1)],m=[i+(s>1?99:-99),c[f],a],h=n.length;Dt(n,[p[0],p[1],p[2]],m,l-12,o,r+f,1.2),Dt(n,[p[0],p[2],p[3]],m,l-12,o,r+f,1.2);for(let t=h+3;t<n.length;t+=10){let r=e([n[t],n[t+1]+.9,n[t+2]]);[n[t],n[t+1],n[t+2]]=r}}}}let p=(e,t)=>[e,l,t,0,1,0,e,t,E.STONE,.5];f(p(i-m-1.5,a-m),p(i+m+1.5,a-m),p(i+m+1.5,a+m),p(i-m-1.5,a+m));let h=s[m][3],g=(o-l)/t;for(let e=0;e<t-1;e++){let o=i+h-1.3*(t-1-e);Ot(n,[[o,l-1,a-1,o+1.3,l+g*(e+1),a+1]],l,9*r+e,2,.9)}for(let e=0;e<20;e++){let t=A*(e+N(r,e,85))/20,[s,c,l]=[i+(m+1.6)*Math.cos(t),a+(m+1.6)*Math.sin(t),.3+.35*N(r,e,86)];Ot(n,[[s-l,o-.3,c-l,s+l,o+.9*l,c+l]],o,40*r+e,1,.9)}}})(g),yield,((e,t)=>{let{at:n}=t.relief,r={relief:ne(t.relief)};f.bowls.forEach(([t,i,a],o)=>{let s=a<12?0:Math.round(A*a/1.5),c=Array.from({length:s},(e,r)=>{let[o,c]=[Math.cos(A*r/s),Math.sin(A*r/s)],[l,u]=[a,-1/0];for(let e=.8*a;e<1.3*a;e+=.5){let r=n(t+o*e,i+c*e);[l,u]=r>u?[e,r]:[l,u]}return l}),l=Array.from({length:s},(e,n)=>{let[a,l]=[Math.cos(A*n/s),Math.sin(A*n/s)],u=[-2,-1,0,1,2].reduce((e,t)=>e+c[(n+t+s)%s],0)/5,d=N(n,o,87);return[-2.4,-1.2,0,1.2,2.4].map((e,s)=>{let[c,f]=[t+a*(u+e),i+l*(u+e)],p=[.04,.12,.1+.15*d,.1,.04][s],m=[.62+.3*N(n>>1,o,88),.9,1.22+.2*d,1.1,1][s];return[c,S(r,c,f)+p,f,0,1,0,c,f,E.STONE,m]})});l.forEach((t,n)=>{let r=l[(n+1)%s];for(let n=0;n<4;n++)[t[n],t[n+1],r[n],r[n+1]].every(e=>Number.isFinite(e[1]))&&e.push(...t[n],...r[n+1],...r[n],...t[n],...t[n+1],...r[n+1])})})})(g,n),yield,((t,n)=>{let r=ne(n.relief),[i,a,o,s]=r.bound,[c,l]=[Lt(r.x0,i+o),Lt(r.z0,a+s)],u=(e,t)=>{let[i,a]=[(e-r.x0)/r.cell,(t-r.z0)/r.cell];return i%1||a%1||i<0||a<0||i>=r.nx||a>=r.nz?n.relief.at(e,t):r.h[i+a*r.nx]},d=(e,t)=>f.bowls.reduce((n,[r,i,a])=>{let o=Math.hypot(e-r,t-i),s=o/a,c=Z((e-r)/o*5+r,(t-i)/o*5+i,19);return s>1.05&&s<2.4?n+.22*X(5*(c-.55))*X((2.4-s)/.9)*X(6*(s-1.05)):n},0),p=/* @__PURE__ */ new Map,m=(t,n)=>{let r=4096*t+n,i=p.get(r);if(!i){let a=u(t,n),o=[u(t-4,n)-u(t+4,n),u(t,n-4)-u(t,n+4)],s=a===0&&o[0]===0&&o[1]===0,c=e=>s?0:1.4*(N(t,n,131+e)-.5);i=[t,a,n,...e([o[0]+c(0),8,o[1]+c(1)]),t,n,E.STONE,Math.min(Math.max(1+a/60,.78),1.2)+d(t,n)],p.set(r,i)}return i},h=(e,t)=>{let[n,r,u,d]=[c[e],c[e+1],l[t],l[t+1]];if(!(n<r&&u<d))return 0;let f=Math.hypot((Math.min(Math.max(i,n),r)-i)/o,(Math.min(Math.max(a,u),d)-a)/s);return f<1?2:+(f<1.65)};for(let e=0;e<c.length-1;e++)for(let n=0;n<l.length-1;n++){let[i,a,o,s,u]=[c[e],c[e+1],l[n],l[n+1],h(e,n)];if(u>1)for(let e=i;e<a;e+=r.cell)for(let n=o;n<s;n+=r.cell){if(e>=r.hole[0]&&e<r.hole[2]&&n>=r.hole[1]-8&&n<r.hole[3]+8||f.pits.some(t=>e>=t.x-M&&e<t.x+M&&n>=t.z-M&&n<t.z+M))continue;let[i,a,o,s]=[m(e,n),m(e+r.cell,n),m(e+r.cell,n+r.cell),m(e,n+r.cell)];t.push(...i,...o,...a,...i,...s,...o)}else if(u){let r=[];for(let[t,c,l,u,d]of[[i,o,a,o,h(e,n-1)],[a,o,a,s,h(e+1,n)],[a,s,i,s,h(e,n+1)],[i,s,i,o,h(e-1,n)]]){let e=d>1?5:1;for(let n=0;n<e;n++)r.push(m(t+(l-t)*n/e,c+(u-c)*n/e))}let c=m((i+a)/2,(o+s)/2);r.forEach((e,n)=>t.push(...c,...r[(n+1)%r.length],...e))}}})(g,n),yield,((t,n)=>{let{at:r}=n.relief,i=e(k([0,1,0],vt)),a=[i,k(vt,i),vt];for(let[e,n]of f.dishes)At(t,e,n,r(e,n),6,[1,.25,.15]),s(t,Ct,[e,r(e,n)+5.2,n],a,[0,0,-.9],1);for(let[e,n,i,a]of f.ramps)for(let o of[-8,8])At(t,e+o*a,n-o*i,r(e+o*a,n-o*i),2.2,[1,.45,.1]);let[o,c]=f.wreck,u=l,d=e([.8,-.35,.5]),p=e(k([0,1,0],d));s(t,St,[o-3,u+3.1,c-2],[p,k(d,p),d],[0,0,0],[1.6,1.4,.55],[.6,.6,.62]),D(t,[[o+3,u,c+4],[o+6.5,u+.2,c+5],[o+4,u+2.6,c+5.5]],[.7,.3,.14]),At(t,o-3.4,c+2.6,u,3.5,[1,.12,.08])})(g,n)),((t,n)=>{for(let[r,a,o,s,c,l]of Bt){let u=t=>{let u=t*A/480,[d,f]=[Math.cos(u),Math.sin(u)],p=a*Vt(d,f,r,l),m=(t+1)*A/480,h=(a*Vt(Math.cos(m),Math.sin(m),r,l)-p)/(r*A/480);return Array.from({length:o+1},(t,a)=>{let u=a/o,m=r-.3*p*(1-u),g=r/(30+26*(1-u))*(1+.05*u),_=2*Z(d*g+l+1.7*u,f*g-1.3*u,l+9)-1,v=e([-d-f*(-1.5*h-1.6*_*(1-.5*u)),.75,d*(-1.5*h-1.6*_*(1-.5*u))-f]),y=Math.max(i(v,n),0),b=(.8+.3*Z(d*r/90-l,f*r/90+2.3*u,l+11))*(.72+.28*X(.5+.9*_))*(c+(s-c)*Math.min(1.2*y+(a===o?.3:0),1));return[Y[0]+d*m,(p+25)*u-25,Y[2]+f*m,d,0,f,b,b,-2,1.03*b]})},d=u(0);for(let e=1;e<=480;e++){let n=u(e%480);for(let e=0;e<o;e++)t.push(...d[e],...n[e],...n[e+1],...d[e],...n[e+1],...d[e+1]);d=n}}})(g,e(n.sun.dir)),g}var Ut=()=>{let t=[];return(t=>{let n=vt,r=n.map(e=>-e),i=e([r[2],0,-r[0]]),a=k(r,i),o=n.map((e,t)=>Y[t]+800*e),s=n.map((e,t)=>o[t]+100*e),[c,l]=[28,64],u=(e,t)=>o.map((n,r)=>n+60*e*(i[r]*Math.cos(t)+a[r]*Math.sin(t))),d=t.length;for(let e=0;e<c;e++)for(let n=0;n<l;n++){let[r,i]=[n*A/l,(n+1)*A/l],[a,o]=[(e+.5)/c,(n+.5)*A/l],[d,f]=[a*Math.cos(o),a*Math.sin(o)],p=Math.sqrt(1-a*a),[m,h]=[(Math.atan2(d,p)+1.5)/A*12,6*(Math.asin(f)/Math.PI+.5)],g=yt(m,h,11)>.5?ue([.13,.32,.09],[.4,.3,.15],yt(2*m,2*h,13)):[.03,.16,.5],_=Math.abs(f)>.93?1:X(4*(yt(1.5*m+4,3*h,17)-.5));g=ue(g,[.95,.97,1],_).map(e=>e*(.55+.45*Math.max(0,.3*d+.25*f+.9*p))*(.6+.4*p)),D(t,e?[u(e/c,r),u((e+1)/c,r),u((e+1)/c,i),u(e/c,i)]:[u(0,0),u(1/c,r),u(1/c,i)],g,s)}ge(t,d,1.5)})(t),t},{FORWARD:Wt,BACK:Gt,JUMP:Kt,CROUCH:qt,SPRINT:Jt,USE:Yt}=oe,Q=[.78,.8,.84],Xt=[.95,.68,.22],Zt=[.06,.06,.07],Qt=[.9,.9,.88],$t=[.14,.24,.55],en=[.75,.42,.2],tn=[3.2,.35,.15],nn=2*Math.PI,rn=(e,t,n,r,i)=>e.push(...t,...n,r[0],r[1],i,r[2]),$=(e,t,n,r,i=-1)=>{let[[a,o],[s,c],[l,u]]=[0,1,2].map(e=>[t[e],n[e]]),d=[[[0,1,0],[[a,c,l],[a,c,u],[o,c,u],[o,c,l]]],[[0,-1,0],[[a,s,l],[o,s,l],[o,s,u],[a,s,u]]],[[1,0,0],[[o,s,l],[o,c,l],[o,c,u],[o,s,u]]],[[-1,0,0],[[a,s,l],[a,s,u],[a,c,u],[a,c,l]]],[[0,0,1],[[a,s,u],[o,s,u],[o,c,u],[a,c,u]]],[[0,0,-1],[[a,s,l],[a,c,l],[o,c,l],[o,s,l]]]];for(let[t,n]of d)for(let a of[0,1,2,0,2,3])rn(e,n[a],t,r,i)},an=(e,t,n,r)=>{let i=c(y(e,r),t);for(let e=8;e<i.length;e+=10)i[e]=n;return i},on=(e,t,n,r,i,a=-1,o=48)=>s(e,an(t,i,a,o),n,g(r,Math.abs(r[1])>.9?[1,0,0]:[0,1,0]),[0,0,0],1),sn=(e,t,r,i,a,o=n)=>b(e,an([[0,0],[i,0],[i,1],[0,1]],a,o,8),t,r,[0,1,0],1),cn=(e,t,n)=>{let r=43758.5453*Math.sin(127.1*e+311.7*t+74.7*n);return 2*(r-Math.floor(r))-1},ln=(e,t,n,r,i=-2)=>{for(let a of[0,1,2,0,2,3])rn(e,[t[a][0],n,t[a][1]],[0,1,0],r,i)},un=[.55,.57,.6],dn=[.9,.45,.08],fn=[.95,.75,.1],pn=[.4,2.6,1.6],mn=[2.6,1.3,.25],hn=[.08,.35,.8],gn=[2.2,2.3,2.6];function*_n(e,t){let r=yield*Ht(e);return yield,r=r.concat((({brushes:e},t)=>{let n=[];for(let r of e)r.ghost&&r.tint&&Le(n,r,2*Math.max(0,t.indexOf(`${r.tint}`)));let r=[];(e=>{[...fe,...Ve].forEach(t=>((e,[t,n,r,i,a,o,c,l])=>{let u=1&l?2:0,[d,f]=[[n,o,r],[i,c,a]],p=l<2?1:-1,m=(e,t,n)=>{let r=[0,o+t,0];return r[u]=(p>0?d[u]:f[u])+p*n,r[2-u]=d[2-u]+e,r},[h,g,_]=[f[2-u]-d[2-u],f[u]-d[u],c-o],v=(t,n,r)=>{let[i,a]=[m(t[0],t[1],t[2]),m(n[0],n[1],n[2])];O(e,i.map((e,t)=>Math.min(e,a[t])),i.map((e,t)=>Math.max(e,a[t])),r)},y=(t,n,r,i,a,o,s=1)=>C(e,s,()=>D(e,[m(t,n,a),m(r,n,a),m(r,i,a),m(t,i,a)],o,m(t,n,a-1))),S=(e,t,n,r,i,a)=>{v([e,t,i-.06],[n,r,i],B),y(e+.04,t+.04,n-.04,r-.04,i+.005,a,.45);for(let o=0;r-t>.3&&o<4;o++){let s=r-.12-o*((r-t-.16)/4);y(e+.08,s-.025,e+.08+(n-e-.16)*(.4+(7*e+o)%4*.15),s,i+.01,a,1.1)}};Re(e,()=>{if(t==le.BENCH){v([0,_-.06,0],[h,_,g],R),v([.05,0,0],[h-.05,_-.06,g-.06],ke);for(let e=1.1;e<h-.5;e+=1.1)v([e-.01,.1,g-.06],[e+.01,_-.1,g-.05],B);for(let e=0;e<4;e++){let t=1.4+2.75*e;v([t-.05,_,.16],[t+.05,_+.22,.22],B),S(t-.45,_+.2,t+.45,_+.75,.28,[V,H,Me,V][e]),v([t-.3,_,.45],[t+.3,_+.025,.65],z),v([t+.7,_,.2],[t+.82,_+.2,.32],[H,Ae,Me,Pe][e])}}else if(t==le.SAMPLES){v([0,_-.05,0],[h,_,g],z),v([.15,.18,.15],[h-.15,.22,g-.15],B);for(let e of[.1,h-.2])for(let t of[.1,g-.2])v([e,0,t],[e+.1,_-.05,t+.1],B);for(let e=0;e<4;e++){let t=.25+1.2*e;v([t,_,.3],[t+.9,_+.07,1.2],B),y(t+.05,_+.015,t+.85,_+.055,1.205,V,1.2),v([t+.28,_+.07,.55],[t+.62,_+.07+(.16+e%3*.07),.95],[.4+.05*e,.38,.35]);for(let[e,n]of[[0,.3],[.88,.3],[0,1.18],[.88,1.18]])v([t+e,_+.07,n],[t+e+.02,_+.55,n+.02],ke);v([t,_+.53,.3],[t+.9,_+.55,1.2],[.5,.6,.66])}}else if(t==le.RACKS){v([0,0,0],[h,_,g],B);for(let e=0;e<3;e++){let t=.1+1.63*e;for(let n=0;n<12;n++){let r=.25+.2*n;y(t,r,t+1.43,r+.16,g+.01,z,.25);for(let i=0;i<5;i++){let a=[H,Me,H,V,Ne,null][(7*e+5*n+3*i)%6];a&&y(t+.1+.08*i,r+.06,t+.14+.08*i,r+.1,g+.015,a,1.6)}}y(t,_-.4,t+1.43,_-.34,g+.01,V,.9)}}else if(t==le.SCOPE){v([.2,0,.2],[1,.1,1],B),v([.45,.1,.45],[.75,.85,.75],R),y(.52,.55,.68,.65,.755,H,1.4),v([.35,.85,.35],[.85,1.05,.85],z);let[t,n]=[m(.6,.9,.2),m(1.4,2.8,2.1)];b(e,x(2,1,[1,1],[0,0]),t,n,[1,0,0],1,.2,R),b(e,x(2,1,[1,1],[0,0]),m(1.3,2.56,1.86),m(1.42,2.83,2.13),[1,0,0],1,.24,B),b(e,x(2,1,[1,1],[0,0]),m(.86,1.4,.6),m(1.2,2.2,1.4),[1,0,0],1,.05,z)}else if(t==le.ANALYSER){v([0,0,0],[h,.9,g],R),v([0,.9,0],[h,_,.5],R),S(.12,.92,.95,1.26,.56,H),v([1.1,.9,.55],[1.88,1.18,1.1],z),y(1.16,.95,1.82,1.13,1.105,Pe,1.3);for(let e=0;e<6;e++)y(.15+.12*e,.74,.22+.12*e,.8,g+.005,[Me,H,V][e%3],1.4);for(let e of[.3,.6])v([.05,e,g],[h-.05,e+.015,g+.005],B)}else if(t==le.PLANTS){for(let e of[0,h/2-.03,h-.06])v([e,0,0],[e+.06,_,g],z);v([0,_-.04,0],[h,_,g],R);for(let t of[.3,.9,1.5]){v([0,t,0],[h,t+.04,g],R),v([.1,t+.04,.12],[h-.1,t+.18,g-.12],je);for(let e=.25;e<h-.15;e+=.4)v([e-.1,t+.18,.2],[e+.1,t+.18+(.12+(10*e+3*t)%3*.06),g-.2],10*e%2<1?[.18,.5,.16]:[.3,.62,.2]);C(e,1.1,()=>v([.1,t+.53,.3],[h-.1,t+.56,g-.3],Fe))}}else if(t==le.LOCKERS){v([0,0,0],[h,_,g],Ae);for(let e=0;e<6;e++){let t=.8*e;e&&v([t-.01,.05,g],[t+.01,_-.05,g+.01],B);for(let e=0;e<3;e++)v([t+.2,1.7+.08*e,g],[t+.6,1.73+.08*e,g+.01],B);v([t+.64,.95,g],[t+.68,1.2,g+.04],ke),y(t+.3,1.5,t+.5,1.56,g+.012,Me,.8)}}else if(t==le.SUIT){v([.1,0,.1],[.9,.06,.9],B),v([.47,.06,.06],[.53,1.7,.14],z);for(let e of[.27,.54])v([e-.02,.06,.36],[e+.21,.22,.68],z),v([e,.22,.4],[e+.19,.95,.62],R);v([.22,.95,.32],[.78,1.58,.7],R),v([.25,1,.14],[.75,1.62,.32],ke);for(let e of[.08,.78])v([e,1,.4],[e+.14,1.54,.6],R),v([e,.88,.4],[e+.14,1,.6],z);y(.34,1.3,.5,1.42,.705,V,1),y(.56,1.34,.64,1.42,.705,Ne,1.2),s(e,x(2,0,[1,1]),m(.5,1.8,.5),pe,[0,0,0],.21,R),y(.38,1.74,.62,1.88,.715,Me,.7)}else{v([0,0,0],[h,_,.05],z),y(.1,.35,.6*h,_-.1,.055,V,.5);for(let e=0;e<12;e++)y(.66*h+e%3*.2,.4+.25*(e>>2),.66*h+e%3*.2+.1,.5+.25*(e>>2),.055,[H,Me,Ne,V][e%4],1.3);y(.1,.1,h-.1,.18,.055,Me,.9)}})})(e,t));let[,t]=ae[0],n=F+t+.03;U(e,2,n,[P-3,3.4,0],[P+3,4.3,0],Te);for(let t of[3.42,4.22])U(e,2,n+.01,[P-2.95,t,0],[P+2.95,t+.05,0],Ce);for(let t=0;t<9;t++){let r=P-2.6+.6*t;U(e,2,n+.01,[r,3.9,0],[r+.45,4.1,0],[.9,.95,1]),U(e,2,n+.01,[r+.05,3.6,0],[r+.3+t%2*.1,3.7,0],V)}for(let[t,n]of[[P+16.6,.3],[P+17.1,.15]])Re(e,()=>O(e,[t,2.94,F-6.7],[t+n,3.06,F+6.7],B));j.forEach(({min:t,max:n},r)=>{let i=r?2:0,[a,o]=[t[i],r?j[0].min[2]:n[i]],s=t[2-i]+T,c=[0,2,0],l=[0,2.1,0];[c[i],l[i],c[2-i],l[2-i]]=[a,o,s,s+.12],Re(e,()=>O(e,c,l,B));for(let t=a+2.5;t<o-1;t+=5){let[n,r]=[[0,1.3,0],[0,1.5,0]];[n[i],r[i]]=[t-.2,t+.2],U(e,2-i,s+.03,n,r,H)}});for(let t of be){let n=t.max[0]-t.min[0]<1?0:2,[r]=ee.filter(({min:e,max:n})=>e[0]<=t.min[0]&&t.max[0]<=n[0]&&e[2]<=t.min[2]&&t.max[2]<=n[2]),i=(r.min[n]+r.max[n])/2>t.min[n]?1:-1,a=(i>0?t.max[n]:t.min[n])+.02*i,[o,s]=[t.min[2-n],t.max[2-n]];if(j.some(e=>[0,2].every(n=>e.min[n]<=t.max[n]+.01&&t.min[n]-.01<=e.max[n])))continue;for(let t=0;o+.3*t<s;t++){let[r,i]=[[0,w+.05,0],[0,w+.35,0]];[r[2-n],i[2-n]]=[o+.3*t,Math.min(o+.3*t+.15,s)],U(e,n,a,r,i,Me),[r[2-n],i[2-n]]=[i[2-n],Math.min(o+.3*t+.3,s)],U(e,n,a,r,i,B)}let c=(o+s)/2,[l,u]=[[0,3.2,0],[0,3.45,0]];[l[2-n],u[2-n]]=[c-.15,c+.15],U(e,n,a,l,u,Ne)}})(r);for(let e of r)n.push(e);for(let e=0;e<r.length;e+=30)for(let t of[0,2,1]){let i=e+10*t;n.push(r[i],r[i+1],280-r[i+2],r[i+3],r[i+4],-r[i+5],...r.slice(i+6,i+10))}return n})(e,t)),e.station&&(yield,r=r.concat((({hall:[e],post:t,hull:[r,i,o,s],gun:c})=>{let l=[],{R:u}=v,d=t[0][1],[f,p]=[e[0],e[0]+48],m=[f,p].flatMap(e=>{let t=Math.acos((e-r)/u);return[t,nn-t]}),h=[...Array.from({length:72},(e,t)=>t*nn/72),...m,nn].sort((e,t)=>e-t);for(let e=i;e<s-.01;e+=2){let t=e>=d+30&&e<s-14;for(let i=0;i+1<h.length;i++){let[a,s]=[h[i],h[i+1]],c=(a+s)/2,m=r+u*Math.cos(c);if(m>f&&m<p&&e>=d-2&&e<d+16)continue;let g=t,_=g?.22:.03;for(let[t,a]of[[i,e],[i+1,e],[i+1,e+2],[i,e],[i+1,e+2],[i,e+2]]){let e=h[t],i=t%(h.length-1),[s,c]=[cn(i,a,1)*_,cn(i,a,2)*_],d=[Math.cos(e)+s*Math.sin(e),c,Math.sin(e)-s*Math.cos(e)];rn(l,[r+u*Math.cos(e),a,o+u*Math.sin(e)],d,g?Xt:Q,g?ie:n)}}}on(l,[[u,0],[u-3,3],[.6*u,a.DOME-1],[0,a.DOME]],[r,s,o],[0,1,0],Q,n);let g=[r-16,s+a.MAST,o];sn(l,[g[0],s+4,o],g,.8,Q);let _=Array.from({length:6},(e,t)=>[2.4*t,3.6*(t/5)**2]);on(l,[..._,...[..._].reverse().map(([e,t])=>[e,t-.3])],g,[-.6,.8,0],Qt,-1,20);let y=a.BARREL*u,b=i-c[1];on(l,[[u,0],[u-1.5,2],[y+2,2.6],[0,2.6]],[r,i,o],[0,-1,0],Q,n),on(l,[[0,2.6],[y+2,2.6],[y+2,5],[y,6.5],[y,b-4],[y+3,b-1.5],[y+3,b],[y-2,b],[y-3,b-10],[0,b-10.5]],[r,i,o],[0,-1,0],Zt,n);for(let e=10;e<b-8;e+=7)on(l,[[0,e],[y+.8,e],[y+.8,e+1.6],[0,e+1.6]],[r,i,o],[0,-1,0],Q,n);on(l,[[0,b-10.3],[y-3.5,b-10.1],[0,b-9.9]],[r,i,o],[0,-1,0],tn,-2),$(l,[r-y-8,c[1]-18,o-16],[r-y-7.2,c[1]+8,o+16],Qt,n),sn(l,[r-y-1,c[1]+3,o],[r-y-7.2,c[1]+3,o],.6,Q);let x=i+(s-i)*a.WING,[S,C,w]=[a.PANEL,a.SPAN,a.GAP];for(let e of[-1,1]){let t=r+e*(u+a.BOOM);sn(l,[r+e*u,x,o],[t,x,o],1.4,Q),$(l,[Math.min(t,t+3*e),x-6,o-2],[Math.max(t,t+3*e),x+6,o+2],Q,n),sn(l,[t,x,o],[t+e*(4*(S+w)+2),x,o],.6,en);for(let r=0;r<4;r++){let i=t+e*(3+r*(S+w)),[a,s]=[Math.min(i,i+e*S),Math.max(i,i+e*S)];$(l,[a,x-C/2,o-.2],[s,x+C/2,o+.2],$t,n);for(let e of[x-C/2,x+C/2-.6,x-.3,x-C/4,x+C/4-.3])$(l,[a,e,o-.3],[s,e+.6,o+.3],Q,n);for(let e of[a,a+S/2-.3,s-.6])$(l,[e,x-C/2,o-.3],[e+.6,x+C/2,o+.3],Q,n)}}return l})(e.station),(({hall:[e],post:t,hull:[r,,i]})=>{let a=[],o=t[0][1],[s,c]=[e[0]+4,e[0]+44],[l,u]=[i-v.R,i+v.R];for(let[e,t,n,r]of[[s+.5,2.4,.25,1],[s+.5,3.1,.16,1],[s+.7,8.5,.4,1],[c-.5,4.6,.25,-1],[c-.7,8.5,.4,-1]]){sn(a,[e,o+t,l+5],[e,o+t,u-5],n,un);for(let i=l+8;i<u-5;i+=8)$(a,[Math.min(e,e-.5*r),o+t-n-.1,i-.15],[Math.max(e,e-.5*r)+.01,o+t+n+.1,i+.15],Zt),i/8%3<1&&sn(a,[e,o+t,i+1.5],[e,o+t,i+1.8],n+.12,dn,-1)}for(let e of[s+.6,c-.6])for(let t of[l+6,u-6])sn(a,[e,o,t],[e,o+14,t],.3,un);for(let e of[r-10,r+10])sn(a,[e,o+13.2,l+5],[e,o+13.2,u-5],.6,un);for(let e=l+10;e<u-5;e+=12)$(a,[r-4,o+13.7,e-.6],[r+4,o+13.9,e+.6],gn,-2);for(let e of[-1,1]){let[t,n]=[r+6,i+10*e];for(let e=0;e<32;e++){let[r,i]=[e*nn/32,(e+1)*nn/32],s=(e,r)=>[t+r*Math.cos(e),n+r*Math.sin(e)];ln(a,[s(r,7),s(i,7),s(i,6.4),s(r,6.4)],o+.03,fn,-1),e%4==0&&$(a,[t+7.4*Math.cos(r)-.15,o,n+7.4*Math.sin(r)-.15],[t+7.4*Math.cos(r)+.15,o+.12,n+7.4*Math.sin(r)+.15],mn,-2)}let d=e<0?l:u;for(let r=n+10*e;e*(d-r)>4;r+=5*e)for(let n of[-1,1])ln(a,[[t+.4*n,r+1.2*e],[t+3.2*n,r-.6*e],[t+3.2*n,r-1.3*e],[t+.4*n,r+.5*e]],o+.04,mn);ln(a,[[s,d-.6*e],[c,d-.6*e],[c,d-.2*e],[s,d-.2*e]],o+.04,pn);for(let t of[s+.06,c-.06])$(a,[t-.06,o,d-.6*e-.2],[t+.06,o+11,d-.6*e+.2],pn,-2);$(a,[s,o+10.94,d-.6*e-.2],[c,o+11,d-.6*e+.2],pn,-2)}let[d,f]=[c+4.2,c+13.5];for(let e of[-1,1]){let t=i+8*e;$(a,[d,o,Math.min(t,t-1.1*e)],[f,o+1,Math.max(t,t-1.1*e)],Zt,n);for(let n=d+.4;n<f-1.5;n+=2.3)$(a,[n,o+1.4,Math.min(t,t-.05*e)],[n+1.9,o+2.6,Math.max(t,t-.05*e)],hn,-2)}return $(a,[c+17.94,o+1.2,i-4],[c+18,o+3.4,i+4],hn,-2),a})(e.station))),yield,{land:r,sky:Ut(),heavens:_t}}export{_n as default};
@@ -0,0 +1,2 @@
1
+ /** The body in its own frame at a level of detail: what keeps its colours, and what takes the team's, white. */
2
+ export declare const body: (level: number) => [number[], number[]];
@@ -0,0 +1,17 @@
1
+ export declare const CAGE: number[];
2
+ export declare const STEEL: number[];
3
+ export declare const ENGINE: number[];
4
+ export declare const DARK: number[];
5
+ export declare const SEAT: number[];
6
+ export declare const LAMP: number[];
7
+ export declare const TAIL: number[];
8
+ export declare const DIALS: number[];
9
+ export declare const WHITE: number[];
10
+ export declare const ROUNDEL: number[];
11
+ /** The body's half width: the pods, the floor, the cage's feet, the dash. */
12
+ export declare const SIDE = 0.92;
13
+ /** The top of the side pods, and where their sides meet the floor, leaning in. */
14
+ export declare const POD_Y = 0.1;
15
+ export declare const FOOT: number;
16
+ /** The pods' top edge from the tail to the dash, [ahead, height]: dipped between the hoops where the crew climbs in. */
17
+ export declare const EDGE: [number, number][];
@@ -0,0 +1,2 @@
1
+ import type { Look } from '../rover';
2
+ export declare const BUGGY: Look;
@@ -0,0 +1,2 @@
1
+ /** Appends both pods at a level of detail (0 far, 1 mid, 2 near). */
2
+ export declare const pods: (o: number[], t: number[], level: number) => void;
@@ -0,0 +1,19 @@
1
+ /** Black rubber, its tread dusted with sand, the pale rim and its dark hub. */
2
+ export declare const RUBBER: number[];
3
+ export declare const RIM: number[];
4
+ /** Half the tyre's width (wider than the rover's 0.15), the carcass and the paddles' tops either side of WR, the rim's radius. */
5
+ export declare const HALF = 0.2;
6
+ export declare const RIM_R = 0.27;
7
+ /** A tyre's profile, back (inner side) to front (outer side): a rounded carcass between two rim beads. */
8
+ export declare const TYRE: [number, number][];
9
+ /**
10
+ * A wheel about the x axis: the tyre, a dished rim and a dark hub; near by, paddles across the
11
+ * tread, one every other facet, the sand tyre's scoops.
12
+ */
13
+ export declare const wheel: (level: number) => number[];
14
+ /**
15
+ * A mudguard over a wheel about the x axis, as the moon rover's (rover/parts.ts) but as wide as the
16
+ * sand tyre: an arc of `n` plates over the top in the team's colour (white), a lip down its outer
17
+ * edge near by. It turns with the wheel's steering, not with its roll.
18
+ */
19
+ export declare const fender: (n: number) => number[];
@@ -11,6 +11,11 @@ export declare const DUST_MAX = 240;
11
11
  export declare const DUST_LIFE = 1.6;
12
12
  /** Metres from the eye past which no dust is raised: it is too small to see. */
13
13
  export declare const DUST_FAR = 120;
14
+ /**
15
+ * What PUFF's grey and blue are multiplied by on Landfall's sand (the user, 2026-11-27): a pale
16
+ * warm sand, not the moon's grey (layer -3 has a grey and a blue only).
17
+ */
18
+ export declare const SAND_TINT: number[];
14
19
  export interface Dust {
15
20
  /** Moves the puffs by dt seconds, then lets the rovers' wheels throw new ones. */
16
21
  update(rovers: Rover[], world: World, dt: number, eye?: Vec3): void;
@@ -109,7 +109,7 @@ export declare const strokeShare: (v: number) => number;
109
109
  */
110
110
  export declare const stroke: (row: number[], u: number, m: number) => number[];
111
111
  /** What a move poses: the pelvis, the spine, the arms and the legs, and nothing of the head. */
112
- export declare const FK: (0 | 1 | 2 | 6 | 16 | 7 | 10 | 11 | 20 | 14 | 18 | 15 | 13 | 19 | 17)[];
112
+ export declare const FK: (0 | 1 | 2 | 6 | 16 | 7 | 10 | 11 | 13 | 14 | 20 | 18 | 15 | 19 | 17)[];
113
113
  export declare const fk: (c: number[]) => Quat[];
114
114
  export declare const IDENT: Quat;
115
115
  /**
@@ -1,36 +1,15 @@
1
- import type { V, Mat } from './types';
2
- /** Olive drab canvas, its webbing darker, the seats' tubes dark grey. */
3
- export declare const CANVAS: Mat;
4
- export declare const WEB: Mat;
5
- export declare const TUBE: Mat;
6
- /** The flight deck: its consoles and seats, their cushions, and the instruments' faces, dim (a glow) or dead. */
7
- export declare const CONSOLE: Mat;
8
- export declare const CUSHION: Mat;
9
- export declare const DIAL: Mat;
10
- export declare const AMBER: Mat;
11
- export declare const DEAD: Mat;
12
- /** A tube from a to b, w across: three sides and no ends, enough at arm's length. */
13
- export declare const rod: (a: V, b: V, w: number, m: Mat) => void;
14
- /** A box in the frame of `o` and its axes `ax`, from `lo` to `hi` along them: its six faces, the top (+ax[1]) in `top`. */
15
- export declare const cube: (o: V, ax: V[], lo: V, hi: V, m: Mat, top?: Mat) => void;
16
- /** The axes `ax` turned by `t` round the unit axis `a` (Rodrigues). */
17
- export declare const turn: (ax: V[], a: V, t: number) => number[][];
18
- /**
19
- * A row of fold-down troop seats along a flank, facing in: a canvas pan and a webbed back on each,
20
- * slung from three tubes that run the row, legs every other seat. From xa to xb on the floor at y,
21
- * the lining at `w` from the line on the side sg. A seat is down, folded up, hanging broken or
22
- * gone, a strap of its belt dangling now and then.
23
- */
24
- export declare const troops: (xa: number, xb: number, y: number, w: number, sg: number) => void;
25
- /**
26
- * Where the troops sat: rows along both flanks of the middle section's hold and deck and of the
27
- * nose's, each section, its floor (-1 the lowest, else the index in DECKS) and x0, x1. The rows leave the doors, the tears,
28
- * the holes across a deck and the broken ends free, and stop short of the wall in the trees.
29
- */
30
- export declare const ROWS_OF_SEATS: number[][];
1
+ /** The harnesses' webbing and the seats' tubes, dark grey. */
2
+ export declare const WEB: import("./types").Mat;
3
+ export declare const TUBE: import("./types").Mat;
4
+ /** The flight deck: its grey consoles and seats, their sheepskin cushions, the carpet, and the instruments' faces, dim (a glow) or dead. */
5
+ export declare const CONSOLE: import("./types").Mat;
6
+ export declare const CUSHION: import("./types").Mat;
7
+ export declare const DIAL: import("./types").Mat;
8
+ export declare const AMBER: import("./types").Mat;
9
+ export declare const DEAD: import("./types").Mat;
31
10
  /** The flight deck behind the canopy: two pilots' seats, the instrument panel under the windscreen, the pedestal with its throttles, the overhead panel, and what the crash threw about. */
32
11
  export declare const cockpit: () => void;
33
12
  /** The canopy's glass, apart from the hull: its panes, and the shards round the broken ones. */
34
13
  export declare const canopy: () => number[];
35
- /** Inside the hull: the troops' seats in rows on its flanks and the flight deck. */
14
+ /** Inside the hull: the seats, galleys and lavatory, the luggage, the trim on the linings, and the flight deck. */
36
15
  export declare const cabin: () => void;
@@ -1,6 +1,8 @@
1
1
  import type { Piece } from '../../shared/beach';
2
2
  import type { V, Mat } from './types';
3
3
  export declare const tex: (l: number, k?: number, s?: number, r?: boolean) => Mat;
4
+ /** A texture tinted `tint`, one of the world's (CABIN): its light k, s tiles a metre. */
5
+ export declare const tinted: (l: number, tint: V, k?: number, s?: number) => Mat;
4
6
  export declare const ink: (c: V, k?: number, l?: number) => Mat;
5
7
  export declare const MID: number;
6
8
  export declare const WHITE: Mat;
@@ -18,6 +20,19 @@ export declare const PANE: Mat;
18
20
  export declare const DUNE: Mat;
19
21
  /** An emergency lamp's glow. */
20
22
  export declare const LAMP: Mat;
23
+ /**
24
+ * An airliner's cabin (the user, 2026-11-27): the walls and ceilings one light grey, in painted
25
+ * 1 m panels, a dark blue-grey carpet, and the edges of the panels and floors a mid grey. The thin
26
+ * edges round the holes and the small parts in flat paint (FLAT): a texture's fine lines
27
+ * shimmered on them.
28
+ */
29
+ export declare const WALL: Mat;
30
+ export declare const CEIL: Mat;
31
+ export declare const FLAT: Mat;
32
+ /** A ceiling, facing down: lit only by the light bounced from below, dim and blue, so as strong as a texture's light goes. */
33
+ export declare const UNDER: Mat;
34
+ export declare const TRIM: Mat;
35
+ export declare const CARPET: Mat;
21
36
  export declare const DOWN: number[];
22
37
  export declare const sm: (t: number) => number;
23
38
  export declare const sub: (a: V, b: V) => number[];
@@ -50,7 +65,7 @@ export declare const RAW: Mat;
50
65
  * leans and twisted a little about its length. Its face is `m` lit `k`, darker toward the tip;
51
66
  * its back, a centimetre behind, is bare metal (glass has none).
52
67
  */
53
- export declare const teeth: (a: V, b: V, d: V, n: number, m: Mat, k?: number, c?: number[]) => void;
68
+ export declare const teeth: (a: V, b: V, d: V, n: number, m: Mat, k?: number, c?: number[], back?: Mat) => void;
54
69
  /** A box with its upright edges cut by `cut`, grown by `grow`: its sides, lit `k` at the foot and at the top, and its top in `top`. */
55
70
  export declare const prism: (a: V, b: V, cut: number, m: Mat, top?: Mat, grow?: number, k?: number[]) => void;
56
71
  /** Sand blown against the foot of a box that stands in the dry beach. */
@@ -0,0 +1,4 @@
1
+ /** Where the luggage lies in each section's hold: x0 and x1 (the tail's is awash). */
2
+ export declare const LUGGAGE: number[][];
3
+ /** The luggage of the hold of section n from xa to xb. */
4
+ export declare const luggage: (n: number, xa: number, xb: number) => void;
@@ -1,5 +1,11 @@
1
1
  export declare const UP: number[];
2
2
  /** A level rectangle. */
3
3
  export declare const flat: (xa: number, xb: number, y: number, za: number, zb: number) => number[][];
4
- /** What one sees from inside a section: the skin's lining with its ribs, the decks with the twisted edges of their holes, lamps and cables under them. */
4
+ /**
5
+ * How far the lining of section n runs: from the stern's bulkhead (or the broken end) to x1, and
6
+ * in the nose to the arch over the sill (the canopy is its own lining there) but to the wall in
7
+ * the trees under it, where a bulkhead closes the main deck and the hold.
8
+ */
9
+ export declare const reach: (n: number) => number[];
10
+ /** What one sees from inside a section: the skin's lining, the decks with the twisted edges of their holes, lamps and cables under them. */
5
11
  export declare const inside: (n: number) => void;
@@ -0,0 +1,4 @@
1
+ /** The captain, seated with the middle of his seat's cushion at (x, y, z) (y the cushion's top). */
2
+ export declare const captain: (x: number, y: number, z: number) => void;
3
+ /** The captain's cap on the floor at (x, y, z), turned `t` round the vertical: its crown, the black peak, the badge. */
4
+ export declare const cap: (x: number, y: number, z: number, t: number) => void;
@@ -0,0 +1,17 @@
1
+ /** Economy's dark blue cloth, business's charcoal leather and its pale shells, the seats' frames. */
2
+ export declare const CLOTH: import("./types").Mat;
3
+ export declare const LEATHER: import("./types").Mat;
4
+ export declare const SHELL: import("./types").Mat;
5
+ export declare const FRAME: import("./types").Mat;
6
+ /** The galleys' stainless steel and the carts' fronts. */
7
+ export declare const INOX: import("./types").Mat;
8
+ /** The seats of section n: economy on its main deck, business on its upper one, a row every pitch. */
9
+ export declare const seats: (n: number) => void;
10
+ /**
11
+ * A galley against a bulkhead at x, standing out toward `f` (+1: greater x), on the floor y of
12
+ * section n, across the flank sg from the lining to the aisle: the carts' bay under the worktop,
13
+ * the ovens and lockers over it. One cart has rolled out and lies on its side.
14
+ */
15
+ export declare const galley: (n: number, x: number, y: number, sg: number, f: number) => void;
16
+ /** A lavatory's cubicle against a bulkhead at x, its door toward `f`, on the flank sg: its walls, its folding door, the sign over it. */
17
+ export declare const lavatory: (n: number, x: number, y: number, sg: number, f: number) => void;
@@ -0,0 +1,16 @@
1
+ import type { V, Mat } from './types';
2
+ /** A tube from a to b, w across: three sides and no ends, enough at arm's length. */
3
+ export declare const rod: (a: V, b: V, w: number, m: Mat) => void;
4
+ /** A box in the frame of `o` and its axes `ax`, from `lo` to `hi` along them: its faces less those of `skip` (bits as box()'s: 4 the bottom), the top (+ax[1]) in `top`. */
5
+ export declare const cube: (o: V, ax: V[], lo: V, hi: V, m: Mat, top?: Mat, skip?: number) => void;
6
+ /**
7
+ * A slab in the frame of `o` and its axes `ax`, from `lo` to `hi` along them: its section across
8
+ * ax[0] and ax[1] a rectangle whose corners are rounded (radius r, or one each: the bottom's back
9
+ * and front, the top's front and back), `seg` steps a corner, run along ax[2] and capped at both
10
+ * ends unless `open`, the one at lo[2] in `rear`. Its flat top in `top`.
11
+ */
12
+ export declare const slab: (o: V, ax: V[], lo: V, hi: V, r: number | number[], m: Mat, top?: Mat, seg?: number, open?: boolean, rear?: Mat) => void;
13
+ /** A flat plate in the frame of `o` and `ax`, across ax[0] and ax[1] from lo to hi, its corners rounded as slab()'s, facing +ax[2]. */
14
+ export declare const plate: (o: V, ax: V[], lo: V, hi: V, r: number | number[], m: Mat, seg?: number) => void;
15
+ /** The axes `ax` turned by `t` round the unit axis `a` (Rodrigues). */
16
+ export declare const turn: (ax: V[], a: V, t: number) => number[][];
@@ -0,0 +1,24 @@
1
+ import type { V, Mat } from './types';
2
+ /** The windows' panes, dark, and a shade pulled down over some. */
3
+ export declare const PANE_DARK: Mat;
4
+ /** The oxygen masks that dropped from the bins: yellow cups on clear tubes. */
5
+ export declare const MASK: Mat;
6
+ /**
7
+ * The storeys of a section: their floor and ceiling over the axis (lines of LINES), the deck
8
+ * holed under them and over them (an index in DECKS, -1 none), and whether passengers sat there.
9
+ */
10
+ export declare const STOREYS: (n: number) => {
11
+ floor: number;
12
+ ceil: number;
13
+ under: number;
14
+ over: number;
15
+ seated: boolean;
16
+ }[];
17
+ /** The lining at x and the height h over the axis, between two of its lines, on the side sg. */
18
+ export declare const wall: (n: number, x: number, h: number, sg: number) => V;
19
+ /** Whether a flank of section n is torn anywhere from xa to xb between the heights a and b over the axis. */
20
+ export declare const torn: (n: number, xa: number, xb: number, a: number, b: number) => boolean;
21
+ /** Whether a hole in deck d runs from xa to xb out to within `w` of the line. */
22
+ export declare const gone: (n: number, d: number, xa: number, xb: number, w: number) => boolean;
23
+ /** The trim of section n. */
24
+ export declare const trim: (n: number) => void;
@@ -6,4 +6,6 @@ export interface Mat {
6
6
  s: number;
7
7
  /** Swaps the texture's u and v: wood's grain then runs up an upright face, along a pole. */
8
8
  r?: boolean;
9
+ /** A texture's tint: its slot in the world's palette (tints()), white when absent. */
10
+ t?: number;
9
11
  }
@@ -2,6 +2,11 @@ export * from './hulk/types';
2
2
  export * from './hulk/common';
3
3
  export * from './hulk/hull';
4
4
  export * from './hulk/inside';
5
+ export * from './hulk/shapes';
6
+ export * from './hulk/trim';
7
+ export * from './hulk/seats';
8
+ export * from './hulk/hold';
9
+ export * from './hulk/pilot';
5
10
  export * from './hulk/cabin';
6
11
  export * from './hulk/wings';
7
12
  export * from './hulk/debris';
@@ -14,7 +14,7 @@ export declare const folded: (k: number) => number;
14
14
  /** Where each bone of HUNTER_REST ends: its first child (the spine, the neck), or a stub past a leaf. */
15
15
  export declare const boneEnd: (j: number) => Vec3;
16
16
  export declare const toBone: (p: Vec3, j: number) => number;
17
- export declare const LEGS: ((16 | 14 | 15 | 13)[] | (20 | 18 | 19 | 17)[])[];
17
+ export declare const LEGS: ((16 | 13 | 14 | 15)[] | (20 | 18 | 19 | 17)[])[];
18
18
  export declare const HEAD_PARTS: RegExp;
19
19
  export declare const TRUNK_PARTS: Set<string>;
20
20
  export declare const ALL: number[];
@@ -1,6 +1,7 @@
1
1
  import type { World, WorldDef } from '../../shared/world';
2
2
  import type { Vec3 } from '../mesh';
3
- /** The tints of a world's brushes, white first and each once: the shader's palette, MAX_TINTS at most. */
3
+ import type { Look } from '../rover/draw';
4
+ /** The tints of a world's textures (tints()): the shader's palette, MAX_TINTS at most. */
4
5
  export declare const palette: ({ def }: Pick<World, "def">) => Vec3[];
5
6
  /** The corners of a face's two triangles, as [along p, along q] picks of its min or max. */
6
7
  export declare const CORNERS: number[][];
@@ -35,6 +36,8 @@ export type Decor = {
35
36
  glass?: number[];
36
37
  /** GLSL for the map's rocks (TEX.ROCK) under BEACH, spliced in by fragOf(): Landfall's granite, which its chunk brings. */
37
38
  rock?: string;
39
+ /** How the map's rovers look, if not as the moon's: Landfall's buggy, which its chunk brings. */
40
+ car?: Look;
38
41
  };
39
42
  /** The scenery of a map that has none of its own: the city's is drawn here. */
40
43
  export declare const BARE: Decor;
@@ -4,7 +4,7 @@ export declare const POST_VERT = "#version 300 es\nout vec2 U;void main(){U=vec2
4
4
  export declare const POST_FRAG = "#version 300 es\nprecision highp float;uniform sampler2D S[4];uniform vec4 Y;uniform float L,Dp;in vec2 U;out vec4 o;\nvec3 b(vec2 x){vec3 c=texture(S[0],x).rgb;if(any(isnan(c)))return vec3(0);return c*smoothstep(.9,2.,max(c.r,max(c.g,c.b)));}\n#define T(k)texture(S[0],U+Y.xy*(k)).rgb\nvoid main(){\nvec3 c;\nif(Y.z<1.)c=(b(U+Y.xy)+b(U-Y.xy)+b(U+Y.xy*vec2(1,-1))+b(U-Y.xy*vec2(1,-1)))/4.;\nelse if(Y.z<2.)c=T(0.)*.227+(T(1.3846)+T(-1.3846))*.3162+(T(3.2308)+T(-3.2308))*.0703;\nelse{\nvec3 s=texture(S[0],U).rgb;\nif(any(isnan(s))){s=textureOffset(S[0],U,ivec2(0,-2)).rgb;if(any(isnan(s)))s=vec3(0);}\nif(Dp>0.){vec2 e=Y.xy*3.,f=e*.7;s=mix(s,(s+texture(S[0],U+e*vec2(1,0)).rgb+texture(S[0],U-e*vec2(1,0)).rgb+texture(S[0],U+e*vec2(0,1)).rgb+texture(S[0],U-e*vec2(0,1)).rgb+texture(S[0],U+f).rgb+texture(S[0],U-f).rgb+texture(S[0],U+f*vec2(1,-1)).rgb+texture(S[0],U-f*vec2(1,-1)).rgb)/9.,Dp);}\nc=s+texture(S[1],U).rgb*1.3+texture(S[2],U).rgb*1.+texture(S[3],U).rgb*.7;\nvec2 q=U-.5;\nc=min(c,.6)+.4*(1.-exp(-max(c-.6,0.)/.4));\nc=mix(c,c*vec3(.3,.7,.95)+vec3(0,.025,.045),Dp*.85);\nfloat a=atan(q.y,q.x)*24.,h=fract(sin(floor(a)*12.9898)*43758.5453);\nc+=L*step(.85-.5*L,h)*sin(fract(a)*3.1416)*smoothstep(.2,.6,length(q))*fract(length(q)*3.-Y.w*.002+h*9.)*.22;\nc*=1.-(.7+.3*L+.4*Dp)*dot(q,q);\nc=pow(max(c*vec3(.97,1.,1.03),0.),vec3(.92))+(fract(sin(dot(gl_FragCoord.xy+Y.w,vec2(12.9898,78.233)))*43758.5453)-.5)*.03;}\no=vec4(c,1);}";
5
5
  /**
6
6
  * Blinn-Phong strength and exponent: a row per TEX id in order (brick, tile, lava, stone, metal, wood,
7
- * moss, grate, concrete, glass, steel, paint, rock), then the flat bodies, then polished metal (SHINE),
7
+ * moss, grate, concrete, glass, steel, paint, rock, fabric, hide), then the flat bodies, then polished metal (SHINE),
8
8
  * then a glossy shell (GLOSS: broader, so it shows on the armour). Lava and glows never get here: they
9
9
  * light themselves.
10
10
  */
@@ -0,0 +1,2 @@
1
+ /** The body in its own frame at a level of detail: what keeps its colours, and what takes the team's, white. */
2
+ export declare const body: (level: number) => [number[], number[]];