@roomle/web-sdk 5.1.0-alpha.4 → 5.1.0-alpha.5
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/lib/{BufferGeometry-Bl5whHAB.mjs → BufferGeometry-CxlpBjLq.mjs} +192 -195
- package/lib/BufferGeometry-CxlpBjLq.mjs.map +1 -0
- package/lib/ConfiguratorKernel.wasm +0 -0
- package/lib/{GLTFExporter-yQ7mMauu.mjs → GLTFExporter-DeNw0qAI.mjs} +86 -80
- package/lib/GLTFExporter-DeNw0qAI.mjs.map +1 -0
- package/lib/GaussianBlurNode-BR1cKBsX.mjs +65 -0
- package/lib/GaussianBlurNode-BR1cKBsX.mjs.map +1 -0
- package/lib/{Object3D-BHdngbxB.mjs → Object3D-CALIQdg1.mjs} +142 -59
- package/lib/Object3D-CALIQdg1.mjs.map +1 -0
- package/lib/{Pass-DLiMLT5k.mjs → Pass-DCljS3Z-.mjs} +4 -4
- package/lib/{Pass-DLiMLT5k.mjs.map → Pass-DCljS3Z-.mjs.map} +1 -1
- package/lib/{PointLightHelper-CuPSBuDU.mjs → PointLightHelper-C_0CYp7R.mjs} +35 -32
- package/lib/PointLightHelper-C_0CYp7R.mjs.map +1 -0
- package/lib/RoomleCore.wasm +0 -0
- package/lib/RoomleToolsCore.wasm +0 -0
- package/lib/{SpotLightHelper-m-Rh8vGU.mjs → SpotLightHelper-UUIHn43T.mjs} +22 -19
- package/lib/SpotLightHelper-UUIHn43T.mjs.map +1 -0
- package/lib/{USDZExporter-MdkuT226.mjs → USDZExporter-BBNw7Hey.mjs} +6 -3
- package/lib/USDZExporter-BBNw7Hey.mjs.map +1 -0
- package/lib/{Vector4-C7TlIAyy.mjs → Vector4-BOcWTZJI.mjs} +2 -2
- package/lib/Vector4-BOcWTZJI.mjs.map +1 -0
- package/lib/{api-Bznmr-xZ.mjs → api-CwEjmjrn.mjs} +2 -2
- package/lib/{api-Bznmr-xZ.mjs.map → api-CwEjmjrn.mjs.map} +1 -1
- package/lib/{banana-for-scale-DpKXNBt_.mjs → banana-for-scale-Cf41yXTl.mjs} +3 -3
- package/lib/{banana-for-scale-DpKXNBt_.mjs.map → banana-for-scale-Cf41yXTl.mjs.map} +1 -1
- package/lib/{common-utils-DbL4tku0.mjs → common-utils-OTJQGohe.mjs} +3 -3
- package/lib/common-utils-OTJQGohe.mjs.map +1 -0
- package/lib/{component-dimensioning-BaUqwqYJ.mjs → component-dimensioning-yPK46Y5o.mjs} +26 -26
- package/lib/{component-dimensioning-BaUqwqYJ.mjs.map → component-dimensioning-yPK46Y5o.mjs.map} +1 -1
- package/lib/{component-raycast-helper-4i8b4E5B.mjs → component-raycast-helper-CnpnRaFg.mjs} +15 -15
- package/lib/{component-raycast-helper-4i8b4E5B.mjs.map → component-raycast-helper-CnpnRaFg.mjs.map} +1 -1
- package/lib/{configurator-CDw_c6tB.mjs → configurator-iYlO_buA.mjs} +4 -4
- package/lib/{configurator-CDw_c6tB.mjs.map → configurator-iYlO_buA.mjs.map} +1 -1
- package/lib/configurator-y7zIaUe_.mjs +2 -0
- package/lib/{continuous-drawing-helper-DqHIR_qF.mjs → continuous-drawing-helper-CTfGRTfH.mjs} +3 -3
- package/lib/{continuous-drawing-helper-DqHIR_qF.mjs.map → continuous-drawing-helper-CTfGRTfH.mjs.map} +1 -1
- package/lib/dimensioning-helper-CQlesi-m.mjs +2 -0
- package/lib/{dimensioning-helper-CGPjS2hW.mjs → dimensioning-helper-DSlkLDmx.mjs} +42 -36
- package/lib/dimensioning-helper-DSlkLDmx.mjs.map +1 -0
- package/lib/{glb-viewer-B-Zr743e.mjs → glb-viewer-AGV-_xKd.mjs} +33 -33
- package/lib/{glb-viewer-B-Zr743e.mjs.map → glb-viewer-AGV-_xKd.mjs.map} +1 -1
- package/lib/glb-viewer-DSzNR4CI.mjs +2 -0
- package/lib/{highlight-coordinator-4gkjde82.mjs → highlight-coordinator-DU6oFunq.mjs} +6 -6
- package/lib/{highlight-coordinator-4gkjde82.mjs.map → highlight-coordinator-DU6oFunq.mjs.map} +1 -1
- package/lib/{homag-intelligence-D7S7r-Gc.mjs → homag-intelligence-D_yBv0ig.mjs} +3 -3
- package/lib/{homag-intelligence-D7S7r-Gc.mjs.map → homag-intelligence-D_yBv0ig.mjs.map} +1 -1
- package/lib/{hosek-wilkie-sky-iMar2iw-.mjs → hosek-wilkie-sky-DmTvnxMA.mjs} +33 -33
- package/lib/{hosek-wilkie-sky-iMar2iw-.mjs.map → hosek-wilkie-sky-DmTvnxMA.mjs.map} +1 -1
- package/lib/{imos-ix-poc-export-helper-CyGqK7nu.mjs → imos-ix-poc-export-helper-BGN97m8W.mjs} +3 -3
- package/lib/{imos-ix-poc-export-helper-CyGqK7nu.mjs.map → imos-ix-poc-export-helper-BGN97m8W.mjs.map} +1 -1
- package/lib/{kernel-utils-BvatnA7U.mjs → kernel-utils-BYKmP0mf.mjs} +13 -13
- package/lib/{kernel-utils-BvatnA7U.mjs.map → kernel-utils-BYKmP0mf.mjs.map} +1 -1
- package/lib/{material-viewer-CTsSfTfL.mjs → material-viewer-BuBSXGw6.mjs} +18 -18
- package/lib/{material-viewer-CTsSfTfL.mjs.map → material-viewer-BuBSXGw6.mjs.map} +1 -1
- package/lib/{packages-BXAZEcKa.mjs → packages-CduZDHYG.mjs} +5 -5
- package/lib/{packages-BXAZEcKa.mjs.map → packages-CduZDHYG.mjs.map} +1 -1
- package/lib/planner-B-SWR4R8.mjs +2 -0
- package/lib/{planner-jvLAnYww.mjs → planner-BuBkFbra.mjs} +3 -3
- package/lib/{planner-jvLAnYww.mjs.map → planner-BuBkFbra.mjs.map} +1 -1
- package/lib/{plugin-system-CRaC04G5.mjs → plugin-system-CPf99Zkf.mjs} +2 -2
- package/lib/{plugin-system-CRaC04G5.mjs.map → plugin-system-CPf99Zkf.mjs.map} +1 -1
- package/lib/{render-cache-DCPIQbO1.mjs → render-cache-CPppt7Rd.mjs} +5 -5
- package/lib/{render-cache-DCPIQbO1.mjs.map → render-cache-CPppt7Rd.mjs.map} +1 -1
- package/lib/{render-order-BPF2wDMw.mjs → render-order-a0QAbB7Q.mjs} +2 -2
- package/lib/{render-order-BPF2wDMw.mjs.map → render-order-a0QAbB7Q.mjs.map} +1 -1
- package/lib/roomle-headless.d.ts +0 -2
- package/lib/roomle-headless.js +14 -14
- package/lib/{roomle-renderer-Ato6RMrd.mjs → roomle-renderer-UJINLYxS.mjs} +2 -2
- package/lib/{roomle-renderer-Ato6RMrd.mjs.map → roomle-renderer-UJINLYxS.mjs.map} +1 -1
- package/lib/{roomle-sdk-CBwhwX_e.mjs → roomle-sdk-CcNdTp_n.mjs} +1844 -1889
- package/lib/roomle-sdk-CcNdTp_n.mjs.map +1 -0
- package/lib/roomle-sdk.d.ts +0 -2
- package/lib/roomle-sdk.js +7 -7
- package/lib/{roomle-webgpu-renderer-BfZKcXSz.mjs → roomle-webgpu-renderer-BSvxbopA.mjs} +900 -707
- package/lib/roomle-webgpu-renderer-BSvxbopA.mjs.map +1 -0
- package/lib/{scene-renderer-BHYZac3H.mjs → scene-renderer--DzrpIl_.mjs} +309 -309
- package/lib/{scene-renderer-BHYZac3H.mjs.map → scene-renderer--DzrpIl_.mjs.map} +1 -1
- package/lib/{script-loader-CvnG6LgL.mjs → script-loader-D6i0wQ_j.mjs} +2 -2
- package/lib/{script-loader-CvnG6LgL.mjs.map → script-loader-D6i0wQ_j.mjs.map} +1 -1
- package/lib/{shading-settings-BBhR7KcS.mjs → shading-settings-6v-7O_Sz.mjs} +49 -49
- package/lib/{shading-settings-BBhR7KcS.mjs.map → shading-settings-6v-7O_Sz.mjs.map} +1 -1
- package/lib/src-6KtBPZXp.mjs +2 -0
- package/lib/{src-HhklrVDg.mjs → src-Dg0wYIom.mjs} +150 -150
- package/lib/{src-HhklrVDg.mjs.map → src-Dg0wYIom.mjs.map} +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/package.json +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/ConfiguratorKernel.wasm +0 -0
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleCore.wasm +0 -0
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleToolsCore.wasm +0 -0
- package/lib/{stats-helper-PndcZCzL.mjs → stats-helper-DYjPPDnz.mjs} +2 -2
- package/lib/{stats-helper-PndcZCzL.mjs.map → stats-helper-DYjPPDnz.mjs.map} +1 -1
- package/lib/{three.core-0KaTx8dm.mjs → three.core-BTUCraWz.mjs} +976 -884
- package/lib/three.core-BTUCraWz.mjs.map +1 -0
- package/lib/{three.module-dym6j3lO.mjs → three.module-DUSFrLM6.mjs} +1789 -1739
- package/lib/three.module-DUSFrLM6.mjs.map +1 -0
- package/lib/three.tsl-De6A-G56.mjs +158 -0
- package/lib/three.tsl-De6A-G56.mjs.map +1 -0
- package/lib/three.tsl-DtfvggFX.mjs +2 -0
- package/lib/three.webgpu-B1OhMci_.mjs +3 -0
- package/lib/{three.webgpu-D3nSEIjD.mjs → three.webgpu-wPiwbpFM.mjs} +5806 -4926
- package/lib/three.webgpu-wPiwbpFM.mjs.map +1 -0
- package/lib/{threejs-utils-v1uOvccg.mjs → threejs-utils-lVSsgAiQ.mjs} +68 -68
- package/lib/{threejs-utils-v1uOvccg.mjs.map → threejs-utils-lVSsgAiQ.mjs.map} +1 -1
- package/lib/{tools-core-B29U-88K.mjs → tools-core-CRGER_KC.mjs} +3 -3
- package/lib/{tools-core-B29U-88K.mjs.map → tools-core-CRGER_KC.mjs.map} +1 -1
- package/lib/{webgpu-BHAP6BLI.mjs → webgpu-BxYJfBjz.mjs} +555 -555
- package/lib/{webgpu-BHAP6BLI.mjs.map → webgpu-BxYJfBjz.mjs.map} +1 -1
- package/package.json +5 -5
- package/lib/BufferGeometry-Bl5whHAB.mjs.map +0 -1
- package/lib/GLTFExporter-yQ7mMauu.mjs.map +0 -1
- package/lib/GaussianBlurNode-DNBEf5-n.mjs +0 -59
- package/lib/GaussianBlurNode-DNBEf5-n.mjs.map +0 -1
- package/lib/Object3D-BHdngbxB.mjs.map +0 -1
- package/lib/PointLightHelper-CuPSBuDU.mjs.map +0 -1
- package/lib/SpotLightHelper-m-Rh8vGU.mjs.map +0 -1
- package/lib/USDZExporter-MdkuT226.mjs.map +0 -1
- package/lib/Vector4-C7TlIAyy.mjs.map +0 -1
- package/lib/common-utils-DbL4tku0.mjs.map +0 -1
- package/lib/configurator-BYQdWEvf.mjs +0 -2
- package/lib/dimensioning-helper-CGPjS2hW.mjs.map +0 -1
- package/lib/dimensioning-helper-VndKlIXS.mjs +0 -2
- package/lib/glb-viewer-Bd5Xn6Oq.mjs +0 -2
- package/lib/planner-DMk3T4ts.mjs +0 -2
- package/lib/roomle-sdk-CBwhwX_e.mjs.map +0 -1
- package/lib/roomle-webgpu-renderer-BfZKcXSz.mjs.map +0 -1
- package/lib/src-Bbq3Hqzn.mjs +0 -2
- package/lib/three.core-0KaTx8dm.mjs.map +0 -1
- package/lib/three.module-dym6j3lO.mjs.map +0 -1
- package/lib/three.tsl-BTc4fg8T.mjs +0 -2
- package/lib/three.tsl-Cf0-sCqB.mjs +0 -152
- package/lib/three.tsl-Cf0-sCqB.mjs.map +0 -1
- package/lib/three.webgpu-ClICiWlK.mjs +0 -3
- package/lib/three.webgpu-D3nSEIjD.mjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as e, C as t, D as n, E as r, O as i, S as a, T as o, _ as s, a as c, b as l, c as u, g as d, h as f, i as p, k as m, l as h, m as g, o as _, r as v, s as y, t as b, u as x, v as S, w as C, x as w, y as T } from "./Object3D-CALIQdg1.mjs";
|
|
2
2
|
//#region ../../node_modules/three/src/math/Ray.js
|
|
3
|
-
var
|
|
4
|
-
constructor(e = new
|
|
3
|
+
var E = /* @__PURE__ */ new x(), D = /* @__PURE__ */ new x(), O = /* @__PURE__ */ new x(), k = /* @__PURE__ */ new x(), A = class {
|
|
4
|
+
constructor(e = new x(), t = new x(0, 0, -1)) {
|
|
5
5
|
this.origin = e, this.direction = t;
|
|
6
6
|
}
|
|
7
7
|
set(e, t) {
|
|
@@ -17,7 +17,7 @@ var T = /* @__PURE__ */ new m(), E = /* @__PURE__ */ new m(), D = /* @__PURE__ *
|
|
|
17
17
|
return this.direction.copy(e).sub(this.origin).normalize(), this;
|
|
18
18
|
}
|
|
19
19
|
recast(e) {
|
|
20
|
-
return this.origin.copy(this.at(e,
|
|
20
|
+
return this.origin.copy(this.at(e, E)), this;
|
|
21
21
|
}
|
|
22
22
|
closestPointToPoint(e, t) {
|
|
23
23
|
t.subVectors(e, this.origin);
|
|
@@ -28,12 +28,12 @@ var T = /* @__PURE__ */ new m(), E = /* @__PURE__ */ new m(), D = /* @__PURE__ *
|
|
|
28
28
|
return Math.sqrt(this.distanceSqToPoint(e));
|
|
29
29
|
}
|
|
30
30
|
distanceSqToPoint(e) {
|
|
31
|
-
let t =
|
|
32
|
-
return t < 0 ? this.origin.distanceToSquared(e) : (
|
|
31
|
+
let t = E.subVectors(e, this.origin).dot(this.direction);
|
|
32
|
+
return t < 0 ? this.origin.distanceToSquared(e) : (E.copy(this.origin).addScaledVector(this.direction, t), E.distanceToSquared(e));
|
|
33
33
|
}
|
|
34
34
|
distanceSqToSegment(e, t, n, r) {
|
|
35
|
-
|
|
36
|
-
let i = e.distanceTo(t) * .5, a = -this.direction.dot(
|
|
35
|
+
D.copy(e).add(t).multiplyScalar(.5), O.copy(t).sub(e).normalize(), k.copy(this.origin).sub(D);
|
|
36
|
+
let i = e.distanceTo(t) * .5, a = -this.direction.dot(O), o = k.dot(this.direction), s = -k.dot(O), c = k.lengthSq(), l = Math.abs(1 - a * a), u, d, f, p;
|
|
37
37
|
if (l > 0) if (u = a * s - o, d = a * o - s, p = i * l, u >= 0) if (d >= -p) if (d <= p) {
|
|
38
38
|
let e = 1 / l;
|
|
39
39
|
u *= e, d *= e, f = u * (u + a * d + 2 * o) + d * (a * u + d + 2 * s) + c;
|
|
@@ -41,11 +41,12 @@ var T = /* @__PURE__ */ new m(), E = /* @__PURE__ */ new m(), D = /* @__PURE__ *
|
|
|
41
41
|
else d = -i, u = Math.max(0, -(a * d + o)), f = -u * u + d * (d + 2 * s) + c;
|
|
42
42
|
else d <= -p ? (u = Math.max(0, -(-a * i + o)), d = u > 0 ? -i : Math.min(Math.max(-i, -s), i), f = -u * u + d * (d + 2 * s) + c) : d <= p ? (u = 0, d = Math.min(Math.max(-i, -s), i), f = d * (d + 2 * s) + c) : (u = Math.max(0, -(a * i + o)), d = u > 0 ? i : Math.min(Math.max(-i, -s), i), f = -u * u + d * (d + 2 * s) + c);
|
|
43
43
|
else d = a > 0 ? -i : i, u = Math.max(0, -(a * d + o)), f = -u * u + d * (d + 2 * s) + c;
|
|
44
|
-
return n && n.copy(this.origin).addScaledVector(this.direction, u), r && r.copy(
|
|
44
|
+
return n && n.copy(this.origin).addScaledVector(this.direction, u), r && r.copy(D).addScaledVector(O, d), f;
|
|
45
45
|
}
|
|
46
46
|
intersectSphere(e, t) {
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
if (e.radius < 0) return null;
|
|
48
|
+
E.subVectors(e.center, this.origin);
|
|
49
|
+
let n = E.dot(this.direction), r = E.dot(E) - n * n, i = e.radius * e.radius;
|
|
49
50
|
if (r > i) return null;
|
|
50
51
|
let a = Math.sqrt(i - r), o = n - a, s = n + a;
|
|
51
52
|
return s < 0 ? null : o < 0 ? this.at(s, t) : this.at(o, t);
|
|
@@ -72,23 +73,19 @@ var T = /* @__PURE__ */ new m(), E = /* @__PURE__ */ new m(), D = /* @__PURE__ *
|
|
|
72
73
|
return c >= 0 ? (n = (e.min.x - d.x) * c, r = (e.max.x - d.x) * c) : (n = (e.max.x - d.x) * c, r = (e.min.x - d.x) * c), l >= 0 ? (i = (e.min.y - d.y) * l, a = (e.max.y - d.y) * l) : (i = (e.max.y - d.y) * l, a = (e.min.y - d.y) * l), n > a || i > r || ((i > n || isNaN(n)) && (n = i), (a < r || isNaN(r)) && (r = a), u >= 0 ? (o = (e.min.z - d.z) * u, s = (e.max.z - d.z) * u) : (o = (e.max.z - d.z) * u, s = (e.min.z - d.z) * u), n > s || o > r) || ((o > n || n !== n) && (n = o), (s < r || r !== r) && (r = s), r < 0) ? null : this.at(n >= 0 ? n : r, t);
|
|
73
74
|
}
|
|
74
75
|
intersectsBox(e) {
|
|
75
|
-
return this.intersectBox(e,
|
|
76
|
+
return this.intersectBox(e, E) !== null;
|
|
76
77
|
}
|
|
77
78
|
intersectTriangle(e, t, n, r, i) {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
} else if (
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
let
|
|
87
|
-
|
|
88
|
-
let c = o * this.direction.dot(k.cross(O));
|
|
89
|
-
if (c < 0 || s + c > a) return null;
|
|
90
|
-
let l = -o * O.dot(j);
|
|
91
|
-
return l < 0 ? null : this.at(l / a, i);
|
|
79
|
+
let a = this.origin, o = this.direction, s = o.x, c = o.y, l = o.z, u = e.x - a.x, d = e.y - a.y, f = e.z - a.z, p = t.x - a.x, m = t.y - a.y, h = t.z - a.z, g = n.x - a.x, _ = n.y - a.y, v = n.z - a.z, y = Math.abs(s), b = Math.abs(c), x = Math.abs(l), S, C, w, T, E, D, O, k, A, j, M, N;
|
|
80
|
+
if (y >= b && y >= x ? (w = s, D = u, A = p, N = g, s >= 0 ? (S = c, C = l, T = d, E = f, O = m, k = h, j = _, M = v) : (S = l, C = c, T = f, E = d, O = h, k = m, j = v, M = _)) : b >= x ? (w = c, D = d, A = m, N = _, c >= 0 ? (S = l, C = s, T = f, E = u, O = h, k = p, j = v, M = g) : (S = s, C = l, T = u, E = f, O = p, k = h, j = g, M = v)) : (w = l, D = f, A = h, N = v, l >= 0 ? (S = s, C = c, T = u, E = d, O = p, k = m, j = g, M = _) : (S = c, C = s, T = d, E = u, O = m, k = p, j = _, M = g)), w === 0) return null;
|
|
81
|
+
let P = S / w, F = C / w, I = 1 / w, L = T - P * D, R = E - F * D, z = O - P * A, B = k - F * A, V = j - P * N, H = M - F * N, U = V * B - H * z, W = L * H - R * V, G = z * R - B * L;
|
|
82
|
+
if (r) {
|
|
83
|
+
if (U < 0 || W < 0 || G < 0) return null;
|
|
84
|
+
} else if ((U < 0 || W < 0 || G < 0) && (U > 0 || W > 0 || G > 0)) return null;
|
|
85
|
+
let K = U + W + G;
|
|
86
|
+
if (K === 0) return null;
|
|
87
|
+
let q = I * (U * D + W * A + G * N);
|
|
88
|
+
return (K > 0 ? q < 0 : q > 0) ? null : this.at(q / K, i);
|
|
92
89
|
}
|
|
93
90
|
applyMatrix4(e) {
|
|
94
91
|
return this.origin.applyMatrix4(e), this.direction.transformDirection(e), this;
|
|
@@ -99,14 +96,14 @@ var T = /* @__PURE__ */ new m(), E = /* @__PURE__ */ new m(), D = /* @__PURE__ *
|
|
|
99
96
|
clone() {
|
|
100
97
|
return new this.constructor().copy(this);
|
|
101
98
|
}
|
|
102
|
-
},
|
|
103
|
-
function
|
|
99
|
+
}, j = /* @__PURE__ */ new c().set(.4123908, .3575843, .1804808, .212639, .7151687, .0721923, .0193308, .1191948, .9505322), M = /* @__PURE__ */ new c().set(3.2409699, -1.5373832, -.4986108, -.9692436, 1.8759675, .0415551, .0556301, -.203977, 1.0569715);
|
|
100
|
+
function N() {
|
|
104
101
|
let e = {
|
|
105
102
|
enabled: !0,
|
|
106
|
-
workingColorSpace:
|
|
103
|
+
workingColorSpace: r,
|
|
107
104
|
spaces: {},
|
|
108
105
|
convert: function(e, t, n) {
|
|
109
|
-
return this.enabled === !1 || t === n || !t || !n ? e : (this.spaces[t].transfer === "srgb" && (e.r =
|
|
106
|
+
return this.enabled === !1 || t === n || !t || !n ? e : (this.spaces[t].transfer === "srgb" && (e.r = F(e.r), e.g = F(e.g), e.b = F(e.b)), this.spaces[t].primaries !== this.spaces[n].primaries && (e.applyMatrix3(this.spaces[t].toXYZ), e.applyMatrix3(this.spaces[n].fromXYZ)), this.spaces[n].transfer === "srgb" && (e.r = I(e.r), e.g = I(e.g), e.b = I(e.b)), e);
|
|
110
107
|
},
|
|
111
108
|
workingToColorSpace: function(e, t) {
|
|
112
109
|
return this.convert(e, this.workingColorSpace, t);
|
|
@@ -138,56 +135,56 @@ function ee() {
|
|
|
138
135
|
_getUnpackColorSpace: function(e = this.workingColorSpace) {
|
|
139
136
|
return this.spaces[e].workingColorSpaceConfig.unpackColorSpace;
|
|
140
137
|
},
|
|
141
|
-
fromWorkingColorSpace: function(
|
|
142
|
-
return
|
|
138
|
+
fromWorkingColorSpace: function(n, r) {
|
|
139
|
+
return t("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."), e.workingToColorSpace(n, r);
|
|
143
140
|
},
|
|
144
|
-
toWorkingColorSpace: function(
|
|
145
|
-
return
|
|
141
|
+
toWorkingColorSpace: function(n, r) {
|
|
142
|
+
return t("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."), e.colorSpaceToWorking(n, r);
|
|
146
143
|
}
|
|
147
|
-
},
|
|
144
|
+
}, a = [
|
|
148
145
|
.64,
|
|
149
146
|
.33,
|
|
150
147
|
.3,
|
|
151
148
|
.6,
|
|
152
149
|
.15,
|
|
153
150
|
.06
|
|
154
|
-
],
|
|
151
|
+
], o = [
|
|
155
152
|
.2126,
|
|
156
153
|
.7152,
|
|
157
154
|
.0722
|
|
158
|
-
],
|
|
155
|
+
], s = [.3127, .329];
|
|
159
156
|
return e.define({
|
|
160
|
-
[
|
|
161
|
-
primaries:
|
|
162
|
-
whitePoint:
|
|
157
|
+
[r]: {
|
|
158
|
+
primaries: a,
|
|
159
|
+
whitePoint: s,
|
|
163
160
|
transfer: n,
|
|
164
|
-
toXYZ:
|
|
165
|
-
fromXYZ:
|
|
166
|
-
luminanceCoefficients:
|
|
167
|
-
workingColorSpaceConfig: { unpackColorSpace:
|
|
168
|
-
outputColorSpaceConfig: { drawingBufferColorSpace:
|
|
161
|
+
toXYZ: j,
|
|
162
|
+
fromXYZ: M,
|
|
163
|
+
luminanceCoefficients: o,
|
|
164
|
+
workingColorSpaceConfig: { unpackColorSpace: i },
|
|
165
|
+
outputColorSpaceConfig: { drawingBufferColorSpace: i }
|
|
169
166
|
},
|
|
170
|
-
[
|
|
171
|
-
primaries:
|
|
172
|
-
whitePoint:
|
|
173
|
-
transfer:
|
|
174
|
-
toXYZ:
|
|
175
|
-
fromXYZ:
|
|
176
|
-
luminanceCoefficients:
|
|
177
|
-
outputColorSpaceConfig: { drawingBufferColorSpace:
|
|
167
|
+
[i]: {
|
|
168
|
+
primaries: a,
|
|
169
|
+
whitePoint: s,
|
|
170
|
+
transfer: m,
|
|
171
|
+
toXYZ: j,
|
|
172
|
+
fromXYZ: M,
|
|
173
|
+
luminanceCoefficients: o,
|
|
174
|
+
outputColorSpaceConfig: { drawingBufferColorSpace: i }
|
|
178
175
|
}
|
|
179
176
|
}), e;
|
|
180
177
|
}
|
|
181
|
-
var
|
|
182
|
-
function
|
|
178
|
+
var P = /* @__PURE__ */ N();
|
|
179
|
+
function F(e) {
|
|
183
180
|
return e < .04045 ? e * .0773993808 : (e * .9478672986 + .0521327014) ** 2.4;
|
|
184
181
|
}
|
|
185
|
-
function
|
|
182
|
+
function I(e) {
|
|
186
183
|
return e < .0031308 ? e * 12.92 : 1.055 * e ** .41666 - .055;
|
|
187
184
|
}
|
|
188
185
|
//#endregion
|
|
189
186
|
//#region ../../node_modules/three/src/math/Color.js
|
|
190
|
-
var
|
|
187
|
+
var L = {
|
|
191
188
|
aliceblue: 15792383,
|
|
192
189
|
antiquewhite: 16444375,
|
|
193
190
|
aqua: 65535,
|
|
@@ -336,19 +333,19 @@ var R = {
|
|
|
336
333
|
whitesmoke: 16119285,
|
|
337
334
|
yellow: 16776960,
|
|
338
335
|
yellowgreen: 10145074
|
|
339
|
-
},
|
|
336
|
+
}, R = {
|
|
340
337
|
h: 0,
|
|
341
338
|
s: 0,
|
|
342
339
|
l: 0
|
|
343
|
-
},
|
|
340
|
+
}, z = {
|
|
344
341
|
h: 0,
|
|
345
342
|
s: 0,
|
|
346
343
|
l: 0
|
|
347
344
|
};
|
|
348
|
-
function
|
|
345
|
+
function B(e, t, n) {
|
|
349
346
|
return n < 0 && (n += 1), n > 1 && --n, n < 1 / 6 ? e + (t - e) * 6 * n : n < 1 / 2 ? t : n < 2 / 3 ? e + (t - e) * 6 * (2 / 3 - n) : e;
|
|
350
347
|
}
|
|
351
|
-
var
|
|
348
|
+
var V = class {
|
|
352
349
|
constructor(e, t, n) {
|
|
353
350
|
return this.isColor = !0, this.r = 1, this.g = 1, this.b = 1, this.set(e, t, n);
|
|
354
351
|
}
|
|
@@ -362,50 +359,50 @@ var H = class {
|
|
|
362
359
|
setScalar(e) {
|
|
363
360
|
return this.r = e, this.g = e, this.b = e, this;
|
|
364
361
|
}
|
|
365
|
-
setHex(e,
|
|
366
|
-
return e = Math.floor(e), this.r = (e >> 16 & 255) / 255, this.g = (e >> 8 & 255) / 255, this.b = (e & 255) / 255,
|
|
362
|
+
setHex(e, t = i) {
|
|
363
|
+
return e = Math.floor(e), this.r = (e >> 16 & 255) / 255, this.g = (e >> 8 & 255) / 255, this.b = (e & 255) / 255, P.colorSpaceToWorking(this, t), this;
|
|
367
364
|
}
|
|
368
|
-
setRGB(e, t, n, r =
|
|
369
|
-
return this.r = e, this.g = t, this.b = n,
|
|
365
|
+
setRGB(e, t, n, r = P.workingColorSpace) {
|
|
366
|
+
return this.r = e, this.g = t, this.b = n, P.colorSpaceToWorking(this, r), this;
|
|
370
367
|
}
|
|
371
|
-
setHSL(e, t, n, r =
|
|
372
|
-
if (e = d(e, 1), t =
|
|
368
|
+
setHSL(e, t, n, r = P.workingColorSpace) {
|
|
369
|
+
if (e = d(e, 1), t = g(t, 0, 1), n = g(n, 0, 1), t === 0) this.r = this.g = this.b = n;
|
|
373
370
|
else {
|
|
374
371
|
let r = n <= .5 ? n * (1 + t) : n + t - n * t, i = 2 * n - r;
|
|
375
|
-
this.r =
|
|
372
|
+
this.r = B(i, r, e + 1 / 3), this.g = B(i, r, e), this.b = B(i, r, e - 1 / 3);
|
|
376
373
|
}
|
|
377
|
-
return
|
|
374
|
+
return P.colorSpaceToWorking(this, r), this;
|
|
378
375
|
}
|
|
379
|
-
setStyle(e,
|
|
380
|
-
function
|
|
381
|
-
t !== void 0 && parseFloat(t) < 1 &&
|
|
376
|
+
setStyle(e, t = i) {
|
|
377
|
+
function n(t) {
|
|
378
|
+
t !== void 0 && parseFloat(t) < 1 && a("Color: Alpha component of " + e + " will be ignored.");
|
|
382
379
|
}
|
|
383
|
-
let
|
|
384
|
-
if (
|
|
385
|
-
let
|
|
386
|
-
switch (
|
|
380
|
+
let r;
|
|
381
|
+
if (r = /^(\w+)\(([^\)]*)\)/.exec(e)) {
|
|
382
|
+
let i, o = r[1], s = r[2];
|
|
383
|
+
switch (o) {
|
|
387
384
|
case "rgb":
|
|
388
385
|
case "rgba":
|
|
389
|
-
if (
|
|
390
|
-
if (
|
|
386
|
+
if (i = /^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s)) return n(i[4]), this.setRGB(Math.min(255, parseInt(i[1], 10)) / 255, Math.min(255, parseInt(i[2], 10)) / 255, Math.min(255, parseInt(i[3], 10)) / 255, t);
|
|
387
|
+
if (i = /^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s)) return n(i[4]), this.setRGB(Math.min(100, parseInt(i[1], 10)) / 100, Math.min(100, parseInt(i[2], 10)) / 100, Math.min(100, parseInt(i[3], 10)) / 100, t);
|
|
391
388
|
break;
|
|
392
389
|
case "hsl":
|
|
393
390
|
case "hsla":
|
|
394
|
-
if (
|
|
391
|
+
if (i = /^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s)) return n(i[4]), this.setHSL(parseFloat(i[1]) / 360, parseFloat(i[2]) / 100, parseFloat(i[3]) / 100, t);
|
|
395
392
|
break;
|
|
396
|
-
default:
|
|
393
|
+
default: a("Color: Unknown color model " + e);
|
|
397
394
|
}
|
|
398
|
-
} else if (
|
|
399
|
-
let
|
|
400
|
-
if (
|
|
401
|
-
if (
|
|
402
|
-
|
|
403
|
-
} else if (e && e.length > 0) return this.setColorName(e,
|
|
395
|
+
} else if (r = /^\#([A-Fa-f\d]+)$/.exec(e)) {
|
|
396
|
+
let n = r[1], i = n.length;
|
|
397
|
+
if (i === 3) return this.setRGB(parseInt(n.charAt(0), 16) / 15, parseInt(n.charAt(1), 16) / 15, parseInt(n.charAt(2), 16) / 15, t);
|
|
398
|
+
if (i === 6) return this.setHex(parseInt(n, 16), t);
|
|
399
|
+
a("Color: Invalid hex color " + e);
|
|
400
|
+
} else if (e && e.length > 0) return this.setColorName(e, t);
|
|
404
401
|
return this;
|
|
405
402
|
}
|
|
406
|
-
setColorName(e,
|
|
407
|
-
let
|
|
408
|
-
return
|
|
403
|
+
setColorName(e, t = i) {
|
|
404
|
+
let n = L[e.toLowerCase()];
|
|
405
|
+
return n === void 0 ? a("Color: Unknown color " + e) : this.setHex(n, t), this;
|
|
409
406
|
}
|
|
410
407
|
clone() {
|
|
411
408
|
return new this.constructor(this.r, this.g, this.b);
|
|
@@ -414,10 +411,10 @@ var H = class {
|
|
|
414
411
|
return this.r = e.r, this.g = e.g, this.b = e.b, this;
|
|
415
412
|
}
|
|
416
413
|
copySRGBToLinear(e) {
|
|
417
|
-
return this.r =
|
|
414
|
+
return this.r = F(e.r), this.g = F(e.g), this.b = F(e.b), this;
|
|
418
415
|
}
|
|
419
416
|
copyLinearToSRGB(e) {
|
|
420
|
-
return this.r =
|
|
417
|
+
return this.r = I(e.r), this.g = I(e.g), this.b = I(e.b), this;
|
|
421
418
|
}
|
|
422
419
|
convertSRGBToLinear() {
|
|
423
420
|
return this.copySRGBToLinear(this), this;
|
|
@@ -425,15 +422,15 @@ var H = class {
|
|
|
425
422
|
convertLinearToSRGB() {
|
|
426
423
|
return this.copyLinearToSRGB(this), this;
|
|
427
424
|
}
|
|
428
|
-
getHex(e =
|
|
429
|
-
return
|
|
425
|
+
getHex(e = i) {
|
|
426
|
+
return P.workingToColorSpace(H.copy(this), e), Math.round(g(H.r * 255, 0, 255)) * 65536 + Math.round(g(H.g * 255, 0, 255)) * 256 + Math.round(g(H.b * 255, 0, 255));
|
|
430
427
|
}
|
|
431
|
-
getHexString(e =
|
|
428
|
+
getHexString(e = i) {
|
|
432
429
|
return ("000000" + this.getHex(e).toString(16)).slice(-6);
|
|
433
430
|
}
|
|
434
|
-
getHSL(e, t =
|
|
435
|
-
|
|
436
|
-
let n =
|
|
431
|
+
getHSL(e, t = P.workingColorSpace) {
|
|
432
|
+
P.workingToColorSpace(H.copy(this), t);
|
|
433
|
+
let n = H.r, r = H.g, i = H.b, a = Math.max(n, r, i), o = Math.min(n, r, i), s, c, l = (o + a) / 2;
|
|
437
434
|
if (o === a) s = 0, c = 0;
|
|
438
435
|
else {
|
|
439
436
|
let e = a - o;
|
|
@@ -452,16 +449,16 @@ var H = class {
|
|
|
452
449
|
}
|
|
453
450
|
return e.h = s, e.s = c, e.l = l, e;
|
|
454
451
|
}
|
|
455
|
-
getRGB(e, t =
|
|
456
|
-
return
|
|
452
|
+
getRGB(e, t = P.workingColorSpace) {
|
|
453
|
+
return P.workingToColorSpace(H.copy(this), t), e.r = H.r, e.g = H.g, e.b = H.b, e;
|
|
457
454
|
}
|
|
458
|
-
getStyle(e =
|
|
459
|
-
|
|
460
|
-
let
|
|
461
|
-
return e === "srgb" ? `rgb(${Math.round(
|
|
455
|
+
getStyle(e = i) {
|
|
456
|
+
P.workingToColorSpace(H.copy(this), e);
|
|
457
|
+
let t = H.r, n = H.g, r = H.b;
|
|
458
|
+
return e === "srgb" ? `rgb(${Math.round(t * 255)},${Math.round(n * 255)},${Math.round(r * 255)})` : `color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${r.toFixed(3)})`;
|
|
462
459
|
}
|
|
463
460
|
offsetHSL(e, t, n) {
|
|
464
|
-
return this.getHSL(
|
|
461
|
+
return this.getHSL(R), this.setHSL(R.h + e, R.s + t, R.l + n);
|
|
465
462
|
}
|
|
466
463
|
add(e) {
|
|
467
464
|
return this.r += e.r, this.g += e.g, this.b += e.b, this;
|
|
@@ -488,8 +485,8 @@ var H = class {
|
|
|
488
485
|
return this.r = e.r + (t.r - e.r) * n, this.g = e.g + (t.g - e.g) * n, this.b = e.b + (t.b - e.b) * n, this;
|
|
489
486
|
}
|
|
490
487
|
lerpHSL(e, t) {
|
|
491
|
-
this.getHSL(
|
|
492
|
-
let n =
|
|
488
|
+
this.getHSL(R), e.getHSL(z);
|
|
489
|
+
let n = S(R.h, z.h, t), r = S(R.s, z.s, t), i = S(R.l, z.l, t);
|
|
493
490
|
return this.setHSL(n, r, i), this;
|
|
494
491
|
}
|
|
495
492
|
setFromVector3(e) {
|
|
@@ -517,13 +514,13 @@ var H = class {
|
|
|
517
514
|
*[Symbol.iterator]() {
|
|
518
515
|
yield this.r, yield this.g, yield this.b;
|
|
519
516
|
}
|
|
520
|
-
},
|
|
521
|
-
|
|
517
|
+
}, H = /* @__PURE__ */ new V();
|
|
518
|
+
V.NAMES = L;
|
|
522
519
|
//#endregion
|
|
523
520
|
//#region ../../node_modules/three/src/materials/Material.js
|
|
524
|
-
var
|
|
521
|
+
var U = 0, W = class extends v {
|
|
525
522
|
constructor() {
|
|
526
|
-
super(), this.isMaterial = !0, Object.defineProperty(this, "id", { value:
|
|
523
|
+
super(), this.isMaterial = !0, Object.defineProperty(this, "id", { value: U++ }), this.uuid = s(), this.name = "", this.type = "Material", this.blending = 1, this.side = 0, this.vertexColors = !1, this.opacity = 1, this.transparent = !1, this.alphaHash = !1, this.blendSrc = 204, this.blendDst = 205, this.blendEquation = 100, this.blendSrcAlpha = null, this.blendDstAlpha = null, this.blendEquationAlpha = null, this.blendColor = new V(0, 0, 0), this.blendAlpha = 0, this.depthFunc = 3, this.depthTest = !0, this.depthWrite = !0, this.stencilWriteMask = 255, this.stencilFunc = 519, this.stencilRef = 0, this.stencilFuncMask = 255, this.stencilFail = o, this.stencilZFail = o, this.stencilZPass = o, this.stencilWrite = !1, this.clippingPlanes = null, this.clipIntersection = !1, this.clipShadows = !1, this.shadowSide = null, this.colorWrite = !0, this.precision = null, this.polygonOffset = !1, this.polygonOffsetFactor = 0, this.polygonOffsetUnits = 0, this.dithering = !1, this.alphaToCoverage = !1, this.premultipliedAlpha = !1, this.forceSinglePass = !1, this.allowOverride = !0, this.visible = !0, this.toneMapped = !0, this.userData = {}, this.version = 0, this._alphaTest = 0;
|
|
527
524
|
}
|
|
528
525
|
get alphaTest() {
|
|
529
526
|
return this._alphaTest;
|
|
@@ -540,12 +537,12 @@ var te = 0, ne = class extends v {
|
|
|
540
537
|
if (e !== void 0) for (let t in e) {
|
|
541
538
|
let n = e[t];
|
|
542
539
|
if (n === void 0) {
|
|
543
|
-
|
|
540
|
+
a(`Material: parameter '${t}' has value of undefined.`);
|
|
544
541
|
continue;
|
|
545
542
|
}
|
|
546
543
|
let r = this[t];
|
|
547
544
|
if (r === void 0) {
|
|
548
|
-
|
|
545
|
+
a(`Material: '${t}' is not a property of THREE.${this.type}.`);
|
|
549
546
|
continue;
|
|
550
547
|
}
|
|
551
548
|
r && r.isColor ? r.set(n) : r && r.isVector2 && n && n.isVector2 || r && r.isEuler && n && n.isEuler || r && r.isVector3 && n && n.isVector3 ? r.copy(n) : this[t] = n;
|
|
@@ -562,7 +559,7 @@ var te = 0, ne = class extends v {
|
|
|
562
559
|
type: "Material",
|
|
563
560
|
generator: "Material.toJSON"
|
|
564
561
|
} };
|
|
565
|
-
n.uuid = this.uuid, n.type = this.type, this.
|
|
562
|
+
n.uuid = this.uuid, n.type = this.type, n.blending = this.blending, n.side = this.side, n.shadowSide = this.shadowSide, n.vertexColors = this.vertexColors, n.opacity = this.opacity, n.transparent = this.transparent, n.blendSrc = this.blendSrc, n.blendDst = this.blendDst, n.blendEquation = this.blendEquation, n.blendSrcAlpha = this.blendSrcAlpha, n.blendDstAlpha = this.blendDstAlpha, n.blendEquationAlpha = this.blendEquationAlpha, n.blendColor = this.blendColor.getHex(), n.blendAlpha = this.blendAlpha, n.depthFunc = this.depthFunc, n.depthTest = this.depthTest, n.depthWrite = this.depthWrite, n.colorWrite = this.colorWrite, n.clipIntersection = this.clipIntersection, n.clipShadows = this.clipShadows, n.stencilWriteMask = this.stencilWriteMask, n.stencilFunc = this.stencilFunc, n.stencilRef = this.stencilRef, n.stencilFuncMask = this.stencilFuncMask, n.stencilFail = this.stencilFail, n.stencilZFail = this.stencilZFail, n.stencilZPass = this.stencilZPass, n.stencilWrite = this.stencilWrite, n.polygonOffset = this.polygonOffset, n.polygonOffsetFactor = this.polygonOffsetFactor, n.polygonOffsetUnits = this.polygonOffsetUnits, n.dithering = this.dithering, n.alphaTest = this.alphaTest, n.alphaHash = this.alphaHash, n.alphaToCoverage = this.alphaToCoverage, n.premultipliedAlpha = this.premultipliedAlpha, n.forceSinglePass = this.forceSinglePass, n.allowOverride = this.allowOverride, n.visible = this.visible, n.toneMapped = this.toneMapped, n.name = this.name, this.color && this.color.isColor && (n.color = this.color.getHex()), this.roughness !== void 0 && (n.roughness = this.roughness), this.metalness !== void 0 && (n.metalness = this.metalness), this.sheen !== void 0 && (n.sheen = this.sheen), this.sheenColor && this.sheenColor.isColor && (n.sheenColor = this.sheenColor.getHex()), this.sheenRoughness !== void 0 && (n.sheenRoughness = this.sheenRoughness), this.emissive && this.emissive.isColor && (n.emissive = this.emissive.getHex()), this.emissiveIntensity !== void 0 && (n.emissiveIntensity = this.emissiveIntensity), this.specular && this.specular.isColor && (n.specular = this.specular.getHex()), this.specularIntensity !== void 0 && (n.specularIntensity = this.specularIntensity), this.specularColor && this.specularColor.isColor && (n.specularColor = this.specularColor.getHex()), this.shininess !== void 0 && (n.shininess = this.shininess), this.clearcoat !== void 0 && (n.clearcoat = this.clearcoat), this.clearcoatRoughness !== void 0 && (n.clearcoatRoughness = this.clearcoatRoughness), this.clearcoatMap && this.clearcoatMap.isTexture && (n.clearcoatMap = this.clearcoatMap.toJSON(e).uuid), this.clearcoatRoughnessMap && this.clearcoatRoughnessMap.isTexture && (n.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON(e).uuid), this.clearcoatNormalMap && this.clearcoatNormalMap.isTexture && (n.clearcoatNormalMap = this.clearcoatNormalMap.toJSON(e).uuid, n.clearcoatNormalScale = this.clearcoatNormalScale.toArray()), this.sheenColorMap && this.sheenColorMap.isTexture && (n.sheenColorMap = this.sheenColorMap.toJSON(e).uuid), this.sheenRoughnessMap && this.sheenRoughnessMap.isTexture && (n.sheenRoughnessMap = this.sheenRoughnessMap.toJSON(e).uuid), this.dispersion !== void 0 && (n.dispersion = this.dispersion), this.retroreflectivity !== void 0 && (n.retroreflectivity = this.retroreflectivity), this.iridescence !== void 0 && (n.iridescence = this.iridescence), this.iridescenceIOR !== void 0 && (n.iridescenceIOR = this.iridescenceIOR), this.iridescenceThicknessRange !== void 0 && (n.iridescenceThicknessRange = this.iridescenceThicknessRange), this.iridescenceMap && this.iridescenceMap.isTexture && (n.iridescenceMap = this.iridescenceMap.toJSON(e).uuid), this.iridescenceThicknessMap && this.iridescenceThicknessMap.isTexture && (n.iridescenceThicknessMap = this.iridescenceThicknessMap.toJSON(e).uuid), this.anisotropy !== void 0 && (n.anisotropy = this.anisotropy), this.anisotropyRotation !== void 0 && (n.anisotropyRotation = this.anisotropyRotation), this.anisotropyMap && this.anisotropyMap.isTexture && (n.anisotropyMap = this.anisotropyMap.toJSON(e).uuid), this.map && this.map.isTexture && (n.map = this.map.toJSON(e).uuid), this.matcap && this.matcap.isTexture && (n.matcap = this.matcap.toJSON(e).uuid), this.alphaMap && this.alphaMap.isTexture && (n.alphaMap = this.alphaMap.toJSON(e).uuid), this.lightMap && this.lightMap.isTexture && (n.lightMap = this.lightMap.toJSON(e).uuid, n.lightMapIntensity = this.lightMapIntensity), this.aoMap && this.aoMap.isTexture && (n.aoMap = this.aoMap.toJSON(e).uuid, n.aoMapIntensity = this.aoMapIntensity), this.bumpMap && this.bumpMap.isTexture && (n.bumpMap = this.bumpMap.toJSON(e).uuid, n.bumpScale = this.bumpScale), this.normalMap && this.normalMap.isTexture && (n.normalMap = this.normalMap.toJSON(e).uuid, n.normalMapType = this.normalMapType, n.normalScale = this.normalScale.toArray()), this.displacementMap && this.displacementMap.isTexture && (n.displacementMap = this.displacementMap.toJSON(e).uuid, n.displacementScale = this.displacementScale, n.displacementBias = this.displacementBias), this.roughnessMap && this.roughnessMap.isTexture && (n.roughnessMap = this.roughnessMap.toJSON(e).uuid), this.metalnessMap && this.metalnessMap.isTexture && (n.metalnessMap = this.metalnessMap.toJSON(e).uuid), this.emissiveMap && this.emissiveMap.isTexture && (n.emissiveMap = this.emissiveMap.toJSON(e).uuid), this.specularMap && this.specularMap.isTexture && (n.specularMap = this.specularMap.toJSON(e).uuid), this.specularIntensityMap && this.specularIntensityMap.isTexture && (n.specularIntensityMap = this.specularIntensityMap.toJSON(e).uuid), this.specularColorMap && this.specularColorMap.isTexture && (n.specularColorMap = this.specularColorMap.toJSON(e).uuid), this.envMap && this.envMap.isTexture && (n.envMap = this.envMap.toJSON(e).uuid, this.combine !== void 0 && (n.combine = this.combine)), this.envMapRotation !== void 0 && (n.envMapRotation = this.envMapRotation.toArray()), this.envMapIntensity !== void 0 && (n.envMapIntensity = this.envMapIntensity), this.reflectivity !== void 0 && (n.reflectivity = this.reflectivity), this.refractionRatio !== void 0 && (n.refractionRatio = this.refractionRatio), this.gradientMap && this.gradientMap.isTexture && (n.gradientMap = this.gradientMap.toJSON(e).uuid), this.transmission !== void 0 && (n.transmission = this.transmission), this.transmissionMap && this.transmissionMap.isTexture && (n.transmissionMap = this.transmissionMap.toJSON(e).uuid), this.thickness !== void 0 && (n.thickness = this.thickness), this.thicknessMap && this.thicknessMap.isTexture && (n.thicknessMap = this.thicknessMap.toJSON(e).uuid), this.attenuationDistance !== void 0 && (n.attenuationDistance = this.attenuationDistance), this.attenuationColor !== void 0 && (n.attenuationColor = this.attenuationColor.getHex()), this.size !== void 0 && (n.size = this.size), this.sizeAttenuation !== void 0 && (n.sizeAttenuation = this.sizeAttenuation), Array.isArray(this.clippingPlanes) && this.clippingPlanes.length > 0 && (n.clippingPlanes = this.clippingPlanes.map((e) => e.toJSON())), this.rotation !== void 0 && (n.rotation = this.rotation), this.depthPacking !== void 0 && (n.depthPacking = this.depthPacking), this.linewidth !== void 0 && (n.linewidth = this.linewidth), this.linecap !== void 0 && (n.linecap = this.linecap), this.linejoin !== void 0 && (n.linejoin = this.linejoin), this.dashSize !== void 0 && (n.dashSize = this.dashSize), this.gapSize !== void 0 && (n.gapSize = this.gapSize), this.scale !== void 0 && (n.scale = this.scale), this.wireframe !== void 0 && (n.wireframe = this.wireframe), this.wireframeLinewidth !== void 0 && (n.wireframeLinewidth = this.wireframeLinewidth), this.wireframeLinecap !== void 0 && (n.wireframeLinecap = this.wireframeLinecap), this.wireframeLinejoin !== void 0 && (n.wireframeLinejoin = this.wireframeLinejoin), this.flatShading !== void 0 && (n.flatShading = this.flatShading), this.fog !== void 0 && (n.fog = this.fog), Object.keys(this.userData).length > 0 && (n.userData = this.userData);
|
|
566
563
|
function r(e) {
|
|
567
564
|
let t = [];
|
|
568
565
|
for (let n in e) {
|
|
@@ -578,11 +575,11 @@ var te = 0, ne = class extends v {
|
|
|
578
575
|
return n;
|
|
579
576
|
}
|
|
580
577
|
fromJSON(e, t) {
|
|
581
|
-
if (e.uuid !== void 0 && (this.uuid = e.uuid), e.name !== void 0 && (this.name = e.name), e.color !== void 0 && this.color !== void 0 && this.color.setHex(e.color), e.roughness !== void 0 && (this.roughness = e.roughness), e.metalness !== void 0 && (this.metalness = e.metalness), e.sheen !== void 0 && (this.sheen = e.sheen), e.sheenColor !== void 0 && (this.sheenColor = new
|
|
578
|
+
if (e.uuid !== void 0 && (this.uuid = e.uuid), e.name !== void 0 && (this.name = e.name), e.color !== void 0 && this.color !== void 0 && this.color.setHex(e.color), e.roughness !== void 0 && (this.roughness = e.roughness), e.metalness !== void 0 && (this.metalness = e.metalness), e.sheen !== void 0 && (this.sheen = e.sheen), e.sheenColor !== void 0 && (this.sheenColor = new V().setHex(e.sheenColor)), e.sheenRoughness !== void 0 && (this.sheenRoughness = e.sheenRoughness), e.emissive !== void 0 && this.emissive !== void 0 && this.emissive.setHex(e.emissive), e.specular !== void 0 && this.specular !== void 0 && this.specular.setHex(e.specular), e.specularIntensity !== void 0 && (this.specularIntensity = e.specularIntensity), e.specularColor !== void 0 && this.specularColor !== void 0 && this.specularColor.setHex(e.specularColor), e.shininess !== void 0 && (this.shininess = e.shininess), e.clearcoat !== void 0 && (this.clearcoat = e.clearcoat), e.clearcoatRoughness !== void 0 && (this.clearcoatRoughness = e.clearcoatRoughness), e.dispersion !== void 0 && (this.dispersion = e.dispersion), e.retroreflectivity !== void 0 && (this.retroreflectivity = e.retroreflectivity), e.iridescence !== void 0 && (this.iridescence = e.iridescence), e.iridescenceIOR !== void 0 && (this.iridescenceIOR = e.iridescenceIOR), e.iridescenceThicknessRange !== void 0 && (this.iridescenceThicknessRange = e.iridescenceThicknessRange), e.transmission !== void 0 && (this.transmission = e.transmission), e.thickness !== void 0 && (this.thickness = e.thickness), e.attenuationDistance !== void 0 && (this.attenuationDistance = e.attenuationDistance), e.attenuationColor !== void 0 && this.attenuationColor !== void 0 && this.attenuationColor.setHex(e.attenuationColor), e.anisotropy !== void 0 && (this.anisotropy = e.anisotropy), e.anisotropyRotation !== void 0 && (this.anisotropyRotation = e.anisotropyRotation), e.fog !== void 0 && (this.fog = e.fog), e.flatShading !== void 0 && (this.flatShading = e.flatShading), e.blending !== void 0 && (this.blending = e.blending), e.combine !== void 0 && (this.combine = e.combine), e.side !== void 0 && (this.side = e.side), e.shadowSide !== void 0 && (this.shadowSide = e.shadowSide), e.opacity !== void 0 && (this.opacity = e.opacity), e.transparent !== void 0 && (this.transparent = e.transparent), e.alphaTest !== void 0 && (this.alphaTest = e.alphaTest), e.alphaHash !== void 0 && (this.alphaHash = e.alphaHash), e.depthFunc !== void 0 && (this.depthFunc = e.depthFunc), e.depthTest !== void 0 && (this.depthTest = e.depthTest), e.depthWrite !== void 0 && (this.depthWrite = e.depthWrite), e.colorWrite !== void 0 && (this.colorWrite = e.colorWrite), e.clippingPlanes !== void 0 && (this.clippingPlanes = e.clippingPlanes.map((e) => new p().fromJSON(e))), e.clipIntersection !== void 0 && (this.clipIntersection = e.clipIntersection), e.clipShadows !== void 0 && (this.clipShadows = e.clipShadows), e.depthPacking !== void 0 && (this.depthPacking = e.depthPacking), e.blendSrc !== void 0 && (this.blendSrc = e.blendSrc), e.blendDst !== void 0 && (this.blendDst = e.blendDst), e.blendEquation !== void 0 && (this.blendEquation = e.blendEquation), e.blendSrcAlpha !== void 0 && (this.blendSrcAlpha = e.blendSrcAlpha), e.blendDstAlpha !== void 0 && (this.blendDstAlpha = e.blendDstAlpha), e.blendEquationAlpha !== void 0 && (this.blendEquationAlpha = e.blendEquationAlpha), e.blendColor !== void 0 && this.blendColor !== void 0 && this.blendColor.setHex(e.blendColor), e.blendAlpha !== void 0 && (this.blendAlpha = e.blendAlpha), e.stencilWriteMask !== void 0 && (this.stencilWriteMask = e.stencilWriteMask), e.stencilFunc !== void 0 && (this.stencilFunc = e.stencilFunc), e.stencilRef !== void 0 && (this.stencilRef = e.stencilRef), e.stencilFuncMask !== void 0 && (this.stencilFuncMask = e.stencilFuncMask), e.stencilFail !== void 0 && (this.stencilFail = e.stencilFail), e.stencilZFail !== void 0 && (this.stencilZFail = e.stencilZFail), e.stencilZPass !== void 0 && (this.stencilZPass = e.stencilZPass), e.stencilWrite !== void 0 && (this.stencilWrite = e.stencilWrite), e.wireframe !== void 0 && (this.wireframe = e.wireframe), e.wireframeLinewidth !== void 0 && (this.wireframeLinewidth = e.wireframeLinewidth), e.wireframeLinecap !== void 0 && (this.wireframeLinecap = e.wireframeLinecap), e.wireframeLinejoin !== void 0 && (this.wireframeLinejoin = e.wireframeLinejoin), e.rotation !== void 0 && (this.rotation = e.rotation), e.linewidth !== void 0 && (this.linewidth = e.linewidth), e.linecap !== void 0 && (this.linecap = e.linecap), e.linejoin !== void 0 && (this.linejoin = e.linejoin), e.dashSize !== void 0 && (this.dashSize = e.dashSize), e.gapSize !== void 0 && (this.gapSize = e.gapSize), e.scale !== void 0 && (this.scale = e.scale), e.polygonOffset !== void 0 && (this.polygonOffset = e.polygonOffset), e.polygonOffsetFactor !== void 0 && (this.polygonOffsetFactor = e.polygonOffsetFactor), e.polygonOffsetUnits !== void 0 && (this.polygonOffsetUnits = e.polygonOffsetUnits), e.dithering !== void 0 && (this.dithering = e.dithering), e.alphaToCoverage !== void 0 && (this.alphaToCoverage = e.alphaToCoverage), e.premultipliedAlpha !== void 0 && (this.premultipliedAlpha = e.premultipliedAlpha), e.forceSinglePass !== void 0 && (this.forceSinglePass = e.forceSinglePass), e.allowOverride !== void 0 && (this.allowOverride = e.allowOverride), e.visible !== void 0 && (this.visible = e.visible), e.toneMapped !== void 0 && (this.toneMapped = e.toneMapped), e.userData !== void 0 && (this.userData = e.userData), e.vertexColors !== void 0 && (typeof e.vertexColors == "number" ? this.vertexColors = e.vertexColors > 0 : this.vertexColors = e.vertexColors), e.size !== void 0 && (this.size = e.size), e.sizeAttenuation !== void 0 && (this.sizeAttenuation = e.sizeAttenuation), e.map !== void 0 && (this.map = t[e.map] || null), e.matcap !== void 0 && (this.matcap = t[e.matcap] || null), e.alphaMap !== void 0 && (this.alphaMap = t[e.alphaMap] || null), e.bumpMap !== void 0 && (this.bumpMap = t[e.bumpMap] || null), e.bumpScale !== void 0 && (this.bumpScale = e.bumpScale), e.normalMap !== void 0 && (this.normalMap = t[e.normalMap] || null), e.normalMapType !== void 0 && (this.normalMapType = e.normalMapType), e.normalScale !== void 0) {
|
|
582
579
|
let t = e.normalScale;
|
|
583
|
-
Array.isArray(t) === !1 && (t = [t, t]), this.normalScale = new
|
|
580
|
+
Array.isArray(t) === !1 && (t = [t, t]), this.normalScale = new u().fromArray(t);
|
|
584
581
|
}
|
|
585
|
-
return e.displacementMap !== void 0 && (this.displacementMap = t[e.displacementMap] || null), e.displacementScale !== void 0 && (this.displacementScale = e.displacementScale), e.displacementBias !== void 0 && (this.displacementBias = e.displacementBias), e.roughnessMap !== void 0 && (this.roughnessMap = t[e.roughnessMap] || null), e.metalnessMap !== void 0 && (this.metalnessMap = t[e.metalnessMap] || null), e.emissiveMap !== void 0 && (this.emissiveMap = t[e.emissiveMap] || null), e.emissiveIntensity !== void 0 && (this.emissiveIntensity = e.emissiveIntensity), e.specularMap !== void 0 && (this.specularMap = t[e.specularMap] || null), e.specularIntensityMap !== void 0 && (this.specularIntensityMap = t[e.specularIntensityMap] || null), e.specularColorMap !== void 0 && (this.specularColorMap = t[e.specularColorMap] || null), e.envMap !== void 0 && (this.envMap = t[e.envMap] || null), e.envMapRotation !== void 0 && this.envMapRotation.fromArray(e.envMapRotation), e.envMapIntensity !== void 0 && (this.envMapIntensity = e.envMapIntensity), e.reflectivity !== void 0 && (this.reflectivity = e.reflectivity), e.refractionRatio !== void 0 && (this.refractionRatio = e.refractionRatio), e.lightMap !== void 0 && (this.lightMap = t[e.lightMap] || null), e.lightMapIntensity !== void 0 && (this.lightMapIntensity = e.lightMapIntensity), e.aoMap !== void 0 && (this.aoMap = t[e.aoMap] || null), e.aoMapIntensity !== void 0 && (this.aoMapIntensity = e.aoMapIntensity), e.gradientMap !== void 0 && (this.gradientMap = t[e.gradientMap] || null), e.clearcoatMap !== void 0 && (this.clearcoatMap = t[e.clearcoatMap] || null), e.clearcoatRoughnessMap !== void 0 && (this.clearcoatRoughnessMap = t[e.clearcoatRoughnessMap] || null), e.clearcoatNormalMap !== void 0 && (this.clearcoatNormalMap = t[e.clearcoatNormalMap] || null), e.clearcoatNormalScale !== void 0 && (this.clearcoatNormalScale = new
|
|
582
|
+
return e.displacementMap !== void 0 && (this.displacementMap = t[e.displacementMap] || null), e.displacementScale !== void 0 && (this.displacementScale = e.displacementScale), e.displacementBias !== void 0 && (this.displacementBias = e.displacementBias), e.roughnessMap !== void 0 && (this.roughnessMap = t[e.roughnessMap] || null), e.metalnessMap !== void 0 && (this.metalnessMap = t[e.metalnessMap] || null), e.emissiveMap !== void 0 && (this.emissiveMap = t[e.emissiveMap] || null), e.emissiveIntensity !== void 0 && (this.emissiveIntensity = e.emissiveIntensity), e.specularMap !== void 0 && (this.specularMap = t[e.specularMap] || null), e.specularIntensityMap !== void 0 && (this.specularIntensityMap = t[e.specularIntensityMap] || null), e.specularColorMap !== void 0 && (this.specularColorMap = t[e.specularColorMap] || null), e.envMap !== void 0 && (this.envMap = t[e.envMap] || null), e.envMapRotation !== void 0 && this.envMapRotation.fromArray(e.envMapRotation), e.envMapIntensity !== void 0 && (this.envMapIntensity = e.envMapIntensity), e.reflectivity !== void 0 && (this.reflectivity = e.reflectivity), e.refractionRatio !== void 0 && (this.refractionRatio = e.refractionRatio), e.lightMap !== void 0 && (this.lightMap = t[e.lightMap] || null), e.lightMapIntensity !== void 0 && (this.lightMapIntensity = e.lightMapIntensity), e.aoMap !== void 0 && (this.aoMap = t[e.aoMap] || null), e.aoMapIntensity !== void 0 && (this.aoMapIntensity = e.aoMapIntensity), e.gradientMap !== void 0 && (this.gradientMap = t[e.gradientMap] || null), e.clearcoatMap !== void 0 && (this.clearcoatMap = t[e.clearcoatMap] || null), e.clearcoatRoughnessMap !== void 0 && (this.clearcoatRoughnessMap = t[e.clearcoatRoughnessMap] || null), e.clearcoatNormalMap !== void 0 && (this.clearcoatNormalMap = t[e.clearcoatNormalMap] || null), e.clearcoatNormalScale !== void 0 && (this.clearcoatNormalScale = new u().fromArray(e.clearcoatNormalScale)), e.iridescenceMap !== void 0 && (this.iridescenceMap = t[e.iridescenceMap] || null), e.iridescenceThicknessMap !== void 0 && (this.iridescenceThicknessMap = t[e.iridescenceThicknessMap] || null), e.transmissionMap !== void 0 && (this.transmissionMap = t[e.transmissionMap] || null), e.thicknessMap !== void 0 && (this.thicknessMap = t[e.thicknessMap] || null), e.anisotropyMap !== void 0 && (this.anisotropyMap = t[e.anisotropyMap] || null), e.sheenColorMap !== void 0 && (this.sheenColorMap = t[e.sheenColorMap] || null), e.sheenRoughnessMap !== void 0 && (this.sheenRoughnessMap = t[e.sheenRoughnessMap] || null), this;
|
|
586
583
|
}
|
|
587
584
|
clone() {
|
|
588
585
|
return new this.constructor().copy(this);
|
|
@@ -603,10 +600,10 @@ var te = 0, ne = class extends v {
|
|
|
603
600
|
set needsUpdate(e) {
|
|
604
601
|
e === !0 && this.version++;
|
|
605
602
|
}
|
|
606
|
-
},
|
|
603
|
+
}, G = /* @__PURE__ */ new x(), K = /* @__PURE__ */ new u(), q = 0, J = class extends v {
|
|
607
604
|
constructor(t, n, r = !1) {
|
|
608
605
|
if (super(), Array.isArray(t)) throw TypeError("THREE.BufferAttribute: array should be a Typed Array.");
|
|
609
|
-
this.isBufferAttribute = !0, Object.defineProperty(this, "id", { value:
|
|
606
|
+
this.isBufferAttribute = !0, Object.defineProperty(this, "id", { value: q++ }), this.name = "", this.array = t, this.itemSize = n, this.count = t === void 0 ? 0 : t.length / n, this.normalized = r, this.usage = e, this.updateRanges = [], this.gpuType = C, this.version = 0;
|
|
610
607
|
}
|
|
611
608
|
onUploadCallback() {}
|
|
612
609
|
set needsUpdate(e) {
|
|
@@ -636,20 +633,20 @@ var te = 0, ne = class extends v {
|
|
|
636
633
|
return this.array.set(e), this;
|
|
637
634
|
}
|
|
638
635
|
applyMatrix3(e) {
|
|
639
|
-
if (this.itemSize === 2) for (let t = 0, n = this.count; t < n; t++)
|
|
640
|
-
else if (this.itemSize === 3) for (let t = 0, n = this.count; t < n; t++)
|
|
636
|
+
if (this.itemSize === 2) for (let t = 0, n = this.count; t < n; t++) K.fromBufferAttribute(this, t), K.applyMatrix3(e), this.setXY(t, K.x, K.y);
|
|
637
|
+
else if (this.itemSize === 3) for (let t = 0, n = this.count; t < n; t++) G.fromBufferAttribute(this, t), G.applyMatrix3(e), this.setXYZ(t, G.x, G.y, G.z);
|
|
641
638
|
return this;
|
|
642
639
|
}
|
|
643
640
|
applyMatrix4(e) {
|
|
644
|
-
for (let t = 0, n = this.count; t < n; t++)
|
|
641
|
+
for (let t = 0, n = this.count; t < n; t++) G.fromBufferAttribute(this, t), G.applyMatrix4(e), this.setXYZ(t, G.x, G.y, G.z);
|
|
645
642
|
return this;
|
|
646
643
|
}
|
|
647
644
|
applyNormalMatrix(e) {
|
|
648
|
-
for (let t = 0, n = this.count; t < n; t++)
|
|
645
|
+
for (let t = 0, n = this.count; t < n; t++) G.fromBufferAttribute(this, t), G.applyNormalMatrix(e), this.setXYZ(t, G.x, G.y, G.z);
|
|
649
646
|
return this;
|
|
650
647
|
}
|
|
651
648
|
transformDirection(e) {
|
|
652
|
-
for (let t = 0, n = this.count; t < n; t++)
|
|
649
|
+
for (let t = 0, n = this.count; t < n; t++) G.fromBufferAttribute(this, t), G.transformDirection(e), this.setXYZ(t, G.x, G.y, G.z);
|
|
653
650
|
return this;
|
|
654
651
|
}
|
|
655
652
|
set(e, t = 0) {
|
|
@@ -657,47 +654,47 @@ var te = 0, ne = class extends v {
|
|
|
657
654
|
}
|
|
658
655
|
getComponent(e, t) {
|
|
659
656
|
let n = this.array[e * this.itemSize + t];
|
|
660
|
-
return this.normalized && (n =
|
|
657
|
+
return this.normalized && (n = f(n, this.array)), n;
|
|
661
658
|
}
|
|
662
659
|
setComponent(e, t, n) {
|
|
663
|
-
return this.normalized && (n =
|
|
660
|
+
return this.normalized && (n = T(n, this.array)), this.array[e * this.itemSize + t] = n, this;
|
|
664
661
|
}
|
|
665
662
|
getX(e) {
|
|
666
663
|
let t = this.array[e * this.itemSize];
|
|
667
|
-
return this.normalized && (t =
|
|
664
|
+
return this.normalized && (t = f(t, this.array)), t;
|
|
668
665
|
}
|
|
669
666
|
setX(e, t) {
|
|
670
|
-
return this.normalized && (t =
|
|
667
|
+
return this.normalized && (t = T(t, this.array)), this.array[e * this.itemSize] = t, this;
|
|
671
668
|
}
|
|
672
669
|
getY(e) {
|
|
673
670
|
let t = this.array[e * this.itemSize + 1];
|
|
674
|
-
return this.normalized && (t =
|
|
671
|
+
return this.normalized && (t = f(t, this.array)), t;
|
|
675
672
|
}
|
|
676
673
|
setY(e, t) {
|
|
677
|
-
return this.normalized && (t =
|
|
674
|
+
return this.normalized && (t = T(t, this.array)), this.array[e * this.itemSize + 1] = t, this;
|
|
678
675
|
}
|
|
679
676
|
getZ(e) {
|
|
680
677
|
let t = this.array[e * this.itemSize + 2];
|
|
681
|
-
return this.normalized && (t =
|
|
678
|
+
return this.normalized && (t = f(t, this.array)), t;
|
|
682
679
|
}
|
|
683
680
|
setZ(e, t) {
|
|
684
|
-
return this.normalized && (t =
|
|
681
|
+
return this.normalized && (t = T(t, this.array)), this.array[e * this.itemSize + 2] = t, this;
|
|
685
682
|
}
|
|
686
683
|
getW(e) {
|
|
687
684
|
let t = this.array[e * this.itemSize + 3];
|
|
688
|
-
return this.normalized && (t =
|
|
685
|
+
return this.normalized && (t = f(t, this.array)), t;
|
|
689
686
|
}
|
|
690
687
|
setW(e, t) {
|
|
691
|
-
return this.normalized && (t =
|
|
688
|
+
return this.normalized && (t = T(t, this.array)), this.array[e * this.itemSize + 3] = t, this;
|
|
692
689
|
}
|
|
693
690
|
setXY(e, t, n) {
|
|
694
|
-
return e *= this.itemSize, this.normalized && (t =
|
|
691
|
+
return e *= this.itemSize, this.normalized && (t = T(t, this.array), n = T(n, this.array)), this.array[e + 0] = t, this.array[e + 1] = n, this;
|
|
695
692
|
}
|
|
696
693
|
setXYZ(e, t, n, r) {
|
|
697
|
-
return e *= this.itemSize, this.normalized && (t =
|
|
694
|
+
return e *= this.itemSize, this.normalized && (t = T(t, this.array), n = T(n, this.array), r = T(r, this.array)), this.array[e + 0] = t, this.array[e + 1] = n, this.array[e + 2] = r, this;
|
|
698
695
|
}
|
|
699
696
|
setXYZW(e, t, n, r, i) {
|
|
700
|
-
return e *= this.itemSize, this.normalized && (t =
|
|
697
|
+
return e *= this.itemSize, this.normalized && (t = T(t, this.array), n = T(n, this.array), r = T(r, this.array), i = T(i, this.array)), this.array[e + 0] = t, this.array[e + 1] = n, this.array[e + 2] = r, this.array[e + 3] = i, this;
|
|
701
698
|
}
|
|
702
699
|
onUpload(e) {
|
|
703
700
|
return this.onUploadCallback = e, this;
|
|
@@ -712,26 +709,26 @@ var te = 0, ne = class extends v {
|
|
|
712
709
|
array: Array.from(this.array),
|
|
713
710
|
normalized: this.normalized
|
|
714
711
|
};
|
|
715
|
-
return
|
|
712
|
+
return e.name = this.name, e.usage = this.usage, e.gpuType = this.gpuType, e;
|
|
716
713
|
}
|
|
717
714
|
dispose() {
|
|
718
715
|
this.dispatchEvent({ type: "dispose" });
|
|
719
716
|
}
|
|
720
|
-
},
|
|
717
|
+
}, ee = class extends J {
|
|
721
718
|
constructor(e, t, n) {
|
|
722
719
|
super(new Uint16Array(e), t, n);
|
|
723
720
|
}
|
|
724
|
-
},
|
|
721
|
+
}, te = class extends J {
|
|
725
722
|
constructor(e, t, n) {
|
|
726
723
|
super(new Uint32Array(e), t, n);
|
|
727
724
|
}
|
|
728
|
-
},
|
|
725
|
+
}, ne = class extends J {
|
|
729
726
|
constructor(e, t, n) {
|
|
730
727
|
super(new Float32Array(e), t, n);
|
|
731
728
|
}
|
|
732
|
-
},
|
|
729
|
+
}, re = 0, Y = /* @__PURE__ */ new h(), ie = /* @__PURE__ */ new b(), X = /* @__PURE__ */ new x(), Z = /* @__PURE__ */ new y(), Q = /* @__PURE__ */ new y(), $ = /* @__PURE__ */ new x(), ae = class e extends v {
|
|
733
730
|
constructor() {
|
|
734
|
-
super(), this.isBufferGeometry = !0, Object.defineProperty(this, "id", { value:
|
|
731
|
+
super(), this.isBufferGeometry = !0, Object.defineProperty(this, "id", { value: re++ }), this.uuid = s(), this.name = "", this.type = "BufferGeometry", this.index = null, this.indirect = null, this.indirectOffset = 0, this.attributes = {}, this.morphAttributes = {}, this.morphTargetsRelative = !1, this.groups = [], this.boundingBox = null, this.boundingSphere = null, this.drawRange = {
|
|
735
732
|
start: 0,
|
|
736
733
|
count: Infinity
|
|
737
734
|
}, this.userData = {}, this._transformed = !1;
|
|
@@ -740,7 +737,7 @@ var te = 0, ne = class extends v {
|
|
|
740
737
|
return this.index;
|
|
741
738
|
}
|
|
742
739
|
setIndex(e) {
|
|
743
|
-
return Array.isArray(e) ? this.index = new (
|
|
740
|
+
return Array.isArray(e) ? this.index = new (l(e) ? te : ee)(e, 1) : this.index = e, this;
|
|
744
741
|
}
|
|
745
742
|
setIndirect(e, t = 0) {
|
|
746
743
|
return this.indirect = e, this.indirectOffset = t, this;
|
|
@@ -778,32 +775,32 @@ var te = 0, ne = class extends v {
|
|
|
778
775
|
t !== void 0 && (t.applyMatrix4(e), t.needsUpdate = !0);
|
|
779
776
|
let n = this.attributes.normal;
|
|
780
777
|
if (n !== void 0) {
|
|
781
|
-
let t = new
|
|
778
|
+
let t = new c().getNormalMatrix(e);
|
|
782
779
|
n.applyNormalMatrix(t), n.needsUpdate = !0;
|
|
783
780
|
}
|
|
784
781
|
let r = this.attributes.tangent;
|
|
785
782
|
return r !== void 0 && (r.transformDirection(e), r.needsUpdate = !0), this.boundingBox !== null && this.computeBoundingBox(), this.boundingSphere !== null && this.computeBoundingSphere(), this._transformed = !0, this;
|
|
786
783
|
}
|
|
787
784
|
applyQuaternion(e) {
|
|
788
|
-
return
|
|
785
|
+
return Y.makeRotationFromQuaternion(e), this.applyMatrix4(Y), this;
|
|
789
786
|
}
|
|
790
787
|
rotateX(e) {
|
|
791
|
-
return
|
|
788
|
+
return Y.makeRotationX(e), this.applyMatrix4(Y), this;
|
|
792
789
|
}
|
|
793
790
|
rotateY(e) {
|
|
794
|
-
return
|
|
791
|
+
return Y.makeRotationY(e), this.applyMatrix4(Y), this;
|
|
795
792
|
}
|
|
796
793
|
rotateZ(e) {
|
|
797
|
-
return
|
|
794
|
+
return Y.makeRotationZ(e), this.applyMatrix4(Y), this;
|
|
798
795
|
}
|
|
799
796
|
translate(e, t, n) {
|
|
800
|
-
return
|
|
797
|
+
return Y.makeTranslation(e, t, n), this.applyMatrix4(Y), this;
|
|
801
798
|
}
|
|
802
799
|
scale(e, t, n) {
|
|
803
|
-
return
|
|
800
|
+
return Y.makeScale(e, t, n), this.applyMatrix4(Y), this;
|
|
804
801
|
}
|
|
805
802
|
lookAt(e) {
|
|
806
|
-
return
|
|
803
|
+
return ie.lookAt(e), ie.updateMatrix(), this.applyMatrix4(ie.matrix), this;
|
|
807
804
|
}
|
|
808
805
|
center() {
|
|
809
806
|
return this.computeBoundingBox(), this.boundingBox.getCenter(X).negate(), this.translate(X.x, X.y, X.z), this;
|
|
@@ -816,22 +813,22 @@ var te = 0, ne = class extends v {
|
|
|
816
813
|
let r = e[n];
|
|
817
814
|
t.push(r.x, r.y, r.z || 0);
|
|
818
815
|
}
|
|
819
|
-
this.setAttribute("position", new
|
|
816
|
+
this.setAttribute("position", new ne(t, 3));
|
|
820
817
|
} else {
|
|
821
818
|
let n = Math.min(e.length, t.count);
|
|
822
819
|
for (let r = 0; r < n; r++) {
|
|
823
820
|
let n = e[r];
|
|
824
821
|
t.setXYZ(r, n.x, n.y, n.z || 0);
|
|
825
822
|
}
|
|
826
|
-
e.length > t.count &&
|
|
823
|
+
e.length > t.count && a("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."), t.needsUpdate = !0;
|
|
827
824
|
}
|
|
828
825
|
return this;
|
|
829
826
|
}
|
|
830
827
|
computeBoundingBox() {
|
|
831
|
-
this.boundingBox === null && (this.boundingBox = new
|
|
828
|
+
this.boundingBox === null && (this.boundingBox = new y());
|
|
832
829
|
let e = this.attributes.position, t = this.morphAttributes.position;
|
|
833
830
|
if (e && e.isGLBufferAttribute) {
|
|
834
|
-
|
|
831
|
+
w("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.", this), this.boundingBox.set(new x(-Infinity, -Infinity, -Infinity), new x(Infinity, Infinity, Infinity));
|
|
835
832
|
return;
|
|
836
833
|
}
|
|
837
834
|
if (e !== void 0) {
|
|
@@ -840,13 +837,13 @@ var te = 0, ne = class extends v {
|
|
|
840
837
|
Z.setFromBufferAttribute(n), this.morphTargetsRelative ? ($.addVectors(this.boundingBox.min, Z.min), this.boundingBox.expandByPoint($), $.addVectors(this.boundingBox.max, Z.max), this.boundingBox.expandByPoint($)) : (this.boundingBox.expandByPoint(Z.min), this.boundingBox.expandByPoint(Z.max));
|
|
841
838
|
}
|
|
842
839
|
} else this.boundingBox.makeEmpty();
|
|
843
|
-
(isNaN(this.boundingBox.min.x) || isNaN(this.boundingBox.min.y) || isNaN(this.boundingBox.min.z)) &&
|
|
840
|
+
(isNaN(this.boundingBox.min.x) || isNaN(this.boundingBox.min.y) || isNaN(this.boundingBox.min.z)) && w("BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The \"position\" attribute is likely to have NaN values.", this);
|
|
844
841
|
}
|
|
845
842
|
computeBoundingSphere() {
|
|
846
|
-
this.boundingSphere === null && (this.boundingSphere = new
|
|
843
|
+
this.boundingSphere === null && (this.boundingSphere = new _());
|
|
847
844
|
let e = this.attributes.position, t = this.morphAttributes.position;
|
|
848
845
|
if (e && e.isGLBufferAttribute) {
|
|
849
|
-
|
|
846
|
+
w("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.", this), this.boundingSphere.set(new x(), Infinity);
|
|
850
847
|
return;
|
|
851
848
|
}
|
|
852
849
|
if (e) {
|
|
@@ -862,44 +859,44 @@ var te = 0, ne = class extends v {
|
|
|
862
859
|
let a = t[i], o = this.morphTargetsRelative;
|
|
863
860
|
for (let t = 0, i = a.count; t < i; t++) $.fromBufferAttribute(a, t), o && (X.fromBufferAttribute(e, t), $.add(X)), r = Math.max(r, n.distanceToSquared($));
|
|
864
861
|
}
|
|
865
|
-
this.boundingSphere.radius = Math.sqrt(r), isNaN(this.boundingSphere.radius) &&
|
|
862
|
+
this.boundingSphere.radius = Math.sqrt(r), isNaN(this.boundingSphere.radius) && w("BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The \"position\" attribute is likely to have NaN values.", this);
|
|
866
863
|
}
|
|
867
864
|
}
|
|
868
865
|
computeTangents() {
|
|
869
866
|
let e = this.index, t = this.attributes;
|
|
870
867
|
if (e === null || t.position === void 0 || t.normal === void 0 || t.uv === void 0) {
|
|
871
|
-
|
|
868
|
+
w("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");
|
|
872
869
|
return;
|
|
873
870
|
}
|
|
874
871
|
let n = t.position, r = t.normal, i = t.uv, a = this.getAttribute("tangent");
|
|
875
|
-
(a === void 0 || a.count !== n.count) && (a = new
|
|
872
|
+
(a === void 0 || a.count !== n.count) && (a = new J(new Float32Array(4 * n.count), 4), this.setAttribute("tangent", a));
|
|
876
873
|
let o = [], s = [];
|
|
877
|
-
for (let e = 0; e < n.count; e++) o[e] = new
|
|
878
|
-
let
|
|
879
|
-
function
|
|
880
|
-
|
|
881
|
-
let a = 1 / (p.x *
|
|
882
|
-
isFinite(a) && (
|
|
874
|
+
for (let e = 0; e < n.count; e++) o[e] = new x(), s[e] = new x();
|
|
875
|
+
let c = new x(), l = new x(), d = new x(), f = new u(), p = new u(), m = new u(), h = new x(), g = new x();
|
|
876
|
+
function _(e, t, r) {
|
|
877
|
+
c.fromBufferAttribute(n, e), l.fromBufferAttribute(n, t), d.fromBufferAttribute(n, r), f.fromBufferAttribute(i, e), p.fromBufferAttribute(i, t), m.fromBufferAttribute(i, r), l.sub(c), d.sub(c), p.sub(f), m.sub(f);
|
|
878
|
+
let a = 1 / (p.x * m.y - m.x * p.y);
|
|
879
|
+
isFinite(a) && (h.copy(l).multiplyScalar(m.y).addScaledVector(d, -p.y).multiplyScalar(a), g.copy(d).multiplyScalar(p.x).addScaledVector(l, -m.x).multiplyScalar(a), o[e].add(h), o[t].add(h), o[r].add(h), s[e].add(g), s[t].add(g), s[r].add(g));
|
|
883
880
|
}
|
|
884
|
-
let
|
|
885
|
-
|
|
881
|
+
let v = this.groups;
|
|
882
|
+
v.length === 0 && (v = [{
|
|
886
883
|
start: 0,
|
|
887
884
|
count: e.count
|
|
888
885
|
}]);
|
|
889
|
-
for (let t = 0, n =
|
|
890
|
-
let n =
|
|
891
|
-
for (let t = r, n = r + i; t < n; t += 3)
|
|
886
|
+
for (let t = 0, n = v.length; t < n; ++t) {
|
|
887
|
+
let n = v[t], r = n.start, i = n.count;
|
|
888
|
+
for (let t = r, n = r + i; t < n; t += 3) _(e.getX(t + 0), e.getX(t + 1), e.getX(t + 2));
|
|
892
889
|
}
|
|
893
|
-
let
|
|
890
|
+
let y = new x(), b = new x(), S = new x(), C = new x();
|
|
894
891
|
function T(e) {
|
|
895
|
-
|
|
892
|
+
S.fromBufferAttribute(r, e), C.copy(S);
|
|
896
893
|
let t = o[e];
|
|
897
|
-
|
|
898
|
-
let n =
|
|
899
|
-
a.setXYZW(e,
|
|
894
|
+
y.copy(t), y.sub(S.multiplyScalar(S.dot(t))).normalize(), b.crossVectors(C, t);
|
|
895
|
+
let n = b.dot(s[e]) < 0 ? -1 : 1;
|
|
896
|
+
a.setXYZW(e, y.x, y.y, y.z, n);
|
|
900
897
|
}
|
|
901
|
-
for (let t = 0, n =
|
|
902
|
-
let n =
|
|
898
|
+
for (let t = 0, n = v.length; t < n; ++t) {
|
|
899
|
+
let n = v[t], r = n.start, i = n.count;
|
|
903
900
|
for (let t = r, n = r + i; t < n; t += 3) T(e.getX(t + 0)), T(e.getX(t + 1)), T(e.getX(t + 2));
|
|
904
901
|
}
|
|
905
902
|
this._transformed = !0;
|
|
@@ -908,9 +905,9 @@ var te = 0, ne = class extends v {
|
|
|
908
905
|
let e = this.index, t = this.getAttribute("position");
|
|
909
906
|
if (t !== void 0) {
|
|
910
907
|
let n = this.getAttribute("normal");
|
|
911
|
-
if (n === void 0 || n.count !== t.count) n = new
|
|
908
|
+
if (n === void 0 || n.count !== t.count) n = new J(new Float32Array(t.count * 3), 3), this.setAttribute("normal", n);
|
|
912
909
|
else for (let e = 0, t = n.count; e < t; e++) n.setXYZ(e, 0, 0, 0);
|
|
913
|
-
let r = new
|
|
910
|
+
let r = new x(), i = new x(), a = new x(), o = new x(), s = new x(), c = new x(), l = new x(), u = new x();
|
|
914
911
|
if (e) for (let d = 0, f = e.count; d < f; d += 3) {
|
|
915
912
|
let f = e.getX(d + 0), p = e.getX(d + 1), m = e.getX(d + 2);
|
|
916
913
|
r.fromBufferAttribute(t, f), i.fromBufferAttribute(t, p), a.fromBufferAttribute(t, m), l.subVectors(a, i), u.subVectors(r, i), l.cross(u), o.fromBufferAttribute(n, f), s.fromBufferAttribute(n, p), c.fromBufferAttribute(n, m), o.add(l), s.add(l), c.add(l), n.setXYZ(f, o.x, o.y, o.z), n.setXYZ(p, s.x, s.y, s.z), n.setXYZ(m, c.x, c.y, c.z);
|
|
@@ -930,27 +927,27 @@ var te = 0, ne = class extends v {
|
|
|
930
927
|
o = e.isInterleavedBufferAttribute ? t[i] * e.data.stride + e.offset : t[i] * r;
|
|
931
928
|
for (let e = 0; e < r; e++) a[s++] = n[o++];
|
|
932
929
|
}
|
|
933
|
-
return new
|
|
930
|
+
return new J(a, r, i);
|
|
934
931
|
}
|
|
935
|
-
if (this.index === null) return
|
|
932
|
+
if (this.index === null) return a("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."), this;
|
|
936
933
|
let n = new e(), r = this.index.array, i = this.attributes;
|
|
937
934
|
for (let e in i) {
|
|
938
935
|
let a = i[e], o = t(a, r);
|
|
939
936
|
n.setAttribute(e, o);
|
|
940
937
|
}
|
|
941
|
-
let
|
|
942
|
-
for (let e in
|
|
943
|
-
let i = [],
|
|
944
|
-
for (let e = 0, n =
|
|
945
|
-
let n =
|
|
946
|
-
i.push(
|
|
938
|
+
let o = this.morphAttributes;
|
|
939
|
+
for (let e in o) {
|
|
940
|
+
let i = [], a = o[e];
|
|
941
|
+
for (let e = 0, n = a.length; e < n; e++) {
|
|
942
|
+
let n = a[e], o = t(n, r);
|
|
943
|
+
i.push(o);
|
|
947
944
|
}
|
|
948
945
|
n.morphAttributes[e] = i;
|
|
949
946
|
}
|
|
950
947
|
n.morphTargetsRelative = this.morphTargetsRelative;
|
|
951
|
-
let
|
|
952
|
-
for (let e = 0, t =
|
|
953
|
-
let t =
|
|
948
|
+
let s = this.groups;
|
|
949
|
+
for (let e = 0, t = s.length; e < t; e++) {
|
|
950
|
+
let t = s[e];
|
|
954
951
|
n.addGroup(t.start, t.count, t.materialIndex);
|
|
955
952
|
}
|
|
956
953
|
return n;
|
|
@@ -961,7 +958,7 @@ var te = 0, ne = class extends v {
|
|
|
961
958
|
type: "BufferGeometry",
|
|
962
959
|
generator: "BufferGeometry.toJSON"
|
|
963
960
|
} };
|
|
964
|
-
if (e.uuid = this.uuid, e.type = this.parameters !== void 0 && this._transformed === !0 ? "BufferGeometry" : this.type,
|
|
961
|
+
if (e.uuid = this.uuid, e.type = this.parameters !== void 0 && this._transformed === !0 ? "BufferGeometry" : this.type, e.name = this.name, Object.keys(this.userData).length > 0 && (e.userData = this.userData), this.parameters !== void 0 && this._transformed !== !0) {
|
|
965
962
|
let t = this.parameters;
|
|
966
963
|
for (let n in t) t[n] !== void 0 && (e[n] = t[n]);
|
|
967
964
|
return e;
|
|
@@ -1028,6 +1025,6 @@ var te = 0, ne = class extends v {
|
|
|
1028
1025
|
}
|
|
1029
1026
|
};
|
|
1030
1027
|
//#endregion
|
|
1031
|
-
export {
|
|
1028
|
+
export { A as a, V as i, ne as n, W as r, ae as t };
|
|
1032
1029
|
|
|
1033
|
-
//# sourceMappingURL=BufferGeometry-
|
|
1030
|
+
//# sourceMappingURL=BufferGeometry-CxlpBjLq.mjs.map
|