From 0bcb2ff9f4815378e04325ed6c5723e5b93b2a19 Mon Sep 17 00:00:00 2001 From: Brian Beck Date: Fri, 5 Dec 2025 15:58:28 -0800 Subject: [PATCH] build --- docs/404.html | 2 +- docs/404/index.html | 2 +- .../_buildManifest.js | 0 .../_clientMiddlewareManifest.json | 0 .../_ssgManifest.js | 0 .../chunks/{618f302c73bc6a21.js => 98d29aec52be59c3.js} | 2 +- docs/_next/static/chunks/bd1dcee0b953cac2.js | 1 + docs/_next/static/chunks/dac67b4b788a5958.js | 1 - docs/index.html | 2 +- docs/index.txt | 4 ++-- 10 files changed, 7 insertions(+), 7 deletions(-) rename docs/_next/static/{LT1qVc5jR2WYUbO3-wDuw => 70hpG-x4f3KKfn_e3s67S}/_buildManifest.js (100%) rename docs/_next/static/{LT1qVc5jR2WYUbO3-wDuw => 70hpG-x4f3KKfn_e3s67S}/_clientMiddlewareManifest.json (100%) rename docs/_next/static/{LT1qVc5jR2WYUbO3-wDuw => 70hpG-x4f3KKfn_e3s67S}/_ssgManifest.js (100%) rename docs/_next/static/chunks/{618f302c73bc6a21.js => 98d29aec52be59c3.js} (99%) create mode 100644 docs/_next/static/chunks/bd1dcee0b953cac2.js delete mode 100644 docs/_next/static/chunks/dac67b4b788a5958.js diff --git a/docs/404.html b/docs/404.html index 2be1ea26..f425bf56 100644 --- a/docs/404.html +++ b/docs/404.html @@ -1 +1 @@ -404: This page could not be found.MapGenius – Explore maps for Tribes 2

404

This page could not be found.

\ No newline at end of file +404: This page could not be found.MapGenius – Explore maps for Tribes 2

404

This page could not be found.

\ No newline at end of file diff --git a/docs/404/index.html b/docs/404/index.html index 2be1ea26..f425bf56 100644 --- a/docs/404/index.html +++ b/docs/404/index.html @@ -1 +1 @@ -404: This page could not be found.MapGenius – Explore maps for Tribes 2

404

This page could not be found.

\ No newline at end of file +404: This page could not be found.MapGenius – Explore maps for Tribes 2

404

This page could not be found.

