@gamelearn/arcade-components 3.5.6 → 3.5.8
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.
|
@@ -26517,7 +26517,7 @@ function addPrimitiveAttributes(o, e, r) {
|
|
|
26517
26517
|
return e.targets !== void 0 ? addMorphTargets(o, e.targets, r) : o;
|
|
26518
26518
|
});
|
|
26519
26519
|
}
|
|
26520
|
-
const defaultCamPos = [0, 14.63, 16], isMobile = DeviceDetection(), loader$1 = new GLTFLoader(), box = new Box3(),
|
|
26520
|
+
const defaultCamPos = [0, 14.63, 16], isMobile = DeviceDetection(), loader$1 = new GLTFLoader(), box = new Box3(), worldPos = new Vector3(), size = new Vector3();
|
|
26521
26521
|
function Panel({ character: o, ttsStarted: e, active: r, emitEvent: t }) {
|
|
26522
26522
|
var _, p, S, C, T;
|
|
26523
26523
|
const n = useRef(null), a = useRef(null), u = o.type === "character", [l, f] = useState(!1), d = useMemo(() => t({ type: "currentLod" }), [t]), h = useRef(), y = useMemo(() => {
|
|
@@ -26549,11 +26549,18 @@ function Panel({ character: o, ttsStarted: e, active: r, emitEvent: t }) {
|
|
|
26549
26549
|
}, [(C = (S = (p = o == null ? void 0 : o.resource) == null ? void 0 : p.animations) == null ? void 0 : S.talking) == null ? void 0 : C.url, e, r, E, l]);
|
|
26550
26550
|
const g = useCallback(
|
|
26551
26551
|
(x) => {
|
|
26552
|
-
x == null || x.traverse((A) => {
|
|
26552
|
+
if (x == null || x.traverse((A) => {
|
|
26553
26553
|
A.isMesh && (A.material.roughness = 0.7, A.material.metalness = 0.5);
|
|
26554
|
-
}),
|
|
26554
|
+
}), o.type === "character") {
|
|
26555
|
+
const A = x.getObjectByName("Head_M", !0);
|
|
26556
|
+
A && setTimeout(() => {
|
|
26557
|
+
A.updateMatrixWorld(!0);
|
|
26558
|
+
}, 200), n.current.zoom = 1.5;
|
|
26559
|
+
} else
|
|
26560
|
+
cameraFitAnyObject(x, n.current), n.current.zoom = 1;
|
|
26561
|
+
n.current.updateProjectionMatrix();
|
|
26555
26562
|
},
|
|
26556
|
-
[o
|
|
26563
|
+
[o]
|
|
26557
26564
|
);
|
|
26558
26565
|
return useFrame(({ gl: x }) => {
|
|
26559
26566
|
if (n.current && a.current) {
|
|
@@ -26570,7 +26577,7 @@ function Panel({ character: o, ttsStarted: e, active: r, emitEvent: t }) {
|
|
|
26570
26577
|
if (u) {
|
|
26571
26578
|
box.setFromObject(h.current), box.getSize(size);
|
|
26572
26579
|
const F = h.current.getObjectByName("Head_M", !0);
|
|
26573
|
-
F ? (F.getWorldPosition(worldPos), n.current.lookAt(worldPos)
|
|
26580
|
+
F ? (F.getWorldPosition(worldPos), n.current.lookAt(worldPos)) : n.current.position.setY(size.y - 1.5 * 1.3), n.current.zoom = 1.5;
|
|
26574
26581
|
}
|
|
26575
26582
|
const D = isMobile ? 24 : 40;
|
|
26576
26583
|
k.bottom += r ? -D : D, x.setViewport(k.left, k.bottom, w, O), x.setScissor(k.left, k.bottom, w, O), x.render(a.current, n.current);
|
|
@@ -26585,8 +26592,7 @@ function Panel({ character: o, ttsStarted: e, active: r, emitEvent: t }) {
|
|
|
26585
26592
|
url: o.resource.url,
|
|
26586
26593
|
animationUrl: y.url,
|
|
26587
26594
|
type: o.type,
|
|
26588
|
-
onLoad: g
|
|
26589
|
-
interactive: !1
|
|
26595
|
+
onLoad: g
|
|
26590
26596
|
}
|
|
26591
26597
|
) }) : null,
|
|
26592
26598
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -26598,46 +26604,34 @@ function Panel({ character: o, ttsStarted: e, active: r, emitEvent: t }) {
|
|
|
26598
26604
|
rotation: [0, 0, 0],
|
|
26599
26605
|
onUpdate: (x) => {
|
|
26600
26606
|
x.layers.enableAll();
|
|
26601
|
-
}
|
|
26607
|
+
},
|
|
26608
|
+
manual: !0
|
|
26602
26609
|
}
|
|
26603
26610
|
),
|
|
26604
26611
|
/* @__PURE__ */ jsxRuntimeExports.jsx(LightSet, {})
|
|
26605
26612
|
] });
|
|
26606
26613
|
}
|
|
26607
|
-
const Panels = ({ characters: o, slots: e, ttsStarted: r, activeIndex: t, flex: n, lodSettings: a, emitEvent: u }) => e.map((l, f) => {
|
|
26608
|
-
let d = null;
|
|
26609
|
-
const h = o.findIndex((y) => y && y.uid === l.uid);
|
|
26610
|
-
if (h >= 0) {
|
|
26611
|
-
const y = n ? h : f;
|
|
26612
|
-
return d = { ...o[h] }, d.slot = y, /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
26613
|
-
Panel,
|
|
26614
|
-
{
|
|
26615
|
-
character: d,
|
|
26616
|
-
active: t === y,
|
|
26617
|
-
lodSettings: a,
|
|
26618
|
-
ttsStarted: r,
|
|
26619
|
-
emitEvent: u
|
|
26620
|
-
},
|
|
26621
|
-
`${`${d.uid}_${f}`}_${h}`
|
|
26622
|
-
);
|
|
26623
|
-
}
|
|
26624
|
-
return null;
|
|
26625
|
-
});
|
|
26626
26614
|
function PanelsWrapper({ characters: o, slots: e, ttsStarted: r, slotRefs: t, flex: n, currentMessage: a, emitEvent: u }) {
|
|
26627
26615
|
return useFrame(({ gl: l }) => {
|
|
26628
26616
|
l.setScissorTest(!1), l.clear(!0, !0), l.setScissorTest(!0);
|
|
26629
|
-
}),
|
|
26630
|
-
|
|
26631
|
-
|
|
26632
|
-
|
|
26633
|
-
|
|
26634
|
-
|
|
26635
|
-
|
|
26636
|
-
|
|
26637
|
-
|
|
26638
|
-
|
|
26617
|
+
}), e.map((l, f) => {
|
|
26618
|
+
let d = null;
|
|
26619
|
+
const h = o.findIndex((y) => y && y.uid === l.uid);
|
|
26620
|
+
if (h >= 0) {
|
|
26621
|
+
const y = n ? h : f;
|
|
26622
|
+
return d = { ...o[h] }, d.slot = y, /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
26623
|
+
Panel,
|
|
26624
|
+
{
|
|
26625
|
+
character: d,
|
|
26626
|
+
active: a.position === y,
|
|
26627
|
+
ttsStarted: r,
|
|
26628
|
+
emitEvent: u
|
|
26629
|
+
},
|
|
26630
|
+
`${`${d.uid}_${f}`}_${h}`
|
|
26631
|
+
);
|
|
26639
26632
|
}
|
|
26640
|
-
|
|
26633
|
+
return null;
|
|
26634
|
+
});
|
|
26641
26635
|
}
|
|
26642
26636
|
function Scene(o) {
|
|
26643
26637
|
return o.lowQuality ? null : /* @__PURE__ */ jsxRuntimeExports.jsxs(
|