@korial29/tiny-fps 1.20.3 → 1.21.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/brick-DS2HonoP.js +1 -0
  2. package/dist/index.js +8 -8
  3. package/dist/landfall-Bb2zsG6_.js +21 -0
  4. package/dist/scene-BpWta97c.js +10 -0
  5. package/dist/stone-Dxy0yrsv.js +1 -0
  6. package/dist/tranquility-BwOJ43Wj.js +1 -0
  7. package/dist/types/client/burnt/charred.d.ts +17 -0
  8. package/dist/types/client/burnt/clearing.d.ts +18 -0
  9. package/dist/types/client/burnt/fire.d.ts +6 -0
  10. package/dist/types/client/cells.d.ts +4 -2
  11. package/dist/types/client/foliage/flower.d.ts +2 -0
  12. package/dist/types/client/foliage/grove.d.ts +12 -0
  13. package/dist/types/client/foliage/layers.d.ts +16 -0
  14. package/dist/types/client/foliage/tiles.d.ts +2 -0
  15. package/dist/types/client/hulk/common.d.ts +7 -1
  16. package/dist/types/client/jungle/canopy.d.ts +11 -0
  17. package/dist/types/client/jungle/constants.d.ts +31 -0
  18. package/dist/types/client/jungle/index.d.ts +17 -0
  19. package/dist/types/client/jungle/models.d.ts +29 -0
  20. package/dist/types/client/jungle/rocks.d.ts +21 -0
  21. package/dist/types/client/jungle/snag.d.ts +10 -0
  22. package/dist/types/client/jungle.d.ts +1 -17
  23. package/dist/types/client/render/scene.d.ts +31 -0
  24. package/dist/types/client/render/shader.d.ts +3 -2
  25. package/dist/types/client/smoke.d.ts +2 -2
  26. package/dist/types/client/store.d.ts +2 -0
  27. package/package.json +1 -1
  28. package/dist/brick-mdI4ov5M.js +0 -1
  29. package/dist/landfall-CtwePyF1.js +0 -21
  30. package/dist/paint-Vea5qRXO.js +0 -4
  31. package/dist/stone-C0leigjc.js +0 -1
  32. package/dist/textures-CkY2Vi9D.js +0 -1
  33. package/dist/tranquility-C5yjsy8i.js +0 -1
