softbox 4.2.2 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ThreePathTracingService-bdhnuLzE.js → ThreePathTracingService-B3fodLjq.js} +1 -1
- package/dist/{ThreePathTracingService-dpfrFF3Q.cjs → ThreePathTracingService-k4X0y0xh.cjs} +1 -1
- package/dist/index-Baq0VFRM.cjs +11 -0
- package/dist/{index-D9zA-xWX.js → index-CfbgrXOX.js} +340 -302
- package/dist/index.d.cts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/simple-viewer.cjs +1 -1
- package/dist/simple-viewer.es.js +1 -1
- package/package.json +1 -1
- package/dist/index-CIx05XiL.cjs +0 -11
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as Te, jsxs as Hn } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo as Dt, useRef as Ge, useState as Xn, useEffect as ht, useCallback as Rt, createContext as Wa, useContext as Za, Component as Ka, forwardRef as yo, useImperativeHandle as Xa } from "react";
|
|
3
3
|
import * as T from "three";
|
|
4
|
-
import { Box3 as _t, Matrix4 as ut, BufferAttribute as jn, Vector3 as
|
|
4
|
+
import { Box3 as _t, Matrix4 as ut, BufferAttribute as jn, Vector3 as $, Line3 as Nt, Plane as Qn, Vector2 as pe, Triangle as En, BackSide as wo, DoubleSide as Eo, REVISION as To, Ray as Yi, FrontSide as Ai, Mesh as wt, LineSegments as qi, LineLoop as $i, Line as Qi, Points as Ji, Sphere as _o, BatchedMesh as Ya, TrianglesDrawMode as qa, TriangleFanDrawMode as vi, TriangleStripDrawMode as So, Loader as $a, LoaderUtils as Gn, FileLoader as bo, MeshPhysicalMaterial as Mt, Color as tn, LinearSRGBColorSpace as je, SRGBColorSpace as Yn, SpotLight as Qa, PointLight as xo, DirectionalLight as Ja, Quaternion as xn, InstancedMesh as Ao, InstancedBufferAttribute as ec, Object3D as er, TextureLoader as tc, ImageBitmapLoader as nc, InterleavedBuffer as sc, InterleavedBufferAttribute as ic, LinearMipmapLinearFilter as vo, NearestMipmapLinearFilter as rc, LinearMipmapNearestFilter as oc, NearestMipmapNearestFilter as ac, LinearFilter as nn, NearestFilter as Ro, RepeatWrapping as Ri, MirroredRepeatWrapping as cc, ClampToEdgeWrapping as lc, PointsMaterial as hc, Material as ei, LineBasicMaterial as uc, MeshStandardMaterial as Hs, MeshBasicMaterial as Un, PropertyBinding as dc, BufferGeometry as fc, SkinnedMesh as pc, Group as ti, PerspectiveCamera as mc, MathUtils as tr, OrthographicCamera as gc, Skeleton as yc, AnimationClip as wc, Bone as Ec, InterpolateDiscrete as Tc, InterpolateLinear as Mo, Texture as xr, VectorKeyframeTrack as Ar, NumberKeyframeTrack as vr, QuaternionKeyframeTrack as Rr, ColorManagement as Mr, Interpolant as _c, Controls as Io, MOUSE as Be, TOUCH as Ye, Spherical as js, Raycaster as Sc, DataTextureLoader as Co, HalfFloatType as Vt, RGBAFormat as Yt, RGFormat as In, DataUtils as Et, RedFormat as fs, FloatType as Vn, Scene as bc, BoxGeometry as xc, MeshLambertMaterial as Ac } from "three";
|
|
5
5
|
class Z extends Error {
|
|
6
6
|
constructor(e, t, n) {
|
|
7
7
|
super(e), this.code = t, this.context = n, this.name = "ThreeViewerError", this.timestamp = /* @__PURE__ */ new Date(), Error.captureStackTrace && Error.captureStackTrace(this, Z);
|
|
@@ -21,7 +21,7 @@ class Z extends Error {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
var Y = /* @__PURE__ */ ((i) => (i.SCENE_INIT_FAILED = "SCENE_INIT_FAILED", i.RENDERER_INIT_FAILED = "RENDERER_INIT_FAILED", i.RENDERER_NOT_INITIALIZED = "RENDERER_NOT_INITIALIZED", i.CAMERA_INIT_FAILED = "CAMERA_INIT_FAILED", i.WEBGL_NOT_SUPPORTED = "WEBGL_NOT_SUPPORTED", i.INITIALIZATION_FAILED = "INITIALIZATION_FAILED", i.PATH_TRACING_INIT_FAILED = "PATH_TRACING_INIT_FAILED", i.MODEL_LOAD_FAILED = "MODEL_LOAD_FAILED", i.TEXTURE_LOAD_FAILED = "TEXTURE_LOAD_FAILED", i.RESOURCE_NOT_FOUND = "RESOURCE_NOT_FOUND", i.UNSUPPORTED_FORMAT = "UNSUPPORTED_FORMAT", i.INVALID_CONFIGURATION = "INVALID_CONFIGURATION", i.RENDER_ERROR = "RENDER_ERROR", i.RENDER_FAILED = "RENDER_FAILED", i.SCENE_OPERATION_FAILED = "SCENE_OPERATION_FAILED", i.COMPONENT_NOT_MOUNTED = "COMPONENT_NOT_MOUNTED", i.INVALID_STATE = "INVALID_STATE", i.INVALID_PARAMETER = "INVALID_PARAMETER", i.OPERATION_FAILED = "OPERATION_FAILED", i.UNKNOWN = "UNKNOWN", i))(Y || {});
|
|
24
|
-
const
|
|
24
|
+
const k = {
|
|
25
25
|
ok(i) {
|
|
26
26
|
return { ok: !0, value: i };
|
|
27
27
|
},
|
|
@@ -30,9 +30,9 @@ const F = {
|
|
|
30
30
|
},
|
|
31
31
|
wrap(i) {
|
|
32
32
|
try {
|
|
33
|
-
return
|
|
33
|
+
return k.ok(i());
|
|
34
34
|
} catch (e) {
|
|
35
|
-
return
|
|
35
|
+
return k.err(
|
|
36
36
|
e instanceof Z ? e : new Z(
|
|
37
37
|
String(e),
|
|
38
38
|
Y.UNKNOWN,
|
|
@@ -700,7 +700,7 @@ class Pc {
|
|
|
700
700
|
a.ok || console.warn("Failed to fit camera to object:", a.error);
|
|
701
701
|
}
|
|
702
702
|
const o = performance.now() - n;
|
|
703
|
-
return t.emit("model:loaded", { model: s, loadTime: o }),
|
|
703
|
+
return t.emit("model:loaded", { model: s, loadTime: o }), k.ok(s);
|
|
704
704
|
} catch (s) {
|
|
705
705
|
const r = s instanceof Z ? s : new Z(
|
|
706
706
|
"Failed to load model",
|
|
@@ -710,7 +710,7 @@ class Pc {
|
|
|
710
710
|
return t.emit("model:error", {
|
|
711
711
|
error: r,
|
|
712
712
|
url: typeof e == "string" ? e : void 0
|
|
713
|
-
}),
|
|
713
|
+
}), k.err(r);
|
|
714
714
|
}
|
|
715
715
|
}
|
|
716
716
|
/**
|
|
@@ -934,12 +934,12 @@ class kc {
|
|
|
934
934
|
this.pendingSettlers = /* @__PURE__ */ new Set(), this.pathTracedWaitSettlers = /* @__PURE__ */ new Set(), this.deps = e;
|
|
935
935
|
}
|
|
936
936
|
async captureStill(e = {}) {
|
|
937
|
-
return this.deps.isDisposed() ?
|
|
937
|
+
return this.deps.isDisposed() ? k.err(
|
|
938
938
|
new Z("Cannot capture a still from a disposed viewer", Y.INVALID_STATE)
|
|
939
939
|
) : (await this.deps.awaitModelLoads().catch(() => {
|
|
940
|
-
}), this.deps.isDisposed() ?
|
|
940
|
+
}), this.deps.isDisposed() ? k.err(
|
|
941
941
|
new Z("Viewer was disposed while a model load finished", Y.INVALID_STATE)
|
|
942
|
-
) : this.deps.isScreenshotActive() ?
|
|
942
|
+
) : this.deps.isScreenshotActive() ? k.err(
|
|
943
943
|
new Z(
|
|
944
944
|
"Cannot capture a still while a screenshot is replacing the canvas",
|
|
945
945
|
Y.INVALID_STATE
|
|
@@ -968,16 +968,16 @@ class kc {
|
|
|
968
968
|
async captureVideo(e = {}) {
|
|
969
969
|
var d;
|
|
970
970
|
if (this.deps.isDisposed())
|
|
971
|
-
return
|
|
971
|
+
return k.err(
|
|
972
972
|
new Z("Cannot capture video from a disposed viewer", Y.INVALID_STATE)
|
|
973
973
|
);
|
|
974
974
|
if (await this.deps.awaitModelLoads().catch(() => {
|
|
975
975
|
}), this.deps.isDisposed())
|
|
976
|
-
return
|
|
976
|
+
return k.err(
|
|
977
977
|
new Z("Viewer was disposed while a model load finished", Y.INVALID_STATE)
|
|
978
978
|
);
|
|
979
979
|
if (this.deps.isScreenshotActive())
|
|
980
|
-
return
|
|
980
|
+
return k.err(
|
|
981
981
|
new Z(
|
|
982
982
|
"Cannot capture video while a screenshot is replacing the canvas",
|
|
983
983
|
Y.INVALID_STATE
|
|
@@ -985,12 +985,12 @@ class kc {
|
|
|
985
985
|
);
|
|
986
986
|
const t = e.duration ?? 3;
|
|
987
987
|
if (!(t > 0))
|
|
988
|
-
return
|
|
988
|
+
return k.err(
|
|
989
989
|
new Z("Video duration must be a positive number of seconds", Y.INVALID_PARAMETER)
|
|
990
990
|
);
|
|
991
991
|
const n = this.deps.renderer.getDomElement();
|
|
992
992
|
if (typeof MediaRecorder > "u" || typeof n.captureStream != "function")
|
|
993
|
-
return
|
|
993
|
+
return k.err(
|
|
994
994
|
new Z(
|
|
995
995
|
"Video capture needs MediaRecorder and canvas.captureStream support",
|
|
996
996
|
Y.UNSUPPORTED_FORMAT
|
|
@@ -1004,7 +1004,7 @@ class kc {
|
|
|
1004
1004
|
videoBitsPerSecond: e.videoBitsPerSecond
|
|
1005
1005
|
});
|
|
1006
1006
|
} catch (h) {
|
|
1007
|
-
return s.getTracks().forEach((f) => f.stop()),
|
|
1007
|
+
return s.getTracks().forEach((f) => f.stop()), k.err(
|
|
1008
1008
|
new Z("Failed to start the video recorder", Y.OPERATION_FAILED, {
|
|
1009
1009
|
originalError: h
|
|
1010
1010
|
})
|
|
@@ -1019,7 +1019,7 @@ class kc {
|
|
|
1019
1019
|
y || (y = !0, this.pendingSettlers.delete(E), c(), p !== null && clearTimeout(p), this.deps.renderLoopManager.releaseContinuous(u), s.getTracks().forEach((w) => w.stop()), h(x));
|
|
1020
1020
|
}, E = () => {
|
|
1021
1021
|
S(
|
|
1022
|
-
|
|
1022
|
+
k.err(
|
|
1023
1023
|
new Z("Viewer was disposed during video capture", Y.INVALID_STATE)
|
|
1024
1024
|
)
|
|
1025
1025
|
);
|
|
@@ -1031,10 +1031,10 @@ class kc {
|
|
|
1031
1031
|
this.pendingSettlers.add(E), r.ondataavailable = (x) => {
|
|
1032
1032
|
x.data.size > 0 && f.push(x.data);
|
|
1033
1033
|
}, r.onstop = () => {
|
|
1034
|
-
S(
|
|
1034
|
+
S(k.ok(new Blob(f, { type: r.mimeType || "video/webm" })));
|
|
1035
1035
|
}, r.onerror = () => {
|
|
1036
1036
|
S(
|
|
1037
|
-
|
|
1037
|
+
k.err(
|
|
1038
1038
|
new Z("Video recording failed", Y.OPERATION_FAILED)
|
|
1039
1039
|
)
|
|
1040
1040
|
);
|
|
@@ -1045,14 +1045,14 @@ class kc {
|
|
|
1045
1045
|
}
|
|
1046
1046
|
async capturePathTracedStill(e) {
|
|
1047
1047
|
if (e.width !== void 0 || e.height !== void 0)
|
|
1048
|
-
return
|
|
1048
|
+
return k.err(
|
|
1049
1049
|
new Z(
|
|
1050
1050
|
"Path-traced stills are captured at the canvas resolution; omit width/height",
|
|
1051
1051
|
Y.INVALID_PARAMETER
|
|
1052
1052
|
)
|
|
1053
1053
|
);
|
|
1054
1054
|
if (this.deps.isAutoRotating())
|
|
1055
|
-
return
|
|
1055
|
+
return k.err(
|
|
1056
1056
|
new Z(
|
|
1057
1057
|
"Cannot capture a path-traced still while the turntable is spinning — pause autoRotate first",
|
|
1058
1058
|
Y.INVALID_STATE
|
|
@@ -1062,15 +1062,15 @@ class kc {
|
|
|
1062
1062
|
if (!this.deps.pathTracing.isCompleteHandled() && t) {
|
|
1063
1063
|
const n = await this.waitForPathTracingOutcome();
|
|
1064
1064
|
if (n === "disposed")
|
|
1065
|
-
return
|
|
1065
|
+
return k.err(
|
|
1066
1066
|
new Z("Viewer was disposed while waiting for the path tracer", Y.INVALID_STATE)
|
|
1067
1067
|
);
|
|
1068
1068
|
if (n === "error")
|
|
1069
|
-
return
|
|
1069
|
+
return k.err(
|
|
1070
1070
|
new Z("Model failed while waiting for the path tracer", Y.RENDER_FAILED)
|
|
1071
1071
|
);
|
|
1072
1072
|
if (n === "turntable")
|
|
1073
|
-
return
|
|
1073
|
+
return k.err(
|
|
1074
1074
|
new Z(
|
|
1075
1075
|
"Cannot capture a path-traced still while the turntable is spinning — pause autoRotate first",
|
|
1076
1076
|
Y.INVALID_STATE
|
|
@@ -1097,7 +1097,7 @@ class kc {
|
|
|
1097
1097
|
captureRasterStill(e) {
|
|
1098
1098
|
const { renderer: t, scene: n, camera: s, renderLoopManager: r } = this.deps, o = t.getDomElement(), a = t.getPixelRatio(), c = o.clientWidth > 0 && o.clientHeight > 0, u = c ? o.clientWidth : Math.round(o.width / a), d = c ? o.clientHeight : Math.round(o.height / a);
|
|
1099
1099
|
if (u <= 0 || d <= 0)
|
|
1100
|
-
return
|
|
1100
|
+
return k.err(
|
|
1101
1101
|
new Z("Cannot capture: the canvas has no size", Y.INVALID_STATE)
|
|
1102
1102
|
);
|
|
1103
1103
|
const h = u / d, f = Math.round(
|
|
@@ -1106,19 +1106,19 @@ class kc {
|
|
|
1106
1106
|
e.height ?? (e.width !== void 0 ? e.width / h : d * a)
|
|
1107
1107
|
), y = t.capabilities.maxTextureSize;
|
|
1108
1108
|
if (!Number.isFinite(f) || !Number.isFinite(p) || f <= 0 || p <= 0 || f > y || p > y)
|
|
1109
|
-
return
|
|
1109
|
+
return k.err(
|
|
1110
1110
|
new Z(
|
|
1111
1111
|
`Requested still size ${f}x${p} is outside 1..${y}`,
|
|
1112
1112
|
Y.INVALID_PARAMETER
|
|
1113
1113
|
)
|
|
1114
1114
|
);
|
|
1115
1115
|
t.setPixelRatio(1), t.setSize(f, p), Mi(s, f / p);
|
|
1116
|
-
const S = t.render(n, s), E = S.ok ? this.readCanvasPng() :
|
|
1116
|
+
const S = t.render(n, s), E = S.ok ? this.readCanvasPng() : k.err(S.error);
|
|
1117
1117
|
return t.setSize(u, d), t.setPixelRatio(a), Mi(s, h), t.render(n, s), r.requestRender(), E;
|
|
1118
1118
|
}
|
|
1119
1119
|
readCanvasPng() {
|
|
1120
1120
|
const e = Oo(this.deps.renderer.getDomElement());
|
|
1121
|
-
return e ?
|
|
1121
|
+
return e ? k.ok(e) : k.err(
|
|
1122
1122
|
new Z("Canvas produced an empty image", Y.RENDER_FAILED)
|
|
1123
1123
|
);
|
|
1124
1124
|
}
|
|
@@ -1199,14 +1199,14 @@ class Fc {
|
|
|
1199
1199
|
onPick: (s) => {
|
|
1200
1200
|
s && !this.disposed && this.events.emit("object:selected", s);
|
|
1201
1201
|
}
|
|
1202
|
-
}), this.stateManager.setInitialized(), this.startRenderLoop(), this.options.staticScene ? this.pathTracing.isEnabled() && this.renderLoopManager.requireContinuous("path-tracing") : this.renderLoopManager.setAlwaysRender(!0), (t = this.options.controls) != null && t.autoRotate && this.renderLoopManager.requireContinuous("turntable"), this.renderLoopManager.requestRender()),
|
|
1202
|
+
}), this.stateManager.setInitialized(), this.startRenderLoop(), this.options.staticScene ? this.pathTracing.isEnabled() && this.renderLoopManager.requireContinuous("path-tracing") : this.renderLoopManager.setAlwaysRender(!0), (t = this.options.controls) != null && t.autoRotate && this.renderLoopManager.requireContinuous("turntable"), this.renderLoopManager.requestRender()), k.ok(void 0)) : n;
|
|
1203
1203
|
} catch (n) {
|
|
1204
1204
|
const s = new Z(
|
|
1205
1205
|
"Failed to initialize viewer",
|
|
1206
1206
|
Y.INITIALIZATION_FAILED,
|
|
1207
1207
|
{ originalError: n }
|
|
1208
1208
|
);
|
|
1209
|
-
return this.stateManager.setError(s), this.events.emit("error", { error: s }),
|
|
1209
|
+
return this.stateManager.setError(s), this.events.emit("error", { error: s }), k.err(s);
|
|
1210
1210
|
}
|
|
1211
1211
|
}
|
|
1212
1212
|
/**
|
|
@@ -1223,11 +1223,11 @@ class Fc {
|
|
|
1223
1223
|
}
|
|
1224
1224
|
async runLoadModel(e) {
|
|
1225
1225
|
if (this.disposed)
|
|
1226
|
-
return
|
|
1226
|
+
return k.err(
|
|
1227
1227
|
new Z("Cannot load model after dispose", Y.INVALID_STATE)
|
|
1228
1228
|
);
|
|
1229
1229
|
if (!this.stateManager.canLoad())
|
|
1230
|
-
return
|
|
1230
|
+
return k.err(
|
|
1231
1231
|
new Z(
|
|
1232
1232
|
"Cannot load model in current state",
|
|
1233
1233
|
Y.INVALID_STATE,
|
|
@@ -1240,16 +1240,16 @@ class Fc {
|
|
|
1240
1240
|
try {
|
|
1241
1241
|
this.stateManager.startLoading();
|
|
1242
1242
|
const t = await this.modelManager.loadModel(e, this.events);
|
|
1243
|
-
return this.disposed ? (t.ok && this.modelManager.disposeCurrentModel(),
|
|
1243
|
+
return this.disposed ? (t.ok && this.modelManager.disposeCurrentModel(), k.err(
|
|
1244
1244
|
new Z("Viewer was disposed while the model was loading", Y.INVALID_STATE)
|
|
1245
|
-
)) : t.ok ? (this.stateManager.setLoaded(t.value), this.attachAnimations(t.value), this.renderLoopManager.requestRender(), this.pathTracing.resetAccumulation(!0),
|
|
1245
|
+
)) : t.ok ? (this.stateManager.setLoaded(t.value), this.attachAnimations(t.value), this.renderLoopManager.requestRender(), this.pathTracing.resetAccumulation(!0), k.ok(void 0)) : (this.stateManager.setError(t.error), t);
|
|
1246
1246
|
} catch (t) {
|
|
1247
1247
|
const n = t instanceof Z ? t : new Z(
|
|
1248
1248
|
"Failed to load model",
|
|
1249
1249
|
Y.MODEL_LOAD_FAILED,
|
|
1250
1250
|
{ originalError: t, source: e }
|
|
1251
1251
|
);
|
|
1252
|
-
return this.stateManager.setError(n),
|
|
1252
|
+
return this.stateManager.setError(n), k.err(n);
|
|
1253
1253
|
}
|
|
1254
1254
|
}
|
|
1255
1255
|
startRenderLoop() {
|
|
@@ -1335,7 +1335,7 @@ class Fc {
|
|
|
1335
1335
|
const c = (E = e.controls) == null ? void 0 : E.autoRotateSpeed;
|
|
1336
1336
|
c !== void 0 && (this.controls.autoRotateSpeed = c, s = !0);
|
|
1337
1337
|
const u = (x = e.animations) == null ? void 0 : x.autoplay;
|
|
1338
|
-
u !== void 0 && u !== t && (u ? this.
|
|
1338
|
+
u !== void 0 && u !== t && (u ? this.modelManager.getCurrentModel() && this.autoplayFromOptions(u) : this.pauseAnimations(), s = !0);
|
|
1339
1339
|
const d = (w = e.animations) == null ? void 0 : w.speed;
|
|
1340
1340
|
d !== void 0 && ((b = this.animationService) == null || b.setSpeed(d), s = !0), s && (this.reviveRenderLoop(), this.renderLoopManager.requestRender());
|
|
1341
1341
|
}
|
|
@@ -1416,10 +1416,30 @@ class Fc {
|
|
|
1416
1416
|
var e;
|
|
1417
1417
|
return ((e = this.animationService) == null ? void 0 : e.getClipNames()) ?? [];
|
|
1418
1418
|
}
|
|
1419
|
-
/**
|
|
1419
|
+
/**
|
|
1420
|
+
* Plays one clip by name, or ALL clips when no name is given (looped).
|
|
1421
|
+
* Errs on a clip name the loaded model does not carry — a typo'd name
|
|
1422
|
+
* must not silently leave the model frozen.
|
|
1423
|
+
*/
|
|
1420
1424
|
playAnimations(e) {
|
|
1421
|
-
var
|
|
1422
|
-
|
|
1425
|
+
var n;
|
|
1426
|
+
if (!this.animationService)
|
|
1427
|
+
return e !== void 0 ? k.err(
|
|
1428
|
+
new Z(
|
|
1429
|
+
`Cannot play animation clip '${e}': the viewer was assembled without an animation service`,
|
|
1430
|
+
Y.INVALID_STATE
|
|
1431
|
+
)
|
|
1432
|
+
) : k.ok(void 0);
|
|
1433
|
+
const t = this.animationService.play(e);
|
|
1434
|
+
return t.ok ? (this.animationService.isPlaying() && ((n = this.sceneSetupService) == null || n.setContactShadowMode(this.scene, "live"), this.renderLoopManager.requireContinuous("animations"), this.reviveRenderLoop(), this.renderLoopManager.requestRender()), k.ok(void 0)) : t;
|
|
1435
|
+
}
|
|
1436
|
+
/**
|
|
1437
|
+
* Options-driven autoplay has no caller to hand a Result to — a typo'd
|
|
1438
|
+
* clip name in `animations.autoplay` surfaces on the console instead.
|
|
1439
|
+
*/
|
|
1440
|
+
autoplayFromOptions(e) {
|
|
1441
|
+
const t = this.playAnimations(typeof e == "string" ? e : void 0);
|
|
1442
|
+
t.ok || console.error("animations.autoplay failed:", t.error.message);
|
|
1423
1443
|
}
|
|
1424
1444
|
/** Freezes playback on the current pose; play() resumes. */
|
|
1425
1445
|
pauseAnimations() {
|
|
@@ -1445,7 +1465,7 @@ class Fc {
|
|
|
1445
1465
|
const t = this.options.animations;
|
|
1446
1466
|
(t == null ? void 0 : t.speed) !== void 0 && this.animationService.setSpeed(t.speed);
|
|
1447
1467
|
const n = t == null ? void 0 : t.autoplay;
|
|
1448
|
-
n && this.
|
|
1468
|
+
n && this.autoplayFromOptions(n);
|
|
1449
1469
|
}
|
|
1450
1470
|
/**
|
|
1451
1471
|
* Creates a projector that maps a world-space anchor to canvas pixels (the
|
|
@@ -1626,8 +1646,8 @@ function ii(i, e, t, n, s) {
|
|
|
1626
1646
|
P < r && (r = P), I > c && (c = I), _ < h && (h = _), _ > y && (y = _);
|
|
1627
1647
|
const M = i[w + 2], O = i[w + 3], C = M - O, N = M + O;
|
|
1628
1648
|
C < o && (o = C), N > u && (u = N), M < f && (f = M), M > S && (S = M);
|
|
1629
|
-
const D = i[w + 4], H = i[w + 5], G = D - H,
|
|
1630
|
-
G < a && (a = G),
|
|
1649
|
+
const D = i[w + 4], H = i[w + 5], G = D - H, q = D + H;
|
|
1650
|
+
G < a && (a = G), q > d && (d = q), D < p && (p = D), D > E && (E = D);
|
|
1631
1651
|
}
|
|
1632
1652
|
n[0] = r, n[1] = o, n[2] = a, n[3] = c, n[4] = u, n[5] = d, s[0] = h, s[1] = f, s[2] = p, s[3] = y, s[4] = S, s[5] = E;
|
|
1633
1653
|
}
|
|
@@ -1869,16 +1889,16 @@ function Li(i, e, t, n, s = null, r = 0, o = 0) {
|
|
|
1869
1889
|
} else {
|
|
1870
1890
|
let C = function(D) {
|
|
1871
1891
|
const { uint16Array: H, uint32Array: G } = be;
|
|
1872
|
-
let
|
|
1873
|
-
for (; !De(
|
|
1874
|
-
D = Fe(D),
|
|
1892
|
+
let q = D * 2;
|
|
1893
|
+
for (; !De(q, H); )
|
|
1894
|
+
D = Fe(D), q = D * 2;
|
|
1875
1895
|
return $e(D, G);
|
|
1876
1896
|
}, N = function(D) {
|
|
1877
1897
|
const { uint16Array: H, uint32Array: G } = be;
|
|
1878
|
-
let
|
|
1879
|
-
for (; !De(
|
|
1880
|
-
D = ze(D, G),
|
|
1881
|
-
return $e(D, G) + Qe(
|
|
1898
|
+
let q = D * 2;
|
|
1899
|
+
for (; !De(q, H); )
|
|
1900
|
+
D = ze(D, G), q = D * 2;
|
|
1901
|
+
return $e(D, G) + Qe(q, H);
|
|
1882
1902
|
};
|
|
1883
1903
|
const f = Fe(i), p = ze(i, u);
|
|
1884
1904
|
let y = f, S = p, E, x, w, b;
|
|
@@ -2060,8 +2080,8 @@ function gt(i, e, t, n, s, r = 0, o = 0, a = 0, c = 0, u = null, d = !1) {
|
|
|
2060
2080
|
D.copy(oi).applyMatrix4(t);
|
|
2061
2081
|
const H = Fe(i), G = ze(i, y);
|
|
2062
2082
|
xe(H, p, ln), xe(G, p, hn);
|
|
2063
|
-
const
|
|
2064
|
-
I =
|
|
2083
|
+
const q = D.intersectsBox(ln), ie = D.intersectsBox(hn);
|
|
2084
|
+
I = q && gt(
|
|
2065
2085
|
M,
|
|
2066
2086
|
H,
|
|
2067
2087
|
n,
|
|
@@ -2107,8 +2127,8 @@ function gt(i, e, t, n, s, r = 0, o = 0, a = 0, c = 0, u = null, d = !1) {
|
|
|
2107
2127
|
D.copy(ai).applyMatrix4(t);
|
|
2108
2128
|
const H = Fe(i), G = ze(i, y);
|
|
2109
2129
|
xe(H, p, ln), xe(G, p, hn);
|
|
2110
|
-
const
|
|
2111
|
-
I =
|
|
2130
|
+
const q = D.intersectsBox(ln), ie = D.intersectsBox(hn);
|
|
2131
|
+
I = q && gt(
|
|
2112
2132
|
O,
|
|
2113
2133
|
H,
|
|
2114
2134
|
n,
|
|
@@ -2448,7 +2468,7 @@ class kt {
|
|
|
2448
2468
|
}
|
|
2449
2469
|
}
|
|
2450
2470
|
kt.prototype.setFromBox = /* @__PURE__ */ (function() {
|
|
2451
|
-
const i = /* @__PURE__ */ new
|
|
2471
|
+
const i = /* @__PURE__ */ new $();
|
|
2452
2472
|
return function(t, n) {
|
|
2453
2473
|
const s = n.min, r = n.max;
|
|
2454
2474
|
let o = 1 / 0, a = -1 / 0;
|
|
@@ -2463,7 +2483,7 @@ kt.prototype.setFromBox = /* @__PURE__ */ (function() {
|
|
|
2463
2483
|
};
|
|
2464
2484
|
})();
|
|
2465
2485
|
const rl = /* @__PURE__ */ (function() {
|
|
2466
|
-
const i = /* @__PURE__ */ new
|
|
2486
|
+
const i = /* @__PURE__ */ new $(), e = /* @__PURE__ */ new $(), t = /* @__PURE__ */ new $();
|
|
2467
2487
|
return function(s, r, o) {
|
|
2468
2488
|
const a = s.start, c = i, u = r.start, d = e;
|
|
2469
2489
|
t.subVectors(a, u), i.subVectors(s.end, s.start), e.subVectors(r.end, r.start);
|
|
@@ -2472,7 +2492,7 @@ const rl = /* @__PURE__ */ (function() {
|
|
|
2472
2492
|
E !== 0 ? x = (h * f - y * p) / E : x = 0, w = (h + x * f) / p, o.x = x, o.y = w;
|
|
2473
2493
|
};
|
|
2474
2494
|
})(), cr = /* @__PURE__ */ (function() {
|
|
2475
|
-
const i = /* @__PURE__ */ new pe(), e = /* @__PURE__ */ new
|
|
2495
|
+
const i = /* @__PURE__ */ new pe(), e = /* @__PURE__ */ new $(), t = /* @__PURE__ */ new $();
|
|
2476
2496
|
return function(s, r, o, a) {
|
|
2477
2497
|
rl(s, r, i);
|
|
2478
2498
|
let c = i.x, u = i.y;
|
|
@@ -2501,7 +2521,7 @@ const rl = /* @__PURE__ */ (function() {
|
|
|
2501
2521
|
}
|
|
2502
2522
|
};
|
|
2503
2523
|
})(), ol = /* @__PURE__ */ (function() {
|
|
2504
|
-
const i = /* @__PURE__ */ new
|
|
2524
|
+
const i = /* @__PURE__ */ new $(), e = /* @__PURE__ */ new $(), t = /* @__PURE__ */ new Qn(), n = /* @__PURE__ */ new Nt();
|
|
2505
2525
|
return function(r, o) {
|
|
2506
2526
|
const { radius: a, center: c } = r, { a: u, b: d, c: h } = o;
|
|
2507
2527
|
if (n.start = u, n.end = d, n.closestPointToPoint(c, !0, i).distanceTo(c) <= a || (n.start = u, n.end = h, n.closestPointToPoint(c, !0, i).distanceTo(c) <= a) || (n.start = d, n.end = h, n.closestPointToPoint(c, !0, i).distanceTo(c) <= a)) return !0;
|
|
@@ -2518,7 +2538,7 @@ function ot(i) {
|
|
|
2518
2538
|
}
|
|
2519
2539
|
class Tt extends En {
|
|
2520
2540
|
constructor(...e) {
|
|
2521
|
-
super(...e), this.isExtendedTriangle = !0, this.satAxes = new Array(4).fill().map(() => new
|
|
2541
|
+
super(...e), this.isExtendedTriangle = !0, this.satAxes = new Array(4).fill().map(() => new $()), this.satBounds = new Array(4).fill().map(() => new kt()), this.points = [this.a, this.b, this.c], this.plane = new Qn(), this.isDegenerateIntoSegment = !1, this.isDegenerateIntoPoint = !1, this.degenerateSegment = new Nt(), this.needsUpdate = !0;
|
|
2522
2542
|
}
|
|
2523
2543
|
/**
|
|
2524
2544
|
* Returns whether the triangle intersects the given sphere.
|
|
@@ -2542,7 +2562,7 @@ class Tt extends En {
|
|
|
2542
2562
|
}
|
|
2543
2563
|
}
|
|
2544
2564
|
Tt.prototype.closestPointToSegment = /* @__PURE__ */ (function() {
|
|
2545
|
-
const i = /* @__PURE__ */ new
|
|
2565
|
+
const i = /* @__PURE__ */ new $(), e = /* @__PURE__ */ new $(), t = /* @__PURE__ */ new Nt();
|
|
2546
2566
|
return function(s, r = null, o = null) {
|
|
2547
2567
|
const { start: a, end: c } = s, u = this.points;
|
|
2548
2568
|
let d, h = 1 / 0;
|
|
@@ -2554,7 +2574,7 @@ Tt.prototype.closestPointToSegment = /* @__PURE__ */ (function() {
|
|
|
2554
2574
|
};
|
|
2555
2575
|
})();
|
|
2556
2576
|
Tt.prototype.intersectsTriangle = /* @__PURE__ */ (function() {
|
|
2557
|
-
const i = /* @__PURE__ */ new Tt(), e = /* @__PURE__ */ new kt(), t = /* @__PURE__ */ new kt(), n = /* @__PURE__ */ new
|
|
2577
|
+
const i = /* @__PURE__ */ new Tt(), e = /* @__PURE__ */ new kt(), t = /* @__PURE__ */ new kt(), n = /* @__PURE__ */ new $(), s = /* @__PURE__ */ new $(), r = /* @__PURE__ */ new $(), o = /* @__PURE__ */ new $(), a = /* @__PURE__ */ new Nt(), c = /* @__PURE__ */ new Nt(), u = /* @__PURE__ */ new $(), d = /* @__PURE__ */ new pe(), h = /* @__PURE__ */ new pe();
|
|
2558
2578
|
function f(b, _, A, P) {
|
|
2559
2579
|
const I = n;
|
|
2560
2580
|
!b.isDegenerateIntoPoint && !b.isDegenerateIntoSegment ? I.copy(b.plane.normal) : I.copy(_.plane.normal);
|
|
@@ -2612,8 +2632,8 @@ Tt.prototype.intersectsTriangle = /* @__PURE__ */ (function() {
|
|
|
2612
2632
|
const H = (N.x * C.y - N.y * C.x) / D, G = -(O.x * N.y - O.y * N.x) / D;
|
|
2613
2633
|
if (H < 0 || H > 1 || G < 0 || G > 1)
|
|
2614
2634
|
return !1;
|
|
2615
|
-
const
|
|
2616
|
-
return ot(
|
|
2635
|
+
const q = I.start.z + O.z * H, ie = M.start.z + C.z * G;
|
|
2636
|
+
return ot(q - ie) ? (A && (A.start.copy(I.start).addScaledVector(O, H), A.end.copy(I.start).addScaledVector(O, H)), !0) : !1;
|
|
2617
2637
|
} else return _.isDegenerateIntoPoint ? x(b, _, A) : S(_, b, A, P);
|
|
2618
2638
|
else {
|
|
2619
2639
|
if (b.isDegenerateIntoPoint)
|
|
@@ -2635,9 +2655,9 @@ Tt.prototype.intersectsTriangle = /* @__PURE__ */ (function() {
|
|
|
2635
2655
|
const H = C * N, G = C * D;
|
|
2636
2656
|
if (H > 0 && G > 0)
|
|
2637
2657
|
return !1;
|
|
2638
|
-
let
|
|
2639
|
-
ot(
|
|
2640
|
-
const dt =
|
|
2658
|
+
let q = M.distanceToPoint(_.a), ie = M.distanceToPoint(_.b), Ne = M.distanceToPoint(_.c);
|
|
2659
|
+
ot(q) && (q = 0), ot(ie) && (ie = 0), ot(Ne) && (Ne = 0);
|
|
2660
|
+
const dt = q * ie, Re = q * Ne;
|
|
2641
2661
|
if (dt > 0 && Re > 0)
|
|
2642
2662
|
return !1;
|
|
2643
2663
|
s.copy(M.normal), r.copy(O.normal);
|
|
@@ -2648,7 +2668,7 @@ Tt.prototype.intersectsTriangle = /* @__PURE__ */ (function() {
|
|
|
2648
2668
|
const We = al[Ve], Ft = this.a[We], me = this.b[We], ft = this.c[We], pt = _.a[We], An = _.b[We], rn = _.c[We];
|
|
2649
2669
|
if (y(this, Ft, me, ft, H, G, C, N, D, d, a))
|
|
2650
2670
|
return f(this, _, A, P);
|
|
2651
|
-
if (y(_, pt, An, rn, dt, Re,
|
|
2671
|
+
if (y(_, pt, An, rn, dt, Re, q, ie, Ne, h, c))
|
|
2652
2672
|
return f(this, _, A, P);
|
|
2653
2673
|
if (d.y < d.x) {
|
|
2654
2674
|
const It = d.y;
|
|
@@ -2662,13 +2682,13 @@ Tt.prototype.intersectsTriangle = /* @__PURE__ */ (function() {
|
|
|
2662
2682
|
};
|
|
2663
2683
|
})();
|
|
2664
2684
|
Tt.prototype.distanceToPoint = /* @__PURE__ */ (function() {
|
|
2665
|
-
const i = /* @__PURE__ */ new
|
|
2685
|
+
const i = /* @__PURE__ */ new $();
|
|
2666
2686
|
return function(t) {
|
|
2667
2687
|
return this.closestPointToPoint(t, i), t.distanceTo(i);
|
|
2668
2688
|
};
|
|
2669
2689
|
})();
|
|
2670
2690
|
Tt.prototype.distanceToTriangle = /* @__PURE__ */ (function() {
|
|
2671
|
-
const i = /* @__PURE__ */ new
|
|
2691
|
+
const i = /* @__PURE__ */ new $(), e = /* @__PURE__ */ new $(), t = ["a", "b", "c"], n = /* @__PURE__ */ new Nt(), s = /* @__PURE__ */ new Nt();
|
|
2672
2692
|
return function(o, a = null, c = null) {
|
|
2673
2693
|
const u = a || c ? n : null;
|
|
2674
2694
|
if (this.intersectsTriangle(o, u, !0))
|
|
@@ -2696,7 +2716,7 @@ Tt.prototype.distanceToTriangle = /* @__PURE__ */ (function() {
|
|
|
2696
2716
|
})();
|
|
2697
2717
|
class Je {
|
|
2698
2718
|
constructor(e, t, n) {
|
|
2699
|
-
this.isOrientedBox = !0, this.min = new
|
|
2719
|
+
this.isOrientedBox = !0, this.min = new $(), this.max = new $(), this.matrix = new ut(), this.invMatrix = new ut(), this.points = new Array(8).fill().map(() => new $()), this.satAxes = new Array(3).fill().map(() => new $()), this.satBounds = new Array(3).fill().map(() => new kt()), this.alignedSatBounds = new Array(3).fill().map(() => new kt()), this.needsUpdate = !1, e && this.min.copy(e), t && this.max.copy(t), n && this.matrix.copy(n);
|
|
2700
2720
|
}
|
|
2701
2721
|
/**
|
|
2702
2722
|
* Sets the oriented box parameters.
|
|
@@ -2743,7 +2763,7 @@ Je.prototype.intersectsBox = /* @__PURE__ */ (function() {
|
|
|
2743
2763
|
};
|
|
2744
2764
|
})();
|
|
2745
2765
|
Je.prototype.intersectsTriangle = /* @__PURE__ */ (function() {
|
|
2746
|
-
const i = /* @__PURE__ */ new Tt(), e = /* @__PURE__ */ new Array(3), t = /* @__PURE__ */ new kt(), n = /* @__PURE__ */ new kt(), s = /* @__PURE__ */ new
|
|
2766
|
+
const i = /* @__PURE__ */ new Tt(), e = /* @__PURE__ */ new Array(3), t = /* @__PURE__ */ new kt(), n = /* @__PURE__ */ new kt(), s = /* @__PURE__ */ new $();
|
|
2747
2767
|
return function(o) {
|
|
2748
2768
|
this.needsUpdate && this.update(), o.isExtendedTriangle ? o.needsUpdate && o.update() : (i.copy(o), i.update(), o = i);
|
|
2749
2769
|
const a = this.satBounds, c = this.satAxes;
|
|
@@ -2773,13 +2793,13 @@ Je.prototype.closestPointToPoint = /* @__PURE__ */ (function() {
|
|
|
2773
2793
|
};
|
|
2774
2794
|
})();
|
|
2775
2795
|
Je.prototype.distanceToPoint = (function() {
|
|
2776
|
-
const i = new
|
|
2796
|
+
const i = new $();
|
|
2777
2797
|
return function(t) {
|
|
2778
2798
|
return this.closestPointToPoint(t, i), t.distanceTo(i);
|
|
2779
2799
|
};
|
|
2780
2800
|
})();
|
|
2781
2801
|
Je.prototype.distanceToBox = /* @__PURE__ */ (function() {
|
|
2782
|
-
const i = ["x", "y", "z"], e = /* @__PURE__ */ new Array(12).fill().map(() => new Nt()), t = /* @__PURE__ */ new Array(12).fill().map(() => new Nt()), n = /* @__PURE__ */ new
|
|
2802
|
+
const i = ["x", "y", "z"], e = /* @__PURE__ */ new Array(12).fill().map(() => new Nt()), t = /* @__PURE__ */ new Array(12).fill().map(() => new Nt()), n = /* @__PURE__ */ new $(), s = /* @__PURE__ */ new $();
|
|
2783
2803
|
return function(o, a = 0, c = null, u = null) {
|
|
2784
2804
|
if (this.needsUpdate && this.update(), this.intersectsBox(o))
|
|
2785
2805
|
return (c || u) && (o.getCenter(s), this.closestPointToPoint(s, n), o.closestPointToPoint(n, s), c && c.copy(n), u && u.copy(s)), 0;
|
|
@@ -2798,8 +2818,8 @@ Je.prototype.distanceToBox = /* @__PURE__ */ (function() {
|
|
|
2798
2818
|
for (let w = 0; w <= 1; w++) {
|
|
2799
2819
|
const b = (E + 1) % 3, _ = (E + 2) % 3, A = x << b | w << _, P = 1 << E | x << b | w << _, I = p[A], M = p[P];
|
|
2800
2820
|
e[S].set(I, M);
|
|
2801
|
-
const C = i[E], N = i[b], D = i[_], H = t[S], G = H.start,
|
|
2802
|
-
G[C] = h[C], G[N] = x ? h[N] : f[N], G[D] = w ? h[D] : f[N],
|
|
2821
|
+
const C = i[E], N = i[b], D = i[_], H = t[S], G = H.start, q = H.end;
|
|
2822
|
+
G[C] = h[C], G[N] = x ? h[N] : f[N], G[D] = w ? h[D] : f[N], q[C] = f[C], q[N] = x ? h[N] : f[N], q[D] = w ? h[D] : f[N], S++;
|
|
2803
2823
|
}
|
|
2804
2824
|
for (let E = 0; E <= 1; E++)
|
|
2805
2825
|
for (let x = 0; x <= 1; x++)
|
|
@@ -2827,7 +2847,7 @@ class cl extends or {
|
|
|
2827
2847
|
super(() => new Tt());
|
|
2828
2848
|
}
|
|
2829
2849
|
}
|
|
2830
|
-
const lt = /* @__PURE__ */ new cl(), Pn = /* @__PURE__ */ new
|
|
2850
|
+
const lt = /* @__PURE__ */ new cl(), Pn = /* @__PURE__ */ new $(), li = /* @__PURE__ */ new $();
|
|
2831
2851
|
function ll(i, e, t = {}, n = 0, s = 1 / 0) {
|
|
2832
2852
|
const r = n * n, o = s * s;
|
|
2833
2853
|
let a = 1 / 0, c = null;
|
|
@@ -2845,7 +2865,7 @@ function ll(i, e, t = {}, n = 0, s = 1 / 0) {
|
|
|
2845
2865
|
const u = Math.sqrt(a);
|
|
2846
2866
|
return t.point ? t.point.copy(li) : t.point = li.clone(), t.distance = u, t.faceIndex = c, t;
|
|
2847
2867
|
}
|
|
2848
|
-
const ws = parseInt(To) >= 169, hl = parseInt(To) <= 161, qt = /* @__PURE__ */ new
|
|
2868
|
+
const ws = parseInt(To) >= 169, hl = parseInt(To) <= 161, qt = /* @__PURE__ */ new $(), $t = /* @__PURE__ */ new $(), Qt = /* @__PURE__ */ new $(), Es = /* @__PURE__ */ new pe(), Ts = /* @__PURE__ */ new pe(), _s = /* @__PURE__ */ new pe(), Br = /* @__PURE__ */ new $(), Ur = /* @__PURE__ */ new $(), Hr = /* @__PURE__ */ new $(), Ln = /* @__PURE__ */ new $();
|
|
2849
2869
|
function ul(i, e, t, n, s, r, o, a) {
|
|
2850
2870
|
let c;
|
|
2851
2871
|
if (r === wo ? c = i.intersectTriangle(n, t, e, !0, s) : c = i.intersectTriangle(e, t, n, r !== Eo, s), c === null) return null;
|
|
@@ -2870,7 +2890,7 @@ function jr(i, e, t, n, s, r, o, a, c, u, d) {
|
|
|
2870
2890
|
ws || (h.uv1 = p), hl && (h.uv2 = h.uv1);
|
|
2871
2891
|
}
|
|
2872
2892
|
if (t) {
|
|
2873
|
-
Br.fromBufferAttribute(t, r), Ur.fromBufferAttribute(t, o), Hr.fromBufferAttribute(t, a), h.normal = new
|
|
2893
|
+
Br.fromBufferAttribute(t, r), Ur.fromBufferAttribute(t, o), Hr.fromBufferAttribute(t, a), h.normal = new $();
|
|
2874
2894
|
const p = En.getInterpolation(Ln, qt, $t, Qt, Br, Ur, Hr, h.normal);
|
|
2875
2895
|
h.normal.dot(i.direction) > 0 && h.normal.multiplyScalar(-1), ws || (h.normal = p);
|
|
2876
2896
|
}
|
|
@@ -2878,11 +2898,11 @@ function jr(i, e, t, n, s, r, o, a, c, u, d) {
|
|
|
2878
2898
|
a: r,
|
|
2879
2899
|
b: o,
|
|
2880
2900
|
c: a,
|
|
2881
|
-
normal: new
|
|
2901
|
+
normal: new $(),
|
|
2882
2902
|
materialIndex: 0
|
|
2883
2903
|
};
|
|
2884
2904
|
if (En.getNormal(qt, $t, Qt, f.normal), h.face = f, h.faceIndex = r, ws) {
|
|
2885
|
-
const p = new
|
|
2905
|
+
const p = new $();
|
|
2886
2906
|
En.getBarycoord(Ln, qt, $t, Qt, p), h.barycoord = p;
|
|
2887
2907
|
}
|
|
2888
2908
|
}
|
|
@@ -2984,8 +3004,8 @@ function ml(i, e = null) {
|
|
|
2984
3004
|
const O = I || M;
|
|
2985
3005
|
if (O)
|
|
2986
3006
|
for (let C = 0; C < 3; C++) {
|
|
2987
|
-
const N = E + C, D = x + C, H = c[N], G = c[N + 3],
|
|
2988
|
-
c[f + C] = H <
|
|
3007
|
+
const N = E + C, D = x + C, H = c[N], G = c[N + 3], q = c[D], ie = c[D + 3];
|
|
3008
|
+
c[f + C] = H < q ? H : q, c[f + C + 3] = G > ie ? G : ie;
|
|
2989
3009
|
}
|
|
2990
3010
|
return O;
|
|
2991
3011
|
}
|
|
@@ -3102,7 +3122,7 @@ function Ni(i, e, t, n, s = null) {
|
|
|
3102
3122
|
return xe(d, r, Ss), !!(s.intersectsBox(Ss) && Ni(d, e, t, n, s) || (xe(h, r, Ss), s.intersectsBox(Ss) && Ni(h, e, t, n, s)));
|
|
3103
3123
|
}
|
|
3104
3124
|
}
|
|
3105
|
-
const xs = /* @__PURE__ */ new ut(), hi = /* @__PURE__ */ new Je(), Dn = /* @__PURE__ */ new Je(), bl = /* @__PURE__ */ new
|
|
3125
|
+
const xs = /* @__PURE__ */ new ut(), hi = /* @__PURE__ */ new Je(), Dn = /* @__PURE__ */ new Je(), bl = /* @__PURE__ */ new $(), xl = /* @__PURE__ */ new $(), Al = /* @__PURE__ */ new $(), vl = /* @__PURE__ */ new $();
|
|
3106
3126
|
function Rl(i, e, t, n = {}, s = {}, r = 0, o = 1 / 0) {
|
|
3107
3127
|
e.boundingBox || e.computeBoundingBox(), hi.set(e.boundingBox.min, e.boundingBox.max, t), hi.needsUpdate = !0;
|
|
3108
3128
|
const a = i.geometry, c = a.attributes.position, u = a.index, d = e.attributes.position, h = e.index, f = lt.getPrimitive(), p = lt.getPrimitive();
|
|
@@ -3163,8 +3183,8 @@ function Ml(i, e = null) {
|
|
|
3163
3183
|
for (let N = 0; N < 3; N++) {
|
|
3164
3184
|
let D = C + N;
|
|
3165
3185
|
D = n ? n[D] : D;
|
|
3166
|
-
const H = s.getX(D), G = s.getY(D),
|
|
3167
|
-
H < w && (w = H), H > A && (A = H), G < b && (b = G), G > P && (P = G),
|
|
3186
|
+
const H = s.getX(D), G = s.getY(D), q = s.getZ(D);
|
|
3187
|
+
H < w && (w = H), H > A && (A = H), G < b && (b = G), G > P && (P = G), q < _ && (_ = q), q > I && (I = q);
|
|
3168
3188
|
}
|
|
3169
3189
|
}
|
|
3170
3190
|
return c[f + 0] !== w || c[f + 1] !== b || c[f + 2] !== _ || c[f + 3] !== A || c[f + 4] !== P || c[f + 5] !== I ? (c[f + 0] = w, c[f + 1] = b, c[f + 2] = _, c[f + 3] = A, c[f + 4] = P, c[f + 5] = I, !0) : !1;
|
|
@@ -3186,8 +3206,8 @@ function Ml(i, e = null) {
|
|
|
3186
3206
|
const O = I || M;
|
|
3187
3207
|
if (O)
|
|
3188
3208
|
for (let C = 0; C < 3; C++) {
|
|
3189
|
-
const N = E + C, D = x + C, H = c[N], G = c[N + 3],
|
|
3190
|
-
c[f + C] = H <
|
|
3209
|
+
const N = E + C, D = x + C, H = c[N], G = c[N + 3], q = c[D], ie = c[D + 3];
|
|
3210
|
+
c[f + C] = H < q ? H : q, c[f + C + 3] = G > ie ? G : ie;
|
|
3191
3211
|
}
|
|
3192
3212
|
return O;
|
|
3193
3213
|
}
|
|
@@ -3274,7 +3294,7 @@ function zi(i, e, t, n, s = null) {
|
|
|
3274
3294
|
return xe(d, r, As), !!(s.intersectsBox(As) && zi(d, e, t, n, s) || (xe(h, r, As), s.intersectsBox(As) && zi(h, e, t, n, s)));
|
|
3275
3295
|
}
|
|
3276
3296
|
}
|
|
3277
|
-
const Rs = /* @__PURE__ */ new ut(), ui = /* @__PURE__ */ new Je(), kn = /* @__PURE__ */ new Je(), Ol = /* @__PURE__ */ new
|
|
3297
|
+
const Rs = /* @__PURE__ */ new ut(), ui = /* @__PURE__ */ new Je(), kn = /* @__PURE__ */ new Je(), Ol = /* @__PURE__ */ new $(), Dl = /* @__PURE__ */ new $(), Nl = /* @__PURE__ */ new $(), kl = /* @__PURE__ */ new $();
|
|
3278
3298
|
function Fl(i, e, t, n = {}, s = {}, r = 0, o = 1 / 0) {
|
|
3279
3299
|
e.boundingBox || e.computeBoundingBox(), ui.set(e.boundingBox.min, e.boundingBox.max, t), ui.needsUpdate = !0;
|
|
3280
3300
|
const a = i.geometry, c = a.attributes.position, u = a.index, d = e.attributes.position, h = e.index, f = lt.getPrimitive(), p = lt.getPrimitive();
|
|
@@ -3296,8 +3316,8 @@ function Fl(i, e, t, n = {}, s = {}, r = 0, o = 1 / 0) {
|
|
|
3296
3316
|
const D = I.resolveTriangleIndex(C);
|
|
3297
3317
|
Ie(p, 3 * D, h, d), p.a.applyMatrix4(t), p.b.applyMatrix4(t), p.c.applyMatrix4(t), p.needsUpdate = !0;
|
|
3298
3318
|
for (let H = A, G = A + P; H < G; H++) {
|
|
3299
|
-
const
|
|
3300
|
-
Ie(f, 3 *
|
|
3319
|
+
const q = i.resolveTriangleIndex(H);
|
|
3320
|
+
Ie(f, 3 * q, u, c), f.needsUpdate = !0;
|
|
3301
3321
|
const ie = f.distanceToTriangle(p, y, E);
|
|
3302
3322
|
if (ie < w && (S.copy(y), x && x.copy(E), w = ie, b = H, _ = C), ie < r)
|
|
3303
3323
|
return !0;
|
|
@@ -3325,7 +3345,7 @@ function Fl(i, e, t, n = {}, s = {}, r = 0, o = 1 / 0) {
|
|
|
3325
3345
|
function Zr(i, e, t) {
|
|
3326
3346
|
return i === null ? null : (i.point.applyMatrix4(e.matrixWorld), i.distance = i.point.distanceTo(t.ray.origin), i.object = e, i);
|
|
3327
3347
|
}
|
|
3328
|
-
const Ms = /* @__PURE__ */ new Je(), Is = /* @__PURE__ */ new Yi(), Kr = /* @__PURE__ */ new
|
|
3348
|
+
const Ms = /* @__PURE__ */ new Je(), Is = /* @__PURE__ */ new Yi(), Kr = /* @__PURE__ */ new $(), Xr = /* @__PURE__ */ new ut(), Yr = /* @__PURE__ */ new $(), di = ["getX", "getY", "getZ"];
|
|
3329
3349
|
class Ws extends il {
|
|
3330
3350
|
/**
|
|
3331
3351
|
* Generates a representation of the complete bounds tree and the geometry index buffer which
|
|
@@ -3905,14 +3925,14 @@ class Le {
|
|
|
3905
3925
|
}
|
|
3906
3926
|
add(e) {
|
|
3907
3927
|
try {
|
|
3908
|
-
return e instanceof Le ? (this.object.add(e.getThreeObject()),
|
|
3928
|
+
return e instanceof Le ? (this.object.add(e.getThreeObject()), k.ok(void 0)) : k.err(
|
|
3909
3929
|
new Z(
|
|
3910
3930
|
"Child must be a ThreeObject3DAdapter",
|
|
3911
3931
|
Y.INVALID_PARAMETER
|
|
3912
3932
|
)
|
|
3913
3933
|
);
|
|
3914
3934
|
} catch (t) {
|
|
3915
|
-
return
|
|
3935
|
+
return k.err(
|
|
3916
3936
|
new Z(
|
|
3917
3937
|
"Failed to add child object",
|
|
3918
3938
|
Y.SCENE_OPERATION_FAILED,
|
|
@@ -3923,14 +3943,14 @@ class Le {
|
|
|
3923
3943
|
}
|
|
3924
3944
|
remove(e) {
|
|
3925
3945
|
try {
|
|
3926
|
-
return e instanceof Le ? (this.object.remove(e.getThreeObject()),
|
|
3946
|
+
return e instanceof Le ? (this.object.remove(e.getThreeObject()), k.ok(void 0)) : k.err(
|
|
3927
3947
|
new Z(
|
|
3928
3948
|
"Child must be a ThreeObject3DAdapter",
|
|
3929
3949
|
Y.INVALID_PARAMETER
|
|
3930
3950
|
)
|
|
3931
3951
|
);
|
|
3932
3952
|
} catch (t) {
|
|
3933
|
-
return
|
|
3953
|
+
return k.err(
|
|
3934
3954
|
new Z(
|
|
3935
3955
|
"Failed to remove child object",
|
|
3936
3956
|
Y.SCENE_OPERATION_FAILED,
|
|
@@ -3977,14 +3997,14 @@ class Lt {
|
|
|
3977
3997
|
}
|
|
3978
3998
|
add(e) {
|
|
3979
3999
|
try {
|
|
3980
|
-
return e instanceof Le ? (this.scene.add(e.getThreeObject()),
|
|
4000
|
+
return e instanceof Le ? (this.scene.add(e.getThreeObject()), k.ok(void 0)) : k.err(
|
|
3981
4001
|
new Z(
|
|
3982
4002
|
"Object must be a ThreeObject3DAdapter",
|
|
3983
4003
|
Y.INVALID_PARAMETER
|
|
3984
4004
|
)
|
|
3985
4005
|
);
|
|
3986
4006
|
} catch (t) {
|
|
3987
|
-
return
|
|
4007
|
+
return k.err(
|
|
3988
4008
|
new Z(
|
|
3989
4009
|
"Failed to add object to scene",
|
|
3990
4010
|
Y.SCENE_OPERATION_FAILED,
|
|
@@ -3995,14 +4015,14 @@ class Lt {
|
|
|
3995
4015
|
}
|
|
3996
4016
|
remove(e) {
|
|
3997
4017
|
try {
|
|
3998
|
-
return e instanceof Le ? (this.scene.remove(e.getThreeObject()),
|
|
4018
|
+
return e instanceof Le ? (this.scene.remove(e.getThreeObject()), k.ok(void 0)) : k.err(
|
|
3999
4019
|
new Z(
|
|
4000
4020
|
"Object must be a ThreeObject3DAdapter",
|
|
4001
4021
|
Y.INVALID_PARAMETER
|
|
4002
4022
|
)
|
|
4003
4023
|
);
|
|
4004
4024
|
} catch (t) {
|
|
4005
|
-
return
|
|
4025
|
+
return k.err(
|
|
4006
4026
|
new Z(
|
|
4007
4027
|
"Failed to remove object from scene",
|
|
4008
4028
|
Y.SCENE_OPERATION_FAILED,
|
|
@@ -4234,9 +4254,9 @@ class jl {
|
|
|
4234
4254
|
const { clientWidth: t, clientHeight: n } = this.canvas.parentElement || this.canvas;
|
|
4235
4255
|
t && n && this.renderer.setSize(t, n);
|
|
4236
4256
|
}
|
|
4237
|
-
return this.renderer.outputColorSpace = T.SRGBColorSpace,
|
|
4257
|
+
return this.renderer.outputColorSpace = T.SRGBColorSpace, k.ok(void 0);
|
|
4238
4258
|
} catch (t) {
|
|
4239
|
-
return
|
|
4259
|
+
return k.err(
|
|
4240
4260
|
new Z(
|
|
4241
4261
|
"Failed to initialize renderer",
|
|
4242
4262
|
Y.RENDERER_INIT_FAILED,
|
|
@@ -4247,7 +4267,7 @@ class jl {
|
|
|
4247
4267
|
}
|
|
4248
4268
|
render(e, t) {
|
|
4249
4269
|
if (!this.renderer)
|
|
4250
|
-
return
|
|
4270
|
+
return k.err(
|
|
4251
4271
|
new Z(
|
|
4252
4272
|
"Renderer not initialized",
|
|
4253
4273
|
Y.RENDERER_NOT_INITIALIZED
|
|
@@ -4255,23 +4275,23 @@ class jl {
|
|
|
4255
4275
|
);
|
|
4256
4276
|
try {
|
|
4257
4277
|
if (!(e instanceof Lt))
|
|
4258
|
-
return
|
|
4278
|
+
return k.err(
|
|
4259
4279
|
new Z(
|
|
4260
4280
|
"Scene must be a ThreeSceneAdapter",
|
|
4261
4281
|
Y.INVALID_PARAMETER
|
|
4262
4282
|
)
|
|
4263
4283
|
);
|
|
4264
4284
|
if (!(t instanceof Uo))
|
|
4265
|
-
return
|
|
4285
|
+
return k.err(
|
|
4266
4286
|
new Z(
|
|
4267
4287
|
"Camera must be a ThreeCameraAdapter",
|
|
4268
4288
|
Y.INVALID_PARAMETER
|
|
4269
4289
|
)
|
|
4270
4290
|
);
|
|
4271
4291
|
const n = e.getThreeScene(), s = t.getThreeCamera();
|
|
4272
|
-
return this.renderer.render(n, s),
|
|
4292
|
+
return this.renderer.render(n, s), k.ok(void 0);
|
|
4273
4293
|
} catch (n) {
|
|
4274
|
-
return
|
|
4294
|
+
return k.err(
|
|
4275
4295
|
new Z(
|
|
4276
4296
|
"Failed to render frame",
|
|
4277
4297
|
Y.RENDER_FAILED,
|
|
@@ -4963,7 +4983,7 @@ class ch {
|
|
|
4963
4983
|
return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(e)), Promise.all(a).then((u) => {
|
|
4964
4984
|
const d = u.pop(), h = d.isGroup ? d.children : [d], f = u[0].count, p = [];
|
|
4965
4985
|
for (const y of h) {
|
|
4966
|
-
const S = new ut(), E = new
|
|
4986
|
+
const S = new ut(), E = new $(), x = new xn(), w = new $(1, 1, 1), b = new Ao(y.geometry, y.material, f);
|
|
4967
4987
|
for (let _ = 0; _ < f; _++)
|
|
4968
4988
|
c.TRANSLATION && E.fromBufferAttribute(c.TRANSLATION, _), c.ROTATION && x.fromBufferAttribute(c.ROTATION, _), c.SCALE && w.fromBufferAttribute(c.SCALE, _), b.setMatrixAt(_, S.compose(E, x, w));
|
|
4969
4989
|
for (const _ in c)
|
|
@@ -5867,7 +5887,7 @@ class Sh {
|
|
|
5867
5887
|
d.add(h[p]);
|
|
5868
5888
|
if (d.userData.pivot !== void 0 && h.length > 0) {
|
|
5869
5889
|
const p = d.userData.pivot, y = h[0];
|
|
5870
|
-
d.pivot = new
|
|
5890
|
+
d.pivot = new $().fromArray(p), d.position.x -= p[0], d.position.y -= p[1], d.position.z -= p[2], y.position.set(0, 0, 0), delete d.userData.pivot;
|
|
5871
5891
|
}
|
|
5872
5892
|
return d;
|
|
5873
5893
|
});
|
|
@@ -6002,8 +6022,8 @@ function bh(i, e, t) {
|
|
|
6002
6022
|
const a = t.json.accessors[n.POSITION], c = a.min, u = a.max;
|
|
6003
6023
|
if (c !== void 0 && u !== void 0) {
|
|
6004
6024
|
if (s.set(
|
|
6005
|
-
new
|
|
6006
|
-
new
|
|
6025
|
+
new $(c[0], c[1], c[2]),
|
|
6026
|
+
new $(u[0], u[1], u[2])
|
|
6007
6027
|
), a.normalized) {
|
|
6008
6028
|
const d = Hi(bn[a.componentType]);
|
|
6009
6029
|
s.min.multiplyScalar(d), s.max.multiplyScalar(d);
|
|
@@ -6016,7 +6036,7 @@ function bh(i, e, t) {
|
|
|
6016
6036
|
return;
|
|
6017
6037
|
const r = e.targets;
|
|
6018
6038
|
if (r !== void 0) {
|
|
6019
|
-
const a = new
|
|
6039
|
+
const a = new $(), c = new $();
|
|
6020
6040
|
for (let u = 0, d = r.length; u < d; u++) {
|
|
6021
6041
|
const h = r[u];
|
|
6022
6042
|
if (h.POSITION !== void 0) {
|
|
@@ -6114,13 +6134,13 @@ class Rh {
|
|
|
6114
6134
|
}),
|
|
6115
6135
|
userData: s.userData
|
|
6116
6136
|
};
|
|
6117
|
-
n(
|
|
6137
|
+
n(k.ok(r));
|
|
6118
6138
|
},
|
|
6119
6139
|
(s) => {
|
|
6120
6140
|
s.total > 0 && (t == null || t(s.loaded, s.total));
|
|
6121
6141
|
},
|
|
6122
6142
|
(s) => {
|
|
6123
|
-
n(
|
|
6143
|
+
n(k.err(
|
|
6124
6144
|
new Z(
|
|
6125
6145
|
"Failed to load GLTF model",
|
|
6126
6146
|
Y.MODEL_LOAD_FAILED,
|
|
@@ -6131,7 +6151,7 @@ class Rh {
|
|
|
6131
6151
|
);
|
|
6132
6152
|
});
|
|
6133
6153
|
} catch (n) {
|
|
6134
|
-
return
|
|
6154
|
+
return k.err(
|
|
6135
6155
|
new Z(
|
|
6136
6156
|
"Failed to initiate model loading",
|
|
6137
6157
|
Y.MODEL_LOAD_FAILED,
|
|
@@ -6187,7 +6207,7 @@ class io {
|
|
|
6187
6207
|
}
|
|
6188
6208
|
}
|
|
6189
6209
|
}
|
|
6190
|
-
const ro = { type: "change" }, hr = { type: "start" }, Wo = { type: "end" }, Ls = new Yi(), oo = new Qn(), Mh = Math.cos(70 * tr.DEG2RAD), Ce = new
|
|
6210
|
+
const ro = { type: "change" }, hr = { type: "start" }, Wo = { type: "end" }, Ls = new Yi(), oo = new Qn(), Mh = Math.cos(70 * tr.DEG2RAD), Ce = new $(), tt = 2 * Math.PI, we = {
|
|
6191
6211
|
NONE: -1,
|
|
6192
6212
|
ROTATE: 0,
|
|
6193
6213
|
DOLLY: 1,
|
|
@@ -6205,7 +6225,7 @@ class Zo extends Io {
|
|
|
6205
6225
|
* @param {?HTMLElement} domElement - The HTML element used for event listeners.
|
|
6206
6226
|
*/
|
|
6207
6227
|
constructor(e, t = null) {
|
|
6208
|
-
super(e, t), this.state = we.NONE, this.target = new
|
|
6228
|
+
super(e, t), this.state = we.NONE, this.target = new $(), this.cursor = new $(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.keyRotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: Be.ROTATE, MIDDLE: Be.DOLLY, RIGHT: Be.PAN }, this.touches = { ONE: Ye.ROTATE, TWO: Ye.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._cursorStyle = "auto", this._domElementKeyEvents = null, this._lastPosition = new $(), this._lastQuaternion = new xn(), this._lastTargetPosition = new $(), this._quat = new xn().setFromUnitVectors(e.up, new $(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new js(), this._sphericalDelta = new js(), this._scale = 1, this._panOffset = new $(), this._rotateStart = new pe(), this._rotateEnd = new pe(), this._rotateDelta = new pe(), this._panStart = new pe(), this._panEnd = new pe(), this._panDelta = new pe(), this._dollyStart = new pe(), this._dollyEnd = new pe(), this._dollyDelta = new pe(), this._dollyDirection = new $(), this._mouse = new pe(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Ch.bind(this), this._onPointerDown = Ih.bind(this), this._onPointerUp = Ph.bind(this), this._onContextMenu = zh.bind(this), this._onMouseWheel = Dh.bind(this), this._onKeyDown = Nh.bind(this), this._onTouchStart = kh.bind(this), this._onTouchMove = Fh.bind(this), this._onMouseDown = Lh.bind(this), this._onMouseMove = Oh.bind(this), this._interceptControlDown = Bh.bind(this), this._interceptControlUp = Uh.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
|
|
6209
6229
|
}
|
|
6210
6230
|
/**
|
|
6211
6231
|
* Defines the visual representation of the cursor.
|
|
@@ -6341,11 +6361,11 @@ class Zo extends Io {
|
|
|
6341
6361
|
const c = a - o;
|
|
6342
6362
|
this.object.position.addScaledVector(this._dollyDirection, c), this.object.updateMatrixWorld(), r = !!c;
|
|
6343
6363
|
} else if (this.object.isOrthographicCamera) {
|
|
6344
|
-
const a = new
|
|
6364
|
+
const a = new $(this._mouse.x, this._mouse.y, 0);
|
|
6345
6365
|
a.unproject(this.object);
|
|
6346
6366
|
const c = this.object.zoom;
|
|
6347
6367
|
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), this.object.updateProjectionMatrix(), r = c !== this.object.zoom;
|
|
6348
|
-
const u = new
|
|
6368
|
+
const u = new $(this._mouse.x, this._mouse.y, 0);
|
|
6349
6369
|
u.unproject(this.object), this.object.position.sub(u).add(a), this.object.updateMatrixWorld(), o = Ce.length();
|
|
6350
6370
|
} else
|
|
6351
6371
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
|
|
@@ -6694,10 +6714,10 @@ function Bh(i) {
|
|
|
6694
6714
|
function Uh(i) {
|
|
6695
6715
|
i.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
6696
6716
|
}
|
|
6697
|
-
const yi = new Qn(), Os = new Sc(), gn = new pe(), wi = new
|
|
6717
|
+
const yi = new Qn(), Os = new Sc(), gn = new pe(), wi = new $();
|
|
6698
6718
|
class Hh extends Zo {
|
|
6699
6719
|
constructor(e, t) {
|
|
6700
|
-
super(e, t), this.screenSpacePanning = !1, this.mouseButtons = { LEFT: Be.PAN, MIDDLE: Be.DOLLY, RIGHT: Be.ROTATE }, this.touches = { ONE: Ye.PAN, TWO: Ye.DOLLY_ROTATE }, this._panWorldStart = new
|
|
6720
|
+
super(e, t), this.screenSpacePanning = !1, this.mouseButtons = { LEFT: Be.PAN, MIDDLE: Be.DOLLY, RIGHT: Be.ROTATE }, this.touches = { ONE: Ye.PAN, TWO: Ye.DOLLY_ROTATE }, this._panWorldStart = new $();
|
|
6701
6721
|
}
|
|
6702
6722
|
_handleMouseDownPan(e) {
|
|
6703
6723
|
if (super._handleMouseDownPan(e), this._panOffset.set(0, 0, 0), this.screenSpacePanning === !0) return;
|
|
@@ -7337,7 +7357,7 @@ class Yh {
|
|
|
7337
7357
|
addHelpers(e, t) {
|
|
7338
7358
|
try {
|
|
7339
7359
|
if (!(e instanceof Lt))
|
|
7340
|
-
return
|
|
7360
|
+
return k.err(
|
|
7341
7361
|
new Z(
|
|
7342
7362
|
"Scene must be ThreeSceneAdapter",
|
|
7343
7363
|
Y.INVALID_PARAMETER
|
|
@@ -7374,9 +7394,9 @@ class Yh {
|
|
|
7374
7394
|
const s = t.axesSize || 5, r = new T.AxesHelper(s);
|
|
7375
7395
|
n.add(r);
|
|
7376
7396
|
}
|
|
7377
|
-
return
|
|
7397
|
+
return k.ok(void 0);
|
|
7378
7398
|
} catch (n) {
|
|
7379
|
-
return
|
|
7399
|
+
return k.err(
|
|
7380
7400
|
new Z(
|
|
7381
7401
|
"Failed to add helpers to scene",
|
|
7382
7402
|
Y.SCENE_OPERATION_FAILED,
|
|
@@ -7389,7 +7409,7 @@ class Yh {
|
|
|
7389
7409
|
var s;
|
|
7390
7410
|
try {
|
|
7391
7411
|
if (!(e instanceof Lt))
|
|
7392
|
-
return
|
|
7412
|
+
return k.err(
|
|
7393
7413
|
new Z(
|
|
7394
7414
|
"Scene must be ThreeSceneAdapter",
|
|
7395
7415
|
Y.INVALID_PARAMETER
|
|
@@ -7397,7 +7417,7 @@ class Yh {
|
|
|
7397
7417
|
);
|
|
7398
7418
|
const r = e.getThreeScene(), o = r.userData, a = o == null ? void 0 : o.gridOptions;
|
|
7399
7419
|
if (!(a != null && a.enabled))
|
|
7400
|
-
return
|
|
7420
|
+
return k.ok(void 0);
|
|
7401
7421
|
const c = [];
|
|
7402
7422
|
r.traverse((M) => {
|
|
7403
7423
|
var O, C, N;
|
|
@@ -7409,7 +7429,7 @@ class Yh {
|
|
|
7409
7429
|
t instanceof Le || "getThreeObject" in t && typeof t.getThreeObject == "function" ? u = t.getThreeObject() : u = t;
|
|
7410
7430
|
const d = new T.Box3().setFromObject(u), h = d.getSize(new T.Vector3());
|
|
7411
7431
|
if (d.isEmpty() || !Number.isFinite(h.x) || !Number.isFinite(h.z))
|
|
7412
|
-
return console.warn("Skipping dynamic grid: object has an empty or non-finite bounding box"),
|
|
7432
|
+
return console.warn("Skipping dynamic grid: object has an empty or non-finite bounding box"), k.ok(void 0);
|
|
7413
7433
|
const f = (s = a.styleOptions) == null ? void 0 : s.tileSize, p = typeof f == "number" ? f : 1, S = sn.getGridSpacing(p).width, E = Math.max(h.x, h.z) * n + h.y;
|
|
7414
7434
|
let x = E <= S ? 0 : Math.ceil((E / S - 1) / 2);
|
|
7415
7435
|
const w = 60;
|
|
@@ -7429,9 +7449,9 @@ class Yh {
|
|
|
7429
7449
|
}, P = Zs.createGrid(b, A);
|
|
7430
7450
|
P.userData.isGrid = !0, P.userData.isHexGrid = !0;
|
|
7431
7451
|
const I = P.getObjectByName(qn);
|
|
7432
|
-
return I && (I.position.y = T.MathUtils.clamp(h.y * 25e-4, 2e-4, 2e-3)), r.add(P),
|
|
7452
|
+
return I && (I.position.y = T.MathUtils.clamp(h.y * 25e-4, 2e-4, 2e-3)), r.add(P), k.ok(void 0);
|
|
7433
7453
|
} catch (r) {
|
|
7434
|
-
return
|
|
7454
|
+
return k.err(
|
|
7435
7455
|
new Z(
|
|
7436
7456
|
"Failed to add dynamic grid",
|
|
7437
7457
|
Y.SCENE_OPERATION_FAILED,
|
|
@@ -7443,7 +7463,7 @@ class Yh {
|
|
|
7443
7463
|
snapObjectToFloor(e, t) {
|
|
7444
7464
|
try {
|
|
7445
7465
|
if (!(e instanceof Lt))
|
|
7446
|
-
return
|
|
7466
|
+
return k.err(
|
|
7447
7467
|
new Z(
|
|
7448
7468
|
"Scene must be ThreeSceneAdapter",
|
|
7449
7469
|
Y.INVALID_PARAMETER
|
|
@@ -7470,16 +7490,16 @@ class Yh {
|
|
|
7470
7490
|
if (n.traverse((_) => {
|
|
7471
7491
|
_.isMesh && a.push(_);
|
|
7472
7492
|
}), o.length === 0 || a.length === 0)
|
|
7473
|
-
return
|
|
7493
|
+
return k.ok(void 0);
|
|
7474
7494
|
let c = -1 / 0;
|
|
7475
7495
|
const u = new T.Box3();
|
|
7476
7496
|
for (const _ of o)
|
|
7477
7497
|
u.setFromObject(_), Number.isFinite(u.max.y) && (c = Math.max(c, u.max.y));
|
|
7478
7498
|
if (!Number.isFinite(c))
|
|
7479
|
-
return
|
|
7499
|
+
return k.ok(void 0);
|
|
7480
7500
|
const d = new T.Box3().setFromObject(n);
|
|
7481
7501
|
if (d.isEmpty() || !Number.isFinite(d.min.x) || !Number.isFinite(d.max.x))
|
|
7482
|
-
return
|
|
7502
|
+
return k.ok(void 0);
|
|
7483
7503
|
const h = 40, f = Math.max(1, d.max.y - d.min.y), p = d.max.y + f, y = d.min.y - f, S = new T.Raycaster(), E = new T.Vector3(0, -1, 0), x = new T.Vector3(0, 1, 0);
|
|
7484
7504
|
let w = 1 / 0;
|
|
7485
7505
|
const b = (_, A, P, I) => {
|
|
@@ -7496,9 +7516,9 @@ class Yh {
|
|
|
7496
7516
|
const _ = w - c;
|
|
7497
7517
|
Math.abs(_) > 1e-4 && (n.position.y -= _);
|
|
7498
7518
|
}
|
|
7499
|
-
return
|
|
7519
|
+
return k.ok(void 0);
|
|
7500
7520
|
} catch (n) {
|
|
7501
|
-
return
|
|
7521
|
+
return k.err(
|
|
7502
7522
|
new Z(
|
|
7503
7523
|
"Failed to snap object to floor",
|
|
7504
7524
|
Y.SCENE_OPERATION_FAILED,
|
|
@@ -7510,7 +7530,7 @@ class Yh {
|
|
|
7510
7530
|
fitShadowCameraToObject(e, t) {
|
|
7511
7531
|
try {
|
|
7512
7532
|
if (!(e instanceof Lt))
|
|
7513
|
-
return
|
|
7533
|
+
return k.err(
|
|
7514
7534
|
new Z(
|
|
7515
7535
|
"Scene must be ThreeSceneAdapter",
|
|
7516
7536
|
Y.INVALID_PARAMETER
|
|
@@ -7520,14 +7540,14 @@ class Yh {
|
|
|
7520
7540
|
t instanceof Le || "getThreeObject" in t && typeof t.getThreeObject == "function" ? n = t.getThreeObject() : n = t;
|
|
7521
7541
|
const s = new T.Box3().setFromObject(n);
|
|
7522
7542
|
if (s.isEmpty() || !Number.isFinite(s.min.x) || !Number.isFinite(s.max.x))
|
|
7523
|
-
return
|
|
7543
|
+
return k.ok(void 0);
|
|
7524
7544
|
const r = s.getSize(new T.Vector3()), o = e.getThreeScene(), a = co(o);
|
|
7525
7545
|
if (!a || !a.castShadow)
|
|
7526
|
-
return
|
|
7546
|
+
return k.ok(void 0);
|
|
7527
7547
|
const d = Math.max(r.x, r.y, r.z, 0.1) * 2, h = a.shadow.camera;
|
|
7528
|
-
return h.left = -d, h.right = d, h.top = d, h.bottom = -d, h.updateProjectionMatrix(),
|
|
7548
|
+
return h.left = -d, h.right = d, h.top = d, h.bottom = -d, h.updateProjectionMatrix(), k.ok(void 0);
|
|
7529
7549
|
} catch (n) {
|
|
7530
|
-
return
|
|
7550
|
+
return k.err(
|
|
7531
7551
|
new Z(
|
|
7532
7552
|
"Failed to fit shadow camera to object",
|
|
7533
7553
|
Y.SCENE_OPERATION_FAILED,
|
|
@@ -7540,7 +7560,7 @@ class Yh {
|
|
|
7540
7560
|
try {
|
|
7541
7561
|
const s = ji(e);
|
|
7542
7562
|
if (!s)
|
|
7543
|
-
return
|
|
7563
|
+
return k.err(
|
|
7544
7564
|
new Z(
|
|
7545
7565
|
"Scene must be ThreeSceneAdapter",
|
|
7546
7566
|
Y.INVALID_PARAMETER
|
|
@@ -7548,7 +7568,7 @@ class Yh {
|
|
|
7548
7568
|
);
|
|
7549
7569
|
const r = en(t);
|
|
7550
7570
|
if (!r)
|
|
7551
|
-
return
|
|
7571
|
+
return k.err(
|
|
7552
7572
|
new Z(
|
|
7553
7573
|
"Object must expose a Three.js Object3D",
|
|
7554
7574
|
Y.INVALID_PARAMETER
|
|
@@ -7556,16 +7576,16 @@ class Yh {
|
|
|
7556
7576
|
);
|
|
7557
7577
|
const o = Xo(n.getInternalRenderer());
|
|
7558
7578
|
if (!o || !o.shadowMap.enabled)
|
|
7559
|
-
return
|
|
7579
|
+
return k.ok(void 0);
|
|
7560
7580
|
const a = co(s);
|
|
7561
7581
|
return !a || !a.castShadow || this.contactShadowBaker.bake({
|
|
7562
7582
|
renderer: o,
|
|
7563
7583
|
scene: s,
|
|
7564
7584
|
object: r,
|
|
7565
7585
|
light: a
|
|
7566
|
-
}),
|
|
7586
|
+
}), k.ok(void 0);
|
|
7567
7587
|
} catch (s) {
|
|
7568
|
-
return
|
|
7588
|
+
return k.err(
|
|
7569
7589
|
new Z(
|
|
7570
7590
|
"Failed to bake contact shadow",
|
|
7571
7591
|
Y.SCENE_OPERATION_FAILED,
|
|
@@ -7578,16 +7598,16 @@ class Yh {
|
|
|
7578
7598
|
try {
|
|
7579
7599
|
const n = ji(e);
|
|
7580
7600
|
if (!n)
|
|
7581
|
-
return
|
|
7601
|
+
return k.err(
|
|
7582
7602
|
new Z(
|
|
7583
7603
|
"Scene must be ThreeSceneAdapter",
|
|
7584
7604
|
Y.INVALID_PARAMETER
|
|
7585
7605
|
)
|
|
7586
7606
|
);
|
|
7587
7607
|
const s = n.getObjectByName(Gi), r = n.getObjectByName(qn);
|
|
7588
|
-
return t === "baked" && !s || (s && (s.visible = t === "baked"), r && (r.visible = t === "live")),
|
|
7608
|
+
return t === "baked" && !s || (s && (s.visible = t === "baked"), r && (r.visible = t === "live")), k.ok(void 0);
|
|
7589
7609
|
} catch (n) {
|
|
7590
|
-
return
|
|
7610
|
+
return k.err(
|
|
7591
7611
|
new Z(
|
|
7592
7612
|
"Failed to switch contact shadow mode",
|
|
7593
7613
|
Y.SCENE_OPERATION_FAILED,
|
|
@@ -7600,16 +7620,16 @@ class Yh {
|
|
|
7600
7620
|
try {
|
|
7601
7621
|
const n = en(e);
|
|
7602
7622
|
if (!n)
|
|
7603
|
-
return
|
|
7623
|
+
return k.err(
|
|
7604
7624
|
new Z(
|
|
7605
7625
|
"Object must expose a Three.js Object3D",
|
|
7606
7626
|
Y.INVALID_PARAMETER
|
|
7607
7627
|
)
|
|
7608
7628
|
);
|
|
7609
7629
|
const s = new T.Group();
|
|
7610
|
-
return s.name = vc, s.scale.setScalar(t), s.add(n),
|
|
7630
|
+
return s.name = vc, s.scale.setScalar(t), s.add(n), k.ok(new Le(s));
|
|
7611
7631
|
} catch (n) {
|
|
7612
|
-
return
|
|
7632
|
+
return k.err(
|
|
7613
7633
|
new Z(
|
|
7614
7634
|
"Failed to apply the units scale to the model",
|
|
7615
7635
|
Y.SCENE_OPERATION_FAILED,
|
|
@@ -7621,7 +7641,7 @@ class Yh {
|
|
|
7621
7641
|
addLighting(e, t) {
|
|
7622
7642
|
try {
|
|
7623
7643
|
if (!(e instanceof Lt))
|
|
7624
|
-
return
|
|
7644
|
+
return k.err(
|
|
7625
7645
|
new Z(
|
|
7626
7646
|
"Scene must be ThreeSceneAdapter",
|
|
7627
7647
|
Y.INVALID_PARAMETER
|
|
@@ -7660,9 +7680,9 @@ class Yh {
|
|
|
7660
7680
|
}
|
|
7661
7681
|
o.target.position.set(0, 0, 0), n.add(o), n.add(o.target), o.shadow && o.shadow.camera.updateProjectionMatrix();
|
|
7662
7682
|
}
|
|
7663
|
-
return
|
|
7683
|
+
return k.ok(void 0);
|
|
7664
7684
|
} catch (n) {
|
|
7665
|
-
return
|
|
7685
|
+
return k.err(
|
|
7666
7686
|
new Z(
|
|
7667
7687
|
"Failed to add lighting to scene",
|
|
7668
7688
|
Y.SCENE_OPERATION_FAILED,
|
|
@@ -7674,7 +7694,7 @@ class Yh {
|
|
|
7674
7694
|
createGradientBackground(e, t) {
|
|
7675
7695
|
try {
|
|
7676
7696
|
if (!(e instanceof Lt))
|
|
7677
|
-
return
|
|
7697
|
+
return k.err(
|
|
7678
7698
|
new Z(
|
|
7679
7699
|
"Scene must be ThreeSceneAdapter",
|
|
7680
7700
|
Y.INVALID_PARAMETER
|
|
@@ -7684,7 +7704,7 @@ class Yh {
|
|
|
7684
7704
|
s.width = 2, s.height = 512;
|
|
7685
7705
|
const r = s.getContext("2d");
|
|
7686
7706
|
if (!r)
|
|
7687
|
-
return
|
|
7707
|
+
return k.err(
|
|
7688
7708
|
new Z(
|
|
7689
7709
|
"Failed to create canvas context",
|
|
7690
7710
|
Y.SCENE_OPERATION_FAILED
|
|
@@ -7695,9 +7715,9 @@ class Yh {
|
|
|
7695
7715
|
const a = new T.CanvasTexture(s);
|
|
7696
7716
|
a.needsUpdate = !0;
|
|
7697
7717
|
const c = n.background;
|
|
7698
|
-
return c instanceof T.Texture && c !== n.environment && c.dispose(), n.background = a,
|
|
7718
|
+
return c instanceof T.Texture && c !== n.environment && c.dispose(), n.background = a, k.ok(void 0);
|
|
7699
7719
|
} catch (n) {
|
|
7700
|
-
return
|
|
7720
|
+
return k.err(
|
|
7701
7721
|
new Z(
|
|
7702
7722
|
"Failed to create gradient background",
|
|
7703
7723
|
Y.SCENE_OPERATION_FAILED,
|
|
@@ -7714,9 +7734,9 @@ class Yh {
|
|
|
7714
7734
|
let f = Math.abs(d / 2 / Math.tan(h / 2));
|
|
7715
7735
|
f *= 2;
|
|
7716
7736
|
const p = -Math.PI / 4, y = Math.PI / 8, S = c.x + f * Math.sin(p) * Math.cos(y), E = c.y + f * Math.sin(y), x = c.z + f * Math.cos(p) * Math.cos(y);
|
|
7717
|
-
return r.position.set(S, E, x), r.lookAt(c), r.updateProjectionMatrix(), o && o.target && (o.target.copy(c), o.update()),
|
|
7737
|
+
return r.position.set(S, E, x), r.lookAt(c), r.updateProjectionMatrix(), o && o.target && (o.target.copy(c), o.update()), k.ok(void 0);
|
|
7718
7738
|
} catch (s) {
|
|
7719
|
-
return
|
|
7739
|
+
return k.err(
|
|
7720
7740
|
new Z(
|
|
7721
7741
|
"Failed to fit camera to object",
|
|
7722
7742
|
Y.CAMERA_INIT_FAILED,
|
|
@@ -7731,9 +7751,9 @@ class qh {
|
|
|
7731
7751
|
this.events = new nr(), this.disposed = !1;
|
|
7732
7752
|
}
|
|
7733
7753
|
async initialize(e) {
|
|
7734
|
-
const { ThreePathTracingService: t } = await import("./ThreePathTracingService-
|
|
7754
|
+
const { ThreePathTracingService: t } = await import("./ThreePathTracingService-B3fodLjq.js");
|
|
7735
7755
|
if (this.disposed)
|
|
7736
|
-
return
|
|
7756
|
+
return k.ok(void 0);
|
|
7737
7757
|
const n = new t();
|
|
7738
7758
|
return this.inner = n, n.events.on("pathtracing:paused", (s) => {
|
|
7739
7759
|
this.events.emit("pathtracing:paused", s);
|
|
@@ -7746,7 +7766,7 @@ class qh {
|
|
|
7746
7766
|
this.inner ? this.inner.updateSettings(e) : this.pendingSettings = { ...this.pendingSettings, ...e };
|
|
7747
7767
|
}
|
|
7748
7768
|
render(e, t) {
|
|
7749
|
-
return this.inner ? this.inner.render(e, t) : Promise.resolve(
|
|
7769
|
+
return this.inner ? this.inner.render(e, t) : Promise.resolve(k.ok(void 0));
|
|
7750
7770
|
}
|
|
7751
7771
|
getSampleCount() {
|
|
7752
7772
|
var e;
|
|
@@ -7954,9 +7974,9 @@ var nu = /* @__PURE__ */ Zn(ts, 9, 1), su = /* @__PURE__ */ Zn(ta, 5, 1), Ei = f
|
|
|
7954
7974
|
C[Qh[N]] = mt(i, h + N * 3, 7);
|
|
7955
7975
|
h += I * 3;
|
|
7956
7976
|
for (var D = Ei(C), H = (1 << D) - 1, G = Zn(C, D, 1), N = 0; N < M; ) {
|
|
7957
|
-
var
|
|
7958
|
-
h +=
|
|
7959
|
-
var b =
|
|
7977
|
+
var q = G[mt(i, h, H)];
|
|
7978
|
+
h += q & 15;
|
|
7979
|
+
var b = q >> 4;
|
|
7960
7980
|
if (b < 16)
|
|
7961
7981
|
O[N++] = b;
|
|
7962
7982
|
else {
|
|
@@ -8073,33 +8093,33 @@ class du extends Co {
|
|
|
8073
8093
|
m = m << 8 | Er(R, L), g += 8;
|
|
8074
8094
|
g -= l, H.l = m >> g & (1 << l) - 1, H.c = m, H.lc = g;
|
|
8075
8095
|
}
|
|
8076
|
-
const
|
|
8096
|
+
const q = new Array(59);
|
|
8077
8097
|
function ie(l) {
|
|
8078
|
-
for (let g = 0; g <= 58; ++g)
|
|
8079
|
-
for (let g = 0; g < 65537; ++g)
|
|
8098
|
+
for (let g = 0; g <= 58; ++g) q[g] = 0;
|
|
8099
|
+
for (let g = 0; g < 65537; ++g) q[l[g]] += 1;
|
|
8080
8100
|
let m = 0;
|
|
8081
8101
|
for (let g = 58; g > 0; --g) {
|
|
8082
|
-
const R = m +
|
|
8083
|
-
|
|
8102
|
+
const R = m + q[g] >> 1;
|
|
8103
|
+
q[g] = m, m = R;
|
|
8084
8104
|
}
|
|
8085
8105
|
for (let g = 0; g < 65537; ++g) {
|
|
8086
8106
|
const R = l[g];
|
|
8087
|
-
R > 0 && (l[g] = R |
|
|
8107
|
+
R > 0 && (l[g] = R | q[R]++ << 6);
|
|
8088
8108
|
}
|
|
8089
8109
|
}
|
|
8090
8110
|
function Ne(l, m, g, R, L, z) {
|
|
8091
8111
|
const v = m;
|
|
8092
|
-
let U = 0,
|
|
8112
|
+
let U = 0, F = 0;
|
|
8093
8113
|
for (; R <= L; R++) {
|
|
8094
8114
|
if (v.value - m.value > g) return !1;
|
|
8095
|
-
G(6, U,
|
|
8115
|
+
G(6, U, F, l, v);
|
|
8096
8116
|
const B = H.l;
|
|
8097
|
-
if (U = H.c,
|
|
8117
|
+
if (U = H.c, F = H.lc, z[R] = B, B == 63) {
|
|
8098
8118
|
if (v.value - m.value > g)
|
|
8099
8119
|
throw new Error("THREE.EXRLoader: Something wrong with hufUnpackEncTable");
|
|
8100
|
-
G(8, U,
|
|
8120
|
+
G(8, U, F, l, v);
|
|
8101
8121
|
let j = H.l + 6;
|
|
8102
|
-
if (U = H.c,
|
|
8122
|
+
if (U = H.c, F = H.lc, R + j > L + 1)
|
|
8103
8123
|
throw new Error("THREE.EXRLoader: Something wrong with hufUnpackEncTable");
|
|
8104
8124
|
for (; j--; ) z[R++] = 0;
|
|
8105
8125
|
R--;
|
|
@@ -8131,18 +8151,18 @@ class du extends Co {
|
|
|
8131
8151
|
if (v.lit++, v.p) {
|
|
8132
8152
|
const U = v.p;
|
|
8133
8153
|
v.p = new Array(v.lit);
|
|
8134
|
-
for (let
|
|
8135
|
-
v.p[
|
|
8154
|
+
for (let F = 0; F < v.lit - 1; ++F)
|
|
8155
|
+
v.p[F] = U[F];
|
|
8136
8156
|
} else
|
|
8137
8157
|
v.p = new Array(1);
|
|
8138
8158
|
v.p[v.lit - 1] = m;
|
|
8139
8159
|
} else if (z) {
|
|
8140
8160
|
let v = 0;
|
|
8141
8161
|
for (let U = 1 << 14 - z; U > 0; U--) {
|
|
8142
|
-
const
|
|
8143
|
-
if (
|
|
8162
|
+
const F = R[(L << 14 - z) + v];
|
|
8163
|
+
if (F.len || F.p)
|
|
8144
8164
|
throw new Error("THREE.EXRLoader: Invalid table entry");
|
|
8145
|
-
|
|
8165
|
+
F.len = z, F.lit = m, v++;
|
|
8146
8166
|
}
|
|
8147
8167
|
}
|
|
8148
8168
|
}
|
|
@@ -8153,16 +8173,16 @@ class du extends Co {
|
|
|
8153
8173
|
l = l << 8 | Er(g, R), m += 8, Ve.c = l, Ve.lc = m;
|
|
8154
8174
|
}
|
|
8155
8175
|
const ge = { c: 0, lc: 0 };
|
|
8156
|
-
function St(l, m, g, R, L, z, v, U,
|
|
8176
|
+
function St(l, m, g, R, L, z, v, U, F) {
|
|
8157
8177
|
if (l == m) {
|
|
8158
8178
|
R < 8 && (Ae(g, R, L, z), g = Ve.c, R = Ve.lc), R -= 8;
|
|
8159
8179
|
let B = g >> R;
|
|
8160
|
-
if (B = new Uint8Array([B])[0], U.value + B >
|
|
8180
|
+
if (B = new Uint8Array([B])[0], U.value + B > F)
|
|
8161
8181
|
return !1;
|
|
8162
8182
|
const j = v[U.value - 1];
|
|
8163
8183
|
for (; B-- > 0; )
|
|
8164
8184
|
v[U.value++] = j;
|
|
8165
|
-
} else if (U.value <
|
|
8185
|
+
} else if (U.value < F)
|
|
8166
8186
|
v[U.value++] = l;
|
|
8167
8187
|
else
|
|
8168
8188
|
return !1;
|
|
@@ -8185,9 +8205,9 @@ class du extends Co {
|
|
|
8185
8205
|
me.a = z, me.b = L;
|
|
8186
8206
|
}
|
|
8187
8207
|
function An(l, m, g, R, L, z, v) {
|
|
8188
|
-
const U = v < 16384,
|
|
8208
|
+
const U = v < 16384, F = g > L ? L : g;
|
|
8189
8209
|
let B = 1, j, W;
|
|
8190
|
-
for (; B <=
|
|
8210
|
+
for (; B <= F; ) B <<= 1;
|
|
8191
8211
|
for (B >>= 1, j = B, B >>= 1; B >= 1; ) {
|
|
8192
8212
|
W = 0;
|
|
8193
8213
|
const V = W + z * (L - j), X = z * B, ee = z * j, K = R * B, Q = R * j;
|
|
@@ -8216,14 +8236,14 @@ class du extends Co {
|
|
|
8216
8236
|
}
|
|
8217
8237
|
return W;
|
|
8218
8238
|
}
|
|
8219
|
-
function rn(l, m, g, R, L, z, v, U,
|
|
8239
|
+
function rn(l, m, g, R, L, z, v, U, F) {
|
|
8220
8240
|
let B = 0, j = 0;
|
|
8221
8241
|
const W = v, V = Math.trunc(R.value + (L + 7) / 8);
|
|
8222
8242
|
for (; R.value < V; )
|
|
8223
8243
|
for (Ae(B, j, g, R), B = Ve.c, j = Ve.lc; j >= 14; ) {
|
|
8224
8244
|
const ee = B >> j - 14 & 16383, K = m[ee];
|
|
8225
8245
|
if (K.len)
|
|
8226
|
-
j -= K.len, St(K.lit, z, B, j, g, R, U,
|
|
8246
|
+
j -= K.len, St(K.lit, z, B, j, g, R, U, F, W), B = ge.c, j = ge.lc;
|
|
8227
8247
|
else {
|
|
8228
8248
|
if (!K.p)
|
|
8229
8249
|
throw new Error("THREE.EXRLoader: hufDecode issues");
|
|
@@ -8233,7 +8253,7 @@ class du extends Co {
|
|
|
8233
8253
|
for (; j < re && R.value < V; )
|
|
8234
8254
|
Ae(B, j, g, R), B = Ve.c, j = Ve.lc;
|
|
8235
8255
|
if (j >= re && Re(l[K.p[Q]]) == (B >> j - re & (1 << re) - 1)) {
|
|
8236
|
-
j -= re, St(K.p[Q], z, B, j, g, R, U,
|
|
8256
|
+
j -= re, St(K.p[Q], z, B, j, g, R, U, F, W), B = ge.c, j = ge.lc;
|
|
8237
8257
|
break;
|
|
8238
8258
|
}
|
|
8239
8259
|
}
|
|
@@ -8245,24 +8265,24 @@ class du extends Co {
|
|
|
8245
8265
|
for (B >>= X, j -= X; j > 0; ) {
|
|
8246
8266
|
const ee = m[B << 14 - j & 16383];
|
|
8247
8267
|
if (ee.len)
|
|
8248
|
-
j -= ee.len, St(ee.lit, z, B, j, g, R, U,
|
|
8268
|
+
j -= ee.len, St(ee.lit, z, B, j, g, R, U, F, W), B = ge.c, j = ge.lc;
|
|
8249
8269
|
else
|
|
8250
8270
|
throw new Error("THREE.EXRLoader: hufDecode issues");
|
|
8251
8271
|
}
|
|
8252
8272
|
return !0;
|
|
8253
8273
|
}
|
|
8254
8274
|
function It(l, m, g, R, L, z) {
|
|
8255
|
-
const v = { value: 0 }, U = g.value,
|
|
8275
|
+
const v = { value: 0 }, U = g.value, F = st(m, g), B = st(m, g);
|
|
8256
8276
|
g.value += 4;
|
|
8257
8277
|
const j = st(m, g);
|
|
8258
|
-
if (g.value += 4,
|
|
8278
|
+
if (g.value += 4, F < 0 || F >= 65537 || B < 0 || B >= 65537)
|
|
8259
8279
|
throw new Error("THREE.EXRLoader: Something wrong with HUF_ENCSIZE");
|
|
8260
8280
|
const W = new Array(65537), V = new Array(16384);
|
|
8261
8281
|
D(V);
|
|
8262
8282
|
const X = R - (g.value - U);
|
|
8263
|
-
if (Ne(l, g, X,
|
|
8283
|
+
if (Ne(l, g, X, F, B, W), j > 8 * (R - (g.value - U)))
|
|
8264
8284
|
throw new Error("THREE.EXRLoader: Something wrong with hufUncompress");
|
|
8265
|
-
Ue(W,
|
|
8285
|
+
Ue(W, F, B, V), rn(W, V, l, g, j, B, z, L, v);
|
|
8266
8286
|
}
|
|
8267
8287
|
function ns(l, m, g) {
|
|
8268
8288
|
for (let R = 0; R < g; ++R)
|
|
@@ -8296,7 +8316,7 @@ class du extends Co {
|
|
|
8296
8316
|
const v = z;
|
|
8297
8317
|
m -= 2;
|
|
8298
8318
|
const U = L.getUint8(R++);
|
|
8299
|
-
for (let
|
|
8319
|
+
for (let F = 0; F < v + 1; F++)
|
|
8300
8320
|
g.push(U);
|
|
8301
8321
|
}
|
|
8302
8322
|
}
|
|
@@ -8304,7 +8324,7 @@ class du extends Co {
|
|
|
8304
8324
|
}
|
|
8305
8325
|
function fa(l, m, g, R, L, z) {
|
|
8306
8326
|
let v = new DataView(z.buffer);
|
|
8307
|
-
const U = g[l.idx[0]].width,
|
|
8327
|
+
const U = g[l.idx[0]].width, F = g[l.idx[0]].height, B = 3, j = Math.floor(U / 8), W = Math.ceil(U / 8), V = Math.ceil(F / 8), X = U - (W - 1) * 8, ee = F - (V - 1) * 8, K = { value: 0 }, Q = new Array(B), re = new Array(B), le = new Array(B), oe = new Array(B), ue = new Array(B);
|
|
8308
8328
|
for (let te = 0; te < B; ++te)
|
|
8309
8329
|
ue[te] = m[l.idx[te]], Q[te] = te < 1 ? 0 : Q[te - 1] + W * V, re[te] = new Float32Array(64), le[te] = new Uint16Array(64), oe[te] = new Uint16Array(W * 64);
|
|
8310
8330
|
for (let te = 0; te < V; ++te) {
|
|
@@ -8343,7 +8363,7 @@ class du extends Co {
|
|
|
8343
8363
|
g[l.idx[te]].decoded = !0;
|
|
8344
8364
|
const se = g[l.idx[te]].type;
|
|
8345
8365
|
if (g[te].type == 2)
|
|
8346
|
-
for (let ye = 0; ye <
|
|
8366
|
+
for (let ye = 0; ye < F; ++ye) {
|
|
8347
8367
|
const fe = ue[te][ye];
|
|
8348
8368
|
for (let ae = 0; ae < U; ++ae)
|
|
8349
8369
|
ne[ae] = v.getUint16(fe + ae * 2 * se, !0);
|
|
@@ -8353,7 +8373,7 @@ class du extends Co {
|
|
|
8353
8373
|
}
|
|
8354
8374
|
}
|
|
8355
8375
|
function pa(l, m, g, R, L, z) {
|
|
8356
|
-
const v = new DataView(z.buffer), U = g[l],
|
|
8376
|
+
const v = new DataView(z.buffer), U = g[l], F = U.width, B = U.height, j = Math.ceil(F / 8), W = Math.ceil(B / 8), V = Math.floor(F / 8), X = F - (j - 1) * 8, ee = B - (W - 1) * 8, K = { value: 0 };
|
|
8357
8377
|
let Q = 0;
|
|
8358
8378
|
const re = new Float32Array(64), le = new Uint16Array(64), oe = new Uint16Array(j * 64);
|
|
8359
8379
|
for (let ue = 0; ue < W; ++ue) {
|
|
@@ -8387,13 +8407,13 @@ class du extends Co {
|
|
|
8387
8407
|
m[0] = J(l[0]), m[1] = J(l[1]), m[2] = J(l[5]), m[3] = J(l[6]), m[4] = J(l[14]), m[5] = J(l[15]), m[6] = J(l[27]), m[7] = J(l[28]), m[8] = J(l[2]), m[9] = J(l[4]), m[10] = J(l[7]), m[11] = J(l[13]), m[12] = J(l[16]), m[13] = J(l[26]), m[14] = J(l[29]), m[15] = J(l[42]), m[16] = J(l[3]), m[17] = J(l[8]), m[18] = J(l[12]), m[19] = J(l[17]), m[20] = J(l[25]), m[21] = J(l[30]), m[22] = J(l[41]), m[23] = J(l[43]), m[24] = J(l[9]), m[25] = J(l[11]), m[26] = J(l[18]), m[27] = J(l[24]), m[28] = J(l[31]), m[29] = J(l[40]), m[30] = J(l[44]), m[31] = J(l[53]), m[32] = J(l[10]), m[33] = J(l[19]), m[34] = J(l[23]), m[35] = J(l[32]), m[36] = J(l[39]), m[37] = J(l[45]), m[38] = J(l[52]), m[39] = J(l[54]), m[40] = J(l[20]), m[41] = J(l[22]), m[42] = J(l[33]), m[43] = J(l[38]), m[44] = J(l[46]), m[45] = J(l[51]), m[46] = J(l[55]), m[47] = J(l[60]), m[48] = J(l[21]), m[49] = J(l[34]), m[50] = J(l[37]), m[51] = J(l[47]), m[52] = J(l[50]), m[53] = J(l[56]), m[54] = J(l[59]), m[55] = J(l[61]), m[56] = J(l[35]), m[57] = J(l[36]), m[58] = J(l[48]), m[59] = J(l[49]), m[60] = J(l[57]), m[61] = J(l[58]), m[62] = J(l[62]), m[63] = J(l[63]);
|
|
8388
8408
|
}
|
|
8389
8409
|
function gr(l) {
|
|
8390
|
-
const m = 0.5 * Math.cos(0.7853975), g = 0.5 * Math.cos(3.14159 / 16), R = 0.5 * Math.cos(3.14159 / 8), L = 0.5 * Math.cos(3 * 3.14159 / 16), z = 0.5 * Math.cos(5 * 3.14159 / 16), v = 0.5 * Math.cos(3 * 3.14159 / 8), U = 0.5 * Math.cos(7 * 3.14159 / 16),
|
|
8410
|
+
const m = 0.5 * Math.cos(0.7853975), g = 0.5 * Math.cos(3.14159 / 16), R = 0.5 * Math.cos(3.14159 / 8), L = 0.5 * Math.cos(3 * 3.14159 / 16), z = 0.5 * Math.cos(5 * 3.14159 / 16), v = 0.5 * Math.cos(3 * 3.14159 / 8), U = 0.5 * Math.cos(7 * 3.14159 / 16), F = new Array(4), B = new Array(4), j = new Array(4), W = new Array(4);
|
|
8391
8411
|
for (let V = 0; V < 8; ++V) {
|
|
8392
8412
|
const X = V * 8;
|
|
8393
|
-
|
|
8413
|
+
F[0] = R * l[X + 2], F[1] = v * l[X + 2], F[2] = R * l[X + 6], F[3] = v * l[X + 6], B[0] = g * l[X + 1] + L * l[X + 3] + z * l[X + 5] + U * l[X + 7], B[1] = L * l[X + 1] - U * l[X + 3] - g * l[X + 5] - z * l[X + 7], B[2] = z * l[X + 1] - g * l[X + 3] + U * l[X + 5] + L * l[X + 7], B[3] = U * l[X + 1] - z * l[X + 3] + L * l[X + 5] - g * l[X + 7], j[0] = m * (l[X + 0] + l[X + 4]), j[3] = m * (l[X + 0] - l[X + 4]), j[1] = F[0] + F[3], j[2] = F[1] - F[2], W[0] = j[0] + j[1], W[1] = j[3] + j[2], W[2] = j[3] - j[2], W[3] = j[0] - j[1], l[X + 0] = W[0] + B[0], l[X + 1] = W[1] + B[1], l[X + 2] = W[2] + B[2], l[X + 3] = W[3] + B[3], l[X + 4] = W[3] - B[3], l[X + 5] = W[2] - B[2], l[X + 6] = W[1] - B[1], l[X + 7] = W[0] - B[0];
|
|
8394
8414
|
}
|
|
8395
8415
|
for (let V = 0; V < 8; ++V)
|
|
8396
|
-
|
|
8416
|
+
F[0] = R * l[16 + V], F[1] = v * l[16 + V], F[2] = R * l[48 + V], F[3] = v * l[48 + V], B[0] = g * l[8 + V] + L * l[24 + V] + z * l[40 + V] + U * l[56 + V], B[1] = L * l[8 + V] - U * l[24 + V] - g * l[40 + V] - z * l[56 + V], B[2] = z * l[8 + V] - g * l[24 + V] + U * l[40 + V] + L * l[56 + V], B[3] = U * l[8 + V] - z * l[24 + V] + L * l[40 + V] - g * l[56 + V], j[0] = m * (l[V] + l[32 + V]), j[3] = m * (l[V] - l[32 + V]), j[1] = F[0] + F[3], j[2] = F[1] - F[2], W[0] = j[0] + j[1], W[1] = j[3] + j[2], W[2] = j[3] - j[2], W[3] = j[0] - j[1], l[0 + V] = W[0] + B[0], l[8 + V] = W[1] + B[1], l[16 + V] = W[2] + B[2], l[24 + V] = W[3] + B[3], l[32 + V] = W[3] - B[3], l[40 + V] = W[2] - B[2], l[48 + V] = W[1] - B[1], l[56 + V] = W[0] - B[0];
|
|
8397
8417
|
}
|
|
8398
8418
|
function ma(l) {
|
|
8399
8419
|
for (let m = 0; m < 64; ++m) {
|
|
@@ -8425,11 +8445,11 @@ class du extends Co {
|
|
|
8425
8445
|
const v = new Array(l.inputChannels.length);
|
|
8426
8446
|
for (let ee = 0, K = l.inputChannels.length; ee < K; ee++)
|
|
8427
8447
|
v[ee] = {}, v[ee].start = z, v[ee].end = v[ee].start, v[ee].nx = l.columns, v[ee].ny = l.lines, v[ee].size = l.type, z += v[ee].nx * v[ee].ny * v[ee].size;
|
|
8428
|
-
const U = vn(m, g),
|
|
8429
|
-
if (
|
|
8448
|
+
const U = vn(m, g), F = vn(m, g);
|
|
8449
|
+
if (F >= 8192)
|
|
8430
8450
|
throw new Error("THREE.EXRLoader: Something is wrong with PIZ_COMPRESSION BITMAP_SIZE");
|
|
8431
|
-
if (U <=
|
|
8432
|
-
for (let ee = 0; ee <
|
|
8451
|
+
if (U <= F)
|
|
8452
|
+
for (let ee = 0; ee < F - U + 1; ee++)
|
|
8433
8453
|
L[ee + U] = zt(m, g);
|
|
8434
8454
|
const B = new Uint16Array(65536), j = N(L, B), W = st(m, g);
|
|
8435
8455
|
It(l.array, m, g, W, R, z);
|
|
@@ -8459,22 +8479,22 @@ class du extends Co {
|
|
|
8459
8479
|
function Ea(l) {
|
|
8460
8480
|
const m = l.array.slice(l.offset.value, l.offset.value + l.size), g = zn(m), R = l.inputChannels.length * l.lines * l.columns * l.totalBytes, L = new ArrayBuffer(R), z = new DataView(L);
|
|
8461
8481
|
let v = 0, U = 0;
|
|
8462
|
-
const
|
|
8482
|
+
const F = new Array(4);
|
|
8463
8483
|
for (let B = 0; B < l.lines; B++)
|
|
8464
8484
|
for (let j = 0; j < l.inputChannels.length; j++) {
|
|
8465
8485
|
let W = 0;
|
|
8466
8486
|
switch (l.inputChannels[j].pixelType) {
|
|
8467
8487
|
case 1:
|
|
8468
|
-
|
|
8488
|
+
F[0] = v, F[1] = F[0] + l.columns, v = F[1] + l.columns;
|
|
8469
8489
|
for (let X = 0; X < l.columns; ++X) {
|
|
8470
|
-
const ee = g[
|
|
8490
|
+
const ee = g[F[0]++] << 8 | g[F[1]++];
|
|
8471
8491
|
W += ee, z.setUint16(U, W, !0), U += 2;
|
|
8472
8492
|
}
|
|
8473
8493
|
break;
|
|
8474
8494
|
case 2:
|
|
8475
|
-
|
|
8495
|
+
F[0] = v, F[1] = F[0] + l.columns, F[2] = F[1] + l.columns, v = F[2] + l.columns;
|
|
8476
8496
|
for (let X = 0; X < l.columns; ++X) {
|
|
8477
|
-
const ee = g[
|
|
8497
|
+
const ee = g[F[0]++] << 24 | g[F[1]++] << 16 | g[F[2]++] << 8;
|
|
8478
8498
|
W += ee, z.setUint32(U, W, !0), U += 4;
|
|
8479
8499
|
}
|
|
8480
8500
|
break;
|
|
@@ -8485,7 +8505,7 @@ class du extends Co {
|
|
|
8485
8505
|
function Ta(l) {
|
|
8486
8506
|
const m = l.array;
|
|
8487
8507
|
let g = l.offset.value;
|
|
8488
|
-
const R = l.columns, L = l.lines, z = l.inputChannels, v = l.totalBytes, U = Ke.compression === "B44A_COMPRESSION",
|
|
8508
|
+
const R = l.columns, L = l.lines, z = l.inputChannels, v = l.totalBytes, U = Ke.compression === "B44A_COMPRESSION", F = new Uint8Array(L * R * v), B = new Uint16Array(16);
|
|
8489
8509
|
let j = 0;
|
|
8490
8510
|
for (let W = 0; W < z.length; W++) {
|
|
8491
8511
|
const V = z[W], X = V.pixelType * 2, ee = Math.ceil(R / V.xSampling), K = Math.ceil(L / V.ySampling), Q = V.xSampling === 1 && V.ySampling === 1;
|
|
@@ -8494,7 +8514,7 @@ class du extends Co {
|
|
|
8494
8514
|
if (Q) {
|
|
8495
8515
|
const ue = oe * R * v + j * R;
|
|
8496
8516
|
for (let ne = 0; ne < ee * X; ne++)
|
|
8497
|
-
|
|
8517
|
+
F[ue + ne] = m[g++];
|
|
8498
8518
|
} else
|
|
8499
8519
|
g += ee * X;
|
|
8500
8520
|
j += X;
|
|
@@ -8539,7 +8559,7 @@ class du extends Co {
|
|
|
8539
8559
|
const it = ye * V.xSampling + Me;
|
|
8540
8560
|
if (it >= R) continue;
|
|
8541
8561
|
const _e = he * R * v + j * R + it * 2;
|
|
8542
|
-
|
|
8562
|
+
F[_e] = fe & 255, F[_e + 1] = fe >> 8 & 255;
|
|
8543
8563
|
}
|
|
8544
8564
|
}
|
|
8545
8565
|
}
|
|
@@ -8547,7 +8567,7 @@ class du extends Co {
|
|
|
8547
8567
|
}
|
|
8548
8568
|
j += 2;
|
|
8549
8569
|
}
|
|
8550
|
-
return new DataView(
|
|
8570
|
+
return new DataView(F.buffer);
|
|
8551
8571
|
}
|
|
8552
8572
|
function wr(l) {
|
|
8553
8573
|
const m = l.viewer, g = { value: l.offset.value }, R = new Uint8Array(l.columns * l.lines * (l.inputChannels.length * l.type * 2)), L = {
|
|
@@ -8576,16 +8596,16 @@ class du extends Co {
|
|
|
8576
8596
|
compression: re
|
|
8577
8597
|
}), v -= K.length + 3;
|
|
8578
8598
|
}
|
|
8579
|
-
const U = Ke.channels,
|
|
8599
|
+
const U = Ke.channels, F = new Array(l.inputChannels.length);
|
|
8580
8600
|
for (let K = 0; K < l.inputChannels.length; ++K) {
|
|
8581
|
-
const Q =
|
|
8601
|
+
const Q = F[K] = {}, re = U[K];
|
|
8582
8602
|
Q.name = re.name, Q.compression = 0, Q.decoded = !1, Q.type = re.pixelType, Q.pLinear = re.pLinear, Q.width = l.columns, Q.height = l.lines;
|
|
8583
8603
|
}
|
|
8584
8604
|
const B = {
|
|
8585
8605
|
idx: new Array(3)
|
|
8586
8606
|
};
|
|
8587
8607
|
for (let K = 0; K < l.inputChannels.length; ++K) {
|
|
8588
|
-
const Q =
|
|
8608
|
+
const Q = F[K], re = Q.name.lastIndexOf("."), le = re >= 0 ? Q.name.substring(re + 1) : Q.name;
|
|
8589
8609
|
for (let oe = 0; oe < z.length; ++oe) {
|
|
8590
8610
|
const ue = z[oe];
|
|
8591
8611
|
le === ue.name && Q.type === ue.type && (Q.compression = ue.compression, ue.index >= 0 && (B.idx[ue.index] = K), Q.offset = K);
|
|
@@ -8615,15 +8635,15 @@ class du extends Co {
|
|
|
8615
8635
|
V = Qs(Q.buffer), g.value += L.rleCompressedSize;
|
|
8616
8636
|
}
|
|
8617
8637
|
let X = 0;
|
|
8618
|
-
const ee = new Array(
|
|
8638
|
+
const ee = new Array(F.length);
|
|
8619
8639
|
for (let K = 0; K < ee.length; ++K)
|
|
8620
8640
|
ee[K] = new Array();
|
|
8621
8641
|
for (let K = 0; K < l.lines; ++K)
|
|
8622
|
-
for (let Q = 0; Q <
|
|
8623
|
-
ee[Q].push(X), X +=
|
|
8624
|
-
B.idx[0] !== void 0 &&
|
|
8625
|
-
for (let K = 0; K <
|
|
8626
|
-
const Q =
|
|
8642
|
+
for (let Q = 0; Q < F.length; ++Q)
|
|
8643
|
+
ee[Q].push(X), X += F[Q].width * l.type * 2;
|
|
8644
|
+
B.idx[0] !== void 0 && F[B.idx[0]] && fa(B, ee, F, j, W, R);
|
|
8645
|
+
for (let K = 0; K < F.length; ++K) {
|
|
8646
|
+
const Q = F[K];
|
|
8627
8647
|
if (!Q.decoded)
|
|
8628
8648
|
switch (Q.compression) {
|
|
8629
8649
|
case 2:
|
|
@@ -8639,7 +8659,7 @@ class du extends Co {
|
|
|
8639
8659
|
}
|
|
8640
8660
|
break;
|
|
8641
8661
|
case 1:
|
|
8642
|
-
pa(K, ee,
|
|
8662
|
+
pa(K, ee, F, j, W, R);
|
|
8643
8663
|
break;
|
|
8644
8664
|
default:
|
|
8645
8665
|
throw new Error("THREE.EXRLoader: unsupported channel compression");
|
|
@@ -8712,13 +8732,13 @@ class du extends Co {
|
|
|
8712
8732
|
function va(l, m, g, R) {
|
|
8713
8733
|
const L = g.value, z = [];
|
|
8714
8734
|
for (; g.value < L + R - 1; ) {
|
|
8715
|
-
const v = os(m, g), U = et(l, g),
|
|
8735
|
+
const v = os(m, g), U = et(l, g), F = zt(l, g);
|
|
8716
8736
|
g.value += 3;
|
|
8717
8737
|
const B = et(l, g), j = et(l, g);
|
|
8718
8738
|
z.push({
|
|
8719
8739
|
name: v,
|
|
8720
8740
|
pixelType: U,
|
|
8721
|
-
pLinear:
|
|
8741
|
+
pLinear: F,
|
|
8722
8742
|
xSampling: B,
|
|
8723
8743
|
ySampling: j
|
|
8724
8744
|
});
|
|
@@ -8726,8 +8746,8 @@ class du extends Co {
|
|
|
8726
8746
|
return g.value += 1, z;
|
|
8727
8747
|
}
|
|
8728
8748
|
function Ra(l, m) {
|
|
8729
|
-
const g = Ze(l, m), R = Ze(l, m), L = Ze(l, m), z = Ze(l, m), v = Ze(l, m), U = Ze(l, m),
|
|
8730
|
-
return { redX: g, redY: R, greenX: L, greenY: z, blueX: v, blueY: U, whiteX:
|
|
8749
|
+
const g = Ze(l, m), R = Ze(l, m), L = Ze(l, m), z = Ze(l, m), v = Ze(l, m), U = Ze(l, m), F = Ze(l, m), B = Ze(l, m);
|
|
8750
|
+
return { redX: g, redY: R, greenX: L, greenY: z, blueX: v, blueY: U, whiteX: F, whiteY: B };
|
|
8731
8751
|
}
|
|
8732
8752
|
function Ma(l, m) {
|
|
8733
8753
|
const g = [
|
|
@@ -8844,8 +8864,8 @@ class du extends Co {
|
|
|
8844
8864
|
const v = 1 << z;
|
|
8845
8865
|
let U = m / v | 0;
|
|
8846
8866
|
R == "ROUND_UP" && U * v < m && (U += 1);
|
|
8847
|
-
const
|
|
8848
|
-
L[z] = (
|
|
8867
|
+
const F = Math.max(U, 1);
|
|
8868
|
+
L[z] = (F + g - 1) / g | 0;
|
|
8849
8869
|
}
|
|
8850
8870
|
return L;
|
|
8851
8871
|
}
|
|
@@ -8856,7 +8876,7 @@ class du extends Co {
|
|
|
8856
8876
|
m.value += 8, l.size = st(l.viewer, m);
|
|
8857
8877
|
const v = L * l.blockWidth, U = z * l.blockHeight;
|
|
8858
8878
|
l.columns = v + l.blockWidth > l.width ? l.width - v : l.blockWidth, l.lines = U + l.blockHeight > l.height ? l.height - U : l.blockHeight;
|
|
8859
|
-
const
|
|
8879
|
+
const F = l.columns * l.totalBytes, j = l.size < l.lines * F ? l.uncompress(l) : rs(l);
|
|
8860
8880
|
m.value += l.size;
|
|
8861
8881
|
for (let W = 0; W < l.lines; W++) {
|
|
8862
8882
|
const V = W * l.columns * l.totalBytes;
|
|
@@ -8880,8 +8900,8 @@ class du extends Co {
|
|
|
8880
8900
|
l.size = st(l.viewer, m), l.lines = L + l.blockHeight > l.height ? l.height - L : l.blockHeight;
|
|
8881
8901
|
const z = l.columns * l.totalBytes, U = l.size < l.lines * z ? l.uncompress(l) : rs(l);
|
|
8882
8902
|
m.value += l.size;
|
|
8883
|
-
for (let
|
|
8884
|
-
const B = L +
|
|
8903
|
+
for (let F = 0; F < l.lines; F++) {
|
|
8904
|
+
const B = L + F, j = F * z, W = (l.height - 1 - B) * l.outLineWidth;
|
|
8885
8905
|
for (let V = 0; V < l.inputChannels.length; V++) {
|
|
8886
8906
|
const X = Ke.channels[V].name, ee = l.channelByteOffsets[X] * l.columns, K = l.decodeChannels[X];
|
|
8887
8907
|
if (K !== void 0) {
|
|
@@ -8902,10 +8922,10 @@ class du extends Co {
|
|
|
8902
8922
|
L.value += 4;
|
|
8903
8923
|
const z = et(l.viewer, L) - Ke.dataWindow.yMin;
|
|
8904
8924
|
l.size = st(l.viewer, L), l.lines = z + l.blockHeight > l.height ? l.height - z : l.blockHeight;
|
|
8905
|
-
const v = l.columns * l.totalBytes, U = l.size < l.lines * v,
|
|
8925
|
+
const v = l.columns * l.totalBytes, U = l.size < l.lines * v, F = l.offset;
|
|
8906
8926
|
l.offset = L;
|
|
8907
8927
|
const B = U ? l.uncompress(l) : rs(l);
|
|
8908
|
-
l.offset =
|
|
8928
|
+
l.offset = F;
|
|
8909
8929
|
for (let j = 0; j < l.lines; j++) {
|
|
8910
8930
|
const W = z + j, V = j * v, X = (l.height - 1 - W) * l.outLineWidth;
|
|
8911
8931
|
for (let ee = 0; ee < l.inputChannels.length; ee++) {
|
|
@@ -8940,7 +8960,7 @@ class du extends Co {
|
|
|
8940
8960
|
}
|
|
8941
8961
|
}
|
|
8942
8962
|
function Ha() {
|
|
8943
|
-
const l = this, m = l.chunkOffsets, g = l.width, R = l.height, L = l.deepChannels, z = Ke.compression, v = l.multiPart, U = l.decodeChannels,
|
|
8963
|
+
const l = this, m = l.chunkOffsets, g = l.width, R = l.height, L = l.deepChannels, z = Ke.compression, v = l.multiPart, U = l.decodeChannels, F = l.outputChannels, B = l.byteArray instanceof Uint16Array;
|
|
8944
8964
|
let j = -1;
|
|
8945
8965
|
for (let W = 0; W < L.length; W++)
|
|
8946
8966
|
if (L[W].name === "A") {
|
|
@@ -8970,7 +8990,7 @@ class du extends Co {
|
|
|
8970
8990
|
for (let se = 0; se < g; se++) {
|
|
8971
8991
|
const ye = se === 0 ? 0 : re[se - 1], ae = re[se] - ye;
|
|
8972
8992
|
if (ae === 0) continue;
|
|
8973
|
-
const he = new Float32Array(
|
|
8993
|
+
const he = new Float32Array(F);
|
|
8974
8994
|
let Me = 0;
|
|
8975
8995
|
for (let _e = 0; _e < ae; _e++) {
|
|
8976
8996
|
const bt = ye + _e, on = 1 - Me;
|
|
@@ -8989,8 +9009,8 @@ class du extends Co {
|
|
|
8989
9009
|
Me += Rn * on;
|
|
8990
9010
|
}
|
|
8991
9011
|
U.A !== void 0 && (he[U.A] = Me);
|
|
8992
|
-
const it = te + se *
|
|
8993
|
-
for (let _e = 0; _e <
|
|
9012
|
+
const it = te + se * F;
|
|
9013
|
+
for (let _e = 0; _e < F; _e++)
|
|
8994
9014
|
l.byteArray[it + _e] = B ? Et.toHalfFloat(he[_e]) : he[_e];
|
|
8995
9015
|
}
|
|
8996
9016
|
}
|
|
@@ -9002,8 +9022,8 @@ class du extends Co {
|
|
|
9002
9022
|
const z = os(m, g);
|
|
9003
9023
|
if (z === "") break;
|
|
9004
9024
|
L = !0;
|
|
9005
|
-
const v = os(m, g), U = st(l, g),
|
|
9006
|
-
|
|
9025
|
+
const v = os(m, g), U = st(l, g), F = Na(l, m, g, v, U);
|
|
9026
|
+
F === void 0 ? console.warn(`THREE.EXRLoader: Skipped unknown header attribute type '${v}'.`) : R[z] = F;
|
|
9007
9027
|
}
|
|
9008
9028
|
return L ? R : null;
|
|
9009
9029
|
}
|
|
@@ -9097,7 +9117,7 @@ class du extends Co {
|
|
|
9097
9117
|
case "A":
|
|
9098
9118
|
U[V.name] = !0, v.type = V.pixelType;
|
|
9099
9119
|
}
|
|
9100
|
-
let
|
|
9120
|
+
let F = !1, B = !1;
|
|
9101
9121
|
if (U.Y && U.RY && U.BY)
|
|
9102
9122
|
v.outputChannels = 4, v.yCbCr = !0;
|
|
9103
9123
|
else if (U.R && U.G && U.B)
|
|
@@ -9108,16 +9128,16 @@ class du extends Co {
|
|
|
9108
9128
|
throw new Error("THREE.EXRLoader: file contains unsupported data channels.");
|
|
9109
9129
|
switch (v.outputChannels) {
|
|
9110
9130
|
case 4:
|
|
9111
|
-
z == Yt ? (
|
|
9131
|
+
z == Yt ? (F = !U.A, v.format = Yt, v.colorSpace = je, v.outputChannels = 4, v.decodeChannels = { R: 0, G: 1, B: 2, A: 3 }) : z == In ? (v.format = In, v.colorSpace = je, v.outputChannels = 2, v.decodeChannels = { R: 0, G: 1 }) : z == fs ? (v.format = fs, v.colorSpace = je, v.outputChannels = 1, v.decodeChannels = { R: 0 }) : B = !0;
|
|
9112
9132
|
break;
|
|
9113
9133
|
case 1:
|
|
9114
|
-
z == Yt ? (
|
|
9134
|
+
z == Yt ? (F = !0, v.format = Yt, v.colorSpace = je, v.outputChannels = 4, v.shouldExpand = !0, v.decodeChannels = { Y: 0 }) : z == In ? (v.format = In, v.colorSpace = je, v.outputChannels = 2, v.shouldExpand = !0, v.decodeChannels = { Y: 0 }) : z == fs ? (v.format = fs, v.colorSpace = je, v.outputChannels = 1, v.decodeChannels = { Y: 0 }) : B = !0;
|
|
9115
9135
|
break;
|
|
9116
9136
|
default:
|
|
9117
9137
|
B = !0;
|
|
9118
9138
|
}
|
|
9119
9139
|
if (B) throw new Error("THREE.EXRLoader: invalid output format for specified file.");
|
|
9120
|
-
if (v.yCbCr && (v.format = Yt, v.outputChannels = 4, v.decodeChannels = { Y: 0, RY: 1, BY: 2 },
|
|
9140
|
+
if (v.yCbCr && (v.format = Yt, v.outputChannels = 4, v.decodeChannels = { Y: 0, RY: 1, BY: 2 }, F = !0), v.type == 1)
|
|
9121
9141
|
switch (L) {
|
|
9122
9142
|
case Vn:
|
|
9123
9143
|
v.getter = Aa;
|
|
@@ -9140,10 +9160,10 @@ class du extends Co {
|
|
|
9140
9160
|
const j = v.width * v.height * v.outputChannels;
|
|
9141
9161
|
switch (L) {
|
|
9142
9162
|
case Vn:
|
|
9143
|
-
v.byteArray = new Float32Array(j),
|
|
9163
|
+
v.byteArray = new Float32Array(j), F && v.byteArray.fill(1, 0, j);
|
|
9144
9164
|
break;
|
|
9145
9165
|
case Vt:
|
|
9146
|
-
v.byteArray = new Uint16Array(j),
|
|
9166
|
+
v.byteArray = new Uint16Array(j), F && v.byteArray.fill(15360, 0, j);
|
|
9147
9167
|
break;
|
|
9148
9168
|
default:
|
|
9149
9169
|
console.error("THREE.EXRLoader: unsupported type: ", L);
|
|
@@ -9210,13 +9230,13 @@ class du extends Co {
|
|
|
9210
9230
|
const l = rt.byteArray, m = rt.width * rt.height;
|
|
9211
9231
|
if (this.type === Vt)
|
|
9212
9232
|
for (let g = 0; g < m; g++) {
|
|
9213
|
-
const R = g * 4, L = J(l[R]), z = J(l[R + 1]), v = J(l[R + 2]), U = (1 + z) * L,
|
|
9214
|
-
l[R] = Et.toHalfFloat(Math.max(0, U)), l[R + 1] = Et.toHalfFloat(Math.max(0, B)), l[R + 2] = Et.toHalfFloat(Math.max(0,
|
|
9233
|
+
const R = g * 4, L = J(l[R]), z = J(l[R + 1]), v = J(l[R + 2]), U = (1 + z) * L, F = (1 + v) * L, B = (L - U * 0.2126 - F * 0.0722) / 0.7152;
|
|
9234
|
+
l[R] = Et.toHalfFloat(Math.max(0, U)), l[R + 1] = Et.toHalfFloat(Math.max(0, B)), l[R + 2] = Et.toHalfFloat(Math.max(0, F));
|
|
9215
9235
|
}
|
|
9216
9236
|
else
|
|
9217
9237
|
for (let g = 0; g < m; g++) {
|
|
9218
|
-
const R = g * 4, L = l[R], z = l[R + 1], v = l[R + 2], U = (1 + z) * L,
|
|
9219
|
-
l[R] = Math.max(0, U), l[R + 1] = Math.max(0, (L - U * 0.2126 -
|
|
9238
|
+
const R = g * 4, L = l[R], z = l[R + 1], v = l[R + 2], U = (1 + z) * L, F = (1 + v) * L;
|
|
9239
|
+
l[R] = Math.max(0, U), l[R + 1] = Math.max(0, (L - U * 0.2126 - F * 0.0722) / 0.7152), l[R + 2] = Math.max(0, F);
|
|
9220
9240
|
}
|
|
9221
9241
|
}
|
|
9222
9242
|
return {
|
|
@@ -9291,11 +9311,11 @@ class fu extends Co {
|
|
|
9291
9311
|
}
|
|
9292
9312
|
}, h = function(M, O, C) {
|
|
9293
9313
|
O = O || 1024;
|
|
9294
|
-
let D = M.pos, H = -1, G = 0,
|
|
9314
|
+
let D = M.pos, H = -1, G = 0, q = "", ie = String.fromCharCode.apply(null, new Uint16Array(M.subarray(D, D + 128)));
|
|
9295
9315
|
for (; 0 > (H = ie.indexOf(`
|
|
9296
9316
|
`)) && G < O && D < M.byteLength; )
|
|
9297
|
-
|
|
9298
|
-
return -1 < H ? (M.pos += G + H + 1,
|
|
9317
|
+
q += ie, G += ie.length, D += 128, ie = String.fromCharCode.apply(null, new Uint16Array(M.subarray(D, D + 128)));
|
|
9318
|
+
return -1 < H ? (M.pos += G + H + 1, q + ie.slice(0, H)) : !1;
|
|
9299
9319
|
}, f = function(M) {
|
|
9300
9320
|
const O = /^#\?(\S+)/, C = /^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/, N = /^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/, D = /^\s*FORMAT=(\S+)\s*$/, H = /^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/, G = {
|
|
9301
9321
|
valid: 0,
|
|
@@ -9316,16 +9336,16 @@ class fu extends Co {
|
|
|
9316
9336
|
height: 0
|
|
9317
9337
|
/* image dimensions, width/height */
|
|
9318
9338
|
};
|
|
9319
|
-
let
|
|
9320
|
-
for ((M.pos >= M.byteLength || !(
|
|
9321
|
-
`;
|
|
9322
|
-
if (G.string +=
|
|
9323
|
-
`,
|
|
9324
|
-
G.comments +=
|
|
9339
|
+
let q, ie;
|
|
9340
|
+
for ((M.pos >= M.byteLength || !(q = h(M))) && o(1, "no header found"), (ie = q.match(O)) || o(3, "bad initial token"), G.valid |= 1, G.programtype = ie[1], G.string += q + `
|
|
9341
|
+
`; q = h(M), q !== !1; ) {
|
|
9342
|
+
if (G.string += q + `
|
|
9343
|
+
`, q.charAt(0) === "#") {
|
|
9344
|
+
G.comments += q + `
|
|
9325
9345
|
`;
|
|
9326
9346
|
continue;
|
|
9327
9347
|
}
|
|
9328
|
-
if ((ie =
|
|
9348
|
+
if ((ie = q.match(C)) && (G.gamma = parseFloat(ie[1])), (ie = q.match(N)) && (G.exposure = parseFloat(ie[1])), (ie = q.match(D)) && (G.valid |= 2, G.format = ie[1]), (ie = q.match(H)) && (G.valid |= 4, G.height = parseInt(ie[1], 10), G.width = parseInt(ie[2], 10)), G.valid & 2 && G.valid & 4) break;
|
|
9329
9349
|
}
|
|
9330
9350
|
return G.valid & 2 || o(3, "missing format specifier"), G.valid & 4 || o(3, "missing image size specifier"), G;
|
|
9331
9351
|
}, p = function(M, O, C) {
|
|
@@ -9340,15 +9360,15 @@ class fu extends Co {
|
|
|
9340
9360
|
const D = new Uint8Array(4 * O * C);
|
|
9341
9361
|
D.length || o(4, "unable to allocate buffer space");
|
|
9342
9362
|
let H = 0, G = 0;
|
|
9343
|
-
const
|
|
9363
|
+
const q = 4 * N, ie = new Uint8Array(4), Ne = new Uint8Array(q);
|
|
9344
9364
|
let dt = C;
|
|
9345
9365
|
for (; dt > 0 && G < M.byteLength; ) {
|
|
9346
9366
|
G + 4 > M.byteLength && o(1), ie[0] = M[G++], ie[1] = M[G++], ie[2] = M[G++], ie[3] = M[G++], (ie[0] != 2 || ie[1] != 2 || (ie[2] << 8 | ie[3]) != N) && o(3, "bad rgbe scanline format");
|
|
9347
9367
|
let Re = 0, Ue;
|
|
9348
|
-
for (; Re <
|
|
9368
|
+
for (; Re < q && G < M.byteLength; ) {
|
|
9349
9369
|
Ue = M[G++];
|
|
9350
9370
|
const Ae = Ue > 128;
|
|
9351
|
-
if (Ae && (Ue -= 128), (Ue === 0 || Re + Ue >
|
|
9371
|
+
if (Ae && (Ue -= 128), (Ue === 0 || Re + Ue > q) && o(3, "bad scanline data"), Ae) {
|
|
9352
9372
|
const ge = M[G++];
|
|
9353
9373
|
for (let St = 0; St < Ue; St++)
|
|
9354
9374
|
Ne[Re++] = ge;
|
|
@@ -9481,14 +9501,14 @@ class gu {
|
|
|
9481
9501
|
o instanceof T.WebGLRenderer && (s = o);
|
|
9482
9502
|
}
|
|
9483
9503
|
}
|
|
9484
|
-
return s ? (this.pmremGenerator = new T.PMREMGenerator(s), this.pmremGenerator.compileEquirectangularShader(),
|
|
9504
|
+
return s ? (this.pmremGenerator = new T.PMREMGenerator(s), this.pmremGenerator.compileEquirectangularShader(), k.ok(void 0)) : k.err(
|
|
9485
9505
|
new Z(
|
|
9486
9506
|
"Could not access Three.js renderer",
|
|
9487
9507
|
Y.INITIALIZATION_FAILED
|
|
9488
9508
|
)
|
|
9489
9509
|
);
|
|
9490
9510
|
} catch (n) {
|
|
9491
|
-
return
|
|
9511
|
+
return k.err(
|
|
9492
9512
|
new Z(
|
|
9493
9513
|
"Failed to initialize environment service",
|
|
9494
9514
|
Y.INITIALIZATION_FAILED,
|
|
@@ -9502,7 +9522,7 @@ class gu {
|
|
|
9502
9522
|
try {
|
|
9503
9523
|
const n = this.loadedTextures.get(e);
|
|
9504
9524
|
if (n)
|
|
9505
|
-
return
|
|
9525
|
+
return k.ok(new wn(n));
|
|
9506
9526
|
const s = (t = e.split(".").pop()) == null ? void 0 : t.toLowerCase();
|
|
9507
9527
|
let r;
|
|
9508
9528
|
switch (s) {
|
|
@@ -9518,7 +9538,7 @@ class gu {
|
|
|
9518
9538
|
r = new T.TextureLoader();
|
|
9519
9539
|
break;
|
|
9520
9540
|
default:
|
|
9521
|
-
return
|
|
9541
|
+
return k.err(
|
|
9522
9542
|
new Z(
|
|
9523
9543
|
`Unsupported environment map format: ${s}`,
|
|
9524
9544
|
Y.UNSUPPORTED_FORMAT,
|
|
@@ -9537,7 +9557,7 @@ class gu {
|
|
|
9537
9557
|
);
|
|
9538
9558
|
});
|
|
9539
9559
|
if (this.disposed)
|
|
9540
|
-
return o.dispose(),
|
|
9560
|
+
return o.dispose(), k.err(
|
|
9541
9561
|
new Z(
|
|
9542
9562
|
"Environment service was disposed during the load",
|
|
9543
9563
|
Y.INVALID_STATE,
|
|
@@ -9549,11 +9569,11 @@ class gu {
|
|
|
9549
9569
|
const a = this.pmremGenerator.fromEquirectangular(o);
|
|
9550
9570
|
this.renderTargets.push(a);
|
|
9551
9571
|
const c = a.texture;
|
|
9552
|
-
return this.loadedTextures.set(e, c), this.loadedTextures.set(e + "_original", o),
|
|
9572
|
+
return this.loadedTextures.set(e, c), this.loadedTextures.set(e + "_original", o), k.ok(new wn(c));
|
|
9553
9573
|
}
|
|
9554
|
-
return this.loadedTextures.set(e, o),
|
|
9574
|
+
return this.loadedTextures.set(e, o), k.ok(new wn(o));
|
|
9555
9575
|
} catch (n) {
|
|
9556
|
-
return
|
|
9576
|
+
return k.err(
|
|
9557
9577
|
new Z(
|
|
9558
9578
|
"Failed to load environment map",
|
|
9559
9579
|
Y.TEXTURE_LOAD_FAILED,
|
|
@@ -9565,14 +9585,14 @@ class gu {
|
|
|
9565
9585
|
applyToScene(e, t, n) {
|
|
9566
9586
|
try {
|
|
9567
9587
|
if (!(e instanceof Lt))
|
|
9568
|
-
return
|
|
9588
|
+
return k.err(
|
|
9569
9589
|
new Z(
|
|
9570
9590
|
"Scene must be ThreeSceneAdapter",
|
|
9571
9591
|
Y.INVALID_PARAMETER
|
|
9572
9592
|
)
|
|
9573
9593
|
);
|
|
9574
9594
|
if (!(t instanceof wn))
|
|
9575
|
-
return
|
|
9595
|
+
return k.err(
|
|
9576
9596
|
new Z(
|
|
9577
9597
|
"Texture must be ThreeTextureAdapter",
|
|
9578
9598
|
Y.INVALID_PARAMETER
|
|
@@ -9595,9 +9615,9 @@ class gu {
|
|
|
9595
9615
|
a ? s.background = a[1] : s.background = r;
|
|
9596
9616
|
} else
|
|
9597
9617
|
s.background = r;
|
|
9598
|
-
return
|
|
9618
|
+
return k.ok(void 0);
|
|
9599
9619
|
} catch (s) {
|
|
9600
|
-
return
|
|
9620
|
+
return k.err(
|
|
9601
9621
|
new Z(
|
|
9602
9622
|
"Failed to apply environment to scene",
|
|
9603
9623
|
Y.SCENE_OPERATION_FAILED,
|
|
@@ -9616,7 +9636,7 @@ class gu {
|
|
|
9616
9636
|
createStudioEnvironment(e = {}) {
|
|
9617
9637
|
try {
|
|
9618
9638
|
if (!this.pmremGenerator)
|
|
9619
|
-
return
|
|
9639
|
+
return k.err(
|
|
9620
9640
|
new Z(
|
|
9621
9641
|
"Environment service not initialized",
|
|
9622
9642
|
Y.INITIALIZATION_FAILED
|
|
@@ -9625,9 +9645,9 @@ class gu {
|
|
|
9625
9645
|
const t = new mu(), n = this.pmremGenerator.fromScene(t);
|
|
9626
9646
|
this.renderTargets.push(n);
|
|
9627
9647
|
const s = n.texture;
|
|
9628
|
-
return t.dispose(),
|
|
9648
|
+
return t.dispose(), k.ok(new wn(s));
|
|
9629
9649
|
} catch (t) {
|
|
9630
|
-
return
|
|
9650
|
+
return k.err(
|
|
9631
9651
|
new Z(
|
|
9632
9652
|
"Failed to create studio environment",
|
|
9633
9653
|
Y.TEXTURE_LOAD_FAILED,
|
|
@@ -9683,14 +9703,14 @@ class wu {
|
|
|
9683
9703
|
alignToFloor(e) {
|
|
9684
9704
|
try {
|
|
9685
9705
|
let t = null;
|
|
9686
|
-
return "getThreeObject" in e && typeof e.getThreeObject == "function" ? t = e.getThreeObject() : e instanceof T.Object3D && (t = e), t ? (new yu(t).alignToFloor(),
|
|
9706
|
+
return "getThreeObject" in e && typeof e.getThreeObject == "function" ? t = e.getThreeObject() : e instanceof T.Object3D && (t = e), t ? (new yu(t).alignToFloor(), k.ok(void 0)) : k.err(
|
|
9687
9707
|
new Z(
|
|
9688
9708
|
"Could not get Three.js object for floor alignment",
|
|
9689
9709
|
Y.INVALID_PARAMETER
|
|
9690
9710
|
)
|
|
9691
9711
|
);
|
|
9692
9712
|
} catch (t) {
|
|
9693
|
-
return
|
|
9713
|
+
return k.err(
|
|
9694
9714
|
new Z(
|
|
9695
9715
|
"Failed to align object to floor",
|
|
9696
9716
|
Y.OPERATION_FAILED,
|
|
@@ -9818,20 +9838,36 @@ class bu {
|
|
|
9818
9838
|
return this.clips.map((e) => e.name);
|
|
9819
9839
|
}
|
|
9820
9840
|
play(e) {
|
|
9821
|
-
if (
|
|
9822
|
-
|
|
9823
|
-
|
|
9824
|
-
|
|
9825
|
-
|
|
9841
|
+
if (e !== void 0) {
|
|
9842
|
+
if (this.clips.length === 0)
|
|
9843
|
+
return k.err(
|
|
9844
|
+
new Z(
|
|
9845
|
+
`Cannot play animation clip '${e}': no animation clips are attached`,
|
|
9846
|
+
Y.INVALID_STATE
|
|
9847
|
+
)
|
|
9848
|
+
);
|
|
9849
|
+
if (!this.clips.some((s) => s.name === e)) {
|
|
9850
|
+
const s = this.clips.map((r) => r.name);
|
|
9851
|
+
return k.err(
|
|
9852
|
+
new Z(
|
|
9853
|
+
`Unknown animation clip '${e}'. Available clips: ${s.join(", ")}`,
|
|
9854
|
+
Y.INVALID_PARAMETER
|
|
9855
|
+
)
|
|
9856
|
+
);
|
|
9857
|
+
}
|
|
9826
9858
|
}
|
|
9859
|
+
if (!this.mixer)
|
|
9860
|
+
return k.ok(void 0);
|
|
9861
|
+
if (!this.playing && this.activeActions.length > 0 && e === void 0)
|
|
9862
|
+
return this.playing = !0, k.ok(void 0);
|
|
9827
9863
|
const t = e ? this.clips.filter((s) => s.name === e) : this.clips;
|
|
9828
9864
|
if (t.length === 0)
|
|
9829
|
-
return;
|
|
9865
|
+
return k.ok(void 0);
|
|
9830
9866
|
const n = this.mixer;
|
|
9831
|
-
n.stopAllAction(), this.activeActions = t.map((s) => {
|
|
9867
|
+
return n.stopAllAction(), this.activeActions = t.map((s) => {
|
|
9832
9868
|
const r = n.clipAction(s);
|
|
9833
9869
|
return r.play(), r;
|
|
9834
|
-
}), this.playing = !0;
|
|
9870
|
+
}), this.playing = !0, k.ok(void 0);
|
|
9835
9871
|
}
|
|
9836
9872
|
pause() {
|
|
9837
9873
|
this.playing = !1;
|
|
@@ -10532,7 +10568,7 @@ const Hu = (i, e, t, n, s, r) => {
|
|
|
10532
10568
|
i.position.lerpVectors(t, n, u), e == null || e.update(), r(), u < 1 && requestAnimationFrame(a);
|
|
10533
10569
|
};
|
|
10534
10570
|
requestAnimationFrame(a);
|
|
10535
|
-
}, uo = { type: "change" }, dr = { type: "start" }, aa = { type: "end" }, Ds = new Yi(), fo = new Qn(), ju = Math.cos(70 * tr.DEG2RAD), Pe = new
|
|
10571
|
+
}, uo = { type: "change" }, dr = { type: "start" }, aa = { type: "end" }, Ds = new Yi(), fo = new Qn(), ju = Math.cos(70 * tr.DEG2RAD), Pe = new $(), nt = 2 * Math.PI, Ee = {
|
|
10536
10572
|
NONE: -1,
|
|
10537
10573
|
ROTATE: 0,
|
|
10538
10574
|
DOLLY: 1,
|
|
@@ -10550,7 +10586,7 @@ class ca extends Io {
|
|
|
10550
10586
|
* @param {?HTMLDOMElement} domElement - The HTML element used for event listeners.
|
|
10551
10587
|
*/
|
|
10552
10588
|
constructor(e, t = null) {
|
|
10553
|
-
super(e, t), this.state = Ee.NONE, this.target = new
|
|
10589
|
+
super(e, t), this.state = Ee.NONE, this.target = new $(), this.cursor = new $(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.keyRotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: Be.ROTATE, MIDDLE: Be.DOLLY, RIGHT: Be.PAN }, this.touches = { ONE: Ye.ROTATE, TWO: Ye.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new $(), this._lastQuaternion = new xn(), this._lastTargetPosition = new $(), this._quat = new xn().setFromUnitVectors(e.up, new $(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new js(), this._sphericalDelta = new js(), this._scale = 1, this._panOffset = new $(), this._rotateStart = new pe(), this._rotateEnd = new pe(), this._rotateDelta = new pe(), this._panStart = new pe(), this._panEnd = new pe(), this._panDelta = new pe(), this._dollyStart = new pe(), this._dollyEnd = new pe(), this._dollyDelta = new pe(), this._dollyDirection = new $(), this._mouse = new pe(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Vu.bind(this), this._onPointerDown = Gu.bind(this), this._onPointerUp = Wu.bind(this), this._onContextMenu = Qu.bind(this), this._onMouseWheel = Xu.bind(this), this._onKeyDown = Yu.bind(this), this._onTouchStart = qu.bind(this), this._onTouchMove = $u.bind(this), this._onMouseDown = Zu.bind(this), this._onMouseMove = Ku.bind(this), this._interceptControlDown = Ju.bind(this), this._interceptControlUp = ed.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
|
|
10554
10590
|
}
|
|
10555
10591
|
connect(e) {
|
|
10556
10592
|
super.connect(e), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointercancel", this._onPointerUp), this.domElement.addEventListener("contextmenu", this._onContextMenu), this.domElement.addEventListener("wheel", this._onMouseWheel, { passive: !1 }), this.domElement.getRootNode().addEventListener("keydown", this._interceptControlDown, { passive: !0, capture: !0 }), this.domElement.style.touchAction = "none";
|
|
@@ -10633,11 +10669,11 @@ class ca extends Io {
|
|
|
10633
10669
|
const c = a - o;
|
|
10634
10670
|
this.object.position.addScaledVector(this._dollyDirection, c), this.object.updateMatrixWorld(), r = !!c;
|
|
10635
10671
|
} else if (this.object.isOrthographicCamera) {
|
|
10636
|
-
const a = new
|
|
10672
|
+
const a = new $(this._mouse.x, this._mouse.y, 0);
|
|
10637
10673
|
a.unproject(this.object);
|
|
10638
10674
|
const c = this.object.zoom;
|
|
10639
10675
|
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), this.object.updateProjectionMatrix(), r = c !== this.object.zoom;
|
|
10640
|
-
const u = new
|
|
10676
|
+
const u = new $(this._mouse.x, this._mouse.y, 0);
|
|
10641
10677
|
u.unproject(this.object), this.object.position.sub(u).add(a), this.object.updateMatrixWorld(), o = Pe.length();
|
|
10642
10678
|
} else
|
|
10643
10679
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
|
|
@@ -11903,31 +11939,33 @@ const Fs = () => new Z("Viewer is not ready yet", Y.COMPONENT_NOT_MOUNTED), da =
|
|
|
11903
11939
|
loadModel: async (G) => {
|
|
11904
11940
|
if (!y)
|
|
11905
11941
|
throw Fs();
|
|
11906
|
-
const
|
|
11942
|
+
const q = typeof G == "string" ? G : new Le(G), ie = await y.loadModel(q);
|
|
11907
11943
|
if (!ie.ok)
|
|
11908
11944
|
throw ie.error;
|
|
11909
11945
|
},
|
|
11910
11946
|
captureStill: async (G) => {
|
|
11911
11947
|
if (!y)
|
|
11912
11948
|
throw Fs();
|
|
11913
|
-
const
|
|
11914
|
-
if (
|
|
11915
|
-
throw
|
|
11916
|
-
return
|
|
11949
|
+
const q = await y.captureStill(G);
|
|
11950
|
+
if (!q.ok)
|
|
11951
|
+
throw q.error;
|
|
11952
|
+
return q.value;
|
|
11917
11953
|
},
|
|
11918
11954
|
captureVideo: async (G) => {
|
|
11919
11955
|
if (!y)
|
|
11920
11956
|
throw Fs();
|
|
11921
|
-
const
|
|
11922
|
-
if (
|
|
11923
|
-
throw
|
|
11924
|
-
return
|
|
11957
|
+
const q = await y.captureVideo(G);
|
|
11958
|
+
if (!q.ok)
|
|
11959
|
+
throw q.error;
|
|
11960
|
+
return q.value;
|
|
11925
11961
|
},
|
|
11926
11962
|
getAnimationNames: () => (y == null ? void 0 : y.getAnimationNames()) ?? [],
|
|
11927
11963
|
playAnimations: (G) => {
|
|
11928
11964
|
if (!y)
|
|
11929
11965
|
throw Fs();
|
|
11930
|
-
y.playAnimations(G);
|
|
11966
|
+
const q = y.playAnimations(G);
|
|
11967
|
+
if (!q.ok)
|
|
11968
|
+
throw q.error;
|
|
11931
11969
|
},
|
|
11932
11970
|
pauseAnimations: () => {
|
|
11933
11971
|
y == null || y.pauseAnimations();
|
|
@@ -12048,7 +12086,7 @@ export {
|
|
|
12048
12086
|
zd as L,
|
|
12049
12087
|
Ws as M,
|
|
12050
12088
|
$e as O,
|
|
12051
|
-
|
|
12089
|
+
k as R,
|
|
12052
12090
|
rr as S,
|
|
12053
12091
|
nr as T,
|
|
12054
12092
|
sa as V,
|