gaesup-world 1.0.20 → 1.0.21
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/blueprints-editor.cjs +1 -1
- package/dist/blueprints-editor.js +3 -3
- package/dist/blueprints.js +3 -3
- package/dist/core/interactions/components/Clicker/index.d.ts +4 -1
- package/dist/editor.js +3 -3
- package/dist/{index-FQgcO1SU.js → index-BUQXtHf3.js} +5 -6
- package/dist/index-CHoKlv0U.cjs +1 -0
- package/dist/{index-B0hl0p1Z.js → index-D0Rz5_-J.js} +5 -6
- package/dist/{index-B_IfvQvL.js → index-DShLht0Q.js} +1 -1
- package/dist/{index-B2hAamTj.js → index-Drmv86ws.js} +2 -2
- package/dist/index-HxpKt5rO.js +320 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +13 -13
- package/dist/network.cjs +1 -1
- package/dist/network.js +4 -4
- package/dist/{plugin--mlpG6-U.js → plugin-BEJHB06f.js} +35 -36
- package/dist/runtime.js +7 -7
- package/dist/{useSpawnFromBlueprint-TYxXKoM5.js → useSpawnFromBlueprint-BxRHlpvL.js} +4 -5
- package/package.json +1 -1
- package/dist/index-BKqky34r.js +0 -319
- package/dist/index-C-4Q2Amk.cjs +0 -1
- package/dist/{index-C-wwuvo7.js → index-C5agFfBe.js} +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as x, jsx as s, Fragment as be } from "react/jsx-runtime";
|
|
2
2
|
import ge, { useCallback as ce, useState as le, useRef as ee, useEffect as oe, memo as Be, forwardRef as lu, useContext as To, createContext as ws, useMemo as X, useLayoutEffect as Ke, Suspense as In } from "react";
|
|
3
3
|
import { u as ze, H as Eo, P as xs, a as Cp, B as Np } from "./gaesupStore-DTu0tYBp.js";
|
|
4
|
-
import { V as cu, ap as _s, H as uu, I as Ss, P as Va, M as du, S as fu, _ as Ip, al as We, an as Tp, G as j, K as pu, L as hu, O as Za, R as Ep, a9 as fe, aq as Ap, a6 as kp, a7 as Pp, aj as En, J as Ms, ai as ui, ar as mu, Q as Bp, e as Rp, B as Dp, y as zp, a as Fp, d as Lp, c as $p, f as Op } from "./index-
|
|
4
|
+
import { V as cu, ap as _s, H as uu, I as Ss, P as Va, M as du, S as fu, _ as Ip, al as We, an as Tp, G as j, K as pu, L as hu, O as Za, R as Ep, a9 as fe, aq as Ap, a6 as kp, a7 as Pp, aj as En, J as Ms, ai as ui, ar as mu, Q as Bp, e as Rp, B as Dp, y as zp, a as Fp, d as Lp, c as $p, f as Op } from "./index-C5agFfBe.js";
|
|
5
5
|
import { useFrame as $e, Canvas as Hp, useThree as Li, extend as Gr } from "@react-three/fiber";
|
|
6
6
|
import { CapsuleCollider as ra, RigidBody as Wr, Physics as Gp, CuboidCollider as Cs } from "@react-three/rapier";
|
|
7
7
|
import { useStoreWithEqualityFn as Wp, createWithEqualityFn as Up } from "zustand/traditional";
|
|
@@ -12,14 +12,13 @@ import { A as gu, c as aa, b as jp } from "./index-C-ViQFGa.js";
|
|
|
12
12
|
import { create as yi } from "zustand";
|
|
13
13
|
import { useShallow as Ns } from "zustand/react/shallow";
|
|
14
14
|
import { r as Vp, o as Zp, G as Yp, S as bu, h as Xp, k as Kp, f as qp, j as Qp, e as Jp, i as eh, m as th, n as nh, c as ih, v as oh } from "./loader-C3ZwumCe.js";
|
|
15
|
-
import { g as Ui, M as rh, W as ah } from "./index-
|
|
15
|
+
import { g as Ui, M as rh, W as ah } from "./index-BUQXtHf3.js";
|
|
16
16
|
import { useGLTF as Is, useAnimations as sh, useTexture as Ts, shaderMaterial as Es, OrbitControls as lh } from "@react-three/drei";
|
|
17
17
|
import * as B from "three";
|
|
18
18
|
import { w as Ao } from "./sfe-CRsG1dTW.js";
|
|
19
19
|
import { enableMapSet as ch } from "immer";
|
|
20
20
|
import { immer as uh } from "zustand/middleware/immer";
|
|
21
21
|
import { SkeletonUtils as yu, Water as dh } from "three-stdlib";
|
|
22
|
-
import "reflect-metadata";
|
|
23
22
|
import { u as As } from "./weatherStore-CzG5N441.js";
|
|
24
23
|
import { createNoise2D as ks } from "simplex-noise";
|
|
25
24
|
function Xe({ label: e, min: t, max: n, step: i, value: o, suffix: r, onChange: a }) {
|
|
@@ -9808,7 +9807,7 @@ function _1(e, t) {
|
|
|
9808
9807
|
e.position[2] + Math.sin(i) * o
|
|
9809
9808
|
];
|
|
9810
9809
|
}
|
|
9811
|
-
function
|
|
9810
|
+
function gM(e, t, n) {
|
|
9812
9811
|
const i = ds(e, t);
|
|
9813
9812
|
return kr.set(i, n), () => {
|
|
9814
9813
|
kr.delete(i);
|
|
@@ -12063,13 +12062,13 @@ const Si = {
|
|
|
12063
12062
|
face: "표정",
|
|
12064
12063
|
weapon: "무기",
|
|
12065
12064
|
accessory: "액세서리"
|
|
12066
|
-
},
|
|
12065
|
+
}, bM = {
|
|
12067
12066
|
short: "단발",
|
|
12068
12067
|
long: "긴머리",
|
|
12069
12068
|
cap: "모자머리",
|
|
12070
12069
|
bun: "쪽머리",
|
|
12071
12070
|
spiky: "뻗친머리"
|
|
12072
|
-
},
|
|
12071
|
+
}, yM = {
|
|
12073
12072
|
default: "기본",
|
|
12074
12073
|
smile: "미소",
|
|
12075
12074
|
wink: "윙크",
|
|
@@ -13265,7 +13264,7 @@ const Ax = ({
|
|
|
13265
13264
|
...e.smoothing ? { smoothing: { ...e.smoothing } } : {},
|
|
13266
13265
|
...e.bounds ? { bounds: { ...e.bounds } } : {},
|
|
13267
13266
|
...e.modeSettings ? { modeSettings: { ...e.modeSettings } } : {}
|
|
13268
|
-
}),
|
|
13267
|
+
}), vM = ({
|
|
13269
13268
|
children: e,
|
|
13270
13269
|
className: t = "",
|
|
13271
13270
|
style: n = {},
|
|
@@ -13311,7 +13310,7 @@ const Ax = ({
|
|
|
13311
13310
|
}, Px = () => /* @__PURE__ */ s("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ s("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) }), Bx = () => /* @__PURE__ */ x("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
13312
13311
|
/* @__PURE__ */ s("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
13313
13312
|
/* @__PURE__ */ s("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
13314
|
-
] }),
|
|
13313
|
+
] }), wM = ({
|
|
13315
13314
|
children: e,
|
|
13316
13315
|
title: t,
|
|
13317
13316
|
initialWidth: n = 280,
|
|
@@ -13409,7 +13408,7 @@ const Ax = ({
|
|
|
13409
13408
|
setActiveNodeGraph: (t) => e({ activeNodeGraph: t }),
|
|
13410
13409
|
clipboard: null,
|
|
13411
13410
|
setClipboard: (t) => e({ clipboard: t })
|
|
13412
|
-
}),
|
|
13411
|
+
}), xM = ff, Rx = yi(ff), _M = () => {
|
|
13413
13412
|
const e = Rx();
|
|
13414
13413
|
return {
|
|
13415
13414
|
...e,
|
|
@@ -13418,7 +13417,7 @@ const Ax = ({
|
|
|
13418
13417
|
clearSelection: () => e.setSelectedObjectIds([])
|
|
13419
13418
|
};
|
|
13420
13419
|
};
|
|
13421
|
-
function
|
|
13420
|
+
function SM(e = {}) {
|
|
13422
13421
|
const t = {
|
|
13423
13422
|
panels: e.panels ?? [],
|
|
13424
13423
|
actions: (e.commands ?? []).map((n) => ({
|
|
@@ -13429,7 +13428,7 @@ function MM(e = {}) {
|
|
|
13429
13428
|
};
|
|
13430
13429
|
return e.defaultActivePanels && (t.defaultActivePanels = e.defaultActivePanels), typeof e.defaultPanelOpen == "boolean" && (t.defaultPanelOpen = e.defaultPanelOpen), typeof e.defaultModalOpen == "boolean" && (t.defaultModalOpen = e.defaultModalOpen), e.hiddenBuiltInPanels && (t.hiddenBuiltInPanels = e.hiddenBuiltInPanels), e.panelOrder && (t.panelOrder = e.panelOrder), e.panelDefaults && (t.panelDefaults = e.panelDefaults), e.validate && (t.validate = e.validate), t;
|
|
13431
13430
|
}
|
|
13432
|
-
function
|
|
13431
|
+
function MM() {
|
|
13433
13432
|
const e = [], t = [];
|
|
13434
13433
|
return {
|
|
13435
13434
|
execute: async (n) => {
|
|
@@ -14653,7 +14652,7 @@ const E_ = ge.memo(function({ billboards: t }) {
|
|
|
14653
14652
|
const r = o[0];
|
|
14654
14653
|
return r ? r.imageUrl ? /* @__PURE__ */ s(I_, { entries: o }, i) : /* @__PURE__ */ s(T_, { entries: o }, i) : null;
|
|
14655
14654
|
}) });
|
|
14656
|
-
}),
|
|
14655
|
+
}), CM = ge.memo(N_);
|
|
14657
14656
|
var A_ = `varying vec2 vUv;\r
|
|
14658
14657
|
uniform float time;\r
|
|
14659
14658
|
uniform float intensity;\r
|
|
@@ -14946,7 +14945,7 @@ const R_ = ({ intensity: e = 1.5, width: t = 1, height: n = 1.5, color: i = "#ff
|
|
|
14946
14945
|
})()),
|
|
14947
14946
|
/* @__PURE__ */ s("points", { geometry: f, material: a.ember })
|
|
14948
14947
|
] });
|
|
14949
|
-
},
|
|
14948
|
+
}, NM = ge.memo(R_), D_ = (
|
|
14950
14949
|
/* glsl */
|
|
14951
14950
|
`
|
|
14952
14951
|
attribute float aSeed;
|
|
@@ -15924,7 +15923,7 @@ function c2({ trees: e, toon: t }) {
|
|
|
15924
15923
|
/* @__PURE__ */ s("points", { geometry: _, children: /* @__PURE__ */ s("pointsMaterial", { size: 0.085 * h, sizeAttenuation: !0, vertexColors: !0, transparent: !0, opacity: 0.7, depthWrite: !1 }) })
|
|
15925
15924
|
] });
|
|
15926
15925
|
}
|
|
15927
|
-
function
|
|
15926
|
+
function IM({ size: e = 4, toon: t }) {
|
|
15928
15927
|
const n = ee(null), i = ee(null), o = ee(null), r = ee(null), a = ee(null), l = ee(null), c = X(() => B.MathUtils.clamp(e / 4, 0.95, 1.85), [e]), u = 3.8 * c, d = 1.65 * c + Math.min(e * 0.08, 0.55), f = 2.15 * c + Math.min(e * 0.04, 0.35), p = t ?? We(), h = Of(), w = Hf(p), g = X(() => Gf(c, u, "round"), [c, u]), _ = X(() => Wf(c), [c]), b = X(() => Uf(c, u, d, f, "round"), [c, u, d, f]), S = g.length, m = _.length + g.length, y = b.length, v = Math.max(180, Math.min(420, Math.round(210 + c * 95))), C = Math.max(44, Math.min(120, Math.round(54 + c * 26))), T = Math.max(52, Math.min(132, Math.round(62 + c * 30))), P = X(() => {
|
|
15929
15928
|
const E = new Float32Array(v * 3), G = new Float32Array(v * 3);
|
|
15930
15929
|
return jf(E, G, 0, v, u, d, f, 0, 0, 0), Fr(E, G, !0);
|
|
@@ -16439,7 +16438,7 @@ function x2({ entries: e, toon: t }) {
|
|
|
16439
16438
|
) })
|
|
16440
16439
|
] });
|
|
16441
16440
|
}
|
|
16442
|
-
function
|
|
16441
|
+
function TM({ size: e = 4, toon: t, color: n, accentColor: i }) {
|
|
16443
16442
|
const o = t ?? We(), r = Kf(o), [a, l] = X(() => {
|
|
16444
16443
|
const c = Math.max(20, Math.round(e * 6)), u = new B.PlaneGeometry(e, e, c, c);
|
|
16445
16444
|
u.rotateX(-Math.PI / 2);
|
|
@@ -16564,7 +16563,7 @@ function S2({ entries: e, toon: t }) {
|
|
|
16564
16563
|
) })
|
|
16565
16564
|
] });
|
|
16566
16565
|
}
|
|
16567
|
-
function
|
|
16566
|
+
function EM({ size: e = 4, toon: t, color: n, accentColor: i }) {
|
|
16568
16567
|
const o = t ?? We(), r = qf(o), [a, l] = X(() => {
|
|
16569
16568
|
const c = Math.max(22, Math.round(e * 7)), u = new B.PlaneGeometry(e, e, c, c);
|
|
16570
16569
|
u.rotateX(-Math.PI / 2);
|
|
@@ -19191,7 +19190,7 @@ function $S() {
|
|
|
19191
19190
|
}), null;
|
|
19192
19191
|
}
|
|
19193
19192
|
const OS = 9, HS = 150;
|
|
19194
|
-
function
|
|
19193
|
+
function AM() {
|
|
19195
19194
|
const { gl: e } = Li(), {
|
|
19196
19195
|
updateMousePosition: t,
|
|
19197
19196
|
placeWall: n,
|
|
@@ -19292,7 +19291,7 @@ function kM() {
|
|
|
19292
19291
|
] });
|
|
19293
19292
|
}
|
|
19294
19293
|
const su = rf;
|
|
19295
|
-
function
|
|
19294
|
+
function kM({
|
|
19296
19295
|
onClose: e,
|
|
19297
19296
|
canEdit: t = !0,
|
|
19298
19297
|
npcPanel: n = !1,
|
|
@@ -20793,7 +20792,7 @@ function ZS(e = {}) {
|
|
|
20793
20792
|
}
|
|
20794
20793
|
};
|
|
20795
20794
|
}
|
|
20796
|
-
const
|
|
20795
|
+
const PM = ZS();
|
|
20797
20796
|
export {
|
|
20798
20797
|
US as $,
|
|
20799
20798
|
kh as A,
|
|
@@ -20813,21 +20812,21 @@ export {
|
|
|
20813
20812
|
Qf as O,
|
|
20814
20813
|
Fh as P,
|
|
20815
20814
|
su as Q,
|
|
20816
|
-
|
|
20815
|
+
wM as R,
|
|
20817
20816
|
Nx as S,
|
|
20818
20817
|
sS as T,
|
|
20819
|
-
|
|
20818
|
+
kM as U,
|
|
20820
20819
|
Lh as V,
|
|
20821
20820
|
gS as W,
|
|
20822
20821
|
_o as X,
|
|
20823
20822
|
Ks as Y,
|
|
20824
20823
|
rf as Z,
|
|
20825
20824
|
WS as _,
|
|
20826
|
-
|
|
20825
|
+
vM as a,
|
|
20827
20826
|
jS as a0,
|
|
20828
20827
|
VS as a1,
|
|
20829
20828
|
ZS as a2,
|
|
20830
|
-
|
|
20829
|
+
PM as a3,
|
|
20831
20830
|
hx as a4,
|
|
20832
20831
|
Ue as a5,
|
|
20833
20832
|
Rt as a6,
|
|
@@ -20844,13 +20843,13 @@ export {
|
|
|
20844
20843
|
Bh as aH,
|
|
20845
20844
|
Dh as aI,
|
|
20846
20845
|
_a as aJ,
|
|
20847
|
-
|
|
20848
|
-
|
|
20846
|
+
bM as aK,
|
|
20847
|
+
yM as aL,
|
|
20849
20848
|
Z1 as aM,
|
|
20850
20849
|
uf as aN,
|
|
20851
20850
|
w1 as aO,
|
|
20852
20851
|
S1 as aP,
|
|
20853
|
-
|
|
20852
|
+
gM as aQ,
|
|
20854
20853
|
Jo as aR,
|
|
20855
20854
|
N1 as aS,
|
|
20856
20855
|
wh as aT,
|
|
@@ -20888,27 +20887,27 @@ export {
|
|
|
20888
20887
|
dl as ay,
|
|
20889
20888
|
f_ as az,
|
|
20890
20889
|
Ax as b,
|
|
20891
|
-
|
|
20892
|
-
|
|
20893
|
-
|
|
20890
|
+
MM as c,
|
|
20891
|
+
SM as d,
|
|
20892
|
+
xM as e,
|
|
20894
20893
|
Rx as f,
|
|
20895
20894
|
Zc as g,
|
|
20896
20895
|
ff as h,
|
|
20897
20896
|
Tx as i,
|
|
20898
|
-
|
|
20897
|
+
IM as j,
|
|
20899
20898
|
c2 as k,
|
|
20900
|
-
|
|
20899
|
+
TM as l,
|
|
20901
20900
|
x2 as m,
|
|
20902
|
-
|
|
20901
|
+
EM as n,
|
|
20903
20902
|
S2 as o,
|
|
20904
20903
|
Xf as p,
|
|
20905
20904
|
ip as q,
|
|
20906
20905
|
Ex as r,
|
|
20907
|
-
|
|
20908
|
-
|
|
20909
|
-
|
|
20906
|
+
CM as s,
|
|
20907
|
+
NM as t,
|
|
20908
|
+
_M as u,
|
|
20910
20909
|
xS as v,
|
|
20911
|
-
|
|
20910
|
+
AM as w,
|
|
20912
20911
|
LS as x,
|
|
20913
20912
|
y_ as y,
|
|
20914
20913
|
RS as z
|
package/dist/runtime.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import "reflect-metadata";
|
|
2
|
-
import { c as le, n as de, a as ue, p as fe, D as pe } from "./index-
|
|
3
|
-
import { B as Et, d as Ot, F as It, R as jt, T as Dt, g as xt, b as Bt, e as Tt, f as Ut, h as Ct, u as Mt, i as At } from "./index-
|
|
2
|
+
import { c as le, n as de, a as ue, p as fe, D as pe } from "./index-DShLht0Q.js";
|
|
3
|
+
import { B as Et, d as Ot, F as It, R as jt, T as Dt, g as xt, b as Bt, e as Tt, f as Ut, h as Ct, u as Mt, i as At } from "./index-DShLht0Q.js";
|
|
4
4
|
import { s as Gt } from "./runtimeFilter-CS35UPHd.js";
|
|
5
|
-
import { $ as ye, a0 as ge, a1 as me, a2 as he, a3 as ve, a4 as be, V as Y, a5 as Se, _ as D } from "./index-
|
|
6
|
-
import { T as zt, a6 as Lt, a7 as Nt } from "./index-
|
|
5
|
+
import { $ as ye, a0 as ge, a1 as me, a2 as he, a3 as ve, a4 as be, V as Y, a5 as Se, _ as D } from "./index-C5agFfBe.js";
|
|
6
|
+
import { T as zt, a6 as Lt, a7 as Nt } from "./index-C5agFfBe.js";
|
|
7
7
|
import * as V from "three";
|
|
8
8
|
import { H as E, P as O, R as Re, u as I, B as we, T as ee, a as Ee } from "./gaesupStore-DTu0tYBp.js";
|
|
9
|
-
import { G as kt, W as Wt, a as $t, W as Vt } from "./index-
|
|
9
|
+
import { G as kt, W as Wt, a as $t, W as Vt } from "./index-Drmv86ws.js";
|
|
10
10
|
import { jsx as f, jsxs as j, Fragment as Oe } from "react/jsx-runtime";
|
|
11
|
-
import { u as x } from "./index-
|
|
11
|
+
import { u as x } from "./index-D0Rz5_-J.js";
|
|
12
12
|
import { useCallback as S, useEffect as N, memo as te, useState as Ie, useRef as je, useMemo as De } from "react";
|
|
13
13
|
import { useFrame as xe } from "@react-three/fiber";
|
|
14
14
|
import { vec3 as J, euler as Be, RigidBody as Te, CapsuleCollider as Ue } from "@react-three/rapier";
|
|
15
|
-
import { D as Kt, I as Ht, L as Zt, S as qt, W as Xt, c as Qt, g as Yt } from "./index-
|
|
15
|
+
import { D as Kt, I as Ht, L as Zt, S as qt, W as Xt, c as Qt, g as Yt } from "./index-BUQXtHf3.js";
|
|
16
16
|
class M {
|
|
17
17
|
cellSize;
|
|
18
18
|
cells = /* @__PURE__ */ new Map();
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useState as T, useCallback as v } from "react";
|
|
2
2
|
import * as _ from "three";
|
|
3
|
-
import "reflect-metadata";
|
|
4
3
|
import { u as k, B as U } from "./gaesupStore-DTu0tYBp.js";
|
|
5
4
|
const j = {
|
|
6
5
|
id: "char_mage_fire",
|
|
@@ -249,14 +248,14 @@ class b {
|
|
|
249
248
|
this.blueprints.clear();
|
|
250
249
|
}
|
|
251
250
|
}
|
|
252
|
-
const I = b.getInstance(),
|
|
251
|
+
const I = b.getInstance(), x = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
253
252
|
__proto__: null,
|
|
254
253
|
blueprintRegistry: I
|
|
255
254
|
}, Symbol.toStringTag, { value: "Module" })), O = "default", E = (r, e) => {
|
|
256
255
|
const n = r?.[e];
|
|
257
256
|
return typeof n == "string" ? n : "";
|
|
258
257
|
}, A = (r) => r.type === "character" ? r.visuals?.model ?? E(r.metadata, "modelUrl") : E(r.metadata, "modelUrl");
|
|
259
|
-
function
|
|
258
|
+
function P() {
|
|
260
259
|
const [r, e] = T(!1), [n, g] = T(null), p = k((t) => t.setMode), u = k((t) => t.setUrls), o = v(async (t, s = {}) => {
|
|
261
260
|
e(!0);
|
|
262
261
|
try {
|
|
@@ -362,6 +361,6 @@ export {
|
|
|
362
361
|
j as F,
|
|
363
362
|
M as W,
|
|
364
363
|
I as b,
|
|
365
|
-
|
|
366
|
-
|
|
364
|
+
x as r,
|
|
365
|
+
P as u
|
|
367
366
|
};
|
package/package.json
CHANGED
package/dist/index-BKqky34r.js
DELETED
|
@@ -1,319 +0,0 @@
|
|
|
1
|
-
import { jsx as m, jsxs as E, Fragment as B } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as P, useState as C, useEffect as K, useMemo as x, useCallback as I, memo as U } from "react";
|
|
3
|
-
import * as S from "three";
|
|
4
|
-
import { Line as L } from "@react-three/drei";
|
|
5
|
-
import { V as T, G as z, W as N, X as F, Y as A, Z as V, U as q, _ as W } from "./index-C-wwuvo7.js";
|
|
6
|
-
import { useFrame as Z } from "@react-three/fiber";
|
|
7
|
-
import "reflect-metadata";
|
|
8
|
-
import { B as j, u as k } from "./gaesupStore-DTu0tYBp.js";
|
|
9
|
-
import { vec3 as Y } from "@react-three/rapier";
|
|
10
|
-
import { u as _ } from "./index-B0hl0p1Z.js";
|
|
11
|
-
const H = () => ({
|
|
12
|
-
position: new S.Vector3(0, 0, 0),
|
|
13
|
-
velocity: new S.Vector3(0, 0, 0),
|
|
14
|
-
rotation: new S.Euler(0, 0, 0),
|
|
15
|
-
isMoving: !1,
|
|
16
|
-
isGrounded: !1,
|
|
17
|
-
speed: 0,
|
|
18
|
-
height: 2
|
|
19
|
-
// Default character height
|
|
20
|
-
});
|
|
21
|
-
function X(e = {}) {
|
|
22
|
-
const { updateInterval: d = 0, entityId: f } = e, l = P(null);
|
|
23
|
-
l.current || (l.current = H());
|
|
24
|
-
const [, g] = C(0), r = P(0), w = P(0), h = P({ x: 0, y: 0, z: 0 }), y = P(void 0), v = P(null), { activeState: R, gameStates: p } = T(), s = (u) => {
|
|
25
|
-
if (f) return f;
|
|
26
|
-
if (y.current) return y.current;
|
|
27
|
-
const n = u.getActiveEntities();
|
|
28
|
-
return y.current = n[0], y.current;
|
|
29
|
-
};
|
|
30
|
-
return K(() => {
|
|
31
|
-
y.current = void 0, v.current = j.getOrCreate("motion");
|
|
32
|
-
const u = v.current;
|
|
33
|
-
if (!u) return;
|
|
34
|
-
const n = u.subscribe((i, t) => {
|
|
35
|
-
const a = s(u);
|
|
36
|
-
if (!a || t !== a) return;
|
|
37
|
-
const c = performance.now();
|
|
38
|
-
if (w.current = c, d > 0 && c - r.current < d) return;
|
|
39
|
-
r.current = c;
|
|
40
|
-
const o = l.current;
|
|
41
|
-
o.position.copy(i.position), o.velocity.copy(i.velocity), o.rotation.copy(i.rotation), o.isMoving = i.isMoving, o.isGrounded = i.isGrounded, o.speed = i.speed, o.height = 2, g((b) => b + 1);
|
|
42
|
-
});
|
|
43
|
-
return () => {
|
|
44
|
-
n();
|
|
45
|
-
};
|
|
46
|
-
}, [f, d]), Z(() => {
|
|
47
|
-
const u = performance.now();
|
|
48
|
-
if (d > 0 && u - r.current < d) return;
|
|
49
|
-
const n = l.current, i = v.current, t = (a) => {
|
|
50
|
-
const c = h.current, o = a.x - c.x, b = a.y - c.y, M = a.z - c.z;
|
|
51
|
-
return o * o + b * b + M * M > 1e-6 ? (c.x = a.x, c.y = a.y, c.z = a.z, !0) : !1;
|
|
52
|
-
};
|
|
53
|
-
if (i) {
|
|
54
|
-
const a = s(i);
|
|
55
|
-
if (!(u - w.current < 16) && a) {
|
|
56
|
-
const o = i.snapshot(a);
|
|
57
|
-
if (o) {
|
|
58
|
-
n.position.copy(o.position), n.velocity.copy(o.velocity), n.rotation.copy(o.rotation), n.isMoving = o.isMoving, n.isGrounded = o.isGrounded, n.speed = o.speed, n.height = 2, r.current = u, t(n.position) && g((b) => b + 1);
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
R?.position && (n.position.copy(R.position), R.velocity ? n.velocity.copy(R.velocity) : n.velocity.set(0, 0, 0), R.euler ? n.rotation.copy(R.euler) : n.rotation.set(0, 0, 0), n.isMoving = p?.isMoving || !1, n.isGrounded = p?.isOnTheGround || !1, n.speed = R.velocity ? R.velocity.length() : 0, n.height = 2, r.current = u, t(n.position) && g((a) => a + 1));
|
|
64
|
-
}), l.current;
|
|
65
|
-
}
|
|
66
|
-
const $ = {
|
|
67
|
-
KeyW: "forward",
|
|
68
|
-
KeyA: "leftward",
|
|
69
|
-
KeyS: "backward",
|
|
70
|
-
KeyD: "rightward",
|
|
71
|
-
ShiftLeft: "shift",
|
|
72
|
-
Space: "space",
|
|
73
|
-
KeyZ: "keyZ",
|
|
74
|
-
KeyR: "keyR",
|
|
75
|
-
KeyF: "keyF",
|
|
76
|
-
KeyE: "keyE",
|
|
77
|
-
Escape: "escape"
|
|
78
|
-
}, J = (e = !0, d = !0, f) => {
|
|
79
|
-
const l = k((s) => s.automation?.queue.isRunning), g = k((s) => s.stopAutomation), r = k((s) => s.interaction?.isActive ?? !0), w = z((s) => s.isInEditMode()), h = N(), y = P(/* @__PURE__ */ new Set()), v = x(() => ({ ...$ }), []), R = I(
|
|
80
|
-
(s, u) => {
|
|
81
|
-
if (!r) return !1;
|
|
82
|
-
try {
|
|
83
|
-
return h.updateKeyboard({ [s]: u }), u ? y.current.add(s) : y.current.delete(s), !0;
|
|
84
|
-
} catch (n) {
|
|
85
|
-
return console.error("Error updating keyboard state:", n), !1;
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
[h, r]
|
|
89
|
-
), p = I(() => {
|
|
90
|
-
y.current.clear(), h.updateKeyboard({
|
|
91
|
-
forward: !1,
|
|
92
|
-
backward: !1,
|
|
93
|
-
leftward: !1,
|
|
94
|
-
rightward: !1,
|
|
95
|
-
shift: !1,
|
|
96
|
-
space: !1,
|
|
97
|
-
keyZ: !1,
|
|
98
|
-
keyR: !1,
|
|
99
|
-
keyF: !1,
|
|
100
|
-
keyE: !1,
|
|
101
|
-
escape: !1
|
|
102
|
-
});
|
|
103
|
-
}, [h]);
|
|
104
|
-
return K(() => {
|
|
105
|
-
(!r || w) && p();
|
|
106
|
-
}, [p, r, w]), K(() => {
|
|
107
|
-
const s = (t, a) => {
|
|
108
|
-
const c = v[t.code];
|
|
109
|
-
if (!c) return;
|
|
110
|
-
if (!r || w) {
|
|
111
|
-
a && t.preventDefault(), p();
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
const o = y.current.has(t.code);
|
|
115
|
-
a && !o ? (y.current.add(t.code), t.code === "Space" && t.preventDefault(), d && l && (c === "forward" || c === "backward" || c === "leftward" || c === "rightward") && (g(), h.updateMouse({ isActive: !1, shouldRun: !1 })), h.updateKeyboard({ [c]: !0 })) : !a && o && (y.current.delete(t.code), h.updateKeyboard({ [c]: !1 }));
|
|
116
|
-
}, u = (t) => s(t, !0), n = (t) => s(t, !1), i = () => document.hidden && p();
|
|
117
|
-
return window.addEventListener("keydown", u), window.addEventListener("keyup", n), document.addEventListener("visibilitychange", i), () => {
|
|
118
|
-
window.removeEventListener("keydown", u), window.removeEventListener("keyup", n), document.removeEventListener("visibilitychange", i);
|
|
119
|
-
};
|
|
120
|
-
}, [
|
|
121
|
-
v,
|
|
122
|
-
d,
|
|
123
|
-
g,
|
|
124
|
-
l,
|
|
125
|
-
p,
|
|
126
|
-
r,
|
|
127
|
-
w,
|
|
128
|
-
h
|
|
129
|
-
]), {
|
|
130
|
-
pressedKeys: Array.from(y.current),
|
|
131
|
-
pushKey: R,
|
|
132
|
-
isKeyPressed: (s) => y.current.has(s),
|
|
133
|
-
clearAllKeys: p
|
|
134
|
-
};
|
|
135
|
-
}, D = U(({ points: e, color: d }) => e.length < 2 ? null : /* @__PURE__ */ m(
|
|
136
|
-
L,
|
|
137
|
-
{
|
|
138
|
-
points: e,
|
|
139
|
-
color: d,
|
|
140
|
-
lineWidth: 2,
|
|
141
|
-
dashed: !1
|
|
142
|
-
}
|
|
143
|
-
));
|
|
144
|
-
D.displayName = "PathLine";
|
|
145
|
-
const O = U(() => /* @__PURE__ */ E("group", { children: [
|
|
146
|
-
/* @__PURE__ */ E("mesh", { children: [
|
|
147
|
-
/* @__PURE__ */ m("sphereGeometry", { args: [0.2, 16, 16] }),
|
|
148
|
-
/* @__PURE__ */ m(
|
|
149
|
-
"meshStandardMaterial",
|
|
150
|
-
{
|
|
151
|
-
color: "#00ff88",
|
|
152
|
-
emissive: "#00ff88",
|
|
153
|
-
emissiveIntensity: 0.5,
|
|
154
|
-
transparent: !0,
|
|
155
|
-
opacity: 0.9
|
|
156
|
-
}
|
|
157
|
-
)
|
|
158
|
-
] }),
|
|
159
|
-
/* @__PURE__ */ E("mesh", { rotation: [Math.PI / 2, 0, 0], children: [
|
|
160
|
-
/* @__PURE__ */ m("ringGeometry", { args: [0.3, 0.5, 8] }),
|
|
161
|
-
/* @__PURE__ */ m(
|
|
162
|
-
"meshStandardMaterial",
|
|
163
|
-
{
|
|
164
|
-
color: "#00ff88",
|
|
165
|
-
transparent: !0,
|
|
166
|
-
opacity: 0.6,
|
|
167
|
-
side: S.DoubleSide
|
|
168
|
-
}
|
|
169
|
-
)
|
|
170
|
-
] })
|
|
171
|
-
] }));
|
|
172
|
-
O.displayName = "TargetMarker";
|
|
173
|
-
function Q() {
|
|
174
|
-
const e = k((t) => t.automation), { position: d } = X(), { mouse: f } = F(), [l, g] = C(() => [...A()]);
|
|
175
|
-
K(() => V(() => {
|
|
176
|
-
g([...A()]);
|
|
177
|
-
}), []);
|
|
178
|
-
const r = f?.target || new S.Vector3(), w = f?.isActive || !1, h = e?.queue || { actions: [], currentIndex: 0 }, y = h.actions || [], v = h.currentIndex || 0, p = d.distanceTo(r) < 1, s = w && !p, u = y.map((t) => t.type === "move" && t.target ? new S.Vector3(t.target.x, t.target.y, t.target.z) : null).filter((t) => t !== null), n = l.length > 0 ? l : [r], i = s ? [d, ...n, ...u] : u.length > 0 ? [d, ...u] : [];
|
|
179
|
-
return /* @__PURE__ */ E("group", { children: [
|
|
180
|
-
s && /* @__PURE__ */ m("group", { position: r, children: /* @__PURE__ */ m(O, {}) }),
|
|
181
|
-
i.length > 1 && /* @__PURE__ */ m(
|
|
182
|
-
D,
|
|
183
|
-
{
|
|
184
|
-
points: i,
|
|
185
|
-
color: v >= 0 ? "#00ff88" : "#ffaa00"
|
|
186
|
-
}
|
|
187
|
-
),
|
|
188
|
-
y.map((t, a) => {
|
|
189
|
-
if (t.type === "move" && t.target) {
|
|
190
|
-
const c = a === v, o = a < v;
|
|
191
|
-
return /* @__PURE__ */ m(
|
|
192
|
-
"group",
|
|
193
|
-
{
|
|
194
|
-
position: [t.target.x, t.target.y, t.target.z],
|
|
195
|
-
children: /* @__PURE__ */ E("mesh", { children: [
|
|
196
|
-
/* @__PURE__ */ m("sphereGeometry", { args: [0.1, 8, 8] }),
|
|
197
|
-
/* @__PURE__ */ m(
|
|
198
|
-
"meshStandardMaterial",
|
|
199
|
-
{
|
|
200
|
-
color: o ? "#888" : c ? "#ff4444" : "#ffaa00",
|
|
201
|
-
transparent: !0,
|
|
202
|
-
opacity: o ? 0.3 : 0.8
|
|
203
|
-
}
|
|
204
|
-
)
|
|
205
|
-
] })
|
|
206
|
-
},
|
|
207
|
-
`action-${a}`
|
|
208
|
-
);
|
|
209
|
-
}
|
|
210
|
-
return null;
|
|
211
|
-
})
|
|
212
|
-
] });
|
|
213
|
-
}
|
|
214
|
-
function ee({ clickerOptions: e }) {
|
|
215
|
-
const { onClick: d } = q(e), f = (l) => {
|
|
216
|
-
l.stopPropagation();
|
|
217
|
-
const { cameraOption: g, setCameraOption: r } = k.getState();
|
|
218
|
-
if (g?.focus) {
|
|
219
|
-
r({ focus: !1 });
|
|
220
|
-
return;
|
|
221
|
-
}
|
|
222
|
-
d(l);
|
|
223
|
-
};
|
|
224
|
-
return /* @__PURE__ */ E(
|
|
225
|
-
"mesh",
|
|
226
|
-
{
|
|
227
|
-
position: [0, 0, 0],
|
|
228
|
-
rotation: [-Math.PI / 2, 0, 0],
|
|
229
|
-
onPointerDown: f,
|
|
230
|
-
visible: !0,
|
|
231
|
-
userData: { intangible: !0 },
|
|
232
|
-
children: [
|
|
233
|
-
/* @__PURE__ */ m("planeGeometry", { args: [1e3, 1e3] }),
|
|
234
|
-
/* @__PURE__ */ m("meshBasicMaterial", { transparent: !0, opacity: 0 })
|
|
235
|
-
]
|
|
236
|
-
}
|
|
237
|
-
);
|
|
238
|
-
}
|
|
239
|
-
function te({ props: e, children: d }) {
|
|
240
|
-
const f = k((i) => i.mode), { gameStates: l } = T(), g = k((i) => i.rideable), r = k((i) => i.urls), w = z((i) => i.isInEditMode()), h = _();
|
|
241
|
-
if (J(), w || !f || !l || !g || !r || f.type === "character" && !r.characterUrl || f.type === "vehicle" && !r.vehicleUrl || f.type === "airplane" && !r.airplaneUrl) return null;
|
|
242
|
-
const { canRide: y, isRiding: v, currentRideable: R } = l, p = R?.id, s = x(
|
|
243
|
-
() => (p ? g[p]?.offset : void 0) ?? Y(),
|
|
244
|
-
[p, g]
|
|
245
|
-
), n = (() => {
|
|
246
|
-
const i = e.rigidBodyRef ?? h.rigidBodyRef, t = e.outerGroupRef ?? h.outerGroupRef, a = e.innerGroupRef ?? h.innerGroupRef, c = e.colliderRef ?? h.colliderRef, o = {
|
|
247
|
-
isActive: !0,
|
|
248
|
-
componentType: f.type,
|
|
249
|
-
enableRiding: y,
|
|
250
|
-
isRiderOn: v,
|
|
251
|
-
offset: s,
|
|
252
|
-
ref: i,
|
|
253
|
-
outerGroupRef: t,
|
|
254
|
-
innerGroupRef: a,
|
|
255
|
-
colliderRef: c,
|
|
256
|
-
parts: (e.parts || []).filter((G) => !!G.url).map((G) => ({ ...G, url: G.url })),
|
|
257
|
-
...e.onAnimate ? { onAnimate: e.onAnimate } : {},
|
|
258
|
-
...e.onFrame ? { onFrame: e.onFrame } : {},
|
|
259
|
-
...e.onReady ? { onReady: e.onReady } : {},
|
|
260
|
-
...e.onDestroy ? { onDestroy: e.onDestroy } : {},
|
|
261
|
-
...e.onDestory ? { onDestory: e.onDestory } : {},
|
|
262
|
-
...typeof e.baseColor == "string" && e.baseColor.trim().length > 0 ? { baseColor: e.baseColor } : {},
|
|
263
|
-
...Array.isArray(e.excludeBaseNodes) && e.excludeBaseNodes.length > 0 ? { excludeBaseNodes: e.excludeBaseNodes } : {},
|
|
264
|
-
...e.rigidBodyProps ? { rigidBodyProps: e.rigidBodyProps } : {},
|
|
265
|
-
...e.controllerOptions ? { controllerOptions: e.controllerOptions } : {},
|
|
266
|
-
...e.groundRay ? { groundRay: e.groundRay } : {},
|
|
267
|
-
...e.colliderSize ? { colliderSize: e.colliderSize } : {},
|
|
268
|
-
...e.position ? { position: e.position } : {},
|
|
269
|
-
...e.rotation ? { rotation: e.rotation } : {},
|
|
270
|
-
...e.scale ? { scale: e.scale } : {}
|
|
271
|
-
}, b = v && f.type !== "character" ? r.ridingUrl : void 0, M = typeof b == "string" && b.length > 0 ? { ridingUrl: b } : {};
|
|
272
|
-
switch (f.type) {
|
|
273
|
-
case "character":
|
|
274
|
-
return {
|
|
275
|
-
...o,
|
|
276
|
-
url: r.characterUrl || ""
|
|
277
|
-
};
|
|
278
|
-
case "vehicle":
|
|
279
|
-
return {
|
|
280
|
-
...o,
|
|
281
|
-
...M,
|
|
282
|
-
url: r.vehicleUrl || "",
|
|
283
|
-
wheelUrl: r.wheelUrl
|
|
284
|
-
};
|
|
285
|
-
case "airplane":
|
|
286
|
-
return {
|
|
287
|
-
...o,
|
|
288
|
-
...M,
|
|
289
|
-
url: r.airplaneUrl || ""
|
|
290
|
-
};
|
|
291
|
-
default:
|
|
292
|
-
return {
|
|
293
|
-
...o,
|
|
294
|
-
url: r.characterUrl || ""
|
|
295
|
-
};
|
|
296
|
-
}
|
|
297
|
-
})();
|
|
298
|
-
return f.type === "character" && l.isRiding ? null : /* @__PURE__ */ m(W, { ...n, children: d });
|
|
299
|
-
}
|
|
300
|
-
function de(e) {
|
|
301
|
-
const { clickToMove: d, children: f, clickerOptions: l, ...g } = e, r = {
|
|
302
|
-
...l ?? {},
|
|
303
|
-
...l?.agentRadius === void 0 && g.colliderSize?.radius !== void 0 ? { agentRadius: g.colliderSize.radius } : {}
|
|
304
|
-
};
|
|
305
|
-
return /* @__PURE__ */ m(te, { props: g, children: /* @__PURE__ */ E(B, { children: [
|
|
306
|
-
d && /* @__PURE__ */ E(B, { children: [
|
|
307
|
-
/* @__PURE__ */ m(ee, { clickerOptions: r }),
|
|
308
|
-
/* @__PURE__ */ m(Q, {})
|
|
309
|
-
] }),
|
|
310
|
-
f
|
|
311
|
-
] }) });
|
|
312
|
-
}
|
|
313
|
-
export {
|
|
314
|
-
de as C,
|
|
315
|
-
ee as G,
|
|
316
|
-
Q as a,
|
|
317
|
-
X as b,
|
|
318
|
-
J as u
|
|
319
|
-
};
|
package/dist/index-C-4Q2Amk.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const i=require("react/jsx-runtime"),h=require("react"),A=require("three"),O=require("@react-three/drei"),S=require("./index-CJj-Z7Jr.cjs"),T=require("@react-three/fiber"),E=require("./gaesupStore-2zKBYTYo.cjs"),D=require("@react-three/rapier"),z=require("./index-D1hpjfAw.cjs");function U(e){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const u=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(c,a,u.get?u:{enumerable:!0,get:()=>e[a]})}}return c.default=e,Object.freeze(c)}const k=U(A),q=()=>({position:new k.Vector3(0,0,0),velocity:new k.Vector3(0,0,0),rotation:new k.Euler(0,0,0),isMoving:!1,isGrounded:!1,speed:0,height:2});function G(e={}){const{updateInterval:c=0,entityId:a}=e,u=h.useRef(null);u.current||(u.current=q());const[,p]=h.useState(0),r=h.useRef(0),x=h.useRef(0),m=h.useRef({x:0,y:0,z:0}),g=h.useRef(void 0),R=h.useRef(null),{activeState:b,gameStates:v}=S.useStateSystem(),l=y=>{if(a)return a;if(g.current)return g.current;const n=y.getActiveEntities();return g.current=n[0],g.current};return h.useEffect(()=>{g.current=void 0,R.current=E.BridgeFactory.getOrCreate("motion");const y=R.current;if(!y)return;const n=y.subscribe((s,t)=>{const d=l(y);if(!d||t!==d)return;const f=performance.now();if(x.current=f,c>0&&f-r.current<c)return;r.current=f;const o=u.current;o.position.copy(s.position),o.velocity.copy(s.velocity),o.rotation.copy(s.rotation),o.isMoving=s.isMoving,o.isGrounded=s.isGrounded,o.speed=s.speed,o.height=2,p(w=>w+1)});return()=>{n()}},[a,c]),T.useFrame(()=>{const y=performance.now();if(c>0&&y-r.current<c)return;const n=u.current,s=R.current,t=d=>{const f=m.current,o=d.x-f.x,w=d.y-f.y,P=d.z-f.z;return o*o+w*w+P*P>1e-6?(f.x=d.x,f.y=d.y,f.z=d.z,!0):!1};if(s){const d=l(s);if(!(y-x.current<16)&&d){const o=s.snapshot(d);if(o){n.position.copy(o.position),n.velocity.copy(o.velocity),n.rotation.copy(o.rotation),n.isMoving=o.isMoving,n.isGrounded=o.isGrounded,n.speed=o.speed,n.height=2,r.current=y,t(n.position)&&p(w=>w+1);return}}}b?.position&&(n.position.copy(b.position),b.velocity?n.velocity.copy(b.velocity):n.velocity.set(0,0,0),b.euler?n.rotation.copy(b.euler):n.rotation.set(0,0,0),n.isMoving=v?.isMoving||!1,n.isGrounded=v?.isOnTheGround||!1,n.speed=b.velocity?b.velocity.length():0,n.height=2,r.current=y,t(n.position)&&p(d=>d+1))}),u.current}const N={KeyW:"forward",KeyA:"leftward",KeyS:"backward",KeyD:"rightward",ShiftLeft:"shift",Space:"space",KeyZ:"keyZ",KeyR:"keyR",KeyF:"keyF",KeyE:"keyE",Escape:"escape"},M=(e=!0,c=!0,a)=>{const u=E.useGaesupStore(l=>l.automation?.queue.isRunning),p=E.useGaesupStore(l=>l.stopAutomation),r=E.useGaesupStore(l=>l.interaction?.isActive??!0),x=S.useBuildingStore(l=>l.isInEditMode()),m=S.useInputBackend(),g=h.useRef(new Set),R=h.useMemo(()=>({...N}),[]),b=h.useCallback((l,y)=>{if(!r)return!1;try{return m.updateKeyboard({[l]:y}),y?g.current.add(l):g.current.delete(l),!0}catch(n){return console.error("Error updating keyboard state:",n),!1}},[m,r]),v=h.useCallback(()=>{g.current.clear(),m.updateKeyboard({forward:!1,backward:!1,leftward:!1,rightward:!1,shift:!1,space:!1,keyZ:!1,keyR:!1,keyF:!1,keyE:!1,escape:!1})},[m]);return h.useEffect(()=>{(!r||x)&&v()},[v,r,x]),h.useEffect(()=>{const l=(t,d)=>{const f=R[t.code];if(!f)return;if(!r||x){d&&t.preventDefault(),v();return}const o=g.current.has(t.code);d&&!o?(g.current.add(t.code),t.code==="Space"&&t.preventDefault(),c&&u&&(f==="forward"||f==="backward"||f==="leftward"||f==="rightward")&&(p(),m.updateMouse({isActive:!1,shouldRun:!1})),m.updateKeyboard({[f]:!0})):!d&&o&&(g.current.delete(t.code),m.updateKeyboard({[f]:!1}))},y=t=>l(t,!0),n=t=>l(t,!1),s=()=>document.hidden&&v();return window.addEventListener("keydown",y),window.addEventListener("keyup",n),document.addEventListener("visibilitychange",s),()=>{window.removeEventListener("keydown",y),window.removeEventListener("keyup",n),document.removeEventListener("visibilitychange",s)}},[R,c,p,u,v,r,x,m]),{pressedKeys:Array.from(g.current),pushKey:b,isKeyPressed:l=>g.current.has(l),clearAllKeys:v}},C=h.memo(({points:e,color:c})=>e.length<2?null:i.jsx(O.Line,{points:e,color:c,lineWidth:2,dashed:!1}));C.displayName="PathLine";const K=h.memo(()=>i.jsxs("group",{children:[i.jsxs("mesh",{children:[i.jsx("sphereGeometry",{args:[.2,16,16]}),i.jsx("meshStandardMaterial",{color:"#00ff88",emissive:"#00ff88",emissiveIntensity:.5,transparent:!0,opacity:.9})]}),i.jsxs("mesh",{rotation:[Math.PI/2,0,0],children:[i.jsx("ringGeometry",{args:[.3,.5,8]}),i.jsx("meshStandardMaterial",{color:"#00ff88",transparent:!0,opacity:.6,side:k.DoubleSide})]})]}));K.displayName="TargetMarker";function B(){const e=E.useGaesupStore(t=>t.automation),{position:c}=G(),{mouse:a}=S.useInteractionSystem(),[u,p]=h.useState(()=>[...S.getClickNavigationRoute()]);h.useEffect(()=>S.subscribeClickNavigationRoute(()=>{p([...S.getClickNavigationRoute()])}),[]);const r=a?.target||new k.Vector3,x=a?.isActive||!1,m=e?.queue||{actions:[],currentIndex:0},g=m.actions||[],R=m.currentIndex||0,v=c.distanceTo(r)<1,l=x&&!v,y=g.map(t=>t.type==="move"&&t.target?new k.Vector3(t.target.x,t.target.y,t.target.z):null).filter(t=>t!==null),n=u.length>0?u:[r],s=l?[c,...n,...y]:y.length>0?[c,...y]:[];return i.jsxs("group",{children:[l&&i.jsx("group",{position:r,children:i.jsx(K,{})}),s.length>1&&i.jsx(C,{points:s,color:R>=0?"#00ff88":"#ffaa00"}),g.map((t,d)=>{if(t.type==="move"&&t.target){const f=d===R,o=d<R;return i.jsx("group",{position:[t.target.x,t.target.y,t.target.z],children:i.jsxs("mesh",{children:[i.jsx("sphereGeometry",{args:[.1,8,8]}),i.jsx("meshStandardMaterial",{color:o?"#888":f?"#ff4444":"#ffaa00",transparent:!0,opacity:o?.3:.8})]})},`action-${d}`)}return null})]})}function I({clickerOptions:e}){const{onClick:c}=S.useClicker(e),a=u=>{u.stopPropagation();const{cameraOption:p,setCameraOption:r}=E.useGaesupStore.getState();if(p?.focus){r({focus:!1});return}c(u)};return i.jsxs("mesh",{position:[0,0,0],rotation:[-Math.PI/2,0,0],onPointerDown:a,visible:!0,userData:{intangible:!0},children:[i.jsx("planeGeometry",{args:[1e3,1e3]}),i.jsx("meshBasicMaterial",{transparent:!0,opacity:0})]})}function F({props:e,children:c}){const a=E.useGaesupStore(s=>s.mode),{gameStates:u}=S.useStateSystem(),p=E.useGaesupStore(s=>s.rideable),r=E.useGaesupStore(s=>s.urls),x=S.useBuildingStore(s=>s.isInEditMode()),m=z.useGenericRefs();if(M(),x||!a||!u||!p||!r||a.type==="character"&&!r.characterUrl||a.type==="vehicle"&&!r.vehicleUrl||a.type==="airplane"&&!r.airplaneUrl)return null;const{canRide:g,isRiding:R,currentRideable:b}=u,v=b?.id,l=h.useMemo(()=>(v?p[v]?.offset:void 0)??D.vec3(),[v,p]),n=(()=>{const s=e.rigidBodyRef??m.rigidBodyRef,t=e.outerGroupRef??m.outerGroupRef,d=e.innerGroupRef??m.innerGroupRef,f=e.colliderRef??m.colliderRef,o={isActive:!0,componentType:a.type,enableRiding:g,isRiderOn:R,offset:l,ref:s,outerGroupRef:t,innerGroupRef:d,colliderRef:f,parts:(e.parts||[]).filter(j=>!!j.url).map(j=>({...j,url:j.url})),...e.onAnimate?{onAnimate:e.onAnimate}:{},...e.onFrame?{onFrame:e.onFrame}:{},...e.onReady?{onReady:e.onReady}:{},...e.onDestroy?{onDestroy:e.onDestroy}:{},...e.onDestory?{onDestory:e.onDestory}:{},...typeof e.baseColor=="string"&&e.baseColor.trim().length>0?{baseColor:e.baseColor}:{},...Array.isArray(e.excludeBaseNodes)&&e.excludeBaseNodes.length>0?{excludeBaseNodes:e.excludeBaseNodes}:{},...e.rigidBodyProps?{rigidBodyProps:e.rigidBodyProps}:{},...e.controllerOptions?{controllerOptions:e.controllerOptions}:{},...e.groundRay?{groundRay:e.groundRay}:{},...e.colliderSize?{colliderSize:e.colliderSize}:{},...e.position?{position:e.position}:{},...e.rotation?{rotation:e.rotation}:{},...e.scale?{scale:e.scale}:{}},w=R&&a.type!=="character"?r.ridingUrl:void 0,P=typeof w=="string"&&w.length>0?{ridingUrl:w}:{};switch(a.type){case"character":return{...o,url:r.characterUrl||""};case"vehicle":return{...o,...P,url:r.vehicleUrl||"",wheelUrl:r.wheelUrl};case"airplane":return{...o,...P,url:r.airplaneUrl||""};default:return{...o,url:r.characterUrl||""}}})();return a.type==="character"&&u.isRiding?null:i.jsx(S.PhysicsEntity,{...n,children:c})}function L(e){const{clickToMove:c,children:a,clickerOptions:u,...p}=e,r={...u??{},...u?.agentRadius===void 0&&p.colliderSize?.radius!==void 0?{agentRadius:p.colliderSize.radius}:{}};return i.jsx(F,{props:p,children:i.jsxs(i.Fragment,{children:[c&&i.jsxs(i.Fragment,{children:[i.jsx(I,{clickerOptions:r}),i.jsx(B,{})]}),a]})})}exports.Clicker=B;exports.ControllerWrapper=L;exports.GroundClicker=I;exports.useKeyboard=M;exports.usePlayerPosition=G;
|
|
@@ -5,8 +5,8 @@ import { useFrame as en, useGraph as pt } from "@react-three/fiber";
|
|
|
5
5
|
import { RigidBody as tn, euler as nn, CapsuleCollider as rn } from "@react-three/rapier";
|
|
6
6
|
import * as w from "three";
|
|
7
7
|
import { SkeletonUtils as yt } from "three-stdlib";
|
|
8
|
-
import "reflect-metadata";
|
|
9
8
|
import { l as ye, b as on, D as sn, A as bt, M as wt, u as B, B as vt, H as P, P as C, a as an, c as ae, d as ln, e as St, g as cn, V as qe } from "./gaesupStore-DTu0tYBp.js";
|
|
9
|
+
import "reflect-metadata";
|
|
10
10
|
import { I as un } from "./EventBus-Ck0Dwee2.js";
|
|
11
11
|
import { enableMapSet as dn } from "immer";
|
|
12
12
|
import { create as hn } from "zustand";
|