@@ -0,0 +1 @@
1
+ import{Cr as e,ot as t,r as n,st as r}from"./brick-DS2HonoP.js";var i=e=>(e=Math.min(Math.max(e,0),1))*e*(3-2*e),a=[1,2,3,4,6].map(e=>{let t=(1+Math.sqrt(5))/2,n=[[-1,t,0],[1,t,0],[-1,-t,0],[1,-t,0],[0,-1,t],[0,1,t],[0,-1,-t],[0,1,-t],[t,0,-1],[t,0,1],[-t,0,-1],[-t,0,1]].map(e=>r(e));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=>n[e])).flatMap(([t,n,i])=>{let a=(a,o)=>r(t.map((t,r)=>t+((n[r]-t)*a+(i[r]-t)*o)/e)),o=[];for(let t=0;t<e;t++)for(let n=0;t+n<e;n++)o.push([a(t,n),a(t+1,n),a(t,n+1)]),t+n<e-1&&o.push([a(t+1,n),a(t+1,n+1),a(t,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 r=n(t(e[1].p,e[0].p),t(e[2].p,e[0].p));e.forEach(e=>e.n=[e.n[0]+r[0],e.n[1]+r[1],e.n[2]+r[2]])}for(let a of h){if(a.every(e=>e.low))continue;let s=n(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}of a){let a=Math.hypot(...n)>1e-12?r(n):[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]],e.ROCK,.85*f*(.55+.45*i((t[1]-l)/(.3*(u-l)))))}}};export{o as t};
@@ -0,0 +1 @@
1
+ import{$ as e,$t as t,Cr as n,Gt as r,H as i,Ht as a,Jt as o,Kt as s,L as c,Qt as l,Sn as u,U as d,Ut as f,Vt as p,Xt as m,Y as h,Yt as g,Zt as _,_n as v,a as y,at as b,bn as x,br as S,cn as C,dn as w,dt as T,en as E,et as D,fn as ee,gn as O,hn as k,i as A,it as j,lt as te,m as ne,mn as re,n as M,nt as ie,o as ae,ot as oe,pn as se,qt as N,r as P,rn as ce,rt as F,st as I,t as le,tt as ue,u as L,v as de,vn as fe,xn as R,y as pe,yn as me}from"./brick-DS2HonoP.js";import{t as he}from"./stone-Dxy0yrsv.js";var ge=[.8,.82,.86],_e=[.35,.36,.4],ve=ee.filter(e=>e.min[1]===2.48&&e.max[1]===4),[z,B]=se,ye=[z,0,B],V=22.4,be=[-.6,.6,.53],xe=[[2,1],[0,2],[0,1]],[Se,Ce]=[-2.35,-2.4],we=[1.25,1.3,1.4],Te=[.56,.48,.28],Ee=[.04,.04,.05],{CONCRETE:De,HULL:Oe,PAINT:ke}=n,[H,Ae,je,U,Me,Ne]=[[.86,.87,.9],[.55,.57,.6],[.32,.33,.36],[.07,.075,.085],[.42,.52,.66],[.2,.13,.08]],[Pe,W,Fe,Ie,Le,Re]=[[.3,.8,1],[.35,1,.5],[1,.7,.25],[1,.2,.15],[.7,.35,1],[1,.35,.85]],ze=(e,t,n,r=1,[i,a]=xe[1])=>{for(let o of[0,1,2,0,2,3])e.push(...t[o],...be),typeof n==`number`?e.push(t[o][i],t[o][a],n,r):e.push(n[0],n[1],-2,n[2])},G=(e,t,n,r,i,a,o)=>ze(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,xe[t]),Be=(e,{min:t,max:n,top:r,side:i},a=0)=>{for(let o=0;o<3;o++)G(e,o,t[o],t,n,i,a+(o==1?.4:1.25-.15*o)),G(e,o,n[o],t,n,o==1?r:i,a+(o==1?1.85:1.25-.15*o))},Ve=(e,t)=>{let n=e.length;t();let r=te(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]]=be}},He=(e,t,n,r)=>{let i=te(e,0);for(let a=t;a<e.length;a+=10)[i[a+3],i[a+4],i[a+5],i[a+8]]=[n[0],n[1],n[2],r]},Ue=(e,t,n,r,i,a)=>{for(let[o,s,c]of[[r,r+.1,0],[i-.1,i,0],[r,i,a-.1]])G(e,t,n,[o,c,o],[s,a,s],we)},We=(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],G(e,t,n,d,f,ke,o),c>i&&([d[1],d[2-t],f[2-t]]=[l,i,c],G(e,t,n,d,f,ke,o))})},Ge=(e,t,n,r,i)=>{let a=Math.min(i,...n.map((e,n)=>(e-t[n])/3)),o=t.map((e,t)=>(e+n[t])/2),s=(e,r)=>[0,1,2].map(i=>{let o=e>>i&1,s=o?n[i]:t[i];return i==r?s:s+(o?-a:a)});for(let t=0;t<3;t++){let[n,i]=[1<<(t+1)%3,1<<(t+2)%3];for(let a of[0,1<<t])A(e,[a,a|n,a|n|i,a|i].map(e=>s(e,t)),r,o);let[a,c]=[(t+1)%3,(t+2)%3];for(let l of[0,n,i,n|i])A(e,[s(l,a),s(l,c),s(l|1<<t,c),s(l|1<<t,a)],r,o)}for(let t=0;t<8;t++)A(e,[s(t,0),s(t,1),s(t,2)],r,o)},Ke=(e,t,[n,r,i])=>e.push(...t,...be,n,r,-2,i),qe=(e,t,n,r,[i,a],o,s,c=12,l=0)=>{let u=l>0?c/2:c,d=Array.from({length:l>0?2*(u+1):c+1},(e,t)=>{let n=l>0?t<=u?1:-1:0,r=l>0?(t<=u?t:t-u-1)/u*Math.PI-Math.PI/2:t/c*2*Math.PI;return[n,n<0?Math.PI+r:r]});l>0&&d.push(d[0]);let f=([e,i],a)=>{let[o,s]=[e*l+Math.cos(i)*a,Math.sin(i)*a];return[0,1,2].map(e=>t[e]+n[e]*o+r[e]*s)};for(let t=0;t+1<d.length;t++){let[n,r]=[d[t],d[t+1]],c=[[f(n,i),o],[f(n,a),s],[f(r,a),s]];(i>0||n[0]!=r[0])&&c.push([f(n,i),o],[f(r,a),s],[f(r,i),o]);for(let[t,n]of c)Ke(e,t,n)}},[Je,Ye,Xe]=[[.13,.135,.15],[.2,.205,.22],[.05,.05,.06]],Ze=[.62,.6,1.05],Qe=[.04,.04,.09],[$e,et,tt]=[7,38*Math.PI/180,32*Math.PI/180],nt=[[-.2,-.22,.2,-.2],[-.2,.2,.2,.22],[-.2,-.22,-.18,.22],[.18,-.22,.2,.22],[-.12,-.1,-.1,.1],[.1,-.1,.12,.1],[-.12,-.01,.12,.01],[-.02,.12,.02,.16],[-.02,-.16,.02,-.12],[.22,-.05,.25,.05]],rt=(e,t,[n,r,i,a],[o,s,c])=>{for(let[l,u]of[[n,r],[n,a],[i,a],[n,r],[i,a],[i,r]])e.push(l,t,u,0,1,0,o,s,-2,c)},it=(()=>{let e=[];Ge(e,[.95,0,-.22],[1.35,.74,.22],Je,.05);let t=e.length;Ge(e,[-.32,-.05,-.3],[.32,.03,.3],Je,.03),rt(e,.032,[-.27,-.25,.27,.25],Ze.map(e=>.9*e));for(let t of nt)rt(e,.034,[t[1],t[0],t[3],t[2]],Qe);for(let[t,n]of[[-.15,[.5,1,.6]],[0,Ze],[.15,[1,.7,.3]]])qe(e,[-.322,-.01,t],[0,0,-1],[0,1,0],[0,.014],n.map(e=>2*e),n,8);return((e,t,n)=>{let[r,i]=[Math.cos(n),Math.sin(n)];for(let n=t;n<e.length;n+=10)for(let[t,a]of[[0,1],[3,0]]){let[o,s]=[e[n+t],e[n+t+1]];[e[n+t],e[n+t+1]]=[r*o-i*s+(a?1.1:0),i*o+r*s+(a?.86:0)]}})(e,t,tt),e})(),at=[0,1,0],ot=[.035,.037,.045],st=(e,t)=>e.map(e=>(e+(1-e)/3)*t),ct=[[-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]],lt=(e,t,n,r,a,o)=>{let s=te(e,0);for(let c=t;c<e.length;c+=10){let e=[0,1,2].map(e=>s[c+e]-n[e]),t=e[0]*r[0]+e[1]*r[1]+e[2]*r[2];[s[c+3],s[c+4],s[c+5]]=I([0,1,2].map(n=>r[n]+o*(e[n]-t*r[n])/a)),s[c+8]=i}},ut=[[-T/4-Math.asin(x[0][2]/V),-T/4+Math.asin(x[0][2]/V),x[0][3]],[-Math.acos((R[1].min[0]-z)/V),Math.asin((R[0].max[2]-B)/V),x[1][3]]],dt=e=>e.filter((t,n)=>{let r=n-n%30;return Math.max(e[r],e[r+10],e[r+20])>-.49}),ft=dt(D(j([[1,0],[1,1]],12),ge)),pt=dt(D(j([[1.06,0],[1.06,.3]],12),_e)),mt=({brushes:e},t)=>{let n=[];for(let r of e)r.ghost&&r.tint&&Be(n,r,2*Math.max(0,t.indexOf(`${r.tint}`)));let r=[];(e=>{[...fe,...ct].forEach(t=>((e,[t,n,r,i,a,o,s,c])=>{let l=1&c?2:0,[u,d]=[[n,o,r],[i,s,a]],f=c<2?1:-1,p=(e,t,n)=>{let r=[0,o+t,0];return r[l]=(f>0?u[l]:d[l])+f*n,r[2-l]=u[2-l]+e,r},[m,h,g]=[d[2-l]-u[2-l],d[l]-u[l],s-o],_=(t,n,r)=>{let[i,a]=[p(t[0],t[1],t[2]),p(n[0],n[1],n[2])];M(e,i.map((e,t)=>Math.min(e,a[t])),i.map((e,t)=>Math.max(e,a[t])),r)},x=(t,n,r,i=.025)=>{let[a,o]=[p(t[0],t[1],t[2]),p(n[0],n[1],n[2])];Ge(e,a.map((e,t)=>Math.min(e,o[t])),a.map((e,t)=>Math.max(e,o[t])),r,i)},S=[0,0,0];S[2-l]=(l?1:-1)*f;let C=[0,1,0],w=(t,n,r,i,a,o=1.6,s=!0,c=8,l=0)=>{qe(e,p(t,n,i+.004),S,C,[0,r],st(a,1.4*o),a.map(e=>e*o),c,l),s&&qe(e,p(t,n,i+.001),S,C,[r,3*r],a.map(e=>.45*e),ot,c,l)},T=(t,n,r,i,a,o,s=1)=>y(e,s,()=>A(e,[p(t,n,a),p(r,n,a),p(r,i,a),p(t,i,a)],o,p(t,n,a-1))),E=(e,t,n,r,i,a)=>{x([e,t,i-.06],[n,r,i],U,.025),T(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);T(e+.08,s-.025,e+.08+(n-e-.16)*(.4+(7*e+o)%4*.15),s,i+.01,a,1.1)}};t==v.CONSOLE?((e,t,n,r,i)=>{Ve(e,()=>{let a=b(2,1,[1,1],[0,0]);F(e,a,[t,r,n],[t,r+.08,n],[1,0,0],1,1.48,Ye),F(e,a,[t,r+.08,n],[t,r+.14,n],[1,0,0],1,.75,Je),F(e,a,[t,r+.14,n],[t,r+.5,n],[1,0,0],1,.05,Ye),F(e,a,[t,r+.5,n],[t,r+.6,n],[1,0,0],1,.22,Xe);for(let a=0;a<$e;a++){let o=i+Math.PI+(a-($e-1)/2)*et;ae(e,it,[t,r,n],-o)}})})(e,(n+i)/2,(r+a)/2,o,c*Math.PI/2):Ve(e,()=>{if(t==v.BENCH){x([0,g-.06,0],[m,g,h],H,.03),x([.05,0,0],[m-.05,g-.06,h-.06],Ae,.04);for(let e=1.1;e<m-.5;e+=1.1)_([e-.01,.1,h-.06],[e+.01,g-.1,h-.05],U);for(let t=0;t<4;t++){let n=1.4+2.75*t;_([n-.05,g,.16],[n+.05,g+.22,.22],U),E(n-.45,g+.2,n+.45,g+.75,.28,[Pe,W,Fe,Pe][t]),_([n-.3,g,.45],[n+.3,g+.025,.65],je);let r=b(2,1,[1,1],[0,0]);F(e,r,p(n+.76,g,.26),p(n+.76,g+.2,.26),[1,0,0],1,.055,[W,Me,Fe,Le][t])}}else if(t==v.RACKS){x([0,0,0],[m,g,h],U,.05);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;T(t,r,t+1.43,r+.16,h+.01,je,.25);for(let i=0;i<5;i++){let a=[W,Fe,W,Pe,Ie,null][(7*e+5*n+3*i)%6];a&&w(t+.12+.08*i,r+.08,.017,h+.011,a,1.9,!1,6)}}T(t,g-.4,t+1.43,g-.34,h+.01,Pe,.9)}}else if(t==v.SCOPE){_([.2,0,.2],[1,.1,1],U),x([.45,.1,.45],[.75,.85,.75],H,.04),w(.6,.6,.035,.75,W,1.8,!1),x([.35,.85,.35],[.85,1.05,.85],je,.04);let[t,n]=[p(.6,.9,.2),p(1.4,2.8,2.1)];F(e,b(2,1,[1,1],[0,0]),t,n,[1,0,0],1,.2,H),F(e,b(2,1,[1,1],[0,0]),p(1.3,2.56,1.86),p(1.42,2.83,2.13),[1,0,0],1,.24,U),F(e,b(2,1,[1,1],[0,0]),p(.86,1.4,.6),p(1.2,2.2,1.4),[1,0,0],1,.05,je)}else if(t==v.ANALYSER){x([0,0,0],[m,.9,h],H,.04),x([0,.9,0],[m,g,.5],H,.04),E(.12,.92,.95,1.26,.56,W),x([1.1,.9,.55],[1.88,1.18,1.1],je,.03),T(1.16,.95,1.82,1.13,1.105,Le,1.3),x([.08,.68,h-.01],[.9,.86,h+.015],U,.012);for(let e=0;e<6;e++)w(.185+.125*e,.77,.025,h+.015,[Fe,W,Pe][e%3]);for(let e of[.3,.6])_([.05,e,h],[m-.05,e+.015,h+.005],U)}else if(t==v.PLANTS){for(let e of[0,m/2-.03,m-.06])x([e,0,0],[e+.06,g,h],je,.02);x([0,g-.04,0],[m,g,h],H,.015);for(let t of[.3,.9,1.5]){x([0,t,0],[m,t+.04,h],H,.015),_([.1,t+.04,.12],[m-.1,t+.18,h-.12],Ne);for(let e=.25;e<m-.15;e+=.4)_([e-.1,t+.18,.2],[e+.1,t+.18+(.12+(10*e+3*t)%3*.06),h-.2],10*e%2<1?[.18,.5,.16]:[.3,.62,.2]);y(e,1.1,()=>_([.1,t+.53,.3],[m-.1,t+.56,h-.3],Re))}}else if(t==v.LOCKERS){x([0,0,0],[m,g,h],Me,.04);for(let e=0;e<6;e++){let t=.8*e;e&&_([t-.01,.05,h],[t+.01,g-.05,h+.01],U);for(let e=0;e<3;e++)_([t+.2,1.7+.08*e,h],[t+.6,1.73+.08*e,h+.01],U);x([t+.64,.95,h],[t+.68,1.2,h+.04],Ae,.015),w(t+.4,1.53,.025,h+.008,Fe,1.3,!1,12,.07)}}else if(t==v.SUIT){_([.1,0,.1],[.9,.06,.9],U),_([.47,.06,.06],[.53,1.7,.14],je);for(let e of[.27,.54])_([e-.02,.06,.36],[e+.21,.22,.68],je),_([e,.22,.4],[e+.19,.95,.62],H);x([.22,.95,.32],[.78,1.58,.7],H,.07),x([.25,1,.14],[.75,1.62,.32],Ae,.05);for(let e of[.08,.78])_([e,1,.4],[e+.14,1.54,.6],H),_([e,.88,.4],[e+.14,1,.6],je);w(.42,1.36,.05,.7,Pe,1.3,!1),w(.6,1.38,.03,.7,Ie,1.6,!1),ie(e,b(2,0,[1,1]),p(.5,1.8,.5),le,[0,0,0],.21,H),T(.38,1.74,.62,1.88,.715,Fe,.7)}else{x([0,0,0],[m,g,.05],je,.03),x([.08,.3,.03],[.6*m+.02,g-.08,.07],U,.02),T(.12,.34,.6*m-.02,g-.12,.071,Pe,.5),x([.64*m,.3,.03],[m-.08,g-.08,.07],U,.02);for(let e=0;e<12;e++){let[t,n]=[.64*m+.15+e%3*.24,.42+.23*Math.floor(e/3)];w(t,n,.04,.07,[W,Fe,Ie,Pe][(e+Math.floor(e/3))%4])}x([.1,.09,.03],[m-.1,.21,.06],U,.015),w(m/2,.15,.03,.06,Fe,1.4,!1,12,m/2-.2)}})})(e,t));let[,t]=x[0],n=B+t+.03;G(e,2,n,[z-3,3.4,0],[z+3,4.3,0],Ee);for(let t of[3.42,4.22])G(e,2,n+.01,[z-2.95,t,0],[z+2.95,t+.05,0],we);for(let t=0;t<9;t++){let r=z-2.6+.6*t;G(e,2,n+.01,[r,3.9,0],[r+.45,4.1,0],[.9,.95,1]),G(e,2,n+.01,[r+.05,3.6,0],[r+.3+t%2*.1,3.7,0],Pe)}for(let[t,n]of[[z+16.6,.3],[z+17.1,.15]])Ve(e,()=>M(e,[t,2.94,B-6.7],[t+n,3.06,B+6.7],U));R.forEach(({min:t,max:n},r)=>{let i=r?2:0,[a,o]=[t[i],r?R[0].min[2]:n[i]],s=t[2-i]+u,c=[0,2,0],l=[0,2.1,0];[c[i],l[i],c[2-i],l[2-i]]=[a,o,s,s+.12],Ve(e,()=>M(e,c,l,U));let[d,f]=[[0,0,0],[0,0,0]];[d[i],f[2-i]]=[i?-1:1,1];for(let t=a+2.5;t<o-1;t+=5){let[n,r]=[[0,1.22,0],[0,1.58,0]];[n[i],r[i],n[2-i],r[2-i]]=[t-.3,t+.3,s,s+.03],Ve(e,()=>Ge(e,n,r,U,.012));let a=[0,1.4,0];[a[i],a[2-i]]=[t,s+.03],qe(e,a,d,at,[.05,.13],W.map(e=>.5*e),ot,12,.16),qe(e,a.map((e,t)=>e+.002*f[t]),d,at,[0,.05],st(W,2),W.map(e=>1.4*e),12,.16)}});for(let t of ve){let n=t.max[0]-t.min[0]<1?0:2,[r]=me.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(R.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,O+.05,0],[0,O+.35,0]];[r[2-n],i[2-n]]=[o+.3*t,Math.min(o+.3*t+.15,s)],G(e,n,a,r,i,Fe),[r[2-n],i[2-n]]=[i[2-n],Math.min(o+.3*t+.3,s)],G(e,n,a,r,i,U)}let c=(o+s)/2,[l,u]=[[0,3.32,0],[0,0,0]];[l[n],l[2-n],u[2-n]]=[a,c,(n?1:-1)*i],qe(e,l,u,at,[.12,.17],ot,ot,14),l[n]+=.003*i,qe(e,l,u,at,[0,.12],st(Ie,2.2),Ie.map(e=>1.6*e),14)}})(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},K=e=>Number.isInteger(e)?`${e}.`:`${e}`,ht=e=>`vec3(${e.map(K)})`,[[gt,_t],[vt,yt]]=me.map(({min:e,max:t})=>[[e[0]+u,0,e[2]+u],[t[0]-u,4,t[2]-u]]),[bt,xt]=se,St=[...k,...k.map(([e,t])=>[t,e])],Ct=`if(L<${(Se+.05).toFixed(2)}&&L>${(Ce-.05).toFixed(2)}){\nbool rd=P.z>${K(140)};vec3 id=1./(r+step(abs(r),vec3(1e-5))*1e-5),h,e,W=vec3(.55,.56,.58);float t=0.;\nif(L<${((Se+Ce)/2).toFixed(3)}){vec2 o=P.xz-vec2(${K(bt)},rd?${K(xt)}:${K(280-xt)}),E[4]=vec2[](${St.map(([e,t])=>`vec2(${K(e)},${K(t)})`)});float ax=0.;\nfor(int n=0;n<2;n++)for(int i=0;i<4;i++){vec2 a=(-E[i]-o)*id.xz,b=(E[i]-o)*id.xz,lo=min(a,b),hi=max(a,b);float t1=min(hi.x,hi.y);\nif(max(lo.x,lo.y)<=t+.01&&t1>t){t=t1;ax=hi.x<hi.y?0.:1.;}}\nfloat tf=r.y<0.?-P.y*id.y:1e3;bool fl=tf<t;t=min(t,tf);h=P+r*t;float u=fract((ax<.5?h.z:h.x)/2.4);\ne=fl?vec3(.42,.43,.45)*(min(fract(h.x),fract(h.z))<.03?.7:1.):h.y>${K(8)}?vec3(.03,.03,.04):h.y>${K(7.4)}&&h.y<${K(7.6)}?vec3(1.3):h.y<.25?vec3(.04):\n((h.y>1.7&&h.y<2.9)||(h.y>5.1&&h.y<6.3))&&u>.25&&u<.75?vec3(.56,.48,.28):W;}\nelse{bool m0=P.x>${K((yt[0]+gt[0])/2)};vec3 lo=m0?${ht(gt)}:${ht(vt)},hi=m0?${ht(_t)}:${ht(yt)};\nif(!rd){float z=lo.z;lo.z=${K(280)}-hi.z;hi.z=${K(280)}-z;}\nvec3 x=max((lo-P)*id,(hi-P)*id);t=min(x.x,min(x.y,x.z));h=P+r*t;float s=(hi.x-lo.x)/3.,lx=abs(fract((h.x-lo.x)/s)-.5)*s,wx=abs(fract((h.x-lo.x-${K(1-u)})*.5+.5)-.5)*2.;\ne=t==x.y?(r.y>0.?(lx<1.2&&abs(h.z-(lo.z+hi.z)*.5)<.3?vec3(1.6):vec3(.5)):vec3(.4,.41,.44)):\nt==x.z&&h.y>2.7&&h.y<3.7&&wx<.46?vec3(.22,.24,.26):W;}\nvec3 dv=normalize(P-E),w;if(dv.y>0.)w=K0(dv,.0015);else{float tg=-P.y/dv.y;vec2 g=P.xz+dv.xz*tg;\nw=vec3(.5,.49,.47)*(.7+.45*vn(g*.12))*(.75+.35*vn(g*1.7))*(.25+.75*max(O.y,0.));}\nc=mix(w,e,.08+.6*fr);}`,[wt,Tt]=se,Et=22.4,q=T/48,Dt=[.4,.42,.46],Ot=[.27,.29,.33],[J,kt,At,jt,Mt,Nt,Pt]=[[.16,.17,.2],[.6,.62,.66],[1,.8,.45],[.7,.9,1],[1,.6,.2],[1,.12,.08],[.35,1,.5]],Ft=[.6,.64,.48],It=D(j([[1,0],[1,1]],6),[1,1,1]),Lt=D(j([[0,-1],[1,0],[0,1]],6),[1,1,1]),Rt=D(j([[0,0],[1,.4],[.93,.42],[0,.12]],12),[.82,.84,.88]),zt=(e,t,n,r,i=kt)=>F(e,It,t,n,Ft,1,r,i),Bt=(e,t,n,r,i=2.2)=>{let a=e.length;ie(e,Lt,t,le,[0,0,0],n,r),i&&de(e,a,i)},Vt=(e,t,n)=>y(e,1.8,()=>A(e,[[t-.15,.03,n-.15],[t+.15,.03,n-.15],[t+.15,.03,n+.15],[t-.15,.03,n+.15]],jt,[t,-5,n])),Ht=e=>[Et*Math.cos(e*T/40),12*Math.sin(e*T/40)],Ut=(e,t,n=.02)=>{let r=Math.max(t-5,0),i=Math.floor(r),[a,o]=[Ht(i),Ht(i+1)],[s,c]=[a[0]+(o[0]-a[0])*(r-i),a[1]+(o[1]-a[1])*(r-i)],l=I([s/Et/Et,c/144,0]),u=s*Math.cos(q/2)/Math.cos((e%q+q)%q-q/2)+n*l[0];return[wt+u*Math.cos(e),Math.min(t,5)+c+n*l[1],Tt+u*Math.sin(e)]},Wt=ut.map(([e,t])=>[e-.03,t+.03]),Gt=e=>!Wt.some(([t,n])=>[e,e-T].some(e=>e>t&&e<n)),Kt=[...Array.from({length:35},(e,t)=>(2*t+1)*T/70).filter(e=>Gt(e-.03)&&Gt(e+.03)).map(e=>{let[t,n]=[Math.cos(e),Math.sin(e)];return[wt+22.419999999999998*t,4.02,Tt+22.419999999999998*n,t,n,.38,0]}),...me.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])=>!R.some(n=>e>n.min[0]-.5&&e<n.max[0]+.5&&t>n.min[2]-.6&&t<n.max[2]+.6))],qt=(e,[t,n,r,i,a],o,s,c)=>A(e,Array.from({length:12},(e,c)=>{let l=o*Math.cos(c*T/12);return[t+s*i-a*l,n+o*Math.sin(c*T/12),r+s*a+i*l]}),c,[t-i,n,r-a]),Jt=(e,[t,n,r,i,a],o,s)=>{let c=e.length,l=e=>{let c=o*Math.cos(e*T/12);return[t+s*i-a*c,n+o*Math.sin(e*T/12),r+s*a+i*c]},u=[t+s*i,n,r+s*a];for(let o=0;o<12;o++)A(e,[u,l(o),l(o+1)],At,[t-i,n,r-a]);de(e,c,.7),lt(e,c,u,[i,0,a],o,.8)},[Yt,Xt]=[160,280],Zt=[80,0,140],Qt=Zt,$t=I([.3,.62,-.75]),Y=e=>(e=Math.min(Math.max(e,0),1))*e*(3-2*e),X=(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)=>L(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},en=(e,t,n)=>.55*X(e,t,n)+.3*X(2*e,2*t,n+1)+.15*X(4*e,4*t,n+2),tn=D(j([[1,0],[1,1]],6),[.5,.52,.56]),nn=D(j([[0,-1],[1,0],[0,1]],6),[1,1,1]),rn=D(j([[0,0],[.5,1.6],[.85,3.5],[1,6],[1,10],[.8,12.5],[.55,14],[0,14]],12),[.9,.9,.92]),an=D(j([[0,0],[2.2,.6],[0,.9]],12),[.8,.82,.86]),on=(e,t,n)=>{let r=e=>e[0]*t[0]+e[1]*t[1]+e[2]*t[2]-n,i=[],a=e.map(e=>{let t=[];return e.forEach((n,a)=>{let o=e[(a+1)%e.length],[s,c]=[r(n),r(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),i.some(e=>Math.abs(e[0]-r[0])+Math.abs(e[1]-r[1])+Math.abs(e[2]-r[2])<1e-9)||i.push(r)}}),t}).filter(e=>e.length>2);if(i.length>2){let e=i.reduce((e,t)=>e.map((e,n)=>e+t[n]/i.length),[0,0,0]),n=I(P(t,Math.abs(t[1])<.9?[0,1,0]:[1,0,0])),r=P(t,n),o=t=>{let i=[t[0]-e[0],t[1]-e[1],t[2]-e[2]];return Math.atan2(i[0]*r[0]+i[1]*r[1]+i[2]*r[2],i[0]*n[0]+i[1]*n[1]+i[2]*n[2])};a.push(i.sort((e,t)=>o(e)-o(t)))}return a},sn=[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}))),cn=(e,t,[r,i,a],o,s,c=!0)=>{let l=(e,t)=>L(e,t,o),u=on(sn,[0,-1,0],.35),d=(e,t,n)=>{let r=Math.sqrt(1-e*e);u=on(u,[r*Math.cos(t),e,r*Math.sin(t)],n)};d(.92+.08*l(0,1),T*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),T*((o+a+.45*l(s,2))/e),r+i*l(s,3))}let[f,p]=[.8+.4*L(o,1,9),T*L(o,2,9)],[m,h]=[Math.cos(p),Math.sin(p)],g=([e,n,o])=>{let[s,c]=[e*r*f,o*a*(2-f)];return[t[0]+s*m-c*h,t[1]+n*i,t[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=I(P([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]-t[0])+o[1]*(a[0][1]-t[1])+o[2]*(a[0][2]-t[2])<0&&(a.reverse(),o.forEach((e,t)=>o[t]=-e));let c=I(P(o,Math.abs(o[1])<.9?[0,1,0]:[1,0,0])),u=P(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),n.ROCK,d];for(let t=1;t<a.length-1;t++)e.push(...f(a[0]),...f(a[t]),...f(a[t+1]))})},ln=(t,r,i,a,o,s,c)=>{let l=P(oe(r[1],r[0]),oe(r[2],r[0]));if(Math.hypot(...l)<1e-9)return;l=I(l),e(l,oe(r[0],i))<0&&(r.reverse(),l=l.map(e=>-e));let u=(r[0][1]+r[1][1]+r[2][1])/3,d=.85*c*(.86+.28*L(t.length,s,7))*(.55+.45*Y((u-a)/(.3*(o-a))))*(.82+.18*Math.max(l[1],0));for(let e of r)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]],n.ROCK,d)},un=(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)];he(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*X(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)},dn=(e,t,n)=>{ie(e,D(j([[13,0],[13,.27],[0,.27]],32),[.13,.13,.15]),[t,0,n],le,[0,0,0],1),pe(e,[t,.29,n],7.6,8,[.8,.8,.82]);for(let r=0;r<24;r++){let i=r*T/24,[a,o]=[t+11.6*Math.cos(i),n+11.6*Math.sin(i)],s=(e,t)=>[a+e,.31,o+t];y(e,1.8,()=>A(e,[s(-.25,-.25),s(.25,-.25),s(.25,.25),s(-.25,.25)],r%3?[1,.95,.8]:[1,.45,.1],[a,-5,o]))}},fn=(e,t,n,r,i=10,a=[1,.93,.75])=>{ie(e,tn,[t,r,n],le,[0,0,0],[.2,.2,i]),ie(e,tn,[t,r,n],le,[0,0,0],[.5,.5,.5]),y(e,ne,()=>ie(e,nn,[t,r+i+.4,n],le,[0,0,0],[.55,.55,.45],a))},pn=(e,t)=>{let n=(n,r)=>{let[i,a]=[t[n],T*(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},mn=[pn(6,[-.35]),pn(5,[.45,-.35]),pn(9,[.62,.1,-.35])],hn=[.08,.2,.45],gn=(e,t,n,r,i,a,o)=>{un(e,[[t,a-4,n,r,a,i]],a-3.4,o,3,.9),un(e,[[t+.15,-17,n+.15,r-.15,a-3,i-.15]],-15,o+9,2,.5)},_n=[[0,.02,.6],[.55,.04,.72],[.88,.2,1.05],[1,.24,1.12],[1.4,.015,1]],vn=({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-Zt[0])<=Zt[0]-.5&&Math.abs(o-Zt[2])<=Zt[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])}),yn=(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)]},bn=[[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]],xn=(()=>{let e=e=>f[Math.min(Math.max(e,0),f.length-1)],t=[[0,140]];for(let n=0;n<=f.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*L(n,1,71)])}return[...t,[f.length,140]]})(),Sn=[[640,75,4,.17,.02,3],[690,95,3,.16,.03,5],[740,115,3,.15,.04,8]],Cn=(e,t,n,r)=>{let i=(i,a)=>X(e*n/i+7*r,t*n/i-3*r,r+a),a=n=>{let i=T*L(r,n,97);return e*Math.cos(i)+t*Math.sin(i)},o=Math.max(Y((a(1)-.93)/.07),.8*Y((a(2)-.95)/.05)),s=Math.max(Y((a(3)-.985)/.015),Y((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*wn(t){let i=[];(e=>{(e=>{(e=>{let t=Array.from({length:9},(e,t)=>{let n=(t+1)/10*(T/4);return[V*Math.cos(n),5+12*Math.sin(n)]}),n=[];ie(n,D(j([[V,0],[V,5],...t,[0,17]],48),ge),[z,0,B],le,[0,0,0],1);let r=(e,t)=>(t?Math.ceil:Math.floor)(e*48/T)*T/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*B,n[i]+n[a]+n[o]-3*z);if(Math.max(n[i+1],n[a+1],n[o+1])>5.01||!ut.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)=>[z+V*Math.cos(e),t,B+V*Math.sin(e),Math.cos(e),0,Math.sin(e),ge[0],ge[1],-1,ge[2]];for(let[t,n,a]of ut){let o=[r(t,0),t];for(let e=Math.ceil(t*48/T);e*T/48<n;e++)o.push(e*T/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)=>[z+(V+n)*Math.cos(e),t,B+(V+n)*Math.sin(e)];for(let t=0;t<70;t++){let n=t*T/70,r=n>T/2?n-T:n;if(ut.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/V,t,i));A(e,i(.72,1.5,2.9,.04),[.06,.06,.08],[z,2.2,B]);let o=e.length;y(e,.56,()=>A(e,i(.6,1.7,2.7,.07),[1,.85,.5],[z,2.2,B])),lt(e,o,a(n,2.2,.07),[Math.cos(n),0,Math.sin(n)],.6,.25)}let[,o,s,c,l]=x[0],u=B+o-l;for(let[t,n,r]of[[-s-.3,-s-.02,0],[s+.02,s+.3,0],[-s-.3,s+.3,c]])M(e,[z+t,r,u-.1],[z+n,c+.3,u+.5],_e),G(e,2,u-.12,[z+t+.09,r+.09,0],[z+n-.09,c+.21,0],we)})(e),(e=>{let t=[...k,...k.map(([e,t])=>[t,e]).reverse()];for(let[n,r]of t)G(e,1,.02,[z-n,0,B-r],[z+n,0,B+r],De,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]=[ye[a]+t[a/2],Math.sign(t[a/2])],[l,u]=[t[o/2],i[o/2]].sort((e,t)=>e-t),d=x.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]]=[ye[o]+t,ye[o]+n],G(e,a,s-c*d,f,p,l,u)};We(e,a,s,ye[o]+l,ye[o]+u,8,1.7,d&&[[ye[o]+f-p,ye[o]+f+p,m]]),g(l,u,0,.25,Ee,0,.02),g(l,u,7.4,7.6,we,0,.03);let _=u-l>6?Math.floor((u-l)/2.4):0;for(let t=0;t<_;t++){let n=l+(u-l)*(t+.5)/_;for(let t of[1.5,4.9])if(t>m||Math.abs(n-f)>p+.8){g(n-.72,n+.72,t,t+1.4,Ee,0,.02);let r=e.length;g(n-.6,n+.6,t+.2,t+1.2,Te,0,.04);let i=[0,0,0];i[a]=-c,He(e,r,i,Ce)}}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[z+r[0]*i,8,B+r[2]*i]};ze(e,[r(n,0),r(n+1,0),r(n+1,1),r(n,1)],De,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]]=[ye[o]+f-p,ye[o]+f+p],G(e,o,t[o],t,n,ke,1.4),G(e,o,n[o],t,n,ke,1.4),G(e,1,m,t,n,ke,.9),G(e,1,.02,t,n,De,1.85),Ue(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+(T/4-o)*t/a,e*T/i],s=(V-.3)*Math.cos(n);return[z+s*Math.cos(r),5+11.7*Math.sin(n),B+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);ze(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=>[z+3*Math.cos(e*T/16),16.2,B+3*Math.sin(e*T/16)];ze(e,[[z,16.2,B],n(t),n(t+1),n(t+2)],we)}re.forEach(t=>Be(e,t))})(e),(e=>{R.forEach(({min:t,max:n},r)=>{let i=r?2:0,[a,o,s]=[t[i],r?R[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;F(e,ft,c(a),c(o),[0,1,0],1,[1.75,l]);for(let t=5;t<o-a-1;t+=5)F(e,pt,c(a+t),c(a+t+.3),[0,1,0],.3,[1.75,l]);We(e,2-i,t[2-i]+u+.02,a,o,O,1.4),We(e,2-i,n[2-i]-u-.02,r?a:R[1].min[0],o,O,1.4),G(e,1,O-.01,t,n,ke,.9);let[d,f]=[[...t],[...n]];[d[2-i],f[2-i]]=[s-.15,s+.15],G(e,1,O-.02,d,f,we)})})(e),(e=>{for(let{min:t,max:n}of me){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(ve.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]);A(e,s(.72,2.6,3.8,.02),[.06,.06,.08],r);let c=e.length;y(e,.5,()=>A(e,s(.6,2.7,3.7,.04),[.9,.95,1],r)),lt(e,c,[o,3.2,a+.04*i],[0,0,i],.6,.25),ze(e,s(.56,2.6,3.8,-u-.04),Ee);let l=e.length;ze(e,s(.46,2.7,3.7,-u-.06),[.45,.48,.5]),He(e,l,[0,0,-i],Se)}}for(let r of[0,2])for(let[i,a]of[[t[r],u+.02],[n[r]-u,-.02]])We(e,r,i+a,t[2-r]+u,n[2-r]-u,4,1.5,ve.filter(e=>Math.abs(e.min[r]-i)<.01).map(e=>[e.min[2-r],e.max[2-r],O]));G(e,1,3.99,t,n,ke,.9);for(let i=0;i<3;i++){let a=t[0]+(n[0]-t[0])*(i+.5)/3;G(e,1,3.98,[a-1.2,0,r[2]-.3],[a+1.2,0,r[2]+.3],we)}}})(e);for(let{min:t,max:n}of[...me,...R])G(e,1,.02,t,n,Oe,1.99);for(let{min:t,max:n}of ve){let r=n[0]-t[0]<1?0:2;for(let i of[t[r]-.02,n[r]+.02])Ue(e,r,i,t[2-r],n[2-r],t[1])}})(e),(e=>{(e=>{let t=(t,n=Dt)=>A(e,t,n,[wt,5,Tt]),n=(e,n,r,i,a,o)=>{for(let s=e;s<n-1e-9;){let e=Math.min(n,(Math.floor(s/q+1e-9)+1)*q);t([Ut(s,r,o),Ut(e,r,o),Ut(e,i,o),Ut(s,i,o)],a),s=e}};for(let[t,r]of[[Wt[0][1],Wt[1][0]],[Wt[1][1],Wt[0][0]+T]])n(t,r,0,.45,J),y(e,1.6,()=>n(t,r,.16,.3,jt,.035)),n(t,r,3.18,3.32);n(0,T,4.55,5.01,J,.03),[.4,1.9,2.5,3.7,5.2].forEach(e=>n(e,e+.05,4.68,4.86,kt,.045));for(let e=0;e<70;e++){let n=(e+.5)*T/70,r=.07/Et;Gt(n)&&[0,2].includes(e%5)&&t([Ut(n-r,.45),Ut(n+r,.45),Ut(n+r,4.55),Ut(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?Ut(r*q+t*n/Ht(s)[0],5+s,i):Ut(r*q,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,Ot,.05),1&t?(y(e,1.6,()=>r([[n,1],[n,8]],.04,jt,.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,T,13.75,14.15,Ot,.05),y(e,1.6,()=>n(0,T,13.9,14,jt,.065));for(let[t,r]of[[5,0],[22,1],[34,0]])n(t*q+.02,(t+2)*q-.02,5.25+r,5.8+r,J,.03),y(e,2,()=>n(t*q+.04,t*q+.05,5.65+r,5.72+r,Pt,.045));let[,i,a,o,s]=x[0],c=Tt+i-s;for(let[t,n,r]of[[-a-.62,-a-.3,0],[a+.3,a+.62,0],[-a-.62,a+.62,o+.3]])M(e,[wt+t,r,c-.04],[wt+n,o+.62,c+.6],J),y(e,1.5,()=>A(e,[[t+.1,r+.1],[n-.1,r+.1],[n-.1,o+.52],[t+.1,o+.52]].map(([e,t])=>[wt+e,t,c-.055]),Mt,[wt,1,Tt]));for(let t=1;t<7;t++)for(let n of[-2.6,2.6])Vt(e,wt+n,c-2.5*t);let l=(e,t=0,n=0)=>[wt+t,e,Tt+n];Bt(e,l(17),.7,J,0),zt(e,l(17),l(25.099999999999998),.11),[1.9,1.5,1.1].forEach((t,n)=>{let r=20+1.6*n;zt(e,1&n?l(r,0,-t):l(r,-t),1&n?l(r,0,t):l(r,t),.06)}),Bt(e,l(25.4),.34,Nt)})(e),(e=>{R.forEach(({min:t,max:n},r)=>{let i=r?2:0,a=2-i,[o,s]=[t[i],r?R[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,M(e,s,c,Dt,12|(i?32:2)>>r);let o=r?c[a]+.015:s[a]-.015;y(e,1.8,()=>A(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}),jt,[(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],M(e,s,c,Dt,4|(i?48:3))}})})(e),(e=>{me.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)=>M(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)=>A(e,[c(t,n,a),c(r,n,a),c(r,i,a),c(t,i,a)],o,c(t,n,-1)),[d]=ve.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,O+.14,t]});l(c(t[i]-.06,4.7,0),c(n[i]+.06,5,.06),J,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),Dt,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,Dt),u(r+4*i,2,a,2.1,.02,Dt),A(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)],Dt,c(r,1,-1)))}if(r&&y(e,1.6,()=>u(t[0]+.3,4.82,n[0]-.3,4.9,.075,jt)),!r&&!d){u(f-1.1,.9,f+1.1,1.9,.02,J);for(let e=0;e<4;e++)u(f-1,1.05+.2*e,f+1,1.15+.2*e,.035,kt)}if(d?.[3]){let t=d[3];l(c(t-.5,2.95,0),c(t+.5,3.05,.22),J,s),y(e,1.8,()=>l(c(t-.4,2.83,0),c(t+.4,2.95,.12),At,8|s)),l(c(t-.05,4.1,0),c(t+.05,4.2,.5),J,s),l(c(t-.5,4.2,.32),c(t+.5,4.42,.5),kt),y(e,2,()=>u(t-.42,4.27,t-.3,4.35,.515,Pt)),zt(e,c(t+.35,4.42,.41),c(t+.35,5.4,.41),.03),Bt(e,c(t+.35,5.45,.41),.07,Nt);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);Vt(e,t,i)}}}}if(r){let r=n[0]-.7;M(e,[r-.3,5,t[2]+2],[r+.3,5.2,n[2]-2],J),[3.4,4.6,2.8].forEach((n,i)=>{let a=t[2]+2.5+1.5*i;zt(e,[r,5.2,a],[r,5.2+n,a],.04),Bt(e,[r,5.26+n,a],.07,1&i?Nt:jt)})}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]];M(e,[r[0]-.4,5,r[2]-.4],[r[0]+.4,5.12,r[2]+.4],J),zt(e,[r[0],5,r[2]],r,.16),Bt(e,r,.26,J,0),F(e,Rt,i(.1),i(1.1),Ft,1,1.15),zt(e,i(.2),i(1.05),.03),Bt(e,i(1.1),.08,Nt)}})})(e),(e=>{for(let t of Kt){let n=t[5];if(qt(e,t,n+.1,0,J),Jt(e,t,n,.015),t[6]){let r=e.length,i=[t[0],t[1],t[2],-t[3],-t[4]];qt(e,i,n+.1,u+.06,[.04,.04,.05]),qt(e,i,n,u+.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]]=[...be,-2]}}})(e)})(e);for(let[t,n]of a.pads.slice(0,a.pads.length/2))dn(e,t,n);for(let[t,n]of a.masts.slice(0,a.masts.length/2))fn(e,t,n,0)})(i),t.relief&&((e,t)=>{let{at:r}=t.relief,i=xn,o=(e,t)=>Math.max(r(e,Math.max(t,148)),0),s=e=>Y(4*(X(e/6,.5,82)-.35))*(.55+.45*X(e/1.7,.5,83)),c=([e,t],n)=>{let[r,i,a]=bn[n];return[e,n?r:o(e,t),t-i-a*s(e)*+!!n]};for(let t=0;t<i.length-1;t++){let[r,a]=[i[t],i[t+1]];for(let i=0;i<bn.length-1;i++){let o=[c(r,i),c(a,i),c(a,i+1),c(r,i+1)];for(let[c,l,u]of t+i&1?[[0,1,2],[0,2,3]]:[[0,1,3],[1,2,3]]){let d=P(oe(o[l],o[c]),oe(o[u],o[c]));if(Math.hypot(...d)<1e-9)continue;d=I(d),d=d[2]>0||Math.abs(d[2])<1e-9&&d[1]<0?d.map(e=>-e):d;let f=bn[i][3]*(.82+.3*L(t,i,73))*(.7+.3*s((r[0]+a[0])/2));for(let t of[o[c],o[l],o[u]])e.push(...t,...d,t[0]+t[2],t[1],n.ROCK,f)}}}a.pillars.forEach(([t,n,r,i,a],o)=>n>140&&gn(e,t,n,r,i,a,o+400)),A(e,[[-2,-30,140],[162,-30,140],[162,-30,158],[-2,-30,158]],[.012,.012,.015]);for(let t=0;t<9;t++){let n=6+17*t+8*L(t,1,77);y(e,.1,()=>A(e,[[n,-29.9,140],[n+9+6*L(t,2,77),-29.9,140],[n+5,-29.9,140.25+.3*L(t,3,77)]],[.2,.55,1]));let r=1.5+2.5*L(t,4,77);cn(e,[n,-29.6,142.5+5*L(t,5,77)],[r,.7*r,r],t+200,.25,!1)}})(i,t);let c=t.relief?.at??(()=>0);a.crags.forEach(e=>((e,{at:[t,n,r],R:i,H:a,s:o},s)=>{let{reach:c}=_(o,i,a),l=[t,n+m(a),r];he(e,i<1.5?3:i<2.5?4:5,e=>{let t=c(e);return[l[0]+e[0]*t,l[1]+e[1]*t,l[2]+e[2]*t]},n,n+a,o,.8+.4*L(o,5,41),s)})(i,e,c));let l=i.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],Xt-e[i+2],e[i+3],e[i+4],-e[i+5],...e.slice(i+6,i+10))}return t})(i));yield,t.relief&&((e,t)=>{for(let[n,r,i,o,s]of(e=>{let t=w(e.relief),[n,r,i,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,l,u=1)=>{if(((e,t)=>{let c=t-Xt/2,l=([t,n,r,i])=>Math.hypot(Math.max(t-e,e-r,0),Math.max(n-c,c-i,0));return c>.3&&Math.hypot((e-n)/i,(t-r)/o)<.97&&!p.some(e=>l(e)<2.5)&&!g.some(e=>l(e)<1)&&!a.pits.some(n=>Math.abs(e-n.x)<N+.5&&Math.abs(t-n.z)<N+.5)&&!a.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=L(l,3,211);c.push([e,s(e,t),t,n<.62?0:n<.945+.055*(1-u)?1:2,l])}};a.sites.forEach(([e,t,n],r)=>{for(let i=0;i<Math.round(8+5*n);i++){let a=e=>L(r,5*i+e,201),o=n*(.1+1.7*a(1)*a(1));l(e+o*Math.cos(T*a(2)),t+o*Math.sin(T*a(2)),1e3*r+i)}}),a.crags.forEach(({at:[e,,t],R:n},r)=>{for(let i=0;i<Math.round(8+5*n);i++){let a=e=>L(r,5*i+e,215),o=n*(1.32+.75*a(1)*a(1));l(e+o*Math.cos(T*a(2)),t+o*Math.sin(T*a(2)),5e5+1e3*r+i)}}),a.bowls.forEach(([e,t,n],r)=>{for(let i=0;t>=Xt/2&&i<Math.round(1.1*n);i++){let a=e=>L(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(T*a(2)),t+o*n*Math.sin(T*a(2)),1e5+1e3*r+i)}});for(let e=0;e<60;e++){let t=t=>L(e,t,205),n=1+158*t(1),r=f[Math.floor(n)];l(n,Xt/2+8+Math.max(r,0)+.5+2.5*t(2)*t(2),2e5+e,.5)}for(let e=0;e<18;e++){let t=t=>L(e,t,207),[r,a,s]=[n+i*(1.8*t(1)-.9),Xt/2+4+(o-8)*t(2),T*t(3)];for(let n=0;n<10+12*t(4);n++)s+=.5*(L(e,10+n,208)-.5),[r,a]=[r+(1+1.4*L(e,40+n,208))*Math.cos(s),a+(1+1.4*L(e,40+n,208))*Math.sin(s)],l(r+.8*(L(e,70+n,208)-.5),a+.8*(L(e,100+n,208)-.5),3e5+100*e+n,.6)}for(let e=0;e<520;e++){let t=t=>L(e,t,209),[r,a]=[n+i*(2*t(1)-1),Xt/2+o*t(2)];(X(r/20,a/20,77)>.62||t(3)<.04)&&l(r,a,4e5+e,.7)}return[...c,...c.map(([e,,t,n,r])=>[e,s(e,Xt-t),Xt-t,n,r])]})(t)){let t=e=>L(s,e,213),a=hn[o]*(.88+.24*t(1)),[c,l,u]=[a/2,a/2*(.65+.35*t(2)),a*(.5+.3*t(3))],[d,f]=[Math.cos(T*t(4)),Math.sin(T*t(4))],p=r+.1*u;he(e,mn[o],e=>{let[t,r]=[e[0]*d+e[2]*f,e[2]*d-e[0]*f],a=(.9+.2*X(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]*a,p+e[1]*a,i+e[2]*a]},r,p+u/2,s,.5+.25*t(5))}})(l,t);for(let[e,t,n,r,i]of a.pillars)t<140&&r>140&&gn(l,e,t,n,r,i,401);return((e,t)=>{let r={relief:t.relief&&w(t.relief)},i=(e,n,i)=>!t.relief||Array.from({length:17},(e,t)=>t*T/16).every((t,a)=>C(r,e+(a?i*Math.cos(t):0),n+(a?i*Math.sin(t):0))===0);for(let r=0,a=0;a<72&&r<900;r++){let[o,s,c]=[Yt*L(r,1,61),Xt*L(r,2,61),.6+2*L(r,3,61)**2];if(!vn(t,o,s,1.5*c)||!i(o,s,1.5*c)||Math.abs(s-Zt[2])<24||(t.rovers??[]).some(([e,,t])=>Math.hypot(o-e,s-t)<6))continue;a++;let l=(e,t)=>{let[i,a,l]=_n[e],[u,d]=[i*(e&&e<4?.86+.28*L(r,t%12,67):1),e===2||e===3?a*(.55+.45*L(r,t%12,68)):a],f=t*T/12,[p,m]=[Math.cos(f),Math.sin(f)],[h,g]=[_n[Math.max(e-1,0)],_n[Math.min(e+1,_n.length-1)]],_=-3*(g[1]-h[1])/((g[0]-h[0])*c),v=Math.hypot(_,1),[y,b]=[o+p*u*c,s+m*u*c];return[y,d,b,_*p/v,1/v,_*m/v,y,b,n.STONE,l]};for(let t=0;t<_n.length-1;t++)for(let n=0;n<12;n++){let[r,i,a,o]=[l(t,n),l(t+1,n),l(t+1,n+1),l(t,n+1)];e.push(...r,...a,...i,...r,...o,...a)}}})(l,t),yield,t.relief&&(((e,t)=>{let{at:r}=t.relief,i=(e,t)=>r(e,Math.max(t,148));for(let t of[1,-1]){let r=(e,r)=>{let a=I([i(e-1,r)-i(e+1,r),2,t*(i(e,r-1)-i(e,r+1))]);return[e,Math.max(i(e,r),0),140+t*(r-140),...a,e,140+t*(r-140),n.STONE,1]};for(let t=0;t<xn.length-1;t++){let[n,i]=[xn[t],xn[t+1]];if(n[0]!==i[0]){let[t,a,o,s]=[r(n[0],156),r(i[0],156),r(i[0],i[1]),r(n[0],n[1])];e.push(...t,...o,...a,...t,...s,...o)}}}})(l,t),(e=>{for(let[t,{x:i,z:c,level:l,rows:u}]of a.pits.entries()){let a=(e,t)=>u[e]?.[2+t]??0,d=Array.from({length:u.length+1},(e,t)=>[u[0][0]+t,-Math.min(a(t-1,0),a(t,0)),Math.min(a(t-1,1),a(t,1))]),f=(e,t)=>[e,l,t,0,1,0,e,t,n.STONE,.6+.4*Y((Math.hypot(e-i,t-c)-s)/3)],p=(t,n,r,i)=>e.push(...t,...r,...n,...t,...i,...r);for(let[e,t]of[[c-N,c-s],[c+s,c+N]])for(let n=i-N;n<i+N;n+=2)p(f(n,e),f(n+2,e),f(n+2,t),f(n,t));for(let n=0;n<d.length-1;n++){let[[a,o,s],[u,m,h]]=[d[n],d[n+1]];p(f(i-N,a),f(i+o,a),f(i+m,u),f(i-N,u)),p(f(i+s,a),f(i+N,a),f(i+N,u),f(i+h,u));for(let a of[1,2]){let o=[l,l-.6,l-5,l-10,r],s=(e,t)=>[i+e[a]+(a>1?-1:1)*(t&&t<4?.9*L(e[0],t,83+a)-.25:0),o[t],e[0]];for(let u=0;u<4;u++){let f=[s(d[n],u),s(d[n+1],u),s(d[n+1],u+1),s(d[n],u+1)],p=[i+(a>1?99:-99),o[u],c],m=e.length;ln(e,[f[0],f[1],f[2]],p,r-12,l,t+u,1.2),ln(e,[f[0],f[2],f[3]],p,r-12,l,t+u,1.2);for(let t=m+3;t<e.length;t+=10){let n=I([e[t],e[t+1]+.9,e[t+2]]);[e[t],e[t+1],e[t+2]]=n}}}}let m=(e,t)=>[e,r,t,0,1,0,e,t,n.STONE,.5];p(m(i-s-1.5,c-s),m(i+s+1.5,c-s),m(i+s+1.5,c+s),m(i-s-1.5,c+s));let h=u[s][3],g=(l-r)/o;for(let n=0;n<o-1;n++){let a=i+h-1.3*(o-1-n);un(e,[[a,r-1,c-1,a+1.3,r+g*(n+1),c+1]],r,9*t+n,2,.9)}for(let n=0;n<20;n++){let r=T*(n+L(t,n,85))/20,[a,o,u]=[i+(s+1.6)*Math.cos(r),c+(s+1.6)*Math.sin(r),.3+.35*L(t,n,86)];un(e,[[a-u,l-.3,o-u,a+u,l+.9*u,o+u]],l,40*t+n,1,.9)}}})(l),yield,((e,t)=>{let{at:r}=t.relief,i={relief:w(t.relief)};a.bowls.forEach(([t,a,o],s)=>{let c=o<12?0:Math.round(T*o/1.5),l=Array.from({length:c},(e,n)=>{let[i,s]=[Math.cos(T*n/c),Math.sin(T*n/c)],[l,u]=[o,-1/0];for(let e=.8*o;e<1.3*o;e+=.5){let n=r(t+i*e,a+s*e);[l,u]=n>u?[e,n]:[l,u]}return l}),u=Array.from({length:c},(e,r)=>{let[o,u]=[Math.cos(T*r/c),Math.sin(T*r/c)],d=[-2,-1,0,1,2].reduce((e,t)=>e+l[(r+t+c)%c],0)/5,f=L(r,s,87);return[-2.4,-1.2,0,1.2,2.4].map((e,c)=>{let[l,p]=[t+o*(d+e),a+u*(d+e)],m=[.04,.12,.1+.15*f,.1,.04][c],h=[.62+.3*L(r>>1,s,88),.9,1.22+.2*f,1.1,1][c];return[l,C(i,l,p)+m,p,0,1,0,l,p,n.STONE,h]})});u.forEach((t,n)=>{let r=u[(n+1)%c];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])})})})(l,t),yield,((e,t)=>{let r=w(t.relief),[i,o,s,c]=r.bound,[l,u]=[yn(r.x0,i+s),yn(r.z0,o+c)],d=(e,n)=>{let[i,a]=[(e-r.x0)/r.cell,(n-r.z0)/r.cell];return i%1||a%1||i<0||a<0||i>=r.nx||a>=r.nz?t.relief.at(e,n):r.h[i+a*r.nx]},f=(e,t)=>a.bowls.reduce((n,[r,i,a])=>{let o=Math.hypot(e-r,t-i),s=o/a,c=X((e-r)/o*5+r,(t-i)/o*5+i,19);return s>1.05&&s<2.4?n+.22*Y(5*(c-.55))*Y((2.4-s)/.9)*Y(6*(s-1.05)):n},0),p=/* @__PURE__ */ new Map,m=(e,t)=>{let r=4096*e+t,i=p.get(r);if(!i){let a=d(e,t),o=[d(e-4,t)-d(e+4,t),d(e,t-4)-d(e,t+4)],s=a===0&&o[0]===0&&o[1]===0,c=n=>s?0:1.4*(L(e,t,131+n)-.5);i=[e,a,t,...I([o[0]+c(0),8,o[1]+c(1)]),e,t,n.STONE,Math.min(Math.max(1+a/60,.78),1.2)+f(e,t)],p.set(r,i)}return i},h=(e,t)=>{let[n,r,a,d]=[l[e],l[e+1],u[t],u[t+1]];if(!(n<r&&a<d))return 0;let f=Math.hypot((Math.min(Math.max(i,n),r)-i)/s,(Math.min(Math.max(o,a),d)-o)/c);return f<1?2:+(f<1.65)};for(let t=0;t<l.length-1;t++)for(let n=0;n<u.length-1;n++){let[i,o,s,c,d]=[l[t],l[t+1],u[n],u[n+1],h(t,n)];if(d>1)for(let t=i;t<o;t+=r.cell)for(let n=s;n<c;n+=r.cell){if(t>=r.hole[0]&&t<r.hole[2]&&n>=r.hole[1]-8&&n<r.hole[3]+8||a.pits.some(e=>t>=e.x-N&&t<e.x+N&&n>=e.z-N&&n<e.z+N))continue;let[i,o,s,c]=[m(t,n),m(t+r.cell,n),m(t+r.cell,n+r.cell),m(t,n+r.cell)];e.push(...i,...s,...o,...i,...c,...s)}else if(d){let r=[];for(let[e,a,l,u,d]of[[i,s,o,s,h(t,n-1)],[o,s,o,c,h(t+1,n)],[o,c,i,c,h(t,n+1)],[i,c,i,s,h(t-1,n)]]){let t=d>1?5:1;for(let n=0;n<t;n++)r.push(m(e+(l-e)*n/t,a+(u-a)*n/t))}let a=m((i+o)/2,(s+c)/2);r.forEach((t,n)=>e.push(...a,...r[(n+1)%r.length],...t))}}})(l,t),yield,((e,t)=>{let{at:n}=t.relief,i=I(P([0,1,0],$t)),o=[i,P($t,i),$t];for(let[t,r]of a.dishes)fn(e,t,r,n(t,r),6,[1,.25,.15]),ie(e,an,[t,n(t,r)+5.2,r],o,[0,0,-.9],1);for(let[t,r,i,o]of a.ramps)for(let a of[-8,8])fn(e,t+a*o,r-a*i,n(t+a*o,r-a*i),2.2,[1,.45,.1]);let[s,c]=a.wreck,l=r,u=I([.8,-.35,.5]),d=I(P([0,1,0],u));ie(e,rn,[s-3,l+3.1,c-2],[d,P(u,d),u],[0,0,0],[1.6,1.4,.55],[.6,.6,.62]),A(e,[[s+3,l,c+4],[s+6.5,l+.2,c+5],[s+4,l+2.6,c+5.5]],[.7,.3,.14]),fn(e,s-3.4,c+2.6,l,3.5,[1,.12,.08])})(l,t)),((t,n)=>{for(let[r,i,a,o,s,c]of Sn){let l=t=>{let l=t*T/480,[u,d]=[Math.cos(l),Math.sin(l)],f=i*Cn(u,d,r,c),p=(t+1)*T/480,m=(i*Cn(Math.cos(p),Math.sin(p),r,c)-f)/(r*T/480);return Array.from({length:a+1},(t,i)=>{let l=i/a,p=r-.3*f*(1-l),h=r/(30+26*(1-l))*(1+.05*l),g=2*X(u*h+c+1.7*l,d*h-1.3*l,c+9)-1,_=I([-u-d*(-1.5*m-1.6*g*(1-.5*l)),.75,u*(-1.5*m-1.6*g*(1-.5*l))-d]),v=Math.max(e(_,n),0),y=(.8+.3*X(u*r/90-c,d*r/90+2.3*l,c+11))*(.72+.28*Y(.5+.9*g))*(s+(o-s)*Math.min(1.2*v+(i===a?.3:0),1));return[Zt[0]+u*p,(f+25)*l-25,Zt[2]+d*p,u,0,d,y,y,-2,1.03*y]})},u=l(0);for(let e=1;e<=480;e++){let n=l(e%480);for(let e=0;e<a;e++)t.push(...u[e],...n[e],...n[e+1],...u[e],...n[e+1],...u[e+1]);u=n}}})(l,I(t.sun.dir)),l}var Tn=()=>{let e=[];return(e=>{let t=$t,n=t.map(e=>-e),r=I([n[2],0,-n[0]]),i=P(n,r),a=t.map((e,t)=>Zt[t]+800*e),o=t.map((e,t)=>a[t]+100*e),[s,c]=[28,64],l=(e,t)=>a.map((n,a)=>n+60*e*(r[a]*Math.cos(t)+i[a]*Math.sin(t))),u=e.length;for(let t=0;t<s;t++)for(let n=0;n<c;n++){let[r,i]=[n*T/c,(n+1)*T/c],[a,u]=[(t+.5)/s,(n+.5)*T/c],[d,f]=[a*Math.cos(u),a*Math.sin(u)],p=Math.sqrt(1-a*a),[m,h]=[(Math.atan2(d,p)+1.5)/T*12,6*(Math.asin(f)/Math.PI+.5)],g=en(m,h,11)>.5?ue([.13,.32,.09],[.4,.3,.15],en(2*m,2*h,13)):[.03,.16,.5],_=Math.abs(f)>.93?1:Y(4*(en(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)),A(e,t?[l(t/s,r),l((t+1)/s,r),l((t+1)/s,i),l(t/s,i)]:[l(0,0),l(1/s,r),l(1/s,i)],g,o)}de(e,u,1.5)})(e),e},{FORWARD:En,BACK:Dn,JUMP:On,CROUCH:kn,SPRINT:An,USE:jn}=S,Mn=(e,t,n,r,i)=>e.push(...t,...n,r[0],r[1],i,r[2]),Z=(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])Mn(e,n[a],t,r,i)},Nn=(e,t,n,r)=>{let i=D(j(e,r),t);for(let e=8;e<i.length;e+=10)i[e]=n;return i},Q=(e,t,n,r,i,a=d)=>F(e,Nn([[0,0],[r,0],[r,1],[0,1]],i,a,8),t,n,[0,1,0],1),Pn=[.2,.22,.26],Fn=[.42,.45,.5],In=[.05,.05,.06],Ln=[.3,.32,.36],Rn=[.95,.72,.08],zn=[.08,.35,.8],Bn=[.35,.9,1.4],Vn=[[1.6,.12,.08],[.15,1.4,.35],[1.5,.8,.12],[.3,.6,1.6]],Hn=(e,[t,,n],r,i,a,o)=>{for(let s=0;s<24;s++){let[c,l]=[2*s*Math.PI/24,2*(s+1)*Math.PI/24],u=(e,i)=>[t+r*Math.cos(e),i,n+r*Math.sin(e)],d=(c+l)/2,f=[Math.cos(d),0,Math.sin(d)];for(let t of[u(c,i),u(c,a),u(l,a),u(c,i),u(l,a),u(l,i)])Mn(e,t,f,o,-1);for(let r of[[t,a,n],u(l,a),u(c,a)])Mn(e,r,[0,1,0],o,-1)}},Un=(e,t)=>{let n=43758.5453*Math.sin(91.7*e+47.3*t);return n-Math.floor(n)},Wn=[.2,.22,.26],Gn=[.5,.53,.58],Kn=[.13,.14,.17],qn=[.62,.65,.7],Jn=[.42,.44,.48],Yn=[.06,.06,.07],Xn=[.1,.1,.12],Zn=[.3,.45,.9],Qn=[.55,.7,1.1],$n=[.08,.35,.8],er=[2.2,2.3,2.6],tr=2*Math.PI,nr=48,rr=(e,t,n,r,i,a,o=-1)=>{let[s,c]=[n,r].map(e=>e.map((e,n)=>e-t[n])),l=[s[1]*c[2]-s[2]*c[1],s[2]*c[0]-s[0]*c[2],s[0]*c[1]-s[1]*c[0]],u=Math.hypot(...l)||1;for(let s of[t,n,r,t,r,i])Mn(e,s,[l[0]/u,l[1]/u,l[2]/u],a,o)},ir=(e,t,n,r,i,a=-1)=>{let o=([e,t],n)=>[n,t,e];rr(e,o(t[0],n),o(t[1],n),o(t[2],n),o(t[3],n),i,a);for(let s=0;s<4;s++){let[c,l]=[t[s],t[(s+1)%4]];rr(e,o(l,n),o(c,n),o(c,r),o(l,r),i,a)}},ar=({hull:[e,,t],deck:n})=>({cz:t,cy:n+l.DAIS+l.UP,px:e+l.X1}),or=l.R+5,sr=(e,t,n,r,i,a)=>{let{cz:o,cy:s,px:c}=ar(e),u=Math.max(Math.min(n,r)-o,o-Math.max(n,r),0),d=Math.max(i-s,s-a,0);return t>c-4&&Math.hypot(u,d)<l.R+.3},cr=(e,t,n,r,i,a)=>{rr(e,t,n,r,i,a),rr(e,i,r,n,t,a)},lr=2*Math.PI,ur=[.5,.51,.53],dr=[.62,.63,.64],fr=[.36,.37,.4],pr=[.16,.17,.19],mr=[1.5,1.4,1.05],$=(e,t)=>{let n=43758.5453*Math.sin(91.7*e+47.3*t+3.1);return n-Math.floor(n)},hr=(e,t,n)=>e>=t+44&&e<n-36,gr=[.78,.8,.84],_r=[.95,.68,.22],vr=[.06,.06,.07],yr=[.9,.9,.88],br=[.14,.24,.55],xr=[.75,.42,.2],Sr=[3.2,.35,.15],Cr=2*Math.PI,wr=(e,t,n,r,i,a=-1,o=48)=>ie(e,Nn(t,i,a,o),n,h(r,Math.abs(r[1])>.9?[1,0,0]:[0,1,0]),[0,0,0],1),Tr=(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},Er=(e,t)=>{let n=Tr(Math.floor(Math.min(e,Cr-e)/(4*Cr/72)),Math.floor(t/6),3);return ur.map(e=>e*(1+.12*n))},Dr=(e,t,n,r,i=-2)=>{for(let a of[0,1,2,0,2,3])Mn(e,[t[a][0],n,t[a][1]],[0,1,0],r,i)},Or=[.55,.57,.6],kr=[.9,.45,.08],Ar=[.95,.75,.1],jr=[.4,2.6,1.6],Mr=[2.6,1.3,.25],Nr=[2.2,2.3,2.6];function*Pr(e,n){let r=yield*wn(e);return yield,r=r.concat(mt(e,n)),e.station&&(yield,r=r.concat((e=>{let{hall:[n],deck:r,hull:[i,a,o,s],gun:u}=e,f=[],{R:p}=t,[m,h]=[n[0],n[0]+48],g=[m,h].flatMap(e=>{let t=Math.acos((e-i)/p);return[t,Cr-t]}),_=[...Array.from({length:72},(e,t)=>t*Cr/72),...g,Cr].sort((e,t)=>e-t);for(let t=a;t<s-.01;t+=2){let n=hr(t,r,s);for(let a=0;a+1<_.length;a++){let[s,l]=[_[a],_[a+1]],u=(s+l)/2,d=i+p*Math.cos(u);if(d>m&&d<h&&t>=r-2&&t<r+16||sr(e,i+p*Math.cos(u),o+p*Math.sin(s),o+p*Math.sin(l),t,t+2))continue;let g=n,v=g?_r:Er(u,t),y=g?.22:.03;for(let[e,n]of[[a,t],[a+1,t],[a+1,t+2],[a,t],[a+1,t+2],[a,t+2]]){let t=_[e],r=e%(_.length-1),[a,s]=[Tr(r,n,1)*y,Tr(r,n,2)*y],l=[Math.cos(t)+a*Math.sin(t),s,Math.sin(t)-a*Math.cos(t)];Mn(f,[i+p*Math.cos(t),n,o+p*Math.sin(t)],l,v,g?c:-1)}}}wr(f,[[p,0],[p-3,3],[.6*p,E.DOME-1],[0,E.DOME]],[i,s,o],[0,1,0],gr,d);let v=[i-16,s+E.MAST,o];Q(f,[v[0],s+4,o],v,.8,gr);let y=Array.from({length:6},(e,t)=>[2.4*t,3.6*(t/5)**2]);wr(f,[...y,...[...y].reverse().map(([e,t])=>[e,t-.3])],v,[-.6,.8,0],yr,-1,20);let b=E.BARREL*p,x=a-u[1];wr(f,[[p,0],[p-1.5,2],[b+2,2.6],[0,2.6]],[i,a,o],[0,-1,0],gr,d),wr(f,[[0,2.6],[b+2,2.6],[b+2,5],[b,6.5],[b,x-4],[b+3,x-1.5],[b+3,x],[b-2,x],[b-3,x-10],[0,x-10.5]],[i,a,o],[0,-1,0],vr,d);for(let e=10;e<x-8;e+=7)wr(f,[[0,e],[b+.8,e],[b+.8,e+1.6],[0,e+1.6]],[i,a,o],[0,-1,0],gr,d);wr(f,[[0,x-10.3],[b-3.5,x-10.1],[0,x-9.9]],[i,a,o],[0,-1,0],Sr,-2),Z(f,[i-b-8,u[1]-18,o-16],[i-b-7.2,u[1]+8,o+16],yr,d),Q(f,[i-b-1,u[1]+3,o],[i-b-7.2,u[1]+3,o],.6,gr);let S=a+(s-a)*E.WING,[C,w,T]=[E.PANEL,E.SPAN,E.GAP],D=(e,t,n,r,a,s)=>Z(f,[i-a,n,o+Math.min(e,t)],[i+a,r,o+Math.max(e,t)],s,d);for(let e of[-1,1]){let t=e*(p+E.BOOM);Q(f,[i,S,o+e*p],[i,S,o+t],1.4,gr),D(t,t+3*e,S-6,S+6,2,gr),Q(f,[i,S,o+t],[i,S,o+t+e*(4*(C+T)+2)],.6,xr);for(let n=0;n<4;n++){let r=t+e*(3+n*(C+T)),[i,a]=[Math.min(r,r+e*C),Math.max(r,r+e*C)];D(i,a,S-w/2,S+w/2,.2,br);for(let e of[S-w/2,S+w/2-.6,S-.3,S-w/4,S+w/4-.3])D(i,a,e,e+.6,.3,gr);for(let e of[i,i+C/2-.3,a-.6])D(e,e+.6,S-w/2,S+w/2,.3,gr)}}return((e,n=[])=>{let{hall:[r],deck:i,hull:[a,o,s,c]}=e,{R:u}=t,[d,f]=[r[0],r[0]+48],p=o+(c-o)*E.WING,m=(e,t,n,r)=>[a+n*Math.cos(e)-t*Math.sin(e),r,s+n*Math.sin(e)+t*Math.cos(e)],h=(t,n,r,o)=>{let c=a+u*Math.cos(t),m=c>d-4-n&&c<f+4+n&&o>i-4&&r<i+19,h=Math.abs(Math.cos(t))<.2&&o>p-10&&r<p+10,g=((e,t,n,r,i)=>{let{cz:a,cy:o,px:s}=ar(e);return t>s-4&&Math.hypot(n-a,r-o)<or+.5+i})(e,c,s+u*Math.sin(t),Math.max(r,Math.min(o,i+l.DAIS+l.UP)),n);return!m&&!h&&!g},g=(e,t,r,i,a,o,s)=>{let[c,l]=[u+a,u+o],d=m(e,0,(c+l)/2,(r+i)/2),f=(n,r,i)=>m(e,n*t,r,i);for(let e of[[f(-1,l,r),f(1,l,r),f(1,l,i),f(-1,l,i)],[f(-1,c,i),f(-1,l,i),f(1,l,i),f(1,c,i)],[f(-1,c,r),f(1,c,r),f(1,l,r),f(-1,l,r)],[f(-1,c,r),f(-1,l,r),f(-1,l,i),f(-1,c,i)],[f(1,c,r),f(1,c,i),f(1,l,i),f(1,l,r)]])A(n,e,s,d)},_=e=>e<1e-6||e>Math.PI-1e-6?[e]:[e,lr-e],v=(e,t,r,i,a)=>{for(let o=0;o<72;o++){let[s,c]=[o*lr/72,(o+1)*lr/72],[l,d]=[u+t,u+i];A(n,[m(s,0,l,e),m(c,0,l,e),m(c,0,d,r),m(s,0,d,r)],a,m((s+c)/2,0,u-1,(e+r)/2))}};for(let[e,t]of[[0,o+14],[1,c-24]]){v(t,.12,t+3,.12,pr),v(t-.6,0,t,.45,dr),v(t+3,.45,t+3.6,0,dr);for(let n=0;n<14;n++){let r=(n+.5+.4*$(n,e))*Math.PI/14,i=.5+.9*$(n,e+7);for(let a of _(r))g(a,i,t+.4,t+1.2+1.4*$(n,e+3),.1,.35,fr)}}[[o+1,o+13],[o+18,i+44],[c-36,c-25],[c-20,c-1]].forEach(([e,t],r)=>{for(let r=0;r<18;r++){let i=4*r*lr/72;if(h(i,.1,e,t)){let r=(e,t)=>m(i,.09*e,u+.03,t);A(n,[r(-1,e),r(1,e),r(1,t),r(-1,t)],pr,m(i,0,u,e))}}let i=Math.round(.5*(t-e));for(let n=0;n<i;n++){let a=(n+.15+.7*$(n,10+r))*Math.PI/i,o=Math.min(t-e-2,3+8*$(n,20+r)),s=e+1+(t-e-2-o)*$(n,30+r),c=2+4*$(n,40+r);if(h(a,c,s,s+o))for(let e of _(a))g(e,c,s,s+o,0,.35,dr),$(n,45+r)<.5&&o>3&&g(e,.6*c,s+.25*o,s+.75*o,.35,.7,ur)}for(let n=0;n<i;n++){let a=(n+$(n,50+r))*Math.PI/i,o=.8+2.4*$(n,60+r),s=e+.5+(t-e-1-o)*$(n,70+r),c=.6+1.8*$(n,80+r);if(h(a,c,s,s+o))for(let e of _(a))g(e,c,s,s+o,0,.6+1.2*$(n,90+r),fr)}for(let i=0;e+3+10*i<t-1;i++){let t=e+3+10*i;for(let e=0;e<9;e++){let a=4+Math.floor(5*$(e,100+r+9*i)),o=1.2/u,s=(a-1)*o,c=(e+.1+.5*$(e,110+r+9*i))*Math.PI/9;if(c+s>Math.PI||!h(c+s/2,s*u/2+1,t,t+.45))continue;let l=n.length;for(let e=0;e<a;e++)for(let r of _(c+e*o)){let e=(e,t)=>m(r,.35*e,u+.06,t);A(n,[e(-1,t),e(1,t),e(1,t+.45),e(-1,t+.45)],mr,m(r,0,u,t))}de(n,l,1)}}})})(e,f),f})(e.station),(e=>{let{hall:[n],deck:r,hull:[i,,a]}=e,o=[],[s,c]=[n[0]+4,n[0]+44],[u,d]=[a-t.R,a+t.R];for(let[e,t,n,i]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]]){Q(o,[e,r+t,u+5],[e,r+t,d-5],n,Or);for(let a=u+8;a<d-5;a+=8)Z(o,[Math.min(e,e-.5*i),r+t-n-.1,a-.15],[Math.max(e,e-.5*i)+.01,r+t+n+.1,a+.15],vr),a/8%3<1&&Q(o,[e,r+t,a+1.5],[e,r+t,a+1.8],n+.12,kr,-1)}for(let e of[s+.6,c-.6])for(let t of[u+6,d-6])Q(o,[e,r,t],[e,r+14,t],.3,Or);for(let e of[i-10,i+10])Q(o,[e,r+13.2,u+5],[e,r+13.2,d-5],.6,Or);for(let e=u+10;e<d-5;e+=12)Z(o,[i-4,r+13.7,e-.6],[i+4,r+13.9,e+.6],Nr,-2);for(let e of[-1,1]){let[t,n]=[i+6,a+10*e];for(let e=0;e<32;e++){let[i,a]=[e*Cr/32,(e+1)*Cr/32],s=(e,r)=>[t+r*Math.cos(e),n+r*Math.sin(e)];Dr(o,[s(i,7),s(a,7),s(a,6.4),s(i,6.4)],r+.03,Ar,-1),e%4==0&&Z(o,[t+7.4*Math.cos(i)-.15,r,n+7.4*Math.sin(i)-.15],[t+7.4*Math.cos(i)+.15,r+.12,n+7.4*Math.sin(i)+.15],Mr,-2)}let l=e<0?u:d;for(let i=n+10*e;e*(l-i)>4;i+=5*e)for(let n of[-1,1])Dr(o,[[t+.4*n,i+1.2*e],[t+3.2*n,i-.6*e],[t+3.2*n,i-1.3*e],[t+.4*n,i+.5*e]],r+.04,Mr);Dr(o,[[s,l-.6*e],[c,l-.6*e],[c,l-.2*e],[s,l-.2*e]],r+.04,jr);for(let t of[s+.06,c-.06])Z(o,[t-.06,r,l-.6*e-.2],[t+.06,r+11,l-.6*e+.2],jr,-2);Z(o,[s,r+10.94,l-.6*e-.2],[c,r+11,l-.6*e+.2],jr,-2)}return((e,n)=>{let{X0:r,X1:i,Z:a,H:o,STAIR0:s,STAIR1:c,STEPS:u,W:d,DAIS:f,GALLERY:p,SIDE:m,R:h}=l,{hull:[g,,_],deck:v}=n,{cy:y,px:b}=ar(n),[x,S]=[g+r,g+i],C=(e,t)=>[_+e*Math.cos(t),y+e*Math.sin(t)],w=[[a,v+o-y],[-a,v+o-y],[-a,v-y],[a,v-y]].map(([e,t])=>(Math.atan2(t,e)+tr)%tr),T=[...Array.from({length:49},(e,t)=>t*tr/nr),...w].sort((e,t)=>e-t),E=e=>{let[t,n]=[Math.cos(e),Math.sin(e)],r=Math.min(Math.abs(t)>1e-9?a/Math.abs(t):1/0,n>1e-9?(v+o-y)/n:n<-1e-9?(v-y)/n:1/0);return[_+r*t,y+r*n]};for(let t=0;t+1<T.length;t++){let[n,r]=[T[t],T[t+1]];if(r-n<1e-6)continue;let i=[C(h,n),C(h,r),E(r),E(n)],a=([e,t],n)=>[n,t,e];rr(e,a(i[0],b),a(i[1],b),a(i[2],b),a(i[3],b),Wn),rr(e,a(i[3],b+.5),a(i[2],b+.5),a(i[1],b+.5),a(i[0],b+.5),Wn)}let D=(e,n,r)=>{let[i,a]=C(e,n);return[g+Math.sqrt(t.R**2-(i-_)**2)+r,a,i]};for(let t=0;t<nr;t++){let[n,r]=[t*tr/nr,(t+1)*tr/nr],[i,a]=C(h,n),[o,s]=C(h,r);cr(e,[b+.5,a,i],[b+.5,s,o],D(h,r,.3),D(h,n,.3),Gn),cr(e,D(h,n,.3),D(h,r,.3),D(or,r,.15),D(or,n,.15),Jn),cr(e,D(or,n,.15),D(or,r,.15),D(or,r,-.3),D(or,n,-.3),Kn)}for(let t=0;t<nr;t++){let[n,r]=[t*tr/nr,(t+1)*tr/nr];ir(e,[C(h,n),C(h-.7,n),C(h-.7,r),C(h,r)],b-.8,b,Gn),ir(e,[C(h+1.6,n),C(h,n),C(h,r),C(h+1.6,r)],b-.3,b,Kn),ir(e,[C(4.6,n),C(4.1,n),C(4.1,r),C(4.6,r)],b-.4,b,Gn)}for(let t=0;t<9;t++){let[n,r]=[(t+.06)*Math.PI/9,(t+.94)*Math.PI/9];ir(e,[C(h+3,n),C(h+1.7,n),C(h+1.7,r),C(h+3,r)],b-1.2,b,Gn),ir(e,[C(h+2.8,n),C(h+1.9,n),C(h+1.9,r),C(h+2.8,r)],b-1.25,b,Qn,-2)}for(let t=0;t<8;t++){let n=t*tr/8+tr/16,[r,i]=[Math.cos(n),Math.sin(n)],a=.18,o=(e,t)=>[_+e*r-t*i,y+e*i+t*r];ir(e,[o(h-.6,a),o(4.4,a),o(4.4,-.18),o(h-.6,-.18)],b-.3,b,Gn)}let ee=(c-s)/u;for(let t=0;t<u;t++){let[n,r]=[g+s+ee*t,v+f*(t+1)/u];Z(e,[n-.02,r-.08,_-d+.1],[n+.06,r-.02,_+d-.1],Zn,-2)}for(let t of[-1,1]){let n=_+t*(d-.15),r=g+s+.3;Q(e,[r,v+1.1,n],[g+c,v+f+1.1,n],.05,qn);for(let t=r;t<g+c;t+=1.5){let r=v+f*(t-g-s+ee)/(c-s);Q(e,[t,Math.min(r,v+f),n],[t,Math.min(r,v+f)+1.1,n],.04,qn)}let i=_+t*(m+.15);for(let[n,r]of[[[g+p+.15,i],[g+c+.15,i]],[[g+c+.15,i],[g+c+.15,_+t*d]],[[g+p+.15,i],[g+p+.15,_+t*(a-.3)]]]){Q(e,[n[0],v+f+1.1,n[1]],[r[0],v+f+1.1,r[1]],.05,qn);let t=Math.max(1,Math.round(Math.hypot(r[0]-n[0],r[1]-n[1])/1.5));for(let i=0;i<=t;i++){let[a,o]=[n[0]+(r[0]-n[0])*i/t,n[1]+(r[1]-n[1])*i/t];Q(e,[a,v+f,o],[a,v+f+1.1,o],.04,qn)}}let l=_+t*a,u=e=>t<0?[l,l+e]:[l-e,l];for(let t=x+1.5;t<S-.5;t+=3){let[n,r]=u(.7);Z(e,[t-.3,v,n],[t+.3,v+o,r],Kn)}let[h,y]=u(1.1);Z(e,[x,v+19,h],[S,v+19.6,y],Kn);let[b,C]=u(.05);for(let t=x+4.6;t<g+c;t+=3)Z(e,[t-1.1,v+8,b],[t+1.1,v+12,C],Qn,-2),Z(e,[t-1.1,v+22,b],[t+1.1,v+26,C],$n,-2);let[w,T]=u(1.1);Z(e,[g+p+.6,v+f,w],[g+c-.4,v+f+1,T],Yn);for(let t=g+p+1;t<g+c-1.8;t+=2.3)Z(e,[t,v+f+1.4,b],[t+1.9,v+f+2.6,C],$n,-2);let[E,D]=u(.25);Z(e,[x,v+.05,E],[g+p,v+.15,D],Zn,-2);let O=_+6*t;Z(e,[g+37.4,v+f,O-.6],[g+38.6,v+f+1.2,O+.6],Yn),Z(e,[g+37.3,v+f+1.2,O-.7],[g+38.7,v+f+1.3,O+.7],Qn,-2);let k=_+3*t;Q(e,[g+36,v+o,k],[g+36,v+18,k],.25,Gn),Q(e,[g+36,v+18,k],[g+38,v+14,k],.2,Gn),Z(e,[g+37.6,v+13.4,k-.4],[g+38.4,v+14,k+.4],er,-2)}((e,t)=>{let[n,r]=t.post,[i,a]=[n[1],(n[2]+r[2])/2];Z(e,[n[0]+.15,i,n[2]+.15],[r[0]-.1,i+.12,r[2]-.15],In),Z(e,[n[0]+.2,i+.12,n[2]+.1],[r[0]-.05,i+.95,r[2]-.1],Pn);for(let t=0;t<6;t++){let a=i+.32+.08*t;Z(e,[n[0]+.17,a,n[2]+.45],[n[0]+.2,a+.03,r[2]-.45],In)}Z(e,[n[0]+.16,i+.15,n[2]+.3],[n[0]+.2,i+.19,r[2]-.3],Vn[0],-2),Z(e,[n[0],i+.95,n[2]],[r[0],r[1],r[2]],Fn),Z(e,[n[0]-.02,i+1.01,n[2]+.05],[n[0],i+1.04,r[2]-.05],Bn,-2);for(let t of[-1,1])for(let i=0;i<4;i++)for(let o=0;o<6;o++){let[s,c]=[n[0]+.14+.19*i,a+t*(.5+.15*o)],l=Un(i+4*t,o),[u,d]=l<.3?[Vn[Math.floor(13*l)%4],-2]:[Ln,-1];Z(e,[s,r[1],c-.055],[s+.13,r[1]+.035,c+.055],u,d)}let o=ce(t);Hn(e,o,.31,r[1],r[1]+.02,Rn),Hn(e,o,.25,r[1],r[1]+.035,In);let s=r[0]-.6;Z(e,[s,r[1],n[2]+.05],[r[0]-.05,i+2.4,r[2]-.05],Pn),Z(e,[s-.02,i+1.35,a-.65],[s,i+2.15,a+.65],zn,-2);for(let t=1;t<4;t++){let n=i+1.35+.2*t;Z(e,[s-.03,n,a-.6],[s-.02,n+.012,a+.6],Bn,-2);let r=a-.65+.325*t;Z(e,[s-.03,i+1.4,r],[s-.02,i+2.1,r+.012],Bn,-2)}for(let[t,n]of[[-1,Vn[1]],[1,Vn[2]]]){let[r,o]=[a+.8*t,a+1.35*t];Z(e,[s-.02,i+1.5,Math.min(r,o)],[s,i+2,Math.max(r,o)],n,-2)}for(let t=0;t<8;t++){let n=a-1.2+.33*t;Z(e,[s-.04,i+2.22,n-.05],[s,i+2.3,n+.05],Vn[t%2?1:0],-2)}Z(e,[s-.1,i+2.4,n[2]],[r[0]+.05,i+2.5,r[2]],Fn);for(let t of[-1,1])Q(e,[r[0]-.05,i+.5,a+.9*t],[r[0]+.5,i+.04,a+1.2*t],.06,In)})(e,n);let[O,k]=[g+39.6,v+f];Z(e,[O-.3,k,_-.3],[O+.3,k+.45,_+.3],Yn),Z(e,[O-.45,k+.45,_-.45],[O+.45,k+.6,_+.45],Xn),Z(e,[O-.6,k+.6,_-.5],[O-.45,k+2.2,_+.5],Xn);for(let t of[-1,1])Z(e,[O-.45,k+.6,_+.45*t-.07],[O+.4,k+.9,_+.45*t+.07],Xn);for(let t of[-1,1])Z(e,[x,v,_+3.2*t-.12],[x+.08,v+3.4,_+3.2*t+.12],Zn,-2);Z(e,[x,v+3.3,_-3.3],[x+.08,v+3.45,_+3.3],Zn,-2),Z(e,[x,v+19,_-a],[x+1.1,v+19.6,_+a],Kn);for(let t=x+1.5;t<S-.5;t+=3)Z(e,[t-.3,v+o-1.2,_-a],[t+.3,v+o,_+a],Kn),t+1.5<S-1&&Z(e,[t+1.1,v+o-.15,_-4],[t+1.9,v+o-.05,_+4],er,-2)})(o,e),o})(e.station))),yield,{land:r,sky:Tn(),heavens:Qt,glaze:Ct}}export{Pr as default};
@@ -0,0 +1,17 @@
1
+ import type { Vec3 } from '../mesh';
2
+ /** A spike, 1 long and 1 wide at its foot: a splinter at a break, or a bare branch. */
3
+ export declare const SPIKE: number[];
4
+ /** Ash, the grey a charred log goes where the fire has done with it. */
5
+ export declare const ASH: number[];
6
+ /** Two unit vectors square to the unit `f` and to each other. */
7
+ export declare const across: (f: Vec3) => [Vec3, Vec3];
8
+ /**
9
+ * A charred trunk from `a` to `b`: a ring at each [t, radius] of `rings` (t 0 at a, 1 at b), its
10
+ * points jittered in and out, capped at both ends. Seed s.
11
+ */
12
+ export declare const charred: (o: number[], a: Vec3, b: Vec3, rings: number[][], s: number, tone: number[]) => void;
13
+ /**
14
+ * The jagged end of a trunk broken at `at` along the unit `f`, `r` its radius there: three or four
15
+ * splinters round its rim, of all lengths, close to the trunk's line.
16
+ */
17
+ export declare const splinters: (o: number[], at: Vec3, f: Vec3, r: number, s: number, tone: number[]) => void;
@@ -0,0 +1,18 @@
1
+ import type { Vec3 } from '../mesh';
2
+ /** The broken trees in the clearing the nose made, on each side of it: x, z and seed. */
3
+ export declare const CLEARING: number[][];
4
+ /**
5
+ * How the tree of seed s whose foot is at (x, z), on ground y, was broken: `a` the bearing it was
6
+ * pushed to, forward and away from the centre line (c, d its cosine and sine), `tall` the stump's
7
+ * height, `r` its radius, `len` the fallen trunk's length, `lean` the stump's lean, `top` its break.
8
+ */
9
+ export declare const broken: (x: number, y: number, z: number, s: number) => {
10
+ a: number;
11
+ c: number;
12
+ d: number;
13
+ tall: number;
14
+ r: number;
15
+ len: number;
16
+ lean: number;
17
+ top: Vec3;
18
+ };
@@ -0,0 +1,6 @@
1
+ import type { WorldDef } from '../../shared/world';
2
+ /**
3
+ * The fires among the snags, as smoke.ts's FIRES (x, y, z, the smoke's height, its radius at the
4
+ * foot and at the top) and the flames' scale: about three in five of the clearing's stumps.
5
+ */
6
+ export declare const blazes: (def: WorldDef) => number[][];
@@ -19,6 +19,8 @@ export declare const cells: (v: ArrayLike<number>, end: number, limit?: number)
19
19
  /**
20
20
  * Puts in `out` the draws (first vertex, count) that cover the runs of `c` reaching into the
21
21
  * frustum of `m`, hidden runs of up to `gap` vertices between two seen ones drawn through. Returns
22
- * the number of draws.
22
+ * the number of draws. With `eye`, only the runs whose bounds come within `reach` metres of it
23
+ * (Landfall's undergrowth, Decor.grass; its near palms, Decor.groves), or with `beyond` only the
24
+ * others (its far palms), none past `limit`.
23
25
  */
