@vincentt-xr/sdk 2.0.0-alpha.0 → 2.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/GROUNDING.md +232 -14
- package/dist/{DebuggerUI-CEfdddkZ.cjs → DebuggerUI-CatYc-RG.cjs} +1 -1
- package/dist/{DebuggerUI-Dgop6Q6o.js → DebuggerUI-gLMKiVwJ.js} +1 -1
- package/dist/MediaSourceSwitcher-C-xYg0nQ.js +317 -0
- package/dist/MediaSourceSwitcher-Cq3g4IKw.cjs +31 -0
- package/dist/components/FaceMesh/canonical/CanonicalFaceMeshRenderer.d.ts +6 -1
- package/dist/components/FaceMesh/material/defaults.d.ts +4 -0
- package/dist/components/FaceMesh/material/types.d.ts +2 -0
- package/dist/components/FaceRetouch/Background.d.ts +6 -1
- package/dist/components/FaceRetouch/defaults.d.ts +13 -0
- package/dist/components/FaceRetouch/index.d.ts +3 -1
- package/dist/components/FaceRetouch/landmarkMask.d.ts +4 -1
- package/dist/components/FaceRetouch/useFaceRetouchMask.d.ts +2 -1
- package/dist/components/FaceWarp3D/FaceWarp3DHead.d.ts +15 -0
- package/dist/components/FaceWarp3D/defaults.d.ts +37 -0
- package/dist/components/FaceWarp3D/index.d.ts +3 -0
- package/dist/components/FaceWarp3D/warp.d.ts +13 -0
- package/dist/components/HandJoints2D/index.d.ts +6 -0
- package/dist/components/HandTracker/index.d.ts +2 -2
- package/dist/components/HandTracking2D/HandVisual.d.ts +12 -0
- package/dist/components/HandTracking2D/index.d.ts +5 -0
- package/dist/components/HandTracking2DController/index.d.ts +5 -0
- package/dist/components/HandTracking3D/index.d.ts +6 -0
- package/dist/components/ScreenImage/index.d.ts +87 -0
- package/dist/components/ScreenText/index.d.ts +20 -0
- package/dist/components/TextLabel/index.d.ts +99 -0
- package/dist/components/XRScene/index.d.ts +14 -3
- package/dist/components/XRViewport/index.d.ts +17 -0
- package/dist/components/index.d.ts +7 -0
- package/dist/debug-ui/default-setting/index.d.ts +37 -0
- package/dist/debug-ui/default-setting.cjs +21 -0
- package/dist/debug-ui/default-setting.js +777 -0
- package/dist/debug-ui/face-warp-3d/index.d.ts +6 -0
- package/dist/debug-ui/hand-joints-2d/index.d.ts +6 -0
- package/dist/debug-ui/hand-tracking-2d/index.d.ts +6 -0
- package/dist/debug-ui/hand-tracking-2d-controller/index.d.ts +6 -0
- package/dist/debug-ui/hand-tracking-3d/index.d.ts +6 -0
- package/dist/debug-ui/index.d.ts +23 -0
- package/dist/debug-ui/layer-panel/index.d.ts +17 -0
- package/dist/debug-ui/media-source/MediaSourceSwitcher.d.ts +10 -0
- package/dist/debug-ui/media-source/index.d.ts +4 -0
- package/dist/debug-ui/media-source/media-preset.d.ts +9 -0
- package/dist/debug-ui/media-source.cjs +1 -0
- package/dist/debug-ui/media-source.js +7 -0
- package/dist/debug-ui/screen-image-settings/index.d.ts +7 -0
- package/dist/debug-ui/screen-text-settings/index.d.ts +122 -0
- package/dist/debug-ui/settings-panel/index.d.ts +38 -0
- package/dist/debug-ui/shared/MaterialSection.d.ts +13 -0
- package/dist/debug-ui/shared/ScreenTransformSection.d.ts +29 -0
- package/dist/debug-ui.cjs +20 -0
- package/dist/debug-ui.js +6063 -0
- package/dist/defaults-BLpcN3pG.cjs +1 -0
- package/dist/defaults-LtY4M7dg.js +55 -0
- package/dist/entries/core.d.ts +5 -1
- package/dist/entries/face-effects.d.ts +2 -0
- package/dist/entries/low-level.d.ts +3 -0
- package/dist/face-effects.cjs +113 -23
- package/dist/face-effects.js +1566 -1399
- package/dist/handJoints2d.d.ts +49 -0
- package/dist/handTracking2d.d.ts +33 -0
- package/dist/handTracking2dController.d.ts +65 -0
- package/dist/handTracking3d.d.ts +52 -0
- package/dist/{index-BD-JWMjE.js → index-BGNbrc4C.js} +113 -137
- package/dist/index-BXyObVHF.cjs +1 -0
- package/dist/index-CY3bUAcW.js +12 -0
- package/dist/index-C_Duh13c.cjs +1 -0
- package/dist/index-D8fpPQkC.cjs +1 -0
- package/dist/index-DxshgBu0.cjs +1 -0
- package/dist/index-O-2crZ3M.js +1102 -0
- package/dist/{index-CYMj26Ej.js → index-safCs_af.js} +426 -416
- package/dist/{internal-DH5d1Xnq.cjs → internal-BjyhBP8i.cjs} +1 -1
- package/dist/{internal-KOKJDxCG.js → internal-Cae1ps15.js} +3 -3
- package/dist/internal.cjs +1 -1
- package/dist/internal.js +2 -2
- package/dist/layerStack.d.ts +29 -0
- package/dist/low-level.cjs +1 -1
- package/dist/low-level.js +74 -890
- package/dist/main.cjs +73 -1
- package/dist/main.js +1656 -407
- package/dist/models/Hand/HandTracking.d.ts +2 -0
- package/dist/screen2d/index.d.ts +4 -0
- package/dist/screen2d/material-runtime.d.ts +32 -0
- package/dist/screen2d/texture.d.ts +10 -0
- package/dist/screen2d/transform.d.ts +25 -0
- package/dist/screen2d/types.d.ts +90 -0
- package/dist/screenImagePresets.d.ts +13 -0
- package/dist/screenImageSettings-6NRg4cx9.js +39 -0
- package/dist/screenImageSettings-y_B4_767.cjs +1 -0
- package/dist/screenImageSettings.d.ts +50 -0
- package/dist/screenTextPresets.d.ts +6 -0
- package/dist/screenTextSettings.d.ts +131 -0
- package/dist/{selectors-Bub0o3qy.cjs → selectors-BLl2JUWW.cjs} +1 -1
- package/dist/{selectors-BHO6TnoC.js → selectors-CXd_x-6t.js} +6 -6
- package/dist/tracking.cjs +1 -1
- package/dist/tracking.js +193 -168
- package/dist/types/hand-tracking.d.ts +8 -0
- package/dist/types/nodes.d.ts +2 -0
- package/dist/useXRModel-3DcUa28n.cjs +1 -0
- package/dist/useXRModel-BMJE1hrk.js +28 -0
- package/dist/x-Co8jPhP0.js +127 -0
- package/dist/x-KC8E4Gaj.cjs +41 -0
- package/package.json +19 -1
- package/dist/index-B5J4gzn2.cjs +0 -1
- package/dist/index-BVBVg96G.cjs +0 -1
- package/dist/index-DtwHElmG.js +0 -157
- package/dist/index-PtFmD6B8.cjs +0 -1
package/dist/face-effects.js
CHANGED
|
@@ -1,26 +1,51 @@
|
|
|
1
1
|
import * as R from "three";
|
|
2
|
-
import { TrianglesDrawMode as
|
|
3
|
-
import { jsxs as
|
|
4
|
-
import { useThree as
|
|
5
|
-
import { useState as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { p as
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
},
|
|
2
|
+
import { TrianglesDrawMode as dn, TriangleFanDrawMode as ut, TriangleStripDrawMode as Ht, Loader as fn, LoaderUtils as be, FileLoader as Gt, MeshPhysicalMaterial as V, Vector2 as Xt, Color as oe, LinearSRGBColorSpace as Z, SRGBColorSpace as Me, SpotLight as mn, PointLight as pn, DirectionalLight as gn, Matrix4 as Oe, Vector3 as se, Quaternion as jt, InstancedMesh as An, InstancedBufferAttribute as vn, Object3D as Kt, TextureLoader as Tn, ImageBitmapLoader as xn, BufferAttribute as qe, InterleavedBuffer as bn, InterleavedBufferAttribute as Mn, LinearMipmapLinearFilter as Yt, NearestMipmapLinearFilter as Rn, LinearMipmapNearestFilter as En, NearestMipmapNearestFilter as wn, LinearFilter as ht, NearestFilter as Wt, RepeatWrapping as dt, MirroredRepeatWrapping as Sn, ClampToEdgeWrapping as yn, PointsMaterial as _n, Material as Ze, LineBasicMaterial as Ln, MeshStandardMaterial as Vt, DoubleSide as Fe, MeshBasicMaterial as Te, PropertyBinding as Cn, BufferGeometry as In, SkinnedMesh as Pn, Mesh as Nn, LineSegments as Fn, Line as kn, LineLoop as On, Points as Dn, Group as Qe, PerspectiveCamera as Un, MathUtils as Bn, OrthographicCamera as Hn, Skeleton as Gn, AnimationClip as Xn, Bone as jn, InterpolateDiscrete as Kn, InterpolateLinear as zt, Texture as wt, VectorKeyframeTrack as St, NumberKeyframeTrack as yt, QuaternionKeyframeTrack as _t, ColorManagement as Lt, FrontSide as Yn, Interpolant as Wn, Box3 as Vn, Sphere as zn, Euler as qn } from "three";
|
|
3
|
+
import { jsxs as S, Fragment as ft, jsx as x } from "react/jsx-runtime";
|
|
4
|
+
import { useThree as qt, useLoader as $e, useFrame as Zn } from "@react-three/fiber";
|
|
5
|
+
import { useState as gt, useEffect as $, useMemo as W, useRef as P } from "react";
|
|
6
|
+
import { f as Zt, X as Qn } from "./index-safCs_af.js";
|
|
7
|
+
import { d as $n, b as Qt } from "./selectors-CXd_x-6t.js";
|
|
8
|
+
import { p as Jn, F as es, a as ts } from "./index-BGNbrc4C.js";
|
|
9
|
+
import { l as De } from "./index-CY3bUAcW.js";
|
|
10
|
+
import { D as To, F as xo } from "./defaults-LtY4M7dg.js";
|
|
11
|
+
import { Text as Je } from "@react-three/drei";
|
|
12
|
+
const xe = (a) => Math.min(1, Math.max(0, a)), U = (a, e, t) => xe(1 - Math.abs(a - e) / t), ns = (a) => {
|
|
13
|
+
let e = 1 / 0, t = -1 / 0, s = 1 / 0, n = -1 / 0;
|
|
14
|
+
for (const c of a)
|
|
15
|
+
e = Math.min(e, c.x), t = Math.max(t, c.x), s = Math.min(s, c.y), n = Math.max(n, c.y);
|
|
16
|
+
const o = Math.max(t - e, 1e-3), r = Math.max(n - s, 1e-3);
|
|
17
|
+
return {
|
|
18
|
+
centerX: e + o * 0.5,
|
|
19
|
+
centerY: s + r * 0.5,
|
|
20
|
+
width: o,
|
|
21
|
+
height: r
|
|
22
|
+
};
|
|
23
|
+
}, ss = (a) => a != null && a.enabled ? (a.strength ?? 1) !== 0 && Object.entries(a).some(
|
|
24
|
+
([e, t]) => e !== "enabled" && e !== "strength" && typeof t == "number" && t !== 0
|
|
25
|
+
) : !1, rs = (a, e, t, s) => {
|
|
26
|
+
const n = t.enabled ? t.strength ?? 1 : 0;
|
|
27
|
+
if (n === 0)
|
|
28
|
+
return s.x = a.x, s.y = a.y, s.z = a.z, s;
|
|
29
|
+
const o = (a.x - e.centerX) / e.width, r = (a.y - e.centerY) / e.height, c = Math.abs(o), i = xe((-r + 0.42) / 0.55), l = U(r, -0.02, 0.34), h = U(r, -0.24, 0.16) * xe((c - 0.05) / 0.28), u = U(r, 0.02, 0.26) * U(c, 0, 0.18), d = U(r, 0.29, 0.18) * U(c, 0, 0.36), m = xe((r - 0.16) / 0.36), A = l * U(c, 0.34, 0.22), g = i * U(c, 0, 0.48), p = U(r, -0.19, 0.1) * xe((c - 0.05) / 0.3), f = U(r, 0.48, 0.2) * U(c, 0, 0.26);
|
|
30
|
+
let v = a.x, T = a.y, b = a.z;
|
|
31
|
+
const E = (F, _ = 1) => {
|
|
32
|
+
v += o * e.width * F * n * _;
|
|
33
|
+
}, L = (F, _ = 1) => {
|
|
34
|
+
T += r * e.height * F * n * _;
|
|
35
|
+
};
|
|
36
|
+
E(t.faceWidth ?? 0), L(t.faceHeight ?? 0), E(t.faceRoundness ?? 0, l * (1 - c)), T -= e.height * (t.midfaceHeight ?? 0) * n * l * 0.25, L(-(t.foreheadHeight ?? 0), g), E(t.foreheadWidth ?? 0, g), E(
|
|
37
|
+
t.cheekboneWidth ?? 0,
|
|
38
|
+
U(r, -0.06, 0.16) * U(c, 0.34, 0.2)
|
|
39
|
+
), E(t.cheekWidth ?? 0, A), E(t.jawWidth ?? 0, m), L(t.chinHeight ?? 0, f), T -= e.height * (t.scalpHeight ?? 0) * n * i * 0.3, b -= (t.midfaceDepth ?? 0) * n * l * 0.08, b += (t.cheekHollowness ?? 0) * n * A * 0.06, b -= (t.browDepth ?? 0) * n * p * 0.05, T -= e.height * (t.browHeight ?? 0) * n * p * 0.2, v += Math.sign(o || 1) * e.width * (t.browDistance ?? 0) * n * p * 0.16;
|
|
40
|
+
const y = (t.headCurve ?? 0) * n * (r + 0.1);
|
|
41
|
+
b -= y * y * 0.04 * Math.sign(t.headCurve ?? 0), v += e.width * (t.faceTwist ?? 0) * n * r * 0.18;
|
|
42
|
+
const N = (t.faceSwirl ?? 0) * n * 0.22;
|
|
43
|
+
v += -r * e.width * N, T += o * e.height * N;
|
|
44
|
+
const C = o < 0 ? t.leftEyeSize ?? 0 : t.rightEyeSize ?? 0, I = ((t.eyeSize ?? 0) + C) * n * h;
|
|
45
|
+
v += o * e.width * I * 0.45, T += (r + 0.24) * e.height * I * 0.7, v += Math.sign(o || 1) * e.width * (t.eyeDistance ?? 0) * n * h * 0.2, v += e.width * (o < 0 ? t.leftEyeX ?? 0 : t.rightEyeX ?? 0) * n * h * 0.15, T += e.height * (o < 0 ? t.leftEyeY ?? 0 : t.rightEyeY ?? 0) * n * h * 0.15;
|
|
46
|
+
const O = (t.noseSize ?? 0) * n * u;
|
|
47
|
+
return v += o * e.width * O * 0.7, T += (r - 0.02) * e.height * O * 0.5, T += e.height * (t.noseLength ?? 0) * n * u * Math.max(r + 0.08, 0) * 0.4, b -= (t.noseSize ?? 0) * n * u * 0.08, v += o * e.width * (t.mouthWidth ?? 0) * n * d, T += (r - 0.29) * e.height * (t.mouthHeight ?? 0) * n * d, s.x = v, s.y = T, s.z = b, s;
|
|
48
|
+
}, et = /* @__PURE__ */ new Set([
|
|
24
49
|
61,
|
|
25
50
|
146,
|
|
26
51
|
91,
|
|
@@ -52,7 +77,7 @@ const Tt = {
|
|
|
52
77
|
311,
|
|
53
78
|
310,
|
|
54
79
|
415
|
|
55
|
-
]),
|
|
80
|
+
]), tt = /* @__PURE__ */ new Set([
|
|
56
81
|
33,
|
|
57
82
|
7,
|
|
58
83
|
163,
|
|
@@ -69,7 +94,7 @@ const Tt = {
|
|
|
69
94
|
160,
|
|
70
95
|
161,
|
|
71
96
|
246
|
|
72
|
-
]),
|
|
97
|
+
]), nt = /* @__PURE__ */ new Set([
|
|
73
98
|
362,
|
|
74
99
|
382,
|
|
75
100
|
381,
|
|
@@ -86,42 +111,42 @@ const Tt = {
|
|
|
86
111
|
385,
|
|
87
112
|
384,
|
|
88
113
|
398
|
|
89
|
-
]),
|
|
90
|
-
const s =
|
|
91
|
-
return s ? "mouth" : n ||
|
|
92
|
-
},
|
|
93
|
-
const e = [], t = [], s = [], n = [],
|
|
94
|
-
let c = 0,
|
|
95
|
-
|
|
96
|
-
`).forEach((
|
|
97
|
-
const
|
|
98
|
-
if (!
|
|
99
|
-
if (
|
|
114
|
+
]), os = /* @__PURE__ */ new Set([814, 815, 816, 817, 818, 819, 830, 831, 832, 833]), as = (a, e, t) => {
|
|
115
|
+
const s = et.has(a) && et.has(e) && et.has(t), n = tt.has(a) && tt.has(e) && tt.has(t), o = nt.has(a) && nt.has(e) && nt.has(t);
|
|
116
|
+
return s ? "mouth" : n || o ? "eye" : "base";
|
|
117
|
+
}, is = (a) => {
|
|
118
|
+
const e = [], t = [], s = [], n = [], o = [], r = [];
|
|
119
|
+
let c = 0, i = 0;
|
|
120
|
+
a.split(`
|
|
121
|
+
`).forEach((h) => {
|
|
122
|
+
const u = h.trim();
|
|
123
|
+
if (!u) return;
|
|
124
|
+
if (u.startsWith("v ")) {
|
|
100
125
|
c += 1;
|
|
101
126
|
return;
|
|
102
127
|
}
|
|
103
|
-
if (
|
|
104
|
-
const [,
|
|
105
|
-
|
|
128
|
+
if (u.startsWith("vt ")) {
|
|
129
|
+
const [, g, p] = u.split(/\s+/);
|
|
130
|
+
o.push([Number(g), Number(p)]);
|
|
106
131
|
return;
|
|
107
132
|
}
|
|
108
|
-
if (!
|
|
109
|
-
const d =
|
|
110
|
-
|
|
111
|
-
const [, ...
|
|
112
|
-
const [
|
|
113
|
-
return
|
|
133
|
+
if (!u.startsWith("f ")) return;
|
|
134
|
+
const d = i;
|
|
135
|
+
i += 1;
|
|
136
|
+
const [, ...m] = u.split(/\s+/), A = m.map((g) => {
|
|
137
|
+
const [p, f] = g.split("/"), v = Number(p) - 1, T = Number(f) - 1;
|
|
138
|
+
return T >= 0 && o[T] && !r[v] && (r[v] = o[T]), v;
|
|
114
139
|
});
|
|
115
|
-
if (!(
|
|
116
|
-
for (let
|
|
117
|
-
const
|
|
118
|
-
|
|
140
|
+
if (!(A.length < 3))
|
|
141
|
+
for (let g = 1; g < A.length - 1; g += 1) {
|
|
142
|
+
const p = A[0], f = A[g], v = A[g + 1], T = as(p, f, v);
|
|
143
|
+
os.has(d) ? n.push(p, f, v) : T === "mouth" ? t.push(p, f, v) : T === "eye" ? s.push(p, f, v) : e.push(p, f, v);
|
|
119
144
|
}
|
|
120
145
|
});
|
|
121
146
|
const l = [];
|
|
122
|
-
for (let
|
|
123
|
-
const [
|
|
124
|
-
l.push(
|
|
147
|
+
for (let h = 0; h < c; h += 1) {
|
|
148
|
+
const [u, d] = r[h] ?? [0, 0];
|
|
149
|
+
l.push(u, d);
|
|
125
150
|
}
|
|
126
151
|
return {
|
|
127
152
|
baseIndices: new Uint16Array(e),
|
|
@@ -131,34 +156,47 @@ const Tt = {
|
|
|
131
156
|
uvs: new Float32Array(l),
|
|
132
157
|
vertexCount: c
|
|
133
158
|
};
|
|
134
|
-
},
|
|
135
|
-
const e =
|
|
159
|
+
}, cs = "canonical_face_model.obj", ls = new TextDecoder("utf-8"), st = /* @__PURE__ */ new Map(), us = (a) => {
|
|
160
|
+
const e = st.get(a);
|
|
136
161
|
if (e) return e;
|
|
137
|
-
const t =
|
|
138
|
-
throw
|
|
162
|
+
const t = Zt(a).then((s) => is(ls.decode(s))).catch((s) => {
|
|
163
|
+
throw st.delete(a), s;
|
|
139
164
|
});
|
|
140
|
-
return
|
|
141
|
-
},
|
|
142
|
-
const { mesh: e, url: t } =
|
|
165
|
+
return st.set(a, t), t;
|
|
166
|
+
}, hs = (a) => {
|
|
167
|
+
const { mesh: e, url: t } = a ?? {}, s = t ?? `${De.sdkAssetsBaseUrl}/${cs}`, [n, o] = gt(e ?? null);
|
|
143
168
|
return $(() => {
|
|
144
169
|
if (e) {
|
|
145
|
-
|
|
170
|
+
o(e);
|
|
146
171
|
return;
|
|
147
172
|
}
|
|
148
|
-
let
|
|
149
|
-
return
|
|
150
|
-
|
|
173
|
+
let r = !1;
|
|
174
|
+
return us(s).then((c) => {
|
|
175
|
+
r || o(c);
|
|
151
176
|
}).catch((c) => {
|
|
152
|
-
|
|
177
|
+
r || console.error(`${De.loggerPrefix} canonical face mesh load failed`, c);
|
|
153
178
|
}), () => {
|
|
154
|
-
|
|
179
|
+
r = !0;
|
|
155
180
|
};
|
|
156
181
|
}, [e, s]), n;
|
|
157
|
-
},
|
|
182
|
+
}, Ct = {
|
|
183
|
+
normal: 0,
|
|
184
|
+
add: 1,
|
|
185
|
+
subtract: 2,
|
|
186
|
+
multiply: 3,
|
|
187
|
+
screen: 4,
|
|
188
|
+
overlay: 5,
|
|
189
|
+
softLight: 6,
|
|
190
|
+
hardLight: 7,
|
|
191
|
+
lighten: 8,
|
|
192
|
+
darken: 9,
|
|
193
|
+
difference: 10,
|
|
194
|
+
exclusion: 11
|
|
195
|
+
}, rt = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO2YpZcAAAAASUVORK5CYII=", ds = {
|
|
158
196
|
front: R.FrontSide,
|
|
159
197
|
back: R.BackSide,
|
|
160
198
|
double: R.DoubleSide
|
|
161
|
-
},
|
|
199
|
+
}, fs = `
|
|
162
200
|
attribute vec2 faceUv;
|
|
163
201
|
varying vec2 vUv;
|
|
164
202
|
varying vec2 vFaceUv;
|
|
@@ -170,13 +208,14 @@ const Tt = {
|
|
|
170
208
|
vNormal = normalize(normalMatrix * normal);
|
|
171
209
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
172
210
|
}
|
|
173
|
-
`,
|
|
211
|
+
`, ms = `
|
|
174
212
|
uniform sampler2D cameraTexture;
|
|
175
213
|
uniform sampler2D canonicalTexture;
|
|
176
214
|
uniform sampler2D alphaMask;
|
|
177
215
|
uniform vec3 textureTint;
|
|
178
216
|
uniform float opacity;
|
|
179
217
|
uniform float blendMode;
|
|
218
|
+
uniform float blendOpacity;
|
|
180
219
|
uniform float useCanonicalTexture;
|
|
181
220
|
uniform float useAlphaMask;
|
|
182
221
|
uniform float alphaOpacity;
|
|
@@ -262,10 +301,11 @@ const Tt = {
|
|
|
262
301
|
float maskSample = texture2D(alphaMask, vUv).r;
|
|
263
302
|
float mask = useAlphaMask > 0.5 ? mix(1.0, maskSample, alphaOpacity) : 1.0;
|
|
264
303
|
float textureAlpha = useCanonicalTexture > 0.5 ? textureSample.a : 1.0;
|
|
265
|
-
vec3
|
|
304
|
+
vec3 blended = applyBlendMode(base, blend, blendMode);
|
|
305
|
+
vec3 color = useCanonicalTexture > 0.5 ? mix(base, blended, blendOpacity) : base;
|
|
266
306
|
gl_FragColor = vec4(srgbToLinear(color), opacity * mask * textureAlpha);
|
|
267
307
|
}
|
|
268
|
-
`,
|
|
308
|
+
`, ps = `
|
|
269
309
|
varying vec2 vUv;
|
|
270
310
|
varying vec3 vNormal;
|
|
271
311
|
|
|
@@ -274,7 +314,7 @@ const Tt = {
|
|
|
274
314
|
vNormal = normalize(normalMatrix * normal);
|
|
275
315
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
276
316
|
}
|
|
277
|
-
`,
|
|
317
|
+
`, gs = `
|
|
278
318
|
uniform vec3 color;
|
|
279
319
|
uniform float opacity;
|
|
280
320
|
varying vec3 vNormal;
|
|
@@ -285,8 +325,8 @@ const Tt = {
|
|
|
285
325
|
|
|
286
326
|
gl_FragColor = vec4(base, opacity);
|
|
287
327
|
}
|
|
288
|
-
`,
|
|
289
|
-
const
|
|
328
|
+
`, As = () => {
|
|
329
|
+
const a = new Uint8Array([
|
|
290
330
|
32,
|
|
291
331
|
32,
|
|
292
332
|
32,
|
|
@@ -303,68 +343,79 @@ const Tt = {
|
|
|
303
343
|
255,
|
|
304
344
|
255,
|
|
305
345
|
255
|
|
306
|
-
]), e = new R.DataTexture(
|
|
346
|
+
]), e = new R.DataTexture(a, 4, 1, R.RGBAFormat);
|
|
307
347
|
return e.minFilter = R.NearestFilter, e.magFilter = R.NearestFilter, e.generateMipmaps = !1, e.needsUpdate = !0, e;
|
|
308
|
-
},
|
|
309
|
-
const
|
|
310
|
-
|
|
311
|
-
const e =
|
|
348
|
+
}, vs = () => {
|
|
349
|
+
const a = document.createElement("canvas");
|
|
350
|
+
a.width = 256, a.height = 256;
|
|
351
|
+
const e = a.getContext("2d");
|
|
312
352
|
if (!e)
|
|
313
|
-
return new R.CanvasTexture(
|
|
353
|
+
return new R.CanvasTexture(a);
|
|
314
354
|
const t = e.createRadialGradient(96, 80, 10, 128, 128, 128);
|
|
315
|
-
t.addColorStop(0, "#ffffff"), t.addColorStop(0.18, "#f7d794"), t.addColorStop(0.45, "#d97706"), t.addColorStop(0.72, "#78350f"), t.addColorStop(1, "#120701"), e.fillStyle = t, e.fillRect(0, 0,
|
|
316
|
-
const s = new R.CanvasTexture(
|
|
355
|
+
t.addColorStop(0, "#ffffff"), t.addColorStop(0.18, "#f7d794"), t.addColorStop(0.45, "#d97706"), t.addColorStop(0.72, "#78350f"), t.addColorStop(1, "#120701"), e.fillStyle = t, e.fillRect(0, 0, a.width, a.height);
|
|
356
|
+
const s = new R.CanvasTexture(a);
|
|
317
357
|
return s.needsUpdate = !0, s;
|
|
318
|
-
},
|
|
319
|
-
faceIndex:
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
358
|
+
}, zr = ({
|
|
359
|
+
faceIndex: a = 0,
|
|
360
|
+
baseColor: e,
|
|
361
|
+
color: t = "#38bdf8",
|
|
362
|
+
opacity: s = 0.45,
|
|
363
|
+
materialType: n = "basic",
|
|
364
|
+
shaderPreset: o = "basicShader",
|
|
324
365
|
textureMap: r = "none",
|
|
325
|
-
alphaMap:
|
|
326
|
-
alphaOpacity:
|
|
327
|
-
side:
|
|
328
|
-
blendMode:
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
366
|
+
alphaMap: c = "none",
|
|
367
|
+
alphaOpacity: i = 0,
|
|
368
|
+
side: l = "front",
|
|
369
|
+
blendMode: h = "normal",
|
|
370
|
+
blendOpacity: u = 1,
|
|
371
|
+
showMouthMask: d = !0,
|
|
372
|
+
showEyeMask: m = !0,
|
|
373
|
+
showNoseMask: A = !0,
|
|
374
|
+
maskTextureSource: g = "none",
|
|
375
|
+
maskColor: p = "#111111",
|
|
376
|
+
maskOpacity: f = 0,
|
|
377
|
+
faceTextureUrl: v = "",
|
|
378
|
+
faceTextureStyle2Url: T = "",
|
|
379
|
+
faceAlphaMaskUrl: b = "",
|
|
380
|
+
compositeShading: E = !1,
|
|
381
|
+
faceWarp3D: L,
|
|
382
|
+
renderOrder: y = 10,
|
|
383
|
+
mesh: N,
|
|
384
|
+
meshUrl: C
|
|
341
385
|
}) => {
|
|
342
|
-
const
|
|
386
|
+
const I = $n(Qn.FACE_TRACKER), O = Qt(), { camera: F } = qt(), _ = hs({ mesh: N, url: C }), w = $e(
|
|
343
387
|
R.TextureLoader,
|
|
344
|
-
|
|
345
|
-
),
|
|
346
|
-
|
|
388
|
+
v || rt
|
|
389
|
+
), he = $e(
|
|
390
|
+
R.TextureLoader,
|
|
391
|
+
T || v || rt
|
|
392
|
+
), G = $e(
|
|
393
|
+
R.TextureLoader,
|
|
394
|
+
b || rt
|
|
395
|
+
), J = W(() => As(), []), Re = W(() => vs(), []), de = P(null), fe = P(null), me = P(null), ae = P(null), pe = P(null), Ee = P(null), we = P(null), Se = P(null), Ue = P(null), Be = P(null), He = P(null), Tt = P(null), cn = P(new R.Vector3()), ln = P({ x: 0, y: 0, z: 0 }), ye = P(!1), ee = ds[l], ie = e ?? t, ce = {
|
|
396
|
+
side: ee,
|
|
347
397
|
transparent: !0,
|
|
348
|
-
opacity:
|
|
398
|
+
opacity: s,
|
|
349
399
|
wireframe: !1
|
|
350
|
-
},
|
|
400
|
+
}, Ge = r === "style2" ? he : w, ge = r !== "none", _e = W(
|
|
351
401
|
() => ({
|
|
352
|
-
color: { value: new R.Color(
|
|
353
|
-
opacity: { value:
|
|
402
|
+
color: { value: new R.Color(ie) },
|
|
403
|
+
opacity: { value: s }
|
|
354
404
|
}),
|
|
355
405
|
[]
|
|
356
|
-
),
|
|
406
|
+
), D = W(
|
|
357
407
|
() => ({
|
|
358
408
|
cameraTexture: { value: null },
|
|
359
409
|
canonicalTexture: { value: null },
|
|
360
410
|
alphaMask: { value: null },
|
|
361
|
-
textureTint: { value: new R.Color(
|
|
362
|
-
opacity: { value:
|
|
363
|
-
blendMode: { value:
|
|
411
|
+
textureTint: { value: new R.Color(ie) },
|
|
412
|
+
opacity: { value: s },
|
|
413
|
+
blendMode: { value: Ct[h] },
|
|
414
|
+
blendOpacity: { value: u },
|
|
364
415
|
useCanonicalTexture: { value: ge ? 1 : 0 },
|
|
365
|
-
useAlphaMask: { value:
|
|
366
|
-
alphaOpacity: { value:
|
|
367
|
-
compositeShading: { value:
|
|
416
|
+
useAlphaMask: { value: c === "canonical" ? 1 : 0 },
|
|
417
|
+
alphaOpacity: { value: i },
|
|
418
|
+
compositeShading: { value: E ? 1 : 0 },
|
|
368
419
|
lightDirection: { value: new R.Vector3(0.3, 0.65, 0.7).normalize() },
|
|
369
420
|
ambientStrength: { value: 0.78 },
|
|
370
421
|
directionalStrength: { value: 0.38 }
|
|
@@ -372,60 +423,61 @@ const Tt = {
|
|
|
372
423
|
[]
|
|
373
424
|
);
|
|
374
425
|
$(() => {
|
|
375
|
-
|
|
376
|
-
}, [
|
|
377
|
-
|
|
426
|
+
_e.color.value.set(ie), _e.opacity.value = s;
|
|
427
|
+
}, [ie, s, _e]), $(() => {
|
|
428
|
+
D.cameraTexture.value = O ?? w, D.canonicalTexture.value = Ge, D.alphaMask.value = G, D.textureTint.value.set(ie), D.opacity.value = s, D.blendMode.value = Ct[h], D.blendOpacity.value = u, D.useCanonicalTexture.value = ge ? 1 : 0, D.useAlphaMask.value = c === "canonical" ? 1 : 0, D.alphaOpacity.value = i, D.compositeShading.value = E ? 1 : 0;
|
|
378
429
|
}, [
|
|
379
|
-
o,
|
|
380
|
-
I,
|
|
381
430
|
c,
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
431
|
+
G,
|
|
432
|
+
i,
|
|
433
|
+
h,
|
|
434
|
+
u,
|
|
435
|
+
O,
|
|
436
|
+
E,
|
|
437
|
+
D,
|
|
438
|
+
w,
|
|
388
439
|
ge,
|
|
389
|
-
|
|
390
|
-
|
|
440
|
+
ie,
|
|
441
|
+
s,
|
|
442
|
+
Ge,
|
|
391
443
|
r
|
|
392
444
|
]);
|
|
393
|
-
const
|
|
394
|
-
if (
|
|
395
|
-
return
|
|
445
|
+
const Le = (k) => {
|
|
446
|
+
if (k)
|
|
447
|
+
return g === "canonical" ? /* @__PURE__ */ x(
|
|
396
448
|
"meshBasicMaterial",
|
|
397
449
|
{
|
|
398
|
-
color:
|
|
399
|
-
alphaMap:
|
|
450
|
+
color: p,
|
|
451
|
+
alphaMap: G,
|
|
400
452
|
transparent: !0,
|
|
401
|
-
opacity:
|
|
402
|
-
side:
|
|
453
|
+
opacity: f,
|
|
454
|
+
side: ee,
|
|
403
455
|
depthWrite: !1,
|
|
404
456
|
depthTest: !1,
|
|
405
457
|
toneMapped: !1
|
|
406
458
|
},
|
|
407
459
|
"masked-canonical-material"
|
|
408
|
-
) : /* @__PURE__ */
|
|
460
|
+
) : /* @__PURE__ */ x(
|
|
409
461
|
"meshBasicMaterial",
|
|
410
462
|
{
|
|
411
|
-
color:
|
|
463
|
+
color: p,
|
|
412
464
|
transparent: !0,
|
|
413
|
-
opacity:
|
|
414
|
-
side:
|
|
465
|
+
opacity: f,
|
|
466
|
+
side: ee,
|
|
415
467
|
depthWrite: !1,
|
|
416
468
|
depthTest: !1,
|
|
417
469
|
toneMapped: !1
|
|
418
470
|
},
|
|
419
471
|
"masked-solid-material"
|
|
420
472
|
);
|
|
421
|
-
if (
|
|
422
|
-
return /* @__PURE__ */
|
|
473
|
+
if (n === "wireframe")
|
|
474
|
+
return /* @__PURE__ */ x(
|
|
423
475
|
"meshBasicMaterial",
|
|
424
476
|
{
|
|
425
|
-
color:
|
|
477
|
+
color: t,
|
|
426
478
|
transparent: !0,
|
|
427
|
-
opacity:
|
|
428
|
-
side:
|
|
479
|
+
opacity: s,
|
|
480
|
+
side: ee,
|
|
429
481
|
depthWrite: !1,
|
|
430
482
|
depthTest: !1,
|
|
431
483
|
wireframe: !0,
|
|
@@ -433,57 +485,57 @@ const Tt = {
|
|
|
433
485
|
},
|
|
434
486
|
"wireframe-material"
|
|
435
487
|
);
|
|
436
|
-
if (
|
|
437
|
-
return /* @__PURE__ */
|
|
488
|
+
if (n === "shader" && O && (o === "originalFace" || o === "composite" && r === "none"))
|
|
489
|
+
return /* @__PURE__ */ x(
|
|
438
490
|
"meshBasicMaterial",
|
|
439
491
|
{
|
|
440
|
-
map:
|
|
441
|
-
alphaMap:
|
|
492
|
+
map: O,
|
|
493
|
+
alphaMap: G,
|
|
442
494
|
transparent: !0,
|
|
443
|
-
opacity:
|
|
444
|
-
side:
|
|
495
|
+
opacity: s,
|
|
496
|
+
side: ee,
|
|
445
497
|
depthWrite: !1,
|
|
446
498
|
depthTest: !0,
|
|
447
499
|
toneMapped: !1
|
|
448
500
|
},
|
|
449
501
|
"use-original-face-material"
|
|
450
502
|
);
|
|
451
|
-
if (
|
|
452
|
-
return /* @__PURE__ */
|
|
503
|
+
if (n === "shader" && o === "composite" && ge && O)
|
|
504
|
+
return /* @__PURE__ */ x(
|
|
453
505
|
"shaderMaterial",
|
|
454
506
|
{
|
|
455
|
-
uniforms:
|
|
456
|
-
vertexShader:
|
|
457
|
-
fragmentShader:
|
|
507
|
+
uniforms: D,
|
|
508
|
+
vertexShader: fs,
|
|
509
|
+
fragmentShader: ms,
|
|
458
510
|
transparent: !0,
|
|
459
|
-
side:
|
|
511
|
+
side: ee,
|
|
460
512
|
depthWrite: !1,
|
|
461
513
|
depthTest: !0,
|
|
462
514
|
toneMapped: !1
|
|
463
515
|
},
|
|
464
516
|
"composite-material"
|
|
465
517
|
);
|
|
466
|
-
const
|
|
467
|
-
return
|
|
518
|
+
const X = ge ? Ge : null, j = c === "canonical" && i > 0 ? G : null, K = `${n}-${r}-${c}-${i > 0 ? "alpha-on" : "alpha-off"}`;
|
|
519
|
+
return n === "standard" ? /* @__PURE__ */ x(
|
|
468
520
|
"meshStandardMaterial",
|
|
469
521
|
{
|
|
470
522
|
...ce,
|
|
471
|
-
color:
|
|
472
|
-
map:
|
|
473
|
-
alphaMap:
|
|
523
|
+
color: t,
|
|
524
|
+
map: X ?? void 0,
|
|
525
|
+
alphaMap: j ?? void 0,
|
|
474
526
|
depthWrite: !0,
|
|
475
527
|
depthTest: !0,
|
|
476
528
|
metalness: 0.05,
|
|
477
529
|
roughness: 0.72
|
|
478
530
|
},
|
|
479
|
-
|
|
480
|
-
) :
|
|
531
|
+
K
|
|
532
|
+
) : n === "physical" ? /* @__PURE__ */ x(
|
|
481
533
|
"meshPhysicalMaterial",
|
|
482
534
|
{
|
|
483
535
|
...ce,
|
|
484
|
-
color:
|
|
485
|
-
map:
|
|
486
|
-
alphaMap:
|
|
536
|
+
color: t,
|
|
537
|
+
map: X ?? void 0,
|
|
538
|
+
alphaMap: j ?? void 0,
|
|
487
539
|
depthWrite: !0,
|
|
488
540
|
depthTest: !0,
|
|
489
541
|
roughness: 0.58,
|
|
@@ -491,20 +543,20 @@ const Tt = {
|
|
|
491
543
|
clearcoat: 0.35,
|
|
492
544
|
clearcoatRoughness: 0.4
|
|
493
545
|
},
|
|
494
|
-
|
|
495
|
-
) :
|
|
546
|
+
K
|
|
547
|
+
) : n === "toon" ? /* @__PURE__ */ x(
|
|
496
548
|
"meshToonMaterial",
|
|
497
549
|
{
|
|
498
550
|
...ce,
|
|
499
|
-
color:
|
|
500
|
-
map:
|
|
501
|
-
alphaMap:
|
|
502
|
-
gradientMap:
|
|
551
|
+
color: t,
|
|
552
|
+
map: X ?? void 0,
|
|
553
|
+
alphaMap: j ?? void 0,
|
|
554
|
+
gradientMap: J,
|
|
503
555
|
depthWrite: !0,
|
|
504
556
|
depthTest: !0
|
|
505
557
|
},
|
|
506
|
-
|
|
507
|
-
) :
|
|
558
|
+
K
|
|
559
|
+
) : n === "normal" ? /* @__PURE__ */ x(
|
|
508
560
|
"meshNormalMaterial",
|
|
509
561
|
{
|
|
510
562
|
...ce,
|
|
@@ -513,84 +565,84 @@ const Tt = {
|
|
|
513
565
|
flatShading: !1
|
|
514
566
|
},
|
|
515
567
|
"normal-material"
|
|
516
|
-
) :
|
|
568
|
+
) : n === "matcap" ? /* @__PURE__ */ x(
|
|
517
569
|
"meshMatcapMaterial",
|
|
518
570
|
{
|
|
519
571
|
...ce,
|
|
520
|
-
color:
|
|
521
|
-
matcap:
|
|
572
|
+
color: t,
|
|
573
|
+
matcap: Re,
|
|
522
574
|
depthWrite: !0,
|
|
523
575
|
depthTest: !0
|
|
524
576
|
},
|
|
525
577
|
"matcap-material"
|
|
526
|
-
) :
|
|
578
|
+
) : n === "shader" ? /* @__PURE__ */ x(
|
|
527
579
|
"shaderMaterial",
|
|
528
580
|
{
|
|
529
|
-
uniforms:
|
|
530
|
-
vertexShader:
|
|
531
|
-
fragmentShader:
|
|
581
|
+
uniforms: _e,
|
|
582
|
+
vertexShader: ps,
|
|
583
|
+
fragmentShader: gs,
|
|
532
584
|
transparent: !0,
|
|
533
|
-
side:
|
|
585
|
+
side: ee,
|
|
534
586
|
depthWrite: !1,
|
|
535
587
|
depthTest: !0,
|
|
536
588
|
toneMapped: !1
|
|
537
589
|
},
|
|
538
590
|
"generic-shader-material"
|
|
539
|
-
) : /* @__PURE__ */
|
|
591
|
+
) : /* @__PURE__ */ x(
|
|
540
592
|
"meshBasicMaterial",
|
|
541
593
|
{
|
|
542
594
|
...ce,
|
|
543
|
-
color:
|
|
544
|
-
map:
|
|
545
|
-
alphaMap:
|
|
595
|
+
color: t,
|
|
596
|
+
map: X ?? void 0,
|
|
597
|
+
alphaMap: j ?? void 0,
|
|
546
598
|
depthWrite: !1,
|
|
547
|
-
depthTest: r !== "none" ||
|
|
599
|
+
depthTest: r !== "none" || c !== "none",
|
|
548
600
|
toneMapped: !1
|
|
549
601
|
},
|
|
550
|
-
|
|
602
|
+
K
|
|
551
603
|
);
|
|
552
|
-
},
|
|
553
|
-
return
|
|
554
|
-
var
|
|
555
|
-
const
|
|
556
|
-
if (!
|
|
604
|
+
}, un = (k) => Jn(k, F, cn.current);
|
|
605
|
+
return Zn(() => {
|
|
606
|
+
var Rt, Et;
|
|
607
|
+
const k = de.current, X = fe.current, j = me.current, K = ae.current, Xe = pe.current, je = Ee.current, Ke = we.current, Ye = Se.current, Ae = (Et = (Rt = I == null ? void 0 : I.detectionResults) == null ? void 0 : Rt.faceLandmarks) == null ? void 0 : Et[a];
|
|
608
|
+
if (!_ || !k || !X || !j || !K || !Xe || !je || !Ke || !Ye)
|
|
557
609
|
return;
|
|
558
|
-
if (!
|
|
559
|
-
|
|
610
|
+
if (!Ae || Ae.length < _.vertexCount) {
|
|
611
|
+
Xe.visible = !1, je.visible = !1, Ke.visible = !1, Ye.visible = !1;
|
|
560
612
|
return;
|
|
561
613
|
}
|
|
562
|
-
if (
|
|
563
|
-
|
|
564
|
-
const
|
|
565
|
-
|
|
614
|
+
if (Tt.current !== _) {
|
|
615
|
+
Ue.current = new Float32Array(_.vertexCount * 3), Be.current = new Float32Array(_.uvs), He.current = new Float32Array(_.vertexCount * 2);
|
|
616
|
+
const Y = new R.BufferAttribute(Ue.current, 3), B = new R.BufferAttribute(Be.current, 2), le = new R.BufferAttribute(He.current, 2);
|
|
617
|
+
k.setAttribute("position", Y), k.setAttribute("uv", B), k.setAttribute("faceUv", le), k.setIndex(new R.BufferAttribute(_.baseIndices, 1)), X.setAttribute("position", Y), X.setAttribute("uv", B), X.setAttribute("faceUv", le), X.setIndex(new R.BufferAttribute(_.mouthIndices, 1)), j.setAttribute("position", Y), j.setAttribute("uv", B), j.setAttribute("faceUv", le), j.setIndex(new R.BufferAttribute(_.eyeIndices, 1)), K.setAttribute("position", Y), K.setAttribute("uv", B), K.setAttribute("faceUv", le), K.setIndex(new R.BufferAttribute(_.noseIndices, 1)), B.needsUpdate = !0, Tt.current = _, ye.current = !1;
|
|
566
618
|
}
|
|
567
|
-
const
|
|
568
|
-
if (!
|
|
569
|
-
const
|
|
570
|
-
for (let
|
|
571
|
-
const
|
|
572
|
-
|
|
619
|
+
const Ce = Ue.current, We = He.current, Ie = Be.current;
|
|
620
|
+
if (!Ce || !We || !Ie) return;
|
|
621
|
+
const xt = n === "shader" && (o === "originalFace" || o === "composite" && r === "none"), bt = ss(L), Mt = bt ? ns(Ae) : null, hn = Math.min(Ae.length, _.vertexCount);
|
|
622
|
+
for (let Y = 0; Y < hn; Y++) {
|
|
623
|
+
const B = Ae[Y], le = bt && Mt ? rs(B, Mt, L, ln.current) : B, Ve = Y * 3, Pe = Y * 2, ze = un(le);
|
|
624
|
+
Ce[Ve] = ze.x, Ce[Ve + 1] = ze.y, Ce[Ve + 2] = ze.z, We[Pe] = B.x, We[Pe + 1] = 1 - B.y, xt && (Ie[Pe] = B.x, Ie[Pe + 1] = 1 - B.y);
|
|
573
625
|
}
|
|
574
|
-
|
|
575
|
-
}), /* @__PURE__ */
|
|
576
|
-
/* @__PURE__ */
|
|
577
|
-
/* @__PURE__ */
|
|
578
|
-
|
|
626
|
+
xt ? (k.attributes.uv.needsUpdate = !0, ye.current = !0) : ye.current && (Ie.set(_.uvs), k.attributes.uv.needsUpdate = !0, ye.current = !1), Xe.visible = !0, je.visible = !0, Ke.visible = !0, Ye.visible = !0, k.attributes.position.needsUpdate = !0, k.attributes.faceUv.needsUpdate = !0, k.computeVertexNormals(), X.computeVertexNormals(), j.computeVertexNormals(), K.computeVertexNormals();
|
|
627
|
+
}), /* @__PURE__ */ S(ft, { children: [
|
|
628
|
+
/* @__PURE__ */ S("mesh", { ref: pe, renderOrder: y, frustumCulled: !1, children: [
|
|
629
|
+
/* @__PURE__ */ x("bufferGeometry", { ref: de }),
|
|
630
|
+
Le(!1)
|
|
579
631
|
] }),
|
|
580
|
-
/* @__PURE__ */
|
|
581
|
-
/* @__PURE__ */
|
|
582
|
-
|
|
632
|
+
/* @__PURE__ */ S("mesh", { ref: Ee, renderOrder: y + 2, frustumCulled: !1, children: [
|
|
633
|
+
/* @__PURE__ */ x("bufferGeometry", { ref: fe }),
|
|
634
|
+
Le(d)
|
|
583
635
|
] }),
|
|
584
|
-
/* @__PURE__ */
|
|
585
|
-
/* @__PURE__ */
|
|
586
|
-
|
|
636
|
+
/* @__PURE__ */ S("mesh", { ref: we, renderOrder: y + 2, frustumCulled: !1, children: [
|
|
637
|
+
/* @__PURE__ */ x("bufferGeometry", { ref: me }),
|
|
638
|
+
Le(m)
|
|
587
639
|
] }),
|
|
588
|
-
/* @__PURE__ */
|
|
589
|
-
/* @__PURE__ */
|
|
590
|
-
|
|
640
|
+
/* @__PURE__ */ S("mesh", { ref: Se, renderOrder: y + 2, frustumCulled: !1, children: [
|
|
641
|
+
/* @__PURE__ */ x("bufferGeometry", { ref: ae }),
|
|
642
|
+
Le(A)
|
|
591
643
|
] })
|
|
592
644
|
] });
|
|
593
|
-
},
|
|
645
|
+
}, qr = {
|
|
594
646
|
materialType: "basic",
|
|
595
647
|
shaderPreset: "basicShader",
|
|
596
648
|
textureMap: "none",
|
|
@@ -598,13 +650,15 @@ const Tt = {
|
|
|
598
650
|
alphaOpacity: 1,
|
|
599
651
|
side: "front",
|
|
600
652
|
blendMode: "normal",
|
|
653
|
+
blendOpacity: 1,
|
|
601
654
|
baseColor: "#38bdf8",
|
|
602
|
-
opacity: 0.45
|
|
603
|
-
|
|
655
|
+
opacity: 0.45,
|
|
656
|
+
compositeShading: !1
|
|
657
|
+
}, Zr = {
|
|
604
658
|
mouth: !0,
|
|
605
659
|
eyes: !0,
|
|
606
660
|
nose: !0
|
|
607
|
-
},
|
|
661
|
+
}, Qr = [
|
|
608
662
|
{ label: "Wireframe", value: "wireframe" },
|
|
609
663
|
{ label: "Basic", value: "basic" },
|
|
610
664
|
{ label: "Standard", value: "standard" },
|
|
@@ -613,22 +667,22 @@ const Tt = {
|
|
|
613
667
|
{ label: "Normal", value: "normal" },
|
|
614
668
|
{ label: "Matcap", value: "matcap" },
|
|
615
669
|
{ label: "Shader", value: "shader" }
|
|
616
|
-
],
|
|
670
|
+
], $r = [
|
|
617
671
|
{ label: "Basic Shader", value: "basicShader" },
|
|
618
672
|
{ label: "Original Face", value: "originalFace" },
|
|
619
673
|
{ label: "Composite", value: "composite" }
|
|
620
|
-
],
|
|
674
|
+
], Jr = [
|
|
621
675
|
{ label: "Front", value: "front" },
|
|
622
676
|
{ label: "Back", value: "back" },
|
|
623
677
|
{ label: "Double", value: "double" }
|
|
624
|
-
],
|
|
678
|
+
], eo = [
|
|
625
679
|
{ label: "None", value: "none" },
|
|
626
680
|
{ label: "UV Map 1", value: "canonical" },
|
|
627
681
|
{ label: "UV Map 2", value: "style2" }
|
|
628
|
-
],
|
|
682
|
+
], to = [
|
|
629
683
|
{ label: "None", value: "none" },
|
|
630
684
|
{ label: "Default Mask", value: "canonical" }
|
|
631
|
-
],
|
|
685
|
+
], no = [
|
|
632
686
|
{ label: "Normal", value: "normal" },
|
|
633
687
|
{ label: "Add", value: "add" },
|
|
634
688
|
{ label: "Subtract", value: "subtract" },
|
|
@@ -641,20 +695,24 @@ const Tt = {
|
|
|
641
695
|
{ label: "Darken", value: "darken" },
|
|
642
696
|
{ label: "Difference", value: "difference" },
|
|
643
697
|
{ label: "Exclusion", value: "exclusion" }
|
|
644
|
-
],
|
|
698
|
+
], so = (a, e) => a === "basic" || a === "standard" || a === "physical" || a === "toon" || a === "shader" && e === "composite", ro = (a, e) => a === "shader" && e === "composite", Ts = `
|
|
645
699
|
varying vec2 vUv;
|
|
646
700
|
|
|
647
701
|
void main() {
|
|
648
702
|
vUv = uv;
|
|
649
703
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
650
704
|
}
|
|
651
|
-
`,
|
|
705
|
+
`, xs = `
|
|
652
706
|
uniform sampler2D cameraTexture;
|
|
653
707
|
uniform sampler2D retouchMaskTexture;
|
|
654
708
|
uniform sampler2D mouthMaskTexture;
|
|
655
709
|
uniform vec2 texelSize;
|
|
656
710
|
uniform float retouchAmount;
|
|
657
711
|
uniform float blurRadius;
|
|
712
|
+
uniform float detailPreservation;
|
|
713
|
+
uniform float blemishReduction;
|
|
714
|
+
uniform float rednessReduction;
|
|
715
|
+
uniform float blemishRadius;
|
|
658
716
|
uniform float teethWhitening;
|
|
659
717
|
uniform float previewMask;
|
|
660
718
|
uniform float protectLandmarks;
|
|
@@ -714,23 +772,105 @@ const Tt = {
|
|
|
714
772
|
return color / max(weightSum, 0.001);
|
|
715
773
|
}
|
|
716
774
|
|
|
717
|
-
|
|
775
|
+
float retouchLuminance(vec3 color) {
|
|
776
|
+
return dot(color, vec3(0.299, 0.587, 0.114));
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
void addMouthSample(inout vec3 color, inout float weightSum, vec2 uv, float weight) {
|
|
780
|
+
float mouth = readMouthMask(uv);
|
|
781
|
+
color += sampleCamera(uv) * mouth * weight;
|
|
782
|
+
weightSum += mouth * weight;
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
vec3 mouthAverage(vec2 uv) {
|
|
786
|
+
vec2 r = texelSize * 7.0;
|
|
787
|
+
vec3 color = vec3(0.0);
|
|
788
|
+
float weightSum = 0.0;
|
|
789
|
+
|
|
790
|
+
addMouthSample(color, weightSum, uv, 0.22);
|
|
791
|
+
addMouthSample(color, weightSum, uv + vec2(r.x, 0.0), 0.12);
|
|
792
|
+
addMouthSample(color, weightSum, uv - vec2(r.x, 0.0), 0.12);
|
|
793
|
+
addMouthSample(color, weightSum, uv + vec2(0.0, r.y), 0.12);
|
|
794
|
+
addMouthSample(color, weightSum, uv - vec2(0.0, r.y), 0.12);
|
|
795
|
+
addMouthSample(color, weightSum, uv + r, 0.08);
|
|
796
|
+
addMouthSample(color, weightSum, uv - r, 0.08);
|
|
797
|
+
addMouthSample(color, weightSum, uv + vec2(r.x, -r.y), 0.08);
|
|
798
|
+
addMouthSample(color, weightSum, uv + vec2(-r.x, r.y), 0.08);
|
|
799
|
+
|
|
800
|
+
return weightSum > 0.01 ? color / weightSum : sampleCamera(uv);
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
float teethCandidateMask(vec3 color, vec3 localMouth, float mouthRegion) {
|
|
804
|
+
float lum = retouchLuminance(color);
|
|
805
|
+
float localLum = retouchLuminance(localMouth);
|
|
718
806
|
float maxChannel = max(max(color.r, color.g), color.b);
|
|
719
807
|
float minChannel = min(min(color.r, color.g), color.b);
|
|
720
808
|
float saturation = maxChannel - minChannel;
|
|
721
|
-
float brightness = dot(color, vec3(0.299, 0.587, 0.114));
|
|
722
809
|
float redness = max(color.r - max(color.g, color.b), 0.0);
|
|
723
|
-
float
|
|
810
|
+
float yellowness = max(min(color.r, color.g) - color.b, 0.0);
|
|
811
|
+
float pinkness = max(color.r - color.g * 0.92, 0.0) * max(color.r - color.b * 0.92, 0.0);
|
|
812
|
+
float relativeBrightness = lum - localLum;
|
|
813
|
+
float brightEnough = smoothstep(0.015, 0.18, relativeBrightness) * smoothstep(0.28, 0.58, lum);
|
|
814
|
+
float neutralEnough = 1.0 - smoothstep(0.16, 0.42, saturation);
|
|
815
|
+
float notRed = 1.0 - smoothstep(0.08, 0.28, redness + pinkness);
|
|
816
|
+
float notDark = smoothstep(0.18, 0.38, lum);
|
|
817
|
+
float plausibleWarmth = 1.0 - smoothstep(0.24, 0.5, yellowness);
|
|
818
|
+
|
|
819
|
+
return clamp(mouthRegion * brightEnough * max(neutralEnough, 0.35) * notRed * notDark * plausibleWarmth, 0.0, 1.0);
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
float softTeethMask(vec2 uv, vec3 color, vec3 localMouth, float mouthRegion) {
|
|
823
|
+
vec2 r = texelSize * 2.0;
|
|
824
|
+
float mask = teethCandidateMask(color, localMouth, mouthRegion) * 0.42;
|
|
825
|
+
mask += teethCandidateMask(sampleCamera(uv + vec2(r.x, 0.0)), localMouth, readMouthMask(uv + vec2(r.x, 0.0))) * 0.14;
|
|
826
|
+
mask += teethCandidateMask(sampleCamera(uv - vec2(r.x, 0.0)), localMouth, readMouthMask(uv - vec2(r.x, 0.0))) * 0.14;
|
|
827
|
+
mask += teethCandidateMask(sampleCamera(uv + vec2(0.0, r.y)), localMouth, readMouthMask(uv + vec2(0.0, r.y))) * 0.14;
|
|
828
|
+
mask += teethCandidateMask(sampleCamera(uv - vec2(0.0, r.y)), localMouth, readMouthMask(uv - vec2(0.0, r.y))) * 0.14;
|
|
829
|
+
|
|
830
|
+
return smoothstep(0.18, 0.62, mask);
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
vec3 whitenTeeth(vec2 uv, vec3 color, float amount, float mouthRegion) {
|
|
834
|
+
if (amount <= 0.001 || mouthRegion <= 0.001) return color;
|
|
835
|
+
|
|
836
|
+
vec3 localMouth = mouthAverage(uv);
|
|
837
|
+
float mask = softTeethMask(uv, color, localMouth, mouthRegion);
|
|
838
|
+
float lum = retouchLuminance(color);
|
|
839
|
+
float localLum = retouchLuminance(localMouth);
|
|
840
|
+
vec3 neutral = vec3(lum);
|
|
841
|
+
vec3 chromaCorrected = mix(color, neutral, 0.46);
|
|
842
|
+
chromaCorrected.r = min(chromaCorrected.r, color.r * 0.96 + lum * 0.04);
|
|
843
|
+
chromaCorrected.g = min(chromaCorrected.g * 1.02, 1.0);
|
|
844
|
+
chromaCorrected.b = min(max(chromaCorrected.b, color.b * 1.08), 1.0);
|
|
845
|
+
float lift = clamp((0.62 - lum) * 0.18 + max(lum - localLum, 0.0) * 0.08, 0.0, 0.12);
|
|
846
|
+
vec3 brightened = min(chromaCorrected + vec3(lift), vec3(1.0));
|
|
847
|
+
|
|
848
|
+
return mix(color, brightened, clamp(amount * mask, 0.0, 0.72));
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
vec3 reduceBlemishes(vec2 uv, vec3 original, vec3 localAverage, vec3 skinBase, float skinMask) {
|
|
852
|
+
float originalLum = retouchLuminance(original);
|
|
853
|
+
float localLum = retouchLuminance(localAverage);
|
|
854
|
+
float redness = max(original.r - max(original.g, original.b), 0.0);
|
|
855
|
+
float localRedness = max(localAverage.r - max(localAverage.g, localAverage.b), 0.0);
|
|
856
|
+
float excessRedness = max(redness - localRedness * 0.82, 0.0);
|
|
857
|
+
float darkSpot = max(localLum - originalLum, 0.0);
|
|
858
|
+
float contrast = length(original - localAverage);
|
|
724
859
|
float candidate =
|
|
725
|
-
smoothstep(0.
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
float whiteningMask = clamp(mouthRegion * candidate, 0.0, 1.0);
|
|
730
|
-
vec3 desaturated = mix(color, vec3(brightness), 0.42);
|
|
731
|
-
vec3 brightened = min(desaturated + vec3(0.16), vec3(1.0));
|
|
860
|
+
smoothstep(0.025, 0.13, excessRedness * rednessReduction) +
|
|
861
|
+
smoothstep(0.035, 0.18, darkSpot) +
|
|
862
|
+
smoothstep(0.045, 0.22, contrast);
|
|
863
|
+
float blemishMask = clamp(candidate * 0.45, 0.0, 1.0) * skinMask * blemishReduction;
|
|
732
864
|
|
|
733
|
-
|
|
865
|
+
vec3 chromaReduced = vec3(
|
|
866
|
+
mix(original.r, min(original.r, localAverage.r * 1.04), rednessReduction * blemishMask),
|
|
867
|
+
mix(original.g, max(original.g, localAverage.g * 0.98), 0.25 * blemishMask),
|
|
868
|
+
mix(original.b, max(original.b, localAverage.b * 0.98), 0.25 * blemishMask)
|
|
869
|
+
);
|
|
870
|
+
vec3 texture = original - localAverage;
|
|
871
|
+
vec3 repaired = clamp(skinBase + texture * detailPreservation * 0.35, 0.0, 1.0);
|
|
872
|
+
|
|
873
|
+
return mix(chromaReduced, repaired, blemishMask);
|
|
734
874
|
}
|
|
735
875
|
|
|
736
876
|
void main() {
|
|
@@ -742,7 +882,7 @@ const Tt = {
|
|
|
742
882
|
float sharpPreview = 1.0 - step(0.001, retouchAmount + blurRadius);
|
|
743
883
|
float retouchPreview = mix(masks.x, masks.z, sharpPreview);
|
|
744
884
|
float protectedPreview = mix(masks.y, step(0.08, masks.y), sharpPreview);
|
|
745
|
-
float whiteningPreview = mouthMask * teethWhitening;
|
|
885
|
+
float whiteningPreview = softTeethMask(vUv, original, mouthAverage(vUv), mouthMask) * teethWhitening;
|
|
746
886
|
vec3 facePreview = vec3(retouchPreview, 0.08, 0.08);
|
|
747
887
|
vec3 featurePreview = vec3(0.05, protectedPreview, 0.1);
|
|
748
888
|
vec3 whiteningMaskPreview = vec3(whiteningPreview, whiteningPreview, 0.05);
|
|
@@ -757,70 +897,85 @@ const Tt = {
|
|
|
757
897
|
vec3 smallBlur = maskedBlurCamera(vUv, max(0.0, effectiveBlurRadius * 0.45));
|
|
758
898
|
vec3 largeBlur = maskedBlurCamera(vUv, max(0.0, effectiveBlurRadius));
|
|
759
899
|
vec3 detail = original - smallBlur;
|
|
760
|
-
float detailAmount = mix(
|
|
900
|
+
float detailAmount = mix(detailPreservation, 0.9, masks.y);
|
|
761
901
|
vec3 smoothed = clamp(largeBlur + detail * detailAmount, 0.0, 1.0);
|
|
762
902
|
vec3 color = mix(original, smoothed, min(retouchAmount, 0.72) * masks.x);
|
|
763
|
-
|
|
903
|
+
vec3 blemishAverage = maskedBlurCamera(vUv, max(1.0, blemishRadius));
|
|
904
|
+
color = reduceBlemishes(vUv, color, blemishAverage, smoothed, masks.x);
|
|
905
|
+
color = whitenTeeth(vUv, color, teethWhitening, mouthMask);
|
|
764
906
|
gl_FragColor = vec4(color, 1.0);
|
|
765
907
|
#include <colorspace_fragment>
|
|
766
908
|
}
|
|
767
|
-
`,
|
|
768
|
-
retouchMask:
|
|
909
|
+
`, oo = ({
|
|
910
|
+
retouchMask: a,
|
|
769
911
|
mouthMask: e,
|
|
770
912
|
retouchAmount: t,
|
|
771
913
|
blurRadius: s,
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
914
|
+
detailPreservation: n = 0.62,
|
|
915
|
+
blemishReduction: o = 0.35,
|
|
916
|
+
rednessReduction: r = 0.45,
|
|
917
|
+
blemishRadius: c = 3,
|
|
918
|
+
teethWhitening: i,
|
|
919
|
+
previewMask: l,
|
|
920
|
+
protectLandmarks: h,
|
|
921
|
+
renderOrder: u = -1e3
|
|
775
922
|
}) => {
|
|
776
|
-
const { camera:
|
|
923
|
+
const { camera: d, size: m } = qt(), A = Qt(), g = W(
|
|
777
924
|
() => ({
|
|
778
925
|
cameraTexture: { value: null },
|
|
779
|
-
retouchMaskTexture: { value:
|
|
926
|
+
retouchMaskTexture: { value: a },
|
|
780
927
|
mouthMaskTexture: { value: e },
|
|
781
928
|
texelSize: { value: new R.Vector2(1 / 1280, 1 / 720) },
|
|
782
929
|
retouchAmount: { value: t },
|
|
783
930
|
blurRadius: { value: s },
|
|
784
|
-
|
|
931
|
+
detailPreservation: { value: n },
|
|
932
|
+
blemishReduction: { value: o },
|
|
933
|
+
rednessReduction: { value: r },
|
|
934
|
+
blemishRadius: { value: c },
|
|
935
|
+
teethWhitening: { value: i },
|
|
785
936
|
previewMask: { value: 0 },
|
|
786
937
|
protectLandmarks: { value: 1 }
|
|
787
938
|
}),
|
|
788
|
-
[e,
|
|
789
|
-
),
|
|
790
|
-
if (!
|
|
939
|
+
[e, a]
|
|
940
|
+
), p = W(() => {
|
|
941
|
+
if (!d.isPerspectiveCamera)
|
|
791
942
|
return [10, 10];
|
|
792
|
-
const
|
|
793
|
-
return [
|
|
794
|
-
}, [
|
|
943
|
+
const f = d, b = (f.position.z || 5) - -1, E = R.MathUtils.degToRad(f.fov), L = 2 * Math.tan(E / 2) * b;
|
|
944
|
+
return [L * (m.width / m.height), L];
|
|
945
|
+
}, [d, m]);
|
|
795
946
|
return $(() => {
|
|
796
|
-
|
|
947
|
+
g.cameraTexture.value = A ?? null, g.retouchMaskTexture.value = a, g.mouthMaskTexture.value = e, g.texelSize.value.set(1 / Math.max(m.width, 1), 1 / Math.max(m.height, 1)), g.retouchAmount.value = t, g.blurRadius.value = s, g.detailPreservation.value = n, g.blemishReduction.value = o, g.rednessReduction.value = r, g.blemishRadius.value = c, g.teethWhitening.value = i, g.previewMask.value = l ? 1 : 0, g.protectLandmarks.value = h ? 1 : 0;
|
|
797
948
|
}, [
|
|
798
949
|
s,
|
|
799
|
-
|
|
800
|
-
r,
|
|
950
|
+
c,
|
|
801
951
|
o,
|
|
952
|
+
A,
|
|
953
|
+
n,
|
|
954
|
+
l,
|
|
955
|
+
h,
|
|
802
956
|
t,
|
|
957
|
+
r,
|
|
803
958
|
e,
|
|
959
|
+
a,
|
|
804
960
|
i,
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
/* @__PURE__ */
|
|
811
|
-
/* @__PURE__ */ T(
|
|
961
|
+
m.height,
|
|
962
|
+
m.width,
|
|
963
|
+
g
|
|
964
|
+
]), A ? /* @__PURE__ */ x("group", { position: [0, 0, -1], children: /* @__PURE__ */ S("mesh", { renderOrder: u, children: [
|
|
965
|
+
/* @__PURE__ */ x("planeGeometry", { args: p }),
|
|
966
|
+
/* @__PURE__ */ x(
|
|
812
967
|
"shaderMaterial",
|
|
813
968
|
{
|
|
814
|
-
uniforms:
|
|
815
|
-
vertexShader:
|
|
816
|
-
fragmentShader:
|
|
969
|
+
uniforms: g,
|
|
970
|
+
vertexShader: Ts,
|
|
971
|
+
fragmentShader: xs,
|
|
817
972
|
depthTest: !1,
|
|
818
973
|
depthWrite: !1,
|
|
819
974
|
toneMapped: !1
|
|
820
975
|
}
|
|
821
976
|
)
|
|
822
977
|
] }) }) : null;
|
|
823
|
-
},
|
|
978
|
+
}, At = 512, $t = [
|
|
824
979
|
10,
|
|
825
980
|
338,
|
|
826
981
|
297,
|
|
@@ -857,7 +1012,7 @@ const Tt = {
|
|
|
857
1012
|
103,
|
|
858
1013
|
67,
|
|
859
1014
|
109
|
|
860
|
-
],
|
|
1015
|
+
], bs = [
|
|
861
1016
|
33,
|
|
862
1017
|
246,
|
|
863
1018
|
161,
|
|
@@ -874,7 +1029,7 @@ const Tt = {
|
|
|
874
1029
|
144,
|
|
875
1030
|
163,
|
|
876
1031
|
7
|
|
877
|
-
],
|
|
1032
|
+
], Ms = [
|
|
878
1033
|
362,
|
|
879
1034
|
398,
|
|
880
1035
|
384,
|
|
@@ -891,7 +1046,7 @@ const Tt = {
|
|
|
891
1046
|
380,
|
|
892
1047
|
381,
|
|
893
1048
|
382
|
|
894
|
-
],
|
|
1049
|
+
], Rs = [
|
|
895
1050
|
61,
|
|
896
1051
|
146,
|
|
897
1052
|
91,
|
|
@@ -912,7 +1067,7 @@ const Tt = {
|
|
|
912
1067
|
39,
|
|
913
1068
|
40,
|
|
914
1069
|
185
|
|
915
|
-
],
|
|
1070
|
+
], Jt = [
|
|
916
1071
|
78,
|
|
917
1072
|
95,
|
|
918
1073
|
88,
|
|
@@ -933,38 +1088,48 @@ const Tt = {
|
|
|
933
1088
|
81,
|
|
934
1089
|
80,
|
|
935
1090
|
191
|
|
936
|
-
],
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
],
|
|
944
|
-
|
|
945
|
-
},
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
const s =
|
|
1091
|
+
], Es = [70, 63, 105, 66, 107, 55, 65, 52, 53, 46], ws = [336, 296, 334, 293, 300, 276, 283, 282, 295, 285], Ss = [
|
|
1092
|
+
bs,
|
|
1093
|
+
Ms,
|
|
1094
|
+
Rs,
|
|
1095
|
+
Jt,
|
|
1096
|
+
Es,
|
|
1097
|
+
ws
|
|
1098
|
+
], It = (a, e, t) => {
|
|
1099
|
+
vt(a, e, $t, t);
|
|
1100
|
+
}, Pt = (a, e, t) => {
|
|
1101
|
+
const s = ne(e, 10, t), n = ne(e, 103, t), o = ne(e, 332, t), r = ne(e, 105, t), c = ne(e, 334, t);
|
|
1102
|
+
if (!s || !n || !o || !r || !c) return;
|
|
1103
|
+
const i = (r.y + c.y) * 0.5, l = Math.abs(o.x - n.x), h = Math.max(Math.abs(i - s.y) * 0.72, l * 0.08), u = Math.max(0, s.y - h), d = h * 0.34;
|
|
1104
|
+
a.beginPath(), a.moveTo(n.x, n.y - d), a.quadraticCurveTo((n.x + s.x) * 0.5, u, s.x, u), a.quadraticCurveTo(
|
|
1105
|
+
(o.x + s.x) * 0.5,
|
|
1106
|
+
u,
|
|
1107
|
+
o.x,
|
|
1108
|
+
o.y - d
|
|
1109
|
+
), a.lineTo(c.x, i), a.quadraticCurveTo(s.x, i + h * 0.16, r.x, i), a.closePath(), a.fill();
|
|
1110
|
+
}, ys = (a, e, t) => {
|
|
1111
|
+
Ss.forEach((s) => vt(a, e, s, t));
|
|
1112
|
+
}, ne = (a, e, t) => {
|
|
1113
|
+
const s = a[e];
|
|
949
1114
|
return s ? {
|
|
950
1115
|
x: s.x * t,
|
|
951
1116
|
y: s.y * t
|
|
952
1117
|
} : null;
|
|
953
|
-
},
|
|
954
|
-
const n =
|
|
1118
|
+
}, vt = (a, e, t, s) => {
|
|
1119
|
+
const n = ne(e, t[0], s);
|
|
955
1120
|
if (n) {
|
|
956
|
-
|
|
957
|
-
for (let
|
|
958
|
-
const
|
|
959
|
-
|
|
1121
|
+
a.beginPath(), a.moveTo(n.x, n.y);
|
|
1122
|
+
for (let o = 1; o < t.length; o += 1) {
|
|
1123
|
+
const r = ne(e, t[o], s);
|
|
1124
|
+
r && a.lineTo(r.x, r.y);
|
|
960
1125
|
}
|
|
961
|
-
|
|
1126
|
+
a.closePath(), a.fill();
|
|
962
1127
|
}
|
|
963
|
-
},
|
|
964
|
-
|
|
965
|
-
},
|
|
966
|
-
|
|
967
|
-
},
|
|
1128
|
+
}, _s = (a, e, t = At, s = {}) => {
|
|
1129
|
+
a.clearRect(0, 0, t, t), e != null && e.length && (a.save(), a.globalCompositeOperation = "lighter", a.fillStyle = "rgb(0, 0, 255)", It(a, e, t), s.foreheadCoverage && Pt(a, e, t), a.restore(), a.save(), a.globalCompositeOperation = "lighter", a.filter = "blur(8px)", a.fillStyle = "rgb(255, 0, 0)", It(a, e, t), s.foreheadCoverage && Pt(a, e, t), a.restore(), a.save(), a.globalCompositeOperation = "lighter", a.filter = "blur(3px)", a.fillStyle = "rgb(0, 255, 0)", ys(a, e, t), a.restore());
|
|
1130
|
+
}, Ls = (a, e, t = At) => {
|
|
1131
|
+
a.clearRect(0, 0, t, t), e != null && e.length && (a.save(), a.filter = "blur(2px)", a.fillStyle = "rgb(255, 255, 255)", vt(a, e, Jt, t), a.restore());
|
|
1132
|
+
}, Cs = 0.1, Is = 0.48, Ps = 0.012, Ns = 1, Fs = 1.1, ks = 1.15, Os = 0.04, Ds = [
|
|
968
1133
|
61,
|
|
969
1134
|
146,
|
|
970
1135
|
91,
|
|
@@ -996,7 +1161,7 @@ const Tt = {
|
|
|
996
1161
|
311,
|
|
997
1162
|
310,
|
|
998
1163
|
415
|
|
999
|
-
],
|
|
1164
|
+
], Us = [
|
|
1000
1165
|
33,
|
|
1001
1166
|
7,
|
|
1002
1167
|
163,
|
|
@@ -1013,7 +1178,7 @@ const Tt = {
|
|
|
1013
1178
|
160,
|
|
1014
1179
|
161,
|
|
1015
1180
|
246
|
|
1016
|
-
],
|
|
1181
|
+
], Bs = [
|
|
1017
1182
|
362,
|
|
1018
1183
|
382,
|
|
1019
1184
|
381,
|
|
@@ -1030,7 +1195,7 @@ const Tt = {
|
|
|
1030
1195
|
385,
|
|
1031
1196
|
384,
|
|
1032
1197
|
398
|
|
1033
|
-
],
|
|
1198
|
+
], Hs = [70, 63, 105, 66, 107, 55, 65, 52, 53, 46], Gs = [336, 296, 334, 293, 300, 285, 295, 282, 283, 276], Xs = [
|
|
1034
1199
|
1,
|
|
1035
1200
|
2,
|
|
1036
1201
|
4,
|
|
@@ -1055,14 +1220,14 @@ const Tt = {
|
|
|
1055
1220
|
344,
|
|
1056
1221
|
358,
|
|
1057
1222
|
440
|
|
1058
|
-
],
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
],
|
|
1223
|
+
], js = [
|
|
1224
|
+
Ds,
|
|
1225
|
+
Us,
|
|
1226
|
+
Bs,
|
|
1227
|
+
Hs,
|
|
1228
|
+
Gs,
|
|
1229
|
+
Xs
|
|
1230
|
+
], Ks = [
|
|
1066
1231
|
61,
|
|
1067
1232
|
91,
|
|
1068
1233
|
84,
|
|
@@ -1121,86 +1286,86 @@ const Tt = {
|
|
|
1121
1286
|
326,
|
|
1122
1287
|
2,
|
|
1123
1288
|
195
|
|
1124
|
-
],
|
|
1125
|
-
let
|
|
1126
|
-
if (e.forEach((
|
|
1127
|
-
const b =
|
|
1128
|
-
b && (
|
|
1129
|
-
}),
|
|
1130
|
-
const
|
|
1289
|
+
], Ne = (a) => Math.min(Math.max(a, 0), 1), Nt = (a, e, t, s, n, o) => {
|
|
1290
|
+
let r = 1, c = 1, i = 0, l = 0, h = 0;
|
|
1291
|
+
if (e.forEach((T) => {
|
|
1292
|
+
const b = a[T];
|
|
1293
|
+
b && (r = Math.min(r, b.x), c = Math.min(c, b.y), i = Math.max(i, b.x), l = Math.max(l, b.y), h += 1);
|
|
1294
|
+
}), h === 0) return null;
|
|
1295
|
+
const u = i - r, d = l - c, m = Math.max(u * t, o), A = Math.max(d * t, o), g = Ne(r - m), p = Ne(c - A), f = Ne(i + m), v = Ne(l + A);
|
|
1131
1296
|
return {
|
|
1132
|
-
centerX: (
|
|
1133
|
-
centerY: (
|
|
1134
|
-
radiusX: Math.max((f -
|
|
1135
|
-
radiusY: Math.max((
|
|
1297
|
+
centerX: (g + f) * 0.5,
|
|
1298
|
+
centerY: (p + v) * 0.5,
|
|
1299
|
+
radiusX: Math.max((f - g) * 0.5, o),
|
|
1300
|
+
radiusY: Math.max((v - p) * 0.5, o),
|
|
1136
1301
|
strength: s,
|
|
1137
1302
|
kind: n
|
|
1138
1303
|
};
|
|
1139
|
-
},
|
|
1140
|
-
centerX:
|
|
1141
|
-
centerY:
|
|
1304
|
+
}, Ys = (a, e, t) => a ? {
|
|
1305
|
+
centerX: a.x,
|
|
1306
|
+
centerY: a.y,
|
|
1142
1307
|
radiusX: e,
|
|
1143
1308
|
radiusY: e,
|
|
1144
1309
|
strength: t,
|
|
1145
1310
|
kind: "feature"
|
|
1146
|
-
} : null,
|
|
1147
|
-
if (!(
|
|
1148
|
-
const t = (e == null ? void 0 : e.faceOvalIndices) ??
|
|
1149
|
-
i,
|
|
1150
|
-
t,
|
|
1151
|
-
r,
|
|
1311
|
+
} : null, Ws = (a, e) => {
|
|
1312
|
+
if (!(a != null && a.length)) return [];
|
|
1313
|
+
const t = (e == null ? void 0 : e.faceOvalIndices) ?? $t, s = (e == null ? void 0 : e.featureGroups) ?? js, n = (e == null ? void 0 : e.featurePointIndices) ?? Ks, o = (e == null ? void 0 : e.faceBoundsExpansion) ?? Cs, r = (e == null ? void 0 : e.featureBoundsExpansion) ?? Is, c = (e == null ? void 0 : e.minRegionRadius) ?? Ps, i = (e == null ? void 0 : e.faceRegionStrength) ?? Ns, l = (e == null ? void 0 : e.featureRegionStrength) ?? Fs, h = (e == null ? void 0 : e.featurePointRegionStrength) ?? ks, u = (e == null ? void 0 : e.featurePointRadiusRatio) ?? Os, d = [], m = Nt(
|
|
1152
1314
|
a,
|
|
1315
|
+
t,
|
|
1316
|
+
o,
|
|
1317
|
+
i,
|
|
1153
1318
|
"face",
|
|
1154
1319
|
c
|
|
1155
1320
|
);
|
|
1156
|
-
|
|
1157
|
-
const
|
|
1158
|
-
Math.max((
|
|
1321
|
+
m && d.push(m);
|
|
1322
|
+
const A = Math.max(
|
|
1323
|
+
Math.max((m == null ? void 0 : m.radiusX) ?? 0, (m == null ? void 0 : m.radiusY) ?? 0) * u,
|
|
1159
1324
|
c * 1.35
|
|
1160
1325
|
);
|
|
1161
|
-
return s.forEach((
|
|
1162
|
-
const
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1326
|
+
return s.forEach((g) => {
|
|
1327
|
+
const p = Nt(
|
|
1328
|
+
a,
|
|
1329
|
+
g,
|
|
1330
|
+
r,
|
|
1166
1331
|
l,
|
|
1167
1332
|
"feature",
|
|
1168
1333
|
c
|
|
1169
1334
|
);
|
|
1170
|
-
|
|
1171
|
-
}), n.forEach((
|
|
1172
|
-
const
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1335
|
+
p && d.push(p);
|
|
1336
|
+
}), n.forEach((g) => {
|
|
1337
|
+
const p = Ys(
|
|
1338
|
+
a[g],
|
|
1339
|
+
A,
|
|
1340
|
+
h
|
|
1176
1341
|
);
|
|
1177
|
-
|
|
1342
|
+
p && d.push(p);
|
|
1178
1343
|
}), d;
|
|
1179
|
-
},
|
|
1344
|
+
}, Ft = (a) => {
|
|
1180
1345
|
const e = document.createElement("canvas");
|
|
1181
|
-
e.width =
|
|
1346
|
+
e.width = a, e.height = a;
|
|
1182
1347
|
const t = e.getContext("2d", { willReadFrequently: !1 });
|
|
1183
1348
|
if (!t) throw new Error("Unable to create face retouch mask context");
|
|
1184
1349
|
const s = new R.CanvasTexture(e);
|
|
1185
1350
|
return s.colorSpace = R.NoColorSpace, s.minFilter = R.LinearFilter, s.magFilter = R.LinearFilter, s.generateMipmaps = !1, s.needsUpdate = !0, { canvas: e, context: t, texture: s };
|
|
1186
|
-
},
|
|
1187
|
-
const { mask:
|
|
1188
|
-
mask:
|
|
1189
|
-
mouthMask:
|
|
1351
|
+
}, ao = (a, e = At, t = {}) => {
|
|
1352
|
+
const { mask: s, mouthMask: n } = W(() => ({
|
|
1353
|
+
mask: Ft(e),
|
|
1354
|
+
mouthMask: Ft(e)
|
|
1190
1355
|
}), [e]);
|
|
1191
1356
|
return $(() => {
|
|
1192
|
-
let
|
|
1357
|
+
let o = 0;
|
|
1193
1358
|
const r = () => {
|
|
1194
|
-
var
|
|
1195
|
-
|
|
1196
|
-
const
|
|
1197
|
-
|
|
1359
|
+
var i, l;
|
|
1360
|
+
o = requestAnimationFrame(r);
|
|
1361
|
+
const c = (l = (i = a == null ? void 0 : a.detectionResults) == null ? void 0 : i.faceLandmarks) == null ? void 0 : l[0];
|
|
1362
|
+
_s(s.context, c, e, t), Ls(n.context, c, e), s.texture.needsUpdate = !0, n.texture.needsUpdate = !0;
|
|
1198
1363
|
};
|
|
1199
1364
|
return r(), () => {
|
|
1200
|
-
cancelAnimationFrame(
|
|
1365
|
+
cancelAnimationFrame(o);
|
|
1201
1366
|
};
|
|
1202
|
-
}, [
|
|
1203
|
-
},
|
|
1367
|
+
}, [a, s.context, s.texture, n.context, n.texture, t, e]), { canvas: s.canvas, texture: s.texture, mouthTexture: n.texture };
|
|
1368
|
+
}, Vs = (a) => a.map(
|
|
1204
1369
|
(e) => [
|
|
1205
1370
|
e.centerX.toFixed(4),
|
|
1206
1371
|
e.centerY.toFixed(4),
|
|
@@ -1209,107 +1374,107 @@ const Tt = {
|
|
|
1209
1374
|
e.strength.toFixed(2),
|
|
1210
1375
|
e.kind
|
|
1211
1376
|
].join(",")
|
|
1212
|
-
).join("|"),
|
|
1213
|
-
const [t, s] =
|
|
1377
|
+
).join("|"), io = (a, e) => {
|
|
1378
|
+
const [t, s] = gt([]);
|
|
1214
1379
|
return $(() => {
|
|
1215
|
-
let n = 0,
|
|
1216
|
-
const
|
|
1217
|
-
var
|
|
1218
|
-
n = requestAnimationFrame(
|
|
1219
|
-
const c = (
|
|
1220
|
-
l !==
|
|
1380
|
+
let n = 0, o = "";
|
|
1381
|
+
const r = () => {
|
|
1382
|
+
var h, u;
|
|
1383
|
+
n = requestAnimationFrame(r);
|
|
1384
|
+
const c = (u = (h = a == null ? void 0 : a.detectionResults) == null ? void 0 : h.faceLandmarks) == null ? void 0 : u[0], i = Ws(c, e), l = Vs(i);
|
|
1385
|
+
l !== o && (o = l, s(i));
|
|
1221
1386
|
};
|
|
1222
|
-
return
|
|
1387
|
+
return r(), () => {
|
|
1223
1388
|
cancelAnimationFrame(n);
|
|
1224
1389
|
};
|
|
1225
|
-
}, [
|
|
1390
|
+
}, [a]), t;
|
|
1226
1391
|
};
|
|
1227
|
-
function
|
|
1228
|
-
if (e ===
|
|
1229
|
-
return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),
|
|
1230
|
-
if (e ===
|
|
1231
|
-
let t =
|
|
1392
|
+
function kt(a, e) {
|
|
1393
|
+
if (e === dn)
|
|
1394
|
+
return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), a;
|
|
1395
|
+
if (e === ut || e === Ht) {
|
|
1396
|
+
let t = a.getIndex();
|
|
1232
1397
|
if (t === null) {
|
|
1233
|
-
const
|
|
1398
|
+
const r = [], c = a.getAttribute("position");
|
|
1234
1399
|
if (c !== void 0) {
|
|
1235
|
-
for (let
|
|
1236
|
-
|
|
1237
|
-
|
|
1400
|
+
for (let i = 0; i < c.count; i++)
|
|
1401
|
+
r.push(i);
|
|
1402
|
+
a.setIndex(r), t = a.getIndex();
|
|
1238
1403
|
} else
|
|
1239
|
-
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),
|
|
1404
|
+
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."), a;
|
|
1240
1405
|
}
|
|
1241
1406
|
const s = t.count - 2, n = [];
|
|
1242
|
-
if (e ===
|
|
1243
|
-
for (let
|
|
1244
|
-
n.push(t.getX(0)), n.push(t.getX(
|
|
1407
|
+
if (e === ut)
|
|
1408
|
+
for (let r = 1; r <= s; r++)
|
|
1409
|
+
n.push(t.getX(0)), n.push(t.getX(r)), n.push(t.getX(r + 1));
|
|
1245
1410
|
else
|
|
1246
|
-
for (let
|
|
1247
|
-
|
|
1411
|
+
for (let r = 0; r < s; r++)
|
|
1412
|
+
r % 2 === 0 ? (n.push(t.getX(r)), n.push(t.getX(r + 1)), n.push(t.getX(r + 2))) : (n.push(t.getX(r + 2)), n.push(t.getX(r + 1)), n.push(t.getX(r)));
|
|
1248
1413
|
n.length / 3 !== s && console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");
|
|
1249
|
-
const
|
|
1250
|
-
return
|
|
1414
|
+
const o = a.clone();
|
|
1415
|
+
return o.setIndex(n), o.clearGroups(), o;
|
|
1251
1416
|
} else
|
|
1252
|
-
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:", e),
|
|
1417
|
+
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:", e), a;
|
|
1253
1418
|
}
|
|
1254
|
-
class
|
|
1419
|
+
class zs extends fn {
|
|
1255
1420
|
constructor(e) {
|
|
1256
1421
|
super(e), this.dracoLoader = null, this.ktx2Loader = null, this.meshoptDecoder = null, this.pluginCallbacks = [], this.register(function(t) {
|
|
1257
|
-
return new
|
|
1258
|
-
}), this.register(function(t) {
|
|
1259
|
-
return new Bs(t);
|
|
1422
|
+
return new Js(t);
|
|
1260
1423
|
}), this.register(function(t) {
|
|
1261
|
-
return new
|
|
1424
|
+
return new er(t);
|
|
1262
1425
|
}), this.register(function(t) {
|
|
1263
|
-
return new
|
|
1426
|
+
return new lr(t);
|
|
1264
1427
|
}), this.register(function(t) {
|
|
1265
|
-
return new
|
|
1428
|
+
return new ur(t);
|
|
1266
1429
|
}), this.register(function(t) {
|
|
1267
|
-
return new
|
|
1430
|
+
return new hr(t);
|
|
1268
1431
|
}), this.register(function(t) {
|
|
1269
|
-
return new
|
|
1432
|
+
return new nr(t);
|
|
1270
1433
|
}), this.register(function(t) {
|
|
1271
|
-
return new
|
|
1434
|
+
return new sr(t);
|
|
1272
1435
|
}), this.register(function(t) {
|
|
1273
|
-
return new
|
|
1436
|
+
return new rr(t);
|
|
1274
1437
|
}), this.register(function(t) {
|
|
1275
|
-
return new
|
|
1438
|
+
return new or(t);
|
|
1276
1439
|
}), this.register(function(t) {
|
|
1277
|
-
return new
|
|
1440
|
+
return new $s(t);
|
|
1278
1441
|
}), this.register(function(t) {
|
|
1279
|
-
return new
|
|
1442
|
+
return new ar(t);
|
|
1280
1443
|
}), this.register(function(t) {
|
|
1281
|
-
return new
|
|
1444
|
+
return new tr(t);
|
|
1282
1445
|
}), this.register(function(t) {
|
|
1283
|
-
return new
|
|
1446
|
+
return new cr(t);
|
|
1284
1447
|
}), this.register(function(t) {
|
|
1285
|
-
return new
|
|
1448
|
+
return new ir(t);
|
|
1286
1449
|
}), this.register(function(t) {
|
|
1287
1450
|
return new Zs(t);
|
|
1288
1451
|
}), this.register(function(t) {
|
|
1289
|
-
return new
|
|
1452
|
+
return new dr(t);
|
|
1453
|
+
}), this.register(function(t) {
|
|
1454
|
+
return new fr(t);
|
|
1290
1455
|
});
|
|
1291
1456
|
}
|
|
1292
1457
|
load(e, t, s, n) {
|
|
1293
|
-
const
|
|
1294
|
-
let
|
|
1458
|
+
const o = this;
|
|
1459
|
+
let r;
|
|
1295
1460
|
if (this.resourcePath !== "")
|
|
1296
|
-
|
|
1461
|
+
r = this.resourcePath;
|
|
1297
1462
|
else if (this.path !== "") {
|
|
1298
|
-
const l =
|
|
1299
|
-
|
|
1463
|
+
const l = be.extractUrlBase(e);
|
|
1464
|
+
r = be.resolveURL(l, this.path);
|
|
1300
1465
|
} else
|
|
1301
|
-
|
|
1466
|
+
r = be.extractUrlBase(e);
|
|
1302
1467
|
this.manager.itemStart(e);
|
|
1303
1468
|
const c = function(l) {
|
|
1304
|
-
n ? n(l) : console.error(l),
|
|
1305
|
-
},
|
|
1306
|
-
|
|
1469
|
+
n ? n(l) : console.error(l), o.manager.itemError(e), o.manager.itemEnd(e);
|
|
1470
|
+
}, i = new Gt(this.manager);
|
|
1471
|
+
i.setPath(this.path), i.setResponseType("arraybuffer"), i.setRequestHeader(this.requestHeader), i.setWithCredentials(this.withCredentials), i.load(e, function(l) {
|
|
1307
1472
|
try {
|
|
1308
|
-
|
|
1309
|
-
t(
|
|
1473
|
+
o.parse(l, r, function(h) {
|
|
1474
|
+
t(h), o.manager.itemEnd(e);
|
|
1310
1475
|
}, c);
|
|
1311
|
-
} catch (
|
|
1312
|
-
c(
|
|
1476
|
+
} catch (h) {
|
|
1477
|
+
c(h);
|
|
1313
1478
|
}
|
|
1314
1479
|
}, s, c);
|
|
1315
1480
|
}
|
|
@@ -1329,28 +1494,28 @@ class Ns extends Jt {
|
|
|
1329
1494
|
return this.pluginCallbacks.indexOf(e) !== -1 && this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e), 1), this;
|
|
1330
1495
|
}
|
|
1331
1496
|
parse(e, t, s, n) {
|
|
1332
|
-
let
|
|
1333
|
-
const
|
|
1497
|
+
let o;
|
|
1498
|
+
const r = {}, c = {}, i = new TextDecoder();
|
|
1334
1499
|
if (typeof e == "string")
|
|
1335
|
-
|
|
1500
|
+
o = JSON.parse(e);
|
|
1336
1501
|
else if (e instanceof ArrayBuffer)
|
|
1337
|
-
if (
|
|
1502
|
+
if (i.decode(new Uint8Array(e, 0, 4)) === en) {
|
|
1338
1503
|
try {
|
|
1339
|
-
|
|
1340
|
-
} catch (
|
|
1341
|
-
n && n(
|
|
1504
|
+
r[M.KHR_BINARY_GLTF] = new mr(e);
|
|
1505
|
+
} catch (u) {
|
|
1506
|
+
n && n(u);
|
|
1342
1507
|
return;
|
|
1343
1508
|
}
|
|
1344
|
-
|
|
1509
|
+
o = JSON.parse(r[M.KHR_BINARY_GLTF].content);
|
|
1345
1510
|
} else
|
|
1346
|
-
|
|
1511
|
+
o = JSON.parse(i.decode(e));
|
|
1347
1512
|
else
|
|
1348
|
-
|
|
1349
|
-
if (
|
|
1513
|
+
o = e;
|
|
1514
|
+
if (o.asset === void 0 || o.asset.version[0] < 2) {
|
|
1350
1515
|
n && n(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));
|
|
1351
1516
|
return;
|
|
1352
1517
|
}
|
|
1353
|
-
const l = new
|
|
1518
|
+
const l = new yr(o, {
|
|
1354
1519
|
path: t || this.resourcePath || "",
|
|
1355
1520
|
crossOrigin: this.crossOrigin,
|
|
1356
1521
|
requestHeader: this.requestHeader,
|
|
@@ -1359,57 +1524,57 @@ class Ns extends Jt {
|
|
|
1359
1524
|
meshoptDecoder: this.meshoptDecoder
|
|
1360
1525
|
});
|
|
1361
1526
|
l.fileLoader.setRequestHeader(this.requestHeader);
|
|
1362
|
-
for (let
|
|
1363
|
-
const
|
|
1364
|
-
|
|
1527
|
+
for (let h = 0; h < this.pluginCallbacks.length; h++) {
|
|
1528
|
+
const u = this.pluginCallbacks[h](l);
|
|
1529
|
+
u.name || console.error("THREE.GLTFLoader: Invalid plugin found: missing name"), c[u.name] = u, r[u.name] = !0;
|
|
1365
1530
|
}
|
|
1366
|
-
if (
|
|
1367
|
-
for (let
|
|
1368
|
-
const
|
|
1369
|
-
switch (
|
|
1370
|
-
case
|
|
1371
|
-
|
|
1531
|
+
if (o.extensionsUsed)
|
|
1532
|
+
for (let h = 0; h < o.extensionsUsed.length; ++h) {
|
|
1533
|
+
const u = o.extensionsUsed[h], d = o.extensionsRequired || [];
|
|
1534
|
+
switch (u) {
|
|
1535
|
+
case M.KHR_MATERIALS_UNLIT:
|
|
1536
|
+
r[u] = new Qs();
|
|
1372
1537
|
break;
|
|
1373
|
-
case
|
|
1374
|
-
|
|
1538
|
+
case M.KHR_DRACO_MESH_COMPRESSION:
|
|
1539
|
+
r[u] = new pr(o, this.dracoLoader);
|
|
1375
1540
|
break;
|
|
1376
|
-
case
|
|
1377
|
-
|
|
1541
|
+
case M.KHR_TEXTURE_TRANSFORM:
|
|
1542
|
+
r[u] = new gr();
|
|
1378
1543
|
break;
|
|
1379
|
-
case
|
|
1380
|
-
|
|
1544
|
+
case M.KHR_MESH_QUANTIZATION:
|
|
1545
|
+
r[u] = new Ar();
|
|
1381
1546
|
break;
|
|
1382
1547
|
default:
|
|
1383
|
-
d.indexOf(
|
|
1548
|
+
d.indexOf(u) >= 0 && c[u] === void 0 && console.warn('THREE.GLTFLoader: Unknown extension "' + u + '".');
|
|
1384
1549
|
}
|
|
1385
1550
|
}
|
|
1386
|
-
l.setExtensions(
|
|
1551
|
+
l.setExtensions(r), l.setPlugins(c), l.parse(s, n);
|
|
1387
1552
|
}
|
|
1388
1553
|
parseAsync(e, t) {
|
|
1389
1554
|
const s = this;
|
|
1390
|
-
return new Promise(function(n,
|
|
1391
|
-
s.parse(e, t, n,
|
|
1555
|
+
return new Promise(function(n, o) {
|
|
1556
|
+
s.parse(e, t, n, o);
|
|
1392
1557
|
});
|
|
1393
1558
|
}
|
|
1394
1559
|
}
|
|
1395
|
-
function
|
|
1396
|
-
let
|
|
1560
|
+
function qs() {
|
|
1561
|
+
let a = {};
|
|
1397
1562
|
return {
|
|
1398
1563
|
get: function(e) {
|
|
1399
|
-
return
|
|
1564
|
+
return a[e];
|
|
1400
1565
|
},
|
|
1401
1566
|
add: function(e, t) {
|
|
1402
|
-
|
|
1567
|
+
a[e] = t;
|
|
1403
1568
|
},
|
|
1404
1569
|
remove: function(e) {
|
|
1405
|
-
delete
|
|
1570
|
+
delete a[e];
|
|
1406
1571
|
},
|
|
1407
1572
|
removeAll: function() {
|
|
1408
|
-
|
|
1573
|
+
a = {};
|
|
1409
1574
|
}
|
|
1410
1575
|
};
|
|
1411
1576
|
}
|
|
1412
|
-
const
|
|
1577
|
+
const M = {
|
|
1413
1578
|
KHR_BINARY_GLTF: "KHR_binary_glTF",
|
|
1414
1579
|
KHR_DRACO_MESH_COMPRESSION: "KHR_draco_mesh_compression",
|
|
1415
1580
|
KHR_LIGHTS_PUNCTUAL: "KHR_lights_punctual",
|
|
@@ -1433,292 +1598,292 @@ const E = {
|
|
|
1433
1598
|
EXT_MESHOPT_COMPRESSION: "EXT_meshopt_compression",
|
|
1434
1599
|
EXT_MESH_GPU_INSTANCING: "EXT_mesh_gpu_instancing"
|
|
1435
1600
|
};
|
|
1436
|
-
class
|
|
1601
|
+
class Zs {
|
|
1437
1602
|
constructor(e) {
|
|
1438
|
-
this.parser = e, this.name =
|
|
1603
|
+
this.parser = e, this.name = M.KHR_LIGHTS_PUNCTUAL, this.cache = { refs: {}, uses: {} };
|
|
1439
1604
|
}
|
|
1440
1605
|
_markDefs() {
|
|
1441
1606
|
const e = this.parser, t = this.parser.json.nodes || [];
|
|
1442
1607
|
for (let s = 0, n = t.length; s < n; s++) {
|
|
1443
|
-
const
|
|
1444
|
-
|
|
1608
|
+
const o = t[s];
|
|
1609
|
+
o.extensions && o.extensions[this.name] && o.extensions[this.name].light !== void 0 && e._addNodeRef(this.cache, o.extensions[this.name].light);
|
|
1445
1610
|
}
|
|
1446
1611
|
}
|
|
1447
1612
|
_loadLight(e) {
|
|
1448
1613
|
const t = this.parser, s = "light:" + e;
|
|
1449
1614
|
let n = t.cache.get(s);
|
|
1450
1615
|
if (n) return n;
|
|
1451
|
-
const
|
|
1616
|
+
const o = t.json, i = ((o.extensions && o.extensions[this.name] || {}).lights || [])[e];
|
|
1452
1617
|
let l;
|
|
1453
|
-
const
|
|
1454
|
-
|
|
1455
|
-
const
|
|
1456
|
-
switch (
|
|
1618
|
+
const h = new oe(16777215);
|
|
1619
|
+
i.color !== void 0 && h.setRGB(i.color[0], i.color[1], i.color[2], Z);
|
|
1620
|
+
const u = i.range !== void 0 ? i.range : 0;
|
|
1621
|
+
switch (i.type) {
|
|
1457
1622
|
case "directional":
|
|
1458
|
-
l = new
|
|
1623
|
+
l = new gn(h), l.target.position.set(0, 0, -1), l.add(l.target);
|
|
1459
1624
|
break;
|
|
1460
1625
|
case "point":
|
|
1461
|
-
l = new
|
|
1626
|
+
l = new pn(h), l.distance = u;
|
|
1462
1627
|
break;
|
|
1463
1628
|
case "spot":
|
|
1464
|
-
l = new
|
|
1629
|
+
l = new mn(h), l.distance = u, i.spot = i.spot || {}, i.spot.innerConeAngle = i.spot.innerConeAngle !== void 0 ? i.spot.innerConeAngle : 0, i.spot.outerConeAngle = i.spot.outerConeAngle !== void 0 ? i.spot.outerConeAngle : Math.PI / 4, l.angle = i.spot.outerConeAngle, l.penumbra = 1 - i.spot.innerConeAngle / i.spot.outerConeAngle, l.target.position.set(0, 0, -1), l.add(l.target);
|
|
1465
1630
|
break;
|
|
1466
1631
|
default:
|
|
1467
|
-
throw new Error("THREE.GLTFLoader: Unexpected light type: " +
|
|
1632
|
+
throw new Error("THREE.GLTFLoader: Unexpected light type: " + i.type);
|
|
1468
1633
|
}
|
|
1469
|
-
return l.position.set(0, 0, 0),
|
|
1634
|
+
return l.position.set(0, 0, 0), z(l, i), i.intensity !== void 0 && (l.intensity = i.intensity), l.name = t.createUniqueName(i.name || "light_" + e), n = Promise.resolve(l), t.cache.add(s, n), n;
|
|
1470
1635
|
}
|
|
1471
1636
|
getDependency(e, t) {
|
|
1472
1637
|
if (e === "light")
|
|
1473
1638
|
return this._loadLight(t);
|
|
1474
1639
|
}
|
|
1475
1640
|
createNodeAttachment(e) {
|
|
1476
|
-
const t = this, s = this.parser,
|
|
1477
|
-
return c === void 0 ? null : this._loadLight(c).then(function(
|
|
1478
|
-
return s._getNodeRef(t.cache, c,
|
|
1641
|
+
const t = this, s = this.parser, o = s.json.nodes[e], c = (o.extensions && o.extensions[this.name] || {}).light;
|
|
1642
|
+
return c === void 0 ? null : this._loadLight(c).then(function(i) {
|
|
1643
|
+
return s._getNodeRef(t.cache, c, i);
|
|
1479
1644
|
});
|
|
1480
1645
|
}
|
|
1481
1646
|
}
|
|
1482
|
-
class
|
|
1647
|
+
class Qs {
|
|
1483
1648
|
constructor() {
|
|
1484
|
-
this.name =
|
|
1649
|
+
this.name = M.KHR_MATERIALS_UNLIT;
|
|
1485
1650
|
}
|
|
1486
1651
|
getMaterialType() {
|
|
1487
1652
|
return Te;
|
|
1488
1653
|
}
|
|
1489
1654
|
extendParams(e, t, s) {
|
|
1490
1655
|
const n = [];
|
|
1491
|
-
e.color = new
|
|
1492
|
-
const
|
|
1493
|
-
if (
|
|
1494
|
-
if (Array.isArray(
|
|
1495
|
-
const
|
|
1496
|
-
e.color.setRGB(
|
|
1656
|
+
e.color = new oe(1, 1, 1), e.opacity = 1;
|
|
1657
|
+
const o = t.pbrMetallicRoughness;
|
|
1658
|
+
if (o) {
|
|
1659
|
+
if (Array.isArray(o.baseColorFactor)) {
|
|
1660
|
+
const r = o.baseColorFactor;
|
|
1661
|
+
e.color.setRGB(r[0], r[1], r[2], Z), e.opacity = r[3];
|
|
1497
1662
|
}
|
|
1498
|
-
|
|
1663
|
+
o.baseColorTexture !== void 0 && n.push(s.assignTexture(e, "map", o.baseColorTexture, Me));
|
|
1499
1664
|
}
|
|
1500
1665
|
return Promise.all(n);
|
|
1501
1666
|
}
|
|
1502
1667
|
}
|
|
1503
|
-
class
|
|
1668
|
+
class $s {
|
|
1504
1669
|
constructor(e) {
|
|
1505
|
-
this.parser = e, this.name =
|
|
1670
|
+
this.parser = e, this.name = M.KHR_MATERIALS_EMISSIVE_STRENGTH;
|
|
1506
1671
|
}
|
|
1507
1672
|
extendMaterialParams(e, t) {
|
|
1508
1673
|
const n = this.parser.json.materials[e];
|
|
1509
1674
|
if (!n.extensions || !n.extensions[this.name])
|
|
1510
1675
|
return Promise.resolve();
|
|
1511
|
-
const
|
|
1512
|
-
return
|
|
1676
|
+
const o = n.extensions[this.name].emissiveStrength;
|
|
1677
|
+
return o !== void 0 && (t.emissiveIntensity = o), Promise.resolve();
|
|
1513
1678
|
}
|
|
1514
1679
|
}
|
|
1515
|
-
class
|
|
1680
|
+
class Js {
|
|
1516
1681
|
constructor(e) {
|
|
1517
|
-
this.parser = e, this.name =
|
|
1682
|
+
this.parser = e, this.name = M.KHR_MATERIALS_CLEARCOAT;
|
|
1518
1683
|
}
|
|
1519
1684
|
getMaterialType(e) {
|
|
1520
1685
|
const s = this.parser.json.materials[e];
|
|
1521
|
-
return !s.extensions || !s.extensions[this.name] ? null :
|
|
1686
|
+
return !s.extensions || !s.extensions[this.name] ? null : V;
|
|
1522
1687
|
}
|
|
1523
1688
|
extendMaterialParams(e, t) {
|
|
1524
1689
|
const s = this.parser, n = s.json.materials[e];
|
|
1525
1690
|
if (!n.extensions || !n.extensions[this.name])
|
|
1526
1691
|
return Promise.resolve();
|
|
1527
|
-
const
|
|
1528
|
-
if (
|
|
1529
|
-
const c =
|
|
1530
|
-
t.clearcoatNormalScale = new
|
|
1692
|
+
const o = [], r = n.extensions[this.name];
|
|
1693
|
+
if (r.clearcoatFactor !== void 0 && (t.clearcoat = r.clearcoatFactor), r.clearcoatTexture !== void 0 && o.push(s.assignTexture(t, "clearcoatMap", r.clearcoatTexture)), r.clearcoatRoughnessFactor !== void 0 && (t.clearcoatRoughness = r.clearcoatRoughnessFactor), r.clearcoatRoughnessTexture !== void 0 && o.push(s.assignTexture(t, "clearcoatRoughnessMap", r.clearcoatRoughnessTexture)), r.clearcoatNormalTexture !== void 0 && (o.push(s.assignTexture(t, "clearcoatNormalMap", r.clearcoatNormalTexture)), r.clearcoatNormalTexture.scale !== void 0)) {
|
|
1694
|
+
const c = r.clearcoatNormalTexture.scale;
|
|
1695
|
+
t.clearcoatNormalScale = new Xt(c, c);
|
|
1531
1696
|
}
|
|
1532
|
-
return Promise.all(
|
|
1697
|
+
return Promise.all(o);
|
|
1533
1698
|
}
|
|
1534
1699
|
}
|
|
1535
|
-
class
|
|
1700
|
+
class er {
|
|
1536
1701
|
constructor(e) {
|
|
1537
|
-
this.parser = e, this.name =
|
|
1702
|
+
this.parser = e, this.name = M.KHR_MATERIALS_DISPERSION;
|
|
1538
1703
|
}
|
|
1539
1704
|
getMaterialType(e) {
|
|
1540
1705
|
const s = this.parser.json.materials[e];
|
|
1541
|
-
return !s.extensions || !s.extensions[this.name] ? null :
|
|
1706
|
+
return !s.extensions || !s.extensions[this.name] ? null : V;
|
|
1542
1707
|
}
|
|
1543
1708
|
extendMaterialParams(e, t) {
|
|
1544
1709
|
const n = this.parser.json.materials[e];
|
|
1545
1710
|
if (!n.extensions || !n.extensions[this.name])
|
|
1546
1711
|
return Promise.resolve();
|
|
1547
|
-
const
|
|
1548
|
-
return t.dispersion =
|
|
1712
|
+
const o = n.extensions[this.name];
|
|
1713
|
+
return t.dispersion = o.dispersion !== void 0 ? o.dispersion : 0, Promise.resolve();
|
|
1549
1714
|
}
|
|
1550
1715
|
}
|
|
1551
|
-
class
|
|
1716
|
+
class tr {
|
|
1552
1717
|
constructor(e) {
|
|
1553
|
-
this.parser = e, this.name =
|
|
1718
|
+
this.parser = e, this.name = M.KHR_MATERIALS_IRIDESCENCE;
|
|
1554
1719
|
}
|
|
1555
1720
|
getMaterialType(e) {
|
|
1556
1721
|
const s = this.parser.json.materials[e];
|
|
1557
|
-
return !s.extensions || !s.extensions[this.name] ? null :
|
|
1722
|
+
return !s.extensions || !s.extensions[this.name] ? null : V;
|
|
1558
1723
|
}
|
|
1559
1724
|
extendMaterialParams(e, t) {
|
|
1560
1725
|
const s = this.parser, n = s.json.materials[e];
|
|
1561
1726
|
if (!n.extensions || !n.extensions[this.name])
|
|
1562
1727
|
return Promise.resolve();
|
|
1563
|
-
const
|
|
1564
|
-
return
|
|
1728
|
+
const o = [], r = n.extensions[this.name];
|
|
1729
|
+
return r.iridescenceFactor !== void 0 && (t.iridescence = r.iridescenceFactor), r.iridescenceTexture !== void 0 && o.push(s.assignTexture(t, "iridescenceMap", r.iridescenceTexture)), r.iridescenceIor !== void 0 && (t.iridescenceIOR = r.iridescenceIor), t.iridescenceThicknessRange === void 0 && (t.iridescenceThicknessRange = [100, 400]), r.iridescenceThicknessMinimum !== void 0 && (t.iridescenceThicknessRange[0] = r.iridescenceThicknessMinimum), r.iridescenceThicknessMaximum !== void 0 && (t.iridescenceThicknessRange[1] = r.iridescenceThicknessMaximum), r.iridescenceThicknessTexture !== void 0 && o.push(s.assignTexture(t, "iridescenceThicknessMap", r.iridescenceThicknessTexture)), Promise.all(o);
|
|
1565
1730
|
}
|
|
1566
1731
|
}
|
|
1567
|
-
class
|
|
1732
|
+
class nr {
|
|
1568
1733
|
constructor(e) {
|
|
1569
|
-
this.parser = e, this.name =
|
|
1734
|
+
this.parser = e, this.name = M.KHR_MATERIALS_SHEEN;
|
|
1570
1735
|
}
|
|
1571
1736
|
getMaterialType(e) {
|
|
1572
1737
|
const s = this.parser.json.materials[e];
|
|
1573
|
-
return !s.extensions || !s.extensions[this.name] ? null :
|
|
1738
|
+
return !s.extensions || !s.extensions[this.name] ? null : V;
|
|
1574
1739
|
}
|
|
1575
1740
|
extendMaterialParams(e, t) {
|
|
1576
1741
|
const s = this.parser, n = s.json.materials[e];
|
|
1577
1742
|
if (!n.extensions || !n.extensions[this.name])
|
|
1578
1743
|
return Promise.resolve();
|
|
1579
|
-
const
|
|
1580
|
-
t.sheenColor = new
|
|
1581
|
-
const
|
|
1582
|
-
if (
|
|
1583
|
-
const c =
|
|
1584
|
-
t.sheenColor.setRGB(c[0], c[1], c[2],
|
|
1744
|
+
const o = [];
|
|
1745
|
+
t.sheenColor = new oe(0, 0, 0), t.sheenRoughness = 0, t.sheen = 1;
|
|
1746
|
+
const r = n.extensions[this.name];
|
|
1747
|
+
if (r.sheenColorFactor !== void 0) {
|
|
1748
|
+
const c = r.sheenColorFactor;
|
|
1749
|
+
t.sheenColor.setRGB(c[0], c[1], c[2], Z);
|
|
1585
1750
|
}
|
|
1586
|
-
return
|
|
1751
|
+
return r.sheenRoughnessFactor !== void 0 && (t.sheenRoughness = r.sheenRoughnessFactor), r.sheenColorTexture !== void 0 && o.push(s.assignTexture(t, "sheenColorMap", r.sheenColorTexture, Me)), r.sheenRoughnessTexture !== void 0 && o.push(s.assignTexture(t, "sheenRoughnessMap", r.sheenRoughnessTexture)), Promise.all(o);
|
|
1587
1752
|
}
|
|
1588
1753
|
}
|
|
1589
|
-
class
|
|
1754
|
+
class sr {
|
|
1590
1755
|
constructor(e) {
|
|
1591
|
-
this.parser = e, this.name =
|
|
1756
|
+
this.parser = e, this.name = M.KHR_MATERIALS_TRANSMISSION;
|
|
1592
1757
|
}
|
|
1593
1758
|
getMaterialType(e) {
|
|
1594
1759
|
const s = this.parser.json.materials[e];
|
|
1595
|
-
return !s.extensions || !s.extensions[this.name] ? null :
|
|
1760
|
+
return !s.extensions || !s.extensions[this.name] ? null : V;
|
|
1596
1761
|
}
|
|
1597
1762
|
extendMaterialParams(e, t) {
|
|
1598
1763
|
const s = this.parser, n = s.json.materials[e];
|
|
1599
1764
|
if (!n.extensions || !n.extensions[this.name])
|
|
1600
1765
|
return Promise.resolve();
|
|
1601
|
-
const
|
|
1602
|
-
return
|
|
1766
|
+
const o = [], r = n.extensions[this.name];
|
|
1767
|
+
return r.transmissionFactor !== void 0 && (t.transmission = r.transmissionFactor), r.transmissionTexture !== void 0 && o.push(s.assignTexture(t, "transmissionMap", r.transmissionTexture)), Promise.all(o);
|
|
1603
1768
|
}
|
|
1604
1769
|
}
|
|
1605
|
-
class
|
|
1770
|
+
class rr {
|
|
1606
1771
|
constructor(e) {
|
|
1607
|
-
this.parser = e, this.name =
|
|
1772
|
+
this.parser = e, this.name = M.KHR_MATERIALS_VOLUME;
|
|
1608
1773
|
}
|
|
1609
1774
|
getMaterialType(e) {
|
|
1610
1775
|
const s = this.parser.json.materials[e];
|
|
1611
|
-
return !s.extensions || !s.extensions[this.name] ? null :
|
|
1776
|
+
return !s.extensions || !s.extensions[this.name] ? null : V;
|
|
1612
1777
|
}
|
|
1613
1778
|
extendMaterialParams(e, t) {
|
|
1614
1779
|
const s = this.parser, n = s.json.materials[e];
|
|
1615
1780
|
if (!n.extensions || !n.extensions[this.name])
|
|
1616
1781
|
return Promise.resolve();
|
|
1617
|
-
const
|
|
1618
|
-
t.thickness =
|
|
1619
|
-
const c =
|
|
1620
|
-
return t.attenuationColor = new
|
|
1782
|
+
const o = [], r = n.extensions[this.name];
|
|
1783
|
+
t.thickness = r.thicknessFactor !== void 0 ? r.thicknessFactor : 0, r.thicknessTexture !== void 0 && o.push(s.assignTexture(t, "thicknessMap", r.thicknessTexture)), t.attenuationDistance = r.attenuationDistance || 1 / 0;
|
|
1784
|
+
const c = r.attenuationColor || [1, 1, 1];
|
|
1785
|
+
return t.attenuationColor = new oe().setRGB(c[0], c[1], c[2], Z), Promise.all(o);
|
|
1621
1786
|
}
|
|
1622
1787
|
}
|
|
1623
|
-
class
|
|
1788
|
+
class or {
|
|
1624
1789
|
constructor(e) {
|
|
1625
|
-
this.parser = e, this.name =
|
|
1790
|
+
this.parser = e, this.name = M.KHR_MATERIALS_IOR;
|
|
1626
1791
|
}
|
|
1627
1792
|
getMaterialType(e) {
|
|
1628
1793
|
const s = this.parser.json.materials[e];
|
|
1629
|
-
return !s.extensions || !s.extensions[this.name] ? null :
|
|
1794
|
+
return !s.extensions || !s.extensions[this.name] ? null : V;
|
|
1630
1795
|
}
|
|
1631
1796
|
extendMaterialParams(e, t) {
|
|
1632
1797
|
const n = this.parser.json.materials[e];
|
|
1633
1798
|
if (!n.extensions || !n.extensions[this.name])
|
|
1634
1799
|
return Promise.resolve();
|
|
1635
|
-
const
|
|
1636
|
-
return t.ior =
|
|
1800
|
+
const o = n.extensions[this.name];
|
|
1801
|
+
return t.ior = o.ior !== void 0 ? o.ior : 1.5, Promise.resolve();
|
|
1637
1802
|
}
|
|
1638
1803
|
}
|
|
1639
|
-
class
|
|
1804
|
+
class ar {
|
|
1640
1805
|
constructor(e) {
|
|
1641
|
-
this.parser = e, this.name =
|
|
1806
|
+
this.parser = e, this.name = M.KHR_MATERIALS_SPECULAR;
|
|
1642
1807
|
}
|
|
1643
1808
|
getMaterialType(e) {
|
|
1644
1809
|
const s = this.parser.json.materials[e];
|
|
1645
|
-
return !s.extensions || !s.extensions[this.name] ? null :
|
|
1810
|
+
return !s.extensions || !s.extensions[this.name] ? null : V;
|
|
1646
1811
|
}
|
|
1647
1812
|
extendMaterialParams(e, t) {
|
|
1648
1813
|
const s = this.parser, n = s.json.materials[e];
|
|
1649
1814
|
if (!n.extensions || !n.extensions[this.name])
|
|
1650
1815
|
return Promise.resolve();
|
|
1651
|
-
const
|
|
1652
|
-
t.specularIntensity =
|
|
1653
|
-
const c =
|
|
1654
|
-
return t.specularColor = new
|
|
1816
|
+
const o = [], r = n.extensions[this.name];
|
|
1817
|
+
t.specularIntensity = r.specularFactor !== void 0 ? r.specularFactor : 1, r.specularTexture !== void 0 && o.push(s.assignTexture(t, "specularIntensityMap", r.specularTexture));
|
|
1818
|
+
const c = r.specularColorFactor || [1, 1, 1];
|
|
1819
|
+
return t.specularColor = new oe().setRGB(c[0], c[1], c[2], Z), r.specularColorTexture !== void 0 && o.push(s.assignTexture(t, "specularColorMap", r.specularColorTexture, Me)), Promise.all(o);
|
|
1655
1820
|
}
|
|
1656
1821
|
}
|
|
1657
|
-
class
|
|
1822
|
+
class ir {
|
|
1658
1823
|
constructor(e) {
|
|
1659
|
-
this.parser = e, this.name =
|
|
1824
|
+
this.parser = e, this.name = M.EXT_MATERIALS_BUMP;
|
|
1660
1825
|
}
|
|
1661
1826
|
getMaterialType(e) {
|
|
1662
1827
|
const s = this.parser.json.materials[e];
|
|
1663
|
-
return !s.extensions || !s.extensions[this.name] ? null :
|
|
1828
|
+
return !s.extensions || !s.extensions[this.name] ? null : V;
|
|
1664
1829
|
}
|
|
1665
1830
|
extendMaterialParams(e, t) {
|
|
1666
1831
|
const s = this.parser, n = s.json.materials[e];
|
|
1667
1832
|
if (!n.extensions || !n.extensions[this.name])
|
|
1668
1833
|
return Promise.resolve();
|
|
1669
|
-
const
|
|
1670
|
-
return t.bumpScale =
|
|
1834
|
+
const o = [], r = n.extensions[this.name];
|
|
1835
|
+
return t.bumpScale = r.bumpFactor !== void 0 ? r.bumpFactor : 1, r.bumpTexture !== void 0 && o.push(s.assignTexture(t, "bumpMap", r.bumpTexture)), Promise.all(o);
|
|
1671
1836
|
}
|
|
1672
1837
|
}
|
|
1673
|
-
class
|
|
1838
|
+
class cr {
|
|
1674
1839
|
constructor(e) {
|
|
1675
|
-
this.parser = e, this.name =
|
|
1840
|
+
this.parser = e, this.name = M.KHR_MATERIALS_ANISOTROPY;
|
|
1676
1841
|
}
|
|
1677
1842
|
getMaterialType(e) {
|
|
1678
1843
|
const s = this.parser.json.materials[e];
|
|
1679
|
-
return !s.extensions || !s.extensions[this.name] ? null :
|
|
1844
|
+
return !s.extensions || !s.extensions[this.name] ? null : V;
|
|
1680
1845
|
}
|
|
1681
1846
|
extendMaterialParams(e, t) {
|
|
1682
1847
|
const s = this.parser, n = s.json.materials[e];
|
|
1683
1848
|
if (!n.extensions || !n.extensions[this.name])
|
|
1684
1849
|
return Promise.resolve();
|
|
1685
|
-
const
|
|
1686
|
-
return
|
|
1850
|
+
const o = [], r = n.extensions[this.name];
|
|
1851
|
+
return r.anisotropyStrength !== void 0 && (t.anisotropy = r.anisotropyStrength), r.anisotropyRotation !== void 0 && (t.anisotropyRotation = r.anisotropyRotation), r.anisotropyTexture !== void 0 && o.push(s.assignTexture(t, "anisotropyMap", r.anisotropyTexture)), Promise.all(o);
|
|
1687
1852
|
}
|
|
1688
1853
|
}
|
|
1689
|
-
class
|
|
1854
|
+
class lr {
|
|
1690
1855
|
constructor(e) {
|
|
1691
|
-
this.parser = e, this.name =
|
|
1856
|
+
this.parser = e, this.name = M.KHR_TEXTURE_BASISU;
|
|
1692
1857
|
}
|
|
1693
1858
|
loadTexture(e) {
|
|
1694
1859
|
const t = this.parser, s = t.json, n = s.textures[e];
|
|
1695
1860
|
if (!n.extensions || !n.extensions[this.name])
|
|
1696
1861
|
return null;
|
|
1697
|
-
const
|
|
1698
|
-
if (!
|
|
1862
|
+
const o = n.extensions[this.name], r = t.options.ktx2Loader;
|
|
1863
|
+
if (!r) {
|
|
1699
1864
|
if (s.extensionsRequired && s.extensionsRequired.indexOf(this.name) >= 0)
|
|
1700
1865
|
throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");
|
|
1701
1866
|
return null;
|
|
1702
1867
|
}
|
|
1703
|
-
return t.loadTextureImage(e,
|
|
1868
|
+
return t.loadTextureImage(e, o.source, r);
|
|
1704
1869
|
}
|
|
1705
1870
|
}
|
|
1706
|
-
class
|
|
1871
|
+
class ur {
|
|
1707
1872
|
constructor(e) {
|
|
1708
|
-
this.parser = e, this.name =
|
|
1873
|
+
this.parser = e, this.name = M.EXT_TEXTURE_WEBP, this.isSupported = null;
|
|
1709
1874
|
}
|
|
1710
1875
|
loadTexture(e) {
|
|
1711
|
-
const t = this.name, s = this.parser, n = s.json,
|
|
1712
|
-
if (!
|
|
1876
|
+
const t = this.name, s = this.parser, n = s.json, o = n.textures[e];
|
|
1877
|
+
if (!o.extensions || !o.extensions[t])
|
|
1713
1878
|
return null;
|
|
1714
|
-
const
|
|
1715
|
-
let
|
|
1879
|
+
const r = o.extensions[t], c = n.images[r.source];
|
|
1880
|
+
let i = s.textureLoader;
|
|
1716
1881
|
if (c.uri) {
|
|
1717
1882
|
const l = s.options.manager.getHandler(c.uri);
|
|
1718
|
-
l !== null && (
|
|
1883
|
+
l !== null && (i = l);
|
|
1719
1884
|
}
|
|
1720
1885
|
return this.detectSupport().then(function(l) {
|
|
1721
|
-
if (l) return s.loadTextureImage(e,
|
|
1886
|
+
if (l) return s.loadTextureImage(e, r.source, i);
|
|
1722
1887
|
if (n.extensionsRequired && n.extensionsRequired.indexOf(t) >= 0)
|
|
1723
1888
|
throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");
|
|
1724
1889
|
return s.loadTexture(e);
|
|
@@ -1733,22 +1898,22 @@ class zs {
|
|
|
1733
1898
|
})), this.isSupported;
|
|
1734
1899
|
}
|
|
1735
1900
|
}
|
|
1736
|
-
class
|
|
1901
|
+
class hr {
|
|
1737
1902
|
constructor(e) {
|
|
1738
|
-
this.parser = e, this.name =
|
|
1903
|
+
this.parser = e, this.name = M.EXT_TEXTURE_AVIF, this.isSupported = null;
|
|
1739
1904
|
}
|
|
1740
1905
|
loadTexture(e) {
|
|
1741
|
-
const t = this.name, s = this.parser, n = s.json,
|
|
1742
|
-
if (!
|
|
1906
|
+
const t = this.name, s = this.parser, n = s.json, o = n.textures[e];
|
|
1907
|
+
if (!o.extensions || !o.extensions[t])
|
|
1743
1908
|
return null;
|
|
1744
|
-
const
|
|
1745
|
-
let
|
|
1909
|
+
const r = o.extensions[t], c = n.images[r.source];
|
|
1910
|
+
let i = s.textureLoader;
|
|
1746
1911
|
if (c.uri) {
|
|
1747
1912
|
const l = s.options.manager.getHandler(c.uri);
|
|
1748
|
-
l !== null && (
|
|
1913
|
+
l !== null && (i = l);
|
|
1749
1914
|
}
|
|
1750
1915
|
return this.detectSupport().then(function(l) {
|
|
1751
|
-
if (l) return s.loadTextureImage(e,
|
|
1916
|
+
if (l) return s.loadTextureImage(e, r.source, i);
|
|
1752
1917
|
if (n.extensionsRequired && n.extensionsRequired.indexOf(t) >= 0)
|
|
1753
1918
|
throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");
|
|
1754
1919
|
return s.loadTexture(e);
|
|
@@ -1763,35 +1928,35 @@ class qs {
|
|
|
1763
1928
|
})), this.isSupported;
|
|
1764
1929
|
}
|
|
1765
1930
|
}
|
|
1766
|
-
class
|
|
1931
|
+
class dr {
|
|
1767
1932
|
constructor(e) {
|
|
1768
|
-
this.name =
|
|
1933
|
+
this.name = M.EXT_MESHOPT_COMPRESSION, this.parser = e;
|
|
1769
1934
|
}
|
|
1770
1935
|
loadBufferView(e) {
|
|
1771
1936
|
const t = this.parser.json, s = t.bufferViews[e];
|
|
1772
1937
|
if (s.extensions && s.extensions[this.name]) {
|
|
1773
|
-
const n = s.extensions[this.name],
|
|
1774
|
-
if (!
|
|
1938
|
+
const n = s.extensions[this.name], o = this.parser.getDependency("buffer", n.buffer), r = this.parser.options.meshoptDecoder;
|
|
1939
|
+
if (!r || !r.supported) {
|
|
1775
1940
|
if (t.extensionsRequired && t.extensionsRequired.indexOf(this.name) >= 0)
|
|
1776
1941
|
throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");
|
|
1777
1942
|
return null;
|
|
1778
1943
|
}
|
|
1779
|
-
return
|
|
1780
|
-
const
|
|
1781
|
-
return
|
|
1782
|
-
return
|
|
1783
|
-
}) :
|
|
1784
|
-
const
|
|
1785
|
-
return
|
|
1944
|
+
return o.then(function(c) {
|
|
1945
|
+
const i = n.byteOffset || 0, l = n.byteLength || 0, h = n.count, u = n.byteStride, d = new Uint8Array(c, i, l);
|
|
1946
|
+
return r.decodeGltfBufferAsync ? r.decodeGltfBufferAsync(h, u, d, n.mode, n.filter).then(function(m) {
|
|
1947
|
+
return m.buffer;
|
|
1948
|
+
}) : r.ready.then(function() {
|
|
1949
|
+
const m = new ArrayBuffer(h * u);
|
|
1950
|
+
return r.decodeGltfBuffer(new Uint8Array(m), h, u, d, n.mode, n.filter), m;
|
|
1786
1951
|
});
|
|
1787
1952
|
});
|
|
1788
1953
|
} else
|
|
1789
1954
|
return null;
|
|
1790
1955
|
}
|
|
1791
1956
|
}
|
|
1792
|
-
class
|
|
1957
|
+
class fr {
|
|
1793
1958
|
constructor(e) {
|
|
1794
|
-
this.name =
|
|
1959
|
+
this.name = M.EXT_MESH_GPU_INSTANCING, this.parser = e;
|
|
1795
1960
|
}
|
|
1796
1961
|
createNodeMesh(e) {
|
|
1797
1962
|
const t = this.parser.json, s = t.nodes[e];
|
|
@@ -1799,132 +1964,132 @@ class Qs {
|
|
|
1799
1964
|
return null;
|
|
1800
1965
|
const n = t.meshes[s.mesh];
|
|
1801
1966
|
for (const l of n.primitives)
|
|
1802
|
-
if (l.mode !==
|
|
1967
|
+
if (l.mode !== H.TRIANGLES && l.mode !== H.TRIANGLE_STRIP && l.mode !== H.TRIANGLE_FAN && l.mode !== void 0)
|
|
1803
1968
|
return null;
|
|
1804
|
-
const
|
|
1805
|
-
for (const l in
|
|
1806
|
-
c.push(this.parser.getDependency("accessor",
|
|
1969
|
+
const r = s.extensions[this.name].attributes, c = [], i = {};
|
|
1970
|
+
for (const l in r)
|
|
1971
|
+
c.push(this.parser.getDependency("accessor", r[l]).then((h) => (i[l] = h, i[l])));
|
|
1807
1972
|
return c.length < 1 ? null : (c.push(this.parser.createNodeMesh(e)), Promise.all(c).then((l) => {
|
|
1808
|
-
const
|
|
1809
|
-
for (const
|
|
1810
|
-
const
|
|
1973
|
+
const h = l.pop(), u = h.isGroup ? h.children : [h], d = l[0].count, m = [];
|
|
1974
|
+
for (const A of u) {
|
|
1975
|
+
const g = new Oe(), p = new se(), f = new jt(), v = new se(1, 1, 1), T = new An(A.geometry, A.material, d);
|
|
1811
1976
|
for (let b = 0; b < d; b++)
|
|
1812
|
-
|
|
1813
|
-
for (const b in
|
|
1977
|
+
i.TRANSLATION && p.fromBufferAttribute(i.TRANSLATION, b), i.ROTATION && f.fromBufferAttribute(i.ROTATION, b), i.SCALE && v.fromBufferAttribute(i.SCALE, b), T.setMatrixAt(b, g.compose(p, f, v));
|
|
1978
|
+
for (const b in i)
|
|
1814
1979
|
if (b === "_COLOR_0") {
|
|
1815
|
-
const
|
|
1816
|
-
|
|
1817
|
-
} else b !== "TRANSLATION" && b !== "ROTATION" && b !== "SCALE" &&
|
|
1818
|
-
|
|
1980
|
+
const E = i[b];
|
|
1981
|
+
T.instanceColor = new vn(E.array, E.itemSize, E.normalized);
|
|
1982
|
+
} else b !== "TRANSLATION" && b !== "ROTATION" && b !== "SCALE" && A.geometry.setAttribute(b, i[b]);
|
|
1983
|
+
Kt.prototype.copy.call(T, A), this.parser.assignFinalMaterial(T), m.push(T);
|
|
1819
1984
|
}
|
|
1820
|
-
return
|
|
1985
|
+
return h.isGroup ? (h.clear(), h.add(...m), h) : m[0];
|
|
1821
1986
|
}));
|
|
1822
1987
|
}
|
|
1823
1988
|
}
|
|
1824
|
-
const
|
|
1825
|
-
class
|
|
1989
|
+
const en = "glTF", ve = 12, Ot = { JSON: 1313821514, BIN: 5130562 };
|
|
1990
|
+
class mr {
|
|
1826
1991
|
constructor(e) {
|
|
1827
|
-
this.name =
|
|
1828
|
-
const t = new DataView(e, 0,
|
|
1992
|
+
this.name = M.KHR_BINARY_GLTF, this.content = null, this.body = null;
|
|
1993
|
+
const t = new DataView(e, 0, ve), s = new TextDecoder();
|
|
1829
1994
|
if (this.header = {
|
|
1830
1995
|
magic: s.decode(new Uint8Array(e.slice(0, 4))),
|
|
1831
1996
|
version: t.getUint32(4, !0),
|
|
1832
1997
|
length: t.getUint32(8, !0)
|
|
1833
|
-
}, this.header.magic !==
|
|
1998
|
+
}, this.header.magic !== en)
|
|
1834
1999
|
throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");
|
|
1835
2000
|
if (this.header.version < 2)
|
|
1836
2001
|
throw new Error("THREE.GLTFLoader: Legacy binary file detected.");
|
|
1837
|
-
const n = this.header.length -
|
|
1838
|
-
let
|
|
1839
|
-
for (;
|
|
1840
|
-
const c =
|
|
1841
|
-
|
|
1842
|
-
const
|
|
1843
|
-
if (
|
|
1844
|
-
const l = new Uint8Array(e,
|
|
2002
|
+
const n = this.header.length - ve, o = new DataView(e, ve);
|
|
2003
|
+
let r = 0;
|
|
2004
|
+
for (; r < n; ) {
|
|
2005
|
+
const c = o.getUint32(r, !0);
|
|
2006
|
+
r += 4;
|
|
2007
|
+
const i = o.getUint32(r, !0);
|
|
2008
|
+
if (r += 4, i === Ot.JSON) {
|
|
2009
|
+
const l = new Uint8Array(e, ve + r, c);
|
|
1845
2010
|
this.content = s.decode(l);
|
|
1846
|
-
} else if (
|
|
1847
|
-
const l =
|
|
2011
|
+
} else if (i === Ot.BIN) {
|
|
2012
|
+
const l = ve + r;
|
|
1848
2013
|
this.body = e.slice(l, l + c);
|
|
1849
2014
|
}
|
|
1850
|
-
|
|
2015
|
+
r += c;
|
|
1851
2016
|
}
|
|
1852
2017
|
if (this.content === null)
|
|
1853
2018
|
throw new Error("THREE.GLTFLoader: JSON content not found.");
|
|
1854
2019
|
}
|
|
1855
2020
|
}
|
|
1856
|
-
class
|
|
2021
|
+
class pr {
|
|
1857
2022
|
constructor(e, t) {
|
|
1858
2023
|
if (!t)
|
|
1859
2024
|
throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");
|
|
1860
|
-
this.name =
|
|
2025
|
+
this.name = M.KHR_DRACO_MESH_COMPRESSION, this.json = e, this.dracoLoader = t, this.dracoLoader.preload();
|
|
1861
2026
|
}
|
|
1862
2027
|
decodePrimitive(e, t) {
|
|
1863
|
-
const s = this.json, n = this.dracoLoader,
|
|
1864
|
-
for (const
|
|
1865
|
-
const
|
|
1866
|
-
c[
|
|
2028
|
+
const s = this.json, n = this.dracoLoader, o = e.extensions[this.name].bufferView, r = e.extensions[this.name].attributes, c = {}, i = {}, l = {};
|
|
2029
|
+
for (const h in r) {
|
|
2030
|
+
const u = mt[h] || h.toLowerCase();
|
|
2031
|
+
c[u] = r[h];
|
|
1867
2032
|
}
|
|
1868
|
-
for (const
|
|
1869
|
-
const
|
|
1870
|
-
if (
|
|
1871
|
-
const d = s.accessors[e.attributes[
|
|
1872
|
-
l[
|
|
2033
|
+
for (const h in e.attributes) {
|
|
2034
|
+
const u = mt[h] || h.toLowerCase();
|
|
2035
|
+
if (r[h] !== void 0) {
|
|
2036
|
+
const d = s.accessors[e.attributes[h]], m = ue[d.componentType];
|
|
2037
|
+
l[u] = m.name, i[u] = d.normalized === !0;
|
|
1873
2038
|
}
|
|
1874
2039
|
}
|
|
1875
|
-
return t.getDependency("bufferView",
|
|
1876
|
-
return new Promise(function(
|
|
1877
|
-
n.decodeDracoFile(
|
|
1878
|
-
for (const
|
|
1879
|
-
const
|
|
1880
|
-
|
|
2040
|
+
return t.getDependency("bufferView", o).then(function(h) {
|
|
2041
|
+
return new Promise(function(u, d) {
|
|
2042
|
+
n.decodeDracoFile(h, function(m) {
|
|
2043
|
+
for (const A in m.attributes) {
|
|
2044
|
+
const g = m.attributes[A], p = i[A];
|
|
2045
|
+
p !== void 0 && (g.normalized = p);
|
|
1881
2046
|
}
|
|
1882
|
-
|
|
1883
|
-
}, c, l,
|
|
2047
|
+
u(m);
|
|
2048
|
+
}, c, l, Z, d);
|
|
1884
2049
|
});
|
|
1885
2050
|
});
|
|
1886
2051
|
}
|
|
1887
2052
|
}
|
|
1888
|
-
class
|
|
2053
|
+
class gr {
|
|
1889
2054
|
constructor() {
|
|
1890
|
-
this.name =
|
|
2055
|
+
this.name = M.KHR_TEXTURE_TRANSFORM;
|
|
1891
2056
|
}
|
|
1892
2057
|
extendTexture(e, t) {
|
|
1893
2058
|
return (t.texCoord === void 0 || t.texCoord === e.channel) && t.offset === void 0 && t.rotation === void 0 && t.scale === void 0 || (e = e.clone(), t.texCoord !== void 0 && (e.channel = t.texCoord), t.offset !== void 0 && e.offset.fromArray(t.offset), t.rotation !== void 0 && (e.rotation = t.rotation), t.scale !== void 0 && e.repeat.fromArray(t.scale), e.needsUpdate = !0), e;
|
|
1894
2059
|
}
|
|
1895
2060
|
}
|
|
1896
|
-
class
|
|
2061
|
+
class Ar {
|
|
1897
2062
|
constructor() {
|
|
1898
|
-
this.name =
|
|
2063
|
+
this.name = M.KHR_MESH_QUANTIZATION;
|
|
1899
2064
|
}
|
|
1900
2065
|
}
|
|
1901
|
-
class
|
|
2066
|
+
class tn extends Wn {
|
|
1902
2067
|
constructor(e, t, s, n) {
|
|
1903
2068
|
super(e, t, s, n);
|
|
1904
2069
|
}
|
|
1905
2070
|
copySampleValue_(e) {
|
|
1906
|
-
const t = this.resultBuffer, s = this.sampleValues, n = this.valueSize,
|
|
1907
|
-
for (let
|
|
1908
|
-
t[
|
|
2071
|
+
const t = this.resultBuffer, s = this.sampleValues, n = this.valueSize, o = e * n * 3 + n;
|
|
2072
|
+
for (let r = 0; r !== n; r++)
|
|
2073
|
+
t[r] = s[o + r];
|
|
1909
2074
|
return t;
|
|
1910
2075
|
}
|
|
1911
2076
|
interpolate_(e, t, s, n) {
|
|
1912
|
-
const
|
|
2077
|
+
const o = this.resultBuffer, r = this.sampleValues, c = this.valueSize, i = c * 2, l = c * 3, h = n - t, u = (s - t) / h, d = u * u, m = d * u, A = e * l, g = A - l, p = -2 * m + 3 * d, f = m - d, v = 1 - p, T = f - d + u;
|
|
1913
2078
|
for (let b = 0; b !== c; b++) {
|
|
1914
|
-
const
|
|
1915
|
-
|
|
2079
|
+
const E = r[g + b + c], L = r[g + b + i] * h, y = r[A + b + c], N = r[A + b] * h;
|
|
2080
|
+
o[b] = v * E + T * L + p * y + f * N;
|
|
1916
2081
|
}
|
|
1917
|
-
return
|
|
2082
|
+
return o;
|
|
1918
2083
|
}
|
|
1919
2084
|
}
|
|
1920
|
-
const
|
|
1921
|
-
class
|
|
2085
|
+
const vr = new jt();
|
|
2086
|
+
class Tr extends tn {
|
|
1922
2087
|
interpolate_(e, t, s, n) {
|
|
1923
|
-
const
|
|
1924
|
-
return
|
|
2088
|
+
const o = super.interpolate_(e, t, s, n);
|
|
2089
|
+
return vr.fromArray(o).normalize().toArray(o), o;
|
|
1925
2090
|
}
|
|
1926
2091
|
}
|
|
1927
|
-
const
|
|
2092
|
+
const H = {
|
|
1928
2093
|
POINTS: 0,
|
|
1929
2094
|
LINES: 1,
|
|
1930
2095
|
LINE_LOOP: 2,
|
|
@@ -1932,25 +2097,25 @@ const O = {
|
|
|
1932
2097
|
TRIANGLES: 4,
|
|
1933
2098
|
TRIANGLE_STRIP: 5,
|
|
1934
2099
|
TRIANGLE_FAN: 6
|
|
1935
|
-
},
|
|
2100
|
+
}, ue = {
|
|
1936
2101
|
5120: Int8Array,
|
|
1937
2102
|
5121: Uint8Array,
|
|
1938
2103
|
5122: Int16Array,
|
|
1939
2104
|
5123: Uint16Array,
|
|
1940
2105
|
5125: Uint32Array,
|
|
1941
2106
|
5126: Float32Array
|
|
1942
|
-
},
|
|
1943
|
-
9728:
|
|
1944
|
-
9729:
|
|
1945
|
-
9984:
|
|
1946
|
-
9985:
|
|
1947
|
-
9986:
|
|
1948
|
-
9987:
|
|
1949
|
-
},
|
|
1950
|
-
33071:
|
|
1951
|
-
33648:
|
|
1952
|
-
10497:
|
|
1953
|
-
},
|
|
2107
|
+
}, Dt = {
|
|
2108
|
+
9728: Wt,
|
|
2109
|
+
9729: ht,
|
|
2110
|
+
9984: wn,
|
|
2111
|
+
9985: En,
|
|
2112
|
+
9986: Rn,
|
|
2113
|
+
9987: Yt
|
|
2114
|
+
}, Ut = {
|
|
2115
|
+
33071: yn,
|
|
2116
|
+
33648: Sn,
|
|
2117
|
+
10497: dt
|
|
2118
|
+
}, ot = {
|
|
1954
2119
|
SCALAR: 1,
|
|
1955
2120
|
VEC2: 2,
|
|
1956
2121
|
VEC3: 3,
|
|
@@ -1958,7 +2123,7 @@ const O = {
|
|
|
1958
2123
|
MAT2: 4,
|
|
1959
2124
|
MAT3: 9,
|
|
1960
2125
|
MAT4: 16
|
|
1961
|
-
},
|
|
2126
|
+
}, mt = {
|
|
1962
2127
|
POSITION: "position",
|
|
1963
2128
|
NORMAL: "normal",
|
|
1964
2129
|
TANGENT: "tangent",
|
|
@@ -1974,98 +2139,98 @@ const O = {
|
|
|
1974
2139
|
translation: "position",
|
|
1975
2140
|
rotation: "quaternion",
|
|
1976
2141
|
weights: "morphTargetInfluences"
|
|
1977
|
-
},
|
|
2142
|
+
}, xr = {
|
|
1978
2143
|
CUBICSPLINE: void 0,
|
|
1979
2144
|
// We use a custom interpolant (GLTFCubicSplineInterpolation) for CUBICSPLINE tracks. Each
|
|
1980
2145
|
// keyframe track will be initialized with a default interpolation type, then modified.
|
|
1981
|
-
LINEAR:
|
|
1982
|
-
STEP:
|
|
1983
|
-
},
|
|
2146
|
+
LINEAR: zt,
|
|
2147
|
+
STEP: Kn
|
|
2148
|
+
}, at = {
|
|
1984
2149
|
OPAQUE: "OPAQUE",
|
|
1985
2150
|
MASK: "MASK",
|
|
1986
2151
|
BLEND: "BLEND"
|
|
1987
2152
|
};
|
|
1988
|
-
function
|
|
1989
|
-
return
|
|
2153
|
+
function br(a) {
|
|
2154
|
+
return a.DefaultMaterial === void 0 && (a.DefaultMaterial = new Vt({
|
|
1990
2155
|
color: 16777215,
|
|
1991
2156
|
emissive: 0,
|
|
1992
2157
|
metalness: 1,
|
|
1993
2158
|
roughness: 1,
|
|
1994
2159
|
transparent: !1,
|
|
1995
2160
|
depthTest: !0,
|
|
1996
|
-
side:
|
|
1997
|
-
})),
|
|
2161
|
+
side: Yn
|
|
2162
|
+
})), a.DefaultMaterial;
|
|
1998
2163
|
}
|
|
1999
|
-
function
|
|
2164
|
+
function te(a, e, t) {
|
|
2000
2165
|
for (const s in t.extensions)
|
|
2001
|
-
|
|
2166
|
+
a[s] === void 0 && (e.userData.gltfExtensions = e.userData.gltfExtensions || {}, e.userData.gltfExtensions[s] = t.extensions[s]);
|
|
2002
2167
|
}
|
|
2003
|
-
function
|
|
2004
|
-
e.extras !== void 0 && (typeof e.extras == "object" ? Object.assign(
|
|
2168
|
+
function z(a, e) {
|
|
2169
|
+
e.extras !== void 0 && (typeof e.extras == "object" ? Object.assign(a.userData, e.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + e.extras));
|
|
2005
2170
|
}
|
|
2006
|
-
function
|
|
2007
|
-
let s = !1, n = !1,
|
|
2008
|
-
for (let l = 0,
|
|
2009
|
-
const
|
|
2010
|
-
if (
|
|
2011
|
-
}
|
|
2012
|
-
if (!s && !n && !
|
|
2013
|
-
const
|
|
2014
|
-
for (let l = 0,
|
|
2015
|
-
const
|
|
2171
|
+
function Mr(a, e, t) {
|
|
2172
|
+
let s = !1, n = !1, o = !1;
|
|
2173
|
+
for (let l = 0, h = e.length; l < h; l++) {
|
|
2174
|
+
const u = e[l];
|
|
2175
|
+
if (u.POSITION !== void 0 && (s = !0), u.NORMAL !== void 0 && (n = !0), u.COLOR_0 !== void 0 && (o = !0), s && n && o) break;
|
|
2176
|
+
}
|
|
2177
|
+
if (!s && !n && !o) return Promise.resolve(a);
|
|
2178
|
+
const r = [], c = [], i = [];
|
|
2179
|
+
for (let l = 0, h = e.length; l < h; l++) {
|
|
2180
|
+
const u = e[l];
|
|
2016
2181
|
if (s) {
|
|
2017
|
-
const d =
|
|
2018
|
-
|
|
2182
|
+
const d = u.POSITION !== void 0 ? t.getDependency("accessor", u.POSITION) : a.attributes.position;
|
|
2183
|
+
r.push(d);
|
|
2019
2184
|
}
|
|
2020
2185
|
if (n) {
|
|
2021
|
-
const d =
|
|
2186
|
+
const d = u.NORMAL !== void 0 ? t.getDependency("accessor", u.NORMAL) : a.attributes.normal;
|
|
2022
2187
|
c.push(d);
|
|
2023
2188
|
}
|
|
2024
|
-
if (
|
|
2025
|
-
const d =
|
|
2026
|
-
|
|
2189
|
+
if (o) {
|
|
2190
|
+
const d = u.COLOR_0 !== void 0 ? t.getDependency("accessor", u.COLOR_0) : a.attributes.color;
|
|
2191
|
+
i.push(d);
|
|
2027
2192
|
}
|
|
2028
2193
|
}
|
|
2029
2194
|
return Promise.all([
|
|
2030
|
-
Promise.all(
|
|
2195
|
+
Promise.all(r),
|
|
2031
2196
|
Promise.all(c),
|
|
2032
|
-
Promise.all(
|
|
2197
|
+
Promise.all(i)
|
|
2033
2198
|
]).then(function(l) {
|
|
2034
|
-
const
|
|
2035
|
-
return s && (
|
|
2199
|
+
const h = l[0], u = l[1], d = l[2];
|
|
2200
|
+
return s && (a.morphAttributes.position = h), n && (a.morphAttributes.normal = u), o && (a.morphAttributes.color = d), a.morphTargetsRelative = !0, a;
|
|
2036
2201
|
});
|
|
2037
2202
|
}
|
|
2038
|
-
function
|
|
2039
|
-
if (
|
|
2203
|
+
function Rr(a, e) {
|
|
2204
|
+
if (a.updateMorphTargets(), e.weights !== void 0)
|
|
2040
2205
|
for (let t = 0, s = e.weights.length; t < s; t++)
|
|
2041
|
-
|
|
2206
|
+
a.morphTargetInfluences[t] = e.weights[t];
|
|
2042
2207
|
if (e.extras && Array.isArray(e.extras.targetNames)) {
|
|
2043
2208
|
const t = e.extras.targetNames;
|
|
2044
|
-
if (
|
|
2045
|
-
|
|
2209
|
+
if (a.morphTargetInfluences.length === t.length) {
|
|
2210
|
+
a.morphTargetDictionary = {};
|
|
2046
2211
|
for (let s = 0, n = t.length; s < n; s++)
|
|
2047
|
-
|
|
2212
|
+
a.morphTargetDictionary[t[s]] = s;
|
|
2048
2213
|
} else
|
|
2049
2214
|
console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.");
|
|
2050
2215
|
}
|
|
2051
2216
|
}
|
|
2052
|
-
function
|
|
2217
|
+
function Er(a) {
|
|
2053
2218
|
let e;
|
|
2054
|
-
const t =
|
|
2055
|
-
if (t ? e = "draco:" + t.bufferView + ":" + t.indices + ":" +
|
|
2056
|
-
for (let s = 0, n =
|
|
2057
|
-
e += ":" +
|
|
2219
|
+
const t = a.extensions && a.extensions[M.KHR_DRACO_MESH_COMPRESSION];
|
|
2220
|
+
if (t ? e = "draco:" + t.bufferView + ":" + t.indices + ":" + it(t.attributes) : e = a.indices + ":" + it(a.attributes) + ":" + a.mode, a.targets !== void 0)
|
|
2221
|
+
for (let s = 0, n = a.targets.length; s < n; s++)
|
|
2222
|
+
e += ":" + it(a.targets[s]);
|
|
2058
2223
|
return e;
|
|
2059
2224
|
}
|
|
2060
|
-
function
|
|
2225
|
+
function it(a) {
|
|
2061
2226
|
let e = "";
|
|
2062
|
-
const t = Object.keys(
|
|
2227
|
+
const t = Object.keys(a).sort();
|
|
2063
2228
|
for (let s = 0, n = t.length; s < n; s++)
|
|
2064
|
-
e += t[s] + ":" +
|
|
2229
|
+
e += t[s] + ":" + a[t[s]] + ";";
|
|
2065
2230
|
return e;
|
|
2066
2231
|
}
|
|
2067
|
-
function
|
|
2068
|
-
switch (
|
|
2232
|
+
function pt(a) {
|
|
2233
|
+
switch (a) {
|
|
2069
2234
|
case Int8Array:
|
|
2070
2235
|
return 1 / 127;
|
|
2071
2236
|
case Uint8Array:
|
|
@@ -2078,21 +2243,21 @@ function it(i) {
|
|
|
2078
2243
|
throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.");
|
|
2079
2244
|
}
|
|
2080
2245
|
}
|
|
2081
|
-
function
|
|
2082
|
-
return
|
|
2246
|
+
function wr(a) {
|
|
2247
|
+
return a.search(/\.jpe?g($|\?)/i) > 0 || a.search(/^data\:image\/jpeg/) === 0 ? "image/jpeg" : a.search(/\.webp($|\?)/i) > 0 || a.search(/^data\:image\/webp/) === 0 ? "image/webp" : a.search(/\.ktx2($|\?)/i) > 0 || a.search(/^data\:image\/ktx2/) === 0 ? "image/ktx2" : "image/png";
|
|
2083
2248
|
}
|
|
2084
|
-
const
|
|
2085
|
-
class
|
|
2249
|
+
const Sr = new Oe();
|
|
2250
|
+
class yr {
|
|
2086
2251
|
constructor(e = {}, t = {}) {
|
|
2087
|
-
this.json = e, this.extensions = {}, this.plugins = {}, this.options = t, this.cache = new
|
|
2088
|
-
let s = !1, n = -1,
|
|
2252
|
+
this.json = e, this.extensions = {}, this.plugins = {}, this.options = t, this.cache = new qs(), this.associations = /* @__PURE__ */ new Map(), this.primitiveCache = {}, this.nodeCache = {}, this.meshCache = { refs: {}, uses: {} }, this.cameraCache = { refs: {}, uses: {} }, this.lightCache = { refs: {}, uses: {} }, this.sourceCache = {}, this.textureCache = {}, this.nodeNamesUsed = {};
|
|
2253
|
+
let s = !1, n = -1, o = !1, r = -1;
|
|
2089
2254
|
if (typeof navigator < "u") {
|
|
2090
2255
|
const c = navigator.userAgent;
|
|
2091
2256
|
s = /^((?!chrome|android).)*safari/i.test(c) === !0;
|
|
2092
|
-
const
|
|
2093
|
-
n = s &&
|
|
2257
|
+
const i = c.match(/Version\/(\d+)/);
|
|
2258
|
+
n = s && i ? parseInt(i[1], 10) : -1, o = c.indexOf("Firefox") > -1, r = o ? c.match(/Firefox\/([0-9]+)\./)[1] : -1;
|
|
2094
2259
|
}
|
|
2095
|
-
typeof createImageBitmap > "u" || s && n < 17 ||
|
|
2260
|
+
typeof createImageBitmap > "u" || s && n < 17 || o && r < 98 ? this.textureLoader = new Tn(this.options.manager) : this.textureLoader = new xn(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new Gt(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0);
|
|
2096
2261
|
}
|
|
2097
2262
|
setExtensions(e) {
|
|
2098
2263
|
this.extensions = e;
|
|
@@ -2101,32 +2266,32 @@ class hr {
|
|
|
2101
2266
|
this.plugins = e;
|
|
2102
2267
|
}
|
|
2103
2268
|
parse(e, t) {
|
|
2104
|
-
const s = this, n = this.json,
|
|
2105
|
-
this.cache.removeAll(), this.nodeCache = {}, this._invokeAll(function(
|
|
2106
|
-
return
|
|
2107
|
-
}), Promise.all(this._invokeAll(function(
|
|
2108
|
-
return
|
|
2269
|
+
const s = this, n = this.json, o = this.extensions;
|
|
2270
|
+
this.cache.removeAll(), this.nodeCache = {}, this._invokeAll(function(r) {
|
|
2271
|
+
return r._markDefs && r._markDefs();
|
|
2272
|
+
}), Promise.all(this._invokeAll(function(r) {
|
|
2273
|
+
return r.beforeRoot && r.beforeRoot();
|
|
2109
2274
|
})).then(function() {
|
|
2110
2275
|
return Promise.all([
|
|
2111
2276
|
s.getDependencies("scene"),
|
|
2112
2277
|
s.getDependencies("animation"),
|
|
2113
2278
|
s.getDependencies("camera")
|
|
2114
2279
|
]);
|
|
2115
|
-
}).then(function(
|
|
2280
|
+
}).then(function(r) {
|
|
2116
2281
|
const c = {
|
|
2117
|
-
scene:
|
|
2118
|
-
scenes:
|
|
2119
|
-
animations:
|
|
2120
|
-
cameras:
|
|
2282
|
+
scene: r[0][n.scene || 0],
|
|
2283
|
+
scenes: r[0],
|
|
2284
|
+
animations: r[1],
|
|
2285
|
+
cameras: r[2],
|
|
2121
2286
|
asset: n.asset,
|
|
2122
2287
|
parser: s,
|
|
2123
2288
|
userData: {}
|
|
2124
2289
|
};
|
|
2125
|
-
return
|
|
2126
|
-
return
|
|
2290
|
+
return te(o, c, n), z(c, n), Promise.all(s._invokeAll(function(i) {
|
|
2291
|
+
return i.afterRoot && i.afterRoot(c);
|
|
2127
2292
|
})).then(function() {
|
|
2128
|
-
for (const
|
|
2129
|
-
|
|
2293
|
+
for (const i of c.scenes)
|
|
2294
|
+
i.updateMatrixWorld();
|
|
2130
2295
|
e(c);
|
|
2131
2296
|
});
|
|
2132
2297
|
}).catch(t);
|
|
@@ -2136,14 +2301,14 @@ class hr {
|
|
|
2136
2301
|
*/
|
|
2137
2302
|
_markDefs() {
|
|
2138
2303
|
const e = this.json.nodes || [], t = this.json.skins || [], s = this.json.meshes || [];
|
|
2139
|
-
for (let n = 0,
|
|
2140
|
-
const
|
|
2141
|
-
for (let c = 0,
|
|
2142
|
-
e[
|
|
2304
|
+
for (let n = 0, o = t.length; n < o; n++) {
|
|
2305
|
+
const r = t[n].joints;
|
|
2306
|
+
for (let c = 0, i = r.length; c < i; c++)
|
|
2307
|
+
e[r[c]].isBone = !0;
|
|
2143
2308
|
}
|
|
2144
|
-
for (let n = 0,
|
|
2145
|
-
const
|
|
2146
|
-
|
|
2309
|
+
for (let n = 0, o = e.length; n < o; n++) {
|
|
2310
|
+
const r = e[n];
|
|
2311
|
+
r.mesh !== void 0 && (this._addNodeRef(this.meshCache, r.mesh), r.skin !== void 0 && (s[r.mesh].isSkinnedMesh = !0)), r.camera !== void 0 && this._addNodeRef(this.cameraCache, r.camera);
|
|
2147
2312
|
}
|
|
2148
2313
|
}
|
|
2149
2314
|
/**
|
|
@@ -2171,13 +2336,13 @@ class hr {
|
|
|
2171
2336
|
*/
|
|
2172
2337
|
_getNodeRef(e, t, s) {
|
|
2173
2338
|
if (e.refs[t] <= 1) return s;
|
|
2174
|
-
const n = s.clone(),
|
|
2175
|
-
const
|
|
2176
|
-
|
|
2177
|
-
for (const [l,
|
|
2178
|
-
|
|
2339
|
+
const n = s.clone(), o = (r, c) => {
|
|
2340
|
+
const i = this.associations.get(r);
|
|
2341
|
+
i != null && this.associations.set(c, i);
|
|
2342
|
+
for (const [l, h] of r.children.entries())
|
|
2343
|
+
o(h, c.children[l]);
|
|
2179
2344
|
};
|
|
2180
|
-
return
|
|
2345
|
+
return o(s, n), n.name += "_instance_" + e.uses[t]++, n;
|
|
2181
2346
|
}
|
|
2182
2347
|
_invokeOne(e) {
|
|
2183
2348
|
const t = Object.values(this.plugins);
|
|
@@ -2193,8 +2358,8 @@ class hr {
|
|
|
2193
2358
|
t.unshift(this);
|
|
2194
2359
|
const s = [];
|
|
2195
2360
|
for (let n = 0; n < t.length; n++) {
|
|
2196
|
-
const
|
|
2197
|
-
|
|
2361
|
+
const o = e(t[n]);
|
|
2362
|
+
o && s.push(o);
|
|
2198
2363
|
}
|
|
2199
2364
|
return s;
|
|
2200
2365
|
}
|
|
@@ -2213,50 +2378,50 @@ class hr {
|
|
|
2213
2378
|
n = this.loadScene(t);
|
|
2214
2379
|
break;
|
|
2215
2380
|
case "node":
|
|
2216
|
-
n = this._invokeOne(function(
|
|
2217
|
-
return
|
|
2381
|
+
n = this._invokeOne(function(o) {
|
|
2382
|
+
return o.loadNode && o.loadNode(t);
|
|
2218
2383
|
});
|
|
2219
2384
|
break;
|
|
2220
2385
|
case "mesh":
|
|
2221
|
-
n = this._invokeOne(function(
|
|
2222
|
-
return
|
|
2386
|
+
n = this._invokeOne(function(o) {
|
|
2387
|
+
return o.loadMesh && o.loadMesh(t);
|
|
2223
2388
|
});
|
|
2224
2389
|
break;
|
|
2225
2390
|
case "accessor":
|
|
2226
2391
|
n = this.loadAccessor(t);
|
|
2227
2392
|
break;
|
|
2228
2393
|
case "bufferView":
|
|
2229
|
-
n = this._invokeOne(function(
|
|
2230
|
-
return
|
|
2394
|
+
n = this._invokeOne(function(o) {
|
|
2395
|
+
return o.loadBufferView && o.loadBufferView(t);
|
|
2231
2396
|
});
|
|
2232
2397
|
break;
|
|
2233
2398
|
case "buffer":
|
|
2234
2399
|
n = this.loadBuffer(t);
|
|
2235
2400
|
break;
|
|
2236
2401
|
case "material":
|
|
2237
|
-
n = this._invokeOne(function(
|
|
2238
|
-
return
|
|
2402
|
+
n = this._invokeOne(function(o) {
|
|
2403
|
+
return o.loadMaterial && o.loadMaterial(t);
|
|
2239
2404
|
});
|
|
2240
2405
|
break;
|
|
2241
2406
|
case "texture":
|
|
2242
|
-
n = this._invokeOne(function(
|
|
2243
|
-
return
|
|
2407
|
+
n = this._invokeOne(function(o) {
|
|
2408
|
+
return o.loadTexture && o.loadTexture(t);
|
|
2244
2409
|
});
|
|
2245
2410
|
break;
|
|
2246
2411
|
case "skin":
|
|
2247
2412
|
n = this.loadSkin(t);
|
|
2248
2413
|
break;
|
|
2249
2414
|
case "animation":
|
|
2250
|
-
n = this._invokeOne(function(
|
|
2251
|
-
return
|
|
2415
|
+
n = this._invokeOne(function(o) {
|
|
2416
|
+
return o.loadAnimation && o.loadAnimation(t);
|
|
2252
2417
|
});
|
|
2253
2418
|
break;
|
|
2254
2419
|
case "camera":
|
|
2255
2420
|
n = this.loadCamera(t);
|
|
2256
2421
|
break;
|
|
2257
2422
|
default:
|
|
2258
|
-
if (n = this._invokeOne(function(
|
|
2259
|
-
return
|
|
2423
|
+
if (n = this._invokeOne(function(o) {
|
|
2424
|
+
return o != this && o.getDependency && o.getDependency(e, t);
|
|
2260
2425
|
}), !n)
|
|
2261
2426
|
throw new Error("Unknown type: " + e);
|
|
2262
2427
|
break;
|
|
@@ -2274,8 +2439,8 @@ class hr {
|
|
|
2274
2439
|
let t = this.cache.get(e);
|
|
2275
2440
|
if (!t) {
|
|
2276
2441
|
const s = this, n = this.json[e + (e === "mesh" ? "es" : "s")] || [];
|
|
2277
|
-
t = Promise.all(n.map(function(
|
|
2278
|
-
return s.getDependency(e,
|
|
2442
|
+
t = Promise.all(n.map(function(o, r) {
|
|
2443
|
+
return s.getDependency(e, r);
|
|
2279
2444
|
})), this.cache.add(e, t);
|
|
2280
2445
|
}
|
|
2281
2446
|
return t;
|
|
@@ -2290,11 +2455,11 @@ class hr {
|
|
|
2290
2455
|
if (t.type && t.type !== "arraybuffer")
|
|
2291
2456
|
throw new Error("THREE.GLTFLoader: " + t.type + " buffer type is not supported.");
|
|
2292
2457
|
if (t.uri === void 0 && e === 0)
|
|
2293
|
-
return Promise.resolve(this.extensions[
|
|
2458
|
+
return Promise.resolve(this.extensions[M.KHR_BINARY_GLTF].body);
|
|
2294
2459
|
const n = this.options;
|
|
2295
|
-
return new Promise(function(
|
|
2296
|
-
s.load(
|
|
2297
|
-
|
|
2460
|
+
return new Promise(function(o, r) {
|
|
2461
|
+
s.load(be.resolveURL(t.uri, n.path), o, void 0, function() {
|
|
2462
|
+
r(new Error('THREE.GLTFLoader: Failed to load buffer "' + t.uri + '".'));
|
|
2298
2463
|
});
|
|
2299
2464
|
});
|
|
2300
2465
|
}
|
|
@@ -2306,8 +2471,8 @@ class hr {
|
|
|
2306
2471
|
loadBufferView(e) {
|
|
2307
2472
|
const t = this.json.bufferViews[e];
|
|
2308
2473
|
return this.getDependency("buffer", t.buffer).then(function(s) {
|
|
2309
|
-
const n = t.byteLength || 0,
|
|
2310
|
-
return s.slice(
|
|
2474
|
+
const n = t.byteLength || 0, o = t.byteOffset || 0;
|
|
2475
|
+
return s.slice(o, o + n);
|
|
2311
2476
|
});
|
|
2312
2477
|
}
|
|
2313
2478
|
/**
|
|
@@ -2318,29 +2483,29 @@ class hr {
|
|
|
2318
2483
|
loadAccessor(e) {
|
|
2319
2484
|
const t = this, s = this.json, n = this.json.accessors[e];
|
|
2320
2485
|
if (n.bufferView === void 0 && n.sparse === void 0) {
|
|
2321
|
-
const
|
|
2322
|
-
return Promise.resolve(new
|
|
2486
|
+
const r = ot[n.type], c = ue[n.componentType], i = n.normalized === !0, l = new c(n.count * r);
|
|
2487
|
+
return Promise.resolve(new qe(l, r, i));
|
|
2323
2488
|
}
|
|
2324
|
-
const
|
|
2325
|
-
return n.bufferView !== void 0 ?
|
|
2326
|
-
const c =
|
|
2327
|
-
let
|
|
2328
|
-
if (
|
|
2329
|
-
const f = Math.floor(d /
|
|
2330
|
-
let
|
|
2331
|
-
|
|
2489
|
+
const o = [];
|
|
2490
|
+
return n.bufferView !== void 0 ? o.push(this.getDependency("bufferView", n.bufferView)) : o.push(null), n.sparse !== void 0 && (o.push(this.getDependency("bufferView", n.sparse.indices.bufferView)), o.push(this.getDependency("bufferView", n.sparse.values.bufferView))), Promise.all(o).then(function(r) {
|
|
2491
|
+
const c = r[0], i = ot[n.type], l = ue[n.componentType], h = l.BYTES_PER_ELEMENT, u = h * i, d = n.byteOffset || 0, m = n.bufferView !== void 0 ? s.bufferViews[n.bufferView].byteStride : void 0, A = n.normalized === !0;
|
|
2492
|
+
let g, p;
|
|
2493
|
+
if (m && m !== u) {
|
|
2494
|
+
const f = Math.floor(d / m), v = "InterleavedBuffer:" + n.bufferView + ":" + n.componentType + ":" + f + ":" + n.count;
|
|
2495
|
+
let T = t.cache.get(v);
|
|
2496
|
+
T || (g = new l(c, f * m, n.count * m / h), T = new bn(g, m / h), t.cache.add(v, T)), p = new Mn(T, i, d % m / h, A);
|
|
2332
2497
|
} else
|
|
2333
|
-
c === null ?
|
|
2498
|
+
c === null ? g = new l(n.count * i) : g = new l(c, d, n.count * i), p = new qe(g, i, A);
|
|
2334
2499
|
if (n.sparse !== void 0) {
|
|
2335
|
-
const f =
|
|
2336
|
-
c !== null && (
|
|
2337
|
-
for (let
|
|
2338
|
-
const
|
|
2339
|
-
if (
|
|
2500
|
+
const f = ot.SCALAR, v = ue[n.sparse.indices.componentType], T = n.sparse.indices.byteOffset || 0, b = n.sparse.values.byteOffset || 0, E = new v(r[1], T, n.sparse.count * f), L = new l(r[2], b, n.sparse.count * i);
|
|
2501
|
+
c !== null && (p = new qe(p.array.slice(), p.itemSize, p.normalized)), p.normalized = !1;
|
|
2502
|
+
for (let y = 0, N = E.length; y < N; y++) {
|
|
2503
|
+
const C = E[y];
|
|
2504
|
+
if (p.setX(C, L[y * i]), i >= 2 && p.setY(C, L[y * i + 1]), i >= 3 && p.setZ(C, L[y * i + 2]), i >= 4 && p.setW(C, L[y * i + 3]), i >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
|
|
2340
2505
|
}
|
|
2341
|
-
|
|
2506
|
+
p.normalized = A;
|
|
2342
2507
|
}
|
|
2343
|
-
return
|
|
2508
|
+
return p;
|
|
2344
2509
|
});
|
|
2345
2510
|
}
|
|
2346
2511
|
/**
|
|
@@ -2349,55 +2514,55 @@ class hr {
|
|
|
2349
2514
|
* @return {Promise<THREE.Texture|null>}
|
|
2350
2515
|
*/
|
|
2351
2516
|
loadTexture(e) {
|
|
2352
|
-
const t = this.json, s = this.options,
|
|
2517
|
+
const t = this.json, s = this.options, o = t.textures[e].source, r = t.images[o];
|
|
2353
2518
|
let c = this.textureLoader;
|
|
2354
|
-
if (
|
|
2355
|
-
const
|
|
2356
|
-
|
|
2519
|
+
if (r.uri) {
|
|
2520
|
+
const i = s.manager.getHandler(r.uri);
|
|
2521
|
+
i !== null && (c = i);
|
|
2357
2522
|
}
|
|
2358
|
-
return this.loadTextureImage(e,
|
|
2523
|
+
return this.loadTextureImage(e, o, c);
|
|
2359
2524
|
}
|
|
2360
2525
|
loadTextureImage(e, t, s) {
|
|
2361
|
-
const n = this,
|
|
2362
|
-
if (this.textureCache[
|
|
2363
|
-
return this.textureCache[
|
|
2364
|
-
const l = this.loadImageSource(t, s).then(function(
|
|
2365
|
-
|
|
2366
|
-
const d = (
|
|
2367
|
-
return
|
|
2526
|
+
const n = this, o = this.json, r = o.textures[e], c = o.images[t], i = (c.uri || c.bufferView) + ":" + r.sampler;
|
|
2527
|
+
if (this.textureCache[i])
|
|
2528
|
+
return this.textureCache[i];
|
|
2529
|
+
const l = this.loadImageSource(t, s).then(function(h) {
|
|
2530
|
+
h.flipY = !1, h.name = r.name || c.name || "", h.name === "" && typeof c.uri == "string" && c.uri.startsWith("data:image/") === !1 && (h.name = c.uri);
|
|
2531
|
+
const d = (o.samplers || {})[r.sampler] || {};
|
|
2532
|
+
return h.magFilter = Dt[d.magFilter] || ht, h.minFilter = Dt[d.minFilter] || Yt, h.wrapS = Ut[d.wrapS] || dt, h.wrapT = Ut[d.wrapT] || dt, h.generateMipmaps = !h.isCompressedTexture && h.minFilter !== Wt && h.minFilter !== ht, n.associations.set(h, { textures: e }), h;
|
|
2368
2533
|
}).catch(function() {
|
|
2369
2534
|
return null;
|
|
2370
2535
|
});
|
|
2371
|
-
return this.textureCache[
|
|
2536
|
+
return this.textureCache[i] = l, l;
|
|
2372
2537
|
}
|
|
2373
2538
|
loadImageSource(e, t) {
|
|
2374
|
-
const s = this, n = this.json,
|
|
2539
|
+
const s = this, n = this.json, o = this.options;
|
|
2375
2540
|
if (this.sourceCache[e] !== void 0)
|
|
2376
|
-
return this.sourceCache[e].then((
|
|
2377
|
-
const
|
|
2378
|
-
let
|
|
2379
|
-
if (
|
|
2380
|
-
|
|
2541
|
+
return this.sourceCache[e].then((u) => u.clone());
|
|
2542
|
+
const r = n.images[e], c = self.URL || self.webkitURL;
|
|
2543
|
+
let i = r.uri || "", l = !1;
|
|
2544
|
+
if (r.bufferView !== void 0)
|
|
2545
|
+
i = s.getDependency("bufferView", r.bufferView).then(function(u) {
|
|
2381
2546
|
l = !0;
|
|
2382
|
-
const d = new Blob([
|
|
2383
|
-
return
|
|
2547
|
+
const d = new Blob([u], { type: r.mimeType });
|
|
2548
|
+
return i = c.createObjectURL(d), i;
|
|
2384
2549
|
});
|
|
2385
|
-
else if (
|
|
2550
|
+
else if (r.uri === void 0)
|
|
2386
2551
|
throw new Error("THREE.GLTFLoader: Image " + e + " is missing URI and bufferView");
|
|
2387
|
-
const
|
|
2388
|
-
return new Promise(function(d,
|
|
2389
|
-
let
|
|
2390
|
-
t.isImageBitmapLoader === !0 && (
|
|
2391
|
-
const
|
|
2392
|
-
|
|
2393
|
-
}), t.load(
|
|
2552
|
+
const h = Promise.resolve(i).then(function(u) {
|
|
2553
|
+
return new Promise(function(d, m) {
|
|
2554
|
+
let A = d;
|
|
2555
|
+
t.isImageBitmapLoader === !0 && (A = function(g) {
|
|
2556
|
+
const p = new wt(g);
|
|
2557
|
+
p.needsUpdate = !0, d(p);
|
|
2558
|
+
}), t.load(be.resolveURL(u, o.path), A, void 0, m);
|
|
2394
2559
|
});
|
|
2395
|
-
}).then(function(
|
|
2396
|
-
return l === !0 && c.revokeObjectURL(
|
|
2397
|
-
}).catch(function(
|
|
2398
|
-
throw console.error("THREE.GLTFLoader: Couldn't load texture",
|
|
2560
|
+
}).then(function(u) {
|
|
2561
|
+
return l === !0 && c.revokeObjectURL(i), z(u, r), u.userData.mimeType = r.mimeType || wr(r.uri), u;
|
|
2562
|
+
}).catch(function(u) {
|
|
2563
|
+
throw console.error("THREE.GLTFLoader: Couldn't load texture", i), u;
|
|
2399
2564
|
});
|
|
2400
|
-
return this.sourceCache[e] =
|
|
2565
|
+
return this.sourceCache[e] = h, h;
|
|
2401
2566
|
}
|
|
2402
2567
|
/**
|
|
2403
2568
|
* Asynchronously assigns a texture to the given material parameters.
|
|
@@ -2409,17 +2574,17 @@ class hr {
|
|
|
2409
2574
|
* @return {Promise<Texture>}
|
|
2410
2575
|
*/
|
|
2411
2576
|
assignTexture(e, t, s, n) {
|
|
2412
|
-
const
|
|
2413
|
-
return this.getDependency("texture", s.index).then(function(
|
|
2414
|
-
if (!
|
|
2415
|
-
if (s.texCoord !== void 0 && s.texCoord > 0 && (
|
|
2416
|
-
const c = s.extensions !== void 0 ? s.extensions[
|
|
2577
|
+
const o = this;
|
|
2578
|
+
return this.getDependency("texture", s.index).then(function(r) {
|
|
2579
|
+
if (!r) return null;
|
|
2580
|
+
if (s.texCoord !== void 0 && s.texCoord > 0 && (r = r.clone(), r.channel = s.texCoord), o.extensions[M.KHR_TEXTURE_TRANSFORM]) {
|
|
2581
|
+
const c = s.extensions !== void 0 ? s.extensions[M.KHR_TEXTURE_TRANSFORM] : void 0;
|
|
2417
2582
|
if (c) {
|
|
2418
|
-
const
|
|
2419
|
-
|
|
2583
|
+
const i = o.associations.get(r);
|
|
2584
|
+
r = o.extensions[M.KHR_TEXTURE_TRANSFORM].extendTexture(r, c), o.associations.set(r, i);
|
|
2420
2585
|
}
|
|
2421
2586
|
}
|
|
2422
|
-
return n !== void 0 && (
|
|
2587
|
+
return n !== void 0 && (r.colorSpace = n), e[t] = r, r;
|
|
2423
2588
|
});
|
|
2424
2589
|
}
|
|
2425
2590
|
/**
|
|
@@ -2433,26 +2598,26 @@ class hr {
|
|
|
2433
2598
|
assignFinalMaterial(e) {
|
|
2434
2599
|
const t = e.geometry;
|
|
2435
2600
|
let s = e.material;
|
|
2436
|
-
const n = t.attributes.tangent === void 0,
|
|
2601
|
+
const n = t.attributes.tangent === void 0, o = t.attributes.color !== void 0, r = t.attributes.normal === void 0;
|
|
2437
2602
|
if (e.isPoints) {
|
|
2438
2603
|
const c = "PointsMaterial:" + s.uuid;
|
|
2439
|
-
let
|
|
2440
|
-
|
|
2604
|
+
let i = this.cache.get(c);
|
|
2605
|
+
i || (i = new _n(), Ze.prototype.copy.call(i, s), i.color.copy(s.color), i.map = s.map, i.sizeAttenuation = !1, this.cache.add(c, i)), s = i;
|
|
2441
2606
|
} else if (e.isLine) {
|
|
2442
2607
|
const c = "LineBasicMaterial:" + s.uuid;
|
|
2443
|
-
let
|
|
2444
|
-
|
|
2608
|
+
let i = this.cache.get(c);
|
|
2609
|
+
i || (i = new Ln(), Ze.prototype.copy.call(i, s), i.color.copy(s.color), i.map = s.map, this.cache.add(c, i)), s = i;
|
|
2445
2610
|
}
|
|
2446
|
-
if (n ||
|
|
2611
|
+
if (n || o || r) {
|
|
2447
2612
|
let c = "ClonedMaterial:" + s.uuid + ":";
|
|
2448
|
-
n && (c += "derivative-tangents:"),
|
|
2449
|
-
let
|
|
2450
|
-
|
|
2613
|
+
n && (c += "derivative-tangents:"), o && (c += "vertex-colors:"), r && (c += "flat-shading:");
|
|
2614
|
+
let i = this.cache.get(c);
|
|
2615
|
+
i || (i = s.clone(), o && (i.vertexColors = !0), r && (i.flatShading = !0), n && (i.normalScale && (i.normalScale.y *= -1), i.clearcoatNormalScale && (i.clearcoatNormalScale.y *= -1)), this.cache.add(c, i), this.associations.set(i, this.associations.get(s))), s = i;
|
|
2451
2616
|
}
|
|
2452
2617
|
e.material = s;
|
|
2453
2618
|
}
|
|
2454
2619
|
getMaterialType() {
|
|
2455
|
-
return
|
|
2620
|
+
return Vt;
|
|
2456
2621
|
}
|
|
2457
2622
|
/**
|
|
2458
2623
|
* Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials
|
|
@@ -2460,37 +2625,37 @@ class hr {
|
|
|
2460
2625
|
* @return {Promise<Material>}
|
|
2461
2626
|
*/
|
|
2462
2627
|
loadMaterial(e) {
|
|
2463
|
-
const t = this, s = this.json, n = this.extensions,
|
|
2464
|
-
let
|
|
2465
|
-
const c = {},
|
|
2466
|
-
if (
|
|
2467
|
-
const
|
|
2468
|
-
|
|
2628
|
+
const t = this, s = this.json, n = this.extensions, o = s.materials[e];
|
|
2629
|
+
let r;
|
|
2630
|
+
const c = {}, i = o.extensions || {}, l = [];
|
|
2631
|
+
if (i[M.KHR_MATERIALS_UNLIT]) {
|
|
2632
|
+
const u = n[M.KHR_MATERIALS_UNLIT];
|
|
2633
|
+
r = u.getMaterialType(), l.push(u.extendParams(c, o, t));
|
|
2469
2634
|
} else {
|
|
2470
|
-
const
|
|
2471
|
-
if (c.color = new
|
|
2472
|
-
const d =
|
|
2473
|
-
c.color.setRGB(d[0], d[1], d[2],
|
|
2635
|
+
const u = o.pbrMetallicRoughness || {};
|
|
2636
|
+
if (c.color = new oe(1, 1, 1), c.opacity = 1, Array.isArray(u.baseColorFactor)) {
|
|
2637
|
+
const d = u.baseColorFactor;
|
|
2638
|
+
c.color.setRGB(d[0], d[1], d[2], Z), c.opacity = d[3];
|
|
2474
2639
|
}
|
|
2475
|
-
|
|
2640
|
+
u.baseColorTexture !== void 0 && l.push(t.assignTexture(c, "map", u.baseColorTexture, Me)), c.metalness = u.metallicFactor !== void 0 ? u.metallicFactor : 1, c.roughness = u.roughnessFactor !== void 0 ? u.roughnessFactor : 1, u.metallicRoughnessTexture !== void 0 && (l.push(t.assignTexture(c, "metalnessMap", u.metallicRoughnessTexture)), l.push(t.assignTexture(c, "roughnessMap", u.metallicRoughnessTexture))), r = this._invokeOne(function(d) {
|
|
2476
2641
|
return d.getMaterialType && d.getMaterialType(e);
|
|
2477
2642
|
}), l.push(Promise.all(this._invokeAll(function(d) {
|
|
2478
2643
|
return d.extendMaterialParams && d.extendMaterialParams(e, c);
|
|
2479
2644
|
})));
|
|
2480
2645
|
}
|
|
2481
|
-
|
|
2482
|
-
const
|
|
2483
|
-
if (
|
|
2484
|
-
const
|
|
2485
|
-
c.normalScale.set(
|
|
2646
|
+
o.doubleSided === !0 && (c.side = Fe);
|
|
2647
|
+
const h = o.alphaMode || at.OPAQUE;
|
|
2648
|
+
if (h === at.BLEND ? (c.transparent = !0, c.depthWrite = !1) : (c.transparent = !1, h === at.MASK && (c.alphaTest = o.alphaCutoff !== void 0 ? o.alphaCutoff : 0.5)), o.normalTexture !== void 0 && r !== Te && (l.push(t.assignTexture(c, "normalMap", o.normalTexture)), c.normalScale = new Xt(1, 1), o.normalTexture.scale !== void 0)) {
|
|
2649
|
+
const u = o.normalTexture.scale;
|
|
2650
|
+
c.normalScale.set(u, u);
|
|
2486
2651
|
}
|
|
2487
|
-
if (
|
|
2488
|
-
const
|
|
2489
|
-
c.emissive = new
|
|
2652
|
+
if (o.occlusionTexture !== void 0 && r !== Te && (l.push(t.assignTexture(c, "aoMap", o.occlusionTexture)), o.occlusionTexture.strength !== void 0 && (c.aoMapIntensity = o.occlusionTexture.strength)), o.emissiveFactor !== void 0 && r !== Te) {
|
|
2653
|
+
const u = o.emissiveFactor;
|
|
2654
|
+
c.emissive = new oe().setRGB(u[0], u[1], u[2], Z);
|
|
2490
2655
|
}
|
|
2491
|
-
return
|
|
2492
|
-
const
|
|
2493
|
-
return
|
|
2656
|
+
return o.emissiveTexture !== void 0 && r !== Te && l.push(t.assignTexture(c, "emissiveMap", o.emissiveTexture, Me)), Promise.all(l).then(function() {
|
|
2657
|
+
const u = new r(c);
|
|
2658
|
+
return o.name && (u.name = o.name), z(u, o), t.associations.set(u, { materials: e }), o.extensions && te(n, u, o), u;
|
|
2494
2659
|
});
|
|
2495
2660
|
}
|
|
2496
2661
|
/**
|
|
@@ -2500,7 +2665,7 @@ class hr {
|
|
|
2500
2665
|
* @return {String}
|
|
2501
2666
|
*/
|
|
2502
2667
|
createUniqueName(e) {
|
|
2503
|
-
const t =
|
|
2668
|
+
const t = Cn.sanitizeNodeName(e || "");
|
|
2504
2669
|
return t in this.nodeNamesUsed ? t + "_" + ++this.nodeNamesUsed[t] : (this.nodeNamesUsed[t] = 0, t);
|
|
2505
2670
|
}
|
|
2506
2671
|
/**
|
|
@@ -2513,22 +2678,22 @@ class hr {
|
|
|
2513
2678
|
*/
|
|
2514
2679
|
loadGeometries(e) {
|
|
2515
2680
|
const t = this, s = this.extensions, n = this.primitiveCache;
|
|
2516
|
-
function
|
|
2517
|
-
return s[
|
|
2518
|
-
return
|
|
2681
|
+
function o(c) {
|
|
2682
|
+
return s[M.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(c, t).then(function(i) {
|
|
2683
|
+
return Bt(i, c, t);
|
|
2519
2684
|
});
|
|
2520
2685
|
}
|
|
2521
|
-
const
|
|
2522
|
-
for (let c = 0,
|
|
2523
|
-
const l = e[c],
|
|
2524
|
-
if (
|
|
2525
|
-
|
|
2686
|
+
const r = [];
|
|
2687
|
+
for (let c = 0, i = e.length; c < i; c++) {
|
|
2688
|
+
const l = e[c], h = Er(l), u = n[h];
|
|
2689
|
+
if (u)
|
|
2690
|
+
r.push(u.promise);
|
|
2526
2691
|
else {
|
|
2527
2692
|
let d;
|
|
2528
|
-
l.extensions && l.extensions[
|
|
2693
|
+
l.extensions && l.extensions[M.KHR_DRACO_MESH_COMPRESSION] ? d = o(l) : d = Bt(new In(), l, t), n[h] = { primitive: l, promise: d }, r.push(d);
|
|
2529
2694
|
}
|
|
2530
2695
|
}
|
|
2531
|
-
return Promise.all(
|
|
2696
|
+
return Promise.all(r);
|
|
2532
2697
|
}
|
|
2533
2698
|
/**
|
|
2534
2699
|
* Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#meshes
|
|
@@ -2536,42 +2701,42 @@ class hr {
|
|
|
2536
2701
|
* @return {Promise<Group|Mesh|SkinnedMesh>}
|
|
2537
2702
|
*/
|
|
2538
2703
|
loadMesh(e) {
|
|
2539
|
-
const t = this, s = this.json, n = this.extensions,
|
|
2540
|
-
for (let
|
|
2541
|
-
const
|
|
2542
|
-
c.push(
|
|
2704
|
+
const t = this, s = this.json, n = this.extensions, o = s.meshes[e], r = o.primitives, c = [];
|
|
2705
|
+
for (let i = 0, l = r.length; i < l; i++) {
|
|
2706
|
+
const h = r[i].material === void 0 ? br(this.cache) : this.getDependency("material", r[i].material);
|
|
2707
|
+
c.push(h);
|
|
2543
2708
|
}
|
|
2544
|
-
return c.push(t.loadGeometries(
|
|
2545
|
-
const l =
|
|
2546
|
-
for (let
|
|
2547
|
-
const
|
|
2709
|
+
return c.push(t.loadGeometries(r)), Promise.all(c).then(function(i) {
|
|
2710
|
+
const l = i.slice(0, i.length - 1), h = i[i.length - 1], u = [];
|
|
2711
|
+
for (let m = 0, A = h.length; m < A; m++) {
|
|
2712
|
+
const g = h[m], p = r[m];
|
|
2548
2713
|
let f;
|
|
2549
|
-
const
|
|
2550
|
-
if (
|
|
2551
|
-
f =
|
|
2552
|
-
else if (
|
|
2553
|
-
f = new
|
|
2554
|
-
else if (
|
|
2555
|
-
f = new
|
|
2556
|
-
else if (
|
|
2557
|
-
f = new
|
|
2558
|
-
else if (
|
|
2559
|
-
f = new
|
|
2714
|
+
const v = l[m];
|
|
2715
|
+
if (p.mode === H.TRIANGLES || p.mode === H.TRIANGLE_STRIP || p.mode === H.TRIANGLE_FAN || p.mode === void 0)
|
|
2716
|
+
f = o.isSkinnedMesh === !0 ? new Pn(g, v) : new Nn(g, v), f.isSkinnedMesh === !0 && f.normalizeSkinWeights(), p.mode === H.TRIANGLE_STRIP ? f.geometry = kt(f.geometry, Ht) : p.mode === H.TRIANGLE_FAN && (f.geometry = kt(f.geometry, ut));
|
|
2717
|
+
else if (p.mode === H.LINES)
|
|
2718
|
+
f = new Fn(g, v);
|
|
2719
|
+
else if (p.mode === H.LINE_STRIP)
|
|
2720
|
+
f = new kn(g, v);
|
|
2721
|
+
else if (p.mode === H.LINE_LOOP)
|
|
2722
|
+
f = new On(g, v);
|
|
2723
|
+
else if (p.mode === H.POINTS)
|
|
2724
|
+
f = new Dn(g, v);
|
|
2560
2725
|
else
|
|
2561
|
-
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " +
|
|
2562
|
-
Object.keys(f.geometry.morphAttributes).length > 0 &&
|
|
2726
|
+
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + p.mode);
|
|
2727
|
+
Object.keys(f.geometry.morphAttributes).length > 0 && Rr(f, o), f.name = t.createUniqueName(o.name || "mesh_" + e), z(f, o), p.extensions && te(n, f, p), t.assignFinalMaterial(f), u.push(f);
|
|
2563
2728
|
}
|
|
2564
|
-
for (let
|
|
2565
|
-
t.associations.set(
|
|
2729
|
+
for (let m = 0, A = u.length; m < A; m++)
|
|
2730
|
+
t.associations.set(u[m], {
|
|
2566
2731
|
meshes: e,
|
|
2567
|
-
primitives:
|
|
2732
|
+
primitives: m
|
|
2568
2733
|
});
|
|
2569
|
-
if (
|
|
2570
|
-
return
|
|
2571
|
-
const d = new
|
|
2572
|
-
|
|
2573
|
-
for (let
|
|
2574
|
-
d.add(
|
|
2734
|
+
if (u.length === 1)
|
|
2735
|
+
return o.extensions && te(n, u[0], o), u[0];
|
|
2736
|
+
const d = new Qe();
|
|
2737
|
+
o.extensions && te(n, d, o), t.associations.set(d, { meshes: e });
|
|
2738
|
+
for (let m = 0, A = u.length; m < A; m++)
|
|
2739
|
+
d.add(u[m]);
|
|
2575
2740
|
return d;
|
|
2576
2741
|
});
|
|
2577
2742
|
}
|
|
@@ -2587,7 +2752,7 @@ class hr {
|
|
|
2587
2752
|
console.warn("THREE.GLTFLoader: Missing camera parameters.");
|
|
2588
2753
|
return;
|
|
2589
2754
|
}
|
|
2590
|
-
return s.type === "perspective" ? t = new
|
|
2755
|
+
return s.type === "perspective" ? t = new Un(Bn.radToDeg(n.yfov), n.aspectRatio || 1, n.znear || 1, n.zfar || 2e6) : s.type === "orthographic" && (t = new Hn(-n.xmag, n.xmag, n.ymag, -n.ymag, n.znear, n.zfar)), s.name && (t.name = this.createUniqueName(s.name)), z(t, s), Promise.resolve(t);
|
|
2591
2756
|
}
|
|
2592
2757
|
/**
|
|
2593
2758
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins
|
|
@@ -2596,20 +2761,20 @@ class hr {
|
|
|
2596
2761
|
*/
|
|
2597
2762
|
loadSkin(e) {
|
|
2598
2763
|
const t = this.json.skins[e], s = [];
|
|
2599
|
-
for (let n = 0,
|
|
2764
|
+
for (let n = 0, o = t.joints.length; n < o; n++)
|
|
2600
2765
|
s.push(this._loadNodeShallow(t.joints[n]));
|
|
2601
2766
|
return t.inverseBindMatrices !== void 0 ? s.push(this.getDependency("accessor", t.inverseBindMatrices)) : s.push(null), Promise.all(s).then(function(n) {
|
|
2602
|
-
const
|
|
2603
|
-
for (let l = 0,
|
|
2604
|
-
const
|
|
2605
|
-
if (
|
|
2606
|
-
c.push(
|
|
2607
|
-
const d = new
|
|
2608
|
-
|
|
2767
|
+
const o = n.pop(), r = n, c = [], i = [];
|
|
2768
|
+
for (let l = 0, h = r.length; l < h; l++) {
|
|
2769
|
+
const u = r[l];
|
|
2770
|
+
if (u) {
|
|
2771
|
+
c.push(u);
|
|
2772
|
+
const d = new Oe();
|
|
2773
|
+
o !== null && d.fromArray(o.array, l * 16), i.push(d);
|
|
2609
2774
|
} else
|
|
2610
2775
|
console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', t.joints[l]);
|
|
2611
2776
|
}
|
|
2612
|
-
return new
|
|
2777
|
+
return new Gn(c, i);
|
|
2613
2778
|
});
|
|
2614
2779
|
}
|
|
2615
2780
|
/**
|
|
@@ -2618,40 +2783,40 @@ class hr {
|
|
|
2618
2783
|
* @return {Promise<AnimationClip>}
|
|
2619
2784
|
*/
|
|
2620
2785
|
loadAnimation(e) {
|
|
2621
|
-
const t = this.json, s = this, n = t.animations[e],
|
|
2622
|
-
for (let
|
|
2623
|
-
const
|
|
2624
|
-
|
|
2786
|
+
const t = this.json, s = this, n = t.animations[e], o = n.name ? n.name : "animation_" + e, r = [], c = [], i = [], l = [], h = [];
|
|
2787
|
+
for (let u = 0, d = n.channels.length; u < d; u++) {
|
|
2788
|
+
const m = n.channels[u], A = n.samplers[m.sampler], g = m.target, p = g.node, f = n.parameters !== void 0 ? n.parameters[A.input] : A.input, v = n.parameters !== void 0 ? n.parameters[A.output] : A.output;
|
|
2789
|
+
g.node !== void 0 && (r.push(this.getDependency("node", p)), c.push(this.getDependency("accessor", f)), i.push(this.getDependency("accessor", v)), l.push(A), h.push(g));
|
|
2625
2790
|
}
|
|
2626
2791
|
return Promise.all([
|
|
2627
|
-
Promise.all(
|
|
2792
|
+
Promise.all(r),
|
|
2628
2793
|
Promise.all(c),
|
|
2629
|
-
Promise.all(
|
|
2794
|
+
Promise.all(i),
|
|
2630
2795
|
Promise.all(l),
|
|
2631
|
-
Promise.all(
|
|
2632
|
-
]).then(function(
|
|
2633
|
-
const d =
|
|
2634
|
-
for (let
|
|
2635
|
-
const b = d[
|
|
2796
|
+
Promise.all(h)
|
|
2797
|
+
]).then(function(u) {
|
|
2798
|
+
const d = u[0], m = u[1], A = u[2], g = u[3], p = u[4], f = [];
|
|
2799
|
+
for (let v = 0, T = d.length; v < T; v++) {
|
|
2800
|
+
const b = d[v], E = m[v], L = A[v], y = g[v], N = p[v];
|
|
2636
2801
|
if (b === void 0) continue;
|
|
2637
2802
|
b.updateMatrix && b.updateMatrix();
|
|
2638
|
-
const
|
|
2639
|
-
if (
|
|
2640
|
-
for (let
|
|
2641
|
-
f.push(
|
|
2803
|
+
const C = s._createAnimationTracks(b, E, L, y, N);
|
|
2804
|
+
if (C)
|
|
2805
|
+
for (let I = 0; I < C.length; I++)
|
|
2806
|
+
f.push(C[I]);
|
|
2642
2807
|
}
|
|
2643
|
-
return new
|
|
2808
|
+
return new Xn(o, void 0, f);
|
|
2644
2809
|
});
|
|
2645
2810
|
}
|
|
2646
2811
|
createNodeMesh(e) {
|
|
2647
2812
|
const t = this.json, s = this, n = t.nodes[e];
|
|
2648
|
-
return n.mesh === void 0 ? null : s.getDependency("mesh", n.mesh).then(function(
|
|
2649
|
-
const
|
|
2650
|
-
return n.weights !== void 0 &&
|
|
2813
|
+
return n.mesh === void 0 ? null : s.getDependency("mesh", n.mesh).then(function(o) {
|
|
2814
|
+
const r = s._getNodeRef(s.meshCache, n.mesh, o);
|
|
2815
|
+
return n.weights !== void 0 && r.traverse(function(c) {
|
|
2651
2816
|
if (c.isMesh)
|
|
2652
|
-
for (let
|
|
2653
|
-
c.morphTargetInfluences[
|
|
2654
|
-
}),
|
|
2817
|
+
for (let i = 0, l = n.weights.length; i < l; i++)
|
|
2818
|
+
c.morphTargetInfluences[i] = n.weights[i];
|
|
2819
|
+
}), r;
|
|
2655
2820
|
});
|
|
2656
2821
|
}
|
|
2657
2822
|
/**
|
|
@@ -2660,22 +2825,22 @@ class hr {
|
|
|
2660
2825
|
* @return {Promise<Object3D>}
|
|
2661
2826
|
*/
|
|
2662
2827
|
loadNode(e) {
|
|
2663
|
-
const t = this.json, s = this, n = t.nodes[e],
|
|
2664
|
-
for (let l = 0,
|
|
2665
|
-
|
|
2666
|
-
const
|
|
2828
|
+
const t = this.json, s = this, n = t.nodes[e], o = s._loadNodeShallow(e), r = [], c = n.children || [];
|
|
2829
|
+
for (let l = 0, h = c.length; l < h; l++)
|
|
2830
|
+
r.push(s.getDependency("node", c[l]));
|
|
2831
|
+
const i = n.skin === void 0 ? Promise.resolve(null) : s.getDependency("skin", n.skin);
|
|
2667
2832
|
return Promise.all([
|
|
2668
|
-
|
|
2669
|
-
Promise.all(
|
|
2670
|
-
|
|
2833
|
+
o,
|
|
2834
|
+
Promise.all(r),
|
|
2835
|
+
i
|
|
2671
2836
|
]).then(function(l) {
|
|
2672
|
-
const
|
|
2673
|
-
d !== null &&
|
|
2674
|
-
|
|
2837
|
+
const h = l[0], u = l[1], d = l[2];
|
|
2838
|
+
d !== null && h.traverse(function(m) {
|
|
2839
|
+
m.isSkinnedMesh && m.bind(d, Sr);
|
|
2675
2840
|
});
|
|
2676
|
-
for (let
|
|
2677
|
-
|
|
2678
|
-
return
|
|
2841
|
+
for (let m = 0, A = u.length; m < A; m++)
|
|
2842
|
+
h.add(u[m]);
|
|
2843
|
+
return h;
|
|
2679
2844
|
});
|
|
2680
2845
|
}
|
|
2681
2846
|
// ._loadNodeShallow() parses a single node.
|
|
@@ -2684,26 +2849,26 @@ class hr {
|
|
|
2684
2849
|
const t = this.json, s = this.extensions, n = this;
|
|
2685
2850
|
if (this.nodeCache[e] !== void 0)
|
|
2686
2851
|
return this.nodeCache[e];
|
|
2687
|
-
const
|
|
2852
|
+
const o = t.nodes[e], r = o.name ? n.createUniqueName(o.name) : "", c = [], i = n._invokeOne(function(l) {
|
|
2688
2853
|
return l.createNodeMesh && l.createNodeMesh(e);
|
|
2689
2854
|
});
|
|
2690
|
-
return
|
|
2691
|
-
return n._getNodeRef(n.cameraCache,
|
|
2855
|
+
return i && c.push(i), o.camera !== void 0 && c.push(n.getDependency("camera", o.camera).then(function(l) {
|
|
2856
|
+
return n._getNodeRef(n.cameraCache, o.camera, l);
|
|
2692
2857
|
})), n._invokeAll(function(l) {
|
|
2693
2858
|
return l.createNodeAttachment && l.createNodeAttachment(e);
|
|
2694
2859
|
}).forEach(function(l) {
|
|
2695
2860
|
c.push(l);
|
|
2696
2861
|
}), this.nodeCache[e] = Promise.all(c).then(function(l) {
|
|
2697
|
-
let
|
|
2698
|
-
if (
|
|
2699
|
-
for (let
|
|
2700
|
-
|
|
2701
|
-
if (
|
|
2702
|
-
const
|
|
2703
|
-
|
|
2862
|
+
let h;
|
|
2863
|
+
if (o.isBone === !0 ? h = new jn() : l.length > 1 ? h = new Qe() : l.length === 1 ? h = l[0] : h = new Kt(), h !== l[0])
|
|
2864
|
+
for (let u = 0, d = l.length; u < d; u++)
|
|
2865
|
+
h.add(l[u]);
|
|
2866
|
+
if (o.name && (h.userData.name = o.name, h.name = r), z(h, o), o.extensions && te(s, h, o), o.matrix !== void 0) {
|
|
2867
|
+
const u = new Oe();
|
|
2868
|
+
u.fromArray(o.matrix), h.applyMatrix4(u);
|
|
2704
2869
|
} else
|
|
2705
|
-
|
|
2706
|
-
return n.associations.has(
|
|
2870
|
+
o.translation !== void 0 && h.position.fromArray(o.translation), o.rotation !== void 0 && h.quaternion.fromArray(o.rotation), o.scale !== void 0 && h.scale.fromArray(o.scale);
|
|
2871
|
+
return n.associations.has(h) || n.associations.set(h, {}), n.associations.get(h).nodes = e, h;
|
|
2707
2872
|
}), this.nodeCache[e];
|
|
2708
2873
|
}
|
|
2709
2874
|
/**
|
|
@@ -2712,96 +2877,96 @@ class hr {
|
|
|
2712
2877
|
* @return {Promise<Group>}
|
|
2713
2878
|
*/
|
|
2714
2879
|
loadScene(e) {
|
|
2715
|
-
const t = this.extensions, s = this.json.scenes[e], n = this,
|
|
2716
|
-
s.name && (
|
|
2717
|
-
const
|
|
2718
|
-
for (let
|
|
2719
|
-
c.push(n.getDependency("node",
|
|
2720
|
-
return Promise.all(c).then(function(
|
|
2721
|
-
for (let
|
|
2722
|
-
|
|
2723
|
-
const l = (
|
|
2724
|
-
const
|
|
2725
|
-
for (const [d,
|
|
2726
|
-
(d instanceof
|
|
2727
|
-
return
|
|
2728
|
-
const
|
|
2729
|
-
|
|
2730
|
-
}),
|
|
2880
|
+
const t = this.extensions, s = this.json.scenes[e], n = this, o = new Qe();
|
|
2881
|
+
s.name && (o.name = n.createUniqueName(s.name)), z(o, s), s.extensions && te(t, o, s);
|
|
2882
|
+
const r = s.nodes || [], c = [];
|
|
2883
|
+
for (let i = 0, l = r.length; i < l; i++)
|
|
2884
|
+
c.push(n.getDependency("node", r[i]));
|
|
2885
|
+
return Promise.all(c).then(function(i) {
|
|
2886
|
+
for (let h = 0, u = i.length; h < u; h++)
|
|
2887
|
+
o.add(i[h]);
|
|
2888
|
+
const l = (h) => {
|
|
2889
|
+
const u = /* @__PURE__ */ new Map();
|
|
2890
|
+
for (const [d, m] of n.associations)
|
|
2891
|
+
(d instanceof Ze || d instanceof wt) && u.set(d, m);
|
|
2892
|
+
return h.traverse((d) => {
|
|
2893
|
+
const m = n.associations.get(d);
|
|
2894
|
+
m != null && u.set(d, m);
|
|
2895
|
+
}), u;
|
|
2731
2896
|
};
|
|
2732
|
-
return n.associations = l(
|
|
2897
|
+
return n.associations = l(o), o;
|
|
2733
2898
|
});
|
|
2734
2899
|
}
|
|
2735
|
-
_createAnimationTracks(e, t, s, n,
|
|
2736
|
-
const
|
|
2737
|
-
Q[
|
|
2738
|
-
d.morphTargetInfluences &&
|
|
2739
|
-
}) :
|
|
2900
|
+
_createAnimationTracks(e, t, s, n, o) {
|
|
2901
|
+
const r = [], c = e.name ? e.name : e.uuid, i = [];
|
|
2902
|
+
Q[o.path] === Q.weights ? e.traverse(function(d) {
|
|
2903
|
+
d.morphTargetInfluences && i.push(d.name ? d.name : d.uuid);
|
|
2904
|
+
}) : i.push(c);
|
|
2740
2905
|
let l;
|
|
2741
|
-
switch (Q[
|
|
2906
|
+
switch (Q[o.path]) {
|
|
2742
2907
|
case Q.weights:
|
|
2743
|
-
l =
|
|
2908
|
+
l = yt;
|
|
2744
2909
|
break;
|
|
2745
2910
|
case Q.rotation:
|
|
2746
|
-
l =
|
|
2911
|
+
l = _t;
|
|
2747
2912
|
break;
|
|
2748
2913
|
case Q.position:
|
|
2749
2914
|
case Q.scale:
|
|
2750
|
-
l =
|
|
2915
|
+
l = St;
|
|
2751
2916
|
break;
|
|
2752
2917
|
default:
|
|
2753
2918
|
switch (s.itemSize) {
|
|
2754
2919
|
case 1:
|
|
2755
|
-
l =
|
|
2920
|
+
l = yt;
|
|
2756
2921
|
break;
|
|
2757
2922
|
case 2:
|
|
2758
2923
|
case 3:
|
|
2759
2924
|
default:
|
|
2760
|
-
l =
|
|
2925
|
+
l = St;
|
|
2761
2926
|
break;
|
|
2762
2927
|
}
|
|
2763
2928
|
break;
|
|
2764
2929
|
}
|
|
2765
|
-
const
|
|
2766
|
-
for (let d = 0,
|
|
2767
|
-
const
|
|
2768
|
-
|
|
2930
|
+
const h = n.interpolation !== void 0 ? xr[n.interpolation] : zt, u = this._getArrayFromAccessor(s);
|
|
2931
|
+
for (let d = 0, m = i.length; d < m; d++) {
|
|
2932
|
+
const A = new l(
|
|
2933
|
+
i[d] + "." + Q[o.path],
|
|
2769
2934
|
t.array,
|
|
2770
|
-
|
|
2771
|
-
|
|
2935
|
+
u,
|
|
2936
|
+
h
|
|
2772
2937
|
);
|
|
2773
|
-
n.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(
|
|
2938
|
+
n.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(A), r.push(A);
|
|
2774
2939
|
}
|
|
2775
|
-
return
|
|
2940
|
+
return r;
|
|
2776
2941
|
}
|
|
2777
2942
|
_getArrayFromAccessor(e) {
|
|
2778
2943
|
let t = e.array;
|
|
2779
2944
|
if (e.normalized) {
|
|
2780
|
-
const s =
|
|
2781
|
-
for (let
|
|
2782
|
-
n[
|
|
2945
|
+
const s = pt(t.constructor), n = new Float32Array(t.length);
|
|
2946
|
+
for (let o = 0, r = t.length; o < r; o++)
|
|
2947
|
+
n[o] = t[o] * s;
|
|
2783
2948
|
t = n;
|
|
2784
2949
|
}
|
|
2785
2950
|
return t;
|
|
2786
2951
|
}
|
|
2787
2952
|
_createCubicSplineTrackInterpolant(e) {
|
|
2788
2953
|
e.createInterpolant = function(s) {
|
|
2789
|
-
const n = this instanceof
|
|
2954
|
+
const n = this instanceof _t ? Tr : tn;
|
|
2790
2955
|
return new n(this.times, this.values, this.getValueSize() / 3, s);
|
|
2791
2956
|
}, e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0;
|
|
2792
2957
|
}
|
|
2793
2958
|
}
|
|
2794
|
-
function
|
|
2795
|
-
const s = e.attributes, n = new
|
|
2959
|
+
function _r(a, e, t) {
|
|
2960
|
+
const s = e.attributes, n = new Vn();
|
|
2796
2961
|
if (s.POSITION !== void 0) {
|
|
2797
|
-
const c = t.json.accessors[s.POSITION],
|
|
2798
|
-
if (
|
|
2962
|
+
const c = t.json.accessors[s.POSITION], i = c.min, l = c.max;
|
|
2963
|
+
if (i !== void 0 && l !== void 0) {
|
|
2799
2964
|
if (n.set(
|
|
2800
|
-
new
|
|
2801
|
-
new
|
|
2965
|
+
new se(i[0], i[1], i[2]),
|
|
2966
|
+
new se(l[0], l[1], l[2])
|
|
2802
2967
|
), c.normalized) {
|
|
2803
|
-
const
|
|
2804
|
-
n.min.multiplyScalar(
|
|
2968
|
+
const h = pt(ue[c.componentType]);
|
|
2969
|
+
n.min.multiplyScalar(h), n.max.multiplyScalar(h);
|
|
2805
2970
|
}
|
|
2806
2971
|
} else {
|
|
2807
2972
|
console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");
|
|
@@ -2809,120 +2974,120 @@ function dr(i, e, t) {
|
|
|
2809
2974
|
}
|
|
2810
2975
|
} else
|
|
2811
2976
|
return;
|
|
2812
|
-
const
|
|
2813
|
-
if (
|
|
2814
|
-
const c = new
|
|
2815
|
-
for (let l = 0,
|
|
2816
|
-
const
|
|
2817
|
-
if (
|
|
2818
|
-
const d = t.json.accessors[
|
|
2819
|
-
if (
|
|
2820
|
-
if (
|
|
2821
|
-
const
|
|
2822
|
-
|
|
2977
|
+
const o = e.targets;
|
|
2978
|
+
if (o !== void 0) {
|
|
2979
|
+
const c = new se(), i = new se();
|
|
2980
|
+
for (let l = 0, h = o.length; l < h; l++) {
|
|
2981
|
+
const u = o[l];
|
|
2982
|
+
if (u.POSITION !== void 0) {
|
|
2983
|
+
const d = t.json.accessors[u.POSITION], m = d.min, A = d.max;
|
|
2984
|
+
if (m !== void 0 && A !== void 0) {
|
|
2985
|
+
if (i.setX(Math.max(Math.abs(m[0]), Math.abs(A[0]))), i.setY(Math.max(Math.abs(m[1]), Math.abs(A[1]))), i.setZ(Math.max(Math.abs(m[2]), Math.abs(A[2]))), d.normalized) {
|
|
2986
|
+
const g = pt(ue[d.componentType]);
|
|
2987
|
+
i.multiplyScalar(g);
|
|
2823
2988
|
}
|
|
2824
|
-
c.max(
|
|
2989
|
+
c.max(i);
|
|
2825
2990
|
} else
|
|
2826
2991
|
console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");
|
|
2827
2992
|
}
|
|
2828
2993
|
}
|
|
2829
2994
|
n.expandByVector(c);
|
|
2830
2995
|
}
|
|
2831
|
-
|
|
2832
|
-
const
|
|
2833
|
-
n.getCenter(
|
|
2996
|
+
a.boundingBox = n;
|
|
2997
|
+
const r = new zn();
|
|
2998
|
+
n.getCenter(r.center), r.radius = n.min.distanceTo(n.max) / 2, a.boundingSphere = r;
|
|
2834
2999
|
}
|
|
2835
|
-
function
|
|
3000
|
+
function Bt(a, e, t) {
|
|
2836
3001
|
const s = e.attributes, n = [];
|
|
2837
|
-
function r
|
|
2838
|
-
return t.getDependency("accessor",
|
|
2839
|
-
|
|
3002
|
+
function o(r, c) {
|
|
3003
|
+
return t.getDependency("accessor", r).then(function(i) {
|
|
3004
|
+
a.setAttribute(c, i);
|
|
2840
3005
|
});
|
|
2841
3006
|
}
|
|
2842
|
-
for (const
|
|
2843
|
-
const c =
|
|
2844
|
-
c in
|
|
3007
|
+
for (const r in s) {
|
|
3008
|
+
const c = mt[r] || r.toLowerCase();
|
|
3009
|
+
c in a.attributes || n.push(o(s[r], c));
|
|
2845
3010
|
}
|
|
2846
|
-
if (e.indices !== void 0 && !
|
|
2847
|
-
const
|
|
2848
|
-
|
|
3011
|
+
if (e.indices !== void 0 && !a.index) {
|
|
3012
|
+
const r = t.getDependency("accessor", e.indices).then(function(c) {
|
|
3013
|
+
a.setIndex(c);
|
|
2849
3014
|
});
|
|
2850
|
-
n.push(
|
|
3015
|
+
n.push(r);
|
|
2851
3016
|
}
|
|
2852
|
-
return
|
|
2853
|
-
return e.targets !== void 0 ?
|
|
3017
|
+
return Lt.workingColorSpace !== Z && "COLOR_0" in s && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Lt.workingColorSpace}" not supported.`), z(a, e), _r(a, e, t), Promise.all(n).then(function() {
|
|
3018
|
+
return e.targets !== void 0 ? Mr(a, e.targets, t) : a;
|
|
2854
3019
|
});
|
|
2855
3020
|
}
|
|
2856
|
-
const
|
|
2857
|
-
const e =
|
|
3021
|
+
const ke = [0, 0, -10], re = [0.5, 0.5, 0.5], nn = 1, ct = /* @__PURE__ */ new Map(), Lr = (a) => {
|
|
3022
|
+
const e = ct.get(a);
|
|
2858
3023
|
if (e) return e;
|
|
2859
|
-
const t = new
|
|
2860
|
-
(n) => new Promise((
|
|
2861
|
-
t.parse(n, "",
|
|
3024
|
+
const t = new zs(), s = Zt(a).then(
|
|
3025
|
+
(n) => new Promise((o, r) => {
|
|
3026
|
+
t.parse(n, "", o, r);
|
|
2862
3027
|
})
|
|
2863
3028
|
).catch((n) => {
|
|
2864
|
-
throw
|
|
3029
|
+
throw ct.delete(a), n;
|
|
2865
3030
|
});
|
|
2866
|
-
return
|
|
2867
|
-
},
|
|
2868
|
-
position:
|
|
3031
|
+
return ct.set(a, s), s;
|
|
3032
|
+
}, sn = ({
|
|
3033
|
+
position: a,
|
|
2869
3034
|
rotation: e,
|
|
2870
3035
|
scale: t,
|
|
2871
3036
|
url: s,
|
|
2872
3037
|
showDebugMaterial: n = !1,
|
|
2873
|
-
opacity:
|
|
3038
|
+
opacity: o = nn
|
|
2874
3039
|
}) => {
|
|
2875
|
-
const
|
|
3040
|
+
const r = s ?? new URL("/assets/xr/3d-models/head-occluder-v2.glb", De.assetStorageEndpoint).toString(), [c, i] = gt(null);
|
|
2876
3041
|
$(() => {
|
|
2877
|
-
let
|
|
2878
|
-
return
|
|
2879
|
-
|
|
2880
|
-
}).catch((
|
|
2881
|
-
|
|
3042
|
+
let h = !1;
|
|
3043
|
+
return Lr(r).then((u) => {
|
|
3044
|
+
h || i(u.scene);
|
|
3045
|
+
}).catch((u) => {
|
|
3046
|
+
h || console.error(`${De.loggerPrefix} head occluder load failed`, u);
|
|
2882
3047
|
}), () => {
|
|
2883
|
-
|
|
3048
|
+
h = !0;
|
|
2884
3049
|
};
|
|
2885
|
-
}, [
|
|
2886
|
-
const l =
|
|
3050
|
+
}, [r]);
|
|
3051
|
+
const l = W(() => {
|
|
2887
3052
|
if (!c) return null;
|
|
2888
|
-
const
|
|
2889
|
-
return
|
|
2890
|
-
|
|
3053
|
+
const h = c.clone();
|
|
3054
|
+
return h.traverse((u) => {
|
|
3055
|
+
u instanceof R.Mesh && (u.material = new R.MeshStandardMaterial({
|
|
2891
3056
|
color: 15132390,
|
|
2892
3057
|
colorWrite: n,
|
|
2893
3058
|
depthWrite: !0,
|
|
2894
|
-
opacity: n ?
|
|
3059
|
+
opacity: n ? o : 1,
|
|
2895
3060
|
side: R.DoubleSide,
|
|
2896
3061
|
transparent: n
|
|
2897
3062
|
}));
|
|
2898
|
-
}),
|
|
2899
|
-
}, [c, n,
|
|
3063
|
+
}), h;
|
|
3064
|
+
}, [c, n, o]);
|
|
2900
3065
|
return $(() => {
|
|
2901
3066
|
if (l)
|
|
2902
3067
|
return () => {
|
|
2903
|
-
l.traverse((
|
|
2904
|
-
|
|
3068
|
+
l.traverse((h) => {
|
|
3069
|
+
h instanceof R.Mesh && h.material.dispose();
|
|
2905
3070
|
});
|
|
2906
3071
|
};
|
|
2907
|
-
}, [l]), l ? (
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
3072
|
+
}, [l]), l ? (a ? l.position.set(a[0], a[1], a[2]) : l.position.set(
|
|
3073
|
+
ke[0],
|
|
3074
|
+
ke[1],
|
|
3075
|
+
ke[2]
|
|
2911
3076
|
), e && l.rotation.set(e[0], e[1], e[2]), t ? l.scale.set(t[0], t[1], t[2]) : l.scale.set(
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
), l.renderOrder = -1, /* @__PURE__ */
|
|
2916
|
-
},
|
|
2917
|
-
children:
|
|
3077
|
+
re[0],
|
|
3078
|
+
re[1],
|
|
3079
|
+
re[2]
|
|
3080
|
+
), l.renderOrder = -1, /* @__PURE__ */ x("primitive", { object: l })) : null;
|
|
3081
|
+
}, Cr = 4, co = ({
|
|
3082
|
+
children: a,
|
|
2918
3083
|
faceIndex: e = 0,
|
|
2919
|
-
numFaces: t =
|
|
3084
|
+
numFaces: t = Cr,
|
|
2920
3085
|
scaleWithFace: s = !0,
|
|
2921
3086
|
occluder: n = !0,
|
|
2922
|
-
showFaceMesh:
|
|
2923
|
-
faceMeshMaterial:
|
|
3087
|
+
showFaceMesh: o = !1,
|
|
3088
|
+
faceMeshMaterial: r
|
|
2924
3089
|
}) => {
|
|
2925
|
-
const c =
|
|
3090
|
+
const c = W(
|
|
2926
3091
|
() => new R.MeshBasicMaterial({
|
|
2927
3092
|
color: "#22c55e",
|
|
2928
3093
|
side: R.BackSide,
|
|
@@ -2931,60 +3096,60 @@ const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new M
|
|
|
2931
3096
|
depthWrite: !1
|
|
2932
3097
|
}),
|
|
2933
3098
|
[]
|
|
2934
|
-
),
|
|
2935
|
-
return /* @__PURE__ */
|
|
2936
|
-
|
|
2937
|
-
|
|
3099
|
+
), i = n === !1 ? null : n === !0 ? {} : n;
|
|
3100
|
+
return /* @__PURE__ */ S(es, { faceIndex: e, numFaces: t, scaleWithFace: s, children: [
|
|
3101
|
+
i && /* @__PURE__ */ x(
|
|
3102
|
+
sn,
|
|
2938
3103
|
{
|
|
2939
|
-
position:
|
|
2940
|
-
rotation:
|
|
2941
|
-
scale:
|
|
2942
|
-
url:
|
|
2943
|
-
showDebugMaterial:
|
|
2944
|
-
opacity:
|
|
3104
|
+
position: i.position ?? ke,
|
|
3105
|
+
rotation: i.rotation,
|
|
3106
|
+
scale: i.scale ?? re,
|
|
3107
|
+
url: i.url,
|
|
3108
|
+
showDebugMaterial: i.showDebugMaterial,
|
|
3109
|
+
opacity: i.opacity ?? nn
|
|
2945
3110
|
}
|
|
2946
3111
|
),
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
3112
|
+
a,
|
|
3113
|
+
o && /* @__PURE__ */ x(
|
|
3114
|
+
ts,
|
|
2950
3115
|
{
|
|
2951
3116
|
faceIndex: e,
|
|
2952
3117
|
numFaces: t,
|
|
2953
|
-
material:
|
|
3118
|
+
material: r ?? c
|
|
2954
3119
|
}
|
|
2955
3120
|
)
|
|
2956
3121
|
] });
|
|
2957
|
-
},
|
|
2958
|
-
eyeMidX:
|
|
3122
|
+
}, Ir = 57, Pr = 15.5, lt = Ir / Math.PI / Pr, Nr = -0.134, Fr = -0.024, q = (a, e, t) => Math.min(t, Math.max(e, a)), rn = (a, e) => a * e - e / 2, on = (a, e) => -(a * e - e / 2), kr = ({
|
|
3123
|
+
eyeMidX: a,
|
|
2959
3124
|
noseX: e,
|
|
2960
3125
|
offsetX: t,
|
|
2961
3126
|
rawYaw: s,
|
|
2962
3127
|
sideMidX: n
|
|
2963
3128
|
}) => {
|
|
2964
|
-
const
|
|
2965
|
-
return
|
|
2966
|
-
},
|
|
2967
|
-
baseScale:
|
|
3129
|
+
const o = q((Math.abs(s) - 0.18) / 0.42, 0, 1), r = n * 0.75 + a * 0.25, c = a * 0.7 + e * 0.3;
|
|
3130
|
+
return r * (1 - o) + c * o + t;
|
|
3131
|
+
}, lo = ({
|
|
3132
|
+
baseScale: a,
|
|
2968
3133
|
pitchRadians: e
|
|
2969
3134
|
}) => {
|
|
2970
|
-
const t = e * 180 / Math.PI, n = 1 +
|
|
2971
|
-
return [
|
|
2972
|
-
},
|
|
2973
|
-
const e = Math.abs(
|
|
2974
|
-
return Math.sign(
|
|
2975
|
-
},
|
|
2976
|
-
pitchRadians:
|
|
3135
|
+
const t = e * 180 / Math.PI, n = 1 + q((t - 6) / 22, 0, 1) * 0.22;
|
|
3136
|
+
return [a[0] * n, a[1] * n, a[2] * n];
|
|
3137
|
+
}, uo = ({ yawRadians: a }) => {
|
|
3138
|
+
const e = Math.abs(a * 180 / Math.PI), s = 0.066 * q((e - 8) / 12, 0, 1);
|
|
3139
|
+
return Math.sign(a) * s;
|
|
3140
|
+
}, ho = ({
|
|
3141
|
+
pitchRadians: a
|
|
2977
3142
|
}) => {
|
|
2978
|
-
const e =
|
|
2979
|
-
return -0.026 *
|
|
2980
|
-
},
|
|
2981
|
-
baseOffset:
|
|
3143
|
+
const e = a * 180 / Math.PI;
|
|
3144
|
+
return -0.026 * q((-e - 6) / 18, 0, 1);
|
|
3145
|
+
}, fo = ({
|
|
3146
|
+
baseOffset: a,
|
|
2982
3147
|
yawRadians: e
|
|
2983
3148
|
}) => {
|
|
2984
|
-
const t = Math.abs(e * 180 / Math.PI), s =
|
|
2985
|
-
return
|
|
2986
|
-
},
|
|
2987
|
-
baseOffsetY:
|
|
3149
|
+
const t = Math.abs(e * 180 / Math.PI), s = q((t - 8) / 24, 0, 1);
|
|
3150
|
+
return a + s * 0.25;
|
|
3151
|
+
}, mo = ({
|
|
3152
|
+
baseOffsetY: a,
|
|
2988
3153
|
baseScaleY: e,
|
|
2989
3154
|
face: t
|
|
2990
3155
|
}) => {
|
|
@@ -2993,167 +3158,167 @@ const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new M
|
|
|
2993
3158
|
aspectRatio: 0,
|
|
2994
3159
|
normalizedAspect: 0,
|
|
2995
3160
|
scaleY: e,
|
|
2996
|
-
offsetY:
|
|
3161
|
+
offsetY: a
|
|
2997
3162
|
};
|
|
2998
|
-
const s = t.bounds.height / t.bounds.width, n =
|
|
3163
|
+
const s = t.bounds.height / t.bounds.width, n = q((s - 1.55) / 0.35, -1, 1);
|
|
2999
3164
|
return {
|
|
3000
3165
|
aspectRatio: s,
|
|
3001
3166
|
normalizedAspect: n,
|
|
3002
3167
|
scaleY: e + n * 0.06,
|
|
3003
|
-
offsetY:
|
|
3168
|
+
offsetY: a + n * 5e-3
|
|
3004
3169
|
};
|
|
3005
|
-
},
|
|
3006
|
-
face:
|
|
3170
|
+
}, Or = ({
|
|
3171
|
+
face: a,
|
|
3007
3172
|
offsetX: e,
|
|
3008
3173
|
offsetY: t,
|
|
3009
3174
|
scaleX: s,
|
|
3010
3175
|
scaleY: n
|
|
3011
3176
|
}) => {
|
|
3012
|
-
const
|
|
3177
|
+
const o = a.bounds.width * s, r = a.bounds.height * n, c = a.bounds.centerX + e, i = a.bounds.centerY + t;
|
|
3013
3178
|
return {
|
|
3014
|
-
x: c -
|
|
3015
|
-
y:
|
|
3016
|
-
width:
|
|
3017
|
-
height:
|
|
3179
|
+
x: c - o * 0.5,
|
|
3180
|
+
y: i - r * 0.5,
|
|
3181
|
+
width: o,
|
|
3182
|
+
height: r,
|
|
3018
3183
|
centerX: c,
|
|
3019
|
-
centerY:
|
|
3184
|
+
centerY: i
|
|
3020
3185
|
};
|
|
3021
|
-
},
|
|
3022
|
-
face:
|
|
3186
|
+
}, Dr = ({
|
|
3187
|
+
face: a,
|
|
3023
3188
|
height: e,
|
|
3024
3189
|
lockDepth: t,
|
|
3025
3190
|
lockRotation: s,
|
|
3026
3191
|
model: n,
|
|
3027
|
-
offsetX:
|
|
3028
|
-
offsetY:
|
|
3192
|
+
offsetX: o,
|
|
3193
|
+
offsetY: r,
|
|
3029
3194
|
scaleX: c,
|
|
3030
|
-
scaleY:
|
|
3195
|
+
scaleY: i,
|
|
3031
3196
|
scaleZ: l,
|
|
3032
|
-
width:
|
|
3197
|
+
width: h
|
|
3033
3198
|
}) => {
|
|
3034
|
-
const
|
|
3035
|
-
face:
|
|
3036
|
-
offsetX:
|
|
3037
|
-
offsetY:
|
|
3199
|
+
const u = Or({
|
|
3200
|
+
face: a,
|
|
3201
|
+
offsetX: o,
|
|
3202
|
+
offsetY: r,
|
|
3038
3203
|
scaleX: c,
|
|
3039
|
-
scaleY:
|
|
3040
|
-
}), d =
|
|
3041
|
-
eyeMidX:
|
|
3042
|
-
noseX: (
|
|
3043
|
-
offsetX:
|
|
3044
|
-
rawYaw:
|
|
3045
|
-
sideMidX:
|
|
3046
|
-
}),
|
|
3047
|
-
(
|
|
3204
|
+
scaleY: i
|
|
3205
|
+
}), d = a.landmarks[33], m = a.landmarks[263], A = a.landmarks[234], g = a.landmarks[454], p = a.landmarks[1], f = a.landmarks[10], v = a.landmarks[152], T = u.width * h, b = u.height * e, E = d && m ? (d.x + m.x) * 0.5 : a.bounds.centerX, L = d && m ? (d.y + m.y) * 0.5 : a.bounds.centerY - a.bounds.height * 0.15, y = A && g ? (A.x + g.x) * 0.5 : E, N = (f == null ? void 0 : f.y) ?? a.bounds.minY, C = (v == null ? void 0 : v.y) ?? a.bounds.maxY, I = (N + C) * 0.5, O = d && m ? Math.atan2(m.y - d.y, m.x - d.x) : 0, F = p && a.bounds.width > 0 ? q((p.x - a.bounds.centerX) / (a.bounds.width * 0.5), -1, 1) * 0.75 : 0, _ = kr({
|
|
3206
|
+
eyeMidX: E,
|
|
3207
|
+
noseX: (p == null ? void 0 : p.x) ?? E,
|
|
3208
|
+
offsetX: o,
|
|
3209
|
+
rawYaw: F,
|
|
3210
|
+
sideMidX: y
|
|
3211
|
+
}), w = I * 0.75 + L * 0.25 + r, he = n === "v2" ? rn(_, h) : u.centerX * h - h / 2, G = n === "v2" ? on(a.bounds.centerY + r * 0.75, e) : -(u.centerY * e - e / 2), J = f && p ? Math.max(1e-4, p.y - f.y) : a.bounds.height * 0.42, Re = p && v ? Math.max(1e-4, v.y - p.y) : a.bounds.height * 0.58, de = (Re - J) / (Re + J), fe = q((de - Nr) / 0.28, -1, 1) * 0.58, me = p && a.bounds.height > 0 ? q(
|
|
3212
|
+
(a.bounds.centerY - p.y) / (a.bounds.height * 0.5) - Fr,
|
|
3048
3213
|
-1,
|
|
3049
3214
|
1
|
|
3050
|
-
) * 0.18 : 0,
|
|
3215
|
+
) * 0.18 : 0, ae = fe * 0.82 + me * 0.18, pe = s ? 0 : n === "v2" ? F * 0.72 : F, Ee = s ? 0 : n === "v2" ? -ae * 0.78 : -ae, we = s ? 0 : -O, Se = t ? T * lt : n === "v2" ? T * (lt + Math.abs(pe) * 0.18) : T * lt;
|
|
3051
3216
|
return {
|
|
3052
|
-
centerXPx:
|
|
3053
|
-
centerYPx:
|
|
3054
|
-
depthPx:
|
|
3217
|
+
centerXPx: he,
|
|
3218
|
+
centerYPx: G,
|
|
3219
|
+
depthPx: Se * l,
|
|
3055
3220
|
heightPx: b,
|
|
3056
|
-
pitch:
|
|
3057
|
-
rawPitch:
|
|
3058
|
-
rawPitchFromBalance:
|
|
3059
|
-
rawPitchFromCenter:
|
|
3060
|
-
rawYaw:
|
|
3061
|
-
rotationZ:
|
|
3062
|
-
roll:
|
|
3063
|
-
shape:
|
|
3064
|
-
skullAnchorX:
|
|
3065
|
-
skullAnchorY:
|
|
3066
|
-
verticalBalance:
|
|
3067
|
-
widthPx:
|
|
3068
|
-
yaw:
|
|
3221
|
+
pitch: Ee,
|
|
3222
|
+
rawPitch: ae,
|
|
3223
|
+
rawPitchFromBalance: fe,
|
|
3224
|
+
rawPitchFromCenter: me,
|
|
3225
|
+
rawYaw: F,
|
|
3226
|
+
rotationZ: we,
|
|
3227
|
+
roll: O,
|
|
3228
|
+
shape: u,
|
|
3229
|
+
skullAnchorX: _,
|
|
3230
|
+
skullAnchorY: w,
|
|
3231
|
+
verticalBalance: de,
|
|
3232
|
+
widthPx: T,
|
|
3233
|
+
yaw: pe
|
|
3069
3234
|
};
|
|
3070
|
-
},
|
|
3071
|
-
lockDepth:
|
|
3235
|
+
}, Ur = ({
|
|
3236
|
+
lockDepth: a,
|
|
3072
3237
|
lockRotation: e,
|
|
3073
3238
|
model: t,
|
|
3074
3239
|
face: s,
|
|
3075
3240
|
height: n,
|
|
3076
|
-
headDepthOffset:
|
|
3077
|
-
offsetX:
|
|
3241
|
+
headDepthOffset: o,
|
|
3242
|
+
offsetX: r,
|
|
3078
3243
|
offsetY: c,
|
|
3079
|
-
rotationOffsetX:
|
|
3244
|
+
rotationOffsetX: i,
|
|
3080
3245
|
rotationOffsetY: l,
|
|
3081
|
-
rotationOffsetZ:
|
|
3082
|
-
scaleX:
|
|
3246
|
+
rotationOffsetZ: h,
|
|
3247
|
+
scaleX: u,
|
|
3083
3248
|
scaleY: d,
|
|
3084
|
-
scaleZ:
|
|
3085
|
-
skullCenterMode:
|
|
3086
|
-
skullVerticalBias:
|
|
3087
|
-
width:
|
|
3088
|
-
}) =>
|
|
3089
|
-
lockDepth:
|
|
3249
|
+
scaleZ: m,
|
|
3250
|
+
skullCenterMode: A,
|
|
3251
|
+
skullVerticalBias: g,
|
|
3252
|
+
width: p
|
|
3253
|
+
}) => an({
|
|
3254
|
+
lockDepth: a,
|
|
3090
3255
|
lockRotation: e,
|
|
3091
3256
|
model: t,
|
|
3092
3257
|
face: s,
|
|
3093
3258
|
height: n,
|
|
3094
|
-
headDepthOffset:
|
|
3095
|
-
offsetX:
|
|
3259
|
+
headDepthOffset: o,
|
|
3260
|
+
offsetX: r,
|
|
3096
3261
|
offsetY: c,
|
|
3097
|
-
rotationOffsetX:
|
|
3262
|
+
rotationOffsetX: i,
|
|
3098
3263
|
rotationOffsetY: l,
|
|
3099
|
-
rotationOffsetZ:
|
|
3100
|
-
scaleX:
|
|
3264
|
+
rotationOffsetZ: h,
|
|
3265
|
+
scaleX: u,
|
|
3101
3266
|
scaleY: d,
|
|
3102
|
-
scaleZ:
|
|
3103
|
-
skullCenterMode:
|
|
3104
|
-
skullVerticalBias:
|
|
3105
|
-
width:
|
|
3106
|
-
}).pose,
|
|
3107
|
-
lockDepth:
|
|
3267
|
+
scaleZ: m,
|
|
3268
|
+
skullCenterMode: A,
|
|
3269
|
+
skullVerticalBias: g,
|
|
3270
|
+
width: p
|
|
3271
|
+
}).pose, an = ({
|
|
3272
|
+
lockDepth: a,
|
|
3108
3273
|
lockRotation: e,
|
|
3109
3274
|
model: t,
|
|
3110
3275
|
face: s,
|
|
3111
3276
|
height: n,
|
|
3112
|
-
headDepthOffset:
|
|
3113
|
-
offsetX:
|
|
3277
|
+
headDepthOffset: o,
|
|
3278
|
+
offsetX: r,
|
|
3114
3279
|
offsetY: c,
|
|
3115
|
-
rotationOffsetX:
|
|
3280
|
+
rotationOffsetX: i,
|
|
3116
3281
|
rotationOffsetY: l,
|
|
3117
|
-
rotationOffsetZ:
|
|
3118
|
-
scaleX:
|
|
3282
|
+
rotationOffsetZ: h,
|
|
3283
|
+
scaleX: u,
|
|
3119
3284
|
scaleY: d,
|
|
3120
|
-
scaleZ:
|
|
3121
|
-
skullCenterMode:
|
|
3122
|
-
skullVerticalBias:
|
|
3123
|
-
width:
|
|
3285
|
+
scaleZ: m,
|
|
3286
|
+
skullCenterMode: A,
|
|
3287
|
+
skullVerticalBias: g,
|
|
3288
|
+
width: p
|
|
3124
3289
|
}) => {
|
|
3125
|
-
const f =
|
|
3290
|
+
const f = Dr({
|
|
3126
3291
|
face: s,
|
|
3127
3292
|
height: n,
|
|
3128
|
-
lockDepth:
|
|
3293
|
+
lockDepth: a,
|
|
3129
3294
|
lockRotation: e,
|
|
3130
3295
|
model: t,
|
|
3131
|
-
offsetX:
|
|
3296
|
+
offsetX: r,
|
|
3132
3297
|
offsetY: c,
|
|
3133
|
-
scaleX:
|
|
3298
|
+
scaleX: u,
|
|
3134
3299
|
scaleY: d,
|
|
3135
|
-
scaleZ:
|
|
3136
|
-
width:
|
|
3300
|
+
scaleZ: m,
|
|
3301
|
+
width: p
|
|
3137
3302
|
});
|
|
3138
|
-
if (
|
|
3139
|
-
const
|
|
3303
|
+
if (A) {
|
|
3304
|
+
const T = new se(
|
|
3140
3305
|
0,
|
|
3141
|
-
f.heightPx *
|
|
3142
|
-
-f.depthPx *
|
|
3306
|
+
f.heightPx * g,
|
|
3307
|
+
-f.depthPx * o
|
|
3143
3308
|
).applyEuler(
|
|
3144
|
-
new
|
|
3145
|
-
), b =
|
|
3309
|
+
new qn(f.pitch, f.yaw, f.rotationZ, "XYZ")
|
|
3310
|
+
), b = rn(f.skullAnchorX, p), E = on(f.skullAnchorY, n);
|
|
3146
3311
|
return {
|
|
3147
3312
|
pose: {
|
|
3148
|
-
boxCenterZ:
|
|
3149
|
-
centerX: b +
|
|
3150
|
-
centerY:
|
|
3313
|
+
boxCenterZ: T.z,
|
|
3314
|
+
centerX: b + T.x,
|
|
3315
|
+
centerY: E + T.y,
|
|
3151
3316
|
width: f.widthPx,
|
|
3152
3317
|
height: f.heightPx,
|
|
3153
3318
|
depth: f.depthPx,
|
|
3154
|
-
rotationX: f.pitch +
|
|
3319
|
+
rotationX: f.pitch + i,
|
|
3155
3320
|
rotationY: f.yaw + l,
|
|
3156
|
-
rotationZ: f.rotationZ +
|
|
3321
|
+
rotationZ: f.rotationZ + h
|
|
3157
3322
|
},
|
|
3158
3323
|
debugMetrics: {
|
|
3159
3324
|
face: {
|
|
@@ -3173,18 +3338,18 @@ const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new M
|
|
|
3173
3338
|
pose: {
|
|
3174
3339
|
pitch: f.pitch,
|
|
3175
3340
|
yaw: f.yaw,
|
|
3176
|
-
rotationX: f.pitch +
|
|
3341
|
+
rotationX: f.pitch + i,
|
|
3177
3342
|
rotationY: f.yaw + l,
|
|
3178
|
-
rotationZ: f.rotationZ +
|
|
3343
|
+
rotationZ: f.rotationZ + h
|
|
3179
3344
|
},
|
|
3180
3345
|
skullAnchor: {
|
|
3181
3346
|
x: f.skullAnchorX,
|
|
3182
3347
|
y: f.skullAnchorY
|
|
3183
3348
|
},
|
|
3184
3349
|
center: {
|
|
3185
|
-
x: b +
|
|
3186
|
-
y:
|
|
3187
|
-
z:
|
|
3350
|
+
x: b + T.x,
|
|
3351
|
+
y: E + T.y,
|
|
3352
|
+
z: T.z
|
|
3188
3353
|
},
|
|
3189
3354
|
depthPx: f.depthPx,
|
|
3190
3355
|
screen: {
|
|
@@ -3196,15 +3361,15 @@ const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new M
|
|
|
3196
3361
|
}
|
|
3197
3362
|
return {
|
|
3198
3363
|
pose: {
|
|
3199
|
-
boxCenterZ: -f.depthPx *
|
|
3364
|
+
boxCenterZ: -f.depthPx * o,
|
|
3200
3365
|
centerX: f.centerXPx,
|
|
3201
3366
|
centerY: f.centerYPx,
|
|
3202
3367
|
width: f.widthPx,
|
|
3203
3368
|
height: f.heightPx,
|
|
3204
3369
|
depth: f.depthPx,
|
|
3205
|
-
rotationX: f.pitch +
|
|
3370
|
+
rotationX: f.pitch + i,
|
|
3206
3371
|
rotationY: f.yaw + l,
|
|
3207
|
-
rotationZ: f.rotationZ +
|
|
3372
|
+
rotationZ: f.rotationZ + h
|
|
3208
3373
|
},
|
|
3209
3374
|
debugMetrics: {
|
|
3210
3375
|
face: {
|
|
@@ -3224,9 +3389,9 @@ const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new M
|
|
|
3224
3389
|
pose: {
|
|
3225
3390
|
pitch: f.pitch,
|
|
3226
3391
|
yaw: f.yaw,
|
|
3227
|
-
rotationX: f.pitch +
|
|
3392
|
+
rotationX: f.pitch + i,
|
|
3228
3393
|
rotationY: f.yaw + l,
|
|
3229
|
-
rotationZ: f.rotationZ +
|
|
3394
|
+
rotationZ: f.rotationZ + h
|
|
3230
3395
|
},
|
|
3231
3396
|
skullAnchor: {
|
|
3232
3397
|
x: f.skullAnchorX,
|
|
@@ -3235,7 +3400,7 @@ const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new M
|
|
|
3235
3400
|
center: {
|
|
3236
3401
|
x: f.centerXPx,
|
|
3237
3402
|
y: f.centerYPx,
|
|
3238
|
-
z: -f.depthPx *
|
|
3403
|
+
z: -f.depthPx * o
|
|
3239
3404
|
},
|
|
3240
3405
|
depthPx: f.depthPx,
|
|
3241
3406
|
screen: {
|
|
@@ -3244,151 +3409,151 @@ const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new M
|
|
|
3244
3409
|
}
|
|
3245
3410
|
}
|
|
3246
3411
|
};
|
|
3247
|
-
},
|
|
3248
|
-
lockDepth:
|
|
3412
|
+
}, po = ({
|
|
3413
|
+
lockDepth: a,
|
|
3249
3414
|
lockRotation: e,
|
|
3250
3415
|
model: t,
|
|
3251
3416
|
face: s,
|
|
3252
3417
|
height: n,
|
|
3253
|
-
headDepthOffset:
|
|
3254
|
-
offsetX:
|
|
3418
|
+
headDepthOffset: o,
|
|
3419
|
+
offsetX: r,
|
|
3255
3420
|
offsetY: c,
|
|
3256
|
-
rotationOffsetX:
|
|
3421
|
+
rotationOffsetX: i,
|
|
3257
3422
|
rotationOffsetY: l,
|
|
3258
|
-
rotationOffsetZ:
|
|
3259
|
-
scaleX:
|
|
3423
|
+
rotationOffsetZ: h,
|
|
3424
|
+
scaleX: u,
|
|
3260
3425
|
scaleY: d,
|
|
3261
|
-
scaleZ:
|
|
3262
|
-
skullCenterMode:
|
|
3263
|
-
skullVerticalBias:
|
|
3264
|
-
width:
|
|
3265
|
-
}) =>
|
|
3266
|
-
lockDepth:
|
|
3426
|
+
scaleZ: m,
|
|
3427
|
+
skullCenterMode: A,
|
|
3428
|
+
skullVerticalBias: g,
|
|
3429
|
+
width: p
|
|
3430
|
+
}) => an({
|
|
3431
|
+
lockDepth: a,
|
|
3267
3432
|
lockRotation: e,
|
|
3268
3433
|
model: t,
|
|
3269
3434
|
face: s,
|
|
3270
3435
|
height: n,
|
|
3271
|
-
headDepthOffset:
|
|
3272
|
-
offsetX:
|
|
3436
|
+
headDepthOffset: o,
|
|
3437
|
+
offsetX: r,
|
|
3273
3438
|
offsetY: c,
|
|
3274
|
-
rotationOffsetX:
|
|
3439
|
+
rotationOffsetX: i,
|
|
3275
3440
|
rotationOffsetY: l,
|
|
3276
|
-
rotationOffsetZ:
|
|
3277
|
-
scaleX:
|
|
3441
|
+
rotationOffsetZ: h,
|
|
3442
|
+
scaleX: u,
|
|
3278
3443
|
scaleY: d,
|
|
3279
|
-
scaleZ:
|
|
3280
|
-
skullCenterMode:
|
|
3281
|
-
skullVerticalBias:
|
|
3282
|
-
width:
|
|
3283
|
-
}).debugMetrics,
|
|
3284
|
-
boxColor:
|
|
3444
|
+
scaleZ: m,
|
|
3445
|
+
skullCenterMode: A,
|
|
3446
|
+
skullVerticalBias: g,
|
|
3447
|
+
width: p
|
|
3448
|
+
}).debugMetrics, go = ({
|
|
3449
|
+
boxColor: a,
|
|
3285
3450
|
boxOpacity: e,
|
|
3286
3451
|
face: t,
|
|
3287
3452
|
headDepthOffset: s,
|
|
3288
3453
|
lockDepth: n,
|
|
3289
|
-
lockRotation:
|
|
3290
|
-
model:
|
|
3454
|
+
lockRotation: o,
|
|
3455
|
+
model: r,
|
|
3291
3456
|
occluderOffset: c,
|
|
3292
|
-
occluderOpacity:
|
|
3457
|
+
occluderOpacity: i,
|
|
3293
3458
|
occluderScale: l,
|
|
3294
|
-
showOccluderProxy:
|
|
3295
|
-
offsetX:
|
|
3459
|
+
showOccluderProxy: h = !1,
|
|
3460
|
+
offsetX: u,
|
|
3296
3461
|
offsetY: d,
|
|
3297
|
-
pose:
|
|
3298
|
-
rotationOffsetX:
|
|
3299
|
-
rotationOffsetY:
|
|
3300
|
-
rotationOffsetZ:
|
|
3462
|
+
pose: m,
|
|
3463
|
+
rotationOffsetX: A,
|
|
3464
|
+
rotationOffsetY: g,
|
|
3465
|
+
rotationOffsetZ: p,
|
|
3301
3466
|
scaleX: f,
|
|
3302
|
-
scaleY:
|
|
3303
|
-
scaleZ:
|
|
3467
|
+
scaleY: v,
|
|
3468
|
+
scaleZ: T,
|
|
3304
3469
|
show: b,
|
|
3305
|
-
showCenterDot:
|
|
3470
|
+
showCenterDot: E,
|
|
3306
3471
|
showFacePlaneReference: L,
|
|
3307
|
-
showGizmo:
|
|
3308
|
-
showHeadOccluder:
|
|
3309
|
-
skullCenterMode:
|
|
3310
|
-
skullVerticalBias:
|
|
3311
|
-
url:
|
|
3312
|
-
viewportHeight:
|
|
3313
|
-
viewportWidth:
|
|
3472
|
+
showGizmo: y,
|
|
3473
|
+
showHeadOccluder: N,
|
|
3474
|
+
skullCenterMode: C,
|
|
3475
|
+
skullVerticalBias: I,
|
|
3476
|
+
url: O,
|
|
3477
|
+
viewportHeight: F,
|
|
3478
|
+
viewportWidth: _
|
|
3314
3479
|
}) => {
|
|
3315
|
-
const
|
|
3480
|
+
const w = W(() => m || (!t || _ <= 0 || F <= 0 ? null : Ur({
|
|
3316
3481
|
face: t,
|
|
3317
|
-
width:
|
|
3318
|
-
height:
|
|
3482
|
+
width: _,
|
|
3483
|
+
height: F,
|
|
3319
3484
|
headDepthOffset: s,
|
|
3320
3485
|
lockDepth: n,
|
|
3321
|
-
lockRotation:
|
|
3322
|
-
model:
|
|
3323
|
-
offsetX:
|
|
3486
|
+
lockRotation: o,
|
|
3487
|
+
model: r,
|
|
3488
|
+
offsetX: u,
|
|
3324
3489
|
offsetY: d,
|
|
3325
|
-
rotationOffsetX:
|
|
3326
|
-
rotationOffsetY:
|
|
3327
|
-
rotationOffsetZ:
|
|
3490
|
+
rotationOffsetX: A,
|
|
3491
|
+
rotationOffsetY: g,
|
|
3492
|
+
rotationOffsetZ: p,
|
|
3328
3493
|
scaleX: f,
|
|
3329
|
-
scaleY:
|
|
3330
|
-
scaleZ:
|
|
3331
|
-
skullCenterMode:
|
|
3332
|
-
skullVerticalBias:
|
|
3494
|
+
scaleY: v,
|
|
3495
|
+
scaleZ: T,
|
|
3496
|
+
skullCenterMode: C,
|
|
3497
|
+
skullVerticalBias: I
|
|
3333
3498
|
})), [
|
|
3334
3499
|
t,
|
|
3335
3500
|
s,
|
|
3336
3501
|
n,
|
|
3337
|
-
r,
|
|
3338
3502
|
o,
|
|
3339
|
-
|
|
3503
|
+
r,
|
|
3504
|
+
u,
|
|
3340
3505
|
d,
|
|
3341
|
-
g,
|
|
3342
3506
|
A,
|
|
3343
|
-
|
|
3507
|
+
g,
|
|
3508
|
+
p,
|
|
3344
3509
|
f,
|
|
3345
|
-
x,
|
|
3346
3510
|
v,
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
p,
|
|
3511
|
+
T,
|
|
3512
|
+
C,
|
|
3350
3513
|
I,
|
|
3351
|
-
|
|
3514
|
+
m,
|
|
3515
|
+
F,
|
|
3516
|
+
_
|
|
3352
3517
|
]);
|
|
3353
|
-
if (!b || !
|
|
3354
|
-
const
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3518
|
+
if (!b || !w) return null;
|
|
3519
|
+
const he = C ? [0, -w.height * I, w.depth * s] : [0, 0, 0], G = w.height, J = [
|
|
3520
|
+
re[0] * l[0] * G,
|
|
3521
|
+
re[1] * l[1] * G,
|
|
3522
|
+
re[2] * l[2] * G
|
|
3358
3523
|
];
|
|
3359
|
-
return /* @__PURE__ */
|
|
3360
|
-
/* @__PURE__ */
|
|
3524
|
+
return /* @__PURE__ */ S(ft, { children: [
|
|
3525
|
+
/* @__PURE__ */ S(
|
|
3361
3526
|
"group",
|
|
3362
3527
|
{
|
|
3363
|
-
position: [
|
|
3364
|
-
rotation: [
|
|
3528
|
+
position: [w.centerX, w.centerY, w.boxCenterZ],
|
|
3529
|
+
rotation: [w.rotationX, w.rotationY, w.rotationZ],
|
|
3365
3530
|
children: [
|
|
3366
|
-
/* @__PURE__ */
|
|
3367
|
-
/* @__PURE__ */
|
|
3368
|
-
/* @__PURE__ */
|
|
3531
|
+
/* @__PURE__ */ x("group", { scale: [w.width, w.height, w.depth], children: e > 0 && /* @__PURE__ */ S("mesh", { children: [
|
|
3532
|
+
/* @__PURE__ */ x("boxGeometry", { args: [1, 1, 1] }),
|
|
3533
|
+
/* @__PURE__ */ x("meshBasicMaterial", { color: a, wireframe: !0, transparent: !0, opacity: e })
|
|
3369
3534
|
] }) }),
|
|
3370
|
-
|
|
3371
|
-
/* @__PURE__ */
|
|
3372
|
-
/* @__PURE__ */
|
|
3535
|
+
E && /* @__PURE__ */ S("mesh", { children: [
|
|
3536
|
+
/* @__PURE__ */ x("sphereGeometry", { args: [6, 20, 20] }),
|
|
3537
|
+
/* @__PURE__ */ x("meshBasicMaterial", { color: a })
|
|
3373
3538
|
] }),
|
|
3374
|
-
L && /* @__PURE__ */
|
|
3375
|
-
/* @__PURE__ */
|
|
3376
|
-
/* @__PURE__ */
|
|
3377
|
-
/* @__PURE__ */
|
|
3539
|
+
L && /* @__PURE__ */ S("group", { position: he, children: [
|
|
3540
|
+
/* @__PURE__ */ S("mesh", { rotation: [0, 0, Math.PI / 4], children: [
|
|
3541
|
+
/* @__PURE__ */ x("ringGeometry", { args: [6, 8, 24] }),
|
|
3542
|
+
/* @__PURE__ */ x("meshBasicMaterial", { color: "#f8fafc", side: Fe })
|
|
3378
3543
|
] }),
|
|
3379
|
-
/* @__PURE__ */
|
|
3380
|
-
/* @__PURE__ */
|
|
3381
|
-
/* @__PURE__ */
|
|
3544
|
+
/* @__PURE__ */ S("mesh", { rotation: [0, 0, Math.PI / 2], children: [
|
|
3545
|
+
/* @__PURE__ */ x("planeGeometry", { args: [3, 16] }),
|
|
3546
|
+
/* @__PURE__ */ x("meshBasicMaterial", { color: "#f8fafc", transparent: !0, opacity: 0.9, side: Fe })
|
|
3382
3547
|
] }),
|
|
3383
|
-
/* @__PURE__ */
|
|
3384
|
-
/* @__PURE__ */
|
|
3385
|
-
/* @__PURE__ */
|
|
3548
|
+
/* @__PURE__ */ S("mesh", { children: [
|
|
3549
|
+
/* @__PURE__ */ x("planeGeometry", { args: [16, 3] }),
|
|
3550
|
+
/* @__PURE__ */ x("meshBasicMaterial", { color: "#f8fafc", transparent: !0, opacity: 0.9, side: Fe })
|
|
3386
3551
|
] })
|
|
3387
3552
|
] }),
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
/* @__PURE__ */
|
|
3391
|
-
/* @__PURE__ */
|
|
3553
|
+
N && /* @__PURE__ */ S(ft, { children: [
|
|
3554
|
+
h && /* @__PURE__ */ S("mesh", { position: c, scale: J, renderOrder: 20, children: [
|
|
3555
|
+
/* @__PURE__ */ x("sphereGeometry", { args: [1, 24, 16] }),
|
|
3556
|
+
/* @__PURE__ */ x(
|
|
3392
3557
|
"meshBasicMaterial",
|
|
3393
3558
|
{
|
|
3394
3559
|
color: "#facc15",
|
|
@@ -3400,57 +3565,57 @@ const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new M
|
|
|
3400
3565
|
}
|
|
3401
3566
|
)
|
|
3402
3567
|
] }),
|
|
3403
|
-
/* @__PURE__ */
|
|
3404
|
-
|
|
3568
|
+
/* @__PURE__ */ x(
|
|
3569
|
+
sn,
|
|
3405
3570
|
{
|
|
3406
|
-
opacity:
|
|
3571
|
+
opacity: i,
|
|
3407
3572
|
position: c,
|
|
3408
|
-
scale:
|
|
3573
|
+
scale: J,
|
|
3409
3574
|
showDebugMaterial: !0,
|
|
3410
|
-
url:
|
|
3575
|
+
url: O
|
|
3411
3576
|
}
|
|
3412
3577
|
)
|
|
3413
3578
|
] })
|
|
3414
3579
|
]
|
|
3415
3580
|
}
|
|
3416
3581
|
),
|
|
3417
|
-
|
|
3582
|
+
y && /* @__PURE__ */ x(
|
|
3418
3583
|
"group",
|
|
3419
3584
|
{
|
|
3420
|
-
position: [
|
|
3421
|
-
rotation: [
|
|
3585
|
+
position: [w.centerX, w.centerY, w.boxCenterZ],
|
|
3586
|
+
rotation: [w.rotationX, w.rotationY, w.rotationZ],
|
|
3422
3587
|
renderOrder: 10,
|
|
3423
|
-
children: /* @__PURE__ */
|
|
3424
|
-
/* @__PURE__ */
|
|
3425
|
-
/* @__PURE__ */
|
|
3426
|
-
/* @__PURE__ */
|
|
3588
|
+
children: /* @__PURE__ */ S("group", { children: [
|
|
3589
|
+
/* @__PURE__ */ S("mesh", { children: [
|
|
3590
|
+
/* @__PURE__ */ x("sphereGeometry", { args: [6, 20, 20] }),
|
|
3591
|
+
/* @__PURE__ */ x("meshBasicMaterial", { color: "#e2e8f0", depthTest: !1, depthWrite: !1 })
|
|
3427
3592
|
] }),
|
|
3428
|
-
/* @__PURE__ */
|
|
3429
|
-
/* @__PURE__ */
|
|
3430
|
-
/* @__PURE__ */
|
|
3593
|
+
/* @__PURE__ */ S("mesh", { position: [18, 0, 0], rotation: [0, 0, -Math.PI / 2], children: [
|
|
3594
|
+
/* @__PURE__ */ x("cylinderGeometry", { args: [1.6, 1.6, 24, 12] }),
|
|
3595
|
+
/* @__PURE__ */ x("meshBasicMaterial", { color: "#ef4444", depthTest: !1, depthWrite: !1 })
|
|
3431
3596
|
] }),
|
|
3432
|
-
/* @__PURE__ */
|
|
3433
|
-
/* @__PURE__ */
|
|
3434
|
-
/* @__PURE__ */
|
|
3597
|
+
/* @__PURE__ */ S("mesh", { position: [34, 0, 0], rotation: [0, 0, -Math.PI / 2], children: [
|
|
3598
|
+
/* @__PURE__ */ x("coneGeometry", { args: [4.2, 12, 16] }),
|
|
3599
|
+
/* @__PURE__ */ x("meshBasicMaterial", { color: "#ef4444", depthTest: !1, depthWrite: !1 })
|
|
3435
3600
|
] }),
|
|
3436
|
-
/* @__PURE__ */
|
|
3437
|
-
/* @__PURE__ */
|
|
3438
|
-
/* @__PURE__ */
|
|
3601
|
+
/* @__PURE__ */ S("mesh", { position: [0, 18, 0], children: [
|
|
3602
|
+
/* @__PURE__ */ x("cylinderGeometry", { args: [1.6, 1.6, 24, 12] }),
|
|
3603
|
+
/* @__PURE__ */ x("meshBasicMaterial", { color: "#22c55e", depthTest: !1, depthWrite: !1 })
|
|
3439
3604
|
] }),
|
|
3440
|
-
/* @__PURE__ */
|
|
3441
|
-
/* @__PURE__ */
|
|
3442
|
-
/* @__PURE__ */
|
|
3605
|
+
/* @__PURE__ */ S("mesh", { position: [0, 34, 0], children: [
|
|
3606
|
+
/* @__PURE__ */ x("coneGeometry", { args: [4.2, 12, 16] }),
|
|
3607
|
+
/* @__PURE__ */ x("meshBasicMaterial", { color: "#22c55e", depthTest: !1, depthWrite: !1 })
|
|
3443
3608
|
] }),
|
|
3444
|
-
/* @__PURE__ */
|
|
3445
|
-
/* @__PURE__ */
|
|
3446
|
-
/* @__PURE__ */
|
|
3609
|
+
/* @__PURE__ */ S("mesh", { position: [0, 0, 18], rotation: [Math.PI / 2, 0, 0], children: [
|
|
3610
|
+
/* @__PURE__ */ x("cylinderGeometry", { args: [1.6, 1.6, 24, 12] }),
|
|
3611
|
+
/* @__PURE__ */ x("meshBasicMaterial", { color: "#3b82f6", depthTest: !1, depthWrite: !1 })
|
|
3447
3612
|
] }),
|
|
3448
|
-
/* @__PURE__ */
|
|
3449
|
-
/* @__PURE__ */
|
|
3450
|
-
/* @__PURE__ */
|
|
3613
|
+
/* @__PURE__ */ S("mesh", { position: [0, 0, 34], rotation: [Math.PI / 2, 0, 0], children: [
|
|
3614
|
+
/* @__PURE__ */ x("coneGeometry", { args: [4.2, 12, 16] }),
|
|
3615
|
+
/* @__PURE__ */ x("meshBasicMaterial", { color: "#3b82f6", depthTest: !1, depthWrite: !1 })
|
|
3451
3616
|
] }),
|
|
3452
|
-
/* @__PURE__ */
|
|
3453
|
-
|
|
3617
|
+
/* @__PURE__ */ x(
|
|
3618
|
+
Je,
|
|
3454
3619
|
{
|
|
3455
3620
|
position: [42, 0, 0],
|
|
3456
3621
|
fontSize: 10,
|
|
@@ -3462,8 +3627,8 @@ const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new M
|
|
|
3462
3627
|
children: "X"
|
|
3463
3628
|
}
|
|
3464
3629
|
),
|
|
3465
|
-
/* @__PURE__ */
|
|
3466
|
-
|
|
3630
|
+
/* @__PURE__ */ x(
|
|
3631
|
+
Je,
|
|
3467
3632
|
{
|
|
3468
3633
|
position: [0, 42, 0],
|
|
3469
3634
|
fontSize: 10,
|
|
@@ -3475,8 +3640,8 @@ const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new M
|
|
|
3475
3640
|
children: "Y"
|
|
3476
3641
|
}
|
|
3477
3642
|
),
|
|
3478
|
-
/* @__PURE__ */
|
|
3479
|
-
|
|
3643
|
+
/* @__PURE__ */ x(
|
|
3644
|
+
Je,
|
|
3480
3645
|
{
|
|
3481
3646
|
position: [0, 0, 42],
|
|
3482
3647
|
fontSize: 10,
|
|
@@ -3494,49 +3659,51 @@ const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new M
|
|
|
3494
3659
|
] });
|
|
3495
3660
|
};
|
|
3496
3661
|
export {
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3662
|
+
zr as CanonicalFaceMeshRenderer,
|
|
3663
|
+
qr as DEFAULT_APPEARANCE,
|
|
3664
|
+
To as DEFAULT_FACE_WARP_3D_SETTINGS,
|
|
3665
|
+
js as DEFAULT_FEATURE_GROUPS,
|
|
3666
|
+
Ks as DEFAULT_FEATURE_POINT_INDICES,
|
|
3667
|
+
Zr as DEFAULT_MASKING,
|
|
3668
|
+
At as FACE_MASK_SIZE,
|
|
3669
|
+
$t as FACE_OVAL,
|
|
3670
|
+
xo as FACE_WARP_3D_PRESET,
|
|
3671
|
+
oo as FaceRetouchBackground,
|
|
3672
|
+
nn as HEAD_OCCLUDER_DEFAULT_OPACITY,
|
|
3673
|
+
ke as HEAD_OCCLUDER_DEFAULT_POSITION,
|
|
3674
|
+
re as HEAD_OCCLUDER_DEFAULT_SCALE,
|
|
3675
|
+
co as HeadBinding,
|
|
3676
|
+
go as HeadBindingOccluder,
|
|
3677
|
+
sn as HeadOccluder,
|
|
3678
|
+
Jt as INNER_MOUTH,
|
|
3679
|
+
bs as LEFT_EYE,
|
|
3680
|
+
Es as LEFT_EYEBROW,
|
|
3681
|
+
Rs as OUTER_LIPS,
|
|
3682
|
+
Ms as RIGHT_EYE,
|
|
3683
|
+
ws as RIGHT_EYEBROW,
|
|
3684
|
+
to as alphaMapOptions,
|
|
3685
|
+
Ct as blendModeIndices,
|
|
3686
|
+
no as blendModeOptions,
|
|
3687
|
+
mo as computeAdaptiveVerticalFit,
|
|
3688
|
+
Ur as computeHeadBindingCubePose,
|
|
3689
|
+
po as computeHeadBindingDebugMetrics,
|
|
3690
|
+
Or as computeHeadBindingShape,
|
|
3691
|
+
fo as computeUniversalHeadDepthOffset,
|
|
3692
|
+
lo as computeUniversalOccluderScale,
|
|
3693
|
+
ho as computeUniversalPitchOffsetY,
|
|
3694
|
+
uo as computeUniversalYawOffsetX,
|
|
3695
|
+
Ws as createFaceRetouchRegions,
|
|
3696
|
+
_s as drawFaceRetouchMask,
|
|
3697
|
+
Ls as drawMouthRetouchMask,
|
|
3698
|
+
Qr as materialTypeOptions,
|
|
3699
|
+
is as parseCanonicalFaceModel,
|
|
3700
|
+
$r as shaderPresetOptions,
|
|
3701
|
+
Jr as sideOptions,
|
|
3702
|
+
an as solveHeadBinding,
|
|
3703
|
+
ro as supportsBlendMode,
|
|
3704
|
+
so as supportsTexturePanel,
|
|
3705
|
+
eo as textureMapOptions,
|
|
3706
|
+
hs as useCanonicalFaceMesh,
|
|
3707
|
+
ao as useFaceRetouchMask,
|
|
3708
|
+
io as useFaceRetouchRegions
|
|
3542
3709
|
};
|