@ridp/threejs 1.4.6 → 1.4.7
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/README.md +148 -43
- package/dist/{PredictiveLoader-wSx-b7OS.cjs → PredictiveLoader-Tnm0gRZR.cjs} +1 -1
- package/dist/{PredictiveLoader-ClWlas7_.js → PredictiveLoader-VyluUQ_9.js} +63 -63
- package/dist/assets/{gltfParserOptimized.worker-yo8WMPFM.js → gltfParserOptimized.worker-BHgPWvd-.js} +1 -1
- package/dist/hooks.cjs +1 -1
- package/dist/hooks.js +2 -2
- package/dist/{ImageLoader-B706H7-_.js → objectQuery-DV6aOB66.js} +418 -409
- package/dist/objectQuery-E6g-_2wI.cjs +24 -0
- package/dist/threejs.cjs +2 -2
- package/dist/threejs.js +29 -27
- package/dist/{useBatchGLTFLoader-B9kI2LGP.js → useBatchGLTFLoader-CaIsPkER.js} +1 -1
- package/dist/{useBatchGLTFLoader-C9v4CYix.cjs → useBatchGLTFLoader-DQt14QwC.cjs} +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +18 -16
- package/package.json +1 -1
- package/dist/ImageLoader-Bx97EjI3.cjs +0 -24
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as A from "three";
|
|
2
|
-
import { Controls as gt, Vector3 as S, MOUSE as B, TOUCH as V, Quaternion as le, Spherical as Ue, Vector2 as k, Ray as yt, Plane as _t, MathUtils as nt, TrianglesDrawMode as Tt, TriangleFanDrawMode as Pe, TriangleStripDrawMode as it, Loader as ot, FileLoader as de, SRGBColorSpace as Y, LinearSRGBColorSpace as U, BufferGeometry as rt, BufferAttribute as oe, Color as q, ColorManagement as De, LoaderUtils as re, MeshPhysicalMaterial as j, SpotLight as wt, PointLight as bt, DirectionalLight as Et, Matrix4 as se, InstancedMesh as xt, InstancedBufferAttribute as At, Object3D as ve, TextureLoader as
|
|
2
|
+
import { Controls as gt, Vector3 as S, MOUSE as B, TOUCH as V, Quaternion as le, Spherical as Ue, Vector2 as k, Ray as yt, Plane as _t, MathUtils as nt, TrianglesDrawMode as Tt, TriangleFanDrawMode as Pe, TriangleStripDrawMode as it, Loader as ot, FileLoader as de, SRGBColorSpace as Y, LinearSRGBColorSpace as U, BufferGeometry as rt, BufferAttribute as oe, Color as q, ColorManagement as De, LoaderUtils as re, MeshPhysicalMaterial as j, SpotLight as wt, PointLight as bt, DirectionalLight as Et, Matrix4 as se, InstancedMesh as xt, InstancedBufferAttribute as At, Object3D as ve, TextureLoader as Rt, ImageBitmapLoader as Mt, InterleavedBuffer as St, InterleavedBufferAttribute as Lt, LinearMipmapLinearFilter as at, NearestMipmapLinearFilter as Pt, LinearMipmapNearestFilter as Dt, NearestMipmapNearestFilter as Ct, LinearFilter as Ce, NearestFilter as ct, RepeatWrapping as Oe, MirroredRepeatWrapping as Ot, ClampToEdgeWrapping as kt, PointsMaterial as It, Material as Te, LineBasicMaterial as Nt, MeshStandardMaterial as lt, DoubleSide as vt, MeshBasicMaterial as ie, PropertyBinding as Ht, SkinnedMesh as Ft, Mesh as Ut, LineSegments as jt, Line as Gt, LineLoop as Bt, Points as zt, Group as we, PerspectiveCamera as Kt, OrthographicCamera as Wt, Skeleton as Xt, AnimationClip as Vt, Bone as Yt, InterpolateDiscrete as qt, InterpolateLinear as ht, Texture as je, VectorKeyframeTrack as Ge, NumberKeyframeTrack as Be, QuaternionKeyframeTrack as ze, FrontSide as $t, Interpolant as Zt, Box3 as Qt, Sphere as Jt, CameraHelper as es, GridHelper as ts, BoxHelper as ss, Raycaster as ns, AxesHelper as is, ArrowHelper as os } from "three";
|
|
3
3
|
import rs from "dexie";
|
|
4
|
-
const Ke = { type: "change" }, He = { type: "start" }, ut = { type: "end" }, ue = new yt(), We = new _t(), as = Math.cos(70 * nt.DEG2RAD), L = new S(), O = 2 * Math.PI,
|
|
4
|
+
const Ke = { type: "change" }, He = { type: "start" }, ut = { type: "end" }, ue = new yt(), We = new _t(), as = Math.cos(70 * nt.DEG2RAD), L = new S(), O = 2 * Math.PI, R = {
|
|
5
5
|
NONE: -1,
|
|
6
6
|
ROTATE: 0,
|
|
7
7
|
DOLLY: 1,
|
|
@@ -19,7 +19,7 @@ class dt extends gt {
|
|
|
19
19
|
* @param {?HTMLDOMElement} domElement - The HTML element used for event listeners.
|
|
20
20
|
*/
|
|
21
21
|
constructor(e, t = null) {
|
|
22
|
-
super(e, t), this.state =
|
|
22
|
+
super(e, t), this.state = R.NONE, this.target = new S(), this.cursor = new S(), 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: B.ROTATE, MIDDLE: B.DOLLY, RIGHT: B.PAN }, this.touches = { ONE: V.ROTATE, TWO: V.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new S(), this._lastQuaternion = new le(), this._lastTargetPosition = new S(), this._quat = new le().setFromUnitVectors(e.up, new S(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new Ue(), this._sphericalDelta = new Ue(), this._scale = 1, this._panOffset = new S(), this._rotateStart = new k(), this._rotateEnd = new k(), this._rotateDelta = new k(), this._panStart = new k(), this._panEnd = new k(), this._panDelta = new k(), this._dollyStart = new k(), this._dollyEnd = new k(), this._dollyDelta = new k(), this._dollyDirection = new S(), this._mouse = new k(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = ls.bind(this), this._onPointerDown = cs.bind(this), this._onPointerUp = hs.bind(this), this._onContextMenu = ys.bind(this), this._onMouseWheel = fs.bind(this), this._onKeyDown = ps.bind(this), this._onTouchStart = ms.bind(this), this._onTouchMove = gs.bind(this), this._onMouseDown = us.bind(this), this._onMouseMove = ds.bind(this), this._interceptControlDown = _s.bind(this), this._interceptControlUp = Ts.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
|
|
23
23
|
}
|
|
24
24
|
connect(e) {
|
|
25
25
|
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";
|
|
@@ -80,11 +80,11 @@ class dt extends gt {
|
|
|
80
80
|
* was called, or the initial state.
|
|
81
81
|
*/
|
|
82
82
|
reset() {
|
|
83
|
-
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(Ke), this.update(), this.state =
|
|
83
|
+
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(Ke), this.update(), this.state = R.NONE;
|
|
84
84
|
}
|
|
85
85
|
update(e = null) {
|
|
86
86
|
const t = this.object.position;
|
|
87
|
-
L.copy(t).sub(this.target), L.applyQuaternion(this._quat), this._spherical.setFromVector3(L), this.autoRotate && this.state ===
|
|
87
|
+
L.copy(t).sub(this.target), L.applyQuaternion(this._quat), this._spherical.setFromVector3(L), this.autoRotate && this.state === R.NONE && this._rotateLeft(this._getAutoRotationAngle(e)), this.enableDamping ? (this._spherical.theta += this._sphericalDelta.theta * this.dampingFactor, this._spherical.phi += this._sphericalDelta.phi * this.dampingFactor) : (this._spherical.theta += this._sphericalDelta.theta, this._spherical.phi += this._sphericalDelta.phi);
|
|
88
88
|
let n = this.minAzimuthAngle, s = this.maxAzimuthAngle;
|
|
89
89
|
isFinite(n) && isFinite(s) && (n < -Math.PI ? n += O : n > Math.PI && (n -= O), s < -Math.PI ? s += O : s > Math.PI && (s -= O), n <= s ? this._spherical.theta = Math.max(n, Math.min(s, this._spherical.theta)) : this._spherical.theta = this._spherical.theta > (n + s) / 2 ? Math.max(n, this._spherical.theta) : Math.min(s, this._spherical.theta)), this._spherical.phi = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, this._spherical.phi)), this._spherical.makeSafe(), this.enableDamping === !0 ? this.target.addScaledVector(this._panOffset, this.dampingFactor) : this.target.add(this._panOffset), this.target.sub(this.cursor), this.target.clampLength(this.minTargetRadius, this.maxTargetRadius), this.target.add(this.cursor);
|
|
90
90
|
let i = !1;
|
|
@@ -316,7 +316,7 @@ function ls(r) {
|
|
|
316
316
|
function hs(r) {
|
|
317
317
|
switch (this._removePointer(r), this._pointers.length) {
|
|
318
318
|
case 0:
|
|
319
|
-
this.domElement.releasePointerCapture(r.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(ut), this.state =
|
|
319
|
+
this.domElement.releasePointerCapture(r.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(ut), this.state = R.NONE;
|
|
320
320
|
break;
|
|
321
321
|
case 1:
|
|
322
322
|
const e = this._pointers[0], t = this._pointerPositions[e];
|
|
@@ -342,49 +342,49 @@ function us(r) {
|
|
|
342
342
|
switch (e) {
|
|
343
343
|
case B.DOLLY:
|
|
344
344
|
if (this.enableZoom === !1) return;
|
|
345
|
-
this._handleMouseDownDolly(r), this.state =
|
|
345
|
+
this._handleMouseDownDolly(r), this.state = R.DOLLY;
|
|
346
346
|
break;
|
|
347
347
|
case B.ROTATE:
|
|
348
348
|
if (r.ctrlKey || r.metaKey || r.shiftKey) {
|
|
349
349
|
if (this.enablePan === !1) return;
|
|
350
|
-
this._handleMouseDownPan(r), this.state =
|
|
350
|
+
this._handleMouseDownPan(r), this.state = R.PAN;
|
|
351
351
|
} else {
|
|
352
352
|
if (this.enableRotate === !1) return;
|
|
353
|
-
this._handleMouseDownRotate(r), this.state =
|
|
353
|
+
this._handleMouseDownRotate(r), this.state = R.ROTATE;
|
|
354
354
|
}
|
|
355
355
|
break;
|
|
356
356
|
case B.PAN:
|
|
357
357
|
if (r.ctrlKey || r.metaKey || r.shiftKey) {
|
|
358
358
|
if (this.enableRotate === !1) return;
|
|
359
|
-
this._handleMouseDownRotate(r), this.state =
|
|
359
|
+
this._handleMouseDownRotate(r), this.state = R.ROTATE;
|
|
360
360
|
} else {
|
|
361
361
|
if (this.enablePan === !1) return;
|
|
362
|
-
this._handleMouseDownPan(r), this.state =
|
|
362
|
+
this._handleMouseDownPan(r), this.state = R.PAN;
|
|
363
363
|
}
|
|
364
364
|
break;
|
|
365
365
|
default:
|
|
366
|
-
this.state =
|
|
366
|
+
this.state = R.NONE;
|
|
367
367
|
}
|
|
368
|
-
this.state !==
|
|
368
|
+
this.state !== R.NONE && this.dispatchEvent(He);
|
|
369
369
|
}
|
|
370
370
|
function ds(r) {
|
|
371
371
|
switch (this.state) {
|
|
372
|
-
case
|
|
372
|
+
case R.ROTATE:
|
|
373
373
|
if (this.enableRotate === !1) return;
|
|
374
374
|
this._handleMouseMoveRotate(r);
|
|
375
375
|
break;
|
|
376
|
-
case
|
|
376
|
+
case R.DOLLY:
|
|
377
377
|
if (this.enableZoom === !1) return;
|
|
378
378
|
this._handleMouseMoveDolly(r);
|
|
379
379
|
break;
|
|
380
|
-
case
|
|
380
|
+
case R.PAN:
|
|
381
381
|
if (this.enablePan === !1) return;
|
|
382
382
|
this._handleMouseMovePan(r);
|
|
383
383
|
break;
|
|
384
384
|
}
|
|
385
385
|
}
|
|
386
386
|
function fs(r) {
|
|
387
|
-
this.enabled === !1 || this.enableZoom === !1 || this.state !==
|
|
387
|
+
this.enabled === !1 || this.enableZoom === !1 || this.state !== R.NONE || (r.preventDefault(), this.dispatchEvent(He), this._handleMouseWheel(this._customWheelEvent(r)), this.dispatchEvent(ut));
|
|
388
388
|
}
|
|
389
389
|
function ps(r) {
|
|
390
390
|
this.enabled !== !1 && this._handleKeyDown(r);
|
|
@@ -395,55 +395,55 @@ function ms(r) {
|
|
|
395
395
|
switch (this.touches.ONE) {
|
|
396
396
|
case V.ROTATE:
|
|
397
397
|
if (this.enableRotate === !1) return;
|
|
398
|
-
this._handleTouchStartRotate(r), this.state =
|
|
398
|
+
this._handleTouchStartRotate(r), this.state = R.TOUCH_ROTATE;
|
|
399
399
|
break;
|
|
400
400
|
case V.PAN:
|
|
401
401
|
if (this.enablePan === !1) return;
|
|
402
|
-
this._handleTouchStartPan(r), this.state =
|
|
402
|
+
this._handleTouchStartPan(r), this.state = R.TOUCH_PAN;
|
|
403
403
|
break;
|
|
404
404
|
default:
|
|
405
|
-
this.state =
|
|
405
|
+
this.state = R.NONE;
|
|
406
406
|
}
|
|
407
407
|
break;
|
|
408
408
|
case 2:
|
|
409
409
|
switch (this.touches.TWO) {
|
|
410
410
|
case V.DOLLY_PAN:
|
|
411
411
|
if (this.enableZoom === !1 && this.enablePan === !1) return;
|
|
412
|
-
this._handleTouchStartDollyPan(r), this.state =
|
|
412
|
+
this._handleTouchStartDollyPan(r), this.state = R.TOUCH_DOLLY_PAN;
|
|
413
413
|
break;
|
|
414
414
|
case V.DOLLY_ROTATE:
|
|
415
415
|
if (this.enableZoom === !1 && this.enableRotate === !1) return;
|
|
416
|
-
this._handleTouchStartDollyRotate(r), this.state =
|
|
416
|
+
this._handleTouchStartDollyRotate(r), this.state = R.TOUCH_DOLLY_ROTATE;
|
|
417
417
|
break;
|
|
418
418
|
default:
|
|
419
|
-
this.state =
|
|
419
|
+
this.state = R.NONE;
|
|
420
420
|
}
|
|
421
421
|
break;
|
|
422
422
|
default:
|
|
423
|
-
this.state =
|
|
423
|
+
this.state = R.NONE;
|
|
424
424
|
}
|
|
425
|
-
this.state !==
|
|
425
|
+
this.state !== R.NONE && this.dispatchEvent(He);
|
|
426
426
|
}
|
|
427
427
|
function gs(r) {
|
|
428
428
|
switch (this._trackPointer(r), this.state) {
|
|
429
|
-
case
|
|
429
|
+
case R.TOUCH_ROTATE:
|
|
430
430
|
if (this.enableRotate === !1) return;
|
|
431
431
|
this._handleTouchMoveRotate(r), this.update();
|
|
432
432
|
break;
|
|
433
|
-
case
|
|
433
|
+
case R.TOUCH_PAN:
|
|
434
434
|
if (this.enablePan === !1) return;
|
|
435
435
|
this._handleTouchMovePan(r), this.update();
|
|
436
436
|
break;
|
|
437
|
-
case
|
|
437
|
+
case R.TOUCH_DOLLY_PAN:
|
|
438
438
|
if (this.enableZoom === !1 && this.enablePan === !1) return;
|
|
439
439
|
this._handleTouchMoveDollyPan(r), this.update();
|
|
440
440
|
break;
|
|
441
|
-
case
|
|
441
|
+
case R.TOUCH_DOLLY_ROTATE:
|
|
442
442
|
if (this.enableZoom === !1 && this.enableRotate === !1) return;
|
|
443
443
|
this._handleTouchMoveDollyRotate(r), this.update();
|
|
444
444
|
break;
|
|
445
445
|
default:
|
|
446
|
-
this.state =
|
|
446
|
+
this.state = R.NONE;
|
|
447
447
|
}
|
|
448
448
|
}
|
|
449
449
|
function ys(r) {
|
|
@@ -798,7 +798,7 @@ class xs extends ot {
|
|
|
798
798
|
}), this.register(function(t) {
|
|
799
799
|
return new vs(t);
|
|
800
800
|
}), this.register(function(t) {
|
|
801
|
-
return new
|
|
801
|
+
return new Rs(t);
|
|
802
802
|
}), this.register(function(t) {
|
|
803
803
|
return new Gs(t);
|
|
804
804
|
}), this.register(function(t) {
|
|
@@ -936,7 +936,7 @@ class xs extends ot {
|
|
|
936
936
|
const h = i.extensionsUsed[u], p = i.extensionsRequired || [];
|
|
937
937
|
switch (h) {
|
|
938
938
|
case b.KHR_MATERIALS_UNLIT:
|
|
939
|
-
o[h] = new
|
|
939
|
+
o[h] = new Ms();
|
|
940
940
|
break;
|
|
941
941
|
case b.KHR_DRACO_MESH_COMPRESSION:
|
|
942
942
|
o[h] = new Ks(i, this.dracoLoader);
|
|
@@ -1009,7 +1009,7 @@ const b = {
|
|
|
1009
1009
|
EXT_MESHOPT_COMPRESSION: "EXT_meshopt_compression",
|
|
1010
1010
|
EXT_MESH_GPU_INSTANCING: "EXT_mesh_gpu_instancing"
|
|
1011
1011
|
};
|
|
1012
|
-
class
|
|
1012
|
+
class Rs {
|
|
1013
1013
|
constructor(e) {
|
|
1014
1014
|
this.parser = e, this.name = b.KHR_LIGHTS_PUNCTUAL, this.cache = { refs: {}, uses: {} };
|
|
1015
1015
|
}
|
|
@@ -1055,7 +1055,7 @@ class Ms {
|
|
|
1055
1055
|
});
|
|
1056
1056
|
}
|
|
1057
1057
|
}
|
|
1058
|
-
class
|
|
1058
|
+
class Ms {
|
|
1059
1059
|
constructor() {
|
|
1060
1060
|
this.name = b.KHR_MATERIALS_UNLIT;
|
|
1061
1061
|
}
|
|
@@ -1461,8 +1461,8 @@ class pt extends Zt {
|
|
|
1461
1461
|
interpolate_(e, t, n, s) {
|
|
1462
1462
|
const i = this.resultBuffer, o = this.sampleValues, c = this.valueSize, a = c * 2, l = c * 3, u = s - t, h = (n - t) / u, p = h * h, m = p * h, _ = e * l, w = _ - l, d = -2 * m + 3 * p, f = m - p, g = 1 - d, T = f - p + h;
|
|
1463
1463
|
for (let y = 0; y !== c; y++) {
|
|
1464
|
-
const E = o[w + y + c], x = o[w + y + a] * u,
|
|
1465
|
-
i[y] = g * E + T * x + d *
|
|
1464
|
+
const E = o[w + y + c], x = o[w + y + a] * u, M = o[_ + y + c], D = o[_ + y] * u;
|
|
1465
|
+
i[y] = g * E + T * x + d * M + f * D;
|
|
1466
1466
|
}
|
|
1467
1467
|
return i;
|
|
1468
1468
|
}
|
|
@@ -1602,12 +1602,12 @@ function Qs(r, e) {
|
|
|
1602
1602
|
function Js(r) {
|
|
1603
1603
|
let e;
|
|
1604
1604
|
const t = r.extensions && r.extensions[b.KHR_DRACO_MESH_COMPRESSION];
|
|
1605
|
-
if (t ? e = "draco:" + t.bufferView + ":" + t.indices + ":" +
|
|
1605
|
+
if (t ? e = "draco:" + t.bufferView + ":" + t.indices + ":" + Re(t.attributes) : e = r.indices + ":" + Re(r.attributes) + ":" + r.mode, r.targets !== void 0)
|
|
1606
1606
|
for (let n = 0, s = r.targets.length; n < s; n++)
|
|
1607
|
-
e += ":" +
|
|
1607
|
+
e += ":" + Re(r.targets[n]);
|
|
1608
1608
|
return e;
|
|
1609
1609
|
}
|
|
1610
|
-
function
|
|
1610
|
+
function Re(r) {
|
|
1611
1611
|
let e = "";
|
|
1612
1612
|
const t = Object.keys(r).sort();
|
|
1613
1613
|
for (let n = 0, s = t.length; n < s; n++)
|
|
@@ -1642,7 +1642,7 @@ class sn {
|
|
|
1642
1642
|
const a = c.match(/Version\/(\d+)/);
|
|
1643
1643
|
s = n && a ? parseInt(a[1], 10) : -1, i = c.indexOf("Firefox") > -1, o = i ? c.match(/Firefox\/([0-9]+)\./)[1] : -1;
|
|
1644
1644
|
}
|
|
1645
|
-
typeof createImageBitmap > "u" || n && s < 17 || i && o < 98 ? this.textureLoader = new
|
|
1645
|
+
typeof createImageBitmap > "u" || n && s < 17 || i && o < 98 ? this.textureLoader = new Rt(this.options.manager) : this.textureLoader = new Mt(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new de(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0);
|
|
1646
1646
|
}
|
|
1647
1647
|
setExtensions(e) {
|
|
1648
1648
|
this.extensions = e;
|
|
@@ -1898,9 +1898,9 @@ class sn {
|
|
|
1898
1898
|
if (s.sparse !== void 0) {
|
|
1899
1899
|
const f = xe.SCALAR, g = te[s.sparse.indices.componentType], T = s.sparse.indices.byteOffset || 0, y = s.sparse.values.byteOffset || 0, E = new g(o[1], T, s.sparse.count * f), x = new l(o[2], y, s.sparse.count * a);
|
|
1900
1900
|
c !== null && (d = new oe(d.array.slice(), d.itemSize, d.normalized)), d.normalized = !1;
|
|
1901
|
-
for (let
|
|
1902
|
-
const C = E[
|
|
1903
|
-
if (d.setX(C, x[
|
|
1901
|
+
for (let M = 0, D = E.length; M < D; M++) {
|
|
1902
|
+
const C = E[M];
|
|
1903
|
+
if (d.setX(C, x[M * a]), a >= 2 && d.setY(C, x[M * a + 1]), a >= 3 && d.setZ(C, x[M * a + 2]), a >= 4 && d.setW(C, x[M * a + 3]), a >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
|
|
1904
1904
|
}
|
|
1905
1905
|
d.normalized = _;
|
|
1906
1906
|
}
|
|
@@ -2213,10 +2213,10 @@ class sn {
|
|
|
2213
2213
|
]).then(function(h) {
|
|
2214
2214
|
const p = h[0], m = h[1], _ = h[2], w = h[3], d = h[4], f = [];
|
|
2215
2215
|
for (let g = 0, T = p.length; g < T; g++) {
|
|
2216
|
-
const y = p[g], E = m[g], x = _[g],
|
|
2216
|
+
const y = p[g], E = m[g], x = _[g], M = w[g], D = d[g];
|
|
2217
2217
|
if (y === void 0) continue;
|
|
2218
2218
|
y.updateMatrix && y.updateMatrix();
|
|
2219
|
-
const C = n._createAnimationTracks(y, E, x,
|
|
2219
|
+
const C = n._createAnimationTracks(y, E, x, M, D);
|
|
2220
2220
|
if (C)
|
|
2221
2221
|
for (let z = 0; z < C.length; z++)
|
|
2222
2222
|
f.push(C[z]);
|
|
@@ -2535,8 +2535,8 @@ class wn {
|
|
|
2535
2535
|
d.onBeforeRender(t, f, g);
|
|
2536
2536
|
let x;
|
|
2537
2537
|
d.isCSS3DSprite ? (F.copy(g.matrixWorldInverse), F.transpose(), d.rotation2D !== 0 && F.multiply(an.makeRotationZ(d.rotation2D)), d.matrixWorld.decompose(Ze, on, Qe), F.setPosition(Ze), F.scale(Qe), F.elements[3] = 0, F.elements[7] = 0, F.elements[11] = 0, F.elements[15] = 1, x = m(F)) : x = m(d.matrixWorld);
|
|
2538
|
-
const
|
|
2539
|
-
if (
|
|
2538
|
+
const M = c.objects.get(d);
|
|
2539
|
+
if (M === void 0 || M.style !== x) {
|
|
2540
2540
|
E.style.transform = x;
|
|
2541
2541
|
const D = { style: x };
|
|
2542
2542
|
c.objects.set(d, D);
|
|
@@ -2613,10 +2613,10 @@ function xn(r) {
|
|
|
2613
2613
|
function An(r, e) {
|
|
2614
2614
|
return new dt(r, e);
|
|
2615
2615
|
}
|
|
2616
|
-
function
|
|
2616
|
+
function Rn(r, e) {
|
|
2617
2617
|
return new ws(r, e);
|
|
2618
2618
|
}
|
|
2619
|
-
function
|
|
2619
|
+
function Mn() {
|
|
2620
2620
|
const r = new ns(), e = new k(0, 0);
|
|
2621
2621
|
return {
|
|
2622
2622
|
raycaster: r,
|
|
@@ -2643,7 +2643,7 @@ function Je(r) {
|
|
|
2643
2643
|
r[e] && r[e].isTexture && r[e].dispose();
|
|
2644
2644
|
r.dispose();
|
|
2645
2645
|
}
|
|
2646
|
-
const
|
|
2646
|
+
const Me = {};
|
|
2647
2647
|
async function Dn(r, e = 50) {
|
|
2648
2648
|
const t = {
|
|
2649
2649
|
type: r.type,
|
|
@@ -2853,13 +2853,13 @@ function me(r) {
|
|
|
2853
2853
|
};
|
|
2854
2854
|
}
|
|
2855
2855
|
function ge(r) {
|
|
2856
|
-
if (
|
|
2856
|
+
if (Me[r.name]) return Me[r.name];
|
|
2857
2857
|
const { type: e, ...t } = r, n = e || "MeshStandardMaterial", s = new A[n]({ ...t });
|
|
2858
2858
|
if (r.map) {
|
|
2859
2859
|
const i = new A.TextureLoader().load(r.map);
|
|
2860
2860
|
s.map = i;
|
|
2861
2861
|
}
|
|
2862
|
-
return s.needsUpdate = !0,
|
|
2862
|
+
return s.needsUpdate = !0, Me[r.name] = s, s;
|
|
2863
2863
|
}
|
|
2864
2864
|
class hn {
|
|
2865
2865
|
constructor() {
|
|
@@ -3366,7 +3366,7 @@ function fn(r) {
|
|
|
3366
3366
|
}
|
|
3367
3367
|
function pn(r) {
|
|
3368
3368
|
return new Worker(
|
|
3369
|
-
"" + new URL("assets/gltfParserOptimized.worker-
|
|
3369
|
+
"" + new URL("assets/gltfParserOptimized.worker-BHgPWvd-.js", import.meta.url).href,
|
|
3370
3370
|
{
|
|
3371
3371
|
name: r == null ? void 0 : r.name
|
|
3372
3372
|
}
|
|
@@ -3409,7 +3409,7 @@ const mn = (r = {}) => {
|
|
|
3409
3409
|
let E = !1;
|
|
3410
3410
|
const {
|
|
3411
3411
|
maxRetries: x = 3,
|
|
3412
|
-
optimizeMaterials:
|
|
3412
|
+
optimizeMaterials: M = !1,
|
|
3413
3413
|
simplifyGeometry: D = !1,
|
|
3414
3414
|
simplifyRatio: C = 0.5,
|
|
3415
3415
|
simplifyOptions: z = {},
|
|
@@ -3444,7 +3444,7 @@ const mn = (r = {}) => {
|
|
|
3444
3444
|
}
|
|
3445
3445
|
s.time("[ 解析模型耗时 ]");
|
|
3446
3446
|
let N = await u(P);
|
|
3447
|
-
if (s.timeEnd("[ 解析模型耗时 ]"), s.time("[ 模型优化耗时 ]"),
|
|
3447
|
+
if (s.timeEnd("[ 解析模型耗时 ]"), s.time("[ 模型优化耗时 ]"), M) {
|
|
3448
3448
|
s.info("🔧 [ 材质优化 ] 开始合并相同材质...");
|
|
3449
3449
|
const { modelOptimizer: v } = await import("./modelOptimizer-D6fRg-DF.js");
|
|
3450
3450
|
N = v.optimizeMaterials(N);
|
|
@@ -3478,10 +3478,10 @@ const mn = (r = {}) => {
|
|
|
3478
3478
|
}).then((y) => {
|
|
3479
3479
|
const E = y.headers.get("content-length"), x = E ? parseInt(E, 10) : 0;
|
|
3480
3480
|
if (f && x > 0) {
|
|
3481
|
-
const
|
|
3481
|
+
const M = y.body.getReader();
|
|
3482
3482
|
let D = 0;
|
|
3483
3483
|
const C = [], z = () => {
|
|
3484
|
-
|
|
3484
|
+
M.read().then(({ done: he, value: P }) => {
|
|
3485
3485
|
if (he) {
|
|
3486
3486
|
const N = new Uint8Array(D);
|
|
3487
3487
|
let $ = 0;
|
|
@@ -3512,10 +3512,10 @@ const mn = (r = {}) => {
|
|
|
3512
3512
|
if (x)
|
|
3513
3513
|
try {
|
|
3514
3514
|
s.time("[ 优化解析 ] 使用 Transferable Objects 解析");
|
|
3515
|
-
const
|
|
3516
|
-
return s.timeEnd("[ 优化解析 ] 使用 Transferable Objects 解析"), mt(
|
|
3517
|
-
} catch (
|
|
3518
|
-
s.warn("[ 优化解析 ] 失败,回退到标准解析",
|
|
3515
|
+
const M = await m(x, d, T);
|
|
3516
|
+
return s.timeEnd("[ 优化解析 ] 使用 Transferable Objects 解析"), mt(M);
|
|
3517
|
+
} catch (M) {
|
|
3518
|
+
s.warn("[ 优化解析 ] 失败,回退到标准解析", M);
|
|
3519
3519
|
}
|
|
3520
3520
|
}
|
|
3521
3521
|
const y = h();
|
|
@@ -3823,8 +3823,8 @@ export {
|
|
|
3823
3823
|
xn as b,
|
|
3824
3824
|
bn as c,
|
|
3825
3825
|
An as d,
|
|
3826
|
-
|
|
3827
|
-
|
|
3826
|
+
Rn as e,
|
|
3827
|
+
Mn as f,
|
|
3828
3828
|
Sn as g,
|
|
3829
3829
|
Ln as h,
|
|
3830
3830
|
Pn as i,
|