gaesup-world 1.3.2 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ControllerWrapper-C6mzwejv.cjs → ControllerWrapper-DIZhLWzV.cjs} +1 -1
- package/dist/{ControllerWrapper-Bc_pRQSv.js → ControllerWrapper-guCfO0a-.js} +3 -3
- package/dist/{CoreBridge-DdJBUxmY.js → CoreBridge-CoU_vJOo.js} +1 -0
- package/dist/CoreBridge-L4l4UNtR.cjs +1 -0
- package/dist/{Gamepad-DpCgazVm.js → Gamepad-DuJ8qWlv.js} +4 -4
- package/dist/{Gamepad-BVhh5IfO.cjs → Gamepad-Xvf4z0S2.cjs} +1 -1
- package/dist/{NodeGpuSnow-lWPqrcUV.js → NodeGpuSnow-BvYQIWMj.js} +1 -1
- package/dist/{NodeGpuSnow-C3MwTvnW.cjs → NodeGpuSnow-By8_DPWF.cjs} +1 -1
- package/dist/{NodeGrassMaterial-BMwfsBMP.cjs → NodeGrassMaterial-CbcGJsx_.cjs} +1 -1
- package/dist/{NodeGrassMaterial-W9H9z72i.js → NodeGrassMaterial-DZSpsEzt.js} +1 -1
- package/dist/{NodeTreeParticles-DDpwPxpE.cjs → NodeTreeParticles-BbFBoQik.cjs} +1 -1
- package/dist/{NodeTreeParticles-DPjRQ0wj.js → NodeTreeParticles-CWqWgN2w.js} +1 -1
- package/dist/{NodeWaterMaterial-C5fHPHUG.cjs → NodeWaterMaterial-B1rA9DRv.cjs} +1 -1
- package/dist/{NodeWaterMaterial-Bc1nkYSw.js → NodeWaterMaterial-BKvyycqz.js} +2 -2
- package/dist/{Rideable-DTSh5xu3.js → Rideable-4ECPOR3x.js} +7 -7
- package/dist/{Rideable-CWddzOkn.cjs → Rideable-CNgjDUBh.cjs} +1 -1
- package/dist/{SaveSystem-DF5zSnEj.js → SaveSystem-B9TrEpWU.js} +2 -2
- package/dist/{SaveSystem-DwfckGGo.cjs → SaveSystem-Bj41IbmF.cjs} +1 -1
- package/dist/{WorldBridge-DmvFhm9b.cjs → WorldBridge-CBEkEehK.cjs} +1 -1
- package/dist/{WorldBridge-m64VREYb.js → WorldBridge-DtqzMddm.js} +1 -1
- package/dist/{WorldContainer-BjZj0uvZ.cjs → WorldContainer-CDC2nj9-.cjs} +1 -1
- package/dist/{WorldContainer-Ce5PVxSF.js → WorldContainer-DdHlM9IG.js} +7 -7
- package/dist/{WorldPhysics-CueqwH91.cjs → WorldPhysics-CQAfZYGi.cjs} +1 -1
- package/dist/{WorldPhysics-oZdWret8.js → WorldPhysics-Dry82NpQ.js} +1 -1
- package/dist/WorldPostProcessing-C40JqbKO.js +234 -0
- package/dist/WorldPostProcessing-C9qqKrpI.cjs +1 -0
- package/dist/{WorldProps-L3Izutxz.cjs → WorldProps-C0JF5fFD.cjs} +1 -1
- package/dist/{WorldProps-CQrtF4CO.js → WorldProps-Du0EDzmt.js} +6 -7
- package/dist/{blueprints-BHfyy363.cjs → blueprints-BRMf59iu.cjs} +1 -1
- package/dist/{blueprints-BlhgrXDo.js → blueprints-BzU37Tjs.js} +2 -2
- package/dist/blueprints-editor.cjs +1 -1
- package/dist/blueprints-editor.js +7 -7
- package/dist/blueprints.cjs +1 -1
- package/dist/blueprints.js +1 -1
- package/dist/building.cjs +1 -1
- package/dist/building.js +3 -3
- package/dist/core/building/components/mesh/model/merge.d.cts +2 -1
- package/dist/core/building/components/mesh/model/merge.d.ts +2 -1
- package/dist/core/camera/bridge/types.d.cts +3 -1
- package/dist/core/camera/bridge/types.d.ts +3 -1
- package/dist/core/camera/components/CameraController/defaults.d.cts +2 -1
- package/dist/core/camera/components/CameraController/defaults.d.ts +2 -1
- package/dist/core/camera/components/CameraController/index.d.cts +4 -4
- package/dist/core/camera/components/CameraController/index.d.ts +4 -4
- package/dist/core/camera/components/CameraController/types.d.cts +16 -1
- package/dist/core/camera/components/CameraController/types.d.ts +16 -1
- package/dist/core/camera/components/index.d.cts +2 -2
- package/dist/core/camera/components/index.d.ts +2 -2
- package/dist/core/camera/controllers/BaseController.d.cts +4 -0
- package/dist/core/camera/controllers/BaseController.d.ts +4 -0
- package/dist/core/camera/core/CameraOcclusion.d.cts +60 -0
- package/dist/core/camera/core/CameraOcclusion.d.ts +60 -0
- package/dist/core/camera/core/CameraSystem.d.cts +2 -0
- package/dist/core/camera/core/CameraSystem.d.ts +2 -0
- package/dist/core/camera/core/constants.d.cts +1 -0
- package/dist/core/camera/core/constants.d.ts +1 -0
- package/dist/core/camera/core/seeThrough.d.cts +64 -0
- package/dist/core/camera/core/seeThrough.d.ts +64 -0
- package/dist/core/camera/core/types.d.cts +17 -0
- package/dist/core/camera/core/types.d.ts +17 -0
- package/dist/core/camera/utils/camera.d.cts +6 -3
- package/dist/core/camera/utils/camera.d.ts +6 -3
- package/dist/core/camera/utils/sphereSweep.d.cts +8 -1
- package/dist/core/camera/utils/sphereSweep.d.ts +8 -1
- package/dist/core/editor/components/panels/CameraSettingsTab/types.d.cts +1 -1
- package/dist/core/editor/components/panels/CameraSettingsTab/types.d.ts +1 -1
- package/dist/core/rendering/postprocess/WorldPostProcessing.d.cts +26 -1
- package/dist/core/rendering/postprocess/WorldPostProcessing.d.ts +26 -1
- package/dist/core/rendering/postprocess/screenSpaceLighting.d.cts +51 -0
- package/dist/core/rendering/postprocess/screenSpaceLighting.d.ts +51 -0
- package/dist/core/rendering/webgpu.d.cts +2 -0
- package/dist/core/rendering/webgpu.d.ts +2 -0
- package/dist/core/world/components/WorldContainer/types.d.cts +1 -1
- package/dist/core/world/components/WorldContainer/types.d.ts +1 -1
- package/dist/{defaults-jVT3EUVe.js → defaults-BmnFvrSk.js} +13 -4
- package/dist/defaults-Y3XGbDmo.cjs +1 -0
- package/dist/editor.cjs +1 -1
- package/dist/editor.js +4 -4
- package/dist/{flow-DJRTbNvJ.js → flow-B_5Jtrhv.js} +1 -1
- package/dist/{flow-BnFTzumT.cjs → flow-CY0am38O.cjs} +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.css +1 -1
- package/dist/index.js +906 -904
- package/dist/network.cjs +1 -1
- package/dist/network.js +1 -1
- package/dist/{plugin-BUKo4q0N.cjs → plugin-BY3uYoSx.cjs} +32 -32
- package/dist/{plugin-Dsf9EwPP.js → plugin-uKCTitER.js} +907 -905
- package/dist/postprocessing.cjs +1 -1
- package/dist/postprocessing.js +1 -1
- package/dist/{quality-BLE1xXFm.js → quality--izFMxKn.js} +2 -2
- package/dist/{quality-0VukPLnv.cjs → quality-CxseVZ9x.cjs} +1 -1
- package/dist/runtime.cjs +1 -1
- package/dist/runtime.js +7 -7
- package/dist/sceneCompile-CWcdcntc.cjs +1 -0
- package/dist/{sceneCompile-BWpSal9S.js → sceneCompile-CuCsjsKm.js} +99 -91
- package/dist/{sfe-DnOKmvUM.cjs → sfe-BUv2sneT.cjs} +1 -1
- package/dist/{sfe-BAXSr5BB.js → sfe-DhJQcjMq.js} +1 -1
- package/dist/shell-C82J4LTq.cjs +1 -0
- package/dist/{shell-aiiC8SLL.js → shell-Ct-ZE2ZM.js} +2565 -2515
- package/dist/{useClicker-0Ln5ZSz0.cjs → useClicker-B-fGashd.cjs} +1 -1
- package/dist/{useClicker-DZrb1I0b.js → useClicker-ChI9FA0J.js} +1 -1
- package/dist/useGenericRefs-DzuTNaAX.cjs +1 -0
- package/dist/{useGenericRefs-D0cOKidj.js → useGenericRefs-PVX2F3On.js} +553 -270
- package/dist/{useVisitRoom-GXR8KyFN.cjs → useVisitRoom-BWf5YBiG.cjs} +1 -1
- package/dist/{useVisitRoom-C_UX2avV.js → useVisitRoom-qRZdBGlH.js} +6 -6
- package/package.json +3 -3
- package/dist/CoreBridge-CnLqWZNv.cjs +0 -1
- package/dist/WorldPostProcessing-C80qMk1k.cjs +0 -1
- package/dist/WorldPostProcessing-Dfq_RW-t.js +0 -158
- package/dist/defaults-BLDQhn77.cjs +0 -1
- package/dist/sceneCompile-D9xft0op.cjs +0 -1
- package/dist/shell-BRQStYy9.cjs +0 -1
- package/dist/useGenericRefs-CZ_HIQG_.cjs +0 -1
|
@@ -2,8 +2,8 @@ import { _ as e } from "./useEngineFrame-DH3I5P9Z.js";
|
|
|
2
2
|
import { t } from "./logger-CIvdj60w.js";
|
|
3
3
|
import { n } from "./runtimeContext-IAbUva69.js";
|
|
4
4
|
import { t as r } from "./scopedStore-DgCiroRs.js";
|
|
5
|
-
import { $n as i, An as a, Dn as o, Rn as s, ar as c, er as l, rr as u, t as d, ur as f } from "./useClicker-
|
|
6
|
-
import { n as p } from "./CoreBridge-
|
|
5
|
+
import { $n as i, An as a, Dn as o, Rn as s, ar as c, er as l, rr as u, t as d, ur as f } from "./useClicker-ChI9FA0J.js";
|
|
6
|
+
import { n as p } from "./CoreBridge-CoU_vJOo.js";
|
|
7
7
|
import { t as m } from "./id-_cdNn144.js";
|
|
8
8
|
import { n as h } from "./serviceKey-DSiyXcgA.js";
|
|
9
9
|
import { r as ee } from "./weatherStore-BPDadgEH.js";
|
|
@@ -2755,10 +2755,8 @@ var er = h("npc"), { useStore: tr, useStoreApi: nr } = r("useNPCStore", () => Qn
|
|
|
2755
2755
|
onDispose() {
|
|
2756
2756
|
this.clear(), this.listeners.clear(), this.setCanvas(null), t.instance === this && (t.instance = null);
|
|
2757
2757
|
}
|
|
2758
|
-
};
|
|
2759
|
-
|
|
2760
|
-
//#region src/core/world/components/WorldProps/index.tsx
|
|
2761
|
-
function ar({ type: e = "normal", text: t, position: n, children: r, interactive: i = !0, showMinimap: a = !0 }) {
|
|
2758
|
+
}, ar = { cameraCollisionMode: "push" };
|
|
2759
|
+
function or({ type: e = "normal", text: t, position: n, children: r, interactive: i = !0, showMinimap: a = !0 }) {
|
|
2762
2760
|
let o = se(null), s = d(), c = oe(() => m("world-prop"), []), l = se({
|
|
2763
2761
|
center: new _.Vector3(),
|
|
2764
2762
|
size: new _.Vector3(),
|
|
@@ -2787,6 +2785,7 @@ function ar({ type: e = "normal", text: t, position: n, children: r, interactive
|
|
|
2787
2785
|
]), /* @__PURE__ */ ce("group", {
|
|
2788
2786
|
ref: o,
|
|
2789
2787
|
...n ? { position: n } : {},
|
|
2788
|
+
...e === "ground" ? { userData: ar } : {},
|
|
2790
2789
|
onClick: (e) => {
|
|
2791
2790
|
i && (e.stopPropagation(), s.onClick(e));
|
|
2792
2791
|
},
|
|
@@ -2812,4 +2811,4 @@ function ar({ type: e = "normal", text: t, position: n, children: r, interactive
|
|
|
2812
2811
|
});
|
|
2813
2812
|
}
|
|
2814
2813
|
//#endregion
|
|
2815
|
-
export { mt as $, N as A, At as B, Xt as C, xe as Ct, Rt as D, ye as Dt, Bt as E, ve as Et, jt as F, Dt as G, O as H, Mt as I, xt as J, _t as K, Nt as L, Pt as M, Ft as N, L as O, pe as Ot, It as P, ut as Q, Ot as R, Vt as S, De as St, Ut as T, Ce as Tt, wt as U, E as V, Et as W, T as X, Ct as Y, ft as Z, ln as _, lt as _t, tr as a, st as at, fn as b, we as bt, Z as c, Xe as ct, Sn as d, Qe as dt, ht as et, hn as f, $e as ft, xn as g, ct as gt, vn as h, Ze as ht, $n as i, at as it, P as j, zt as k, Rn as l, ot as lt, _n as m, et as mt, ir as n, dt as nt, nr as o, rt as ot, yn as p, Ye as pt, gt as q, er as r, it as rt, q as s, nt as st,
|
|
2814
|
+
export { mt as $, N as A, At as B, Xt as C, xe as Ct, Rt as D, ye as Dt, Bt as E, ve as Et, jt as F, Dt as G, O as H, Mt as I, xt as J, _t as K, Nt as L, Pt as M, Ft as N, L as O, pe as Ot, It as P, ut as Q, Ot as R, Vt as S, De as St, Ut as T, Ce as Tt, wt as U, E as V, Et as W, T as X, Ct as Y, ft as Z, ln as _, lt as _t, tr as a, st as at, fn as b, we as bt, Z as c, Xe as ct, Sn as d, Qe as dt, ht as et, hn as f, $e as ft, xn as g, ct as gt, vn as h, Ze as ht, $n as i, at as it, P as j, zt as k, Rn as l, ot as lt, _n as m, et as mt, ir as n, dt as nt, nr as o, rt as ot, yn as p, Ye as pt, gt as q, er as r, it as rt, q as s, nt as st, or as t, w as tt, Ln as u, tt as ut, dn as v, Ue as vt, Ht as w, Se as wt, Wt as x, Ie as xt, cn as y, Je as yt, kt as z };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./rolldown-runtime-Chgba0Kb.cjs"),t=require("./useEngineFrame-ujTlLQfa.cjs"),n=require("./logger-B9OaKOPw.cjs"),r=require("./runtimeContext-zx_GnKx4.cjs"),i=require("./CoreBridge-
|
|
1
|
+
const e=require("./rolldown-runtime-Chgba0Kb.cjs"),t=require("./useEngineFrame-ujTlLQfa.cjs"),n=require("./logger-B9OaKOPw.cjs"),r=require("./runtimeContext-zx_GnKx4.cjs"),i=require("./CoreBridge-L4l4UNtR.cjs"),a=require("./id-DWiNl1ym.cjs"),o=require("./WorldBridge-CBEkEehK.cjs"),s=require("./BlueprintFactory-D6FM31oL.cjs");let c=require("three");c=e.n(c,1);let l=require("react"),u=require("react/jsx-runtime"),d=require("@react-three/rapier");var f=class{static{this.blueprints=new Map}static async load(e){try{let t=await(await fetch(e)).json();return this.blueprints.set(t.id,t),t}catch(t){throw console.error(`Failed to load blueprint from ${e}:`,t),t}}static loadFromJSON(e){let t=typeof e==`string`?JSON.parse(e):e;return this.blueprints.set(t.id,t),t}static get(e){return this.blueprints.get(e)}static getAll(){return Array.from(this.blueprints.values())}static clear(){this.blueprints.clear()}};function p(e){return(0,l.useMemo)(()=>s.n.get(e),[e])}function m(e){let t=p(e);if(t?.type===`character`)return t}function h(e){let t=p(e);if(t?.type===`vehicle`)return t}function g(e){let t=p(e);if(t?.type===`airplane`)return t}function _(e){return(0,l.useMemo)(()=>s.n.getByType(e),[e])}function v(e){if(e.type===`character`){let t=e.visuals?.model?.trim();if(t)return t;let n=e.visuals?.parts?.find(e=>e.type===`body`&&e.url.trim());if(n)return n.url.trim()}let t=e.metadata?.modelUrl;return typeof t==`string`?t.trim():``}var y=`default`;function b(e){let t=r.n(),[u,d]=(0,l.useState)(!1),[f,p]=(0,l.useState)(null),m=i.o(e=>e.setMode),h=i.o(e=>e.setUrls),g=(0,l.useCallback)(async(e,r={})=>{d(!0);try{let c=s.n.get(e);if(!c)return n.t.error(`Blueprint not found: ${e}`),null;let l=t?.worldBridge??i.n.getOrCreateFor(o.t),u=t?.worldId??y;if(t&&!t.isActive()||!l?.getEngine(u))return n.t.error(`Cannot spawn blueprint: the target world is not initialized`),null;let d=a.t(c.type),f=r.position||[0,0,0],g=r.rotation||[0,0,0],_=r.scale||[1,1,1],b=x(d,c,f,g,_,r.metadata);if(!l.addObject(u,b))return null;let S=v(c);c.type===`character`?(m({type:`character`}),h({characterUrl:S})):c.type===`vehicle`?(m({type:`vehicle`}),h({vehicleUrl:S})):c.type===`airplane`&&(m({type:`airplane`}),h({airplaneUrl:S}));let C={id:d,blueprintId:c.id,type:c.type,position:f,rotation:g,scale:_,metadata:r.metadata||{}};return p(C),C}catch(e){return n.t.error(`Failed to spawn entity`,e instanceof Error?e:String(e)),null}finally{d(!1)}},[t,m,h]);return{spawnEntity:g,spawnAtCursor:(0,l.useCallback)(async n=>{let r=e??t?.worldViews.current(),i=r?.camera??(t?void 0:window.__camera);if(!i)return g(n);let a=new c.Raycaster,o=new c.Vector2(r?.pointer?.x??0,r?.pointer?.y??0);i.updateWorldMatrix(!0,!1),a.setFromCamera(o,i);let s=r?.scene??(t?void 0:window.__scene);s?.updateWorldMatrix(!0,!0);let l=s?a.intersectObjects(s.children,!0):[],u=[0,0,0],d=l[0];if(d?.point){let e=d.point;u=[e.x,e.y,e.z]}return g(n,{position:u})},[g,t,e]),spawnMultiple:(0,l.useCallback)(async(e,t,n={})=>{let r=[],i=n.spacing||2,a=n.position||[0,0,0];for(let o=0;o<t;o++){let t=[a[0]+o%5*i,a[1],a[2]+Math.floor(o/5)*i],s=await g(e,{...n,position:t});s&&r.push(s)}return r},[g]),isSpawning:u,lastSpawnedEntity:f}}function x(e,t,n,r,i,a){let o={id:e,name:t.name,position:new c.Vector3(...n),rotation:new c.Euler(...r),scale:new c.Vector3(...i),visible:!0,locked:!1,metadata:{blueprintId:t.id,...t.metadata,...a}},s=v(t),l=t.type===`vehicle`||t.type===`airplane`?t.seats:void 0,u=t.type===`character`?t.stats:void 0;return{...o,type:`active`,isActive:!0,canInteract:!0,metadata:{...o.metadata,blueprintType:t.type,characterUrl:t.type===`character`?s:``,vehicleUrl:t.type===`vehicle`?s:``,airplaneUrl:t.type===`airplane`?s:``,currentAnimation:`idle`,...u?{stats:u}:{},...l?{seats:l}:{},health:u?.health||100,maxHealth:u?.health||100,energy:u?.stamina||100,maxEnergy:u?.stamina||100,fuel:100,maxFuel:100,altitude:0}}}function S({blueprint:e,blueprintId:r,position:i=[0,0,0],rotation:a=[0,0,0],scale:o=[1,1,1],onSpawn:c,onDestroy:f,getMovementInput:p,animationClips:m,children:h}){let g=(0,l.useRef)(null),_=(0,l.useRef)(null),v=(0,l.useRef)(null),y=(0,l.useRef)(null),b=(0,l.useRef)({onSpawn:c,onDestroy:f});(0,l.useEffect)(()=>{b.current={onSpawn:c,onDestroy:f}},[c,f]),t.t(`prePhysics`,e=>{y.current?.update(e,p?.())},{label:`blueprints:spawner`}),(0,l.useEffect)(()=>{let t=s.t.getInstance(),c=!1,l=null;return(async()=>{let n=null;if(e?n=t.createEntity(e,{rigidBodyRef:g,innerGroupRef:_,outerGroupRef:v,...m?{animationClips:m}:{},position:i,rotation:a,scale:o}):r&&(n=await t.createFromId(r,{rigidBodyRef:g,innerGroupRef:_,outerGroupRef:v,...m?{animationClips:m}:{},position:i,rotation:a,scale:o})),n){if(c){n.dispose();return}l=n,y.current=n,b.current.onSpawn?.(n)}})().catch(e=>{n.t.error(`Blueprint spawn failed`,e instanceof Error?e:String(e))}),()=>{c=!0;let e=l;if(l=null,e){y.current===e&&(y.current=null);try{e.dispose()}finally{b.current.onDestroy?.()}}}},[e,r,m]);let x=e??(r?s.n.get(r):void 0),S=(x?.type??`character`)!==`character`,C=s.s(x);return(0,u.jsx)(d.RigidBody,{ref:g,type:`dynamic`,position:i,rotation:a,scale:o,enabledRotations:[S,S,S],...C,children:(0,u.jsx)(`group`,{ref:v,children:(0,u.jsx)(`group`,{ref:_,children:h})})})}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return S}});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as e } from "./useEngineFrame-DH3I5P9Z.js";
|
|
2
2
|
import { t } from "./logger-CIvdj60w.js";
|
|
3
3
|
import { n } from "./runtimeContext-IAbUva69.js";
|
|
4
|
-
import { n as r, o as i } from "./CoreBridge-
|
|
4
|
+
import { n as r, o as i } from "./CoreBridge-CoU_vJOo.js";
|
|
5
5
|
import { t as a } from "./id-_cdNn144.js";
|
|
6
|
-
import { t as o } from "./WorldBridge-
|
|
6
|
+
import { t as o } from "./WorldBridge-DtqzMddm.js";
|
|
7
7
|
import { n as s, s as c, t as l } from "./BlueprintFactory-D9JM9lZh.js";
|
|
8
8
|
import * as u from "three";
|
|
9
9
|
import { useCallback as d, useEffect as f, useMemo as p, useRef as m, useState as h } from "react";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-Chgba0Kb.cjs"),t=require("./logger-B9OaKOPw.cjs"),n=require("./WorldPhysics-CueqwH91.cjs"),r=require("./CoreBridge-CnLqWZNv.cjs"),i=require("./id-DWiNl1ym.cjs"),a=require("./defaults-BLDQhn77.cjs"),o=require("./guards-FnxbNibY.cjs"),s=require("./useGenericRefs-CZ_HIQG_.cjs"),c=require("./ControllerWrapper-C6mzwejv.cjs"),l=require("./BlueprintFactory-D6FM31oL.cjs"),u=require("./blueprints-BHfyy363.cjs"),d=require("./Gamepad-BVhh5IfO.cjs");let f=require("three");f=e.n(f,1);let p=require("react");p=e.n(p,1);let m=require("@react-three/fiber"),h=require("react/jsx-runtime"),g=require("@react-three/rapier"),_=require("@react-three/drei");var v=new Map([[`melee`,`근접`],[`tank`,`방어형`],[`starter`,`기본`],[`magic`,`마법`],[`ranged`,`원거리`],[`fire`,`화염`],[`land`,`지상`],[`fast`,`고속`],[`small`,`소형`],[`custom`,`사용자 지정`]]),y=new Map([[`character`,`캐릭터`],[`vehicle`,`차량`],[`airplane`,`비행기`],[`animation-sequence`,`애니메이션 시퀀스`],[`behavior-tree`,`행동 트리`],[`animation`,`애니메이션`],[`behavior`,`행동`],[`item`,`아이템`]]),b={id:`식별자`,name:`이름`,description:`설명`,version:`버전`,tags:`태그`,type:`유형`,metadata:`추가 정보`,physics:`물리`,mass:`질량`,height:`높이`,radius:`반지름`,jumpForce:`점프 힘`,moveSpeed:`이동 속도`,runSpeed:`달리기 속도`,airControl:`공중 조작`,maxSpeed:`최고 속도`,acceleration:`가속`,braking:`제동`,turning:`회전`,lift:`양력`,drag:`항력`,suspension:`서스펜션`,animations:`애니메이션`,idle:`대기`,walk:`걷기`,run:`달리기`,jump:`점프`,start:`시작`,loop:`반복`,land:`착지`,combat:`전투`,special:`특수 동작`,moving:`이동`,flying:`비행`,wheels:`바퀴`,propeller:`프로펠러`,behaviors:`행동`,data:`데이터`,stats:`능력치`,health:`체력`,stamina:`지구력`,mana:`마나`,strength:`공격력`,defense:`방어력`,speed:`속도`,visuals:`외형`,parts:`구성 요소`,model:`모델`,textures:`텍스처`,materials:`재질`,scale:`크기`,camera:`카메라`,controls:`조작`,seats:`좌석`,position:`위치`,rotation:`회전`,isDriver:`운전석`,mode:`모드`,distance:`거리`,fov:`시야각`,smoothing:`보간`,enableCollision:`충돌 사용`,enableZoom:`확대 사용`,zoomSpeed:`확대 속도`,minZoom:`최소 확대`,maxZoom:`최대 확대`,enableKeyboard:`키보드 사용`,enableMouse:`마우스 사용`,enableGamepad:`게임패드 사용`,clickToMove:`클릭 이동`,keyMapping:`키 설정`,clips:`클립`,transitions:`전환`,duration:`길이`,file:`파일`,events:`이벤트`,time:`시간`,from:`시작`,to:`대상`,condition:`조건`,attack_light:`가벼운 공격`,attack_heavy:`강한 공격`,block:`막기`,parry:`받아치기`,cast_fireball:`화염구 시전`,cast_meteor:`운석 시전`,cast_firewall:`화염벽 시전`,channel:`집중 시전`,meditate:`명상`,teleport:`순간 이동`,initial:`초기 상태`,states:`상태 목록`,on:`이벤트 전환`,casting:`시전 중`,meditating:`명상 중`,MOVE:`이동 시작`,ATTACK:`공격`,STOP:`정지`,FINISH:`완료`,CAST:`시전`,MEDITATE:`명상 시작`,INTERRUPT:`중단`,stiffness:`강성`,damping:`감쇠`,restLength:`기본 길이`,maxTravel:`최대 변위`,url:`파일 경로`,color:`색상`,attachmentPoint:`장착 지점`},x=e=>e?.type===`character`;function S(e,t,n){let r={...n};for(let i of Object.keys(t))!Object.is(e[i],t[i])&&Object.is(n[i],t[i])&&(Object.prototype.hasOwnProperty.call(e,i)?r[i]=e[i]:delete r[i]);return r}function C({blueprint:e}){let t=e?u.r(e):``;return!x(e)||!t?(0,h.jsxs)(`div`,{className:`blueprint-preview blueprint-preview--empty`,role:`status`,children:[(0,h.jsx)(`strong`,{children:e?.name??`미리보기`}),(0,h.jsx)(`p`,{children:e?x(e)?`몸체 모델을 지정하면 3D 미리보기가 표시됩니다.`:`이 유형의 3D 미리보기는 아직 지원하지 않습니다. 속성은 편집할 수 있습니다.`:`블루프린트를 선택하면 미리보기가 표시됩니다.`})]}):(0,h.jsx)(w,{blueprint:e,modelUrl:t})}function w({blueprint:e,modelUrl:t}){let i=r.s(),o=(0,p.useRef)(null),l=r.o(e=>e.setUrls),u=r.o(e=>e.setCameraOption),v=r.o(e=>e.setMode),y=r.o(e=>e.mode),[b,C]=(0,p.useState)(20),w=x(e)?e.controls?.clickToMove??!0:!1,T=x(e)?e.controls?.enableKeyboard??!0:!1,E=x(e)?e.controls?.enableMouse??!0:!1,D=e.controls?.enableGamepad??!1,O=e.camera;return(0,p.useEffect)(()=>{let{physics:t,setPhysics:n}=i.getState(),r=e.physics.mass>0?e.physics.jumpForce/e.physics.mass:0;n({walkSpeed:e.physics.moveSpeed,runSpeed:e.physics.runSpeed,jumpSpeed:Number.isFinite(r)?Math.max(0,r):0});let a=i.getState().physics;return()=>{i.setState(e=>({physics:S(t,a,e.physics)}))}},[e.physics.moveSpeed,e.physics.runSpeed,e.physics.jumpForce,e.physics.mass,i]),(0,p.useEffect)(()=>{let{mode:e,cameraOption:t}=i.getState(),n=O??{};v({type:`character`,controller:D?`gamepad`:`keyboard`,control:n.mode||`thirdPerson`}),u({xDistance:n.distance?.x??b,yDistance:n.distance?.y??b*.5,zDistance:n.distance?.z??b,offset:new f.Vector3(0,0,0),enableCollision:n.enableCollision??!1,smoothing:n.smoothing||{position:.25,rotation:.3,fov:.2},fov:n.fov||50,zoom:1,enableZoom:n.enableZoom??!0,zoomSpeed:n.zoomSpeed??.001,minZoom:n.minZoom||.5,maxZoom:n.maxZoom||3,enableFocus:!1,bounds:{minY:2,maxY:50}});let{mode:r,cameraOption:a}=i.getState();return()=>{let n=i.getState();n.setMode(S(e,r,n.mode)),n.replaceCameraOption(S(t,a,n.cameraOption))}},[v,u,b,O,D,i]),(0,p.useEffect)(()=>{let e=i.getState().urls.characterUrl??``;return l({characterUrl:t}),()=>{i.getState().urls.characterUrl===t&&l({characterUrl:e})}},[t,l,i]),(0,p.useEffect)(()=>{let t=o.current;if(!t)return;let n=t=>{if(!E||e.camera?.enableZoom===!1)return;t.preventDefault();let n=t.deltaY*.01;C(e=>Math.max(10,Math.min(40,e+n)))};return t.addEventListener(`wheel`,n,{passive:!1}),()=>t.removeEventListener(`wheel`,n)},[e,E]),(0,h.jsxs)(`div`,{ref:o,className:`blueprint-preview`,children:[(0,h.jsxs)(m.Canvas,{shadows:!0,camera:{position:[0,10,20],fov:50},style:{width:`100%`,height:`100%`},children:[(0,h.jsx)(n.n,{}),(0,h.jsx)(s.n,{enableMouse:E}),(0,h.jsx)(_.Environment,{preset:`sunset`}),(0,h.jsx)(`ambientLight`,{intensity:.5}),(0,h.jsx)(`directionalLight`,{castShadow:!0,position:[20,30,10],intensity:.5,"shadow-mapSize":[1024,1024],"shadow-camera-near":1,"shadow-camera-far":120,"shadow-camera-top":90,"shadow-camera-right":90,"shadow-camera-bottom":-90,"shadow-camera-left":-90}),(0,h.jsxs)(n.t,{debug:!1,gravity:[0,-9.81,0],children:[e&&y?.type===`character`&&(0,h.jsx)(c.t,{enableKeyboard:T,controllerOptions:{lerp:{cameraTurn:.1,cameraPosition:.08}},rigidBodyProps:{lockRotations:!0},parts:!x(e)||!e.visuals?.parts?[]:e.visuals.parts.filter(e=>e.type!==`body`).map(e=>e.color?{url:e.url,color:e.color}:{url:e.url}),position:[0,1,0],rotation:(0,g.euler)({x:0,y:Math.PI,z:0})},`preview-${e.id}`),E&&w&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(c.i,{}),(0,h.jsx)(c.r,{})]}),(0,h.jsx)(g.RigidBody,{type:`fixed`,children:(0,h.jsxs)(`mesh`,{receiveShadow:!0,position:[0,-.5,0],children:[(0,h.jsx)(`boxGeometry`,{args:[100,1,100]}),(0,h.jsx)(`meshStandardMaterial`,{color:`#303030`})]})}),(0,h.jsx)(_.Grid,{renderOrder:-1,position:[0,.01,0],infiniteGrid:!0,cellSize:1,cellThickness:.5,cellColor:`#404040`,sectionSize:5,sectionThickness:1,sectionColor:`#606060`,fadeDistance:50,fadeStrength:1,followCamera:!1,userData:{intangible:!0}})]})]}),D&&(0,h.jsx)(`div`,{className:`blueprint-preview__gamepad`,role:`group`,"aria-label":`화면 조작 버튼`,children:(0,h.jsx)(d.t,{})}),e&&(0,h.jsxs)(`div`,{className:`blueprint-preview__info`,children:[(0,h.jsx)(`h4`,{className:`blueprint-preview__name`,children:e.name}),x(e)&&e.physics&&(0,h.jsxs)(`div`,{className:`blueprint-preview__stats`,children:[(0,h.jsxs)(`div`,{children:[`이동 속도: `,e.physics.moveSpeed]}),(0,h.jsxs)(`div`,{children:[`점프 힘: `,e.physics.jumpForce]})]}),(0,h.jsxs)(`div`,{className:`blueprint-preview__controls`,children:[(0,h.jsxs)(`div`,{children:[`카메라: `,x(e)?a.r.find(t=>t.value===(e.camera?.mode??`thirdPerson`))?.label??`사용자 지정`:`해당 없음`]}),(0,h.jsxs)(`div`,{children:[`키보드: `,T?`켜짐`:`꺼짐`]}),(0,h.jsxs)(`div`,{children:[`마우스: `,E?`켜짐`:`꺼짐`]}),(0,h.jsxs)(`div`,{children:[`클릭 이동: `,w?`켜짐`:`꺼짐`]})]})]})]})}var T=e=>{switch(e.type){case`animation-sequence`:return`animation`;case`behavior-tree`:return`behavior`;default:return e.type}},E=e=>({id:e.id,name:e.name,type:T(e),version:e.version,tags:e.tags||[],description:e.description??``,lastModified:new Date().toISOString().split(`T`)[0]??``}),D=(e,t,n)=>{if(t.length===0)return!1;let r=e;for(let e=0;e<t.length-1;e++){let n=t[e];if(!n)return!1;if(Array.isArray(r)){let e=Number(n);if(!Number.isInteger(e)||e<0||e>=r.length)return!1;let t=r[e],i=Array.isArray(t)?[...t]:o.r(t)?{...t}:void 0;if(!i)return!1;r[e]=i,r=i;continue}if(!o.r(r))return!1;let i=r[n],a=Array.isArray(i)?[...i]:o.r(i)?{...i}:void 0;if(!a)return!1;r[n]=a,r=a}let i=t[t.length-1];if(!i)return!1;if(Array.isArray(r)){let e=Number(i);return!Number.isInteger(e)||e<0||e>=r.length?!1:(r[e]=n,!0)}return o.r(r)?(r[i]=n,!0):!1},O=[{id:`characters`,name:`캐릭터`,type:`character`,count:0},{id:`vehicles`,name:`차량`,type:`vehicle`,count:0},{id:`airplanes`,name:`비행기`,type:`airplane`,count:0},{id:`animations`,name:`애니메이션`,type:`animation`,count:0},{id:`behaviors`,name:`행동`,type:`behavior`,count:0},{id:`items`,name:`아이템`,type:`item`,count:0}],k=({onClose:e})=>{let[n,r]=(0,p.useState)(`character`),[i,s]=(0,p.useState)(null),[c,d]=(0,p.useState)(``),[f,m]=(0,p.useState)(null),[g,_]=(0,p.useState)(!0),[x,S]=(0,p.useState)(!1),{spawnAtCursor:w,isSpawning:T}=u.n(),[k,A]=(0,p.useState)(!1),[j,M]=(0,p.useState)(()=>l.n.getAll().map(E)),N=(0,p.useMemo)(()=>{let e={character:0,vehicle:0,airplane:0,animation:0,behavior:0,item:0};return j.forEach(t=>{t.type in e&&e[t.type]++}),O.map(t=>({...t,count:e[t.type]})).filter(e=>e.count>0)},[j]),P=(0,p.useMemo)(()=>{let e=c.trim().toLowerCase();return j.filter(t=>{let r=t.type===n,i=e===``||t.name.toLowerCase().includes(e)||t.tags.some(t=>t.toLowerCase().includes(e)||v.get(t)?.includes(e));return r&&i})},[n,c,j]),F=(0,p.useCallback)((e,t)=>{S(!0),m(n=>{if(!n)return null;let r={...n};return D(r,e,t)?r:n})},[]),I=(0,p.useCallback)(e=>{if(A(!1),S(!1),s(e),e){let t=l.n.get(e);t&&m(JSON.parse(JSON.stringify(t)))}else m(null)},[]);(0,p.useEffect)(()=>{if(x)return;let e=P.some(e=>e.id===i);P[0]?.id&&P.length>0&&!e?I(P[0].id):P.length===0&&I(null)},[P,i,I,x]);let L=()=>{f&&(l.n.register(f),M(l.n.getAll().map(E)),S(!1))},R=async()=>{if(f){A(!1);try{L(),await w(f.id)?e():A(!0)}catch(e){t.t.error(`Blueprint spawn failed`,e instanceof Error?e:String(e)),A(!0)}}},z=(e,t,n)=>{let r=b[e]??e;return Array.isArray(t)?(0,h.jsxs)(`details`,{className:`blueprint-editor__inspector-group`,children:[(0,h.jsxs)(`summary`,{className:`blueprint-editor__inspector-title`,children:[r,` · `,t.length===0?`비어 있음`:`${t.length}개 항목`]}),t.map((e,t)=>z(`항목 ${t+1}`,e,[...n,String(t)]))]},n.join(`.`)):o.r(t)?(0,h.jsxs)(`div`,{className:`blueprint-editor__inspector-group`,children:[(0,h.jsx)(`div`,{className:`blueprint-editor__inspector-title`,children:r}),Object.entries(t).map(([e,t])=>z(e,t,[...n,e]))]},n.join(`.`)):typeof t==`boolean`?(0,h.jsxs)(`label`,{className:`blueprint-editor__inspector-field`,children:[(0,h.jsx)(`span`,{children:r}),(0,h.jsx)(`button`,{className:`blueprint-editor__toggle ${t?`blueprint-editor__toggle--on`:``}`,onClick:()=>F(n,!t),"aria-pressed":t,children:t?`켜짐`:`꺼짐`})]},n.join(`.`)):typeof t==`number`?(0,h.jsxs)(`label`,{className:`blueprint-editor__inspector-field`,children:[(0,h.jsx)(`span`,{children:r}),(0,h.jsx)(`input`,{type:`number`,value:t,onChange:e=>F(n,Number(e.target.value)),className:`blueprint-editor__inspector-input`})]},n.join(`.`)):n.length===2&&n[0]===`camera`&&e===`mode`&&typeof t==`string`?(0,h.jsxs)(`label`,{className:`blueprint-editor__inspector-field`,children:[(0,h.jsx)(`span`,{children:`카메라 모드`}),(0,h.jsxs)(`select`,{value:t,onChange:e=>F(n,e.target.value),className:`blueprint-editor__inspector-input`,children:[!a.r.some(e=>e.value===t)&&(0,h.jsxs)(`option`,{value:t,children:[`사용자 지정 (`,t,`)`]}),a.r.map(e=>(0,h.jsx)(`option`,{value:e.value,children:e.label},e.value))]})]},n.join(`.`)):(0,h.jsxs)(`label`,{className:`blueprint-editor__inspector-field`,children:[(0,h.jsx)(`span`,{children:r}),(0,h.jsx)(`input`,{type:`text`,value:typeof t==`string`?n.length===1&&e===`type`?y.get(t)??t:t:``,readOnly:n.length===1&&(e===`id`||e===`type`),onChange:e=>F(n,e.target.value),className:`blueprint-editor__inspector-input`})]},n.join(`.`))};return(0,h.jsxs)(`div`,{className:`blueprint-editor`,children:[(0,h.jsxs)(`div`,{className:`blueprint-editor__sidebar`,children:[(0,h.jsx)(`div`,{className:`blueprint-editor__search`,children:(0,h.jsx)(`input`,{type:`text`,placeholder:`블루프린트 검색`,"aria-label":`블루프린트 검색`,disabled:x,value:c,onChange:e=>d(e.target.value),className:`blueprint-editor__search-input`})}),(0,h.jsx)(`div`,{className:`blueprint-editor__categories`,children:N.map(e=>(0,h.jsxs)(`button`,{"aria-pressed":n===e.type,disabled:x,onClick:()=>r(e.type),className:`blueprint-editor__category ${n===e.type?`active`:``}`,children:[(0,h.jsx)(`span`,{className:`blueprint-editor__category-name`,children:e.name}),(0,h.jsx)(`span`,{className:`blueprint-editor__category-count`,children:e.count})]},e.id))}),(0,h.jsxs)(`div`,{className:`blueprint-editor__list`,children:[P.map(e=>(0,h.jsxs)(`button`,{type:`button`,"aria-pressed":i===e.id,disabled:x,onClick:()=>I(e.id),className:`blueprint-editor__item ${i===e.id?`active`:``}`,children:[(0,h.jsx)(`div`,{className:`blueprint-editor__item-name`,children:e.name}),(0,h.jsx)(`div`,{className:`blueprint-editor__item-tags`,children:e.tags.map(e=>(0,h.jsx)(`span`,{className:`blueprint-editor__tag`,children:v.get(e)??e},e))})]},e.id)),P.length===0&&(0,h.jsx)(`p`,{className:`blueprint-editor__empty`,children:`조건에 맞는 블루프린트가 없습니다.`})]}),(0,h.jsxs)(`div`,{className:`blueprint-editor__actions`,children:[k&&(0,h.jsx)(`p`,{role:`alert`,className:`blueprint-editor__spawn-error`,children:`생성하지 못했습니다. 월드가 준비되어 있는지 확인한 뒤 다시 시도해 주세요.`}),(0,h.jsx)(`button`,{onClick:L,disabled:!x||!f||T,className:`blueprint-editor__spawn-button`,children:`변경 적용`}),x&&(0,h.jsx)(`button`,{type:`button`,onClick:()=>I(i),disabled:T,className:`blueprint-editor__cancel-button`,children:`변경 취소`}),(0,h.jsx)(`p`,{className:`blueprint-editor__empty`,children:x?`다른 항목으로 이동하려면 변경 사항을 적용하거나 취소해 주세요.`:`변경 사항은 현재 세션에 적용됩니다. 생성 시에도 함께 적용합니다.`}),(0,h.jsx)(`button`,{onClick:R,disabled:!i||T,className:`blueprint-editor__spawn-button`,children:T?`생성 중...`:`엔티티 생성`})]})]}),(0,h.jsxs)(`div`,{className:`blueprint-editor__main`,children:[(0,h.jsxs)(`div`,{className:`blueprint-editor__preview-section`,children:[(0,h.jsxs)(`div`,{className:`blueprint-editor__preview-header`,children:[(0,h.jsx)(`h3`,{className:`blueprint-editor__preview-title`,children:`미리보기`}),(0,h.jsx)(`button`,{onClick:()=>_(!g),className:`blueprint-editor__preview-toggle`,children:g?`숨기기`:`보기`})]}),g&&(0,h.jsx)(`div`,{className:`blueprint-editor__preview-container`,children:(0,h.jsx)(C,{blueprint:f},f?f.id:`no-blueprint`)})]}),(0,h.jsxs)(`div`,{className:`blueprint-editor__inspector-section`,children:[(0,h.jsx)(`div`,{className:`blueprint-editor__preview-header`,children:(0,h.jsx)(`h3`,{className:`blueprint-editor__preview-title`,children:`속성`})}),(0,h.jsx)(`div`,{className:`blueprint-editor__inspector`,children:f?Object.entries(f).map(([e,t])=>z(e,t,[e])):(0,h.jsx)(`div`,{className:`blueprint-editor__empty`,children:`블루프린트를 선택하세요.`})})]})]})]})},A=(e,t,n)=>{if(t.length===0)return!1;let r=e;for(let e=0;e<t.length-1;e++){let n=t[e];if(!n)return!1;if(Array.isArray(r)){let e=Number(n);if(!Number.isInteger(e)||e<0||e>=r.length)return!1;r=r[e];continue}if(!o.r(r))return!1;r=r[n]}let i=t[t.length-1];if(!i)return!1;if(Array.isArray(r)){let e=Number(i);return!Number.isInteger(e)||e<0||e>=r.length?!1:(r[e]=n,!0)}return o.r(r)?(r[i]=n,!0):!1},j=[{id:`characters`,name:`캐릭터`,type:`character`,count:0},{id:`vehicles`,name:`차량`,type:`vehicle`,count:0},{id:`airplanes`,name:`비행기`,type:`airplane`,count:0},{id:`animations`,name:`애니메이션`,type:`animation`,count:0},{id:`behaviors`,name:`행동`,type:`behavior`,count:0},{id:`items`,name:`아이템`,type:`item`,count:0}],M=({className:e=``,style:t,children:n})=>{let[r,a]=(0,p.useState)(`character`),[s,c]=(0,p.useState)(null),[d,f]=(0,p.useState)(``),[m,g]=(0,p.useState)(!1),[_,x]=(0,p.useState)(null),[S,C]=(0,p.useState)(!1),{spawnAtCursor:w,isSpawning:T}=u.n(),[D,O]=(0,p.useState)(()=>l.n.getAll().map(E)),k=(0,p.useMemo)(()=>{let e={character:0,vehicle:0,airplane:0,animation:0,behavior:0,item:0};return D.forEach(t=>{t.type in e&&e[t.type]++}),j.map(t=>({...t,count:e[t.type]}))},[D]),M=(0,p.useMemo)(()=>{let e=d.trim().toLowerCase();return D.filter(t=>{let n=t.type===r,i=e===``||t.name.toLowerCase().includes(e)||t.tags.some(t=>t.toLowerCase().includes(e)||v.get(t)?.includes(e));return n&&i})},[r,d,D]),N=e=>{c(e);let t=l.n.get(e);t&&x(JSON.parse(JSON.stringify(t)))},P=()=>{g(!0)},F=()=>{_&&(l.n.register(_),O(l.n.getAll().map(E)),g(!1),C(!1),N(_.id))},I=()=>{if(g(!1),C(!1),S){c(null),x(null);return}if(s){let e=l.n.get(s);e&&x(JSON.parse(JSON.stringify(e)))}},L=()=>{if(![`character`,`vehicle`,`airplane`].includes(r))return;let e,t={id:i.t(`custom-${r}`),name:`새 ${j.find(e=>e.type===r)?.name}`,version:`1.0.0`,tags:[`custom`],description:`사용자 지정 블루프린트`};switch(r){case`vehicle`:e={...t,type:`vehicle`,physics:{mass:1e3,maxSpeed:30,acceleration:10,braking:15,turning:2},seats:[{position:[0,1,0],isDriver:!0}],animations:{idle:``}};break;case`airplane`:e={...t,type:`airplane`,physics:{mass:2e3,maxSpeed:100,acceleration:20,turning:1,lift:50,drag:10},seats:[{position:[0,1,2],isDriver:!0}],animations:{idle:``}};break;default:e={...t,type:`character`,physics:{mass:70,height:1.8,radius:.3,jumpForce:300,moveSpeed:5,runSpeed:10,airControl:.2},animations:{idle:``,walk:``,run:``,jump:{start:``,loop:``,land:``}},stats:{health:100,stamina:50,strength:10,defense:10,speed:10}}}x(e),c(e.id),C(!0),g(!0)},R=(e,t)=>{if(!_)return;let n=JSON.parse(JSON.stringify(_));A(n,e,t)&&x(n)},z=(e,t=[])=>{let n=[];return Object.entries(e).forEach(([e,r])=>{let i=b[e]??e,a=[...t,e],s=a.join(`.`);e===`id`||e===`type`?n.push((0,h.jsxs)(`div`,{className:`property-editor__field`,children:[(0,h.jsxs)(`label`,{className:`property-editor__label editor-text-small`,children:[i,`:`]}),(0,h.jsx)(`input`,{type:`text`,value:t.length===0&&e===`type`?y.get(r)??r:r,disabled:!0,"aria-label":i,className:`property-editor__input property-editor__input--disabled`})]},s)):o.r(r)?n.push((0,h.jsxs)(`div`,{className:`property-editor__group`,children:[(0,h.jsxs)(`div`,{className:`property-editor__group-title editor-text`,children:[i,`:`]}),(0,h.jsx)(`div`,{className:`property-editor__group-content`,children:z(r,a)})]},s)):Array.isArray(r)?r.length>0&&r.every(e=>o.r(e))?n.push((0,h.jsxs)(`div`,{className:`property-editor__group`,children:[(0,h.jsxs)(`div`,{className:`property-editor__group-title editor-text`,children:[i,`:`]}),(0,h.jsx)(`div`,{className:`property-editor__group-content`,children:r.map((e,t)=>(0,h.jsxs)(`div`,{className:`property-editor__array-item`,children:[(0,h.jsxs)(`div`,{className:`property-editor__array-item-title editor-text-small`,children:[`항목 `,t+1]}),z(e,[...a,t.toString()])]},`${s}.${t}`))})]},s)):n.push((0,h.jsxs)(`div`,{className:`property-editor__field`,children:[(0,h.jsxs)(`label`,{className:`property-editor__label editor-text-small`,children:[i,`:`]}),(0,h.jsx)(`input`,{type:`text`,value:r.join(`, `),onChange:e=>R(a,e.target.value.split(`,`).map(e=>e.trim())),"aria-label":i,className:`property-editor__input`})]},s)):typeof r==`boolean`?n.push((0,h.jsx)(`div`,{className:`property-editor__field`,children:(0,h.jsxs)(`label`,{className:`property-editor__checkbox-label editor-text-small`,children:[(0,h.jsx)(`input`,{type:`checkbox`,checked:r,onChange:e=>R(a,e.target.checked),className:`property-editor__checkbox`}),i]})},s)):n.push((0,h.jsxs)(`div`,{className:`property-editor__field`,children:[(0,h.jsxs)(`label`,{className:`property-editor__label editor-text-small`,children:[i,`:`]}),(0,h.jsx)(`input`,{type:typeof r==`number`?`number`:`text`,value:r,onChange:e=>R(a,typeof r==`number`?Number(e.target.value):e.target.value),"aria-label":i,className:`property-editor__input`})]},s))}),n};return(0,h.jsxs)(`div`,{className:`blueprint-panel ${e}`,style:t,children:[(0,h.jsx)(`h3`,{className:`editor-title`,children:`블루프린트 라이브러리`}),(0,h.jsx)(`div`,{className:`blueprint-panel__toolbar`,children:(0,h.jsxs)(`div`,{className:`blueprint-panel__search-container`,children:[(0,h.jsx)(`input`,{type:`text`,placeholder:`블루프린트 검색`,"aria-label":`블루프린트 검색`,value:d,onChange:e=>f(e.target.value),className:`blueprint-panel__search-input`}),(0,h.jsx)(`button`,{onClick:L,disabled:m||![`character`,`vehicle`,`airplane`].includes(r),className:`blueprint-panel__button blueprint-panel__button--primary`,children:`+ 새 블루프린트`})]})}),(0,h.jsx)(`div`,{className:`blueprint-panel__categories`,children:k.map(e=>(0,h.jsxs)(`button`,{"aria-pressed":r===e.type,disabled:m,onClick:()=>a(e.type),className:`blueprint-panel__category-button ${r===e.type?`blueprint-panel__category-button--active`:``}`,children:[(0,h.jsx)(`span`,{children:e.name}),(0,h.jsxs)(`span`,{children:[`(`,e.count,`)`]})]},e.id))}),m?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`div`,{className:`blueprint-panel__property-editor-container editor-scrollbar`,children:_&&(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`h4`,{className:`blueprint-panel__property-editor-title editor-text`,children:S?`새 블루프린트 만들기`:`편집: ${_.name}`}),z(_)]})}),(0,h.jsx)(`div`,{className:`blueprint-panel__footer`,children:(0,h.jsxs)(`div`,{className:`blueprint-panel__footer-buttons`,children:[(0,h.jsx)(`button`,{onClick:F,className:`blueprint-panel__button blueprint-panel__button--primary`,children:S?`만들기`:`적용`}),(0,h.jsx)(`button`,{onClick:I,className:`blueprint-panel__button blueprint-panel__button--danger`,children:`취소`})]})})]}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`div`,{className:`blueprint-panel__list editor-scrollbar`,children:M.length===0?(0,h.jsx)(`div`,{className:`blueprint-panel__empty-message editor-text-small`,children:`조건에 맞는 블루프린트가 없습니다.`}):M.map(e=>(0,h.jsx)(`button`,{type:`button`,"aria-pressed":s===e.id,onClick:()=>N(e.id),className:`blueprint-panel__list-item ${s===e.id?`blueprint-panel__list-item--selected`:``}`,children:(0,h.jsxs)(`span`,{className:`list-item__content`,children:[(0,h.jsxs)(`span`,{className:`list-item__text-content`,children:[(0,h.jsx)(`span`,{className:`list-item__name editor-text`,children:e.name}),(0,h.jsx)(`span`,{className:`list-item__description editor-text-small`,children:e.description}),(0,h.jsx)(`span`,{className:`list-item__tags`,children:e.tags.map(e=>(0,h.jsx)(`span`,{className:`list-item__tag editor-text-small`,children:v.get(e)??e},e))})]}),(0,h.jsxs)(`span`,{className:`list-item__meta editor-text-small`,children:[(0,h.jsxs)(`span`,{children:[`v`,e.version]}),(0,h.jsx)(`span`,{children:e.lastModified})]})]})},e.id))}),s&&(0,h.jsx)(`div`,{className:`blueprint-panel__footer`,children:(0,h.jsxs)(`div`,{className:`blueprint-panel__footer-buttons`,children:[(0,h.jsx)(`button`,{onClick:P,className:`blueprint-panel__button blueprint-panel__button--secondary`,children:`블루프린트 편집`}),(0,h.jsx)(`button`,{onClick:async()=>{s&&await w(s)},disabled:T,className:`blueprint-panel__button blueprint-panel__button--primary`,children:T?`생성 중...`:`엔티티 생성`})]})})]}),n]})};exports.BlueprintEditor=k,exports.BlueprintPanel=M,exports.BlueprintPreview=C;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-Chgba0Kb.cjs"),t=require("./logger-B9OaKOPw.cjs"),n=require("./WorldPhysics-CQAfZYGi.cjs"),r=require("./CoreBridge-L4l4UNtR.cjs"),i=require("./id-DWiNl1ym.cjs"),a=require("./defaults-Y3XGbDmo.cjs"),o=require("./guards-FnxbNibY.cjs"),s=require("./useGenericRefs-DzuTNaAX.cjs"),c=require("./ControllerWrapper-DIZhLWzV.cjs"),l=require("./BlueprintFactory-D6FM31oL.cjs"),u=require("./blueprints-BRMf59iu.cjs"),d=require("./Gamepad-Xvf4z0S2.cjs");let f=require("three");f=e.n(f,1);let p=require("react");p=e.n(p,1);let m=require("@react-three/fiber"),h=require("react/jsx-runtime"),g=require("@react-three/rapier"),_=require("@react-three/drei");var v=new Map([[`melee`,`근접`],[`tank`,`방어형`],[`starter`,`기본`],[`magic`,`마법`],[`ranged`,`원거리`],[`fire`,`화염`],[`land`,`지상`],[`fast`,`고속`],[`small`,`소형`],[`custom`,`사용자 지정`]]),y=new Map([[`character`,`캐릭터`],[`vehicle`,`차량`],[`airplane`,`비행기`],[`animation-sequence`,`애니메이션 시퀀스`],[`behavior-tree`,`행동 트리`],[`animation`,`애니메이션`],[`behavior`,`행동`],[`item`,`아이템`]]),b={id:`식별자`,name:`이름`,description:`설명`,version:`버전`,tags:`태그`,type:`유형`,metadata:`추가 정보`,physics:`물리`,mass:`질량`,height:`높이`,radius:`반지름`,jumpForce:`점프 힘`,moveSpeed:`이동 속도`,runSpeed:`달리기 속도`,airControl:`공중 조작`,maxSpeed:`최고 속도`,acceleration:`가속`,braking:`제동`,turning:`회전`,lift:`양력`,drag:`항력`,suspension:`서스펜션`,animations:`애니메이션`,idle:`대기`,walk:`걷기`,run:`달리기`,jump:`점프`,start:`시작`,loop:`반복`,land:`착지`,combat:`전투`,special:`특수 동작`,moving:`이동`,flying:`비행`,wheels:`바퀴`,propeller:`프로펠러`,behaviors:`행동`,data:`데이터`,stats:`능력치`,health:`체력`,stamina:`지구력`,mana:`마나`,strength:`공격력`,defense:`방어력`,speed:`속도`,visuals:`외형`,parts:`구성 요소`,model:`모델`,textures:`텍스처`,materials:`재질`,scale:`크기`,camera:`카메라`,controls:`조작`,seats:`좌석`,position:`위치`,rotation:`회전`,isDriver:`운전석`,mode:`모드`,distance:`거리`,fov:`시야각`,smoothing:`보간`,enableCollision:`충돌 사용`,enableZoom:`확대 사용`,zoomSpeed:`확대 속도`,minZoom:`최소 확대`,maxZoom:`최대 확대`,enableKeyboard:`키보드 사용`,enableMouse:`마우스 사용`,enableGamepad:`게임패드 사용`,clickToMove:`클릭 이동`,keyMapping:`키 설정`,clips:`클립`,transitions:`전환`,duration:`길이`,file:`파일`,events:`이벤트`,time:`시간`,from:`시작`,to:`대상`,condition:`조건`,attack_light:`가벼운 공격`,attack_heavy:`강한 공격`,block:`막기`,parry:`받아치기`,cast_fireball:`화염구 시전`,cast_meteor:`운석 시전`,cast_firewall:`화염벽 시전`,channel:`집중 시전`,meditate:`명상`,teleport:`순간 이동`,initial:`초기 상태`,states:`상태 목록`,on:`이벤트 전환`,casting:`시전 중`,meditating:`명상 중`,MOVE:`이동 시작`,ATTACK:`공격`,STOP:`정지`,FINISH:`완료`,CAST:`시전`,MEDITATE:`명상 시작`,INTERRUPT:`중단`,stiffness:`강성`,damping:`감쇠`,restLength:`기본 길이`,maxTravel:`최대 변위`,url:`파일 경로`,color:`색상`,attachmentPoint:`장착 지점`},x=e=>e?.type===`character`;function S(e,t,n){let r={...n};for(let i of Object.keys(t))!Object.is(e[i],t[i])&&Object.is(n[i],t[i])&&(Object.prototype.hasOwnProperty.call(e,i)?r[i]=e[i]:delete r[i]);return r}function C({blueprint:e}){let t=e?u.r(e):``;return!x(e)||!t?(0,h.jsxs)(`div`,{className:`blueprint-preview blueprint-preview--empty`,role:`status`,children:[(0,h.jsx)(`strong`,{children:e?.name??`미리보기`}),(0,h.jsx)(`p`,{children:e?x(e)?`몸체 모델을 지정하면 3D 미리보기가 표시됩니다.`:`이 유형의 3D 미리보기는 아직 지원하지 않습니다. 속성은 편집할 수 있습니다.`:`블루프린트를 선택하면 미리보기가 표시됩니다.`})]}):(0,h.jsx)(w,{blueprint:e,modelUrl:t})}function w({blueprint:e,modelUrl:t}){let i=r.s(),o=(0,p.useRef)(null),l=r.o(e=>e.setUrls),u=r.o(e=>e.setCameraOption),v=r.o(e=>e.setMode),y=r.o(e=>e.mode),[b,C]=(0,p.useState)(20),w=x(e)?e.controls?.clickToMove??!0:!1,T=x(e)?e.controls?.enableKeyboard??!0:!1,E=x(e)?e.controls?.enableMouse??!0:!1,D=e.controls?.enableGamepad??!1,O=e.camera;return(0,p.useEffect)(()=>{let{physics:t,setPhysics:n}=i.getState(),r=e.physics.mass>0?e.physics.jumpForce/e.physics.mass:0;n({walkSpeed:e.physics.moveSpeed,runSpeed:e.physics.runSpeed,jumpSpeed:Number.isFinite(r)?Math.max(0,r):0});let a=i.getState().physics;return()=>{i.setState(e=>({physics:S(t,a,e.physics)}))}},[e.physics.moveSpeed,e.physics.runSpeed,e.physics.jumpForce,e.physics.mass,i]),(0,p.useEffect)(()=>{let{mode:e,cameraOption:t}=i.getState(),n=O??{};v({type:`character`,controller:D?`gamepad`:`keyboard`,control:n.mode||`thirdPerson`}),u({xDistance:n.distance?.x??b,yDistance:n.distance?.y??b*.5,zDistance:n.distance?.z??b,offset:new f.Vector3(0,0,0),enableCollision:n.enableCollision??!1,smoothing:n.smoothing||{position:.25,rotation:.3,fov:.2},fov:n.fov||50,zoom:1,enableZoom:n.enableZoom??!0,zoomSpeed:n.zoomSpeed??.001,minZoom:n.minZoom||.5,maxZoom:n.maxZoom||3,enableFocus:!1,bounds:{minY:2,maxY:50}});let{mode:r,cameraOption:a}=i.getState();return()=>{let n=i.getState();n.setMode(S(e,r,n.mode)),n.replaceCameraOption(S(t,a,n.cameraOption))}},[v,u,b,O,D,i]),(0,p.useEffect)(()=>{let e=i.getState().urls.characterUrl??``;return l({characterUrl:t}),()=>{i.getState().urls.characterUrl===t&&l({characterUrl:e})}},[t,l,i]),(0,p.useEffect)(()=>{let t=o.current;if(!t)return;let n=t=>{if(!E||e.camera?.enableZoom===!1)return;t.preventDefault();let n=t.deltaY*.01;C(e=>Math.max(10,Math.min(40,e+n)))};return t.addEventListener(`wheel`,n,{passive:!1}),()=>t.removeEventListener(`wheel`,n)},[e,E]),(0,h.jsxs)(`div`,{ref:o,className:`blueprint-preview`,children:[(0,h.jsxs)(m.Canvas,{shadows:!0,camera:{position:[0,10,20],fov:50},style:{width:`100%`,height:`100%`},children:[(0,h.jsx)(n.n,{}),(0,h.jsx)(s.n,{enableMouse:E}),(0,h.jsx)(_.Environment,{preset:`sunset`}),(0,h.jsx)(`ambientLight`,{intensity:.5}),(0,h.jsx)(`directionalLight`,{castShadow:!0,position:[20,30,10],intensity:.5,"shadow-mapSize":[1024,1024],"shadow-camera-near":1,"shadow-camera-far":120,"shadow-camera-top":90,"shadow-camera-right":90,"shadow-camera-bottom":-90,"shadow-camera-left":-90}),(0,h.jsxs)(n.t,{debug:!1,gravity:[0,-9.81,0],children:[e&&y?.type===`character`&&(0,h.jsx)(c.t,{enableKeyboard:T,controllerOptions:{lerp:{cameraTurn:.1,cameraPosition:.08}},rigidBodyProps:{lockRotations:!0},parts:!x(e)||!e.visuals?.parts?[]:e.visuals.parts.filter(e=>e.type!==`body`).map(e=>e.color?{url:e.url,color:e.color}:{url:e.url}),position:[0,1,0],rotation:(0,g.euler)({x:0,y:Math.PI,z:0})},`preview-${e.id}`),E&&w&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(c.i,{}),(0,h.jsx)(c.r,{})]}),(0,h.jsx)(g.RigidBody,{type:`fixed`,children:(0,h.jsxs)(`mesh`,{receiveShadow:!0,position:[0,-.5,0],children:[(0,h.jsx)(`boxGeometry`,{args:[100,1,100]}),(0,h.jsx)(`meshStandardMaterial`,{color:`#303030`})]})}),(0,h.jsx)(_.Grid,{renderOrder:-1,position:[0,.01,0],infiniteGrid:!0,cellSize:1,cellThickness:.5,cellColor:`#404040`,sectionSize:5,sectionThickness:1,sectionColor:`#606060`,fadeDistance:50,fadeStrength:1,followCamera:!1,userData:{intangible:!0}})]})]}),D&&(0,h.jsx)(`div`,{className:`blueprint-preview__gamepad`,role:`group`,"aria-label":`화면 조작 버튼`,children:(0,h.jsx)(d.t,{})}),e&&(0,h.jsxs)(`div`,{className:`blueprint-preview__info`,children:[(0,h.jsx)(`h4`,{className:`blueprint-preview__name`,children:e.name}),x(e)&&e.physics&&(0,h.jsxs)(`div`,{className:`blueprint-preview__stats`,children:[(0,h.jsxs)(`div`,{children:[`이동 속도: `,e.physics.moveSpeed]}),(0,h.jsxs)(`div`,{children:[`점프 힘: `,e.physics.jumpForce]})]}),(0,h.jsxs)(`div`,{className:`blueprint-preview__controls`,children:[(0,h.jsxs)(`div`,{children:[`카메라: `,x(e)?a.i.find(t=>t.value===(e.camera?.mode??`thirdPerson`))?.label??`사용자 지정`:`해당 없음`]}),(0,h.jsxs)(`div`,{children:[`키보드: `,T?`켜짐`:`꺼짐`]}),(0,h.jsxs)(`div`,{children:[`마우스: `,E?`켜짐`:`꺼짐`]}),(0,h.jsxs)(`div`,{children:[`클릭 이동: `,w?`켜짐`:`꺼짐`]})]})]})]})}var T=e=>{switch(e.type){case`animation-sequence`:return`animation`;case`behavior-tree`:return`behavior`;default:return e.type}},E=e=>({id:e.id,name:e.name,type:T(e),version:e.version,tags:e.tags||[],description:e.description??``,lastModified:new Date().toISOString().split(`T`)[0]??``}),D=(e,t,n)=>{if(t.length===0)return!1;let r=e;for(let e=0;e<t.length-1;e++){let n=t[e];if(!n)return!1;if(Array.isArray(r)){let e=Number(n);if(!Number.isInteger(e)||e<0||e>=r.length)return!1;let t=r[e],i=Array.isArray(t)?[...t]:o.r(t)?{...t}:void 0;if(!i)return!1;r[e]=i,r=i;continue}if(!o.r(r))return!1;let i=r[n],a=Array.isArray(i)?[...i]:o.r(i)?{...i}:void 0;if(!a)return!1;r[n]=a,r=a}let i=t[t.length-1];if(!i)return!1;if(Array.isArray(r)){let e=Number(i);return!Number.isInteger(e)||e<0||e>=r.length?!1:(r[e]=n,!0)}return o.r(r)?(r[i]=n,!0):!1},O=[{id:`characters`,name:`캐릭터`,type:`character`,count:0},{id:`vehicles`,name:`차량`,type:`vehicle`,count:0},{id:`airplanes`,name:`비행기`,type:`airplane`,count:0},{id:`animations`,name:`애니메이션`,type:`animation`,count:0},{id:`behaviors`,name:`행동`,type:`behavior`,count:0},{id:`items`,name:`아이템`,type:`item`,count:0}],k=({onClose:e})=>{let[n,r]=(0,p.useState)(`character`),[i,s]=(0,p.useState)(null),[c,d]=(0,p.useState)(``),[f,m]=(0,p.useState)(null),[g,_]=(0,p.useState)(!0),[x,S]=(0,p.useState)(!1),{spawnAtCursor:w,isSpawning:T}=u.n(),[k,A]=(0,p.useState)(!1),[j,M]=(0,p.useState)(()=>l.n.getAll().map(E)),N=(0,p.useMemo)(()=>{let e={character:0,vehicle:0,airplane:0,animation:0,behavior:0,item:0};return j.forEach(t=>{t.type in e&&e[t.type]++}),O.map(t=>({...t,count:e[t.type]})).filter(e=>e.count>0)},[j]),P=(0,p.useMemo)(()=>{let e=c.trim().toLowerCase();return j.filter(t=>{let r=t.type===n,i=e===``||t.name.toLowerCase().includes(e)||t.tags.some(t=>t.toLowerCase().includes(e)||v.get(t)?.includes(e));return r&&i})},[n,c,j]),F=(0,p.useCallback)((e,t)=>{S(!0),m(n=>{if(!n)return null;let r={...n};return D(r,e,t)?r:n})},[]),I=(0,p.useCallback)(e=>{if(A(!1),S(!1),s(e),e){let t=l.n.get(e);t&&m(JSON.parse(JSON.stringify(t)))}else m(null)},[]);(0,p.useEffect)(()=>{if(x)return;let e=P.some(e=>e.id===i);P[0]?.id&&P.length>0&&!e?I(P[0].id):P.length===0&&I(null)},[P,i,I,x]);let L=()=>{f&&(l.n.register(f),M(l.n.getAll().map(E)),S(!1))},R=async()=>{if(f){A(!1);try{L(),await w(f.id)?e():A(!0)}catch(e){t.t.error(`Blueprint spawn failed`,e instanceof Error?e:String(e)),A(!0)}}},z=(e,t,n)=>{let r=b[e]??e;return Array.isArray(t)?(0,h.jsxs)(`details`,{className:`blueprint-editor__inspector-group`,children:[(0,h.jsxs)(`summary`,{className:`blueprint-editor__inspector-title`,children:[r,` · `,t.length===0?`비어 있음`:`${t.length}개 항목`]}),t.map((e,t)=>z(`항목 ${t+1}`,e,[...n,String(t)]))]},n.join(`.`)):o.r(t)?(0,h.jsxs)(`div`,{className:`blueprint-editor__inspector-group`,children:[(0,h.jsx)(`div`,{className:`blueprint-editor__inspector-title`,children:r}),Object.entries(t).map(([e,t])=>z(e,t,[...n,e]))]},n.join(`.`)):typeof t==`boolean`?(0,h.jsxs)(`label`,{className:`blueprint-editor__inspector-field`,children:[(0,h.jsx)(`span`,{children:r}),(0,h.jsx)(`button`,{className:`blueprint-editor__toggle ${t?`blueprint-editor__toggle--on`:``}`,onClick:()=>F(n,!t),"aria-pressed":t,children:t?`켜짐`:`꺼짐`})]},n.join(`.`)):typeof t==`number`?(0,h.jsxs)(`label`,{className:`blueprint-editor__inspector-field`,children:[(0,h.jsx)(`span`,{children:r}),(0,h.jsx)(`input`,{type:`number`,value:t,onChange:e=>F(n,Number(e.target.value)),className:`blueprint-editor__inspector-input`})]},n.join(`.`)):n.length===2&&n[0]===`camera`&&e===`mode`&&typeof t==`string`?(0,h.jsxs)(`label`,{className:`blueprint-editor__inspector-field`,children:[(0,h.jsx)(`span`,{children:`카메라 모드`}),(0,h.jsxs)(`select`,{value:t,onChange:e=>F(n,e.target.value),className:`blueprint-editor__inspector-input`,children:[!a.i.some(e=>e.value===t)&&(0,h.jsxs)(`option`,{value:t,children:[`사용자 지정 (`,t,`)`]}),a.i.map(e=>(0,h.jsx)(`option`,{value:e.value,children:e.label},e.value))]})]},n.join(`.`)):(0,h.jsxs)(`label`,{className:`blueprint-editor__inspector-field`,children:[(0,h.jsx)(`span`,{children:r}),(0,h.jsx)(`input`,{type:`text`,value:typeof t==`string`?n.length===1&&e===`type`?y.get(t)??t:t:``,readOnly:n.length===1&&(e===`id`||e===`type`),onChange:e=>F(n,e.target.value),className:`blueprint-editor__inspector-input`})]},n.join(`.`))};return(0,h.jsxs)(`div`,{className:`blueprint-editor`,children:[(0,h.jsxs)(`div`,{className:`blueprint-editor__sidebar`,children:[(0,h.jsx)(`div`,{className:`blueprint-editor__search`,children:(0,h.jsx)(`input`,{type:`text`,placeholder:`블루프린트 검색`,"aria-label":`블루프린트 검색`,disabled:x,value:c,onChange:e=>d(e.target.value),className:`blueprint-editor__search-input`})}),(0,h.jsx)(`div`,{className:`blueprint-editor__categories`,children:N.map(e=>(0,h.jsxs)(`button`,{"aria-pressed":n===e.type,disabled:x,onClick:()=>r(e.type),className:`blueprint-editor__category ${n===e.type?`active`:``}`,children:[(0,h.jsx)(`span`,{className:`blueprint-editor__category-name`,children:e.name}),(0,h.jsx)(`span`,{className:`blueprint-editor__category-count`,children:e.count})]},e.id))}),(0,h.jsxs)(`div`,{className:`blueprint-editor__list`,children:[P.map(e=>(0,h.jsxs)(`button`,{type:`button`,"aria-pressed":i===e.id,disabled:x,onClick:()=>I(e.id),className:`blueprint-editor__item ${i===e.id?`active`:``}`,children:[(0,h.jsx)(`div`,{className:`blueprint-editor__item-name`,children:e.name}),(0,h.jsx)(`div`,{className:`blueprint-editor__item-tags`,children:e.tags.map(e=>(0,h.jsx)(`span`,{className:`blueprint-editor__tag`,children:v.get(e)??e},e))})]},e.id)),P.length===0&&(0,h.jsx)(`p`,{className:`blueprint-editor__empty`,children:`조건에 맞는 블루프린트가 없습니다.`})]}),(0,h.jsxs)(`div`,{className:`blueprint-editor__actions`,children:[k&&(0,h.jsx)(`p`,{role:`alert`,className:`blueprint-editor__spawn-error`,children:`생성하지 못했습니다. 월드가 준비되어 있는지 확인한 뒤 다시 시도해 주세요.`}),(0,h.jsx)(`button`,{onClick:L,disabled:!x||!f||T,className:`blueprint-editor__spawn-button`,children:`변경 적용`}),x&&(0,h.jsx)(`button`,{type:`button`,onClick:()=>I(i),disabled:T,className:`blueprint-editor__cancel-button`,children:`변경 취소`}),(0,h.jsx)(`p`,{className:`blueprint-editor__empty`,children:x?`다른 항목으로 이동하려면 변경 사항을 적용하거나 취소해 주세요.`:`변경 사항은 현재 세션에 적용됩니다. 생성 시에도 함께 적용합니다.`}),(0,h.jsx)(`button`,{onClick:R,disabled:!i||T,className:`blueprint-editor__spawn-button`,children:T?`생성 중...`:`엔티티 생성`})]})]}),(0,h.jsxs)(`div`,{className:`blueprint-editor__main`,children:[(0,h.jsxs)(`div`,{className:`blueprint-editor__preview-section`,children:[(0,h.jsxs)(`div`,{className:`blueprint-editor__preview-header`,children:[(0,h.jsx)(`h3`,{className:`blueprint-editor__preview-title`,children:`미리보기`}),(0,h.jsx)(`button`,{onClick:()=>_(!g),className:`blueprint-editor__preview-toggle`,children:g?`숨기기`:`보기`})]}),g&&(0,h.jsx)(`div`,{className:`blueprint-editor__preview-container`,children:(0,h.jsx)(C,{blueprint:f},f?f.id:`no-blueprint`)})]}),(0,h.jsxs)(`div`,{className:`blueprint-editor__inspector-section`,children:[(0,h.jsx)(`div`,{className:`blueprint-editor__preview-header`,children:(0,h.jsx)(`h3`,{className:`blueprint-editor__preview-title`,children:`속성`})}),(0,h.jsx)(`div`,{className:`blueprint-editor__inspector`,children:f?Object.entries(f).map(([e,t])=>z(e,t,[e])):(0,h.jsx)(`div`,{className:`blueprint-editor__empty`,children:`블루프린트를 선택하세요.`})})]})]})]})},A=(e,t,n)=>{if(t.length===0)return!1;let r=e;for(let e=0;e<t.length-1;e++){let n=t[e];if(!n)return!1;if(Array.isArray(r)){let e=Number(n);if(!Number.isInteger(e)||e<0||e>=r.length)return!1;r=r[e];continue}if(!o.r(r))return!1;r=r[n]}let i=t[t.length-1];if(!i)return!1;if(Array.isArray(r)){let e=Number(i);return!Number.isInteger(e)||e<0||e>=r.length?!1:(r[e]=n,!0)}return o.r(r)?(r[i]=n,!0):!1},j=[{id:`characters`,name:`캐릭터`,type:`character`,count:0},{id:`vehicles`,name:`차량`,type:`vehicle`,count:0},{id:`airplanes`,name:`비행기`,type:`airplane`,count:0},{id:`animations`,name:`애니메이션`,type:`animation`,count:0},{id:`behaviors`,name:`행동`,type:`behavior`,count:0},{id:`items`,name:`아이템`,type:`item`,count:0}],M=({className:e=``,style:t,children:n})=>{let[r,a]=(0,p.useState)(`character`),[s,c]=(0,p.useState)(null),[d,f]=(0,p.useState)(``),[m,g]=(0,p.useState)(!1),[_,x]=(0,p.useState)(null),[S,C]=(0,p.useState)(!1),{spawnAtCursor:w,isSpawning:T}=u.n(),[D,O]=(0,p.useState)(()=>l.n.getAll().map(E)),k=(0,p.useMemo)(()=>{let e={character:0,vehicle:0,airplane:0,animation:0,behavior:0,item:0};return D.forEach(t=>{t.type in e&&e[t.type]++}),j.map(t=>({...t,count:e[t.type]}))},[D]),M=(0,p.useMemo)(()=>{let e=d.trim().toLowerCase();return D.filter(t=>{let n=t.type===r,i=e===``||t.name.toLowerCase().includes(e)||t.tags.some(t=>t.toLowerCase().includes(e)||v.get(t)?.includes(e));return n&&i})},[r,d,D]),N=e=>{c(e);let t=l.n.get(e);t&&x(JSON.parse(JSON.stringify(t)))},P=()=>{g(!0)},F=()=>{_&&(l.n.register(_),O(l.n.getAll().map(E)),g(!1),C(!1),N(_.id))},I=()=>{if(g(!1),C(!1),S){c(null),x(null);return}if(s){let e=l.n.get(s);e&&x(JSON.parse(JSON.stringify(e)))}},L=()=>{if(![`character`,`vehicle`,`airplane`].includes(r))return;let e,t={id:i.t(`custom-${r}`),name:`새 ${j.find(e=>e.type===r)?.name}`,version:`1.0.0`,tags:[`custom`],description:`사용자 지정 블루프린트`};switch(r){case`vehicle`:e={...t,type:`vehicle`,physics:{mass:1e3,maxSpeed:30,acceleration:10,braking:15,turning:2},seats:[{position:[0,1,0],isDriver:!0}],animations:{idle:``}};break;case`airplane`:e={...t,type:`airplane`,physics:{mass:2e3,maxSpeed:100,acceleration:20,turning:1,lift:50,drag:10},seats:[{position:[0,1,2],isDriver:!0}],animations:{idle:``}};break;default:e={...t,type:`character`,physics:{mass:70,height:1.8,radius:.3,jumpForce:300,moveSpeed:5,runSpeed:10,airControl:.2},animations:{idle:``,walk:``,run:``,jump:{start:``,loop:``,land:``}},stats:{health:100,stamina:50,strength:10,defense:10,speed:10}}}x(e),c(e.id),C(!0),g(!0)},R=(e,t)=>{if(!_)return;let n=JSON.parse(JSON.stringify(_));A(n,e,t)&&x(n)},z=(e,t=[])=>{let n=[];return Object.entries(e).forEach(([e,r])=>{let i=b[e]??e,a=[...t,e],s=a.join(`.`);e===`id`||e===`type`?n.push((0,h.jsxs)(`div`,{className:`property-editor__field`,children:[(0,h.jsxs)(`label`,{className:`property-editor__label editor-text-small`,children:[i,`:`]}),(0,h.jsx)(`input`,{type:`text`,value:t.length===0&&e===`type`?y.get(r)??r:r,disabled:!0,"aria-label":i,className:`property-editor__input property-editor__input--disabled`})]},s)):o.r(r)?n.push((0,h.jsxs)(`div`,{className:`property-editor__group`,children:[(0,h.jsxs)(`div`,{className:`property-editor__group-title editor-text`,children:[i,`:`]}),(0,h.jsx)(`div`,{className:`property-editor__group-content`,children:z(r,a)})]},s)):Array.isArray(r)?r.length>0&&r.every(e=>o.r(e))?n.push((0,h.jsxs)(`div`,{className:`property-editor__group`,children:[(0,h.jsxs)(`div`,{className:`property-editor__group-title editor-text`,children:[i,`:`]}),(0,h.jsx)(`div`,{className:`property-editor__group-content`,children:r.map((e,t)=>(0,h.jsxs)(`div`,{className:`property-editor__array-item`,children:[(0,h.jsxs)(`div`,{className:`property-editor__array-item-title editor-text-small`,children:[`항목 `,t+1]}),z(e,[...a,t.toString()])]},`${s}.${t}`))})]},s)):n.push((0,h.jsxs)(`div`,{className:`property-editor__field`,children:[(0,h.jsxs)(`label`,{className:`property-editor__label editor-text-small`,children:[i,`:`]}),(0,h.jsx)(`input`,{type:`text`,value:r.join(`, `),onChange:e=>R(a,e.target.value.split(`,`).map(e=>e.trim())),"aria-label":i,className:`property-editor__input`})]},s)):typeof r==`boolean`?n.push((0,h.jsx)(`div`,{className:`property-editor__field`,children:(0,h.jsxs)(`label`,{className:`property-editor__checkbox-label editor-text-small`,children:[(0,h.jsx)(`input`,{type:`checkbox`,checked:r,onChange:e=>R(a,e.target.checked),className:`property-editor__checkbox`}),i]})},s)):n.push((0,h.jsxs)(`div`,{className:`property-editor__field`,children:[(0,h.jsxs)(`label`,{className:`property-editor__label editor-text-small`,children:[i,`:`]}),(0,h.jsx)(`input`,{type:typeof r==`number`?`number`:`text`,value:r,onChange:e=>R(a,typeof r==`number`?Number(e.target.value):e.target.value),"aria-label":i,className:`property-editor__input`})]},s))}),n};return(0,h.jsxs)(`div`,{className:`blueprint-panel ${e}`,style:t,children:[(0,h.jsx)(`h3`,{className:`editor-title`,children:`블루프린트 라이브러리`}),(0,h.jsx)(`div`,{className:`blueprint-panel__toolbar`,children:(0,h.jsxs)(`div`,{className:`blueprint-panel__search-container`,children:[(0,h.jsx)(`input`,{type:`text`,placeholder:`블루프린트 검색`,"aria-label":`블루프린트 검색`,value:d,onChange:e=>f(e.target.value),className:`blueprint-panel__search-input`}),(0,h.jsx)(`button`,{onClick:L,disabled:m||![`character`,`vehicle`,`airplane`].includes(r),className:`blueprint-panel__button blueprint-panel__button--primary`,children:`+ 새 블루프린트`})]})}),(0,h.jsx)(`div`,{className:`blueprint-panel__categories`,children:k.map(e=>(0,h.jsxs)(`button`,{"aria-pressed":r===e.type,disabled:m,onClick:()=>a(e.type),className:`blueprint-panel__category-button ${r===e.type?`blueprint-panel__category-button--active`:``}`,children:[(0,h.jsx)(`span`,{children:e.name}),(0,h.jsxs)(`span`,{children:[`(`,e.count,`)`]})]},e.id))}),m?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`div`,{className:`blueprint-panel__property-editor-container editor-scrollbar`,children:_&&(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`h4`,{className:`blueprint-panel__property-editor-title editor-text`,children:S?`새 블루프린트 만들기`:`편집: ${_.name}`}),z(_)]})}),(0,h.jsx)(`div`,{className:`blueprint-panel__footer`,children:(0,h.jsxs)(`div`,{className:`blueprint-panel__footer-buttons`,children:[(0,h.jsx)(`button`,{onClick:F,className:`blueprint-panel__button blueprint-panel__button--primary`,children:S?`만들기`:`적용`}),(0,h.jsx)(`button`,{onClick:I,className:`blueprint-panel__button blueprint-panel__button--danger`,children:`취소`})]})})]}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`div`,{className:`blueprint-panel__list editor-scrollbar`,children:M.length===0?(0,h.jsx)(`div`,{className:`blueprint-panel__empty-message editor-text-small`,children:`조건에 맞는 블루프린트가 없습니다.`}):M.map(e=>(0,h.jsx)(`button`,{type:`button`,"aria-pressed":s===e.id,onClick:()=>N(e.id),className:`blueprint-panel__list-item ${s===e.id?`blueprint-panel__list-item--selected`:``}`,children:(0,h.jsxs)(`span`,{className:`list-item__content`,children:[(0,h.jsxs)(`span`,{className:`list-item__text-content`,children:[(0,h.jsx)(`span`,{className:`list-item__name editor-text`,children:e.name}),(0,h.jsx)(`span`,{className:`list-item__description editor-text-small`,children:e.description}),(0,h.jsx)(`span`,{className:`list-item__tags`,children:e.tags.map(e=>(0,h.jsx)(`span`,{className:`list-item__tag editor-text-small`,children:v.get(e)??e},e))})]}),(0,h.jsxs)(`span`,{className:`list-item__meta editor-text-small`,children:[(0,h.jsxs)(`span`,{children:[`v`,e.version]}),(0,h.jsx)(`span`,{children:e.lastModified})]})]})},e.id))}),s&&(0,h.jsx)(`div`,{className:`blueprint-panel__footer`,children:(0,h.jsxs)(`div`,{className:`blueprint-panel__footer-buttons`,children:[(0,h.jsx)(`button`,{onClick:P,className:`blueprint-panel__button blueprint-panel__button--secondary`,children:`블루프린트 편집`}),(0,h.jsx)(`button`,{onClick:async()=>{s&&await w(s)},disabled:T,className:`blueprint-panel__button blueprint-panel__button--primary`,children:T?`생성 중...`:`엔티티 생성`})]})})]}),n]})};exports.BlueprintEditor=k,exports.BlueprintPanel=M,exports.BlueprintPreview=C;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { t as e } from "./logger-CIvdj60w.js";
|
|
2
|
-
import { n as t, t as n } from "./WorldPhysics-
|
|
3
|
-
import { o as r, s as i } from "./CoreBridge-
|
|
2
|
+
import { n as t, t as n } from "./WorldPhysics-Dry82NpQ.js";
|
|
3
|
+
import { o as r, s as i } from "./CoreBridge-CoU_vJOo.js";
|
|
4
4
|
import { t as a } from "./id-_cdNn144.js";
|
|
5
|
-
import {
|
|
5
|
+
import { i as o } from "./defaults-BmnFvrSk.js";
|
|
6
6
|
import { r as s } from "./guards-DxYgyyOk.js";
|
|
7
|
-
import { n as c } from "./useGenericRefs-
|
|
8
|
-
import { i as l, r as u, t as d } from "./ControllerWrapper-
|
|
7
|
+
import { n as c } from "./useGenericRefs-PVX2F3On.js";
|
|
8
|
+
import { i as l, r as u, t as d } from "./ControllerWrapper-guCfO0a-.js";
|
|
9
9
|
import { n as f } from "./BlueprintFactory-D9JM9lZh.js";
|
|
10
|
-
import { n as p, r as m } from "./blueprints-
|
|
11
|
-
import { t as h } from "./Gamepad-
|
|
10
|
+
import { n as p, r as m } from "./blueprints-BzU37Tjs.js";
|
|
11
|
+
import { t as h } from "./Gamepad-DuJ8qWlv.js";
|
|
12
12
|
import { t as g } from "./legacyDrei-B6cWIHbX.js";
|
|
13
13
|
import * as _ from "three";
|
|
14
14
|
import { useCallback as v, useEffect as y, useMemo as b, useRef as x, useState as S } from "react";
|
package/dist/blueprints.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./BlueprintFactory-D6FM31oL.cjs"),t=require("./blueprints-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./BlueprintFactory-D6FM31oL.cjs"),t=require("./blueprints-BRMf59iu.cjs");exports.BASIC_KART_BLUEPRINT=e.r,exports.BaseComponent=e.d,exports.BlueprintConverter=e.o,exports.BlueprintEntity=e.u,exports.BlueprintFactory=e.t,exports.BlueprintLoader=t.l,exports.BlueprintSpawner=t.t,exports.ComponentRegistry=e.f,exports.FIRE_MAGE_BLUEPRINT=e.a,exports.GravityForceComponent=e.l,exports.WARRIOR_BLUEPRINT=e.i,exports.blueprintRegistry=e.n,exports.registerDefaultComponents=e.c,exports.useAirplaneBlueprint=t.i,exports.useBlueprint=t.a,exports.useBlueprintsByType=t.o,exports.useCharacterBlueprint=t.s,exports.useSpawnFromBlueprint=t.n,exports.useVehicleBlueprint=t.c;
|
package/dist/blueprints.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { a as e, c as t, d as n, f as r, i, l as a, n as o, o as s, r as c, t as l, u } from "./BlueprintFactory-D9JM9lZh.js";
|
|
2
|
-
import { a as d, c as f, i as p, l as m, n as h, o as g, s as _, t as v } from "./blueprints-
|
|
2
|
+
import { a as d, c as f, i as p, l as m, n as h, o as g, s as _, t as v } from "./blueprints-BzU37Tjs.js";
|
|
3
3
|
export { c as BASIC_KART_BLUEPRINT, n as BaseComponent, s as BlueprintConverter, u as BlueprintEntity, l as BlueprintFactory, m as BlueprintLoader, v as BlueprintSpawner, r as ComponentRegistry, e as FIRE_MAGE_BLUEPRINT, a as GravityForceComponent, i as WARRIOR_BLUEPRINT, o as blueprintRegistry, t as registerDefaultComponents, p as useAirplaneBlueprint, d as useBlueprint, g as useBlueprintsByType, _ as useCharacterBlueprint, h as useSpawnFromBlueprint, f as useVehicleBlueprint };
|
package/dist/building.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./useClicker-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./useClicker-B-fGashd.cjs"),t=require("./WorldProps-C0JF5fFD.cjs"),n=require("./plugin-BY3uYoSx.cjs");exports.BUILDING_BASIC_OBJECT_OPTIONS=e.Yt,exports.BUILDING_FLAG_STYLE_OPTIONS=e.Xt,exports.BUILDING_PLACED_OBJECT_OPTIONS=e.Zt,exports.BUILDING_STORE_SERVICE=e.Vt,exports.BUILDING_TILE_GROUP_DRAG_TYPE=e.Qt,exports.BUILDING_TILE_OBJECT_OPTIONS=e.$t,exports.BUILDING_TILE_PRESETS=e.en,exports.BUILDING_TILE_PRESET_DRAG_TYPE=e.tn,exports.BUILDING_TILE_SHAPE_OPTIONS=e.nn,exports.BUILDING_TREE_COLOR_PRESETS=e.rn,exports.BUILDING_TREE_OPTIONS=e.in,exports.BUILDING_WALL_KIND_OPTIONS=e.an,exports.BUILDING_WALL_PRESETS=e.on,exports.BUILDING_WEATHER_EFFECT_OPTIONS=e.sn,exports.BUILDING_WORLD_SURFACE_OPTIONS=e.cn,exports.Billboard=n.U,exports.BlockSystem=n.K,exports.BuildingController=n.h,exports.BuildingGpuCullingDriver=n.f,exports.BuildingGpuMirrorDriver=n.m,exports.BuildingGpuUploadDriver=n.p,exports.BuildingIndirectArgsUploadDriver=n.u,exports.BuildingIndirectDrawDriver=n.d,exports.BuildingNavigationObstacleDriver=n.tt,exports.BuildingRenderStateDriver=n._,exports.BuildingSystem=n.x,exports.BuildingUI=n.s,exports.BuildingVisibilityDriver=n.g,exports.DEFAULT_BUILDING_GRID_EXTENSION_ID=n.t,exports.DEFAULT_BUILDING_OBJECT_CATALOG=n.rt,exports.DEFAULT_BUILDING_PLACEMENT_EXTENSION_ID=n.n,exports.DEFAULT_BUILDING_SAVE_EXTENSION_ID=n.r,exports.DEFAULT_BUILDING_STORE_SERVICE_ID=n.i,exports.DRAW_CLUSTER_BILLBOARD=t.rt,exports.DRAW_CLUSTER_BLOCK=t.it,exports.DRAW_CLUSTER_COUNT=t.at,exports.DRAW_CLUSTER_DESCRIPTORS=t.Z,exports.DRAW_CLUSTER_FIRE=t.ot,exports.DRAW_CLUSTER_FLAG=t.st,exports.DRAW_CLUSTER_GRASS=t.ct,exports.DRAW_CLUSTER_MODEL=t.lt,exports.DRAW_CLUSTER_SAKURA=t.ut,exports.DRAW_CLUSTER_SAND=t.dt,exports.DRAW_CLUSTER_SNOWFIELD=t.ft,exports.DRAW_CLUSTER_TILE=t.pt,exports.DRAW_CLUSTER_WALL=t.mt,exports.DRAW_CLUSTER_WATER=t.ht,exports.FLAG_STYLE_META=e.ln,exports.Fire=n.H,exports.GPU_META_STRIDE=t.K,exports.GPU_SPATIAL_STRIDE=t.q,exports.GpuBatchBridge=n.J,exports.Grass=n.O,exports.GrassDriver=n.z,exports.GrassManagerProvider=n.B,exports.GridHelper=n.W,exports.INDIRECT_DRAW_STRIDE=t.Q,exports.MaterialManager=n.q,exports.Sakura=n.L,exports.SakuraBatch=n.R,exports.Sand=n.E,exports.SandBatch=n.D,exports.Snow=n.I,exports.Snowfield=n.w,exports.SnowfieldBatch=n.T,exports.TileSystem=n.C,exports.WallSystem=n.S,exports.Water=n.A,exports.applyBuildingNavigationObstacles=n.nt,exports.blockToPlacementEntry=e.un,exports.buildBuildingGpuMirror=t.J,exports.buildBuildingIndirectDrawMirror=t.$,exports.buildingCellToWorld=e.dn,exports.buildingGridAdapter=e.fn,exports.buildingGroupsToPlacementEntries=e.pn,exports.buildingPlacementAdapter=e.mn,exports.buildingPlugin=n.a,exports.cellToTilePosition=e.hn,exports.createBlockFootprint=e.gn,exports.createBuildingCullingStore=t.Ct,exports.createBuildingGpuUploadPlan=t.Y,exports.createBuildingIndirectDrawUploadPlan=t.et,exports.createBuildingPlacementEngine=e._n,exports.createBuildingPlugin=n.o,exports.createBuildingRenderStore=t.R,exports.createBuildingScopeId=n.l,exports.createBuildingStore=e.Ht,exports.createBuildingVisibilityStore=t.F,exports.createCustomMeshId=n.c,exports.createEmptyBuildingGpuUploadResources=t.V,exports.createEmptyBuildingIndirectDrawMirror=t.tt,exports.createEmptyGpuMirror=t.X,exports.createGrassManager=t.Et,exports.createShoreField=n.M,exports.createTerrainBlockMaterial=n.v,exports.createTileFootprint=e.vn,exports.createTileSampler=n.Z,exports.destroyBuildingGpuUploadResources=t.H,exports.edgeKey=e.yn,exports.edgeSideToWallRotation=e.bn,exports.edgeToWallTransform=e.xn,exports.findTerrainBlockMaterial=n.y,exports.getBlockSupportHeight=e.Sn,exports.getBuildingSupportHeight=e.Cn,exports.getDefaultBuildingObject=n.it,exports.getDrawClusterForSnapshotEntry=t.gt,exports.getGrassManager=t.Dt,exports.getIndirectInstanceCount=t.nt,exports.getTileSupportHeight=e.wn,exports.getWallMaterialKey=n.G,exports.getWebGPUDeviceFromRenderer=t.U,exports.hasTileCollision=e.Tn,exports.hasWallCollision=e.En,exports.indexAabb=e.Dn,exports.normalizeQuarterTurnRotation=e.On,exports.pair=e.kn,exports.parseBuildingGpuVisibilityFlags=t._t,exports.queryAabbIds=e.An,exports.snapBuildingPosition=e.jn,exports.supportsGpuInstanceBatches=n.Y,exports.syncBuildingGpuBuffers=t.W,exports.syncBuildingIndirectArgsBuffer=t.G,exports.tileFootprintKeys=e.Mn,exports.tileGroupToPlacementEntries=e.Nn,exports.tileHalfSize=e.Pn,exports.tileOverlaps=e.Fn,exports.tilePositionToCell=e.In,exports.tileToPlacementEntry=e.Ln,exports.unindexId=e.Rn,exports.useBuildingEditor=n.b,exports.useBuildingGpuCullingStore=t.wt,exports.useBuildingGpuCullingStoreApi=t.Tt,exports.useBuildingRenderStateStore=t.z,exports.useBuildingRenderStateStoreApi=t.B,exports.useBuildingStore=e.Ut,exports.useBuildingStoreApi=e.Wt,exports.useBuildingVisibilityStore=t.I,exports.useBuildingVisibilityStoreApi=t.L,exports.useGrassManager=n.V,exports.useShoreField=n.j,exports.wallGroupToPlacementEntries=e.zn,exports.wallToPlacementEntry=e.Bn,exports.wallTransformToEdge=e.Vn,exports.worldToBuildingCell=e.Hn,exports.zigZag=e.Un;
|
package/dist/building.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $t as e, An as t, Bn as n, Cn as r, Dn as i, En as a, Fn as o, Hn as s, Ht as c, In as l, Ln as u, Mn as d, Nn as f, On as p, Pn as m, Qt as h, Rn as g, Sn as _, Tn as v, Un as y, Ut as b, Vn as x, Vt as S, Wt as C, Xt as w, Yt as T, Zt as E, _n as D, an as O, bn as k, cn as A, dn as j, en as M, fn as N, gn as P, hn as F, in as I, jn as L, kn as R, ln as z, mn as B, nn as V, on as H, pn as U, rn as W, sn as G, tn as K, un as q, vn as J, wn as Y, xn as X, yn as Z, zn as Q } from "./useClicker-
|
|
2
|
-
import { $, B as ee, Ct as te, Dt as ne, Et as re, F as ie, G as ae, H as oe, I as se, J as ce, K as le, L as ue, Q as de, R as fe, Tt as pe, U as me, V as he, W as ge, X as _e, Y as ve, Z as ye, _t as be, at as xe, ct as Se, dt as Ce, et as we, ft as Te, gt as Ee, ht as De, it as Oe, lt as ke, mt as Ae, nt as je, ot as Me, pt as Ne, q as Pe, rt as Fe, st as Ie, tt as Le, ut as Re, wt as ze, z as Be } from "./WorldProps-
|
|
3
|
-
import { A as Ve, B as He, C as Ue, D as We, E as Ge, G as Ke, H as qe, I as Je, J as Ye, K as Xe, L as Ze, M as Qe, O as $e, R as et, S as tt, T as nt, U as rt, V as it, W as at, Y as ot, Z as st, _ as ct, a as lt, b as ut, c as dt, d as ft, f as pt, g as mt, h as ht, i as gt, it as _t, j as vt, l as yt, m as bt, n as xt, nt as St, o as Ct, p as wt, q as Tt, r as Et, rt as Dt, s as Ot, t as kt, tt as At, u as jt, v as Mt, w as Nt, x as Pt, y as Ft, z as It } from "./plugin-
|
|
1
|
+
import { $t as e, An as t, Bn as n, Cn as r, Dn as i, En as a, Fn as o, Hn as s, Ht as c, In as l, Ln as u, Mn as d, Nn as f, On as p, Pn as m, Qt as h, Rn as g, Sn as _, Tn as v, Un as y, Ut as b, Vn as x, Vt as S, Wt as C, Xt as w, Yt as T, Zt as E, _n as D, an as O, bn as k, cn as A, dn as j, en as M, fn as N, gn as P, hn as F, in as I, jn as L, kn as R, ln as z, mn as B, nn as V, on as H, pn as U, rn as W, sn as G, tn as K, un as q, vn as J, wn as Y, xn as X, yn as Z, zn as Q } from "./useClicker-ChI9FA0J.js";
|
|
2
|
+
import { $, B as ee, Ct as te, Dt as ne, Et as re, F as ie, G as ae, H as oe, I as se, J as ce, K as le, L as ue, Q as de, R as fe, Tt as pe, U as me, V as he, W as ge, X as _e, Y as ve, Z as ye, _t as be, at as xe, ct as Se, dt as Ce, et as we, ft as Te, gt as Ee, ht as De, it as Oe, lt as ke, mt as Ae, nt as je, ot as Me, pt as Ne, q as Pe, rt as Fe, st as Ie, tt as Le, ut as Re, wt as ze, z as Be } from "./WorldProps-Du0EDzmt.js";
|
|
3
|
+
import { A as Ve, B as He, C as Ue, D as We, E as Ge, G as Ke, H as qe, I as Je, J as Ye, K as Xe, L as Ze, M as Qe, O as $e, R as et, S as tt, T as nt, U as rt, V as it, W as at, Y as ot, Z as st, _ as ct, a as lt, b as ut, c as dt, d as ft, f as pt, g as mt, h as ht, i as gt, it as _t, j as vt, l as yt, m as bt, n as xt, nt as St, o as Ct, p as wt, q as Tt, r as Et, rt as Dt, s as Ot, t as kt, tt as At, u as jt, v as Mt, w as Nt, x as Pt, y as Ft, z as It } from "./plugin-uKCTitER.js";
|
|
4
4
|
export { T as BUILDING_BASIC_OBJECT_OPTIONS, w as BUILDING_FLAG_STYLE_OPTIONS, E as BUILDING_PLACED_OBJECT_OPTIONS, S as BUILDING_STORE_SERVICE, h as BUILDING_TILE_GROUP_DRAG_TYPE, e as BUILDING_TILE_OBJECT_OPTIONS, M as BUILDING_TILE_PRESETS, K as BUILDING_TILE_PRESET_DRAG_TYPE, V as BUILDING_TILE_SHAPE_OPTIONS, W as BUILDING_TREE_COLOR_PRESETS, I as BUILDING_TREE_OPTIONS, O as BUILDING_WALL_KIND_OPTIONS, H as BUILDING_WALL_PRESETS, G as BUILDING_WEATHER_EFFECT_OPTIONS, A as BUILDING_WORLD_SURFACE_OPTIONS, rt as Billboard, Xe as BlockSystem, ht as BuildingController, pt as BuildingGpuCullingDriver, bt as BuildingGpuMirrorDriver, wt as BuildingGpuUploadDriver, jt as BuildingIndirectArgsUploadDriver, ft as BuildingIndirectDrawDriver, At as BuildingNavigationObstacleDriver, ct as BuildingRenderStateDriver, Pt as BuildingSystem, Ot as BuildingUI, mt as BuildingVisibilityDriver, kt as DEFAULT_BUILDING_GRID_EXTENSION_ID, Dt as DEFAULT_BUILDING_OBJECT_CATALOG, xt as DEFAULT_BUILDING_PLACEMENT_EXTENSION_ID, Et as DEFAULT_BUILDING_SAVE_EXTENSION_ID, gt as DEFAULT_BUILDING_STORE_SERVICE_ID, Fe as DRAW_CLUSTER_BILLBOARD, Oe as DRAW_CLUSTER_BLOCK, xe as DRAW_CLUSTER_COUNT, ye as DRAW_CLUSTER_DESCRIPTORS, Me as DRAW_CLUSTER_FIRE, Ie as DRAW_CLUSTER_FLAG, Se as DRAW_CLUSTER_GRASS, ke as DRAW_CLUSTER_MODEL, Re as DRAW_CLUSTER_SAKURA, Ce as DRAW_CLUSTER_SAND, Te as DRAW_CLUSTER_SNOWFIELD, Ne as DRAW_CLUSTER_TILE, Ae as DRAW_CLUSTER_WALL, De as DRAW_CLUSTER_WATER, z as FLAG_STYLE_META, qe as Fire, le as GPU_META_STRIDE, Pe as GPU_SPATIAL_STRIDE, Ye as GpuBatchBridge, $e as Grass, It as GrassDriver, He as GrassManagerProvider, at as GridHelper, de as INDIRECT_DRAW_STRIDE, Tt as MaterialManager, Ze as Sakura, et as SakuraBatch, Ge as Sand, We as SandBatch, Je as Snow, Nt as Snowfield, nt as SnowfieldBatch, Ue as TileSystem, tt as WallSystem, Ve as Water, St as applyBuildingNavigationObstacles, q as blockToPlacementEntry, ce as buildBuildingGpuMirror, $ as buildBuildingIndirectDrawMirror, j as buildingCellToWorld, N as buildingGridAdapter, U as buildingGroupsToPlacementEntries, B as buildingPlacementAdapter, lt as buildingPlugin, F as cellToTilePosition, P as createBlockFootprint, te as createBuildingCullingStore, ve as createBuildingGpuUploadPlan, we as createBuildingIndirectDrawUploadPlan, D as createBuildingPlacementEngine, Ct as createBuildingPlugin, fe as createBuildingRenderStore, yt as createBuildingScopeId, c as createBuildingStore, ie as createBuildingVisibilityStore, dt as createCustomMeshId, he as createEmptyBuildingGpuUploadResources, Le as createEmptyBuildingIndirectDrawMirror, _e as createEmptyGpuMirror, re as createGrassManager, Qe as createShoreField, Mt as createTerrainBlockMaterial, J as createTileFootprint, st as createTileSampler, oe as destroyBuildingGpuUploadResources, Z as edgeKey, k as edgeSideToWallRotation, X as edgeToWallTransform, Ft as findTerrainBlockMaterial, _ as getBlockSupportHeight, r as getBuildingSupportHeight, _t as getDefaultBuildingObject, Ee as getDrawClusterForSnapshotEntry, ne as getGrassManager, je as getIndirectInstanceCount, Y as getTileSupportHeight, Ke as getWallMaterialKey, me as getWebGPUDeviceFromRenderer, v as hasTileCollision, a as hasWallCollision, i as indexAabb, p as normalizeQuarterTurnRotation, R as pair, be as parseBuildingGpuVisibilityFlags, t as queryAabbIds, L as snapBuildingPosition, ot as supportsGpuInstanceBatches, ge as syncBuildingGpuBuffers, ae as syncBuildingIndirectArgsBuffer, d as tileFootprintKeys, f as tileGroupToPlacementEntries, m as tileHalfSize, o as tileOverlaps, l as tilePositionToCell, u as tileToPlacementEntry, g as unindexId, ut as useBuildingEditor, ze as useBuildingGpuCullingStore, pe as useBuildingGpuCullingStoreApi, Be as useBuildingRenderStateStore, ee as useBuildingRenderStateStoreApi, b as useBuildingStore, C as useBuildingStoreApi, se as useBuildingVisibilityStore, ue as useBuildingVisibilityStoreApi, it as useGrassManager, vt as useShoreField, Q as wallGroupToPlacementEntries, n as wallToPlacementEntry, x as wallTransformToEdge, s as worldToBuildingCell, y as zigZag };
|
|
@@ -51,7 +51,8 @@ export declare function bakeModel(scene: THREE.Object3D): BakedModel | null;
|
|
|
51
51
|
export declare function placementOf(object: PlacedObject, target: THREE.Matrix4): THREE.Matrix4;
|
|
52
52
|
/**
|
|
53
53
|
* One geometry of every entry's parts placed in the world, with each part's color, emission and roughness per vertex:
|
|
54
|
-
* the draw of a whole cell. Quantized glTF attributes are read unpacked.
|
|
54
|
+
* the draw of a whole cell. Quantized glTF attributes are read unpacked. `userData.mergedParts` lists the index offset
|
|
55
|
+
* where each entry ends, so a camera fade turns one placed object see-through instead of the whole cell.
|
|
55
56
|
*/
|
|
56
57
|
export declare function mergeStaticModels(entries: readonly StaticEntry[]): THREE.BufferGeometry | null;
|
|
57
58
|
/**
|
|
@@ -51,7 +51,8 @@ export declare function bakeModel(scene: THREE.Object3D): BakedModel | null;
|
|
|
51
51
|
export declare function placementOf(object: PlacedObject, target: THREE.Matrix4): THREE.Matrix4;
|
|
52
52
|
/**
|
|
53
53
|
* One geometry of every entry's parts placed in the world, with each part's color, emission and roughness per vertex:
|
|
54
|
-
* the draw of a whole cell. Quantized glTF attributes are read unpacked.
|
|
54
|
+
* the draw of a whole cell. Quantized glTF attributes are read unpacked. `userData.mergedParts` lists the index offset
|
|
55
|
+
* where each entry ends, so a camera fade turns one placed object see-through instead of the whole cell.
|
|
55
56
|
*/
|
|
56
57
|
export declare function mergeStaticModels(entries: readonly StaticEntry[]): THREE.BufferGeometry | null;
|
|
57
58
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type * as THREE from 'three';
|
|
2
2
|
import type { TypedEventBus } from '../../plugins/EventBus.cjs';
|
|
3
|
-
import type { CameraBounds, CameraCollisionTargets } from '../core/types.cjs';
|
|
3
|
+
import type { CameraBounds, CameraCollisionMode, CameraCollisionTargets } from '../core/types.cjs';
|
|
4
4
|
export type CameraEventValue = object | string | number | boolean | null | undefined;
|
|
5
5
|
export type CameraSystemEvents = {
|
|
6
6
|
modeChange: {
|
|
@@ -49,6 +49,8 @@ export interface CameraSystemConfig {
|
|
|
49
49
|
enableCollision: boolean;
|
|
50
50
|
collisionMargin?: number;
|
|
51
51
|
collisionTargets?: CameraCollisionTargets;
|
|
52
|
+
collisionMode?: CameraCollisionMode;
|
|
53
|
+
collisionFadeOpacity?: number;
|
|
52
54
|
orbitYaw?: number;
|
|
53
55
|
orbitPitch?: number;
|
|
54
56
|
minDistance?: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type * as THREE from 'three';
|
|
2
2
|
import type { TypedEventBus } from '../../plugins/EventBus.js';
|
|
3
|
-
import type { CameraBounds, CameraCollisionTargets } from '../core/types.js';
|
|
3
|
+
import type { CameraBounds, CameraCollisionMode, CameraCollisionTargets } from '../core/types.js';
|
|
4
4
|
export type CameraEventValue = object | string | number | boolean | null | undefined;
|
|
5
5
|
export type CameraSystemEvents = {
|
|
6
6
|
modeChange: {
|
|
@@ -49,6 +49,8 @@ export interface CameraSystemConfig {
|
|
|
49
49
|
enableCollision: boolean;
|
|
50
50
|
collisionMargin?: number;
|
|
51
51
|
collisionTargets?: CameraCollisionTargets;
|
|
52
|
+
collisionMode?: CameraCollisionMode;
|
|
53
|
+
collisionFadeOpacity?: number;
|
|
52
54
|
orbitYaw?: number;
|
|
53
55
|
orbitPitch?: number;
|
|
54
56
|
minDistance?: number;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { CameraControllerClassNameSlot, CameraControllerLabels, CameraControllerModeOption, CameraModeConfig } from './types.cjs';
|
|
1
|
+
import type { CameraCollisionModeConfig, CameraControllerClassNameSlot, CameraControllerLabels, CameraControllerModeOption, CameraModeConfig } from './types.cjs';
|
|
2
2
|
import type { CameraType } from '../../core/types.cjs';
|
|
3
3
|
export declare const CAMERA_CONTROLLER_DEFAULT_MODES: CameraModeConfig[];
|
|
4
|
+
export declare const CAMERA_CONTROLLER_DEFAULT_COLLISION_MODES: CameraCollisionModeConfig[];
|
|
4
5
|
export declare const CAMERA_CONTROLLER_DEFAULT_LABELS: CameraControllerLabels;
|
|
5
6
|
export declare const CAMERA_CONTROLLER_MODE_OPTIONS: Record<CameraType, CameraControllerModeOption>;
|
|
6
7
|
export declare const CAMERA_CONTROLLER_DEFAULT_CLASSES: Record<CameraControllerClassNameSlot, string>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { CameraControllerClassNameSlot, CameraControllerLabels, CameraControllerModeOption, CameraModeConfig } from './types.js';
|
|
1
|
+
import type { CameraCollisionModeConfig, CameraControllerClassNameSlot, CameraControllerLabels, CameraControllerModeOption, CameraModeConfig } from './types.js';
|
|
2
2
|
import type { CameraType } from '../../core/types.js';
|
|
3
3
|
export declare const CAMERA_CONTROLLER_DEFAULT_MODES: CameraModeConfig[];
|
|
4
|
+
export declare const CAMERA_CONTROLLER_DEFAULT_COLLISION_MODES: CameraCollisionModeConfig[];
|
|
4
5
|
export declare const CAMERA_CONTROLLER_DEFAULT_LABELS: CameraControllerLabels;
|
|
5
6
|
export declare const CAMERA_CONTROLLER_MODE_OPTIONS: Record<CameraType, CameraControllerModeOption>;
|
|
6
7
|
export declare const CAMERA_CONTROLLER_DEFAULT_CLASSES: Record<CameraControllerClassNameSlot, string>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CAMERA_CONTROLLER_DEFAULT_CLASSES, CAMERA_CONTROLLER_DEFAULT_LABELS, CAMERA_CONTROLLER_DEFAULT_MODES, CAMERA_CONTROLLER_MODE_OPTIONS } from './defaults.cjs';
|
|
1
|
+
import { CAMERA_CONTROLLER_DEFAULT_CLASSES, CAMERA_CONTROLLER_DEFAULT_COLLISION_MODES, CAMERA_CONTROLLER_DEFAULT_LABELS, CAMERA_CONTROLLER_DEFAULT_MODES, CAMERA_CONTROLLER_MODE_OPTIONS } from './defaults.cjs';
|
|
2
2
|
import type { CameraControllerProps } from './types.cjs';
|
|
3
|
-
export declare function CameraController({ position, showLabels, showTitle, compact, modes, className, style, classNames, styles, labels: labelOverrides, renderers, onModeChange, children, }?: CameraControllerProps): import("react").JSX.Element;
|
|
4
|
-
export { CAMERA_CONTROLLER_DEFAULT_CLASSES, CAMERA_CONTROLLER_DEFAULT_LABELS, CAMERA_CONTROLLER_DEFAULT_MODES, CAMERA_CONTROLLER_MODE_OPTIONS, };
|
|
5
|
-
export type { CameraControllerActions, CameraControllerClassNameSlot, CameraControllerClassNames, CameraControllerLabels, CameraControllerModeOption, CameraControllerPosition, CameraControllerProps, CameraControllerRenderContext, CameraControllerRenderers, CameraControllerStyles, CameraModeConfig, } from './types.cjs';
|
|
3
|
+
export declare function CameraController({ position, showLabels, showTitle, compact, modes, collisionModes, className, style, classNames, styles, labels: labelOverrides, renderers, onModeChange, onCollisionModeChange, children, }?: CameraControllerProps): import("react").JSX.Element;
|
|
4
|
+
export { CAMERA_CONTROLLER_DEFAULT_CLASSES, CAMERA_CONTROLLER_DEFAULT_COLLISION_MODES, CAMERA_CONTROLLER_DEFAULT_LABELS, CAMERA_CONTROLLER_DEFAULT_MODES, CAMERA_CONTROLLER_MODE_OPTIONS, };
|
|
5
|
+
export type { CameraCollisionModeConfig, CameraControllerActions, CameraControllerClassNameSlot, CameraControllerClassNames, CameraControllerLabels, CameraControllerModeOption, CameraControllerPosition, CameraControllerProps, CameraControllerRenderContext, CameraControllerRenderers, CameraControllerStyles, CameraModeConfig, } from './types.cjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CAMERA_CONTROLLER_DEFAULT_CLASSES, CAMERA_CONTROLLER_DEFAULT_LABELS, CAMERA_CONTROLLER_DEFAULT_MODES, CAMERA_CONTROLLER_MODE_OPTIONS } from './defaults.js';
|
|
1
|
+
import { CAMERA_CONTROLLER_DEFAULT_CLASSES, CAMERA_CONTROLLER_DEFAULT_COLLISION_MODES, CAMERA_CONTROLLER_DEFAULT_LABELS, CAMERA_CONTROLLER_DEFAULT_MODES, CAMERA_CONTROLLER_MODE_OPTIONS } from './defaults.js';
|
|
2
2
|
import type { CameraControllerProps } from './types.js';
|
|
3
|
-
export declare function CameraController({ position, showLabels, showTitle, compact, modes, className, style, classNames, styles, labels: labelOverrides, renderers, onModeChange, children, }?: CameraControllerProps): import("react").JSX.Element;
|
|
4
|
-
export { CAMERA_CONTROLLER_DEFAULT_CLASSES, CAMERA_CONTROLLER_DEFAULT_LABELS, CAMERA_CONTROLLER_DEFAULT_MODES, CAMERA_CONTROLLER_MODE_OPTIONS, };
|
|
5
|
-
export type { CameraControllerActions, CameraControllerClassNameSlot, CameraControllerClassNames, CameraControllerLabels, CameraControllerModeOption, CameraControllerPosition, CameraControllerProps, CameraControllerRenderContext, CameraControllerRenderers, CameraControllerStyles, CameraModeConfig, } from './types.js';
|
|
3
|
+
export declare function CameraController({ position, showLabels, showTitle, compact, modes, collisionModes, className, style, classNames, styles, labels: labelOverrides, renderers, onModeChange, onCollisionModeChange, children, }?: CameraControllerProps): import("react").JSX.Element;
|
|
4
|
+
export { CAMERA_CONTROLLER_DEFAULT_CLASSES, CAMERA_CONTROLLER_DEFAULT_COLLISION_MODES, CAMERA_CONTROLLER_DEFAULT_LABELS, CAMERA_CONTROLLER_DEFAULT_MODES, CAMERA_CONTROLLER_MODE_OPTIONS, };
|
|
5
|
+
export type { CameraCollisionModeConfig, CameraControllerActions, CameraControllerClassNameSlot, CameraControllerClassNames, CameraControllerLabels, CameraControllerModeOption, CameraControllerPosition, CameraControllerProps, CameraControllerRenderContext, CameraControllerRenderers, CameraControllerStyles, CameraModeConfig, } from './types.js';
|
|
@@ -1,24 +1,35 @@
|
|
|
1
1
|
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
-
import type { CameraOptionType, CameraType } from '../../core/types.cjs';
|
|
2
|
+
import type { CameraCollisionMode, CameraOptionType, CameraType } from '../../core/types.cjs';
|
|
3
3
|
export type CameraControllerPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
4
4
|
export type CameraModeConfig = {
|
|
5
5
|
value: CameraType;
|
|
6
6
|
label: string;
|
|
7
7
|
icon?: ReactNode;
|
|
8
8
|
};
|
|
9
|
+
/** A button that picks what the camera does about occluders (`cameraOption.collisionMode`). */
|
|
10
|
+
export type CameraCollisionModeConfig = {
|
|
11
|
+
value: CameraCollisionMode;
|
|
12
|
+
label: string;
|
|
13
|
+
icon?: ReactNode;
|
|
14
|
+
};
|
|
9
15
|
export type CameraControllerModeOption = Partial<Pick<CameraOptionType, 'xDistance' | 'yDistance' | 'zDistance' | 'fov' | 'enableCollision' | 'enableZoom' | 'zoom' | 'minZoom' | 'maxZoom' | 'zoomSpeed' | 'smoothing'>>;
|
|
10
16
|
export type CameraControllerLabels = {
|
|
11
17
|
title: string;
|
|
18
|
+
/** Accessible name of the occlusion buttons. */
|
|
19
|
+
collision?: string;
|
|
12
20
|
};
|
|
13
21
|
export type CameraControllerClassNameSlot = 'root' | 'floatingRoot' | 'compactRoot' | 'header' | 'title' | 'list' | 'modeButton' | 'activeModeButton' | 'modeIcon' | 'modeLabel';
|
|
14
22
|
export type CameraControllerClassNames = Partial<Record<CameraControllerClassNameSlot, string>>;
|
|
15
23
|
export type CameraControllerStyles = Partial<Record<CameraControllerClassNameSlot, CSSProperties>>;
|
|
16
24
|
export type CameraControllerActions = {
|
|
17
25
|
selectMode: (mode: CameraType) => void;
|
|
26
|
+
selectCollisionMode: (mode: CameraCollisionMode) => void;
|
|
18
27
|
};
|
|
19
28
|
export type CameraControllerRenderContext = {
|
|
20
29
|
activeMode: CameraType;
|
|
21
30
|
modes: readonly CameraModeConfig[];
|
|
31
|
+
activeCollisionMode: CameraCollisionMode;
|
|
32
|
+
collisionModes: readonly CameraCollisionModeConfig[];
|
|
22
33
|
labels: CameraControllerLabels;
|
|
23
34
|
showLabels: boolean;
|
|
24
35
|
showTitle: boolean;
|
|
@@ -33,6 +44,7 @@ export type CameraControllerRenderers = {
|
|
|
33
44
|
header?: (context: CameraControllerRenderContext) => ReactNode;
|
|
34
45
|
list?: (context: CameraControllerRenderContext, children: ReactNode) => ReactNode;
|
|
35
46
|
modeButton?: (context: CameraControllerRenderContext, mode: CameraModeConfig, active: boolean) => ReactNode;
|
|
47
|
+
collisionButton?: (context: CameraControllerRenderContext, mode: CameraCollisionModeConfig, active: boolean) => ReactNode;
|
|
36
48
|
};
|
|
37
49
|
export type CameraControllerProps = {
|
|
38
50
|
position?: CameraControllerPosition;
|
|
@@ -40,6 +52,8 @@ export type CameraControllerProps = {
|
|
|
40
52
|
showTitle?: boolean;
|
|
41
53
|
compact?: boolean;
|
|
42
54
|
modes?: readonly CameraModeConfig[];
|
|
55
|
+
/** Occlusion buttons under the modes; an empty list hides them. */
|
|
56
|
+
collisionModes?: readonly CameraCollisionModeConfig[];
|
|
43
57
|
className?: string;
|
|
44
58
|
style?: CSSProperties;
|
|
45
59
|
classNames?: CameraControllerClassNames;
|
|
@@ -47,5 +61,6 @@ export type CameraControllerProps = {
|
|
|
47
61
|
labels?: Partial<CameraControllerLabels>;
|
|
48
62
|
renderers?: CameraControllerRenderers;
|
|
49
63
|
onModeChange?: (mode: CameraType) => void;
|
|
64
|
+
onCollisionModeChange?: (mode: CameraCollisionMode) => void;
|
|
50
65
|
children?: ReactNode;
|
|
51
66
|
};
|
|
@@ -1,24 +1,35 @@
|
|
|
1
1
|
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
-
import type { CameraOptionType, CameraType } from '../../core/types.js';
|
|
2
|
+
import type { CameraCollisionMode, CameraOptionType, CameraType } from '../../core/types.js';
|
|
3
3
|
export type CameraControllerPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
4
4
|
export type CameraModeConfig = {
|
|
5
5
|
value: CameraType;
|
|
6
6
|
label: string;
|
|
7
7
|
icon?: ReactNode;
|
|
8
8
|
};
|
|
9
|
+
/** A button that picks what the camera does about occluders (`cameraOption.collisionMode`). */
|
|
10
|
+
export type CameraCollisionModeConfig = {
|
|
11
|
+
value: CameraCollisionMode;
|
|
12
|
+
label: string;
|
|
13
|
+
icon?: ReactNode;
|
|
14
|
+
};
|
|
9
15
|
export type CameraControllerModeOption = Partial<Pick<CameraOptionType, 'xDistance' | 'yDistance' | 'zDistance' | 'fov' | 'enableCollision' | 'enableZoom' | 'zoom' | 'minZoom' | 'maxZoom' | 'zoomSpeed' | 'smoothing'>>;
|
|
10
16
|
export type CameraControllerLabels = {
|
|
11
17
|
title: string;
|
|
18
|
+
/** Accessible name of the occlusion buttons. */
|
|
19
|
+
collision?: string;
|
|
12
20
|
};
|
|
13
21
|
export type CameraControllerClassNameSlot = 'root' | 'floatingRoot' | 'compactRoot' | 'header' | 'title' | 'list' | 'modeButton' | 'activeModeButton' | 'modeIcon' | 'modeLabel';
|
|
14
22
|
export type CameraControllerClassNames = Partial<Record<CameraControllerClassNameSlot, string>>;
|
|
15
23
|
export type CameraControllerStyles = Partial<Record<CameraControllerClassNameSlot, CSSProperties>>;
|
|
16
24
|
export type CameraControllerActions = {
|
|
17
25
|
selectMode: (mode: CameraType) => void;
|
|
26
|
+
selectCollisionMode: (mode: CameraCollisionMode) => void;
|
|
18
27
|
};
|
|
19
28
|
export type CameraControllerRenderContext = {
|
|
20
29
|
activeMode: CameraType;
|
|
21
30
|
modes: readonly CameraModeConfig[];
|
|
31
|
+
activeCollisionMode: CameraCollisionMode;
|
|
32
|
+
collisionModes: readonly CameraCollisionModeConfig[];
|
|
22
33
|
labels: CameraControllerLabels;
|
|
23
34
|
showLabels: boolean;
|
|
24
35
|
showTitle: boolean;
|
|
@@ -33,6 +44,7 @@ export type CameraControllerRenderers = {
|
|
|
33
44
|
header?: (context: CameraControllerRenderContext) => ReactNode;
|
|
34
45
|
list?: (context: CameraControllerRenderContext, children: ReactNode) => ReactNode;
|
|
35
46
|
modeButton?: (context: CameraControllerRenderContext, mode: CameraModeConfig, active: boolean) => ReactNode;
|
|
47
|
+
collisionButton?: (context: CameraControllerRenderContext, mode: CameraCollisionModeConfig, active: boolean) => ReactNode;
|
|
36
48
|
};
|
|
37
49
|
export type CameraControllerProps = {
|
|
38
50
|
position?: CameraControllerPosition;
|
|
@@ -40,6 +52,8 @@ export type CameraControllerProps = {
|
|
|
40
52
|
showTitle?: boolean;
|
|
41
53
|
compact?: boolean;
|
|
42
54
|
modes?: readonly CameraModeConfig[];
|
|
55
|
+
/** Occlusion buttons under the modes; an empty list hides them. */
|
|
56
|
+
collisionModes?: readonly CameraCollisionModeConfig[];
|
|
43
57
|
className?: string;
|
|
44
58
|
style?: CSSProperties;
|
|
45
59
|
classNames?: CameraControllerClassNames;
|
|
@@ -47,5 +61,6 @@ export type CameraControllerProps = {
|
|
|
47
61
|
labels?: Partial<CameraControllerLabels>;
|
|
48
62
|
renderers?: CameraControllerRenderers;
|
|
49
63
|
onModeChange?: (mode: CameraType) => void;
|
|
64
|
+
onCollisionModeChange?: (mode: CameraCollisionMode) => void;
|
|
50
65
|
children?: ReactNode;
|
|
51
66
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { CAMERA_CONTROLLER_DEFAULT_CLASSES, CAMERA_CONTROLLER_DEFAULT_LABELS, CAMERA_CONTROLLER_DEFAULT_MODES, CAMERA_CONTROLLER_MODE_OPTIONS, CameraController, } from './CameraController/index.cjs';
|
|
2
|
-
export type { CameraControllerActions, CameraControllerClassNameSlot, CameraControllerClassNames, CameraControllerLabels, CameraControllerModeOption, CameraControllerPosition, CameraControllerProps, CameraControllerRenderContext, CameraControllerRenderers, CameraControllerStyles, CameraModeConfig, } from './CameraController/index.cjs';
|
|
1
|
+
export { CAMERA_CONTROLLER_DEFAULT_CLASSES, CAMERA_CONTROLLER_DEFAULT_COLLISION_MODES, CAMERA_CONTROLLER_DEFAULT_LABELS, CAMERA_CONTROLLER_DEFAULT_MODES, CAMERA_CONTROLLER_MODE_OPTIONS, CameraController, } from './CameraController/index.cjs';
|
|
2
|
+
export type { CameraCollisionModeConfig, CameraControllerActions, CameraControllerClassNameSlot, CameraControllerClassNames, CameraControllerLabels, CameraControllerModeOption, CameraControllerPosition, CameraControllerProps, CameraControllerRenderContext, CameraControllerRenderers, CameraControllerStyles, CameraModeConfig, } from './CameraController/index.cjs';
|
|
3
3
|
export { CAMERA_DEBUG_PANEL_DEFAULT_CLASSES, CAMERA_DEBUG_PANEL_DEFAULT_FIELDS, CAMERA_DEBUG_PANEL_DEFAULT_INTERVAL, CAMERA_DEBUG_PANEL_DEFAULT_LABELS, CAMERA_DEBUG_PANEL_DEFAULT_PRECISION, CameraDebugPanel, createInitialCameraMetrics, } from './CameraDebugPanel/index.cjs';
|
|
4
4
|
export type { CameraDebugPanelClassNameSlot, CameraDebugPanelClassNames, CameraDebugPanelLabels, CameraDebugPanelPosition, CameraDebugPanelProps, CameraDebugPanelRenderContext, CameraDebugPanelRenderers, CameraDebugPanelResolvedField, CameraDebugPanelStyles, CameraDebugPanelTheme, CameraMetrics, CustomField, DebugField, DebugFieldFormat, } from './CameraDebugPanel/index.cjs';
|
|
5
5
|
export { CAMERA_PRESETS_DEFAULT_CLASSES, CAMERA_PRESETS_DEFAULT_LABELS, CAMERA_PRESETS_DEFAULT_PRESETS, CAMERA_PRESETS_DEFAULT_SMOOTHING, CameraPresets, } from './CameraPresets/index.cjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { CAMERA_CONTROLLER_DEFAULT_CLASSES, CAMERA_CONTROLLER_DEFAULT_LABELS, CAMERA_CONTROLLER_DEFAULT_MODES, CAMERA_CONTROLLER_MODE_OPTIONS, CameraController, } from './CameraController/index.js';
|
|
2
|
-
export type { CameraControllerActions, CameraControllerClassNameSlot, CameraControllerClassNames, CameraControllerLabels, CameraControllerModeOption, CameraControllerPosition, CameraControllerProps, CameraControllerRenderContext, CameraControllerRenderers, CameraControllerStyles, CameraModeConfig, } from './CameraController/index.js';
|
|
1
|
+
export { CAMERA_CONTROLLER_DEFAULT_CLASSES, CAMERA_CONTROLLER_DEFAULT_COLLISION_MODES, CAMERA_CONTROLLER_DEFAULT_LABELS, CAMERA_CONTROLLER_DEFAULT_MODES, CAMERA_CONTROLLER_MODE_OPTIONS, CameraController, } from './CameraController/index.js';
|
|
2
|
+
export type { CameraCollisionModeConfig, CameraControllerActions, CameraControllerClassNameSlot, CameraControllerClassNames, CameraControllerLabels, CameraControllerModeOption, CameraControllerPosition, CameraControllerProps, CameraControllerRenderContext, CameraControllerRenderers, CameraControllerStyles, CameraModeConfig, } from './CameraController/index.js';
|
|
3
3
|
export { CAMERA_DEBUG_PANEL_DEFAULT_CLASSES, CAMERA_DEBUG_PANEL_DEFAULT_FIELDS, CAMERA_DEBUG_PANEL_DEFAULT_INTERVAL, CAMERA_DEBUG_PANEL_DEFAULT_LABELS, CAMERA_DEBUG_PANEL_DEFAULT_PRECISION, CameraDebugPanel, createInitialCameraMetrics, } from './CameraDebugPanel/index.js';
|
|
4
4
|
export type { CameraDebugPanelClassNameSlot, CameraDebugPanelClassNames, CameraDebugPanelLabels, CameraDebugPanelPosition, CameraDebugPanelProps, CameraDebugPanelRenderContext, CameraDebugPanelRenderers, CameraDebugPanelResolvedField, CameraDebugPanelStyles, CameraDebugPanelTheme, CameraMetrics, CustomField, DebugField, DebugFieldFormat, } from './CameraDebugPanel/index.js';
|
|
5
5
|
export { CAMERA_PRESETS_DEFAULT_CLASSES, CAMERA_PRESETS_DEFAULT_LABELS, CAMERA_PRESETS_DEFAULT_PRESETS, CAMERA_PRESETS_DEFAULT_SMOOTHING, CameraPresets, } from './CameraPresets/index.js';
|
|
@@ -16,10 +16,14 @@ export declare abstract class BaseController implements ICameraController {
|
|
|
16
16
|
private orbitPitchQuaternion;
|
|
17
17
|
private readonly xAxis;
|
|
18
18
|
private readonly yAxis;
|
|
19
|
+
/** Scene of the last update, whose faded occluders `dispose` restores. */
|
|
20
|
+
private scene;
|
|
19
21
|
private applyDefaults;
|
|
20
22
|
calculateLookAt(props: CameraCalcProps, state: CameraSystemState): THREE.Vector3;
|
|
21
23
|
protected getOrbitYaw(state: CameraSystemState): number;
|
|
22
24
|
protected getOrbitPitch(state: CameraSystemState): number;
|
|
23
25
|
protected applyOrbitOffset(offset: THREE.Vector3, state: CameraSystemState): THREE.Vector3;
|
|
24
26
|
update(props: CameraCalcProps, state: CameraSystemState): void;
|
|
27
|
+
/** Restores the occluders this camera faded, at once, and frees their faded copies. */
|
|
28
|
+
dispose(): void;
|
|
25
29
|
}
|
|
@@ -16,10 +16,14 @@ export declare abstract class BaseController implements ICameraController {
|
|
|
16
16
|
private orbitPitchQuaternion;
|
|
17
17
|
private readonly xAxis;
|
|
18
18
|
private readonly yAxis;
|
|
19
|
+
/** Scene of the last update, whose faded occluders `dispose` restores. */
|
|
20
|
+
private scene;
|
|
19
21
|
private applyDefaults;
|
|
20
22
|
calculateLookAt(props: CameraCalcProps, state: CameraSystemState): THREE.Vector3;
|
|
21
23
|
protected getOrbitYaw(state: CameraSystemState): number;
|
|
22
24
|
protected getOrbitPitch(state: CameraSystemState): number;
|
|
23
25
|
protected applyOrbitOffset(offset: THREE.Vector3, state: CameraSystemState): THREE.Vector3;
|
|
24
26
|
update(props: CameraCalcProps, state: CameraSystemState): void;
|
|
27
|
+
/** Restores the occluders this camera faded, at once, and frees their faded copies. */
|
|
28
|
+
dispose(): void;
|
|
25
29
|
}
|