24
- export declare const seen: (c: Cells, m: Float32Array, out: Int32Array, gap?: number) => number;
26
+ export declare const seen: (c: Cells, m: Float32Array, out: Int32Array, gap?: number, eye?: ArrayLike<number>, reach?: number, beyond?: boolean, limit?: number) => number;
@@ -0,0 +1,2 @@
1
+ /** A clump of blooms round (x, y, z), seed s: two to four, some 50 cm about, a hand or two over the ground. */
2
+ export declare const flowers: (o: number[], x: number, y: number, z: number, s: number) => void;
@@ -0,0 +1,12 @@
1
+ import { GROVE_TILE } from '../render/scene';
2
+ import type { Groves } from '../render/scene';
3
+ export { GROVE_TILE };
4
+ /** The palms whose foot is in one tile: its middle, and their vertices near and far. */
5
+ export type Grove = {
6
+ x: number;
7
+ z: number;
8
+ near: number[];
9
+ far: number[];
10
+ };
11
+ /** The groves packed as Decor.groves: their vertices one after the other, and a tile's ranges and bounds. */
12
+ export declare const packed: (groves: Iterable<Grove>) => Groves;
@@ -0,0 +1,16 @@
1
+ /** Leaves: the palms' fronds, the broadleaves' crowns, the undergrowth and the forest's mass. */
2
+ export declare const LEAF = -1.082;
3
+ /** Bark, and charred wood. */
4
+ export declare const BARK = -1.084;
5
+ /** Burnt earth: the forest's mass where it burnt down to the ground round the nose. */
6
+ export declare const EARTH = -1.0965;
7
+ /** The vertices `v` (the renderer's format, 10 floats each) put on the layer `l`, in place. */
8
+ export declare const onLayer: (v: number[], l: number) => number[];
9
+ /**
10
+ * The sun's shadow on foliage from one tap of the map, not four (the hardware filters 2 by 2):
11
+ * the fronds' own pattern hides the difference, and a leafy forest is many layers of them. GLSL
12
+ * spliced before the four taps, which it skips; `BEACH` only, as the layers are.
13
+ */
14
+ export declare const FOLIAGE_SHADOW = "\n#ifdef BEACH\nif((abs(L-(-1.082))<.0008||abs(L-(-1.084))<.0008)){v=4.*texture(D,vec4(q.xy,0,q.z-.0004));}else\n#endif\n";
15
+ /** What Landfall's chunk splices into the beach's program (Decor.forest): the burnt earth's pixel on its layer. */
16
+ export declare const FOREST_GLSL = "if(abs(L-(-1.0965))<.0008){float f=1.-smoothstep(.02,.08,pw),a=vn3(P*.9),b=vn3(P*4.+3.),d=vn3(P*12.+9.);\nc=mix(vec3(.025,.022,.02),vec3(.11,.105,.1),smoothstep(.3,.8,a+.3*(b-.5)))*(1.-.5*f*smoothstep(.55,.75,d));\nc+=vec3(1.6,.3,.03)*f*smoothstep(.82,.9,vn3(P*1.7+T*.05))*smoothstep(.6,.8,b);h+=f*(.04*b+.015*d);}";
@@ -0,0 +1,2 @@
1
+ /** The triangles of `v` (STRIDE floats a point), tile by tile. */
2
+ export declare const tiled: (v: number[]) => number[];
@@ -68,7 +68,13 @@ export declare const RAW: Mat;
68
68
  export declare const teeth: (a: V, b: V, d: V, n: number, m: Mat, k?: number, c?: number[], back?: Mat) => void;