\ No newline at end of file diff --git a/docs/_next/static/LT1qVc5jR2WYUbO3-wDuw/_buildManifest.js b/docs/_next/static/70hpG-x4f3KKfn_e3s67S/_buildManifest.js similarity index 100% rename from docs/_next/static/LT1qVc5jR2WYUbO3-wDuw/_buildManifest.js rename to docs/_next/static/70hpG-x4f3KKfn_e3s67S/_buildManifest.js diff --git a/docs/_next/static/LT1qVc5jR2WYUbO3-wDuw/_clientMiddlewareManifest.json b/docs/_next/static/70hpG-x4f3KKfn_e3s67S/_clientMiddlewareManifest.json similarity index 100% rename from docs/_next/static/LT1qVc5jR2WYUbO3-wDuw/_clientMiddlewareManifest.json rename to docs/_next/static/70hpG-x4f3KKfn_e3s67S/_clientMiddlewareManifest.json diff --git a/docs/_next/static/LT1qVc5jR2WYUbO3-wDuw/_ssgManifest.js b/docs/_next/static/70hpG-x4f3KKfn_e3s67S/_ssgManifest.js similarity index 100% rename from docs/_next/static/LT1qVc5jR2WYUbO3-wDuw/_ssgManifest.js rename to docs/_next/static/70hpG-x4f3KKfn_e3s67S/_ssgManifest.js diff --git a/docs/_next/static/chunks/618f302c73bc6a21.js b/docs/_next/static/chunks/98d29aec52be59c3.js similarity index 99% rename from docs/_next/static/chunks/618f302c73bc6a21.js rename to docs/_next/static/chunks/98d29aec52be59c3.js index 8dcf34be..edbe73aa 100644 --- a/docs/_next/static/chunks/618f302c73bc6a21.js +++ b/docs/_next/static/chunks/98d29aec52be59c3.js @@ -1 +1 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,6112,51475,77482,e=>{"use strict";e.s(["useDatablock",()=>u],6112),e.s(["RuntimeProvider",()=>s,"useRuntime",()=>c],77482);var t=e.i(43476),r=e.i(71645);e.s(["TickProvider",()=>o,"useTick",()=>a],51475);var n=e.i(5230);let i=(0,r.createContext)(null);function o(e){let{children:o}=e,a=(0,r.useRef)(void 0),l=(0,r.useRef)(0),s=(0,r.useRef)(0);(0,n.useFrame)((e,t)=>{for(l.current+=t;l.current>=.03125;)if(l.current-=.03125,s.current++,a.current)for(let e of a.current)e(s.current)});let c=(0,r.useCallback)(e=>(null!=a.current||(a.current=new Set),a.current.add(e),()=>{a.current.delete(e)}),[]),u=(0,r.useCallback)(()=>s.current,[]),d=(0,r.useMemo)(()=>({subscribe:c,getTick:u}),[c,u]);return(0,t.jsx)(i.Provider,{value:d,children:o})}function a(e){let t=(0,r.useContext)(i);if(!t)throw Error("useTick must be used within a TickProvider");let n=(0,r.useRef)(e);n.current=e,(0,r.useEffect)(()=>t.subscribe(e=>n.current(e)),[t])}let l=(0,r.createContext)(null);function s(e){let{runtime:r,children:n}=e;return(0,t.jsx)(l.Provider,{value:r,children:(0,t.jsx)(o,{children:n})})}function c(){let e=(0,r.useContext)(l);if(!e)throw Error("useRuntime must be used within a RuntimeProvider");return e}function u(e){let t=c();if(e)return t.state.datablocks.get(e)}},47071,80520,e=>{"use strict";e.s(["useTexture",()=>a],47071);var t=e.i(71645),r=e.i(90072),n=e.i(16096);e.s(["useLoader",()=>i.G],80520);var i=e.i(46712),i=i;let o=e=>e===Object(e)&&!Array.isArray(e)&&"function"!=typeof e;function a(e,a){let l=(0,n.useThree)(e=>e.gl),s=(0,i.G)(r.TextureLoader,o(e)?Object.values(e):e);return(0,t.useLayoutEffect)(()=>{null==a||a(s)},[a]),(0,t.useEffect)(()=>{if("initTexture"in l){let e=[];Array.isArray(s)?e=s:s instanceof r.Texture?e=[s]:o(s)&&(e=Object.values(s)),e.forEach(e=>{e instanceof r.Texture&&l.initTexture(e)})}},[l,s]),(0,t.useMemo)(()=>{if(!o(e))return s;{let t={},r=0;for(let n in e)t[n]=s[r++];return t}},[e,s])}a.preload=e=>i.G.preload(r.TextureLoader,e),a.clear=e=>i.G.clear(r.TextureLoader,e)},75567,e=>{"use strict";e.s(["setupColor",()=>r,"setupMask",()=>n]);var t=e.i(90072);function r(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[1,1];return e.wrapS=e.wrapT=t.RepeatWrapping,e.colorSpace=t.SRGBColorSpace,e.repeat.set(...r),e.flipY=!1,e.anisotropy=16,e.generateMipmaps=!0,e.minFilter=t.LinearMipmapLinearFilter,e.magFilter=t.LinearFilter,e.needsUpdate=!0,e}function n(e){let r=new t.DataTexture(e,256,256,t.RedFormat,t.UnsignedByteType);return r.colorSpace=t.NoColorSpace,r.wrapS=r.wrapT=t.RepeatWrapping,r.generateMipmaps=!1,r.minFilter=t.LinearFilter,r.magFilter=t.LinearFilter,r.needsUpdate=!0,r}},31067,e=>{"use strict";function t(){return(t=Object.assign.bind()).apply(null,arguments)}e.s(["default",()=>t])},77975,e=>{"use strict";e.s(["useDistanceFromCamera",()=>o],77975);var t=e.i(5230),r=e.i(16096),n=e.i(71645),i=e.i(90072);function o(e){let{camera:o}=(0,r.useThree)(),a=(0,n.useRef)(null),l=function(e){let r=(0,n.useRef)(null);return(0,t.useFrame)(()=>{e.current&&(null!=r.current||(r.current=new i.Vector3),e.current.getWorldPosition(r.current))}),r}(e);return(0,t.useFrame)(()=>{l.current?a.current=o.position.distanceTo(l.current):a.current=null}),a}},89887,60099,e=>{"use strict";let t,r;e.s(["FloatingLabel",()=>P],89887);var n=e.i(43476),i=e.i(71645),o=e.i(77975),a=e.i(5230);e.s(["Html",()=>M],60099);var l=e.i(31067),s=e.i(88014),c=e.i(90072),u=e.i(16096);let d=new c.Vector3,f=new c.Vector3,m=new c.Vector3,h=new c.Vector2;function p(e,t,r){let n=d.setFromMatrixPosition(e.matrixWorld);n.project(t);let i=r.width/2,o=r.height/2;return[n.x*i+i,-(n.y*o)+o]}let x=e=>1e-10>Math.abs(e)?0:e;function v(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n="matrix3d(";for(let r=0;16!==r;r++)n+=x(t[r]*e.elements[r])+(15!==r?",":")");return r+n}let y=(t=[1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1],e=>v(e,t)),g=(r=e=>[1/e,1/e,1/e,1,-1/e,-1/e,-1/e,-1,1/e,1/e,1/e,1,1,1,1,1],(e,t)=>v(e,r(t),"translate(-50%,-50%)")),M=i.forwardRef((e,t)=>{let{children:r,eps:n=.001,style:o,className:v,prepend:M,center:b,fullscreen:P,portal:w,distanceFactor:T,sprite:S=!1,transform:R=!1,occlude:E,onOcclude:F,castShadow:W,receiveShadow:C,material:j,geometry:L,zIndexRange:A=[0x1000037,0],calculatePosition:k=p,as:z="div",wrapperClass:O,pointerEvents:D="auto",...I}=e,{gl:N,camera:V,scene:G,size:H,raycaster:U,events:B,viewport:K}=(0,u.useThree)(),[_]=i.useState(()=>document.createElement(z)),Y=i.useRef(null),Z=i.useRef(null),q=i.useRef(0),J=i.useRef([0,0]),Q=i.useRef(null),X=i.useRef(null),$=(null==w?void 0:w.current)||B.connected||N.domElement.parentNode,ee=i.useRef(null),et=i.useRef(!1),er=i.useMemo(()=>E&&"blending"!==E||Array.isArray(E)&&E.length&&function(e){return e&&"object"==typeof e&&"current"in e}(E[0]),[E]);i.useLayoutEffect(()=>{let e=N.domElement;E&&"blending"===E?(e.style.zIndex="".concat(Math.floor(A[0]/2)),e.style.position="absolute",e.style.pointerEvents="none"):(e.style.zIndex=null,e.style.position=null,e.style.pointerEvents=null)},[E]),i.useLayoutEffect(()=>{if(Z.current){let e=Y.current=s.createRoot(_);if(G.updateMatrixWorld(),R)_.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{let e=k(Z.current,V,H);_.style.cssText="position:absolute;top:0;left:0;transform:translate3d(".concat(e[0],"px,").concat(e[1],"px,0);transform-origin:0 0;")}return $&&(M?$.prepend(_):$.appendChild(_)),()=>{$&&$.removeChild(_),e.unmount()}}},[$,R]),i.useLayoutEffect(()=>{O&&(_.className=O)},[O]);let en=i.useMemo(()=>R?{position:"absolute",top:0,left:0,width:H.width,height:H.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:b?"translate3d(-50%,-50%,0)":"none",...P&&{top:-H.height/2,left:-H.width/2,width:H.width,height:H.height},...o},[o,b,P,H,R]),ei=i.useMemo(()=>({position:"absolute",pointerEvents:D}),[D]);i.useLayoutEffect(()=>{var e,n;et.current=!1,R?null==(e=Y.current)||e.render(i.createElement("div",{ref:Q,style:en},i.createElement("div",{ref:X,style:ei},i.createElement("div",{ref:t,className:v,style:o,children:r})))):null==(n=Y.current)||n.render(i.createElement("div",{ref:t,style:en,className:v,children:r}))});let eo=i.useRef(!0);(0,a.useFrame)(e=>{if(Z.current){V.updateMatrixWorld(),Z.current.updateWorldMatrix(!0,!1);let e=R?J.current:k(Z.current,V,H);if(R||Math.abs(q.current-V.zoom)>n||Math.abs(J.current[0]-e[0])>n||Math.abs(J.current[1]-e[1])>n){let t=function(e,t){let r=d.setFromMatrixPosition(e.matrixWorld),n=f.setFromMatrixPosition(t.matrixWorld),i=r.sub(n),o=t.getWorldDirection(m);return i.angleTo(o)>Math.PI/2}(Z.current,V),r=!1;er&&(Array.isArray(E)?r=E.map(e=>e.current):"blending"!==E&&(r=[G]));let n=eo.current;r?eo.current=function(e,t,r,n){let i=d.setFromMatrixPosition(e.matrixWorld),o=i.clone();o.project(t),h.set(o.x,o.y),r.setFromCamera(h,t);let a=r.intersectObjects(n,!0);if(a.length){let e=a[0].distance;return i.distanceTo(r.ray.origin)({vertexShader:R?void 0:'\n /*\n This shader is from the THREE\'s SpriteMaterial.\n We need to turn the backing plane into a Sprite\n (make it always face the camera) if "transfrom"\n is false.\n */\n #include \n\n void main() {\n vec2 center = vec2(0., 1.);\n float rotation = 0.0;\n\n // This is somewhat arbitrary, but it seems to work well\n // Need to figure out how to derive this dynamically if it even matters\n float size = 0.03;\n\n vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n vec2 scale;\n scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\n bool isPerspective = isPerspectiveMatrix( projectionMatrix );\n if ( isPerspective ) scale *= - mvPosition.z;\n\n vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale * size;\n vec2 rotatedPosition;\n rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n mvPosition.xy += rotatedPosition;\n\n gl_Position = projectionMatrix * mvPosition;\n }\n ',fragmentShader:"\n void main() {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\n }\n "}),[R]);return i.createElement("group",(0,l.default)({},I,{ref:Z}),E&&!er&&i.createElement("mesh",{castShadow:W,receiveShadow:C,ref:ee},L||i.createElement("planeGeometry",null),j||i.createElement("shaderMaterial",{side:c.DoubleSide,vertexShader:ea.vertexShader,fragmentShader:ea.fragmentShader})))}),b=[0,0,0],P=(0,i.memo)(function(e){let{children:t,color:r="white",position:l=b,opacity:s="fadeWithDistance"}=e,c="fadeWithDistance"===s,u=(0,i.useRef)(null),d=(0,o.useDistanceFromCamera)(u),[f,m]=(0,i.useState)(0!==s),h=(0,i.useRef)(null);return(0,i.useEffect)(()=>{if(c&&h.current&&null!=d.current){let e=Math.max(0,Math.min(1,1-d.current/200));h.current.style.opacity=e.toString()}},[f,c]),(0,a.useFrame)(()=>{if(c){let e=d.current,t=null!=e&&e<200;if(f!==t&&m(t),h.current&&t){let t=Math.max(0,Math.min(1,1-e/200));h.current.style.opacity=t.toString()}}else m(0!==s),h.current&&(h.current.style.opacity=s.toString())}),(0,n.jsx)("group",{ref:u,children:f?(0,n.jsx)(M,{position:l,center:!0,children:(0,n.jsx)("div",{ref:h,className:"StaticShapeLabel",style:{color:r},children:t})}):null})})},51434,e=>{"use strict";e.s(["AudioProvider",()=>a,"useAudio",()=>l]);var t=e.i(43476),r=e.i(71645),n=e.i(16096),i=e.i(90072);let o=(0,r.createContext)(void 0);function a(e){let{children:a}=e,{camera:l}=(0,n.useThree)(),[s,c]=(0,r.useState)({audioLoader:null,audioListener:null});return(0,r.useEffect)(()=>{let e=new i.AudioLoader,t=l.children.find(e=>e instanceof i.AudioListener);t||(t=new i.AudioListener,l.add(t)),c({audioLoader:e,audioListener:t})},[l]),(0,t.jsx)(o.Provider,{value:s,children:a})}function l(){let e=(0,r.useContext)(o);if(void 0===e)throw Error("useAudio must be used within AudioProvider");return e}},61921,e=>{e.v(t=>Promise.all(["static/chunks/5342f4b5b8c465ca.js"].map(t=>e.l(t))).then(()=>t(29055)))},25147,e=>{e.v(t=>Promise.all(["static/chunks/6a22d5a06cf91e1e.js"].map(t=>e.l(t))).then(()=>t(63724)))},18599,e=>{e.v(t=>Promise.all(["static/chunks/dac67b4b788a5958.js"].map(t=>e.l(t))).then(()=>t(42585)))}]); \ No newline at end of file +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,6112,51475,77482,e=>{"use strict";e.s(["useDatablock",()=>u],6112),e.s(["RuntimeProvider",()=>s,"useRuntime",()=>c],77482);var t=e.i(43476),r=e.i(71645);e.s(["TickProvider",()=>o,"useTick",()=>a],51475);var n=e.i(5230);let i=(0,r.createContext)(null);function o(e){let{children:o}=e,a=(0,r.useRef)(void 0),l=(0,r.useRef)(0),s=(0,r.useRef)(0);(0,n.useFrame)((e,t)=>{for(l.current+=t;l.current>=.03125;)if(l.current-=.03125,s.current++,a.current)for(let e of a.current)e(s.current)});let c=(0,r.useCallback)(e=>(null!=a.current||(a.current=new Set),a.current.add(e),()=>{a.current.delete(e)}),[]),u=(0,r.useCallback)(()=>s.current,[]),d=(0,r.useMemo)(()=>({subscribe:c,getTick:u}),[c,u]);return(0,t.jsx)(i.Provider,{value:d,children:o})}function a(e){let t=(0,r.useContext)(i);if(!t)throw Error("useTick must be used within a TickProvider");let n=(0,r.useRef)(e);n.current=e,(0,r.useEffect)(()=>t.subscribe(e=>n.current(e)),[t])}let l=(0,r.createContext)(null);function s(e){let{runtime:r,children:n}=e;return(0,t.jsx)(l.Provider,{value:r,children:(0,t.jsx)(o,{children:n})})}function c(){let e=(0,r.useContext)(l);if(!e)throw Error("useRuntime must be used within a RuntimeProvider");return e}function u(e){let t=c();if(e)return t.state.datablocks.get(e)}},47071,80520,e=>{"use strict";e.s(["useTexture",()=>a],47071);var t=e.i(71645),r=e.i(90072),n=e.i(16096);e.s(["useLoader",()=>i.G],80520);var i=e.i(46712),i=i;let o=e=>e===Object(e)&&!Array.isArray(e)&&"function"!=typeof e;function a(e,a){let l=(0,n.useThree)(e=>e.gl),s=(0,i.G)(r.TextureLoader,o(e)?Object.values(e):e);return(0,t.useLayoutEffect)(()=>{null==a||a(s)},[a]),(0,t.useEffect)(()=>{if("initTexture"in l){let e=[];Array.isArray(s)?e=s:s instanceof r.Texture?e=[s]:o(s)&&(e=Object.values(s)),e.forEach(e=>{e instanceof r.Texture&&l.initTexture(e)})}},[l,s]),(0,t.useMemo)(()=>{if(!o(e))return s;{let t={},r=0;for(let n in e)t[n]=s[r++];return t}},[e,s])}a.preload=e=>i.G.preload(r.TextureLoader,e),a.clear=e=>i.G.clear(r.TextureLoader,e)},75567,e=>{"use strict";e.s(["setupColor",()=>r,"setupMask",()=>n]);var t=e.i(90072);function r(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[1,1];return e.wrapS=e.wrapT=t.RepeatWrapping,e.colorSpace=t.SRGBColorSpace,e.repeat.set(...r),e.flipY=!1,e.anisotropy=16,e.generateMipmaps=!0,e.minFilter=t.LinearMipmapLinearFilter,e.magFilter=t.LinearFilter,e.needsUpdate=!0,e}function n(e){let r=new t.DataTexture(e,256,256,t.RedFormat,t.UnsignedByteType);return r.colorSpace=t.NoColorSpace,r.wrapS=r.wrapT=t.RepeatWrapping,r.generateMipmaps=!1,r.minFilter=t.LinearFilter,r.magFilter=t.LinearFilter,r.needsUpdate=!0,r}},31067,e=>{"use strict";function t(){return(t=Object.assign.bind()).apply(null,arguments)}e.s(["default",()=>t])},77975,e=>{"use strict";e.s(["useDistanceFromCamera",()=>o],77975);var t=e.i(5230),r=e.i(16096),n=e.i(71645),i=e.i(90072);function o(e){let{camera:o}=(0,r.useThree)(),a=(0,n.useRef)(null),l=function(e){let r=(0,n.useRef)(null);return(0,t.useFrame)(()=>{e.current&&(null!=r.current||(r.current=new i.Vector3),e.current.getWorldPosition(r.current))}),r}(e);return(0,t.useFrame)(()=>{l.current?a.current=o.position.distanceTo(l.current):a.current=null}),a}},89887,60099,e=>{"use strict";let t,r;e.s(["FloatingLabel",()=>P],89887);var n=e.i(43476),i=e.i(71645),o=e.i(77975),a=e.i(5230);e.s(["Html",()=>M],60099);var l=e.i(31067),s=e.i(88014),c=e.i(90072),u=e.i(16096);let d=new c.Vector3,f=new c.Vector3,m=new c.Vector3,h=new c.Vector2;function p(e,t,r){let n=d.setFromMatrixPosition(e.matrixWorld);n.project(t);let i=r.width/2,o=r.height/2;return[n.x*i+i,-(n.y*o)+o]}let x=e=>1e-10>Math.abs(e)?0:e;function v(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n="matrix3d(";for(let r=0;16!==r;r++)n+=x(t[r]*e.elements[r])+(15!==r?",":")");return r+n}let y=(t=[1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1],e=>v(e,t)),g=(r=e=>[1/e,1/e,1/e,1,-1/e,-1/e,-1/e,-1,1/e,1/e,1/e,1,1,1,1,1],(e,t)=>v(e,r(t),"translate(-50%,-50%)")),M=i.forwardRef((e,t)=>{let{children:r,eps:n=.001,style:o,className:v,prepend:M,center:b,fullscreen:P,portal:w,distanceFactor:T,sprite:S=!1,transform:R=!1,occlude:E,onOcclude:F,castShadow:W,receiveShadow:C,material:j,geometry:L,zIndexRange:A=[0x1000037,0],calculatePosition:k=p,as:z="div",wrapperClass:O,pointerEvents:D="auto",...I}=e,{gl:N,camera:V,scene:G,size:H,raycaster:U,events:B,viewport:K}=(0,u.useThree)(),[_]=i.useState(()=>document.createElement(z)),Y=i.useRef(null),Z=i.useRef(null),q=i.useRef(0),J=i.useRef([0,0]),Q=i.useRef(null),X=i.useRef(null),$=(null==w?void 0:w.current)||B.connected||N.domElement.parentNode,ee=i.useRef(null),et=i.useRef(!1),er=i.useMemo(()=>E&&"blending"!==E||Array.isArray(E)&&E.length&&function(e){return e&&"object"==typeof e&&"current"in e}(E[0]),[E]);i.useLayoutEffect(()=>{let e=N.domElement;E&&"blending"===E?(e.style.zIndex="".concat(Math.floor(A[0]/2)),e.style.position="absolute",e.style.pointerEvents="none"):(e.style.zIndex=null,e.style.position=null,e.style.pointerEvents=null)},[E]),i.useLayoutEffect(()=>{if(Z.current){let e=Y.current=s.createRoot(_);if(G.updateMatrixWorld(),R)_.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{let e=k(Z.current,V,H);_.style.cssText="position:absolute;top:0;left:0;transform:translate3d(".concat(e[0],"px,").concat(e[1],"px,0);transform-origin:0 0;")}return $&&(M?$.prepend(_):$.appendChild(_)),()=>{$&&$.removeChild(_),e.unmount()}}},[$,R]),i.useLayoutEffect(()=>{O&&(_.className=O)},[O]);let en=i.useMemo(()=>R?{position:"absolute",top:0,left:0,width:H.width,height:H.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:b?"translate3d(-50%,-50%,0)":"none",...P&&{top:-H.height/2,left:-H.width/2,width:H.width,height:H.height},...o},[o,b,P,H,R]),ei=i.useMemo(()=>({position:"absolute",pointerEvents:D}),[D]);i.useLayoutEffect(()=>{var e,n;et.current=!1,R?null==(e=Y.current)||e.render(i.createElement("div",{ref:Q,style:en},i.createElement("div",{ref:X,style:ei},i.createElement("div",{ref:t,className:v,style:o,children:r})))):null==(n=Y.current)||n.render(i.createElement("div",{ref:t,style:en,className:v,children:r}))});let eo=i.useRef(!0);(0,a.useFrame)(e=>{if(Z.current){V.updateMatrixWorld(),Z.current.updateWorldMatrix(!0,!1);let e=R?J.current:k(Z.current,V,H);if(R||Math.abs(q.current-V.zoom)>n||Math.abs(J.current[0]-e[0])>n||Math.abs(J.current[1]-e[1])>n){let t=function(e,t){let r=d.setFromMatrixPosition(e.matrixWorld),n=f.setFromMatrixPosition(t.matrixWorld),i=r.sub(n),o=t.getWorldDirection(m);return i.angleTo(o)>Math.PI/2}(Z.current,V),r=!1;er&&(Array.isArray(E)?r=E.map(e=>e.current):"blending"!==E&&(r=[G]));let n=eo.current;r?eo.current=function(e,t,r,n){let i=d.setFromMatrixPosition(e.matrixWorld),o=i.clone();o.project(t),h.set(o.x,o.y),r.setFromCamera(h,t);let a=r.intersectObjects(n,!0);if(a.length){let e=a[0].distance;return i.distanceTo(r.ray.origin)({vertexShader:R?void 0:'\n /*\n This shader is from the THREE\'s SpriteMaterial.\n We need to turn the backing plane into a Sprite\n (make it always face the camera) if "transfrom"\n is false.\n */\n #include \n\n void main() {\n vec2 center = vec2(0., 1.);\n float rotation = 0.0;\n\n // This is somewhat arbitrary, but it seems to work well\n // Need to figure out how to derive this dynamically if it even matters\n float size = 0.03;\n\n vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n vec2 scale;\n scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\n bool isPerspective = isPerspectiveMatrix( projectionMatrix );\n if ( isPerspective ) scale *= - mvPosition.z;\n\n vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale * size;\n vec2 rotatedPosition;\n rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n mvPosition.xy += rotatedPosition;\n\n gl_Position = projectionMatrix * mvPosition;\n }\n ',fragmentShader:"\n void main() {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\n }\n "}),[R]);return i.createElement("group",(0,l.default)({},I,{ref:Z}),E&&!er&&i.createElement("mesh",{castShadow:W,receiveShadow:C,ref:ee},L||i.createElement("planeGeometry",null),j||i.createElement("shaderMaterial",{side:c.DoubleSide,vertexShader:ea.vertexShader,fragmentShader:ea.fragmentShader})))}),b=[0,0,0],P=(0,i.memo)(function(e){let{children:t,color:r="white",position:l=b,opacity:s="fadeWithDistance"}=e,c="fadeWithDistance"===s,u=(0,i.useRef)(null),d=(0,o.useDistanceFromCamera)(u),[f,m]=(0,i.useState)(0!==s),h=(0,i.useRef)(null);return(0,i.useEffect)(()=>{if(c&&h.current&&null!=d.current){let e=Math.max(0,Math.min(1,1-d.current/200));h.current.style.opacity=e.toString()}},[f,c]),(0,a.useFrame)(()=>{if(c){let e=d.current,t=null!=e&&e<200;if(f!==t&&m(t),h.current&&t){let t=Math.max(0,Math.min(1,1-e/200));h.current.style.opacity=t.toString()}}else m(0!==s),h.current&&(h.current.style.opacity=s.toString())}),(0,n.jsx)("group",{ref:u,children:f?(0,n.jsx)(M,{position:l,center:!0,children:(0,n.jsx)("div",{ref:h,className:"StaticShapeLabel",style:{color:r},children:t})}):null})})},51434,e=>{"use strict";e.s(["AudioProvider",()=>a,"useAudio",()=>l]);var t=e.i(43476),r=e.i(71645),n=e.i(16096),i=e.i(90072);let o=(0,r.createContext)(void 0);function a(e){let{children:a}=e,{camera:l}=(0,n.useThree)(),[s,c]=(0,r.useState)({audioLoader:null,audioListener:null});return(0,r.useEffect)(()=>{let e=new i.AudioLoader,t=l.children.find(e=>e instanceof i.AudioListener);t||(t=new i.AudioListener,l.add(t)),c({audioLoader:e,audioListener:t})},[l]),(0,t.jsx)(o.Provider,{value:s,children:a})}function l(){let e=(0,r.useContext)(o);if(void 0===e)throw Error("useAudio must be used within AudioProvider");return e}},61921,e=>{e.v(t=>Promise.all(["static/chunks/5342f4b5b8c465ca.js"].map(t=>e.l(t))).then(()=>t(29055)))},25147,e=>{e.v(t=>Promise.all(["static/chunks/6a22d5a06cf91e1e.js"].map(t=>e.l(t))).then(()=>t(63724)))},18599,e=>{e.v(t=>Promise.all(["static/chunks/bd1dcee0b953cac2.js"].map(t=>e.l(t))).then(()=>t(42585)))}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/bd1dcee0b953cac2.js b/docs/_next/static/chunks/bd1dcee0b953cac2.js new file mode 100644 index 00000000..2f012e15 --- /dev/null +++ b/docs/_next/static/chunks/bd1dcee0b953cac2.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,42585,e=>{"use strict";e.s(["WaterBlock",()=>p,"WaterMaterial",()=>v,"WaterSurfaceMaterial",()=>c],42585);var n=e.i(43476),a=e.i(71645),t=e.i(47071),i=e.i(5230),r=e.i(90072),o=e.i(12979),l=e.i(62395),s=e.i(75567),u=e.i(79123);function c(e){let{surfaceTexture:l,envMapTexture:c,opacity:v=.75,waveMagnitude:p=1,envMapIntensity:d=1,attach:f}=e,m=(0,o.textureToUrl)(l),g=(0,o.textureToUrl)(null!=c?c:"special/lush_env"),[h,T]=(0,t.useTexture)([m,g],e=>{(Array.isArray(e)?e:[e]).forEach(e=>{(0,s.setupColor)(e),e.wrapS=r.RepeatWrapping,e.wrapT=r.RepeatWrapping})}),{animationEnabled:x}=(0,u.useSettings)(),b=(0,a.useMemo)(()=>{var e,n,a,t,i,o;return e={opacity:v,waveMagnitude:p,envMapIntensity:d,baseTexture:h,envMapTexture:T},new r.ShaderMaterial({uniforms:{uTime:{value:0},uOpacity:{value:null!=(n=null==e?void 0:e.opacity)?n:.75},uWaveMagnitude:{value:null!=(a=null==e?void 0:e.waveMagnitude)?a:1},uEnvMapIntensity:{value:null!=(t=null==e?void 0:e.envMapIntensity)?t:1},uBaseTexture:{value:null!=(i=null==e?void 0:e.baseTexture)?i:null},uEnvMapTexture:{value:null!=(o=null==e?void 0:e.envMapTexture)?o:null},fogColor:{value:new r.Color},fogNear:{value:1},fogFar:{value:2e3}},vertexShader:"\n #include \n\n uniform float uTime;\n uniform float uWaveMagnitude;\n\n varying vec3 vWorldPosition;\n varying vec3 vViewVector;\n varying float vDistance;\n\n // Wave function matching Tribes 2 engine\n // Z = surfaceZ + (sin(X*0.05 + time) + sin(Y*0.05 + time)) * waveFactor\n // waveFactor = waveAmplitude * 0.25\n // Note: Using xz for Three.js Y-up (Torque uses XY with Z-up)\n float getWaveHeight(vec3 worldPos) {\n float waveFactor = uWaveMagnitude * 0.25;\n return (sin(worldPos.x * 0.05 + uTime) + sin(worldPos.z * 0.05 + uTime)) * waveFactor;\n }\n\n void main() {\n // Get world position for wave calculation\n vec4 worldPos = modelMatrix * vec4(position, 1.0);\n vWorldPosition = worldPos.xyz;\n\n // Apply wave displacement to Y (vertical axis in Three.js)\n vec3 displaced = position;\n displaced.y += getWaveHeight(worldPos.xyz);\n\n // Calculate view vector for environment mapping\n vViewVector = cameraPosition - worldPos.xyz;\n vDistance = length(vViewVector);\n\n vec4 mvPosition = viewMatrix * modelMatrix * vec4(displaced, 1.0);\n gl_Position = projectionMatrix * mvPosition;\n\n #include \n }\n",fragmentShader:"\n #include \n\n uniform float uTime;\n uniform float uOpacity;\n uniform float uEnvMapIntensity;\n uniform sampler2D uBaseTexture;\n uniform sampler2D uEnvMapTexture;\n\n varying vec3 vWorldPosition;\n varying vec3 vViewVector;\n varying float vDistance;\n\n #define TWO_PI 6.283185307179586\n\n // Constants from Tribes 2 engine\n #define BASE_DRIFT_CYCLE_TIME 8.0\n #define BASE_DRIFT_RATE 0.02\n #define BASE_DRIFT_SCALAR 0.03\n #define TEXTURE_SCALE (1.0 / 48.0)\n\n // Environment map UV wobble constants\n #define Q1 150.0\n #define Q2 2.0\n #define Q3 0.01\n\n // Rotate UV coordinates\n vec2 rotateUV(vec2 uv, float angle) {\n float c = cos(angle);\n float s = sin(angle);\n return vec2(\n uv.x * c - uv.y * s,\n uv.x * s + uv.y * c\n );\n }\n\n void main() {\n // Calculate base texture UVs using world position (1/48 tiling)\n // Note: In Three.js Y-up coordinates, the water surface is on the XZ plane\n // Torque uses Z-up where the surface is XY, so we use xz here\n vec2 baseUV = vWorldPosition.xz * TEXTURE_SCALE;\n\n // Phase (time in radians for drift cycle)\n float phase = mod(uTime * (TWO_PI / BASE_DRIFT_CYCLE_TIME), TWO_PI);\n\n // Base texture drift\n float baseDriftX = uTime * BASE_DRIFT_RATE;\n float baseDriftY = cos(phase) * BASE_DRIFT_SCALAR;\n\n // === Phase 1a: First base texture pass (rotated 30 degrees) ===\n vec2 uv1a = rotateUV(baseUV, radians(30.0));\n\n // === Phase 1b: Second base texture pass (rotated 60 degrees total, with drift) ===\n // OpenGL matrix order: glRotatef(60) then glTranslatef(drift) means\n // the transform is R60 * T, so when applied to UV: R60 * (UV + drift)\n // Translation is applied first, then rotation.\n vec2 uv1b = rotateUV(baseUV + vec2(baseDriftX, baseDriftY), radians(60.0));\n\n // Calculate cross-fade swing value\n // From engine: A1 = cos((X/Q1 + time/Q2) * 6.0), A2 = sin((Y/Q1 + time/Q2) * 6.28)\n // Using xz for Three.js Y-up coordinate system\n float A1 = cos(((vWorldPosition.x / Q1) + (uTime / Q2)) * 6.0);\n float A2 = sin(((vWorldPosition.z / Q1) + (uTime / Q2)) * TWO_PI);\n float swing = (A1 + A2) * 0.15 + 0.5;\n\n // Cross-fade alpha calculation from engine\n // alpha1a = ((1-swing) * opacity) / (1 - (swing * opacity))\n // alpha1b = swing * opacity\n float alpha1a = ((1.0 - swing) * uOpacity) / max(1.0 - (swing * uOpacity), 0.001);\n float alpha1b = swing * uOpacity;\n\n // Sample base texture for both passes\n vec4 texColor1a = texture2D(uBaseTexture, uv1a);\n vec4 texColor1b = texture2D(uBaseTexture, uv1b);\n\n // Simulate multi-pass alpha accumulation (screen blend formula)\n // Pass 1a: framebuffer = tex1a * alpha1a + bg * (1 - alpha1a)\n // Pass 1b: framebuffer = tex1b * alpha1b + prev * (1 - alpha1b)\n // Combined alpha = 1 - (1 - alpha1a) * (1 - alpha1b)\n float combinedAlpha = 1.0 - (1.0 - alpha1a) * (1.0 - alpha1b);\n\n // Combined color (premultiplied then divided by combined alpha)\n // color = tex1b * alpha1b + tex1a * alpha1a * (1 - alpha1b)\n vec3 baseColor = (texColor1a.rgb * alpha1a * (1.0 - alpha1b) + texColor1b.rgb * alpha1b) / max(combinedAlpha, 0.001);\n\n // === Phase 3: Environment map / specular ===\n // Reflection UV calculation from engine (fluidQuadTree.cc lines 910-962)\n // Engine uses eye-to-point vector (point - eye), unnormalized.\n // vViewVector is camera - worldPos (point-to-eye), so we negate it.\n // Torque Z-up maps XY to UV; Three.js Y-up maps XZ to UV.\n vec3 reflectVec = -vViewVector;\n reflectVec.y = abs(reflectVec.y); // Y is vertical in Three.js (was Z in Torque)\n if (reflectVec.y < 0.001) reflectVec.y = 0.001;\n\n vec2 envUV;\n if (vDistance < 0.001) {\n envUV = vec2(0.0);\n } else {\n // Standard UV reflection mapping with adjustment to reduce edge emphasis\n float value = (vDistance - reflectVec.y) / (vDistance * vDistance);\n envUV.x = reflectVec.x * value;\n envUV.y = reflectVec.z * value; // Z maps to V in Three.js Y-up\n }\n\n // Convert from [-1,1] to [0,1]\n envUV = envUV * 0.5 + 0.5;\n\n // Add time-based wobble to environment map\n envUV.x += A1 * Q3;\n envUV.y += A2 * Q3;\n\n vec4 envColor = texture2D(uEnvMapTexture, envUV);\n\n // Blend environment map additively (GL_SRC_ALPHA, GL_ONE in original engine)\n // Engine uses GL_MODULATE with color (1,1,1,envMapIntensity), so texture alpha\n // is multiplied with intensity before additive blend.\n vec3 finalColor = baseColor + envColor.rgb * envColor.a * uEnvMapIntensity;\n\n gl_FragColor = vec4(finalColor, combinedAlpha);\n\n // Apply scene fog (integrated with Three.js fog system)\n #include \n }\n",transparent:!0,side:r.DoubleSide,depthWrite:!0,fog:!0})},[v,p,d,h,T]),y=(0,a.useRef)(0);return(0,i.useFrame)((e,n)=>{if(!x){y.current=0,b.uniforms.uTime.value=0;return}y.current+=n,b.uniforms.uTime.value=y.current}),(0,a.useEffect)(()=>()=>{b.dispose()},[b]),(0,n.jsx)("primitive",{object:b,attach:f})}function v(e){let{surfaceTexture:a,attach:i}=e,l=(0,o.textureToUrl)(a),u=(0,t.useTexture)(l,e=>(0,s.setupColor)(e));return(0,n.jsx)("meshStandardMaterial",{attach:i,map:u,transparent:!0,opacity:.8,side:r.DoubleSide})}let p=(0,a.memo)(function(e){var t,i,o,s;let{object:u}=e,v=(0,a.useMemo)(()=>(0,l.getPosition)(u),[u]),p=(0,a.useMemo)(()=>(0,l.getRotation)(u),[u]),[d,f,m]=(0,a.useMemo)(()=>(0,l.getScale)(u),[u]),g=null!=(t=(0,l.getProperty)(u,"surfaceTexture"))?t:"liquidTiles/BlueWater",h=(0,l.getProperty)(u,"envMapTexture"),T=parseFloat(null!=(i=(0,l.getProperty)(u,"surfaceOpacity"))?i:"0.75"),x=parseFloat(null!=(o=(0,l.getProperty)(u,"waveMagnitude"))?o:"1.0"),b=parseFloat(null!=(s=(0,l.getProperty)(u,"envMapIntensity"))?s:"1.0"),y=(0,a.useMemo)(()=>{let[e,n]=function(e,n){let a=e<=1024&&n<=1024?8:16;return[Math.max(4,Math.ceil(e/a)),Math.max(4,Math.ceil(n/a))]}(d,m),a=new r.PlaneGeometry(d,m,e,n);return a.rotateX(-Math.PI/2),a.translate(d/2,f,m/2),a},[d,f,m]);return(0,a.useEffect)(()=>()=>{y.dispose()},[y]),(0,n.jsx)("group",{position:v,quaternion:p,children:(0,n.jsx)("mesh",{geometry:y,children:(0,n.jsx)(a.Suspense,{fallback:(0,n.jsx)("meshStandardMaterial",{color:"blue",transparent:!0,opacity:.3,side:r.DoubleSide}),children:(0,n.jsx)(c,{attach:"material",surfaceTexture:g,envMapTexture:h,opacity:T,waveMagnitude:x,envMapIntensity:b})})})})})}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/dac67b4b788a5958.js b/docs/_next/static/chunks/dac67b4b788a5958.js deleted file mode 100644 index fa44be60..00000000 --- a/docs/_next/static/chunks/dac67b4b788a5958.js +++ /dev/null @@ -1 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,42585,e=>{"use strict";e.s(["WaterBlock",()=>p,"WaterMaterial",()=>v,"WaterSurfaceMaterial",()=>c],42585);var n=e.i(43476),a=e.i(71645),t=e.i(47071),i=e.i(5230),r=e.i(90072),o=e.i(12979),l=e.i(62395),s=e.i(75567),u=e.i(79123);function c(e){let{surfaceTexture:l,envMapTexture:c,opacity:v=.75,waveMagnitude:p=1,envMapIntensity:f=1,attach:d}=e,m=(0,o.textureToUrl)(l),g=(0,o.textureToUrl)(null!=c?c:"special/lush_env"),[h,x]=(0,t.useTexture)([m,g],e=>{(Array.isArray(e)?e:[e]).forEach(e=>{(0,s.setupColor)(e),e.wrapS=r.RepeatWrapping,e.wrapT=r.RepeatWrapping})}),{animationEnabled:T}=(0,u.useSettings)(),b=(0,a.useMemo)(()=>{var e,n,a,t,i,o;return e={opacity:v,waveMagnitude:p,envMapIntensity:f,baseTexture:h,envMapTexture:x},new r.ShaderMaterial({uniforms:{uTime:{value:0},uOpacity:{value:null!=(n=null==e?void 0:e.opacity)?n:.75},uWaveMagnitude:{value:null!=(a=null==e?void 0:e.waveMagnitude)?a:1},uEnvMapIntensity:{value:null!=(t=null==e?void 0:e.envMapIntensity)?t:1},uBaseTexture:{value:null!=(i=null==e?void 0:e.baseTexture)?i:null},uEnvMapTexture:{value:null!=(o=null==e?void 0:e.envMapTexture)?o:null},fogColor:{value:new r.Color},fogNear:{value:1},fogFar:{value:2e3}},vertexShader:"\n #include \n\n uniform float uTime;\n uniform float uWaveMagnitude;\n\n varying vec2 vUv;\n varying vec3 vWorldPosition;\n varying vec3 vViewVector;\n varying float vDistance;\n\n // Wave function matching Tribes 2 engine\n // Z = surfaceZ + (sin(X*0.05 + time) + sin(Y*0.05 + time)) * waveFactor\n // waveFactor = waveAmplitude * 0.25\n // Note: Using xz for Three.js Y-up (Torque uses XY with Z-up)\n float getWaveHeight(vec3 worldPos) {\n float waveFactor = uWaveMagnitude * 0.25;\n return (sin(worldPos.x * 0.05 + uTime) + sin(worldPos.z * 0.05 + uTime)) * waveFactor;\n }\n\n void main() {\n vUv = uv;\n\n // Get world position for wave calculation\n vec4 worldPos = modelMatrix * vec4(position, 1.0);\n vWorldPosition = worldPos.xyz;\n\n // Apply wave displacement to Y (vertical axis in Three.js)\n vec3 displaced = position;\n displaced.y += getWaveHeight(worldPos.xyz);\n\n // Calculate view vector for environment mapping\n vViewVector = cameraPosition - worldPos.xyz;\n vDistance = length(vViewVector);\n\n vec4 mvPosition = viewMatrix * modelMatrix * vec4(displaced, 1.0);\n gl_Position = projectionMatrix * mvPosition;\n\n #include \n }\n",fragmentShader:"\n #include \n\n uniform float uTime;\n uniform float uOpacity;\n uniform float uEnvMapIntensity;\n uniform sampler2D uBaseTexture;\n uniform sampler2D uEnvMapTexture;\n\n varying vec2 vUv;\n varying vec3 vWorldPosition;\n varying vec3 vViewVector;\n varying float vDistance;\n\n #define TWO_PI 6.283185307179586\n\n // Constants from Tribes 2 engine\n #define BASE_DRIFT_CYCLE_TIME 8.0\n #define BASE_DRIFT_RATE 0.02\n #define BASE_DRIFT_SCALAR 0.03\n #define TEXTURE_SCALE (1.0 / 48.0)\n\n // Environment map UV wobble constants\n #define Q1 150.0\n #define Q2 2.0\n #define Q3 0.01\n\n // Rotate UV coordinates\n vec2 rotateUV(vec2 uv, float angle) {\n float c = cos(angle);\n float s = sin(angle);\n return vec2(\n uv.x * c - uv.y * s,\n uv.x * s + uv.y * c\n );\n }\n\n void main() {\n // Calculate base texture UVs using world position (1/48 tiling)\n // Note: In Three.js Y-up coordinates, the water surface is on the XZ plane\n // Torque uses Z-up where the surface is XY, so we use xz here\n vec2 baseUV = vWorldPosition.xz * TEXTURE_SCALE;\n\n // Phase (time in radians for drift cycle)\n float phase = mod(uTime * (TWO_PI / BASE_DRIFT_CYCLE_TIME), TWO_PI);\n\n // Base texture drift\n float baseDriftX = uTime * BASE_DRIFT_RATE;\n float baseDriftY = cos(phase) * BASE_DRIFT_SCALAR;\n\n // === Phase 1a: First base texture pass (rotated 30 degrees) ===\n vec2 uv1a = rotateUV(baseUV, radians(30.0));\n\n // === Phase 1b: Second base texture pass (rotated 60 degrees total, with drift) ===\n // OpenGL matrix order: glRotatef(60) then glTranslatef(drift) means\n // the transform is R60 * T, so when applied to UV: R60 * (UV + drift)\n // Translation is applied first, then rotation.\n vec2 uv1b = rotateUV(baseUV + vec2(baseDriftX, baseDriftY), radians(60.0));\n\n // Calculate cross-fade swing value\n // From engine: A1 = cos((X/Q1 + time/Q2) * 6.0), A2 = sin((Y/Q1 + time/Q2) * 6.28)\n // Using xz for Three.js Y-up coordinate system\n float A1 = cos(((vWorldPosition.x / Q1) + (uTime / Q2)) * 6.0);\n float A2 = sin(((vWorldPosition.z / Q1) + (uTime / Q2)) * TWO_PI);\n float swing = (A1 + A2) * 0.15 + 0.5;\n\n // Cross-fade alpha calculation from engine\n // alpha1a = ((1-swing) * opacity) / (1 - (swing * opacity))\n // alpha1b = swing * opacity\n float alpha1a = ((1.0 - swing) * uOpacity) / max(1.0 - (swing * uOpacity), 0.001);\n float alpha1b = swing * uOpacity;\n\n // Sample base texture for both passes\n vec4 texColor1a = texture2D(uBaseTexture, uv1a);\n vec4 texColor1b = texture2D(uBaseTexture, uv1b);\n\n // Simulate multi-pass alpha accumulation (screen blend formula)\n // Pass 1a: framebuffer = tex1a * alpha1a + bg * (1 - alpha1a)\n // Pass 1b: framebuffer = tex1b * alpha1b + prev * (1 - alpha1b)\n // Combined alpha = 1 - (1 - alpha1a) * (1 - alpha1b)\n float combinedAlpha = 1.0 - (1.0 - alpha1a) * (1.0 - alpha1b);\n\n // Combined color (premultiplied then divided by combined alpha)\n // color = tex1b * alpha1b + tex1a * alpha1a * (1 - alpha1b)\n vec3 baseColor = (texColor1a.rgb * alpha1a * (1.0 - alpha1b) + texColor1b.rgb * alpha1b) / max(combinedAlpha, 0.001);\n\n // === Phase 3: Environment map / specular ===\n vec3 viewDir = normalize(vViewVector);\n\n // Reflection UV calculation from engine\n // The reflection vector is eye-to-point with positive Z\n vec3 reflectVec = viewDir;\n reflectVec.z = abs(reflectVec.z);\n if (reflectVec.z < 0.001) reflectVec.z = 0.001;\n\n vec2 envUV;\n if (vDistance < 0.001) {\n envUV = vec2(0.0);\n } else {\n // Standard UV reflection mapping with adjustment\n float value = (vDistance - reflectVec.z) / (vDistance * vDistance);\n envUV.x = reflectVec.x * value;\n envUV.y = reflectVec.y * value;\n }\n\n // Convert from [-1,1] to [0,1]\n envUV = envUV * 0.5 + 0.5;\n\n // Add time-based wobble to environment map\n envUV.x += A1 * Q3;\n envUV.y += A2 * Q3;\n\n vec4 envColor = texture2D(uEnvMapTexture, envUV);\n\n // Blend environment map additively (GL_SRC_ALPHA, GL_ONE in original engine)\n // This adds specular highlights without changing base transparency\n vec3 finalColor = baseColor + envColor.rgb * uEnvMapIntensity;\n\n gl_FragColor = vec4(finalColor, combinedAlpha);\n\n // Apply scene fog (integrated with Three.js fog system)\n #include \n }\n",transparent:!0,side:r.DoubleSide,depthWrite:!0,fog:!0})},[v,p,f,h,x]),y=(0,a.useRef)(0);return(0,i.useFrame)((e,n)=>{if(!T){y.current=0,b.uniforms.uTime.value=0;return}y.current+=n,b.uniforms.uTime.value=y.current}),(0,a.useEffect)(()=>()=>{b.dispose()},[b]),(0,n.jsx)("primitive",{object:b,attach:d})}function v(e){let{surfaceTexture:a,attach:i}=e,l=(0,o.textureToUrl)(a),u=(0,t.useTexture)(l,e=>(0,s.setupColor)(e));return(0,n.jsx)("meshStandardMaterial",{attach:i,map:u,transparent:!0,opacity:.8,side:r.DoubleSide})}let p=(0,a.memo)(function(e){var t,i,o,s;let{object:u}=e,v=(0,a.useMemo)(()=>(0,l.getPosition)(u),[u]),p=(0,a.useMemo)(()=>(0,l.getRotation)(u),[u]),[f,d,m]=(0,a.useMemo)(()=>(0,l.getScale)(u),[u]),g=null!=(t=(0,l.getProperty)(u,"surfaceTexture"))?t:"liquidTiles/BlueWater",h=(0,l.getProperty)(u,"envMapTexture"),x=parseFloat(null!=(i=(0,l.getProperty)(u,"surfaceOpacity"))?i:"0.75"),T=parseFloat(null!=(o=(0,l.getProperty)(u,"waveMagnitude"))?o:"1.0"),b=parseFloat(null!=(s=(0,l.getProperty)(u,"envMapIntensity"))?s:"1.0"),y=(0,a.useMemo)(()=>{let[e,n]=function(e,n){let a=e<=1024&&n<=1024?8:16;return[Math.max(4,Math.ceil(e/a)),Math.max(4,Math.ceil(n/a))]}(f,m),a=new r.PlaneGeometry(f,m,e,n);return a.rotateX(-Math.PI/2),a.translate(f/2,d,m/2),a},[f,d,m]);return(0,a.useEffect)(()=>()=>{y.dispose()},[y]),(0,n.jsx)("group",{position:v,quaternion:p,children:(0,n.jsx)("mesh",{geometry:y,children:(0,n.jsx)(a.Suspense,{fallback:(0,n.jsx)("meshStandardMaterial",{color:"blue",transparent:!0,opacity:.3,side:r.DoubleSide}),children:(0,n.jsx)(c,{attach:"material",surfaceTexture:g,envMapTexture:h,opacity:x,waveMagnitude:T,envMapIntensity:b})})})})})}]); \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index c42966fe..2be80259 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1 +1 @@ -MapGenius – Explore maps for Tribes 2 \ No newline at end of file +MapGenius – Explore maps for Tribes 2 \ No newline at end of file diff --git a/docs/index.txt b/docs/index.txt index a345c202..14eb2d89 100644 --- a/docs/index.txt +++ b/docs/index.txt @@ -2,7 +2,7 @@ 2:I[39756,["/t2-mapper/_next/static/chunks/060f9a97930f3d04.js"],"default"] 3:I[37457,["/t2-mapper/_next/static/chunks/060f9a97930f3d04.js"],"default"] 4:I[47257,["/t2-mapper/_next/static/chunks/060f9a97930f3d04.js"],"ClientPageRoot"] -5:I[31713,["/t2-mapper/_next/static/chunks/618f302c73bc6a21.js","/t2-mapper/_next/static/chunks/32ef0c8650712240.js","/t2-mapper/_next/static/chunks/b70f08013a69708a.js","/t2-mapper/_next/static/chunks/aaf7d6869584978f.js"],"default"] +5:I[31713,["/t2-mapper/_next/static/chunks/98d29aec52be59c3.js","/t2-mapper/_next/static/chunks/32ef0c8650712240.js","/t2-mapper/_next/static/chunks/b70f08013a69708a.js","/t2-mapper/_next/static/chunks/aaf7d6869584978f.js"],"default"] 8:I[97367,["/t2-mapper/_next/static/chunks/060f9a97930f3d04.js"],"OutletBoundary"] a:I[11533,["/t2-mapper/_next/static/chunks/060f9a97930f3d04.js"],"AsyncMetadataOutlet"] c:I[97367,["/t2-mapper/_next/static/chunks/060f9a97930f3d04.js"],"ViewportBoundary"] @@ -10,7 +10,7 @@ e:I[97367,["/t2-mapper/_next/static/chunks/060f9a97930f3d04.js"],"MetadataBounda f:"$Sreact.suspense" 11:I[68027,[],"default"] :HL["/t2-mapper/_next/static/chunks/15b04c9d2ba2c4cf.css","style"] -0:{"P":null,"b":"LT1qVc5jR2WYUbO3-wDuw","p":"/t2-mapper","c":["",""],"i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/15b04c9d2ba2c4cf.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]]}],{"children":["__PAGE__",["$","$1","c",{"children":[["$","$L4",null,{"Component":"$5","searchParams":{},"params":{},"promises":["$@6","$@7"]}],[["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/618f302c73bc6a21.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/32ef0c8650712240.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/b70f08013a69708a.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/aaf7d6869584978f.js","async":true,"nonce":"$undefined"}]],["$","$L8",null,{"children":["$L9",["$","$La",null,{"promise":"$@b"}]]}]]}],{},null,false]},null,false],["$","$1","h",{"children":[null,[["$","$Lc",null,{"children":"$Ld"}],null],["$","$Le",null,{"children":["$","div",null,{"hidden":true,"children":["$","$f",null,{"fallback":null,"children":"$L10"}]}]}]]}],false]],"m":"$undefined","G":["$11",[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/15b04c9d2ba2c4cf.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"s":false,"S":true} +0:{"P":null,"b":"70hpG-x4f3KKfn_e3s67S","p":"/t2-mapper","c":["",""],"i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/15b04c9d2ba2c4cf.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]]}],{"children":["__PAGE__",["$","$1","c",{"children":[["$","$L4",null,{"Component":"$5","searchParams":{},"params":{},"promises":["$@6","$@7"]}],[["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/98d29aec52be59c3.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/32ef0c8650712240.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/b70f08013a69708a.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/aaf7d6869584978f.js","async":true,"nonce":"$undefined"}]],["$","$L8",null,{"children":["$L9",["$","$La",null,{"promise":"$@b"}]]}]]}],{},null,false]},null,false],["$","$1","h",{"children":[null,[["$","$Lc",null,{"children":"$Ld"}],null],["$","$Le",null,{"children":["$","div",null,{"hidden":true,"children":["$","$f",null,{"fallback":null,"children":"$L10"}]}]}]]}],false]],"m":"$undefined","G":["$11",[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/15b04c9d2ba2c4cf.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"s":false,"S":true} 6:{} 7:"$0:f:0:1:2:children:1:props:children:0:props:params" d:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]