From c5d2042b70e49b6b4298c199ae85825e90bf5d09 Mon Sep 17 00:00:00 2001 From: stasm Date: Fri, 8 Mar 2024 18:53:41 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20piesku/h?= =?UTF-8?q?ighnoon@1424753e1d9f0711287df65e09eb3c7e1a562cae=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game.esbuild.js | 13 +++++++------ game.roadroller.js | 2 +- game.sed.js | 13 +++++++------ game.terser.js | 2 +- index.html | 2 +- 5 files changed, 17 insertions(+), 15 deletions(-) diff --git a/game.esbuild.js b/game.esbuild.js index c6ab567a..5bdfffcb 100644 --- a/game.esbuild.js +++ b/game.esbuild.js @@ -2358,20 +2358,21 @@ function sys_mimic(game2, delta) { for (let ent = 0; ent < game2.World.Signature.length; ent++) { if ((game2.World.Signature[ent] & QUERY15) === QUERY15) { - update12(game2, ent); + update12(game2, ent, delta); } } } var target_position = [0, 0, 0]; var target_rotation = [0, 0, 0, 1]; - function update12(game2, entity) { + function update12(game2, entity, delta) { let transform2 = game2.World.Transform[entity]; let mimic2 = game2.World.Mimic[entity]; let target_transform = game2.World.Transform[mimic2.Target]; mat4_get_translation(target_position, target_transform.World); mat4_get_rotation(target_rotation, target_transform.World); - vec3_lerp(transform2.Translation, transform2.Translation, target_position, mimic2.Stiffness); - quat_slerp(transform2.Rotation, transform2.Rotation, target_rotation, mimic2.Stiffness); + let t = 1 - Math.exp(-delta / mimic2.Stiffness); + vec3_lerp(transform2.Translation, transform2.Translation, target_position, t); + quat_slerp(transform2.Rotation, transform2.Rotation, target_rotation, t); game2.World.Signature[entity] |= 256 /* Dirty */; } @@ -3422,7 +3423,7 @@ }; // ../src/components/com_mimic.ts - function mimic(target, stiffness = 0.1) { + function mimic(target, stiffness = 1) { return (game2, entity) => { game2.World.Signature[entity] |= 8192 /* Mimic */; game2.World.Mimic[entity] = { @@ -3452,7 +3453,7 @@ function blueprint_camera_follow(game2) { return [ transform(), - mimic(first_named(game2.World, "camera anchor")), + mimic(first_named(game2.World, "camera anchor"), 0.2), children([ transform( [50, 50, 50], diff --git a/game.roadroller.js b/game.roadroller.js index 5b053e31..b133e492 100644 --- a/game.roadroller.js +++ b/game.roadroller.js @@ -1 +1 @@ -M='E|xCWnlGYEit^XwYwBz?LQOd@wiD]A||ybZDWhkLN?sbkEiYR@hgHuPZQueDh}KFpZVoQhSa]ccyR}bVEnuX`dmk[uGUnSlRZnj{lBYoCcXEtlirvxbcLjPx_CHaLBuNyA{yFGOIJ_yJuVyOr|zf_kyCFfFKQR~t`IFzjdC`k`vaQL[uM^LyItYGwUCT`V?[CP|_Ph[ampnOy}t_VhkV^~b`kleJolg^RxERL`uhyvRKfOS@y?|PtqdgmyZ[Krx}a?Pk_JruF`g?U]^Zy@A@{LkHmHirMcpi_l|wbZLd^zG@E^IjYrGS}vopZaD]TPtw[BBjZNpi_liPLGMrFs^u~aFCOAAETXuXZ|LfqxHPvncS^zrRdF?^Mrm|]sKtwx|H|NQ}ZRajza`OGOm?}oZHHBvgvYlGYNVd_Fm~`]{K?xNtsGeqags?m`~yY{WvysEQTGuQNm_QAMTyNqki}_GJmP?]tnA?bk|{WL[yW|OQcIzAEo`]xRhCn{za`{vlDvLR[n~ihHkV[^yymVJQyn|XcV}vuPLB]N~cBdSRfwUcfUGPn{YXM[MKb_WaJbjQCJKIQpEwCbxTBoNoq_q|OEV?SoftCIhKTQu[MkZhtivRmLpDF|rcWj?A?mUh_tzAnG~@nvT}]exTffqyWYkDgHArObwSqlXKAoxvHLM]jLz[z~tYmmHyrZcMaZ}@F{W~}|JJu@VryMn@PdoPkgu}uIIUxyb}MExQ?GqWpJIzXBxXn[`OKRC`DBLNJIXgFPRITuxu_Y^cwGVeyWB_fpPUao?oDESBmFcLT{SLuOhagCVZgqKpXydmS?YmQAIukYnoX[IvWyKmt]vTJzBH}oogGC[Wh`SHwn`fT~sHiWNarG{s^QPk}hA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H@WhvyNZeanlo[HUZaRnvBcp|DB~l[^^EtLpUwuo?FVoFfreHxJEN`[mjQrmCphASefHQl?b?]AA^KGpywYkfGFCXs';c=1<<15;h=[0,0,0,0,0,0,0,0,0,0,0,0];a=new Uint16Array(51e6).fill(1<<13);r=new Uint8Array(51e6);for(n=[x=y=t=0];t<35680;n[t++]=i-128)for(i=1;i<128;A=p.map((e,U)=>(o=a[e]*2+1,o=Math.log(o/(c-o)),C-=h[U]*o,o/1000)),C=~-c/(1+Math.exp(C))|1,d=x%c>15)-!d*C,p.map((e,U)=>(o=a[e]+=(d*c/2-a[e]<<15)/((r[e]+=r[e]<4)+1/20)>>15,h[U]+=A[U]*(d-C/c))),i=i*2+d)for(p='010202103203210431053105410642087642098321'.split(C=0).map((e,U)=>(o=0,[...e].map((e,U)=>(o=o*997+(n[t-e]|0)|0)),c*128-1&o*997+i)*12+U);x(o=a[e]*2+1,o=Math.log(o/(c-o)),C-=h[U]*o,o/1000)),C=~-c/(1+Math.exp(C))|1,d=x%c>15)-!d*C,p.map((e,U)=>(o=a[e]+=(d*c/2-a[e]<<15)/((r[e]+=r[e]<4)+1/20)>>15,h[U]+=A[U]*(d-C/c))),i=i*2+d)for(p='010202103203210431053106520654109753098651'.split(C=0).map((e,U)=>(o=0,[...e].map((e,U)=>(o=o*997+(n[t-e]|0)|0)),c*128-1&o*997+i)*12+U);x { game2.World.Signature[entity] |= 8192 /* Mimic */; game2.World.Mimic[entity] = { @@ -3452,7 +3453,7 @@ throw `No entity named ${name}.`; function blueprint_camera_follow(game2) { return [ transform(), -mimic(first_named(game2.World, "camera anchor")), +mimic(first_named(game2.World, "camera anchor"), 0.2), children([ transform( [50, 50, 50], diff --git a/game.terser.js b/game.terser.js index 729aa47f..ece9b81a 100644 --- a/game.terser.js +++ b/game.terser.js @@ -1,4 +1,4 @@ -"use strict";(()=>{function t(t,n){t.t[n]=0,t.i.push(n)}function n(t,n){let e=(i=t.o).i.length>0?i.i.pop():i.t.push(0)-1;var i;for(let i of n)i(t,e);return e}function e(...t){return(e,i)=>{16&e.o.t[i]||(e.o.t[i]|=16,e.o.l[i]={l:[]});let o=e.o.l[i].l;for(let i of t){let t=n(e,i);o.push(t)}}}function*i(t,n,e){if((t.t[n]&e)===e&&(yield n),16&t.t[n])for(let o of t.l[n].l)yield*i(t,o,e)}function o(n,e){if(16&n.t[e])for(let t of n.l[e].l)o(n,t);0===n.t[e]||t(n,e)}function r(t,n,e){switch(n){case 0:document.fullscreenElement?document.exitFullscreen():document.body.requestFullscreen();break;case 1:{let[n]=e;o(t.o,n),t.u++;break}case 2:t.h++}}function l(t,n,e){let i=t.createProgram();return t.attachShader(i,a(t,hn,n)),t.attachShader(i,a(t,fn,e)),t.linkProgram(i),i}function a(t,n,e){let i=t.createShader(n);return t.shaderSource(i,e),t.compileShader(i),i}function c(t,n,e){return Math.max(t,Math.min(n,e))}function s(t,n,e,i){return t[0]=n,t[1]=e,t[2]=i,t}function u(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t}function f(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t}function h(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t}function d(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t}function v(t,n){let e=n[0],i=n[1],o=n[2],r=e*e+i*i+o*o;return r>0&&(r=1/Math.sqrt(r)),t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t}function m(t,n,e){let i=n[0],o=n[1],r=n[2],l=e[3]*i+e[7]*o+e[11]*r+e[15]||1;return t[0]=(e[0]*i+e[4]*o+e[8]*r+e[12])/l,t[1]=(e[1]*i+e[5]*o+e[9]*r+e[13])/l,t[2]=(e[2]*i+e[6]*o+e[10]*r+e[14])/l,t}function _(t,n,e){let i=n[0],o=n[1],r=n[2];return t[0]=e[0]*i+e[4]*o+e[8]*r,t[1]=e[1]*i+e[5]*o+e[9]*r,t[2]=e[2]*i+e[6]*o+e[10]*r,t}function M(t,n,e,i){let o=n[0],r=n[1],l=n[2];return t[0]=o+i*(e[0]-o),t[1]=r+i*(e[1]-r),t[2]=l+i*(e[2]-l),t}function g(t,n,e,i,o){return t[0]=n,t[1]=e,t[2]=i,t[3]=o,t}function p(t,n,e){let i=n[0],o=n[1],r=n[2],l=n[3],a=e[0],c=e[1],s=e[2],u=e[3];return t[0]=i*u+l*a+o*s-r*c,t[1]=o*u+l*c+r*a-i*s,t[2]=r*u+l*s+i*c-o*a,t[3]=l*u-i*a-o*c-r*s,t}function w(t,n,e,i){let o=Math.sin(n/2*Yn),r=Math.cos(n/2*Yn),l=Math.sin(e/2*Yn),a=Math.cos(e/2*Yn),c=Math.sin(i/2*Yn),s=Math.cos(i/2*Yn);return t[0]=o*a*s+r*l*c,t[1]=r*l*s-o*a*c,t[2]=r*a*c-o*l*s,t[3]=r*a*s+o*l*c,t}function y(t){return Math.asin(-c(-1,1,2*(t[1]*t[2]-t[3]*t[0])))*jn}function b(t,n,e){let i=e/2;return t[0]=Math.sin(i)*n[0],t[1]=Math.sin(i)*n[1],t[2]=Math.sin(i)*n[2],t[3]=Math.cos(i),t}function C(t,n,e,i){let o,r,l,a,c,s=n[0],u=n[1],f=n[2],h=n[3],d=e[0],v=e[1],m=e[2],_=e[3];return r=s*d+u*v+f*m+h*_,r<0&&(r=-r,d=-d,v=-v,m=-m,_=-_),1-r>Xn?(o=Math.acos(r),l=Math.sin(o),a=Math.sin((1-i)*o)/l,c=Math.sin(i*o)/l):(a=1-i,c=i),t[0]=a*s+c*d,t[1]=a*u+c*v,t[2]=a*f+c*m,t[3]=a*h+c*_,t}function A(t,n,e){let i=t.o.v[n],o=t.o.m[n];if(o._){let t=o.M[o._];t&&t!==o.g&&(0===o.g.p?o.g=t:1&o.g.C&&(o.g.p=0,o.g=t)),o._=void 0}let r=null,l=null;for(let t of o.g.A){if(o.g.p0?(_=2*Math.sqrt(m+1),t[3]=.25*_,t[0]=(f-d)/_,t[1]=(h-c)/_,t[2]=(a-s)/_):l>u&&l>v?(_=2*Math.sqrt(1+l-u-v),t[3]=(f-d)/_,t[0]=.25*_,t[1]=(a+s)/_,t[2]=(h+c)/_):u>v?(_=2*Math.sqrt(1+u-l-v),t[3]=(h-c)/_,t[0]=(a+s)/_,t[1]=.25*_,t[2]=(f+d)/_):(_=2*Math.sqrt(1+v-l-u),t[3]=(a-s)/_,t[0]=(h+c)/_,t[1]=(f+d)/_,t[2]=.25*_),t}function P(t,n){let e=t[12]-n[0],i=t[13]-n[1],o=t[14]-n[2];return e*e+i*i+o*o}function $(t,n){let e=t.o.v[n];var i,o;F(Un,e.o),D(Jn,e.o),(i=Qn)[0]=(o=e.o)[4],i[1]=o[5],i[2]=o[6],v(i,i);let r=t.Audio.listener;r.positionX?(r.positionX.value=Un[0],r.positionY.value=Un[1],r.positionZ.value=Un[2],r.forwardX.value=Jn[0],r.forwardY.value=Jn[1],r.forwardZ.value=Jn[2],r.upX.value=Qn[0],r.upY.value=Qn[1],r.upZ.value=Qn[2]):(r.setPosition(...Un),r.setOrientation(...Jn,...Qn))}function R(t=0,n=1){return((Zn=16807*Zn%2147483647)-1)/2147483646*(n-t)+t}function I(t,n,e,i,o){let r=t.currentTime+o,l=0;n&&n.connect(t.destination);let a,c,s=t.createGain();if(s.gain.value=(e[0]/9)**3,e[5]&&(c=t.createOscillator(),c.type=e[5],c.frequency.value=(e[7]/3)**3,a=t.createGain(),a.gain.value=(e[6]+3)**3,c.connect(a)),e[1]){let i=t.createBiquadFilter();i.type=e[1],i.frequency.value=2**e[2],i.Q.value=e[3]**1.5,a&&e[4]&&a.connect(i.detune),s.connect(i),i.connect(n||t.destination)}else s.connect(n||t.destination);for(let n of e[8]){let e=t.createGain();e.connect(s);let o=(n[1]/9)**3,c=(n[2]/9)**3,u=(n[3]/9)**3,f=c+u+(n[4]/6)**3;if(e.gain.setValueAtTime(0,r),e.gain.linearRampToValueAtTime(o,r+c),e.gain.setValueAtTime(o,r+c+u),e.gain.exponentialRampToValueAtTime(1e-5,r+f),n[0]){let o=t.createOscillator();o.type=n[0],o.connect(e),o.detune.value=3*(n[5]-7.5)**3,a&&n[6]&&a.connect(o.detune);let l=440*2**((i-69)/12);if(n[7]){let t=(n[8]/9)**3,e=(n[9]/9)**3,i=(n[10]/6)**3;o.frequency.linearRampToValueAtTime(0,r),o.frequency.linearRampToValueAtTime(l,r+t),o.frequency.setValueAtTime(l,r+t+e),o.frequency.exponentialRampToValueAtTime(1e-5,r+t+e+i)}else o.frequency.setValueAtTime(l,r);o.start(r),o.stop(r+f)}else{let n=t.createBufferSource();n.buffer=L(t),n.loop=!0,n.connect(e),n.start(r),n.stop(r+f)}f>l&&(l=f)}c&&(c.start(r),c.stop(r+l))}function L(t){if(!qt){let n=(qt=t.createBuffer(1,2*t.sampleRate,t.sampleRate)).getChannelData(0);for(let t=0;ti.g.R?i.g=void 0:i.I&&G(i.I,o)),i._&&!i.g){switch(i._.L){case 0:!function(t,n,e){let i=t.createBufferSource();i.buffer=e.G,n?(i.connect(n),n.connect(t.destination)):i.connect(t.destination),i.start()}(t.Audio,i.I,i._);break;case 1:!function(t,n,e){let i=60/(e.O||120)/4;for(let o of e.K)for(let e=0;e{i.o.t[o]|=8,i.o.W[o]={L:0,X:t,o:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],Y:0,j:0,H:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],q:[0,0,0],U:n,J:t.Z,tt:n,nt:e}}}function K(t,n,e){let i=t.o.v[n];T(e.H,e.X.X,i.et),F(e.q,i.o)}function N(t,n){let e,i,o,r,l,a;F(n.it,t),e=r=n.it[0],i=l=n.it[1],o=a=n.it[2];let c=[0,0,0];for(let s=0;s<8;s++){let u=oe[s];c[0]=u[0]*n.ot[0],c[1]=u[1]*n.ot[1],c[2]=u[2]*n.ot[2],m(c,c,t),c[0]r&&(r=c[0]),c[1]l&&(l=c[1]),c[2]a&&(a=c[2])}n.rt=[e,i,o],n.lt=[r,l,a],n.ct[0]=(r-e)/2,n.ct[1]=(l-i)/2,n.ct[2]=(a-o)/2}function B(t,n){let e=t.it[0]-n.it[0],i=t.ct[0]+n.ct[0]-Math.abs(e),o=t.it[1]-n.it[1],r=t.ct[1]+n.ct[1]-Math.abs(o),l=t.it[2]-n.it[2],a=t.ct[2]+n.ct[2]-Math.abs(l);return io.rt[0]&&i.rt[1]o.rt[1]&&i.rt[2]o.rt[2]){let n=B(t,e);l&&t.ft.push({ht:e.dt,vt:n}),a&&e.ft.push({ht:t.dt,vt:d([0,0,0],n)})}}var i,o}function W(t,n){let e=t.o._t[n],o=t.o.Mt[n];if(e.gt&&f(o.gt,o.gt,e.gt),e.F&&p(o.wt,o.wt,e.F),e.Animation)for(let o of i(t.o,n,1))t.o.m[o]._=e.Animation}function X(t,n){let e=t.o.yt[n];if(t.o.bt[n].Mt&&t.Ct.Space&&e.At){e.kt[1]=300;for(let e of i(t.o,n,1))t.o.m[e]._="jump"}}function Y(t,n){let e=t.o.bt[n];if(e.Mt){let e=t.o.Mt[n];t.Ct.KeyW&&(e.gt[2]+=1),t.Ct.KeyA&&(e.gt[0]+=1),t.Ct.KeyS&&(e.gt[2]-=1),t.Ct.KeyD&&(e.gt[0]-=1)}if(e.Tt){let e=t.o.Mt[n];t.Ct.ArrowLeft&&p(e.wt,e.wt,[0,1,0,0]),t.Ct.ArrowRight&&p(e.wt,e.wt,[0,-1,0,0])}if(e.xt){let i=t.o.Mt[n],o=y(t.o.v[n].F);t.Ct.ArrowUp&&o>e.Et&&p(i.Dt,i.Dt,[-1,0,0,0]),t.Ct.ArrowDown&&ove&&(o.gt[0]+=c(-1,1,-e)),Math.abs(i)>ve&&(o.gt[2]+=c(-1,1,-i))}if(i.Tt&&t.St.Touch1X&&(b(Me,he,-t.St.Touch1X*i.Tt*me*Yn),p(e.F,Me,e.F),t.o.t[n]|=256),i.xt&&t.St.Touch1Y){let o=y(e.F),r=c(i.Et-o,i.Ft-o,t.St.Touch1Y*i.xt*me);b(Me,de,r*Yn),p(e.F,e.F,Me),t.o.t[n]|=256}}function q(t,n){let e=t.o.bt[n];if(e.Mt){let e=t.o.Mt[n];Math.abs(t.St.pad0_axis_1)>we&&(e.gt[0]-=t.St.pad0_axis_1),Math.abs(t.St.pad0_axis_2)>we&&(e.gt[2]-=t.St.pad0_axis_2)}if(e.Tt&&Math.abs(t.St.pad0_axis_3)>we){let e=t.o.Mt[n];p(e.wt,e.wt,b([0,0,0,1],ge,-t.St.pad0_axis_3*Math.PI))}if(e.xt&&Math.abs(t.St.pad0_axis_4)>we){let i=t.o.Mt[n],o=t.St.pad0_axis_4*Math.PI,r=y(t.o.v[n].F);(o<0&&r>e.Et||o>0&&r{a.o.t[c]|=65536,a.o.Pt[c]={L:1,$t:t,Rt:n,It:e[3]<1?1:0,Lt:l,zt:e,Gt:[...r,i],Ot:[e[0],e[1],e[2],o]}}}function J(t=[0,0,0],n=[0,0,0,1],e=[1,1,1],i=!1){return(o,r)=>{o.o.t[r]|=4194560,o.o.v[r]={o:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],et:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],D:t,F:n,S:e,Kt:i}}}function Q(t,n,e){return(i,o)=>{let r=i.o.v[o];r.D[0]=t,r.D[1]=n,r.D[2]=e}}function Z(t,n,e){return(i,o)=>{let r=i.o.v[o];r.S[0]=t,r.S[1]=n,r.S[2]=e}}function tt(t,n){t.Nt.textAlign="center",t.Nt.font=n.Bt,t.Nt.fillStyle=n.Vt,t.Nt.fillText(n.Text,0,0)}function nt(t,n){t.Nt.strokeStyle=n.Wt,t.Nt.strokeRect(-n.ot/2,-n.ot/2,n.ot,n.ot)}function et(t,n,e){let i=t.o.Xt[n];i.Yt-=e,i.Yt<0&&(i.jt&&r(t,i.jt,n),o(t.o,n))}function it(t,n,e){let i=t.o.Ht[n],o=t.o.v[n];2===i.L?D(ke,o.o):F(ke,o.o),t.qt[4*e+0]=ke[0],t.qt[4*e+1]=ke[1],t.qt[4*e+2]=ke[2],t.qt[4*e+3]=i.L,t.Ut[4*e+0]=i.Wt[0],t.Ut[4*e+1]=i.Wt[1],t.Ut[4*e+2]=i.Wt[2],t.Ut[4*e+3]=i.Jt}function ot(t,n){let e=t.o.v[n],i=t.o.Qt[n],o=t.o.v[i.Zt];F(xe,o.o),S(Ee,o.o),M(e.D,e.D,xe,i.tn),C(e.F,e.F,Ee,i.tn),t.o.t[n]|=256}function rt(t,n,e){let i=t.o.v[n],o=t.o.Mt[n];if(0!==o.gt[0]||0!==o.gt[1]||0!==o.gt[2]){let l=Math.min(1,Math.hypot((r=o.gt)[0],r[1],r[2]));_(o.gt,o.gt,i.o),void 0!==i.nn&&_(o.gt,o.gt,t.o.v[i.nn].et),v(o.gt,o.gt),h(o.gt,o.gt,l*o.en*e),f(i.D,i.D,o.gt),t.o.t[n]|=256,s(o.gt,0,0,0)}var r;o.wt[3]<1&&(p(o.wt,o.wt,i.F),C(i.F,i.F,o.wt,Math.min(1,o.on/Math.PI*e)),t.o.t[n]|=256,g(o.wt,0,0,0,1)),o.Dt[3]<1&&(p(o.Dt,i.F,o.Dt),C(i.F,i.F,o.Dt,Math.min(1,o.on/Math.PI*e)),t.o.t[n]|=256,g(o.Dt,0,0,0,1))}function lt(t,n,e){let i=t.o.rn[n],o=t.o.v[n];i.ln+=e,i.ln>i.an&&(i.ln=0,F(Se,o.o),D(Pe,o.o),i.cn.push(...Se,0),i.cn.push(...Pe,Math.random()));for(let t=0;ti.Xt?i.cn.splice(t,ye):t+=ye}function at(t,n=.5){return(e,i)=>{e.o.t[i]|=131072,e.o.yt[i]={L:t,sn:i,un:n,kt:[0,0,0],fn:[0,0,0],hn:[0,0,0],dn:[0,0,0],At:!1}}}function ct(t,n,e){let i=t.o.v[n],o=t.o.yt[n];1===o.L&&(o.fn[1]+=Re*e,h(o.kt,o.kt,e),f(o.fn,o.fn,o.kt),h(Ie,o.fn,e),f(i.D,i.D,Ie),t.o.t[n]|=256,s(o.kt,0,0,0))}function st(t,n,e){let i=t.o.yt[n];var o,r,l;F(ze,t.o.v[n].o),2===i.L&&((o=Ge)[0]=(r=ze)[0]-(l=i.dn)[0],o[1]=r[1]-l[1],o[2]=r[2]-l[2],h(i.fn,Ge,1/e)),u(i.dn,ze)}function ut(t,n){let e=t.o.v[n],i=t.o.yt[n],o=t.o.vn[i.sn];if(1===i.L){i.At=!1,s(Ne,0,0,0);for(let n=0;n0&&(i.At=!0)}}Ne[0]||Ne[1]||Ne[2]?(Math.abs(Ne[0])<.1&&(Ne[0]=0),Math.abs(Ne[2])<.1&&(Ne[2]=0),f(e.D,e.D,Ne),t.o.t[n]|=256):u(i.hn,i.fn)}var r,l}function ft(t,n,e){t[0]=n[0]>=0&&e[0]>=0?Math.max(n[0],e[0]):n[0]<=0&&e[0]<=0?Math.min(n[0],e[0]):n[0],n[1]>=0&&e[1]>=0?t[1]=Math.max(n[1],e[1]):n[1]<=0&&e[1]<=0?t[1]=Math.min(n[1],e[1]):n[1]>e[1]&&(t[1]=n[1]),t[2]=n[2]>=0&&e[2]>=0?Math.max(n[2],e[2]):n[0]<=0&&e[0]<=0?Math.min(n[2],e[2]):n[2]}function ht(t,n){if(16&t.t[n]){let e=t.l[n];for(let n of e.l)if(1048576&t.t[n])return!0}return!1}function dt(t,n,e,i){return t.bindTexture(pn,n),t.texImage2D(pn,0,En,e,i,0,un,cn,null),t.texParameteri(pn,_n,dn),t.texParameteri(pn,mn,dn),n}function vt(t,n,e,i){return t.bindTexture(pn,n),t.texImage2D(pn,0,Fn,e,i,0,sn,an,null),t.texParameteri(pn,_n,vn),t.texParameteri(pn,mn,vn),t.texParameteri(pn,Tn,xn),t.texParameteri(pn,Mn,An),t.texParameteri(pn,gn,An),n}function mt(t,n,e,i){n.mn=e,n._n=i,function(t,n,e,i){t.bindTexture(pn,n),t.texImage2D(pn,0,kn,e,i,0,un,ln,null),t.texParameteri(pn,_n,vn),t.texParameteri(pn,mn,vn)}(t,n.Mn,n.mn,n._n),vt(t,n.gn,n.mn,n._n)}function _t(t,n,e,i){n.mn=e,n._n=i,function(t,n,e,i){t.bindTexture(pn,n),t.texImage2D(pn,0,Dn,e,i,0,un,cn,null),t.texParameteri(pn,_n,vn),t.texParameteri(pn,mn,vn)}(t,n.Mn,n.mn,n._n),vt(t,n.gn,n.mn,n._n)}function Mt(t,n,e,i){n.mn=e,n._n=i,dt(t,n.pn,n.mn,n._n),dt(t,n.wn,n.mn,n._n),dt(t,n.yn,n.mn,n._n),dt(t,n.bn,n.mn,n._n),vt(t,n.gn,n.mn,n._n)}function gt(t,n,e){let i=null,o=null,r=[];for(let l=0;l{let o=t.o.v[e];return P(t.o.v[i].o,n.q)-P(o.o,n.q)})),t.Cn.enable(on);for(let l=0;lo.Jn){o.ln=0;let i=t.o.v[e];F(Ye,i.o),S(je,i.o),n(t,[...o.Qn(t),(l=Ye,(t,n)=>{u(t.o.v[n].D,l)}),(r=je,(t,n)=>{var e,i;(e=t.o.v[n].F)[0]=(i=r)[0],e[1]=i[1],e[2]=i[2],e[3]=i[3]})])}var r,l}function At(t,n,e){let i=t.o.Zn[n];i.ln+=e,i.ln>i.an&&(i.ln=0,(t.o.t[n]&i.st)===i.st?t.o.t[n]&=~i.st:t.o.t[n]|=i.st)}function kt(t,n){for(let n=0;nt+function(t){let n=t.shift();return"boolean"==typeof n||null==n?"":Array.isArray(n)?n.join(""):n}(n)+e))}function Dt(t,n=.1){return(e,i)=>{e.o.t[i]|=8192,e.o.Qt[i]={Zt:t,tn:n}}}function Ft(t,n,e=0){for(let i=e;i{o.o.t[r]|=32,o.o.vn[r]={dt:r,ee:!0,ie:t,ut:n,st:e,ot:i,rt:[0,0,0],lt:[0,0,0],it:[0,0,0],ct:[0,0,0],ft:[]}}}function $t(t){return[J(),Pt(!1,2,0),at(0),e([J([0,R(-.2,.2),0]),U(t.oe,t.re,[0,1,.1,1])])]}function Rt(t,n){return(e,i)=>{let o=t?e.Audio.createPanner():void 0;e.o.t[i]|=4,e.o.$[i]={I:o,V:n,p:0}}}function It(t){return(n,e)=>{t(n,e)}}function Lt(t,n,e){return(i,o)=>{i.o.t[o]|=64,i.o._t[o]={gt:t,F:n,Animation:e}}}function zt(t){return(n,e)=>{n.o.t[e]&=~t}}function Gt(t=[1,1,1],n=1){return(e,i)=>{e.o.t[i]|=4096,e.o.Ht[i]={L:2,Wt:t,Jt:n}}}function Ot(t=[1,1,1],n=1){return(e,i)=>{e.o.t[i]|=4096,e.o.Ht[i]={L:3,Wt:t,Jt:n}}}function Kt(t,n){return(e,i)=>{e.o.t[i]|=16384,e.o.Mt[i]={en:t,on:n,gt:[0,0,0],wt:[0,0,0,1],Dt:[0,0,0,1]}}}function Nt(t){return(n,e)=>{n.o.t[e]|=262144,n.o.qn[e]={jn:t}}}function Bt(t){let n,i,o;return[J(),It(((t,e)=>n=e)),Pt(!0,8,3),(t,n)=>{t.o.t[n]|=8388608,t.o._[n]={st:1,jt:1}},at(1,.3),Rt(!0),(a=5,c=2,(t,n)=>{t.o.t[n]|=2048,t.o.Xt[n]={Yt:a,jt:c}}),zt(2048),e([It(((t,n)=>i=n)),J(void 0,void 0,[.5,.7,.1]),Lt(null,[0,1,0,0]),Kt(0,.2),Nt(.05),(r=262144,l=1,(t,n)=>{t.o.t[n]|=2097152,t.o.Zn[n]={st:r,an:l,ln:0}}),zt(2359296),e([J([0,1,0]),U(t.oe,t.re,[5,3,0,1]),e([J([0,1,0]),Ot([1,.5,0],3)])])],[J([0,1.5,0]),Lt(null,[0,1,0,0]),Kt(0,2),e([J([0,0,.2],w([0,0,0,1],-90,0,0)),e([It(((t,n)=>o=n)),J(),Nt(.05),(t,n)=>{t.o.t[n]|=1024,t.o.rn[n]={Xt:2,an:.2,Vn:1,cn:[],ln:0}},(u=t.le,f=[1,1,1,1],h=[1,1,1,0],(t,n)=>{let e=t.Cn.createBuffer();t.Cn.bindBuffer(en,e),t.Cn.bufferData(en,be*ye*4,nn),t.o.t[n]|=65536,t.o.Pt[n]={L:8,$t:u,It:f[3]<1||h[3]<1?1:0,G:e,Kn:f,Nn:h,ot:[5,1],Lt:rn}})])])],[e([(t,n)=>{t.o.t[n]|=1048576,t.o.ae[n]={L:1,Yt:10}}]),(s=()=>{t.o.t[n]|=2048,t.o.t[i]|=2359296,t.o.qn[o].jn=.1;let e=t.o.rn[o];e.Xt=1,e.an=.1;let r=t.o.Pt[o];r.Kn=[1,1,0,1],r.Nn=[1,0,0,0],r.ot=[10,5]},(t,n)=>{t.o.t[n]|=1048576,t.o.ae[n]={L:2,ce:s}})])];var r,l,a,c,s,u,f,h}function Vt(t){return[J(),Pt(!0,4,3),at(1,.3),e([J(),U(t.oe,t.re,[.5,.5,.5,.3])])]}function Wt(t){return t*t}function Xt(t){return 1-(1-t)**2}function Yt(t){return t<.5?2*t*t:1-(-2*t+2)**2/2}function jt(t,n,e,i=0,o=0){return(r,l)=>{r.o.t[l]|=128,r.o.bt[l]={Mt:t,Tt:n,xt:e,Et:i,Ft:o}}}function Ht(t){return[J(),jt(!0,.2,0),Kt(10,3),Pt(!0,1,2),at(1),Rt(!1),(t,n)=>{t.o.t[n]|=2},e([J(),U(t.oe,t.re,[1,.3,.2,1]),(n={idle:{A:[{k:0,F:w([0,0,0,1],0,-5,0),T:Yt},{k:1,F:w([0,0,0,1],0,5,0),T:Yt}]},jump:{A:[{k:0,F:[0,0,0,1]},{k:.5,F:[1,0,0,0],T:Wt},{k:1,F:[0,0,0,-1],T:Xt}],C:0}},(t,e)=>{let i={};for(let t in n){let{A:e,C:o=7}=n[t],r=e[e.length-1].k;i[t]={A:e.map((t=>({...t}))),C:o,P:r,p:0}}t.o.t[e]|=1,t.o.m[e]={M:i,g:i.idle}})],[J(void 0,void 0,void 0,!0),(t,n)=>{t.o.t[n]|=32768,t.o.ne[n]={te:"camera anchor"}}],[J([0,2,0]),Ot([1,1,1],5)])];var n}var qt,Ut,Jt,Qt=256,Zt=16384,tn=35044,nn=35048,en=34962,on=3042,rn=2304,ln=5121,an=5125,cn=5126,sn=6402,un=6408,fn=35632,hn=35633,dn=9728,vn=9729,mn=10240,_n=10241,Mn=10242,gn=10243,pn=3553,wn=33984,yn=33985,bn=33986,Cn=33987,An=33071,kn=32856,Tn=34892,xn=34894,En=34836,Dn=34842,Fn=33190,Sn=5123,Pn=5126,$n=class{se;t=[];i=[];constructor(t=1e4){this.se=t}},Rn=document.getElementById("update"),In=document.getElementById("delta"),Ln=document.getElementById("fps"),zn=class{ue=0;fe=0;Y=window.innerWidth;j=window.innerHeight;he=!0;Ct={MouseX:0,MouseY:0};St={MouseX:0,MouseY:0};de={Mouse:0,Mouse0:0,Mouse1:0,Mouse2:0,Touch0:0,Touch1:0};ve={};me=document.querySelector("main");constructor(){document.addEventListener("visibilitychange",(()=>document.hidden?this._e():this.Me())),this.me.addEventListener("contextmenu",(t=>t.preventDefault())),this.me.addEventListener("mousedown",(t=>{this.Ct["Mouse"+t.button]=1,this.St["Mouse"+t.button]=1})),this.me.addEventListener("mouseup",(t=>{this.Ct["Mouse"+t.button]=0,this.St["Mouse"+t.button]=-1})),this.me.addEventListener("mousemove",(t=>{this.Ct.MouseX=t.clientX,this.Ct.MouseY=t.clientY,this.St.MouseX=t.movementX,this.St.MouseY=t.movementY})),this.me.addEventListener("wheel",(t=>{t.preventDefault(),this.St.WheelY=t.deltaY})),this.me.addEventListener("touchstart",(t=>{t.target===this.me&&t.preventDefault(),1===t.touches.length&&(this.ve={});for(let n=0;n{t.target===this.me&&t.preventDefault();for(let n=0;n{t.target===this.me&&t.preventDefault();for(let n=0;n{for(let n=0;n{t.repeat||(this.Ct[t.code]=1,this.St[t.code]=1)})),window.addEventListener("keyup",(t=>{this.Ct[t.code]=0,this.St[t.code]=-1}))}Me(){let t=performance.now(),n=e=>{let i=(e-t)/1e3;t=e,this.ue=requestAnimationFrame(n),this.ge(i),this.pe(i),this.we(i)};requestAnimationFrame(n)}_e(){cancelAnimationFrame(this.ue),this.ue=0}ge(t){this.fe=performance.now();let n=Math.abs(this.St.MouseX)+Math.abs(this.St.MouseY);this.de.Mouse+=n,1===this.Ct.Mouse0&&(this.de.Mouse0+=n),1===this.Ct.Mouse1&&(this.de.Mouse1+=n),1===this.Ct.Mouse2&&(this.de.Mouse2+=n),1===this.Ct.Touch0&&(this.de.Touch0+=Math.abs(this.St.Touch0X)+Math.abs(this.St.Touch0Y)),1===this.Ct.Touch1&&(this.de.Touch1+=Math.abs(this.St.Touch1X)+Math.abs(this.St.Touch1Y))}pe(t){}we(t){this.he=!1,-1===this.St.Mouse0&&(this.de.Mouse0=0),-1===this.St.Mouse1&&(this.de.Mouse1=0),-1===this.St.Mouse2&&(this.de.Mouse2=0),-1===this.St.Touch0&&(this.de.Touch0=0),-1===this.St.Touch1&&(this.de.Touch1=0);for(let t in this.St)this.St[t]=0;let n=performance.now()-this.fe;Rn&&(Rn.textContent=n.toFixed(1)),In&&(In.textContent=(1e3*t).toFixed(1)),Ln&&(Ln.textContent=(1/t).toFixed())}},Gn=class extends zn{ye=document.querySelector("#background");be=this.ye.getContext("2d");Ce=document.querySelector("#foreground");Nt=this.Ce.getContext("2d");Ae=document.querySelector("#scene");Cn=this.Ae.getContext("webgl2");Audio=new AudioContext;ke=[];En={};constructor(){super(),this.Cn.enable(2929),this.Cn.enable(2884),this.Cn.blendFunc(770,771)}},On=class extends $n{m=[];$=[];W=[];l=[];vn=[];_t=[];bt=[];Te=[];rn=[];Xt=[];Ht=[];Qt=[];Mt=[];ne=[];Pt=[];yt=[];qn=[];Un=[];ae=[];Zn=[];v=[];_=[]},Kn=Float32Array.from([-.5,-.5,.5,-.5,-.5,.5,-.5,-.5,.5,-.5,.5,.5,-.5,.5,.5,-.5,.5,.5,-.5,-.5,-.5,-.5,-.5,-.5,-.5,-.5,-.5,-.5,.5,-.5,-.5,.5,-.5,-.5,.5,-.5,.5,-.5,.5,.5,-.5,.5,.5,-.5,.5,.5,.5,.5,.5,.5,.5,.5,.5,.5,.5,-.5,-.5,.5,-.5,-.5,.5,-.5,-.5,.5,.5,-.5,.5,.5,-.5,.5,.5,-.5]),Nn=Float32Array.from([-1,0,0,0,-1,0,0,0,1,-1,0,0,0,0,1,0,1,0,-1,0,0,0,-1,0,0,0,-1,-1,0,0,0,0,-1,0,1,0,0,-1,0,0,0,1,1,0,0,0,0,1,0,1,0,1,0,0,0,-1,0,0,0,-1,1,0,0,0,0,-1,0,1,0,1,0,0]),Bn=Float32Array.from([.67,.67,1,1,.67,.33,.33,.67,.67,.67,0,0,.67,1,1,.67,.33,.33,.33,1,0,.33,.33,0,.67,1,.33,.33,.33,1,.33,.67,0,.33,0,1,.67,.67,.33,.67,.33,.67,0,.67,.33,.33,0,.67]),Vn=Float32Array.from([]),Wn=Uint16Array.from([16,5,22,5,11,22,1,12,7,12,18,7,2,4,13,4,15,13,14,17,20,17,23,20,19,21,8,21,10,8,6,9,0,9,3,0]),Xn=1e-6,Yn=Math.PI/180,jn=180/Math.PI,Hn=4194305,qn=4194306,Un=[0,0,0],Jn=[0,0,0],Qn=[0,0,0],Zn=1,te=4194308,ne=[0,0,0],ee=[0,0,0],ie=4194312,oe=[[.5,.5,.5],[.5,.5,-.5],[-.5,.5,-.5],[-.5,.5,.5],[.5,-.5,.5],[.5,-.5,-.5],[-.5,-.5,-.5],[-.5,-.5,.5]],re=4194336,le=4210752,ae=131200,ce=4210816,se=[1,0,0],ue=[0,1,0],fe=[0,0,0,0],he=[0,1,0],de=[1,0,0],ve=.01,me=10,_e=[0,0],Me=[0,0,0,0],ge=[0,1,0],pe=[1,0,0],we=.1,ye=8,be=200,Ce=4194816,Ae=4198400,ke=[0,0,0],Te=4202496,xe=[0,0,0],Ee=[0,0,0,1],De=4210688,Fe=4195328,Se=[0,0,0],Pe=[0,0,0],$e=4325376,Re=-9.81,Ie=[0,0,0],Le=4325376,ze=[0,0,0],Ge=[0,0,0],Oe=4325408,Ke=[0,0,0],Ne=[0,0,0],Be=1048576,Ve=4259840,We=4456448,Xe=4718592,Ye=[0,0,0],je=[0,0,0,0],He=2097152,qe=4194560,Ue=[0,0,0],Je=12582944,Qe=new class extends Gn{o=new On;xe=function(t){return function(t,n=4){let e=l(t,"#version 300 es\n\nuniform mat4 pv;\nuniform mat4 world;\n\nlayout(location=0) in vec4 attr_position;\n\nvoid main() {\ngl_Position = pv * world * attr_position;\n}\n","#version 300 es\n\nprecision mediump float;\n\nuniform vec4 color;\n\nout vec4 frag_color;\n\nvoid main() {\nfrag_color = color;\n}\n");return{Pn:n,An:e,kn:{H:t.getUniformLocation(e,"pv"),o:t.getUniformLocation(e,"world"),Wt:t.getUniformLocation(e,"color")}}}(t,2)}(this.Cn);oe=function(t){let n=l(t,"#version 300 es\n\nuniform mat4 pv;\nuniform mat4 world;\nuniform mat4 self;\n\nlayout(location=0) in vec4 attr_position;\nlayout(location=1) in vec3 attr_normal;\n\nout vec4 vert_position;\nout vec3 vert_normal;\n\nvoid main() {\nvert_position = world * attr_position;\nvert_normal = (vec4(attr_normal, 0.0) * self).xyz;\ngl_Position = pv * vert_position;\n}\n","#version 300 es\n\nprecision mediump float;\n\nuniform vec3 eye;\nuniform vec4 diffuse_color;\nuniform vec4 specular_color;\nuniform vec4 emissive_color;\nuniform vec4 light_positions[8];\nuniform vec4 light_details[8];\n\nin vec4 vert_position;\nin vec3 vert_normal;\n\nout vec4 frag_color;\n\n\n\n\n\n\nvec3 GAMMA_DECODE(vec3 rgb) {\nreturn pow(rgb, vec3(2.2));\n}\n\n\nvec4 GAMMA_DECODE(vec4 color) {\nreturn vec4(pow(color.rgb, vec3(2.2)), color.a);\n}\n\n\n\n\n\n\nvec3 GAMMA_ENCODE(vec3 rgb) {\nreturn pow(rgb, vec3(1.0 / 2.2));\n}\n\n\nvec4 GAMMA_ENCODE(vec4 color) {\nreturn vec4(pow(color.rgb, vec3(1.0 / 2.2)), color.a);\n}\n\n\nvoid main() {\nvec3 world_normal = normalize(vert_normal);\n\nvec3 view_dir = eye - vert_position.xyz;\nvec3 view_normal = normalize(view_dir);\n\n\nvec3 light_acc = GAMMA_DECODE(diffuse_color.rgb) * 0.1;\n\nfor (int i = 0; i < 8; i++) {\nint light_kind = int(light_positions[i].w);\nif (light_kind == 0) {\nbreak;\n}\n\nvec3 light_rgb = GAMMA_DECODE(light_details[i].rgb);\nfloat light_intensity = light_details[i].a;\n\nvec3 light_normal;\nif (light_kind == 2) {\nlight_normal = light_positions[i].xyz;\n} else if (light_kind == 3) {\nvec3 light_dir = light_positions[i].xyz - vert_position.xyz;\nfloat light_dist = length(light_dir);\nlight_normal = light_dir / light_dist;\n\nlight_intensity /= (light_dist * light_dist);\n}\n\nfloat diffuse_factor = dot(world_normal, light_normal);\nif (diffuse_factor > 0.0) {\n\nlight_acc += GAMMA_DECODE(diffuse_color.rgb) * diffuse_factor * light_rgb * light_intensity;\n\nif (specular_color.a > 0.0) {\n\n\n\n\n\n\nvec3 h = normalize(light_normal + view_normal);\nfloat specular_angle = max(dot(h, world_normal), 0.0);\nfloat specular_factor = pow(specular_angle, specular_color.a);\n\n\nlight_acc += GAMMA_DECODE(specular_color.rgb) * specular_factor * light_rgb * light_intensity;\n}\n}\n}\n\nvec3 emissive_rgb = GAMMA_DECODE(emissive_color.rgb) * emissive_color.a;\nfrag_color = vec4(GAMMA_ENCODE(light_acc + emissive_rgb), diffuse_color.a);\n}\n");return{Pn:4,An:n,kn:{H:t.getUniformLocation(n,"pv"),o:t.getUniformLocation(n,"world"),et:t.getUniformLocation(n,"self"),zt:t.getUniformLocation(n,"diffuse_color"),Gt:t.getUniformLocation(n,"specular_color"),Ot:t.getUniformLocation(n,"emissive_color"),Tn:t.getUniformLocation(n,"eye"),qt:t.getUniformLocation(n,"light_positions"),Ut:t.getUniformLocation(n,"light_details")}}}(this.Cn);le=function(t){let n=l(t,"#version 300 es\n\nuniform mat4 pv;\nuniform vec4 color_start;\nuniform vec4 color_end;\n\nuniform vec4 details;\n\n\nin vec4 attr_origin_age;\nin vec3 attr_direction;\n\nout vec4 vert_color;\n\nvoid main() {\n\nvec3 velocity = attr_direction * details.y;\ngl_Position = pv * vec4(attr_origin_age.xyz + velocity * attr_origin_age.w, 1.0);\n\n\nfloat t = attr_origin_age.w / details.x;\ngl_PointSize = mix(details.z, details.w, t);\nvert_color = mix(color_start, color_end, t);\n}\n","#version 300 es\n\nprecision mediump float;\n\nin vec4 vert_color;\n\nout vec4 frag_color;\n\nvoid main() {\nfrag_color = vert_color;\n}\n");return{Pn:0,An:n,kn:{H:t.getUniformLocation(n,"pv"),Kn:t.getUniformLocation(n,"color_start"),Nn:t.getUniformLocation(n,"color_end"),Bn:t.getUniformLocation(n,"details"),Wn:t.getAttribLocation(n,"attr_origin_age"),gt:t.getAttribLocation(n,"attr_direction")}}}(this.Cn);re=function(t){let n=t.createVertexArray();t.bindVertexArray(n);let e=t.createBuffer();t.bindBuffer(en,e),t.bufferData(en,Kn,tn),t.enableVertexAttribArray(0),t.vertexAttribPointer(0,3,Pn,!1,0,0);let i=t.createBuffer();t.bindBuffer(en,i),t.bufferData(en,Nn,tn),t.enableVertexAttribArray(1),t.vertexAttribPointer(1,3,Pn,!1,0,0);let o=t.createBuffer();t.bindBuffer(en,o),t.bufferData(en,Bn,tn),t.enableVertexAttribArray(2),t.vertexAttribPointer(2,2,Pn,!1,0,0);let r=t.createBuffer();t.bindBuffer(en,r),t.bufferData(en,Vn,tn),t.enableVertexAttribArray(5),t.vertexAttribPointer(5,4,Pn,!1,0,0);let l=t.createBuffer();return t.bindBuffer(34963,l),t.bufferData(34963,Wn,tn),t.bindVertexArray(null),{Sn:n,On:e,Ee:Kn,De:i,Fe:Nn,Se:o,Pe:Bn,$e:r,Re:Vn,Ie:l,Le:Wn,$n:Wn.length}}(this.Cn);qt=new Float32Array(32);Ut=new Float32Array(32);u=0;h=0;pe(n){!function(n,e){let i=[];for(let t=0;t1)continue;t.Nt.setTransform(1,0,0,1,.5*(e[0]+1)*t.Y,.5*(1-e[1])*t.j);let o=t.o.Te[n];switch(o.L){case 0:tt(t,o);break;case 3:nt(t,o)}}}(this),function(t,n){let e=function(t){return Et`
${Et` +"use strict";(()=>{function t(t,n){t.t[n]=0,t.i.push(n)}function n(t,n){let e=(i=t.o).i.length>0?i.i.pop():i.t.push(0)-1;var i;for(let i of n)i(t,e);return e}function e(...t){return(e,i)=>{16&e.o.t[i]||(e.o.t[i]|=16,e.o.l[i]={l:[]});let o=e.o.l[i].l;for(let i of t){let t=n(e,i);o.push(t)}}}function*i(t,n,e){if((t.t[n]&e)===e&&(yield n),16&t.t[n])for(let o of t.l[n].l)yield*i(t,o,e)}function o(n,e){if(16&n.t[e])for(let t of n.l[e].l)o(n,t);0===n.t[e]||t(n,e)}function r(t,n,e){switch(n){case 0:document.fullscreenElement?document.exitFullscreen():document.body.requestFullscreen();break;case 1:{let[n]=e;o(t.o,n),t.u++;break}case 2:t.h++}}function l(t,n,e){let i=t.createProgram();return t.attachShader(i,a(t,hn,n)),t.attachShader(i,a(t,fn,e)),t.linkProgram(i),i}function a(t,n,e){let i=t.createShader(n);return t.shaderSource(i,e),t.compileShader(i),i}function c(t,n,e){return Math.max(t,Math.min(n,e))}function s(t,n,e,i){return t[0]=n,t[1]=e,t[2]=i,t}function u(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t}function f(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t}function h(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t}function d(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t}function v(t,n){let e=n[0],i=n[1],o=n[2],r=e*e+i*i+o*o;return r>0&&(r=1/Math.sqrt(r)),t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t}function m(t,n,e){let i=n[0],o=n[1],r=n[2],l=e[3]*i+e[7]*o+e[11]*r+e[15]||1;return t[0]=(e[0]*i+e[4]*o+e[8]*r+e[12])/l,t[1]=(e[1]*i+e[5]*o+e[9]*r+e[13])/l,t[2]=(e[2]*i+e[6]*o+e[10]*r+e[14])/l,t}function _(t,n,e){let i=n[0],o=n[1],r=n[2];return t[0]=e[0]*i+e[4]*o+e[8]*r,t[1]=e[1]*i+e[5]*o+e[9]*r,t[2]=e[2]*i+e[6]*o+e[10]*r,t}function M(t,n,e,i){let o=n[0],r=n[1],l=n[2];return t[0]=o+i*(e[0]-o),t[1]=r+i*(e[1]-r),t[2]=l+i*(e[2]-l),t}function g(t,n,e,i,o){return t[0]=n,t[1]=e,t[2]=i,t[3]=o,t}function p(t,n,e){let i=n[0],o=n[1],r=n[2],l=n[3],a=e[0],c=e[1],s=e[2],u=e[3];return t[0]=i*u+l*a+o*s-r*c,t[1]=o*u+l*c+r*a-i*s,t[2]=r*u+l*s+i*c-o*a,t[3]=l*u-i*a-o*c-r*s,t}function w(t,n,e,i){let o=Math.sin(n/2*Yn),r=Math.cos(n/2*Yn),l=Math.sin(e/2*Yn),a=Math.cos(e/2*Yn),c=Math.sin(i/2*Yn),s=Math.cos(i/2*Yn);return t[0]=o*a*s+r*l*c,t[1]=r*l*s-o*a*c,t[2]=r*a*c-o*l*s,t[3]=r*a*s+o*l*c,t}function y(t){return Math.asin(-c(-1,1,2*(t[1]*t[2]-t[3]*t[0])))*jn}function b(t,n,e){let i=e/2;return t[0]=Math.sin(i)*n[0],t[1]=Math.sin(i)*n[1],t[2]=Math.sin(i)*n[2],t[3]=Math.cos(i),t}function C(t,n,e,i){let o,r,l,a,c,s=n[0],u=n[1],f=n[2],h=n[3],d=e[0],v=e[1],m=e[2],_=e[3];return r=s*d+u*v+f*m+h*_,r<0&&(r=-r,d=-d,v=-v,m=-m,_=-_),1-r>Xn?(o=Math.acos(r),l=Math.sin(o),a=Math.sin((1-i)*o)/l,c=Math.sin(i*o)/l):(a=1-i,c=i),t[0]=a*s+c*d,t[1]=a*u+c*v,t[2]=a*f+c*m,t[3]=a*h+c*_,t}function A(t,n,e){let i=t.o.v[n],o=t.o.m[n];if(o._){let t=o.M[o._];t&&t!==o.g&&(0===o.g.p?o.g=t:1&o.g.C&&(o.g.p=0,o.g=t)),o._=void 0}let r=null,l=null;for(let t of o.g.A){if(o.g.p0?(_=2*Math.sqrt(m+1),t[3]=.25*_,t[0]=(f-d)/_,t[1]=(h-c)/_,t[2]=(a-s)/_):l>u&&l>v?(_=2*Math.sqrt(1+l-u-v),t[3]=(f-d)/_,t[0]=.25*_,t[1]=(a+s)/_,t[2]=(h+c)/_):u>v?(_=2*Math.sqrt(1+u-l-v),t[3]=(h-c)/_,t[0]=(a+s)/_,t[1]=.25*_,t[2]=(f+d)/_):(_=2*Math.sqrt(1+v-l-u),t[3]=(a-s)/_,t[0]=(h+c)/_,t[1]=(f+d)/_,t[2]=.25*_),t}function P(t,n){let e=t[12]-n[0],i=t[13]-n[1],o=t[14]-n[2];return e*e+i*i+o*o}function $(t,n){let e=t.o.v[n];var i,o;F(Un,e.o),D(Jn,e.o),(i=Qn)[0]=(o=e.o)[4],i[1]=o[5],i[2]=o[6],v(i,i);let r=t.Audio.listener;r.positionX?(r.positionX.value=Un[0],r.positionY.value=Un[1],r.positionZ.value=Un[2],r.forwardX.value=Jn[0],r.forwardY.value=Jn[1],r.forwardZ.value=Jn[2],r.upX.value=Qn[0],r.upY.value=Qn[1],r.upZ.value=Qn[2]):(r.setPosition(...Un),r.setOrientation(...Jn,...Qn))}function R(t=0,n=1){return((Zn=16807*Zn%2147483647)-1)/2147483646*(n-t)+t}function I(t,n,e,i,o){let r=t.currentTime+o,l=0;n&&n.connect(t.destination);let a,c,s=t.createGain();if(s.gain.value=(e[0]/9)**3,e[5]&&(c=t.createOscillator(),c.type=e[5],c.frequency.value=(e[7]/3)**3,a=t.createGain(),a.gain.value=(e[6]+3)**3,c.connect(a)),e[1]){let i=t.createBiquadFilter();i.type=e[1],i.frequency.value=2**e[2],i.Q.value=e[3]**1.5,a&&e[4]&&a.connect(i.detune),s.connect(i),i.connect(n||t.destination)}else s.connect(n||t.destination);for(let n of e[8]){let e=t.createGain();e.connect(s);let o=(n[1]/9)**3,c=(n[2]/9)**3,u=(n[3]/9)**3,f=c+u+(n[4]/6)**3;if(e.gain.setValueAtTime(0,r),e.gain.linearRampToValueAtTime(o,r+c),e.gain.setValueAtTime(o,r+c+u),e.gain.exponentialRampToValueAtTime(1e-5,r+f),n[0]){let o=t.createOscillator();o.type=n[0],o.connect(e),o.detune.value=3*(n[5]-7.5)**3,a&&n[6]&&a.connect(o.detune);let l=440*2**((i-69)/12);if(n[7]){let t=(n[8]/9)**3,e=(n[9]/9)**3,i=(n[10]/6)**3;o.frequency.linearRampToValueAtTime(0,r),o.frequency.linearRampToValueAtTime(l,r+t),o.frequency.setValueAtTime(l,r+t+e),o.frequency.exponentialRampToValueAtTime(1e-5,r+t+e+i)}else o.frequency.setValueAtTime(l,r);o.start(r),o.stop(r+f)}else{let n=t.createBufferSource();n.buffer=L(t),n.loop=!0,n.connect(e),n.start(r),n.stop(r+f)}f>l&&(l=f)}c&&(c.start(r),c.stop(r+l))}function L(t){if(!qt){let n=(qt=t.createBuffer(1,2*t.sampleRate,t.sampleRate)).getChannelData(0);for(let t=0;ti.g.R?i.g=void 0:i.I&&G(i.I,o)),i._&&!i.g){switch(i._.L){case 0:!function(t,n,e){let i=t.createBufferSource();i.buffer=e.G,n?(i.connect(n),n.connect(t.destination)):i.connect(t.destination),i.start()}(t.Audio,i.I,i._);break;case 1:!function(t,n,e){let i=60/(e.O||120)/4;for(let o of e.K)for(let e=0;e{i.o.t[o]|=8,i.o.W[o]={L:0,X:t,o:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],Y:0,j:0,H:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],q:[0,0,0],U:n,J:t.Z,tt:n,nt:e}}}function K(t,n,e){let i=t.o.v[n];T(e.H,e.X.X,i.et),F(e.q,i.o)}function N(t,n){let e,i,o,r,l,a;F(n.it,t),e=r=n.it[0],i=l=n.it[1],o=a=n.it[2];let c=[0,0,0];for(let s=0;s<8;s++){let u=oe[s];c[0]=u[0]*n.ot[0],c[1]=u[1]*n.ot[1],c[2]=u[2]*n.ot[2],m(c,c,t),c[0]r&&(r=c[0]),c[1]l&&(l=c[1]),c[2]a&&(a=c[2])}n.rt=[e,i,o],n.lt=[r,l,a],n.ct[0]=(r-e)/2,n.ct[1]=(l-i)/2,n.ct[2]=(a-o)/2}function B(t,n){let e=t.it[0]-n.it[0],i=t.ct[0]+n.ct[0]-Math.abs(e),o=t.it[1]-n.it[1],r=t.ct[1]+n.ct[1]-Math.abs(o),l=t.it[2]-n.it[2],a=t.ct[2]+n.ct[2]-Math.abs(l);return io.rt[0]&&i.rt[1]o.rt[1]&&i.rt[2]o.rt[2]){let n=B(t,e);l&&t.ft.push({ht:e.dt,vt:n}),a&&e.ft.push({ht:t.dt,vt:d([0,0,0],n)})}}var i,o}function W(t,n){let e=t.o._t[n],o=t.o.Mt[n];if(e.gt&&f(o.gt,o.gt,e.gt),e.F&&p(o.wt,o.wt,e.F),e.Animation)for(let o of i(t.o,n,1))t.o.m[o]._=e.Animation}function X(t,n){let e=t.o.yt[n];if(t.o.bt[n].Mt&&t.Ct.Space&&e.At){e.kt[1]=300;for(let e of i(t.o,n,1))t.o.m[e]._="jump"}}function Y(t,n){let e=t.o.bt[n];if(e.Mt){let e=t.o.Mt[n];t.Ct.KeyW&&(e.gt[2]+=1),t.Ct.KeyA&&(e.gt[0]+=1),t.Ct.KeyS&&(e.gt[2]-=1),t.Ct.KeyD&&(e.gt[0]-=1)}if(e.Tt){let e=t.o.Mt[n];t.Ct.ArrowLeft&&p(e.wt,e.wt,[0,1,0,0]),t.Ct.ArrowRight&&p(e.wt,e.wt,[0,-1,0,0])}if(e.xt){let i=t.o.Mt[n],o=y(t.o.v[n].F);t.Ct.ArrowUp&&o>e.Et&&p(i.Dt,i.Dt,[-1,0,0,0]),t.Ct.ArrowDown&&ove&&(o.gt[0]+=c(-1,1,-e)),Math.abs(i)>ve&&(o.gt[2]+=c(-1,1,-i))}if(i.Tt&&t.St.Touch1X&&(b(Me,he,-t.St.Touch1X*i.Tt*me*Yn),p(e.F,Me,e.F),t.o.t[n]|=256),i.xt&&t.St.Touch1Y){let o=y(e.F),r=c(i.Et-o,i.Ft-o,t.St.Touch1Y*i.xt*me);b(Me,de,r*Yn),p(e.F,e.F,Me),t.o.t[n]|=256}}function q(t,n){let e=t.o.bt[n];if(e.Mt){let e=t.o.Mt[n];Math.abs(t.St.pad0_axis_1)>we&&(e.gt[0]-=t.St.pad0_axis_1),Math.abs(t.St.pad0_axis_2)>we&&(e.gt[2]-=t.St.pad0_axis_2)}if(e.Tt&&Math.abs(t.St.pad0_axis_3)>we){let e=t.o.Mt[n];p(e.wt,e.wt,b([0,0,0,1],ge,-t.St.pad0_axis_3*Math.PI))}if(e.xt&&Math.abs(t.St.pad0_axis_4)>we){let i=t.o.Mt[n],o=t.St.pad0_axis_4*Math.PI,r=y(t.o.v[n].F);(o<0&&r>e.Et||o>0&&r{a.o.t[c]|=65536,a.o.Pt[c]={L:1,$t:t,Rt:n,It:e[3]<1?1:0,Lt:l,zt:e,Gt:[...r,i],Ot:[e[0],e[1],e[2],o]}}}function J(t=[0,0,0],n=[0,0,0,1],e=[1,1,1],i=!1){return(o,r)=>{o.o.t[r]|=4194560,o.o.v[r]={o:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],et:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],D:t,F:n,S:e,Kt:i}}}function Q(t,n,e){return(i,o)=>{let r=i.o.v[o];r.D[0]=t,r.D[1]=n,r.D[2]=e}}function Z(t,n,e){return(i,o)=>{let r=i.o.v[o];r.S[0]=t,r.S[1]=n,r.S[2]=e}}function tt(t,n){t.Nt.textAlign="center",t.Nt.font=n.Bt,t.Nt.fillStyle=n.Vt,t.Nt.fillText(n.Text,0,0)}function nt(t,n){t.Nt.strokeStyle=n.Wt,t.Nt.strokeRect(-n.ot/2,-n.ot/2,n.ot,n.ot)}function et(t,n,e){let i=t.o.Xt[n];i.Yt-=e,i.Yt<0&&(i.jt&&r(t,i.jt,n),o(t.o,n))}function it(t,n,e){let i=t.o.Ht[n],o=t.o.v[n];2===i.L?D(ke,o.o):F(ke,o.o),t.qt[4*e+0]=ke[0],t.qt[4*e+1]=ke[1],t.qt[4*e+2]=ke[2],t.qt[4*e+3]=i.L,t.Ut[4*e+0]=i.Wt[0],t.Ut[4*e+1]=i.Wt[1],t.Ut[4*e+2]=i.Wt[2],t.Ut[4*e+3]=i.Jt}function ot(t,n,e){let i=t.o.v[n],o=t.o.Qt[n],r=t.o.v[o.Zt];F(xe,r.o),S(Ee,r.o);let l=1-Math.exp(-e/o.tn);M(i.D,i.D,xe,l),C(i.F,i.F,Ee,l),t.o.t[n]|=256}function rt(t,n,e){let i=t.o.v[n],o=t.o.Mt[n];if(0!==o.gt[0]||0!==o.gt[1]||0!==o.gt[2]){let l=Math.min(1,Math.hypot((r=o.gt)[0],r[1],r[2]));_(o.gt,o.gt,i.o),void 0!==i.nn&&_(o.gt,o.gt,t.o.v[i.nn].et),v(o.gt,o.gt),h(o.gt,o.gt,l*o.en*e),f(i.D,i.D,o.gt),t.o.t[n]|=256,s(o.gt,0,0,0)}var r;o.wt[3]<1&&(p(o.wt,o.wt,i.F),C(i.F,i.F,o.wt,Math.min(1,o.on/Math.PI*e)),t.o.t[n]|=256,g(o.wt,0,0,0,1)),o.Dt[3]<1&&(p(o.Dt,i.F,o.Dt),C(i.F,i.F,o.Dt,Math.min(1,o.on/Math.PI*e)),t.o.t[n]|=256,g(o.Dt,0,0,0,1))}function lt(t,n,e){let i=t.o.rn[n],o=t.o.v[n];i.ln+=e,i.ln>i.an&&(i.ln=0,F(Se,o.o),D(Pe,o.o),i.cn.push(...Se,0),i.cn.push(...Pe,Math.random()));for(let t=0;ti.Xt?i.cn.splice(t,ye):t+=ye}function at(t,n=.5){return(e,i)=>{e.o.t[i]|=131072,e.o.yt[i]={L:t,sn:i,un:n,kt:[0,0,0],fn:[0,0,0],hn:[0,0,0],dn:[0,0,0],At:!1}}}function ct(t,n,e){let i=t.o.v[n],o=t.o.yt[n];1===o.L&&(o.fn[1]+=Re*e,h(o.kt,o.kt,e),f(o.fn,o.fn,o.kt),h(Ie,o.fn,e),f(i.D,i.D,Ie),t.o.t[n]|=256,s(o.kt,0,0,0))}function st(t,n,e){let i=t.o.yt[n];var o,r,l;F(ze,t.o.v[n].o),2===i.L&&((o=Ge)[0]=(r=ze)[0]-(l=i.dn)[0],o[1]=r[1]-l[1],o[2]=r[2]-l[2],h(i.fn,Ge,1/e)),u(i.dn,ze)}function ut(t,n){let e=t.o.v[n],i=t.o.yt[n],o=t.o.vn[i.sn];if(1===i.L){i.At=!1,s(Ne,0,0,0);for(let n=0;n0&&(i.At=!0)}}Ne[0]||Ne[1]||Ne[2]?(Math.abs(Ne[0])<.1&&(Ne[0]=0),Math.abs(Ne[2])<.1&&(Ne[2]=0),f(e.D,e.D,Ne),t.o.t[n]|=256):u(i.hn,i.fn)}var r,l}function ft(t,n,e){t[0]=n[0]>=0&&e[0]>=0?Math.max(n[0],e[0]):n[0]<=0&&e[0]<=0?Math.min(n[0],e[0]):n[0],n[1]>=0&&e[1]>=0?t[1]=Math.max(n[1],e[1]):n[1]<=0&&e[1]<=0?t[1]=Math.min(n[1],e[1]):n[1]>e[1]&&(t[1]=n[1]),t[2]=n[2]>=0&&e[2]>=0?Math.max(n[2],e[2]):n[0]<=0&&e[0]<=0?Math.min(n[2],e[2]):n[2]}function ht(t,n){if(16&t.t[n]){let e=t.l[n];for(let n of e.l)if(1048576&t.t[n])return!0}return!1}function dt(t,n,e,i){return t.bindTexture(pn,n),t.texImage2D(pn,0,En,e,i,0,un,cn,null),t.texParameteri(pn,_n,dn),t.texParameteri(pn,mn,dn),n}function vt(t,n,e,i){return t.bindTexture(pn,n),t.texImage2D(pn,0,Fn,e,i,0,sn,an,null),t.texParameteri(pn,_n,vn),t.texParameteri(pn,mn,vn),t.texParameteri(pn,Tn,xn),t.texParameteri(pn,Mn,An),t.texParameteri(pn,gn,An),n}function mt(t,n,e,i){n.mn=e,n._n=i,function(t,n,e,i){t.bindTexture(pn,n),t.texImage2D(pn,0,kn,e,i,0,un,ln,null),t.texParameteri(pn,_n,vn),t.texParameteri(pn,mn,vn)}(t,n.Mn,n.mn,n._n),vt(t,n.gn,n.mn,n._n)}function _t(t,n,e,i){n.mn=e,n._n=i,function(t,n,e,i){t.bindTexture(pn,n),t.texImage2D(pn,0,Dn,e,i,0,un,cn,null),t.texParameteri(pn,_n,vn),t.texParameteri(pn,mn,vn)}(t,n.Mn,n.mn,n._n),vt(t,n.gn,n.mn,n._n)}function Mt(t,n,e,i){n.mn=e,n._n=i,dt(t,n.pn,n.mn,n._n),dt(t,n.wn,n.mn,n._n),dt(t,n.yn,n.mn,n._n),dt(t,n.bn,n.mn,n._n),vt(t,n.gn,n.mn,n._n)}function gt(t,n,e){let i=null,o=null,r=[];for(let l=0;l{let o=t.o.v[e];return P(t.o.v[i].o,n.q)-P(o.o,n.q)})),t.Cn.enable(on);for(let l=0;lo.Jn){o.ln=0;let i=t.o.v[e];F(Ye,i.o),S(je,i.o),n(t,[...o.Qn(t),(l=Ye,(t,n)=>{u(t.o.v[n].D,l)}),(r=je,(t,n)=>{var e,i;(e=t.o.v[n].F)[0]=(i=r)[0],e[1]=i[1],e[2]=i[2],e[3]=i[3]})])}var r,l}function At(t,n,e){let i=t.o.Zn[n];i.ln+=e,i.ln>i.an&&(i.ln=0,(t.o.t[n]&i.st)===i.st?t.o.t[n]&=~i.st:t.o.t[n]|=i.st)}function kt(t,n){for(let n=0;nt+function(t){let n=t.shift();return"boolean"==typeof n||null==n?"":Array.isArray(n)?n.join(""):n}(n)+e))}function Dt(t,n=1){return(e,i)=>{e.o.t[i]|=8192,e.o.Qt[i]={Zt:t,tn:n}}}function Ft(t,n,e=0){for(let i=e;i{o.o.t[r]|=32,o.o.vn[r]={dt:r,ee:!0,ie:t,ut:n,st:e,ot:i,rt:[0,0,0],lt:[0,0,0],it:[0,0,0],ct:[0,0,0],ft:[]}}}function $t(t){return[J(),Pt(!1,2,0),at(0),e([J([0,R(-.2,.2),0]),U(t.oe,t.re,[0,1,.1,1])])]}function Rt(t,n){return(e,i)=>{let o=t?e.Audio.createPanner():void 0;e.o.t[i]|=4,e.o.$[i]={I:o,V:n,p:0}}}function It(t){return(n,e)=>{t(n,e)}}function Lt(t,n,e){return(i,o)=>{i.o.t[o]|=64,i.o._t[o]={gt:t,F:n,Animation:e}}}function zt(t){return(n,e)=>{n.o.t[e]&=~t}}function Gt(t=[1,1,1],n=1){return(e,i)=>{e.o.t[i]|=4096,e.o.Ht[i]={L:2,Wt:t,Jt:n}}}function Ot(t=[1,1,1],n=1){return(e,i)=>{e.o.t[i]|=4096,e.o.Ht[i]={L:3,Wt:t,Jt:n}}}function Kt(t,n){return(e,i)=>{e.o.t[i]|=16384,e.o.Mt[i]={en:t,on:n,gt:[0,0,0],wt:[0,0,0,1],Dt:[0,0,0,1]}}}function Nt(t){return(n,e)=>{n.o.t[e]|=262144,n.o.qn[e]={jn:t}}}function Bt(t){let n,i,o;return[J(),It(((t,e)=>n=e)),Pt(!0,8,3),(t,n)=>{t.o.t[n]|=8388608,t.o._[n]={st:1,jt:1}},at(1,.3),Rt(!0),(a=5,c=2,(t,n)=>{t.o.t[n]|=2048,t.o.Xt[n]={Yt:a,jt:c}}),zt(2048),e([It(((t,n)=>i=n)),J(void 0,void 0,[.5,.7,.1]),Lt(null,[0,1,0,0]),Kt(0,.2),Nt(.05),(r=262144,l=1,(t,n)=>{t.o.t[n]|=2097152,t.o.Zn[n]={st:r,an:l,ln:0}}),zt(2359296),e([J([0,1,0]),U(t.oe,t.re,[5,3,0,1]),e([J([0,1,0]),Ot([1,.5,0],3)])])],[J([0,1.5,0]),Lt(null,[0,1,0,0]),Kt(0,2),e([J([0,0,.2],w([0,0,0,1],-90,0,0)),e([It(((t,n)=>o=n)),J(),Nt(.05),(t,n)=>{t.o.t[n]|=1024,t.o.rn[n]={Xt:2,an:.2,Vn:1,cn:[],ln:0}},(u=t.le,f=[1,1,1,1],h=[1,1,1,0],(t,n)=>{let e=t.Cn.createBuffer();t.Cn.bindBuffer(en,e),t.Cn.bufferData(en,be*ye*4,nn),t.o.t[n]|=65536,t.o.Pt[n]={L:8,$t:u,It:f[3]<1||h[3]<1?1:0,G:e,Kn:f,Nn:h,ot:[5,1],Lt:rn}})])])],[e([(t,n)=>{t.o.t[n]|=1048576,t.o.ae[n]={L:1,Yt:10}}]),(s=()=>{t.o.t[n]|=2048,t.o.t[i]|=2359296,t.o.qn[o].jn=.1;let e=t.o.rn[o];e.Xt=1,e.an=.1;let r=t.o.Pt[o];r.Kn=[1,1,0,1],r.Nn=[1,0,0,0],r.ot=[10,5]},(t,n)=>{t.o.t[n]|=1048576,t.o.ae[n]={L:2,ce:s}})])];var r,l,a,c,s,u,f,h}function Vt(t){return[J(),Pt(!0,4,3),at(1,.3),e([J(),U(t.oe,t.re,[.5,.5,.5,.3])])]}function Wt(t){return t*t}function Xt(t){return 1-(1-t)**2}function Yt(t){return t<.5?2*t*t:1-(-2*t+2)**2/2}function jt(t,n,e,i=0,o=0){return(r,l)=>{r.o.t[l]|=128,r.o.bt[l]={Mt:t,Tt:n,xt:e,Et:i,Ft:o}}}function Ht(t){return[J(),jt(!0,.2,0),Kt(10,3),Pt(!0,1,2),at(1),Rt(!1),(t,n)=>{t.o.t[n]|=2},e([J(),U(t.oe,t.re,[1,.3,.2,1]),(n={idle:{A:[{k:0,F:w([0,0,0,1],0,-5,0),T:Yt},{k:1,F:w([0,0,0,1],0,5,0),T:Yt}]},jump:{A:[{k:0,F:[0,0,0,1]},{k:.5,F:[1,0,0,0],T:Wt},{k:1,F:[0,0,0,-1],T:Xt}],C:0}},(t,e)=>{let i={};for(let t in n){let{A:e,C:o=7}=n[t],r=e[e.length-1].k;i[t]={A:e.map((t=>({...t}))),C:o,P:r,p:0}}t.o.t[e]|=1,t.o.m[e]={M:i,g:i.idle}})],[J(void 0,void 0,void 0,!0),(t,n)=>{t.o.t[n]|=32768,t.o.ne[n]={te:"camera anchor"}}],[J([0,2,0]),Ot([1,1,1],5)])];var n}var qt,Ut,Jt,Qt=256,Zt=16384,tn=35044,nn=35048,en=34962,on=3042,rn=2304,ln=5121,an=5125,cn=5126,sn=6402,un=6408,fn=35632,hn=35633,dn=9728,vn=9729,mn=10240,_n=10241,Mn=10242,gn=10243,pn=3553,wn=33984,yn=33985,bn=33986,Cn=33987,An=33071,kn=32856,Tn=34892,xn=34894,En=34836,Dn=34842,Fn=33190,Sn=5123,Pn=5126,$n=class{se;t=[];i=[];constructor(t=1e4){this.se=t}},Rn=document.getElementById("update"),In=document.getElementById("delta"),Ln=document.getElementById("fps"),zn=class{ue=0;fe=0;Y=window.innerWidth;j=window.innerHeight;he=!0;Ct={MouseX:0,MouseY:0};St={MouseX:0,MouseY:0};de={Mouse:0,Mouse0:0,Mouse1:0,Mouse2:0,Touch0:0,Touch1:0};ve={};me=document.querySelector("main");constructor(){document.addEventListener("visibilitychange",(()=>document.hidden?this._e():this.Me())),this.me.addEventListener("contextmenu",(t=>t.preventDefault())),this.me.addEventListener("mousedown",(t=>{this.Ct["Mouse"+t.button]=1,this.St["Mouse"+t.button]=1})),this.me.addEventListener("mouseup",(t=>{this.Ct["Mouse"+t.button]=0,this.St["Mouse"+t.button]=-1})),this.me.addEventListener("mousemove",(t=>{this.Ct.MouseX=t.clientX,this.Ct.MouseY=t.clientY,this.St.MouseX=t.movementX,this.St.MouseY=t.movementY})),this.me.addEventListener("wheel",(t=>{t.preventDefault(),this.St.WheelY=t.deltaY})),this.me.addEventListener("touchstart",(t=>{t.target===this.me&&t.preventDefault(),1===t.touches.length&&(this.ve={});for(let n=0;n{t.target===this.me&&t.preventDefault();for(let n=0;n{t.target===this.me&&t.preventDefault();for(let n=0;n{for(let n=0;n{t.repeat||(this.Ct[t.code]=1,this.St[t.code]=1)})),window.addEventListener("keyup",(t=>{this.Ct[t.code]=0,this.St[t.code]=-1}))}Me(){let t=performance.now(),n=e=>{let i=(e-t)/1e3;t=e,this.ue=requestAnimationFrame(n),this.ge(i),this.pe(i),this.we(i)};requestAnimationFrame(n)}_e(){cancelAnimationFrame(this.ue),this.ue=0}ge(t){this.fe=performance.now();let n=Math.abs(this.St.MouseX)+Math.abs(this.St.MouseY);this.de.Mouse+=n,1===this.Ct.Mouse0&&(this.de.Mouse0+=n),1===this.Ct.Mouse1&&(this.de.Mouse1+=n),1===this.Ct.Mouse2&&(this.de.Mouse2+=n),1===this.Ct.Touch0&&(this.de.Touch0+=Math.abs(this.St.Touch0X)+Math.abs(this.St.Touch0Y)),1===this.Ct.Touch1&&(this.de.Touch1+=Math.abs(this.St.Touch1X)+Math.abs(this.St.Touch1Y))}pe(t){}we(t){this.he=!1,-1===this.St.Mouse0&&(this.de.Mouse0=0),-1===this.St.Mouse1&&(this.de.Mouse1=0),-1===this.St.Mouse2&&(this.de.Mouse2=0),-1===this.St.Touch0&&(this.de.Touch0=0),-1===this.St.Touch1&&(this.de.Touch1=0);for(let t in this.St)this.St[t]=0;let n=performance.now()-this.fe;Rn&&(Rn.textContent=n.toFixed(1)),In&&(In.textContent=(1e3*t).toFixed(1)),Ln&&(Ln.textContent=(1/t).toFixed())}},Gn=class extends zn{ye=document.querySelector("#background");be=this.ye.getContext("2d");Ce=document.querySelector("#foreground");Nt=this.Ce.getContext("2d");Ae=document.querySelector("#scene");Cn=this.Ae.getContext("webgl2");Audio=new AudioContext;ke=[];En={};constructor(){super(),this.Cn.enable(2929),this.Cn.enable(2884),this.Cn.blendFunc(770,771)}},On=class extends $n{m=[];$=[];W=[];l=[];vn=[];_t=[];bt=[];Te=[];rn=[];Xt=[];Ht=[];Qt=[];Mt=[];ne=[];Pt=[];yt=[];qn=[];Un=[];ae=[];Zn=[];v=[];_=[]},Kn=Float32Array.from([-.5,-.5,.5,-.5,-.5,.5,-.5,-.5,.5,-.5,.5,.5,-.5,.5,.5,-.5,.5,.5,-.5,-.5,-.5,-.5,-.5,-.5,-.5,-.5,-.5,-.5,.5,-.5,-.5,.5,-.5,-.5,.5,-.5,.5,-.5,.5,.5,-.5,.5,.5,-.5,.5,.5,.5,.5,.5,.5,.5,.5,.5,.5,.5,-.5,-.5,.5,-.5,-.5,.5,-.5,-.5,.5,.5,-.5,.5,.5,-.5,.5,.5,-.5]),Nn=Float32Array.from([-1,0,0,0,-1,0,0,0,1,-1,0,0,0,0,1,0,1,0,-1,0,0,0,-1,0,0,0,-1,-1,0,0,0,0,-1,0,1,0,0,-1,0,0,0,1,1,0,0,0,0,1,0,1,0,1,0,0,0,-1,0,0,0,-1,1,0,0,0,0,-1,0,1,0,1,0,0]),Bn=Float32Array.from([.67,.67,1,1,.67,.33,.33,.67,.67,.67,0,0,.67,1,1,.67,.33,.33,.33,1,0,.33,.33,0,.67,1,.33,.33,.33,1,.33,.67,0,.33,0,1,.67,.67,.33,.67,.33,.67,0,.67,.33,.33,0,.67]),Vn=Float32Array.from([]),Wn=Uint16Array.from([16,5,22,5,11,22,1,12,7,12,18,7,2,4,13,4,15,13,14,17,20,17,23,20,19,21,8,21,10,8,6,9,0,9,3,0]),Xn=1e-6,Yn=Math.PI/180,jn=180/Math.PI,Hn=4194305,qn=4194306,Un=[0,0,0],Jn=[0,0,0],Qn=[0,0,0],Zn=1,te=4194308,ne=[0,0,0],ee=[0,0,0],ie=4194312,oe=[[.5,.5,.5],[.5,.5,-.5],[-.5,.5,-.5],[-.5,.5,.5],[.5,-.5,.5],[.5,-.5,-.5],[-.5,-.5,-.5],[-.5,-.5,.5]],re=4194336,le=4210752,ae=131200,ce=4210816,se=[1,0,0],ue=[0,1,0],fe=[0,0,0,0],he=[0,1,0],de=[1,0,0],ve=.01,me=10,_e=[0,0],Me=[0,0,0,0],ge=[0,1,0],pe=[1,0,0],we=.1,ye=8,be=200,Ce=4194816,Ae=4198400,ke=[0,0,0],Te=4202496,xe=[0,0,0],Ee=[0,0,0,1],De=4210688,Fe=4195328,Se=[0,0,0],Pe=[0,0,0],$e=4325376,Re=-9.81,Ie=[0,0,0],Le=4325376,ze=[0,0,0],Ge=[0,0,0],Oe=4325408,Ke=[0,0,0],Ne=[0,0,0],Be=1048576,Ve=4259840,We=4456448,Xe=4718592,Ye=[0,0,0],je=[0,0,0,0],He=2097152,qe=4194560,Ue=[0,0,0],Je=12582944,Qe=new class extends Gn{o=new On;xe=function(t){return function(t,n=4){let e=l(t,"#version 300 es\n\nuniform mat4 pv;\nuniform mat4 world;\n\nlayout(location=0) in vec4 attr_position;\n\nvoid main() {\ngl_Position = pv * world * attr_position;\n}\n","#version 300 es\n\nprecision mediump float;\n\nuniform vec4 color;\n\nout vec4 frag_color;\n\nvoid main() {\nfrag_color = color;\n}\n");return{Pn:n,An:e,kn:{H:t.getUniformLocation(e,"pv"),o:t.getUniformLocation(e,"world"),Wt:t.getUniformLocation(e,"color")}}}(t,2)}(this.Cn);oe=function(t){let n=l(t,"#version 300 es\n\nuniform mat4 pv;\nuniform mat4 world;\nuniform mat4 self;\n\nlayout(location=0) in vec4 attr_position;\nlayout(location=1) in vec3 attr_normal;\n\nout vec4 vert_position;\nout vec3 vert_normal;\n\nvoid main() {\nvert_position = world * attr_position;\nvert_normal = (vec4(attr_normal, 0.0) * self).xyz;\ngl_Position = pv * vert_position;\n}\n","#version 300 es\n\nprecision mediump float;\n\nuniform vec3 eye;\nuniform vec4 diffuse_color;\nuniform vec4 specular_color;\nuniform vec4 emissive_color;\nuniform vec4 light_positions[8];\nuniform vec4 light_details[8];\n\nin vec4 vert_position;\nin vec3 vert_normal;\n\nout vec4 frag_color;\n\n\n\n\n\n\nvec3 GAMMA_DECODE(vec3 rgb) {\nreturn pow(rgb, vec3(2.2));\n}\n\n\nvec4 GAMMA_DECODE(vec4 color) {\nreturn vec4(pow(color.rgb, vec3(2.2)), color.a);\n}\n\n\n\n\n\n\nvec3 GAMMA_ENCODE(vec3 rgb) {\nreturn pow(rgb, vec3(1.0 / 2.2));\n}\n\n\nvec4 GAMMA_ENCODE(vec4 color) {\nreturn vec4(pow(color.rgb, vec3(1.0 / 2.2)), color.a);\n}\n\n\nvoid main() {\nvec3 world_normal = normalize(vert_normal);\n\nvec3 view_dir = eye - vert_position.xyz;\nvec3 view_normal = normalize(view_dir);\n\n\nvec3 light_acc = GAMMA_DECODE(diffuse_color.rgb) * 0.1;\n\nfor (int i = 0; i < 8; i++) {\nint light_kind = int(light_positions[i].w);\nif (light_kind == 0) {\nbreak;\n}\n\nvec3 light_rgb = GAMMA_DECODE(light_details[i].rgb);\nfloat light_intensity = light_details[i].a;\n\nvec3 light_normal;\nif (light_kind == 2) {\nlight_normal = light_positions[i].xyz;\n} else if (light_kind == 3) {\nvec3 light_dir = light_positions[i].xyz - vert_position.xyz;\nfloat light_dist = length(light_dir);\nlight_normal = light_dir / light_dist;\n\nlight_intensity /= (light_dist * light_dist);\n}\n\nfloat diffuse_factor = dot(world_normal, light_normal);\nif (diffuse_factor > 0.0) {\n\nlight_acc += GAMMA_DECODE(diffuse_color.rgb) * diffuse_factor * light_rgb * light_intensity;\n\nif (specular_color.a > 0.0) {\n\n\n\n\n\n\nvec3 h = normalize(light_normal + view_normal);\nfloat specular_angle = max(dot(h, world_normal), 0.0);\nfloat specular_factor = pow(specular_angle, specular_color.a);\n\n\nlight_acc += GAMMA_DECODE(specular_color.rgb) * specular_factor * light_rgb * light_intensity;\n}\n}\n}\n\nvec3 emissive_rgb = GAMMA_DECODE(emissive_color.rgb) * emissive_color.a;\nfrag_color = vec4(GAMMA_ENCODE(light_acc + emissive_rgb), diffuse_color.a);\n}\n");return{Pn:4,An:n,kn:{H:t.getUniformLocation(n,"pv"),o:t.getUniformLocation(n,"world"),et:t.getUniformLocation(n,"self"),zt:t.getUniformLocation(n,"diffuse_color"),Gt:t.getUniformLocation(n,"specular_color"),Ot:t.getUniformLocation(n,"emissive_color"),Tn:t.getUniformLocation(n,"eye"),qt:t.getUniformLocation(n,"light_positions"),Ut:t.getUniformLocation(n,"light_details")}}}(this.Cn);le=function(t){let n=l(t,"#version 300 es\n\nuniform mat4 pv;\nuniform vec4 color_start;\nuniform vec4 color_end;\n\nuniform vec4 details;\n\n\nin vec4 attr_origin_age;\nin vec3 attr_direction;\n\nout vec4 vert_color;\n\nvoid main() {\n\nvec3 velocity = attr_direction * details.y;\ngl_Position = pv * vec4(attr_origin_age.xyz + velocity * attr_origin_age.w, 1.0);\n\n\nfloat t = attr_origin_age.w / details.x;\ngl_PointSize = mix(details.z, details.w, t);\nvert_color = mix(color_start, color_end, t);\n}\n","#version 300 es\n\nprecision mediump float;\n\nin vec4 vert_color;\n\nout vec4 frag_color;\n\nvoid main() {\nfrag_color = vert_color;\n}\n");return{Pn:0,An:n,kn:{H:t.getUniformLocation(n,"pv"),Kn:t.getUniformLocation(n,"color_start"),Nn:t.getUniformLocation(n,"color_end"),Bn:t.getUniformLocation(n,"details"),Wn:t.getAttribLocation(n,"attr_origin_age"),gt:t.getAttribLocation(n,"attr_direction")}}}(this.Cn);re=function(t){let n=t.createVertexArray();t.bindVertexArray(n);let e=t.createBuffer();t.bindBuffer(en,e),t.bufferData(en,Kn,tn),t.enableVertexAttribArray(0),t.vertexAttribPointer(0,3,Pn,!1,0,0);let i=t.createBuffer();t.bindBuffer(en,i),t.bufferData(en,Nn,tn),t.enableVertexAttribArray(1),t.vertexAttribPointer(1,3,Pn,!1,0,0);let o=t.createBuffer();t.bindBuffer(en,o),t.bufferData(en,Bn,tn),t.enableVertexAttribArray(2),t.vertexAttribPointer(2,2,Pn,!1,0,0);let r=t.createBuffer();t.bindBuffer(en,r),t.bufferData(en,Vn,tn),t.enableVertexAttribArray(5),t.vertexAttribPointer(5,4,Pn,!1,0,0);let l=t.createBuffer();return t.bindBuffer(34963,l),t.bufferData(34963,Wn,tn),t.bindVertexArray(null),{Sn:n,On:e,Ee:Kn,De:i,Fe:Nn,Se:o,Pe:Bn,$e:r,Re:Vn,Ie:l,Le:Wn,$n:Wn.length}}(this.Cn);qt=new Float32Array(32);Ut=new Float32Array(32);u=0;h=0;pe(n){!function(n,e){let i=[];for(let t=0;t1)continue;t.Nt.setTransform(1,0,0,1,.5*(e[0]+1)*t.Y,.5*(1-e[1])*t.j);let o=t.o.Te[n];switch(o.L){case 0:tt(t,o);break;case 3:nt(t,o)}}}(this),function(t,n){let e=function(t){return Et`
${Et`
GoodLuck (opt)
+GoodLuck (opt)