@vgai/editor 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{axe-BJjvBeOZ.js → axe-N4cNyzfs.js} +1 -1
- package/dist/assets/{browserAll-Dn0pgD87.js → browserAll-BIBT0Z2H.js} +1 -1
- package/dist/assets/{create-runtime-BF9OD-U8.js → create-runtime-DxLhdk4U.js} +1 -1
- package/dist/assets/{game-u6c2Patu.js → game-4NbNRROm.js} +1 -1
- package/dist/assets/{game-umrHIqFB.js → game-B3UH5LjS.js} +1 -1
- package/dist/assets/{game-BR0GBNgF.js → game-ByxRLJi1.js} +1 -1
- package/dist/assets/{game-DeTGdgYt.js → game-CJ5BqOYG.js} +1 -1
- package/dist/assets/{game-DQxhCYsZ.js → game-CSJm1kwB.js} +1 -1
- package/dist/assets/{game-CLNm2g0y.js → game-D9Mo4L3Q.js} +1 -1
- package/dist/assets/{game-B346oj_f.js → game-DJmU9BQF.js} +1 -1
- package/dist/assets/{game-BCNN63uV.js → game-ZqGLgxRj.js} +1 -1
- package/dist/assets/{game-loop-t5W_oqxz.js → game-loop-9YP76JB1.js} +1 -1
- package/dist/assets/{game-source-DzE9taML.js → game-source-DLKG9pmj.js} +1 -1
- package/dist/assets/{index-DbQzGLxv.js → index-8A4JLNIp.js} +902 -892
- package/dist/assets/{index-CgcH1RpF.js → index-Brzr17q0.js} +1 -1
- package/dist/assets/{index-D3tcNB2T.js → index-CnKtvrru.js} +1 -1
- package/dist/assets/{index-Fc8Ezr20.js → index-D-WR11Jw.js} +1 -1
- package/dist/assets/index-DiUacMXR.css +1 -0
- package/dist/assets/{ingest-siblings-CW_xbvrF.js → ingest-siblings-Cmx39OBK.js} +1 -1
- package/dist/assets/{mount-manifest-DgUscyaD.js → mount-manifest-kzdZgkkc.js} +1 -1
- package/dist/assets/{react-18-C4tVCii_.js → react-18-DvWsdwa_.js} +1 -1
- package/dist/assets/webworkerAll-C9GR-KrR.js +1 -0
- package/dist/assets/{world-documents-BSaA5YIF.js → world-documents-DM_aIMAW.js} +1 -1
- package/dist/index.html +2 -2
- package/dist-server/packaged.mjs +27125 -1075
- package/package.json +2 -2
- package/server/asset-history-snapshots.ts +189 -0
- package/server/asset-library-routes.ts +404 -53
- package/server/catalog-import-recipe.ts +97 -0
- package/server/catalog-reimport.ts +141 -0
- package/server/cloud-asset-catalog.ts +71 -5
- package/server/dev.ts +1 -1
- package/server/editor-server.ts +106 -51
- package/server/editor-sse.ts +5 -0
- package/server/generative-execution-context.ts +45 -0
- package/server/model-import-conversion.ts +345 -0
- package/server/packaged.ts +1 -1
- package/server/project-hmr-files.ts +3 -5
- package/server/project-output-writer.ts +440 -36
- package/server/project-tools.ts +529 -0
- package/server/server-utils.ts +14 -11
- package/src/EditorContext.tsx +4 -4
- package/src/action-registry.ts +12 -0
- package/src/asset-editor-context.tsx +9 -0
- package/src/asset-events.ts +3 -15
- package/src/asset-selection.ts +3 -0
- package/src/asset-workflow/asset-capabilities.ts +40 -0
- package/src/asset-workflow/asset-import-jobs.ts +108 -0
- package/src/asset-workflow/asset-library-query.ts +8 -1
- package/src/asset-workflow/asset-workflow-quality.ts +2 -0
- package/src/asset-workflow/import-contract.ts +2 -0
- package/src/asset-workflow/model-inspection.ts +92 -1
- package/src/asset-workflow/preview-resource-lifetime.ts +44 -0
- package/src/asset-workflow/project-asset-commands.ts +1 -0
- package/src/asset-workflow/project-asset-health.ts +3 -6
- package/src/asset-workflow/project-asset-operations.ts +119 -4
- package/src/command-listener.ts +37 -9
- package/src/components/ApplicationMenus.tsx +13 -15
- package/src/components/AssetBrowser.tsx +301 -26
- package/src/components/AssetImportDetails.tsx +207 -92
- package/src/components/AssetImportJobStatus.tsx +55 -0
- package/src/components/CenterDocuments.tsx +28 -1
- package/src/components/CommandPalette.tsx +2 -2
- package/src/components/DefaultEditorLayout.tsx +4 -0
- package/src/components/InspectorToolSection.tsx +12 -10
- package/src/components/OnlineAssetBrowser.tsx +197 -11
- package/src/components/ToolHost.tsx +8 -8
- package/src/components/ViewportOverlay.tsx +13 -26
- package/src/components/ViewportPanel.tsx +19 -14
- package/src/components/ViewportShadingMenu.tsx +103 -0
- package/src/components/WorkspaceDock.tsx +103 -17
- package/src/components/asset-documents.tsx +38 -11
- package/src/components/asset-editor-persistence.ts +300 -5
- package/src/components/asset-selection-section.tsx +83 -9
- package/src/components/asset-viewers/AudioViewer.tsx +4 -7
- package/src/components/asset-viewers/ModelViewer.tsx +168 -5
- package/src/components/asset-viewers/OnlineAssetDetail.tsx +52 -12
- package/src/components/asset-viewers/SourceAssetViewer.tsx +7 -26
- package/src/components/asset-workflow.css +30 -3
- package/src/components/primitives/editor-icons.ts +1 -0
- package/src/components/project-tool-documents.tsx +298 -0
- package/src/components/status-contributions.tsx +38 -0
- package/src/components/tool-documents.tsx +20 -17
- package/src/components/tool-schema-form.tsx +258 -0
- package/src/components/workspace-dock.css +16 -0
- package/src/editor-api.ts +159 -22
- package/src/editor-store.ts +6 -5
- package/src/editor-viewport.ts +12 -7
- package/src/game-viewport-state.ts +28 -0
- package/src/model-thumbnail.ts +97 -9
- package/src/play-mode.ts +30 -3
- package/src/project-tool-discovery.ts +5 -5
- package/src/{project-operations.ts → project-tools.ts} +39 -26
- package/src/scene-sync.ts +0 -67
- package/src/storage/handle-storage.ts +5 -1
- package/src/storage/http-storage.ts +7 -2
- package/src/storage/mem-storage.ts +7 -1
- package/src/storage/types.ts +2 -0
- package/src/theme-css.ts +17 -7
- package/src/tool-loader.ts +152 -241
- package/src/viewport-shading-boundary.ts +15 -0
- package/src/widgets/index.ts +2 -1
- package/src/workspace-dock-controller.ts +8 -0
- package/src/workspace-document-registry.ts +4 -4
- package/src/workspace-state-persistence.ts +36 -10
- package/template/.claude/skills/editor/SKILL.md +13 -3
- package/template/AGENTS.md +100 -83
- package/template/package.json +16 -0
- package/template/public/scenes/default.vscn.json +1 -2
- package/template/scripts/playtest.ts +7 -37
- package/template/server/rooms/game-room.ts +2 -2
- package/template/src/data/README.md +3 -2
- package/template/src/data/tuning.data.json +1 -3
- package/template/src/data/tuning.schema.json +0 -12
- package/template/src/data/tuning.schema.ts +2 -9
- package/template/src/data/tuning.ts +1 -1
- package/template/src/scripts/registry.ts +0 -3
- package/template/src/tools/README.md +151 -16
- package/template/src/tools/autoplay.tool.ts +31 -0
- package/template/src/tools/autoplay.ts +15 -0
- package/template/src/tools/tuning.document.tsx +107 -0
- package/template/src/tools/tuning.tool.ts +24 -0
- package/template/src/tools/tuning.ts +9 -0
- package/template/src/ui/Button.stories.tsx +1 -1
- package/template/tests/acceptance/example.spec.ts +4 -59
- package/template/vgai.game.json +1 -1
- package/dist/assets/index-bAGhEnnO.css +0 -1
- package/dist/assets/webworkerAll-BA4aq7xq.js +0 -1
- package/dist/project-scripts.bundle.js +0 -3917
- package/server/project-operations.ts +0 -343
- package/src/components/project-operation-documents.tsx +0 -226
- package/template/src/operations/README.md +0 -88
- package/template/src/scripts/components/data-spinner.ts +0 -86
- package/template/src/scripts/components/spin-lap-math.ts +0 -27
- package/template/src/tools/example.tool.tsx +0 -97
- package/template/src/tools/spin.tool.tsx +0 -101
- package/template/tests/logic/example.test.ts +0 -31
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{af as TT}from"./index-
|
|
1
|
+
import{af as TT}from"./index-8A4JLNIp.js";function kT(Ar,la){for(var E=0;E<la.length;E++){const lt=la[E];if(typeof lt!="string"&&!Array.isArray(lt)){for(const O in lt)if(O!=="default"&&!(O in Ar)){const _=Object.getOwnPropertyDescriptor(lt,O);_&&Object.defineProperty(Ar,O,_.get?_:{enumerable:!0,get:()=>lt[O]})}}}return Object.freeze(Object.defineProperty(Ar,Symbol.toStringTag,{value:"Module"}))}var Hi={exports:{}};/*! axe v4.12.1
|
|
2
2
|
* Copyright (c) 2015 - 2026 Deque Systems, Inc.
|
|
3
3
|
*
|
|
4
4
|
* Your use of this Source Code Form is subject to the terms of the Mozilla Public
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ag as a,ah as s,_ as i,ai as e,aj as t,ak as n,al as d}from"./index-
|
|
1
|
+
import{ag as a,ah as s,_ as i,ai as e,aj as t,ak as n,al as d}from"./index-8A4JLNIp.js";import"./webworkerAll-C9GR-KrR.js";a.add(s);a.mixin(i,e);a.add(t);a.add(n);a.mixin(i,d);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as j,c as B,d as M,b as G,e as I,T as D,h as b,i as R}from"./index-
|
|
1
|
+
import{s as j,c as B,d as M,b as G,e as I,T as D,h as b,i as R}from"./index-8A4JLNIp.js";import{j as ot}from"./index-8A4JLNIp.js";import{c as F,a as L}from"./game-loop-9YP76JB1.js";function A(t){return R(t)?{physics:t.ctx.physics,collisions:t.ctx.collisions,camera:t.ctx.camera,frame:t.frame}:{}}function U(t,o,e,n){const s=b({id:n?.id??"main",kind:"threejs",pausable:n?.pausable??!0,adapter:o,mounted:e,scene:e.scene,...A(e)});return R(e)&&e.ctx.components.adoptWorld(s),t.registerWorld(s),s}function q(t){return t.firstParty!==!0?{}:{physics2d:t.ctx.physics2d,collisions2d:t.ctx.collisions2d,frame:t.frame}}function N(t,o,e,n){const s=n?.id??"main",i=e.firstParty===!0,d=b({id:s,kind:"pixijs",pausable:n?.pausable??!0,adapter:o,mounted:e,stage:e.stage,...q(e)});return i&&e.ctx.components.adoptWorld(d),t.registerWorld(d),d}function $(t,o,e,n,s){const i=b({id:s?.id??"main",kind:"react",pausable:s?.pausable??!0,adapter:o,mounted:e,container:n});return t.registerWorld(i),i}async function rt(t){return _(t)}function J(){return{setPixelRatio(){},setClearColor(){},setSize(){},dispose(){},forceContextLoss(){}}}function K(t){if(t.firstParty!==!0)return;const e=t.ctx.app?.renderer?.events?.rootBoundary;if(!(!e||typeof e.hitTest!="function"))return(n,s)=>e.rootTarget!=null&&e.hitTest(n,s)!=null}async function Q(t,o){const{game:e,canvas:n,w:s,h:i,dpr:d,isBottom:a,headless:l,loopHandle:u,assets:h}=o,c=l?J():I(n,s,i,void 0,{alpha:!a});c.setSize(s,i,!1),n.style.width="100%",n.style.height="100%",c.setPixelRatio(d),a||c.setClearColor(0,0);const p={three:D,surface:{canvas:n,width:s,height:i},renderer:c,loop:u,assets:h,headless:l,game:e,requestSystem:()=>null},y=await t.adapter.mount(p);return U(e,t.adapter,y,{id:t.id,pausable:t.pausable}),{mountedEntry:{id:t.id,kind:"threejs",element:n,mounted:y,renderer:c},routerEntry:{id:t.id,zOrder:t.zOrder??0,canvas:n,hitTest:t.hitTest}}}async function V(t,o){const{game:e,canvas:n,w:s,h:i,dpr:d,isBottom:a}=o,l={canvas:n,width:s,height:i,game:e,dpr:d,transparent:!a,preserveDrawingBuffer:!0},u=await t.adapter.mount(l);return N(e,t.adapter,u,{id:t.id,pausable:t.pausable}),{mountedEntry:{id:t.id,kind:"pixijs",element:n,mounted:u,renderer:void 0},routerEntry:{id:t.id,zOrder:t.zOrder??0,canvas:n,hitTest:t.hitTest??K(u)}}}async function X(t,o,e){e.style.pointerEvents="none",e.style.width="100%",e.style.height="100%";const n={container:e,game:o},s=await t.adapter.mount(n);return $(o,t.adapter,s,e,{id:t.id,pausable:t.pausable}),{mountedEntry:{id:t.id,kind:"react",element:e,mounted:s,renderer:void 0}}}function Y(t){return()=>{}}async function Z(t,o,e){const{surfacesById:n,...s}=e,i=[],d=[];for(const a of t){const l=a.id===o;if(a.kind==="react"){const y=n.get(a.id),{mountedEntry:v}=await X(a,s.game,y);i.push(v);continue}const u=n.get(a.id),h={...s,canvas:u,isBottom:l};let c,p;a.kind==="threejs"?{mountedEntry:c,routerEntry:p}=await Q(a,h):a.kind==="pixijs"?{mountedEntry:c,routerEntry:p}=await V(a,h):G(a,"create-runtime mount loop"),i.push(c),d.push(p)}return{mountedEntries:i,routerEntries:d}}async function _(t){const{container:o,roots:e,width:n,height:s,headless:i=!1,seed:d}=t;if(e.length===0)throw new Error("createGameRuntime: `roots` must contain at least one root.");const a=e,l=Math.max(1,n??o.clientWidth??0),u=Math.max(1,s??o.clientHeight??0),h=i?1:Math.min(typeof window<"u"&&window.devicePixelRatio||1,2);o.style.position||(o.style.position="relative");const c=j(a.map(r=>({id:r.id,zOrder:r.zOrder??0,hitTest:r.hitTest}))),p=c[0]?.id,y=new Map(a.map(r=>[r.id,r.kind])),v=new Map;c.forEach((r,x)=>{const g=y.get(r.id)==="react",m=document.createElement(g?"div":"canvas");if(!g){const w=m;w.width=l,w.height=u}m.style.cssText=`position:absolute;top:0;left:0;width:100%;height:100%;z-index:${x+1};contain:layout paint;`,o.appendChild(m),v.set(r.id,m)});const T=L(),E=new Set,z={onUpdate(r){return E.add(r),()=>E.delete(r)}};let k=!1;const W=F({fixedTimestep:1/60,maxSubSteps:8,update:r=>{k&&f.runFrame(r);for(const x of E)x(r)}}),f=B({loop:W,assets:T,seed:d}),{mountedEntries:P,routerEntries:C}=await Z(a,p,{game:f,surfacesById:v,w:l,h:u,dpr:h,headless:i,loopHandle:z,assets:T}),S=M(o,C);k=!0,W.start();const H=Y();function O(){W.stop(),S.dispose();for(const r of P)r.mounted.dispose(),r.renderer?.dispose(),r.renderer?.forceContextLoss(),o.removeChild(r.element);H()}return{stop:O,pause(){f.play.pause()},resume(){f.play.resume()},step(){f.play.step()},resize(r,x){const g=Math.max(1,r),m=Math.max(1,x);for(const w of P)w.renderer?.setSize(g,m,!1),w.mounted.resize?.(g,m)},get scene(){const r=f.defaultWorld.mounted;return r.kind==="threejs"?r.scene:void 0},get camera(){const r=f.defaultWorld.mounted;return r.kind==="threejs"?r.camera:void 0},get mounted(){return f.defaultWorld.mounted},game:f}}export{ot as adoptSceneCamera,rt as createGameRuntime,N as registerPixiWorld,$ as registerReactWorld,U as registerThreeWorld};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a5 as W,a6 as k,a7 as T,F as H,P as X,S as N,a8 as U,a9 as Y,U as q,aa as O,ab as S,ac as C,ad as V,M as D,H as Q,ae as Z,G as J}from"./index-
|
|
1
|
+
import{a5 as W,a6 as k,a7 as T,F as H,P as X,S as N,a8 as U,a9 as Y,U as q,aa as O,ab as S,ac as C,ad as V,M as D,H as Q,ae as Z,G as J}from"./index-8A4JLNIp.js";const p=new T(0,0,0,"YXZ"),b=new k,$={type:"change"},ee={type:"lock"},te={type:"unlock"},R=Math.PI/2;class oe extends W{constructor(r,t=null){super(r,t),this.isLocked=!1,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.pointerSpeed=1,this._onMouseMove=ne.bind(this),this._onPointerlockChange=re.bind(this),this._onPointerlockError=ie.bind(this),this.domElement!==null&&this.connect()}connect(){this.domElement.ownerDocument.addEventListener("mousemove",this._onMouseMove),this.domElement.ownerDocument.addEventListener("pointerlockchange",this._onPointerlockChange),this.domElement.ownerDocument.addEventListener("pointerlockerror",this._onPointerlockError)}disconnect(){this.domElement.ownerDocument.removeEventListener("mousemove",this._onMouseMove),this.domElement.ownerDocument.removeEventListener("pointerlockchange",this._onPointerlockChange),this.domElement.ownerDocument.removeEventListener("pointerlockerror",this._onPointerlockError)}dispose(){this.disconnect()}getObject(){return console.warn("THREE.PointerLockControls: getObject() has been deprecated. Use controls.object instead."),this.object}getDirection(r){return r.set(0,0,-1).applyQuaternion(this.object.quaternion)}moveForward(r){if(this.enabled===!1)return;const t=this.object;b.setFromMatrixColumn(t.matrix,0),b.crossVectors(t.up,b),t.position.addScaledVector(b,r)}moveRight(r){if(this.enabled===!1)return;const t=this.object;b.setFromMatrixColumn(t.matrix,0),t.position.addScaledVector(b,r)}lock(){this.domElement.requestPointerLock()}unlock(){this.domElement.ownerDocument.exitPointerLock()}}function ne(n){if(this.enabled===!1||this.isLocked===!1)return;const r=n.movementX||n.mozMovementX||n.webkitMovementX||0,t=n.movementY||n.mozMovementY||n.webkitMovementY||0,i=this.object;p.setFromQuaternion(i.quaternion),p.y-=r*.002*this.pointerSpeed,p.x-=t*.002*this.pointerSpeed,p.x=Math.max(R-this.maxPolarAngle,Math.min(R-this.minPolarAngle,p.x)),i.quaternion.setFromEuler(p),this.dispatchEvent($)}function re(){this.domElement.ownerDocument.pointerLockElement===this.domElement?(this.dispatchEvent(ee),this.isLocked=!0):(this.dispatchEvent(te),this.isLocked=!1)}function ie(){console.error("THREE.PointerLockControls: Unable to use Pointer Lock API")}const a=globalThis.__vgaiGameWindow||globalThis.window,w=globalThis.__vgaiGameDocument||globalThis.document;let y,d,f,s;const K=[];let M,E=!1,x=!1,L=!1,P=!1,A=!1,F=performance.now();const o=new k,g=new k,u=new k,l=new H;se();function se(){y=new X(75,a.innerWidth/a.innerHeight,1,1e3),y.position.y=10,d=new N,d.background=new H(16777215),d.fog=new U(16777215,0,750);const n=new Y(15658751,7829384,2.5);n.position.set(.5,1,.75),d.add(n),s=new oe(y,w.body);const r=w.getElementById("blocker"),t=w.getElementById("instructions");t.addEventListener("click",function(){s.lock()}),s.addEventListener("lock",function(){t.style.display="none",r.style.display="none"}),s.addEventListener("unlock",function(){r.style.display="block",t.style.display=""}),d.add(s.object);const i=function(e){switch(e.code){case"ArrowUp":case"KeyW":E=!0;break;case"ArrowLeft":case"KeyA":L=!0;break;case"ArrowDown":case"KeyS":x=!0;break;case"ArrowRight":case"KeyD":P=!0;break;case"Space":A===!0&&(o.y+=350),A=!1;break}},B=function(e){switch(e.code){case"ArrowUp":case"KeyW":E=!1;break;case"ArrowLeft":case"KeyA":L=!1;break;case"ArrowDown":case"KeyS":x=!1;break;case"ArrowRight":case"KeyD":P=!1;break}};w.addEventListener("keydown",i),w.addEventListener("keyup",B),M=new q(new k,new k(0,-1,0),0,10);let m=new O(2e3,2e3,100,100);m.rotateX(-Math.PI/2);let h=m.attributes.position;for(let e=0,c=h.count;e<c;e++)u.fromBufferAttribute(h,e),u.x+=Math.random()*20-10,u.y+=Math.random()*2,u.z+=Math.random()*20-10,h.setXYZ(e,u.x,u.y,u.z);m=m.toNonIndexed(),h=m.attributes.position;const j=[];for(let e=0,c=h.count;e<c;e++)l.setHSL(Math.random()*.3+.5,.75,Math.random()*.25+.75,S),j.push(l.r,l.g,l.b);m.setAttribute("color",new C(j,3));const G=new V({vertexColors:!0}),I=new D(m,G);d.add(I);const _=new Q(20,20,20).toNonIndexed();h=_.attributes.position;const z=[];for(let e=0,c=h.count;e<c;e++)l.setHSL(Math.random()*.3+.5,.75,Math.random()*.25+.75,S),z.push(l.r,l.g,l.b);_.setAttribute("color",new C(z,3));for(let e=0;e<500;e++){const c=new Z({specular:16777215,flatShading:!0,vertexColors:!0});c.color.setHSL(Math.random()*.2+.5,.75,Math.random()*.25+.75,S);const v=new D(_,c);v.position.x=Math.floor(Math.random()*20-10)*20,v.position.y=Math.floor(Math.random()*20)*20+10,v.position.z=Math.floor(Math.random()*20-10)*20,d.add(v),K.push(v)}f=new J({antialias:!0}),f.setPixelRatio(a.devicePixelRatio),f.setSize(a.innerWidth,a.innerHeight),f.setAnimationLoop(ce),w.body.appendChild(f.domElement),a.addEventListener("resize",ae)}function ae(){y.aspect=a.innerWidth/a.innerHeight,y.updateProjectionMatrix(),f.setSize(a.innerWidth,a.innerHeight)}function ce(){const n=performance.now();if(s.isLocked===!0){M.ray.origin.copy(s.object.position),M.ray.origin.y-=10;const t=M.intersectObjects(K,!1).length>0,i=(n-F)/1e3;o.x-=o.x*10*i,o.z-=o.z*10*i,o.y-=9.8*100*i,g.z=Number(E)-Number(x),g.x=Number(P)-Number(L),g.normalize(),(E||x)&&(o.z-=g.z*400*i),(L||P)&&(o.x-=g.x*400*i),t===!0&&(o.y=Math.max(0,o.y),A=!0),s.moveRight(-o.x*i),s.moveForward(-o.z*i),s.object.position.y+=o.y*i,s.object.position.y<10&&(o.y=0,s.object.position.y=10,A=!0)}F=n,f.render(d,y)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{G as d,S as c,F as l,P as m,L as h,M as w,H as g,J as b}from"./index-
|
|
1
|
+
import{G as d,S as c,F as l,P as m,L as h,M as w,H as g,J as b}from"./index-8A4JLNIp.js";const e=globalThis.__vgaiGameWindow||globalThis.window,i=globalThis.__vgaiGameDocument||globalThis.document,n=new d({antialias:!0});n.setSize(e.innerWidth,e.innerHeight);(i.getElementById("container")||i.body).appendChild(n.domElement);const t=new c;t.background=new l(2105384);const r=new m(60,e.innerWidth/e.innerHeight,.1,100);r.position.set(0,1.5,5);const o=new h(16777215,1.2);o.position.set(2,3,4);o.name="KeyLight";t.add(o);const a=new w(new g(1,1,1),new b({color:3368652}));a.name="OwnThreeCube";t.add(a);let s=0;n.setAnimationLoop(()=>{s+=.01,a.rotation.y=s,n.render(t,r)});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a_ as P,F as v,O as u,a$ as S,b0 as w,b1 as U,b2 as p,a6 as d,b3 as _,b4 as H,ad as z,b5 as A,G as V,S as Q,P as W,L as E,M as L,b6 as I,b7 as O}from"./index-
|
|
1
|
+
import{a_ as P,F as v,O as u,a$ as S,b0 as w,b1 as U,b2 as p,a6 as d,b3 as _,b4 as H,ad as z,b5 as A,G as V,S as Q,P as W,L as E,M as L,b6 as I,b7 as O}from"./index-8A4JLNIp.js";class G extends P{constructor(e,l,i=null,a=null,t=null){super(),this.scene=e,this.camera=l,this.overrideMaterial=i,this.clearColor=a,this.clearAlpha=t,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1,this._oldClearColor=new v}render(e,l,i){const a=e.autoClear;e.autoClear=!1;let t,o;this.overrideMaterial!==null&&(o=this.scene.overrideMaterial,this.scene.overrideMaterial=this.overrideMaterial),this.clearColor!==null&&(e.getClearColor(this._oldClearColor),e.setClearColor(this.clearColor,e.getClearAlpha())),this.clearAlpha!==null&&(t=e.getClearAlpha(),e.setClearAlpha(this.clearAlpha)),this.clearDepth==!0&&e.clearDepth(),e.setRenderTarget(this.renderToScreen?null:i),this.clear===!0&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),e.render(this.scene,this.camera),this.clearColor!==null&&e.setClearColor(this._oldClearColor),this.clearAlpha!==null&&e.setClearAlpha(t),this.overrideMaterial!==null&&(this.scene.overrideMaterial=o),e.autoClear=a}}const N={uniforms:{tDiffuse:{value:null},luminosityThreshold:{value:1},smoothWidth:{value:1},defaultColor:{value:new v(0)},defaultOpacity:{value:0}},vertexShader:`
|
|
2
2
|
|
|
3
3
|
varying vec2 vUv;
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Y as M,_,Z as p,a0 as W}from"./index-
|
|
1
|
+
import{Y as M,_,Z as p,a0 as W}from"./index-8A4JLNIp.js";const E=globalThis.__vgaiGameWindow||globalThis.window,L=globalThis.__vgaiGameDocument||globalThis.document;function Y(){return globalThis.__world2dGameContainer??L.body}H();async function H(){const a=new M;await a.init({width:480,height:640,background:"#4ec0ca",antialias:!0}),Y().appendChild(a.canvas);const w=480,c=640,b=new _;a.stage.addChild(b);const e=new _,C=new p().roundRect(-14,-12,28,24,8).fill("#ffd23f").stroke({width:2,color:"#c98a00"}),u=new p().ellipse(-2,2,9,6).fill("#fff3b0");e.addChild(C,u),e.x=w*.3,e.y=c*.5,b.addChild(e);const d=[],x=170,l=64;let y=7;const T=()=>(y=y*1103515245+12345&2147483647,y/2147483647);function k(o){const n=120+T()*(c-240-x),t=new p().rect(0,0,l,n).fill("#5dbb46").stroke({width:3,color:"#3f8a30"}),i=new p().rect(0,0,l,c-n-x).fill("#5dbb46").stroke({width:3,color:"#3f8a30"});t.x=o,t.y=0,i.x=o,i.y=n+x,b.addChild(t,i),d.push({top:t,bot:i,x:o,scored:!1})}for(let o=0;o<4;o++)k(w+o*220);const r=new W({text:"Score: 0",style:{fontSize:28,fill:"#fff",fontWeight:"bold"}});r.x=16,r.y=16,a.stage.addChild(r);let f=0,h=0,s=!1,g=0;const G=.5,A=-8.5;function m(){if(s){e.y=c*.5,f=0,h=0,s=!1;for(let o=0;o<d.length;o++)d[o].x=w+o*220;return}f=A}E.addEventListener("keydown",o=>{(o.code==="Space"||o.code==="ArrowUp")&&m()}),a.canvas.addEventListener("pointerdown",m),a.ticker.add(o=>{const n=o.deltaTime;if(g+=n,u.scale.y=.6+Math.abs(Math.sin(g*.3))*.8,!s){f+=G*n,e.y+=f*n,e.rotation=Math.max(-.5,Math.min(1.2,f*.05));for(const t of d){t.x-=2.2*n,t.top.x=t.x,t.bot.x=t.x,t.x+l<0&&(t.x+=d.length*220,t.scored=!1),!t.scored&&t.x+l<e.x&&(t.scored=!0,h++,r.text=`Score: ${h}`);const i=e.x-14,v=e.y-12;if(i+28>t.x&&i<t.x+l){const P=t.top.height,S=t.bot.y;(v<P||v+24>S)&&(s=!0)}}(e.y>c-12||e.y<0)&&(s=!0),s&&(r.text=`Score: ${h} — tap to retry`)}}),globalThis.__flappy={app:a,score:()=>h}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Y as u,Z as h,_ as v,$ as y}from"./index-
|
|
1
|
+
import{Y as u,Z as h,_ as v,$ as y}from"./index-8A4JLNIp.js";const x=globalThis.__vgaiGameDocument||globalThis.document;function g(){return globalThis.__world2dGameContainer??x.body}p();async function p(){const t=new u;await t.init({width:800,height:600,background:"#1a1a2e",antialias:!1}),g().appendChild(t.canvas);const r=new h().roundRect(0,0,26,32,6).fill("#ffd166").circle(8,10,3).fill("#222").circle(18,10,3).fill("#222"),d=t.renderer.generateTexture(r),e=[],s=new v;t.stage.addChild(s);const a=800,c=600,f=.5;let i=12345;const o=()=>(i=i*1103515245+12345&2147483647,i/2147483647);function l(){const n=new y(d);n.anchor.set(.5),n.x=a/2,n.y=0,n.tint=o()*16777215|0,s.addChild(n),e.push({s:n,vx:(o()-.5)*12,vy:o()*6})}for(let n=0;n<250;n++)l();t.ticker.add(()=>{if(e.length<1500)for(let n=0;n<4;n++)l();for(const n of e)n.s.x+=n.vx,n.s.y+=n.vy,n.vy+=f,n.s.x>a?(n.s.x=a,n.vx=-n.vx):n.s.x<0&&(n.s.x=0,n.vx=-n.vx),n.s.y>c&&(n.s.y=c,n.vy=-n.vy*.85)}),globalThis.__bunnymark={app:t,count:()=>e.length}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Y as C,_ as w,a1 as T,Z as _,a2 as v}from"./index-
|
|
1
|
+
import{Y as C,_ as w,a1 as T,Z as _,a2 as v}from"./index-8A4JLNIp.js";const y=globalThis.__vgaiGameWindow||globalThis.window,m=globalThis.__vgaiGameDocument||globalThis.document;function k(){return globalThis.__world2dGameContainer??m.body}function h(l,a,e){const d=m.createElement("canvas");d.width=e,d.height=e;const n=d.getContext("2d");return n.fillStyle=l,n.fillRect(0,0,e,e),n.fillStyle=a,n.fillRect(2,2,e-4,3),n.fillRect(2,e-5,e-4,3),v.from(d)}A();async function A(){const l=new C;await l.init({width:640,height:480,background:"#0c1a12",antialias:!1}),k().appendChild(l.canvas);const a=32,e=60,d=40,n=new w;l.stage.addChild(n);const g=h("#3a7d44","#2f6638",a),p=h("#6b6b7b","#54545f",a),x=h("#2f6db0","#255a93",a),f=new T;n.addChild(f);let c=99;const u=()=>(c=c*1103515245+12345&2147483647,c/2147483647);for(let i=0;i<d;i++)for(let r=0;r<e;r++){const s=u(),b=s<.12?x:s<.24?p:g;f.tile(b,r*a,i*a)}const t=new w;t.addChild(new _().roundRect(-12,-12,24,24,5).fill("#ffd23f").stroke({width:2,color:"#c98a00"})),t.x=e*a/2,t.y=d*a/2,n.addChild(t);const o={};y.addEventListener("keydown",i=>{o[i.code]=!0}),y.addEventListener("keyup",i=>{o[i.code]=!1}),l.ticker.add(i=>{const s=5*i.deltaTime;(o.ArrowLeft||o.KeyA)&&(t.x-=s),(o.ArrowRight||o.KeyD)&&(t.x+=s),(o.ArrowUp||o.KeyW)&&(t.y-=s),(o.ArrowDown||o.KeyS)&&(t.y+=s),t.x=Math.max(0,Math.min(e*a,t.x)),t.y=Math.max(0,Math.min(d*a,t.y)),n.x=l.screen.width/2-t.x,n.y=l.screen.height/2-t.y}),globalThis.__tilemapCamera={app:l,tiles:e*d,playerPos:()=>({x:t.x,y:t.y}),press:(i,r)=>{o[i]=r}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{O as x,P as g,S as u,F as w,L as b,H,M as v,Q as y,U as z,G as P,X as d}from"./index-
|
|
1
|
+
import{O as x,P as g,S as u,F as w,L as b,H,M as v,Q as y,U as z,G as P,X as d}from"./index-8A4JLNIp.js";import{S as R}from"./stats.module--VATS4Kh.js";const t=globalThis.__vgaiGameWindow||globalThis.window,c=globalThis.__vgaiGameDocument||globalThis.document;let m,n,r,h,o,e,s=0;const f=new x,l=5;T();function T(){n=new g(70,t.innerWidth/t.innerHeight,.1,100),r=new u,r.background=new w(15790320);const a=new b(16777215,3);a.position.set(1,1,1).normalize(),r.add(a);const p=new H;for(let M=0;M<2e3;M++){const i=new v(p,new y({color:Math.random()*16777215}));i.position.x=Math.random()*40-20,i.position.y=Math.random()*40-20,i.position.z=Math.random()*40-20,i.rotation.x=Math.random()*2*Math.PI,i.rotation.y=Math.random()*2*Math.PI,i.rotation.z=Math.random()*2*Math.PI,i.scale.x=Math.random()+.5,i.scale.y=Math.random()+.5,i.scale.z=Math.random()+.5,r.add(i)}h=new z,o=new P({antialias:!0}),o.setPixelRatio(t.devicePixelRatio),o.setSize(t.innerWidth,t.innerHeight),o.setAnimationLoop(S),c.body.appendChild(o.domElement),m=new R,c.body.appendChild(m.dom),c.addEventListener("mousemove",L),t.addEventListener("resize",W)}function W(){n.aspect=t.innerWidth/t.innerHeight,n.updateProjectionMatrix(),o.setSize(t.innerWidth,t.innerHeight)}function L(a){f.x=a.clientX/t.innerWidth*2-1,f.y=-(a.clientY/t.innerHeight)*2+1}function S(){C(),m.update()}function C(){s+=.1,n.position.x=l*Math.sin(d.degToRad(s)),n.position.y=l*Math.sin(d.degToRad(s)),n.position.z=l*Math.cos(d.degToRad(s)),n.lookAt(r.position),n.updateMatrixWorld(),h.setFromCamera(f,n);const a=h.intersectObjects(r.children,!1);a.length>0?e!=a[0].object&&(e&&e.material.emissive.setHex(e.currentHex),e=a[0].object,e.currentHex=e.material.emissive.getHex(),e.material.emissive.setHex(16711680)):(e&&e.material.emissive.setHex(e.currentHex),e=null),o.render(r,n)}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a6 as u,b8 as Q,b9 as pt,ba as gt,bb as rt,bc as ot,bd as mt,be as ft,bf as tt,bg as bt,ac as yt,S as vt,F as wt,a8 as At,P as xt,a9 as _t,L as Et,G as $t,bh as St,bi as Ct,b6 as kt,Q as Lt,M as zt,bj as Mt,bk as Vt}from"./index-
|
|
1
|
+
import{a6 as u,b8 as Q,b9 as pt,ba as gt,bb as rt,bc as ot,bd as mt,be as ft,bf as tt,bg as bt,ac as yt,S as vt,F as wt,a8 as At,P as xt,a9 as _t,L as Et,G as $t,bh as St,bi as Ct,b6 as kt,Q as Lt,M as zt,bj as Mt,bk as Vt}from"./index-8A4JLNIp.js";import{S as Dt}from"./stats.module--VATS4Kh.js";class O{constructor(t=new u(0,0,0),e=new u(0,1,0),i=1){this.start=t,this.end=e,this.radius=i}clone(){return new O(this.start.clone(),this.end.clone(),this.radius)}set(t,e,i){this.start.copy(t),this.end.copy(e),this.radius=i}copy(t){this.start.copy(t.start),this.end.copy(t.end),this.radius=t.radius}getCenter(t){return t.copy(this.end).add(this.start).multiplyScalar(.5)}translate(t){this.start.add(t),this.end.add(t)}checkAABBAxis(t,e,i,r,s,n,l,a,d){return(s-t<d||s-i<d)&&(t-n<d||i-n<d)&&(l-e<d||l-r<d)&&(e-a<d||r-a<d)}intersectsBox(t){return this.checkAABBAxis(this.start.x,this.start.y,this.end.x,this.end.y,t.min.x,t.max.x,t.min.y,t.max.y,this.radius)&&this.checkAABBAxis(this.start.x,this.start.z,this.end.x,this.end.z,t.min.x,t.max.x,t.min.z,t.max.z,this.radius)&&this.checkAABBAxis(this.start.y,this.start.z,this.end.y,this.end.z,t.min.y,t.max.y,t.min.z,t.max.z,this.radius)}}const V=new u,D=new u,I=new u,F=new u,w=new gt,W=new rt,Ft=new rt,P=new ot,T=new O,Tt=new u,Bt=new u,It=new u,Pt=1e-10;function Ht(o,t,e=null,i=null){const r=Tt.copy(o.end).sub(o.start),s=Bt.copy(t.end).sub(t.start),n=It.copy(t.start).sub(o.start),l=r.dot(s),a=r.dot(r),d=s.dot(s),h=s.dot(n),p=r.dot(n);let c,b;const k=a*d-l*l;if(Math.abs(k)<Pt){const M=-h/d,L=(l-h)/d;Math.abs(M-.5)<Math.abs(L-.5)?(c=0,b=M):(c=1,b=L)}else c=(h*l+p*d)/k,b=(c*l-h)/d;b=Math.max(0,Math.min(1,b)),c=Math.max(0,Math.min(1,c)),e&&e.copy(r).multiplyScalar(c).add(o.start),i&&i.copy(s).multiplyScalar(b).add(t.start)}class J{constructor(t){this.box=t,this.bounds=new Q,this.subTrees=[],this.triangles=[],this.layers=new pt}addTriangle(t){return this.bounds.min.x=Math.min(this.bounds.min.x,t.a.x,t.b.x,t.c.x),this.bounds.min.y=Math.min(this.bounds.min.y,t.a.y,t.b.y,t.c.y),this.bounds.min.z=Math.min(this.bounds.min.z,t.a.z,t.b.z,t.c.z),this.bounds.max.x=Math.max(this.bounds.max.x,t.a.x,t.b.x,t.c.x),this.bounds.max.y=Math.max(this.bounds.max.y,t.a.y,t.b.y,t.c.y),this.bounds.max.z=Math.max(this.bounds.max.z,t.a.z,t.b.z,t.c.z),this.triangles.push(t),this}calcBox(){return this.box=this.bounds.clone(),this.box.min.x-=.01,this.box.min.y-=.01,this.box.min.z-=.01,this}split(t){if(!this.box)return;const e=[],i=D.copy(this.box.max).sub(this.box.min).multiplyScalar(.5);for(let s=0;s<2;s++)for(let n=0;n<2;n++)for(let l=0;l<2;l++){const a=new Q,d=V.set(s,n,l);a.min.copy(this.box.min).add(d.multiply(i)),a.max.copy(a.min).add(i),e.push(new J(a))}let r;for(;r=this.triangles.pop();)for(let s=0;s<e.length;s++)e[s].box.intersectsTriangle(r)&&e[s].triangles.push(r);for(let s=0;s<e.length;s++){const n=e[s].triangles.length;n>8&&t<16&&e[s].split(t+1),n!==0&&this.subTrees.push(e[s])}return this}build(){return this.calcBox(),this.split(0),this}getRayTriangles(t,e){for(let i=0;i<this.subTrees.length;i++){const r=this.subTrees[i];if(t.intersectsBox(r.box))if(r.triangles.length>0)for(let s=0;s<r.triangles.length;s++)e.indexOf(r.triangles[s])===-1&&e.push(r.triangles[s]);else r.getRayTriangles(t,e)}return e}triangleCapsuleIntersect(t,e){e.getPlane(w);const i=w.distanceToPoint(t.start)-t.radius,r=w.distanceToPoint(t.end)-t.radius;if(i>0&&r>0||i<-t.radius&&r<-t.radius)return!1;const s=Math.abs(i/(Math.abs(i)+Math.abs(r))),n=V.copy(t.start).lerp(t.end,s);if(e.containsPoint(n))return{normal:w.normal.clone(),point:n.clone(),depth:Math.abs(Math.min(i,r))};const l=t.radius*t.radius,a=W.set(t.start,t.end),d=[[e.a,e.b],[e.b,e.c],[e.c,e.a]];for(let h=0;h<d.length;h++){const p=Ft.set(d[h][0],d[h][1]);if(Ht(a,p,I,F),I.distanceToSquared(F)<l)return{normal:I.clone().sub(F).normalize(),point:F.clone(),depth:t.radius-I.distanceTo(F)}}return!1}triangleSphereIntersect(t,e){if(e.getPlane(w),!t.intersectsPlane(w))return!1;const i=Math.abs(w.distanceToSphere(t)),r=t.radius*t.radius-i*i,s=w.projectPoint(t.center,V);if(e.containsPoint(t.center))return{normal:w.normal.clone(),point:s.clone(),depth:Math.abs(w.distanceToSphere(t))};const n=[[e.a,e.b],[e.b,e.c],[e.c,e.a]];for(let l=0;l<n.length;l++){W.set(n[l][0],n[l][1]),W.closestPointToPoint(s,!0,D);const a=D.distanceToSquared(t.center);if(a<r)return{normal:t.center.clone().sub(D).normalize(),point:D.clone(),depth:t.radius-Math.sqrt(a)}}return!1}getSphereTriangles(t,e){for(let i=0;i<this.subTrees.length;i++){const r=this.subTrees[i];if(t.intersectsBox(r.box))if(r.triangles.length>0)for(let s=0;s<r.triangles.length;s++)e.indexOf(r.triangles[s])===-1&&e.push(r.triangles[s]);else r.getSphereTriangles(t,e)}}getCapsuleTriangles(t,e){for(let i=0;i<this.subTrees.length;i++){const r=this.subTrees[i];if(t.intersectsBox(r.box))if(r.triangles.length>0)for(let s=0;s<r.triangles.length;s++)e.indexOf(r.triangles[s])===-1&&e.push(r.triangles[s]);else r.getCapsuleTriangles(t,e)}}sphereIntersect(t){P.copy(t);const e=[];let i,r=!1;this.getSphereTriangles(t,e);for(let s=0;s<e.length;s++)(i=this.triangleSphereIntersect(P,e[s]))&&(r=!0,P.center.add(i.normal.multiplyScalar(i.depth)));if(r){const s=P.center.clone().sub(t.center),n=s.length();return{normal:s.normalize(),depth:n}}return!1}capsuleIntersect(t){T.copy(t);const e=[];let i,r=!1;this.getCapsuleTriangles(T,e);for(let s=0;s<e.length;s++)(i=this.triangleCapsuleIntersect(T,e[s]))&&(r=!0,T.translate(i.normal.multiplyScalar(i.depth)));if(r){const s=T.getCenter(new u).sub(t.getCenter(V)),n=s.length();return{normal:s.normalize(),depth:n}}return!1}rayIntersect(t){if(t.direction.length()===0)return;const e=[];let i,r,s=1e100;this.getRayTriangles(t,e);for(let n=0;n<e.length;n++){const l=t.intersectTriangle(e[n].a,e[n].b,e[n].c,!0,V);if(l){const a=l.sub(t.origin).length();s>a&&(r=l.clone().add(t.origin),s=a,i=e[n])}}return s<1e100?{distance:s,triangle:i,position:r}:!1}fromGraphNode(t){return t.updateWorldMatrix(!0,!0),t.traverse(e=>{if(e.isMesh===!0&&this.layers.test(e.layers)){let i,r=!1;e.geometry.index!==null?(r=!0,i=e.geometry.toNonIndexed()):i=e.geometry;const s=i.getAttribute("position");for(let n=0;n<s.count;n+=3){const l=new u().fromBufferAttribute(s,n),a=new u().fromBufferAttribute(s,n+1),d=new u().fromBufferAttribute(s,n+2);l.applyMatrix4(e.matrixWorld),a.applyMatrix4(e.matrixWorld),d.applyMatrix4(e.matrixWorld),this.addTriangle(new mt(l,a,d))}r&&i.dispose()}}),this.build(),this}clear(){return this.box=null,this.bounds.makeEmpty(),this.subTrees.length=0,this.triangles.length=0,this}}class Ot extends ft{constructor(t,e=16776960){super(new tt,new bt({color:e,toneMapped:!1})),this.octree=t,this.color=e,this.type="OctreeHelper",this.update()}update(){const t=[];function e(i){for(let r=0;r<i.length;r++){const s=i[r].box.min,n=i[r].box.max;t.push(n.x,n.y,n.z),t.push(s.x,n.y,n.z),t.push(s.x,n.y,n.z),t.push(s.x,s.y,n.z),t.push(s.x,s.y,n.z),t.push(n.x,s.y,n.z),t.push(n.x,s.y,n.z),t.push(n.x,n.y,n.z),t.push(n.x,n.y,s.z),t.push(s.x,n.y,s.z),t.push(s.x,n.y,s.z),t.push(s.x,s.y,s.z),t.push(s.x,s.y,s.z),t.push(n.x,s.y,s.z),t.push(n.x,s.y,s.z),t.push(n.x,n.y,s.z),t.push(n.x,n.y,n.z),t.push(n.x,n.y,s.z),t.push(s.x,n.y,n.z),t.push(s.x,n.y,s.z),t.push(s.x,s.y,n.z),t.push(s.x,s.y,s.z),t.push(n.x,s.y,n.z),t.push(n.x,s.y,s.z),e(i[r].subTrees)}}e(this.octree.subTrees),this.geometry.dispose(),this.geometry=new tt,this.geometry.setAttribute("position",new yt(t,3))}dispose(){this.geometry.dispose(),this.material.dispose()}}/**
|
|
2
2
|
* lil-gui
|
|
3
3
|
* https://lil-gui.georgealways.com
|
|
4
4
|
* @version 0.17.0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a3 as x,a4 as A}from"./index-
|
|
1
|
+
import{a3 as x,a4 as A}from"./index-8A4JLNIp.js";function y(){const o=new Map,s=new Map;function l(e){const i=o.get(e);if(i)return i;let r;if(e.endsWith(".glb")||e.endsWith(".gltf"))r=new Promise((t,d)=>{x.load(e,a=>t({scene:a.scene,animations:a.animations}),void 0,d)});else if(e.endsWith(".json"))r=fetch(A(e)).then(t=>{if(!t.ok)throw new Error(`Failed to fetch ${e}: ${t.status}`);return t.json()});else throw new Error(`AssetCache: unsupported file type for "${e}"`);const n=r.then(t=>(s.set(e,t),t));return o.set(e,n),n}function c(e){if(!s.has(e))throw new Error(`AssetCache: "${e}" not loaded. Call load() first and await it.`);return s.get(e)}return{load:l,get:c}}function S(o){const s=o.fixedTimestep??.016666666666666666,l=o.maxSubSteps??8,c=s*l,e=o.externalDrive??!1;let i=0,r=0,n=!1,t=0,d=1,a=!1,u=!1;function p(){typeof document>"u"||(document.hidden?n&&(n=!1,cancelAnimationFrame(t),a=!0):a&&(a=!1,n=!0,r=performance.now(),i=0,t=requestAnimationFrame(h)))}function h(f){if(!n)return;t=requestAnimationFrame(h);const m=(f-r)/1e3;r=f;const w=Math.min(m,c)*d;i+=w,i>c&&(i=c);let g=0;for(;i>=s&&g<l;)o.update(s),i-=s,g++}return{start(){if(!n&&(n=!0,a=!1,r=performance.now(),i=0,!e)){if(!u&&typeof document<"u"&&(document.addEventListener("visibilitychange",p),u=!0),typeof document<"u"&&document.hidden){n=!1,a=!0;return}t=requestAnimationFrame(h)}},stop(){n=!1,a=!1,cancelAnimationFrame(t),u&&typeof document<"u"&&(document.removeEventListener("visibilitychange",p),u=!1)},get isRunning(){return n},get liveness(){return a?"hidden-paused":n?"running":"stopped"},set timeScale(f){const m=Math.min(8,Math.max(0,f));m!==f&&console.warn(`[game-loop] timeScale ${f} is out of range [0, 8]; clamped to ${m}.`),d=m},get timeScale(){return d},get fixedDt(){return s}}}export{y as a,S as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as h,F as l,P as f,G as w,M as s,H as p,J as r,K as u,L as b,N as g}from"./index-
|
|
1
|
+
import{S as h,F as l,P as f,G as w,M as s,H as p,J as r,K as u,L as b,N as g}from"./index-8A4JLNIp.js";const c=globalThis.__vgaiGameDocument||globalThis.document,e=new h;e.name="BundleScene";e.background=new l(1053724);const n=new f(60,innerWidth/innerHeight,.1,100);n.position.set(0,1.6,5);const d=c.createElement("canvas"),t=new w({canvas:d,antialias:!0});t.setSize(innerWidth,innerHeight,!1);c.body.appendChild(d);const a=new s(new p(1,1,1),new r({color:16733491}));a.name="HeroCube";e.add(a);const i=new s(new u(.6,24,16),new r({color:3377407}));i.name="Orb";i.position.set(2.2,0,0);e.add(i);const o=new b(16777215,2.2);o.position.set(3,5,2);o.name="Sun";e.add(o);e.add(new g(4210768,1));t.setAnimationLoop(m=>{a.rotation.y=m*.001,t.render(e,n)});addEventListener("resize",()=>{n.aspect=innerWidth/innerHeight,n.updateProjectionMatrix(),t.setSize(innerWidth,innerHeight,!1)});
|