69
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`. */
70
70
  export declare const prism: (a: V, b: V, cut: number, m: Mat, top?: Mat, grow?: number, k?: number[]) => void;
71
- /** Sand blown against the foot of a box that stands in the dry beach. */
71
+ /**
72
+ * Sand blown against the foot of a box that stands in the dry beach: a soft bank all round it,
73
+ * its height over the sand set by the distance to the box's footprint (so it rounds the corners)
74
+ * and falling to the sand with a smoothstep, level at both ends, so it shows no crease against
75
+ * the box nor where it meets the beach. Its height wanders round the box; its normals are the
76
+ * bank's own, smooth from one strip to the next.
77
+ */
72
78
  export declare const drift: ({ min: a, max: b }: Piece) => void;
73
79
  /** A model of mesh.ts set at `at`, its length (-z) along `f`, level: `k` its scale across, up and along. */
74
80
  export declare const stand: (src: number[], at: V, f: V, k?: V) => void;
@@ -0,0 +1,11 @@
1
+ import type { Ground } from './constants';
2
+ /** How high the forest's mass stands over the ground, d metres behind the line: a wall of leaves at once, then the crowns. */
3
+ export declare const rise: (d: number) => number;
4
+ /** How far behind the line the far canopy's rows of points are. */
5
+ export declare const ROWS: number[];
6
+ /**
7
+ * The mass of the forest behind the line, one lumpy sheet: it leaves the ground under the line,
8
+ * is the undergrowth's back (some 3 m) within a few metres, the crowns of the trees further in,
9
+ * and climbs inland. Lighter on its lumps than between them, so they read as crowns.
10
+ */
11
+ export declare const canopy: (o: number[], tufts: number[], gy: Ground) => void;
@@ -0,0 +1,31 @@
1
+ import type { Vec3 } from '../mesh';
2
+ export type Ground = (x: number, z: number) => number;
3
+ /**
4
+ * Where the forest that is only drawn begins: a line round the beach on its three dry sides, x =
5
+ * EDGE along the trees and BACK behind each headland's line of rocks, the corners rounded by
6
+ * TURN, from x = WEST on one headland to x = WEST on the other. Nothing of it is solid: the map's
7
+ * ghost wall is expected between the first row of palms and this line.
8
+ */
9
+ export declare const EDGE: number, BACK: number, TURN: number, WEST: number;
10
+ /** The line's straight run behind a headland, a corner's arc, and its whole length. */
11
+ export declare const RUN: number, ARC: number;
12
+ export declare const LEN: number;
13
+ /** The line steps this far back round the wreck's nose, which lies in the trees: a clearing at the end of its furrow. */
14
+ export declare const NOSE: number;
15
+ export declare const sm: (t: number) => number;
16
+ /**
17
+ * How burnt the forest is at (x, z), 0 to 1: a fan round the nose and ahead of it, where the ship
18
+ * ended, burnt out in its middle and ragged at its edge. None on the sand's side of the first
19
+ * trunks. `wide` is its reach: the heat browned the leaves further out than the fire felled the trees.
20
+ */
21
+ export declare const burn: (x: number, z: number, wide?: number) => number;
22
+ /** Scorched leaves, and charred wood. */
23
+ export declare const DRY: number[], CHAR: number[];
24
+ /** The fire's mark on what stands in it: leaves and bark go brown, then black, by `burn` at each vertex. */
25
+ export declare const singe: (o: number[]) => void;
26
+ /** The line at s metres along it: x, z and the way out of the beach. Its second half is the first one's mirror. */
27
+ export declare const edge: (s: number) => number[];
28
+ /** The point d metres behind the line at s (x, z), and how much forest there is there: none at the headland's seaward end. */
29
+ export declare const spot: (s: number, d: number) => Vec3;
30
+ /** A model's length (-z) stood up. */
31
+ export declare const UP: Vec3[];
@@ -0,0 +1,17 @@
1
+ import type { WorldDef } from '../../shared/world';
2
+ import type { Grove } from '../foliage/grove';
3
+ /**
4
+ * Landfall's forest and headlands by part, each its vertices in the renderer's format: the
5
+ * headlands' rocks, the first row's palms (TRUNKS and their twins), the trees behind, the
6
+ * undergrowth and the far canopy, and what the crash broke and burnt of them round the nose, past
7
+ * the first trunks. The lists and the relief are read here, at the call.
8
+ */
9
+ export declare const parts: (def: WorldDef) => {
10
+ rocks: number[];
11
+ groves: Map<string, Grove>;
12
+ brush: number[];
13
+ canopy: number[];
14
+ snags: number[];
15
+ };
16
+ /** Its vertices, in the renderer's format: the palms as drawn near. */
17
+ export declare const jungle: (def: WorldDef) => number[];
@@ -0,0 +1,29 @@
1
+ import type { Vec3 } from '../mesh';
2
+ /** smooth()'s vertices in colour `c`, on the bark's layer. */
3
+ export declare const bark: (v: number[], c: number[]) => number[];
4
+ /** A length of trunk, wider at its top than at its foot: stacked, the steps are a palm's rings. By sides. */
5
+ export declare const BOLE: number[][];
6
+ /** A coconut. */
7
+ export declare const BLOB: number[][];
8
+ export declare const BARK: number[];
9
+ export declare const HUSK: number[];
10
+ /** Fronds: young, grown, old. */
11
+ export declare const FROND: number[][];
12
+ /**
13
+ * A feather of leaflets from `at`: its rib leaves toward the bearing a at the elevation e and
14
+ * bends down over its length, n steps of it, a leaflet a side on each (a triangle, its tip out,
15
+ * forward and hanging), `wide` at the middle. Darker at the rib. Its normals lean up: lit from
16
+ * above on both faces.
17
+ */
18
+ export declare const frond: (o: number[], at: Vec3, a: number, e: number, len: number, wide: number, n: number, [r, g, b]: number[]) => void;
19
+ /**
20
+ * A coconut palm, its foot at (x, y, z), r there, seed s: a ringed trunk that leaves the ground
21
+ * upright (what a runner touches is where the map has it) and leans (lx, lz) by its top, a crown
22
+ * of fronds in three tiers, the lowest hanging. Level 2 is the first row's, with coconuts; 1 the
23
+ * rows behind; 0 the back of the forest. `detail` is how finely it is drawn, its shape staying
24
+ * that of `lod`: 0 the far palm (few fronds and leaflets, no coconut), drawn past GROVE_NEAR, in
25
+ * place of the same palm at its own level (render.ts).
26
+ */
27
+ export declare const palm: (o: number[], x: number, y: number, z: number, r: number, s: number, lod: number, lx: number, lz: number, detail?: number, size?: number) => void;
28
+ /** A rosette of feathers on the ground: a fern (`big` 0), or the broad leaves of a banana plant. */
29
+ export declare const fern: (o: number[], x: number, y: number, z: number, s: number, big: number, n?: number, steps?: number) => void;
@@ -0,0 +1,21 @@
1
+ import type { Ground } from './constants';
2
+ /**
3
+ * A block of shared/beach.ts's kind (x, z, radius, height, seed, and how far over the ground it is
4
+ * set: one stacked on another), blockOf()'s form: granite (granite.ts GRANITE), darker where the sea
5
+ * wets it.
6
+ */
7
+ export declare const rock: (o: number[], gy: Ground, [x, z, R, H, s, lift]: number[], lod: number) => void;
8
+ /** Each triangle's normals turned a quarter of the way to its face's: a block of granite shows a little of its facets, not a smooth mass. */
9
+ export declare const facet: (o: number[], from: number) => void;
10
+ /**
11
+ * Red's headland: the rocks of ROCKS, then what is only drawn, all past the headland's wall: low
12
+ * blocks scattered on the sand that runs on; the mass on the trees' side, tors of two or three
13
+ * blocks stacked, rising inland; stacks standing in the sea off the strand; and a reef running out
14
+ * past x = FRAME.sea, lower and lower. Between them the sand and the sea go on. `k` is 0 for red
15
+ * and 1 for blue, whose jumble is its own. The rocks of ROCKS stand on `red`, red's ground, for
16
+ * both: the map's boxes for blue's are the twins of red's, and the lattice's triangles are not
17
+ * mirrored.
18
+ */
19
+ export declare const cape: (gy: Ground, k: number, red: Ground) => number[];
20
+ /** Blue's half from red's: z becomes ZED - z, the normals follow, the triangles keep their front. */
21
+ export declare const mirror: (v: number[]) => number[];
@@ -0,0 +1,10 @@
1
+ import type { Ground } from './constants';
2
+ /**
3
+ * What the crash left of a tree whose foot is at (x, z), seed s: a charred stump snapped off low
4
+ * or a trunk broken higher up, its roots flared, leaning the way the ship pushed it, forward and
5
+ * away from the centre line, splinters at the break. Most have their top on the ground on that
6
+ * side, still hinged to a low stump or lying by a high one, splintered at both breaks, a stub of a
7
+ * branch on it. A tall one keeps the bare black branches of a broadleaf, or a palm's dead fronds
8
+ * hanging. Black, some greyed with ash.
9
+ */
10
+ export declare const snag: (o: number[], gy: Ground, x: number, z: number, s: number) => void;
@@ -1,17 +1 @@
1
- import type { WorldDef } from '../shared/world';
2
- /**
3
- * Landfall's forest and headlands by part, each its vertices in the renderer's format: the
4
- * headlands' rocks, the first row's palms (TRUNKS and their twins), the trees behind, the
5
- * undergrowth and the far canopy, and what the crash broke and burnt of them round the nose, past
6
- * the first trunks. The lists and the relief are read here, at the call.
7
- */
8
- export declare const parts: (def: WorldDef) => {
9
- rocks: number[];
10
- palms: number[];
11
- forest: number[];
12
- brush: number[];
13
- canopy: number[];
14
- snags: number[];
15
- };
16
- /** Its vertices, in the renderer's format. */
17
- export declare const jungle: (def: WorldDef) => number[];
1
+ export * from './jungle/index';
@@ -29,6 +29,26 @@ export declare const city: (world: World) => World;
29
29
  * once, and on the moon the Earth (`sky`, the ground's last vertices) and where it stands.
30
30
  */
31
31
  /** A map's own scenery: its land, its sky, the Earth's place, glass drawn blended after the rest (Landfall's canopy), and its rocks' GLSL. */
32
+ /** Metres a tile of Decor.grass spans: the runs it is culled by. */
33
+ export declare const GRASS_TILE = 16;
34
+ /** Metres from the eye within which a tile of Decor.grass is drawn. */
35
+ export declare const GRASS_REACH = 20;
36
+ /** Metres a tile of Decor.groves spans, by its palms' feet. */
37
+ export declare const GROVE_TILE = 16;
38
+ /** Metres from the eye within which a grove's palms are drawn finely (and cast shadows); cheaply past it. */
39
+ export declare const GROVE_NEAR = 20;
40
+ /** Metres past which no palm is drawn: the far end of the beach, the hills behind standing for the forest there. */
41
+ export declare const GROVE_FAR = 100;
42
+ /**
43
+ * Palms drawn twice, near and far (foliage/grove.ts): each version's vertices tile by tile, and
44
+ * per tile ten numbers: its near range (first, count, in vertices from the version's start), its
45
+ * far range, its bounds (min then max).
46
+ */
47
+ export type Groves = {
48
+ near: number[];
49
+ far: number[];
50
+ tiles: number[];
51
+ };
32
52
  export type Decor = {
33
53
  land: number[];
34
54
  sky: number[];
@@ -40,6 +60,17 @@ export type Decor = {
40
60
  glaze?: string;
41
61
  /** How the map's rovers look, if not as the moon's: Landfall's buggy, which its chunk brings. */
42
62
  car?: Look;
63
+ /**
64
+ * Fine detail drawn only near the eye and casting no shadow (Landfall's ferns, fronds and
65
+ * flowers), its triangles in tiles of GRASS_TILE metres so that a run of them is a tile.
66
+ */
67
+ grass?: number[];
68
+ /** Palms drawn finely near the eye and cheaply far from it (foliage/grove.ts). */
69
+ groves?: Groves;
70
+ /** GLSL for the forest's own layers under BEACH, spliced in by fragOf(): Landfall's burnt earth, which its chunk brings. */
71
+ forest?: string;
72
+ /** Fires drawn only, with the map's (smoke.ts plumes()): Landfall's among its burnt trees, which its chunk brings. */
73
+ blazes?: number[][];
43
74
  };
44
75
  /** The scenery of a map that has none of its own: the city's is drawn here. */
45
76
  export declare const BARE: Decor;
@@ -66,12 +66,13 @@ export declare const mirrors: (brushes?: readonly Brush[]) => boolean;
66
66
  * code still costs every pixel through the shader's registers: the moon 2.4 ms of GPU a frame on
67
67
  * Highline, the ninja's 1.9 ms on three astronauts at 3 m on the moon. `rock` is the GLSL of the
68
68
  * map's rocks under BEACH (Decor.rock: Landfall's granite, from its chunk), `glaze` that of its indoor
69
- * windows under MOON (Decor.glaze: Tranquility's traced reflections, from its chunk). `sight` adds the
69
+ * windows under MOON (Decor.glaze: Tranquility's traced reflections, from its chunk), `forest` that of
70
+ * the forest's own layers under BEACH (Decor.forest: Landfall's burnt earth, from its chunk). `sight` adds the
70
71
  * vision's filter and its glowing prey (VISION), for a frame in a xenomorph's or the Hunter's
71
72
  * vision: its loop and palettes were 4.6 ms a frame on Highline with none ever drawn, 1.4 on
72
73
  * Tranquility and none on Landfall, through the registers they take from every pixel.
73
74
  */
74
- export declare const fragOf: (def: Pick<WorldDef, "scenery" | "seam" | "relief" | "helmets"> & Partial<Pick<WorldDef, "brushes">>, kind?: string, rock?: string, sight?: boolean, glaze?: string) => string;
75
+ export declare const fragOf: (def: Pick<WorldDef, "scenery" | "seam" | "relief" | "helmets"> & Partial<Pick<WorldDef, "brushes">>, kind?: string, rock?: string, sight?: boolean, glaze?: string, forest?: string) => string;
75
76
  /** A map whose ground takes footprints (createPrints): Landfall's sand, the moon's regolith. */
76
77
  export declare const printed: (def: Pick<WorldDef, "scenery" | "relief">) => boolean;
77
78
  /** A map with the moon's sky: its globe, stars and craters. Not the beach, whose sand is a relief too. */
@@ -12,9 +12,9 @@ export declare const BANDS: number, SLICES: number;
12
12
  /**
13
13
  * The smoke's and the fires' vertices, in the renderer's format: drawn after the sky, blended
14
14
  * (render.ts). A column's balls grow as they rise and lean inland, each overlapping the last;
15
- * three flames stand round its foot.
15
+ * three flames stand round its foot. `blazes` are fires drawn only (Decor.blazes), after the map's.
16
16
  */
17
- export declare const plumes: (def: WorldDef) => number[];
17
+ export declare const plumes: (def: WorldDef, blazes?: number[][]) => number[];
18
18
  /**
19
19
  * The smoke's and the flames' pixel, in main(), given `fog` as the sea's: the share of haze over
20
20
  * it, an expression of `ds`. Blended with its colour times its alpha: a flame has none and only
@@ -26,6 +26,8 @@ export interface Draw {
26
26
  sw: Vec3;
27
27
  t: number;
28
28
  };
29
+ /** How far the rail gun's bolt has burnt it away, 0 to 1 (fried()): the shader does dissolve(). */
30
+ z?: number;
29
31
  }
30
32
  /**
31
33
  * A runner's skin (`kind` 1) or armour (2) posed by the vertex shader from `data` (flesh.ts): the
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@korial29/tiny-fps",
3
3
  "description": "Tiny multiplayer first-person rooftop game for the browser: raw WebGL, zero runtime dependencies, WebSocket or same-browser multi-tab play.",
4
4
  "license": "Apache-2.0",
5
- "version": "1.20.3",
5
+ "version": "1.21.1",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist"