@ridp/threejs 0.0.2 → 0.2.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/common-DESmndxO.js +54 -0
- package/dist/common-nMt4tIRA.cjs +15 -0
- package/dist/hooks.cjs +1 -1
- package/dist/hooks.js +1 -1
- package/dist/threejs.cjs +1 -1
- package/dist/threejs.js +12 -11
- package/dist/{useGLTFLoader-CoqckCZO.js → useGLTFLoader-BAoIZjEX.js} +205 -201
- package/dist/{useGLTFLoader-CkQCsokF.cjs → useGLTFLoader-CGOxhEOO.cjs} +6 -6
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +7 -6
- package/package.json +9 -2
- package/dist/common-DGdtPI9P.js +0 -28
- package/dist/common-DbWzzhhR.cjs +0 -1
- package/dist/draco/README.md +0 -32
- package/dist/draco/draco_decoder.js +0 -34
- package/dist/draco/draco_decoder.wasm +0 -0
- package/dist/draco/draco_encoder.js +0 -33
- package/dist/draco/draco_wasm_wrapper.js +0 -117
- package/dist/draco/gltf/draco_decoder.js +0 -33
- package/dist/draco/gltf/draco_decoder.wasm +0 -0
- package/dist/draco/gltf/draco_encoder.js +0 -33
- package/dist/draco/gltf/draco_wasm_wrapper.js +0 -116
- package/dist/hdr/slightly_overcast_sky_dome_1k.hdr +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { TrianglesDrawMode as
|
|
2
|
-
import {
|
|
1
|
+
import { TrianglesDrawMode as ft, TriangleFanDrawMode as Ie, TriangleStripDrawMode as Ze, Loader as $e, FileLoader as ye, SRGBColorSpace as te, LinearSRGBColorSpace as K, BufferGeometry as et, BufferAttribute as ue, Color as V, ColorManagement as Ne, LoaderUtils as de, MeshPhysicalMaterial as X, Vector2 as ke, SpotLight as tt, PointLight as pt, DirectionalLight as mt, Matrix4 as ae, Vector3 as O, Quaternion as nt, InstancedMesh as gt, InstancedBufferAttribute as At, Object3D as st, TextureLoader as Tt, ImageBitmapLoader as yt, InterleavedBuffer as xt, InterleavedBufferAttribute as Rt, LinearMipmapLinearFilter as rt, NearestMipmapLinearFilter as _t, LinearMipmapNearestFilter as Et, NearestMipmapNearestFilter as wt, LinearFilter as pe, NearestFilter as it, RepeatWrapping as Ce, MirroredRepeatWrapping as bt, ClampToEdgeWrapping as St, PointsMaterial as Lt, Material as _e, LineBasicMaterial as Mt, MeshStandardMaterial as ot, DoubleSide as It, MeshBasicMaterial as le, PropertyBinding as Nt, SkinnedMesh as Ct, Mesh as Ot, LineSegments as Pt, Line as Dt, LineLoop as kt, Points as Ft, Group as Te, PerspectiveCamera as at, MathUtils as he, OrthographicCamera as Ht, Skeleton as vt, AnimationClip as Bt, Bone as Gt, InterpolateDiscrete as Ut, InterpolateLinear as ct, Texture as He, VectorKeyframeTrack as ve, NumberKeyframeTrack as Be, QuaternionKeyframeTrack as Ge, FrontSide as jt, Interpolant as zt, Box3 as xe, Sphere as Kt, DataTextureLoader as Vt, HalfFloatType as me, FloatType as Ee, DataUtils as ge, Matrix3 as lt, Ray as Xt, WebGLRenderer as Wt, Scene as qt, EquirectangularReflectionMapping as Yt, Raycaster as Qt, AmbientLight as Jt } from "three";
|
|
2
|
+
import { ref as Ue } from "vue";
|
|
3
|
+
import { i as Zt, g as $t, a as en, d as tn, j as nn } from "./disposeObject-CmFSSgi7.js";
|
|
3
4
|
var fe = function() {
|
|
4
5
|
var h = 0, e = document.createElement("div");
|
|
5
6
|
e.style.cssText = "position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000", e.addEventListener("click", function(l) {
|
|
@@ -47,15 +48,15 @@ fe.Panel = function(h, e, t) {
|
|
|
47
48
|
var p = T.getContext("2d");
|
|
48
49
|
return p.font = "bold " + 9 * s + "px Helvetica,Arial,sans-serif", p.textBaseline = "top", p.fillStyle = t, p.fillRect(0, 0, a, o), p.fillStyle = e, p.fillText(h, c, l), p.fillRect(u, d, f, m), p.fillStyle = t, p.globalAlpha = 0.9, p.fillRect(u, d, f, m), {
|
|
49
50
|
dom: T,
|
|
50
|
-
update: function(A,
|
|
51
|
-
r = Math.min(r, A), n = Math.max(n, A), p.fillStyle = t, p.globalAlpha = 1, p.fillRect(0, 0, a, d), p.fillStyle = e, p.fillText(i(A) + " " + h + " (" + i(r) + "-" + i(n) + ")", c, l), p.drawImage(T, u + s, d, f - s, m, u, d, f - s, m), p.fillRect(u + f - s, d, s, m), p.fillStyle = t, p.globalAlpha = 0.9, p.fillRect(u + f - s, d, s, i((1 - A /
|
|
51
|
+
update: function(A, R) {
|
|
52
|
+
r = Math.min(r, A), n = Math.max(n, A), p.fillStyle = t, p.globalAlpha = 1, p.fillRect(0, 0, a, d), p.fillStyle = e, p.fillText(i(A) + " " + h + " (" + i(r) + "-" + i(n) + ")", c, l), p.drawImage(T, u + s, d, f - s, m, u, d, f - s, m), p.fillRect(u + f - s, d, s, m), p.fillStyle = t, p.globalAlpha = 0.9, p.fillRect(u + f - s, d, s, i((1 - A / R) * m));
|
|
52
53
|
}
|
|
53
54
|
};
|
|
54
55
|
};
|
|
55
|
-
function
|
|
56
|
-
if (e ===
|
|
56
|
+
function je(h, e) {
|
|
57
|
+
if (e === ft)
|
|
57
58
|
return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), h;
|
|
58
|
-
if (e === Ie || e ===
|
|
59
|
+
if (e === Ie || e === Ze) {
|
|
59
60
|
let t = h.getIndex();
|
|
60
61
|
if (t === null) {
|
|
61
62
|
const s = [], a = h.getAttribute("position");
|
|
@@ -80,7 +81,7 @@ function Ue(h, e) {
|
|
|
80
81
|
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:", e), h;
|
|
81
82
|
}
|
|
82
83
|
const we = /* @__PURE__ */ new WeakMap();
|
|
83
|
-
class
|
|
84
|
+
class sn extends $e {
|
|
84
85
|
/**
|
|
85
86
|
* Constructs a new Draco loader.
|
|
86
87
|
*
|
|
@@ -187,7 +188,7 @@ class nn extends Ze {
|
|
|
187
188
|
}), a;
|
|
188
189
|
}
|
|
189
190
|
_createGeometry(e) {
|
|
190
|
-
const t = new
|
|
191
|
+
const t = new et();
|
|
191
192
|
e.index && t.setIndex(new ue(e.index.array, 1));
|
|
192
193
|
for (let r = 0; r < e.attributes.length; r++) {
|
|
193
194
|
const n = e.attributes[r], i = n.name, s = n.array, a = n.itemSize, o = new ue(s, a);
|
|
@@ -216,7 +217,7 @@ class nn extends Ze {
|
|
|
216
217
|
return e ? t.push(this._loadLibrary("draco_decoder.js", "text")) : (t.push(this._loadLibrary("draco_wasm_wrapper.js", "text")), t.push(this._loadLibrary("draco_decoder.wasm", "arraybuffer"))), this.decoderPending = Promise.all(t).then((r) => {
|
|
217
218
|
const n = r[0];
|
|
218
219
|
e || (this.decoderConfig.wasmBinary = r[1]);
|
|
219
|
-
const i =
|
|
220
|
+
const i = rn.toString(), s = [
|
|
220
221
|
"/* draco decoder */",
|
|
221
222
|
n,
|
|
222
223
|
"",
|
|
@@ -264,7 +265,7 @@ class nn extends Ze {
|
|
|
264
265
|
return this.workerPool.length = 0, this.workerSourceURL !== "" && URL.revokeObjectURL(this.workerSourceURL), this;
|
|
265
266
|
}
|
|
266
267
|
}
|
|
267
|
-
function
|
|
268
|
+
function rn() {
|
|
268
269
|
let h, e;
|
|
269
270
|
onmessage = function(s) {
|
|
270
271
|
const a = s.data;
|
|
@@ -307,14 +308,14 @@ function sn() {
|
|
|
307
308
|
const T = { index: null, attributes: [] };
|
|
308
309
|
for (const p in l) {
|
|
309
310
|
const A = self[u[p]];
|
|
310
|
-
let
|
|
311
|
+
let R, N;
|
|
311
312
|
if (c.useUniqueIDs)
|
|
312
|
-
N = l[p],
|
|
313
|
+
N = l[p], R = a.GetAttributeByUniqueId(d, N);
|
|
313
314
|
else {
|
|
314
315
|
if (N = a.GetAttributeId(d, s[l[p]]), N === -1) continue;
|
|
315
|
-
|
|
316
|
+
R = a.GetAttribute(d, N);
|
|
316
317
|
}
|
|
317
|
-
const _ = n(s, a, d, p, A,
|
|
318
|
+
const _ = n(s, a, d, p, A, R);
|
|
318
319
|
p === "color" && (_.vertexColorSpace = c.vertexColorSpace), T.attributes.push(_);
|
|
319
320
|
}
|
|
320
321
|
return m === s.TRIANGULAR_MESH && (T.index = r(s, a, d)), s.destroy(d), T;
|
|
@@ -328,10 +329,10 @@ function sn() {
|
|
|
328
329
|
function n(s, a, o, c, l, u) {
|
|
329
330
|
const d = u.num_components(), m = o.num_points() * d, T = m * l.BYTES_PER_ELEMENT, p = i(s, l), A = s._malloc(T);
|
|
330
331
|
a.GetAttributeDataArrayForAllPoints(o, u, p, T, A);
|
|
331
|
-
const
|
|
332
|
+
const R = new l(s.HEAPF32.buffer, A, m).slice();
|
|
332
333
|
return s._free(A), {
|
|
333
334
|
name: c,
|
|
334
|
-
array:
|
|
335
|
+
array: R,
|
|
335
336
|
itemSize: d
|
|
336
337
|
};
|
|
337
338
|
}
|
|
@@ -354,7 +355,7 @@ function sn() {
|
|
|
354
355
|
}
|
|
355
356
|
}
|
|
356
357
|
}
|
|
357
|
-
class
|
|
358
|
+
class on extends $e {
|
|
358
359
|
/**
|
|
359
360
|
* Constructs a new glTF loader.
|
|
360
361
|
*
|
|
@@ -362,39 +363,39 @@ class rn extends Ze {
|
|
|
362
363
|
*/
|
|
363
364
|
constructor(e) {
|
|
364
365
|
super(e), this.dracoLoader = null, this.ktx2Loader = null, this.meshoptDecoder = null, this.pluginCallbacks = [], this.register(function(t) {
|
|
365
|
-
return new un(t);
|
|
366
|
-
}), this.register(function(t) {
|
|
367
366
|
return new dn(t);
|
|
368
367
|
}), this.register(function(t) {
|
|
369
|
-
return new
|
|
368
|
+
return new hn(t);
|
|
370
369
|
}), this.register(function(t) {
|
|
371
|
-
return new
|
|
370
|
+
return new Rn(t);
|
|
372
371
|
}), this.register(function(t) {
|
|
373
372
|
return new _n(t);
|
|
374
373
|
}), this.register(function(t) {
|
|
375
|
-
return new
|
|
374
|
+
return new En(t);
|
|
376
375
|
}), this.register(function(t) {
|
|
377
376
|
return new pn(t);
|
|
378
377
|
}), this.register(function(t) {
|
|
379
378
|
return new mn(t);
|
|
380
379
|
}), this.register(function(t) {
|
|
381
380
|
return new gn(t);
|
|
382
|
-
}), this.register(function(t) {
|
|
383
|
-
return new ln(t);
|
|
384
381
|
}), this.register(function(t) {
|
|
385
382
|
return new An(t);
|
|
386
383
|
}), this.register(function(t) {
|
|
387
|
-
return new
|
|
388
|
-
}), this.register(function(t) {
|
|
389
|
-
return new yn(t);
|
|
384
|
+
return new un(t);
|
|
390
385
|
}), this.register(function(t) {
|
|
391
386
|
return new Tn(t);
|
|
392
387
|
}), this.register(function(t) {
|
|
393
|
-
return new
|
|
388
|
+
return new fn(t);
|
|
394
389
|
}), this.register(function(t) {
|
|
395
|
-
return new
|
|
390
|
+
return new xn(t);
|
|
391
|
+
}), this.register(function(t) {
|
|
392
|
+
return new yn(t);
|
|
393
|
+
}), this.register(function(t) {
|
|
394
|
+
return new cn(t);
|
|
396
395
|
}), this.register(function(t) {
|
|
397
396
|
return new wn(t);
|
|
397
|
+
}), this.register(function(t) {
|
|
398
|
+
return new bn(t);
|
|
398
399
|
});
|
|
399
400
|
}
|
|
400
401
|
/**
|
|
@@ -494,9 +495,9 @@ class rn extends Ze {
|
|
|
494
495
|
if (typeof e == "string")
|
|
495
496
|
i = JSON.parse(e);
|
|
496
497
|
else if (e instanceof ArrayBuffer)
|
|
497
|
-
if (o.decode(new Uint8Array(e, 0, 4)) ===
|
|
498
|
+
if (o.decode(new Uint8Array(e, 0, 4)) === ut) {
|
|
498
499
|
try {
|
|
499
|
-
s[E.KHR_BINARY_GLTF] = new
|
|
500
|
+
s[E.KHR_BINARY_GLTF] = new Sn(e);
|
|
500
501
|
} catch (u) {
|
|
501
502
|
n && n(u);
|
|
502
503
|
return;
|
|
@@ -510,7 +511,7 @@ class rn extends Ze {
|
|
|
510
511
|
n && n(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));
|
|
511
512
|
return;
|
|
512
513
|
}
|
|
513
|
-
const c = new
|
|
514
|
+
const c = new Bn(i, {
|
|
514
515
|
path: t || this.resourcePath || "",
|
|
515
516
|
crossOrigin: this.crossOrigin,
|
|
516
517
|
requestHeader: this.requestHeader,
|
|
@@ -528,16 +529,16 @@ class rn extends Ze {
|
|
|
528
529
|
const u = i.extensionsUsed[l], d = i.extensionsRequired || [];
|
|
529
530
|
switch (u) {
|
|
530
531
|
case E.KHR_MATERIALS_UNLIT:
|
|
531
|
-
s[u] = new
|
|
532
|
+
s[u] = new ln();
|
|
532
533
|
break;
|
|
533
534
|
case E.KHR_DRACO_MESH_COMPRESSION:
|
|
534
|
-
s[u] = new
|
|
535
|
+
s[u] = new Ln(i, this.dracoLoader);
|
|
535
536
|
break;
|
|
536
537
|
case E.KHR_TEXTURE_TRANSFORM:
|
|
537
|
-
s[u] = new
|
|
538
|
+
s[u] = new Mn();
|
|
538
539
|
break;
|
|
539
540
|
case E.KHR_MESH_QUANTIZATION:
|
|
540
|
-
s[u] = new
|
|
541
|
+
s[u] = new In();
|
|
541
542
|
break;
|
|
542
543
|
default:
|
|
543
544
|
d.indexOf(u) >= 0 && a[u] === void 0 && console.warn('THREE.GLTFLoader: Unknown extension "' + u + '".');
|
|
@@ -560,7 +561,7 @@ class rn extends Ze {
|
|
|
560
561
|
});
|
|
561
562
|
}
|
|
562
563
|
}
|
|
563
|
-
function
|
|
564
|
+
function an() {
|
|
564
565
|
let h = {};
|
|
565
566
|
return {
|
|
566
567
|
get: function(e) {
|
|
@@ -601,7 +602,7 @@ const E = {
|
|
|
601
602
|
EXT_MESHOPT_COMPRESSION: "EXT_meshopt_compression",
|
|
602
603
|
EXT_MESH_GPU_INSTANCING: "EXT_mesh_gpu_instancing"
|
|
603
604
|
};
|
|
604
|
-
class
|
|
605
|
+
class cn {
|
|
605
606
|
constructor(e) {
|
|
606
607
|
this.parser = e, this.name = E.KHR_LIGHTS_PUNCTUAL, this.cache = { refs: {}, uses: {} };
|
|
607
608
|
}
|
|
@@ -623,13 +624,13 @@ class an {
|
|
|
623
624
|
const u = o.range !== void 0 ? o.range : 0;
|
|
624
625
|
switch (o.type) {
|
|
625
626
|
case "directional":
|
|
626
|
-
c = new
|
|
627
|
+
c = new mt(l), c.target.position.set(0, 0, -1), c.add(c.target);
|
|
627
628
|
break;
|
|
628
629
|
case "point":
|
|
629
|
-
c = new
|
|
630
|
+
c = new pt(l), c.distance = u;
|
|
630
631
|
break;
|
|
631
632
|
case "spot":
|
|
632
|
-
c = new
|
|
633
|
+
c = new tt(l), c.distance = u, o.spot = o.spot || {}, o.spot.innerConeAngle = o.spot.innerConeAngle !== void 0 ? o.spot.innerConeAngle : 0, o.spot.outerConeAngle = o.spot.outerConeAngle !== void 0 ? o.spot.outerConeAngle : Math.PI / 4, c.angle = o.spot.outerConeAngle, c.penumbra = 1 - o.spot.innerConeAngle / o.spot.outerConeAngle, c.target.position.set(0, 0, -1), c.add(c.target);
|
|
633
634
|
break;
|
|
634
635
|
default:
|
|
635
636
|
throw new Error("THREE.GLTFLoader: Unexpected light type: " + o.type);
|
|
@@ -647,7 +648,7 @@ class an {
|
|
|
647
648
|
});
|
|
648
649
|
}
|
|
649
650
|
}
|
|
650
|
-
class
|
|
651
|
+
class ln {
|
|
651
652
|
constructor() {
|
|
652
653
|
this.name = E.KHR_MATERIALS_UNLIT;
|
|
653
654
|
}
|
|
@@ -668,7 +669,7 @@ class cn {
|
|
|
668
669
|
return Promise.all(n);
|
|
669
670
|
}
|
|
670
671
|
}
|
|
671
|
-
class
|
|
672
|
+
class un {
|
|
672
673
|
constructor(e) {
|
|
673
674
|
this.parser = e, this.name = E.KHR_MATERIALS_EMISSIVE_STRENGTH;
|
|
674
675
|
}
|
|
@@ -680,7 +681,7 @@ class ln {
|
|
|
680
681
|
return i !== void 0 && (t.emissiveIntensity = i), Promise.resolve();
|
|
681
682
|
}
|
|
682
683
|
}
|
|
683
|
-
class
|
|
684
|
+
class dn {
|
|
684
685
|
constructor(e) {
|
|
685
686
|
this.parser = e, this.name = E.KHR_MATERIALS_CLEARCOAT;
|
|
686
687
|
}
|
|
@@ -695,12 +696,12 @@ class un {
|
|
|
695
696
|
const i = [], s = n.extensions[this.name];
|
|
696
697
|
if (s.clearcoatFactor !== void 0 && (t.clearcoat = s.clearcoatFactor), s.clearcoatTexture !== void 0 && i.push(r.assignTexture(t, "clearcoatMap", s.clearcoatTexture)), s.clearcoatRoughnessFactor !== void 0 && (t.clearcoatRoughness = s.clearcoatRoughnessFactor), s.clearcoatRoughnessTexture !== void 0 && i.push(r.assignTexture(t, "clearcoatRoughnessMap", s.clearcoatRoughnessTexture)), s.clearcoatNormalTexture !== void 0 && (i.push(r.assignTexture(t, "clearcoatNormalMap", s.clearcoatNormalTexture)), s.clearcoatNormalTexture.scale !== void 0)) {
|
|
697
698
|
const a = s.clearcoatNormalTexture.scale;
|
|
698
|
-
t.clearcoatNormalScale = new
|
|
699
|
+
t.clearcoatNormalScale = new ke(a, a);
|
|
699
700
|
}
|
|
700
701
|
return Promise.all(i);
|
|
701
702
|
}
|
|
702
703
|
}
|
|
703
|
-
class
|
|
704
|
+
class hn {
|
|
704
705
|
constructor(e) {
|
|
705
706
|
this.parser = e, this.name = E.KHR_MATERIALS_DISPERSION;
|
|
706
707
|
}
|
|
@@ -716,7 +717,7 @@ class dn {
|
|
|
716
717
|
return t.dispersion = i.dispersion !== void 0 ? i.dispersion : 0, Promise.resolve();
|
|
717
718
|
}
|
|
718
719
|
}
|
|
719
|
-
class
|
|
720
|
+
class fn {
|
|
720
721
|
constructor(e) {
|
|
721
722
|
this.parser = e, this.name = E.KHR_MATERIALS_IRIDESCENCE;
|
|
722
723
|
}
|
|
@@ -732,7 +733,7 @@ class hn {
|
|
|
732
733
|
return s.iridescenceFactor !== void 0 && (t.iridescence = s.iridescenceFactor), s.iridescenceTexture !== void 0 && i.push(r.assignTexture(t, "iridescenceMap", s.iridescenceTexture)), s.iridescenceIor !== void 0 && (t.iridescenceIOR = s.iridescenceIor), t.iridescenceThicknessRange === void 0 && (t.iridescenceThicknessRange = [100, 400]), s.iridescenceThicknessMinimum !== void 0 && (t.iridescenceThicknessRange[0] = s.iridescenceThicknessMinimum), s.iridescenceThicknessMaximum !== void 0 && (t.iridescenceThicknessRange[1] = s.iridescenceThicknessMaximum), s.iridescenceThicknessTexture !== void 0 && i.push(r.assignTexture(t, "iridescenceThicknessMap", s.iridescenceThicknessTexture)), Promise.all(i);
|
|
733
734
|
}
|
|
734
735
|
}
|
|
735
|
-
class
|
|
736
|
+
class pn {
|
|
736
737
|
constructor(e) {
|
|
737
738
|
this.parser = e, this.name = E.KHR_MATERIALS_SHEEN;
|
|
738
739
|
}
|
|
@@ -754,7 +755,7 @@ class fn {
|
|
|
754
755
|
return s.sheenRoughnessFactor !== void 0 && (t.sheenRoughness = s.sheenRoughnessFactor), s.sheenColorTexture !== void 0 && i.push(r.assignTexture(t, "sheenColorMap", s.sheenColorTexture, te)), s.sheenRoughnessTexture !== void 0 && i.push(r.assignTexture(t, "sheenRoughnessMap", s.sheenRoughnessTexture)), Promise.all(i);
|
|
755
756
|
}
|
|
756
757
|
}
|
|
757
|
-
class
|
|
758
|
+
class mn {
|
|
758
759
|
constructor(e) {
|
|
759
760
|
this.parser = e, this.name = E.KHR_MATERIALS_TRANSMISSION;
|
|
760
761
|
}
|
|
@@ -770,7 +771,7 @@ class pn {
|
|
|
770
771
|
return s.transmissionFactor !== void 0 && (t.transmission = s.transmissionFactor), s.transmissionTexture !== void 0 && i.push(r.assignTexture(t, "transmissionMap", s.transmissionTexture)), Promise.all(i);
|
|
771
772
|
}
|
|
772
773
|
}
|
|
773
|
-
class
|
|
774
|
+
class gn {
|
|
774
775
|
constructor(e) {
|
|
775
776
|
this.parser = e, this.name = E.KHR_MATERIALS_VOLUME;
|
|
776
777
|
}
|
|
@@ -788,7 +789,7 @@ class mn {
|
|
|
788
789
|
return t.attenuationColor = new V().setRGB(a[0], a[1], a[2], K), Promise.all(i);
|
|
789
790
|
}
|
|
790
791
|
}
|
|
791
|
-
class
|
|
792
|
+
class An {
|
|
792
793
|
constructor(e) {
|
|
793
794
|
this.parser = e, this.name = E.KHR_MATERIALS_IOR;
|
|
794
795
|
}
|
|
@@ -804,7 +805,7 @@ class gn {
|
|
|
804
805
|
return t.ior = i.ior !== void 0 ? i.ior : 1.5, Promise.resolve();
|
|
805
806
|
}
|
|
806
807
|
}
|
|
807
|
-
class
|
|
808
|
+
class Tn {
|
|
808
809
|
constructor(e) {
|
|
809
810
|
this.parser = e, this.name = E.KHR_MATERIALS_SPECULAR;
|
|
810
811
|
}
|
|
@@ -822,7 +823,7 @@ class An {
|
|
|
822
823
|
return t.specularColor = new V().setRGB(a[0], a[1], a[2], K), s.specularColorTexture !== void 0 && i.push(r.assignTexture(t, "specularColorMap", s.specularColorTexture, te)), Promise.all(i);
|
|
823
824
|
}
|
|
824
825
|
}
|
|
825
|
-
class
|
|
826
|
+
class yn {
|
|
826
827
|
constructor(e) {
|
|
827
828
|
this.parser = e, this.name = E.EXT_MATERIALS_BUMP;
|
|
828
829
|
}
|
|
@@ -838,7 +839,7 @@ class Tn {
|
|
|
838
839
|
return t.bumpScale = s.bumpFactor !== void 0 ? s.bumpFactor : 1, s.bumpTexture !== void 0 && i.push(r.assignTexture(t, "bumpMap", s.bumpTexture)), Promise.all(i);
|
|
839
840
|
}
|
|
840
841
|
}
|
|
841
|
-
class
|
|
842
|
+
class xn {
|
|
842
843
|
constructor(e) {
|
|
843
844
|
this.parser = e, this.name = E.KHR_MATERIALS_ANISOTROPY;
|
|
844
845
|
}
|
|
@@ -871,7 +872,7 @@ class Rn {
|
|
|
871
872
|
return t.loadTextureImage(e, i.source, s);
|
|
872
873
|
}
|
|
873
874
|
}
|
|
874
|
-
class
|
|
875
|
+
class _n {
|
|
875
876
|
constructor(e) {
|
|
876
877
|
this.parser = e, this.name = E.EXT_TEXTURE_WEBP, this.isSupported = null;
|
|
877
878
|
}
|
|
@@ -901,7 +902,7 @@ class xn {
|
|
|
901
902
|
})), this.isSupported;
|
|
902
903
|
}
|
|
903
904
|
}
|
|
904
|
-
class
|
|
905
|
+
class En {
|
|
905
906
|
constructor(e) {
|
|
906
907
|
this.parser = e, this.name = E.EXT_TEXTURE_AVIF, this.isSupported = null;
|
|
907
908
|
}
|
|
@@ -931,7 +932,7 @@ class _n {
|
|
|
931
932
|
})), this.isSupported;
|
|
932
933
|
}
|
|
933
934
|
}
|
|
934
|
-
class
|
|
935
|
+
class wn {
|
|
935
936
|
constructor(e) {
|
|
936
937
|
this.name = E.EXT_MESHOPT_COMPRESSION, this.parser = e;
|
|
937
938
|
}
|
|
@@ -957,7 +958,7 @@ class En {
|
|
|
957
958
|
return null;
|
|
958
959
|
}
|
|
959
960
|
}
|
|
960
|
-
class
|
|
961
|
+
class bn {
|
|
961
962
|
constructor(e) {
|
|
962
963
|
this.name = E.EXT_MESH_GPU_INSTANCING, this.parser = e;
|
|
963
964
|
}
|
|
@@ -975,22 +976,22 @@ class wn {
|
|
|
975
976
|
return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(e)), Promise.all(a).then((c) => {
|
|
976
977
|
const l = c.pop(), u = l.isGroup ? l.children : [l], d = c[0].count, f = [];
|
|
977
978
|
for (const m of u) {
|
|
978
|
-
const T = new ae(), p = new O(), A = new
|
|
979
|
+
const T = new ae(), p = new O(), A = new nt(), R = new O(1, 1, 1), N = new gt(m.geometry, m.material, d);
|
|
979
980
|
for (let _ = 0; _ < d; _++)
|
|
980
|
-
o.TRANSLATION && p.fromBufferAttribute(o.TRANSLATION, _), o.ROTATION && A.fromBufferAttribute(o.ROTATION, _), o.SCALE &&
|
|
981
|
+
o.TRANSLATION && p.fromBufferAttribute(o.TRANSLATION, _), o.ROTATION && A.fromBufferAttribute(o.ROTATION, _), o.SCALE && R.fromBufferAttribute(o.SCALE, _), N.setMatrixAt(_, T.compose(p, A, R));
|
|
981
982
|
for (const _ in o)
|
|
982
983
|
if (_ === "_COLOR_0") {
|
|
983
984
|
const B = o[_];
|
|
984
|
-
N.instanceColor = new
|
|
985
|
+
N.instanceColor = new At(B.array, B.itemSize, B.normalized);
|
|
985
986
|
} else _ !== "TRANSLATION" && _ !== "ROTATION" && _ !== "SCALE" && m.geometry.setAttribute(_, o[_]);
|
|
986
|
-
|
|
987
|
+
st.prototype.copy.call(N, m), this.parser.assignFinalMaterial(N), f.push(N);
|
|
987
988
|
}
|
|
988
989
|
return l.isGroup ? (l.clear(), l.add(...f), l) : f[0];
|
|
989
990
|
}));
|
|
990
991
|
}
|
|
991
992
|
}
|
|
992
|
-
const
|
|
993
|
-
class
|
|
993
|
+
const ut = "glTF", ce = 12, ze = { JSON: 1313821514, BIN: 5130562 };
|
|
994
|
+
class Sn {
|
|
994
995
|
constructor(e) {
|
|
995
996
|
this.name = E.KHR_BINARY_GLTF, this.content = null, this.body = null;
|
|
996
997
|
const t = new DataView(e, 0, ce), r = new TextDecoder();
|
|
@@ -998,7 +999,7 @@ class bn {
|
|
|
998
999
|
magic: r.decode(new Uint8Array(e.slice(0, 4))),
|
|
999
1000
|
version: t.getUint32(4, !0),
|
|
1000
1001
|
length: t.getUint32(8, !0)
|
|
1001
|
-
}, this.header.magic !==
|
|
1002
|
+
}, this.header.magic !== ut)
|
|
1002
1003
|
throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");
|
|
1003
1004
|
if (this.header.version < 2)
|
|
1004
1005
|
throw new Error("THREE.GLTFLoader: Legacy binary file detected.");
|
|
@@ -1008,10 +1009,10 @@ class bn {
|
|
|
1008
1009
|
const a = i.getUint32(s, !0);
|
|
1009
1010
|
s += 4;
|
|
1010
1011
|
const o = i.getUint32(s, !0);
|
|
1011
|
-
if (s += 4, o ===
|
|
1012
|
+
if (s += 4, o === ze.JSON) {
|
|
1012
1013
|
const c = new Uint8Array(e, ce + s, a);
|
|
1013
1014
|
this.content = r.decode(c);
|
|
1014
|
-
} else if (o ===
|
|
1015
|
+
} else if (o === ze.BIN) {
|
|
1015
1016
|
const c = ce + s;
|
|
1016
1017
|
this.body = e.slice(c, c + a);
|
|
1017
1018
|
}
|
|
@@ -1021,7 +1022,7 @@ class bn {
|
|
|
1021
1022
|
throw new Error("THREE.GLTFLoader: JSON content not found.");
|
|
1022
1023
|
}
|
|
1023
1024
|
}
|
|
1024
|
-
class
|
|
1025
|
+
class Ln {
|
|
1025
1026
|
constructor(e, t) {
|
|
1026
1027
|
if (!t)
|
|
1027
1028
|
throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");
|
|
@@ -1053,7 +1054,7 @@ class Sn {
|
|
|
1053
1054
|
});
|
|
1054
1055
|
}
|
|
1055
1056
|
}
|
|
1056
|
-
class
|
|
1057
|
+
class Mn {
|
|
1057
1058
|
constructor() {
|
|
1058
1059
|
this.name = E.KHR_TEXTURE_TRANSFORM;
|
|
1059
1060
|
}
|
|
@@ -1061,12 +1062,12 @@ class Ln {
|
|
|
1061
1062
|
return (t.texCoord === void 0 || t.texCoord === e.channel) && t.offset === void 0 && t.rotation === void 0 && t.scale === void 0 || (e = e.clone(), t.texCoord !== void 0 && (e.channel = t.texCoord), t.offset !== void 0 && e.offset.fromArray(t.offset), t.rotation !== void 0 && (e.rotation = t.rotation), t.scale !== void 0 && e.repeat.fromArray(t.scale), e.needsUpdate = !0), e;
|
|
1062
1063
|
}
|
|
1063
1064
|
}
|
|
1064
|
-
class
|
|
1065
|
+
class In {
|
|
1065
1066
|
constructor() {
|
|
1066
1067
|
this.name = E.KHR_MESH_QUANTIZATION;
|
|
1067
1068
|
}
|
|
1068
1069
|
}
|
|
1069
|
-
class
|
|
1070
|
+
class dt extends zt {
|
|
1070
1071
|
constructor(e, t, r, n) {
|
|
1071
1072
|
super(e, t, r, n);
|
|
1072
1073
|
}
|
|
@@ -1077,19 +1078,19 @@ class ut extends jt {
|
|
|
1077
1078
|
return t;
|
|
1078
1079
|
}
|
|
1079
1080
|
interpolate_(e, t, r, n) {
|
|
1080
|
-
const i = this.resultBuffer, s = this.sampleValues, a = this.valueSize, o = a * 2, c = a * 3, l = n - t, u = (r - t) / l, d = u * u, f = d * u, m = e * c, T = m - c, p = -2 * f + 3 * d, A = f - d,
|
|
1081
|
+
const i = this.resultBuffer, s = this.sampleValues, a = this.valueSize, o = a * 2, c = a * 3, l = n - t, u = (r - t) / l, d = u * u, f = d * u, m = e * c, T = m - c, p = -2 * f + 3 * d, A = f - d, R = 1 - p, N = A - d + u;
|
|
1081
1082
|
for (let _ = 0; _ !== a; _++) {
|
|
1082
1083
|
const B = s[T + _ + a], U = s[T + _ + o] * l, M = s[m + _ + a], g = s[m + _] * l;
|
|
1083
|
-
i[_] =
|
|
1084
|
+
i[_] = R * B + N * U + p * M + A * g;
|
|
1084
1085
|
}
|
|
1085
1086
|
return i;
|
|
1086
1087
|
}
|
|
1087
1088
|
}
|
|
1088
|
-
const
|
|
1089
|
-
class
|
|
1089
|
+
const Nn = new nt();
|
|
1090
|
+
class Cn extends dt {
|
|
1090
1091
|
interpolate_(e, t, r, n) {
|
|
1091
1092
|
const i = super.interpolate_(e, t, r, n);
|
|
1092
|
-
return
|
|
1093
|
+
return Nn.fromArray(i).normalize().toArray(i), i;
|
|
1093
1094
|
}
|
|
1094
1095
|
}
|
|
1095
1096
|
const j = {
|
|
@@ -1107,16 +1108,16 @@ const j = {
|
|
|
1107
1108
|
5123: Uint16Array,
|
|
1108
1109
|
5125: Uint32Array,
|
|
1109
1110
|
5126: Float32Array
|
|
1110
|
-
}, ze = {
|
|
1111
|
-
9728: rt,
|
|
1112
|
-
9729: pe,
|
|
1113
|
-
9984: Et,
|
|
1114
|
-
9985: _t,
|
|
1115
|
-
9986: xt,
|
|
1116
|
-
9987: st
|
|
1117
1111
|
}, Ke = {
|
|
1118
|
-
|
|
1119
|
-
|
|
1112
|
+
9728: it,
|
|
1113
|
+
9729: pe,
|
|
1114
|
+
9984: wt,
|
|
1115
|
+
9985: Et,
|
|
1116
|
+
9986: _t,
|
|
1117
|
+
9987: rt
|
|
1118
|
+
}, Ve = {
|
|
1119
|
+
33071: St,
|
|
1120
|
+
33648: bt,
|
|
1120
1121
|
10497: Ce
|
|
1121
1122
|
}, be = {
|
|
1122
1123
|
SCALAR: 1,
|
|
@@ -1142,26 +1143,26 @@ const j = {
|
|
|
1142
1143
|
translation: "position",
|
|
1143
1144
|
rotation: "quaternion",
|
|
1144
1145
|
weights: "morphTargetInfluences"
|
|
1145
|
-
},
|
|
1146
|
+
}, On = {
|
|
1146
1147
|
CUBICSPLINE: void 0,
|
|
1147
1148
|
// We use a custom interpolant (GLTFCubicSplineInterpolation) for CUBICSPLINE tracks. Each
|
|
1148
1149
|
// keyframe track will be initialized with a default interpolation type, then modified.
|
|
1149
|
-
LINEAR:
|
|
1150
|
-
STEP:
|
|
1150
|
+
LINEAR: ct,
|
|
1151
|
+
STEP: Ut
|
|
1151
1152
|
}, Se = {
|
|
1152
1153
|
OPAQUE: "OPAQUE",
|
|
1153
1154
|
MASK: "MASK",
|
|
1154
1155
|
BLEND: "BLEND"
|
|
1155
1156
|
};
|
|
1156
|
-
function
|
|
1157
|
-
return h.DefaultMaterial === void 0 && (h.DefaultMaterial = new
|
|
1157
|
+
function Pn(h) {
|
|
1158
|
+
return h.DefaultMaterial === void 0 && (h.DefaultMaterial = new ot({
|
|
1158
1159
|
color: 16777215,
|
|
1159
1160
|
emissive: 0,
|
|
1160
1161
|
metalness: 1,
|
|
1161
1162
|
roughness: 1,
|
|
1162
1163
|
transparent: !1,
|
|
1163
1164
|
depthTest: !0,
|
|
1164
|
-
side:
|
|
1165
|
+
side: jt
|
|
1165
1166
|
})), h.DefaultMaterial;
|
|
1166
1167
|
}
|
|
1167
1168
|
function ne(h, e, t) {
|
|
@@ -1171,7 +1172,7 @@ function ne(h, e, t) {
|
|
|
1171
1172
|
function Z(h, e) {
|
|
1172
1173
|
e.extras !== void 0 && (typeof e.extras == "object" ? Object.assign(h.userData, e.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + e.extras));
|
|
1173
1174
|
}
|
|
1174
|
-
function
|
|
1175
|
+
function Dn(h, e, t) {
|
|
1175
1176
|
let r = !1, n = !1, i = !1;
|
|
1176
1177
|
for (let c = 0, l = e.length; c < l; c++) {
|
|
1177
1178
|
const u = e[c];
|
|
@@ -1217,7 +1218,7 @@ function kn(h, e) {
|
|
|
1217
1218
|
console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.");
|
|
1218
1219
|
}
|
|
1219
1220
|
}
|
|
1220
|
-
function
|
|
1221
|
+
function Fn(h) {
|
|
1221
1222
|
let e;
|
|
1222
1223
|
const t = h.extensions && h.extensions[E.KHR_DRACO_MESH_COMPRESSION];
|
|
1223
1224
|
if (t ? e = "draco:" + t.bufferView + ":" + t.indices + ":" + Le(t.attributes) : e = h.indices + ":" + Le(h.attributes) + ":" + h.mode, h.targets !== void 0)
|
|
@@ -1246,13 +1247,13 @@ function Pe(h) {
|
|
|
1246
1247
|
throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.");
|
|
1247
1248
|
}
|
|
1248
1249
|
}
|
|
1249
|
-
function
|
|
1250
|
+
function Hn(h) {
|
|
1250
1251
|
return h.search(/\.jpe?g($|\?)/i) > 0 || h.search(/^data\:image\/jpeg/) === 0 ? "image/jpeg" : h.search(/\.webp($|\?)/i) > 0 || h.search(/^data\:image\/webp/) === 0 ? "image/webp" : h.search(/\.ktx2($|\?)/i) > 0 || h.search(/^data\:image\/ktx2/) === 0 ? "image/ktx2" : "image/png";
|
|
1251
1252
|
}
|
|
1252
|
-
const
|
|
1253
|
-
class
|
|
1253
|
+
const vn = new ae();
|
|
1254
|
+
class Bn {
|
|
1254
1255
|
constructor(e = {}, t = {}) {
|
|
1255
|
-
this.json = e, this.extensions = {}, this.plugins = {}, this.options = t, this.cache = new
|
|
1256
|
+
this.json = e, this.extensions = {}, this.plugins = {}, this.options = t, this.cache = new an(), this.associations = /* @__PURE__ */ new Map(), this.primitiveCache = {}, this.nodeCache = {}, this.meshCache = { refs: {}, uses: {} }, this.cameraCache = { refs: {}, uses: {} }, this.lightCache = { refs: {}, uses: {} }, this.sourceCache = {}, this.textureCache = {}, this.nodeNamesUsed = {};
|
|
1256
1257
|
let r = !1, n = -1, i = !1, s = -1;
|
|
1257
1258
|
if (typeof navigator < "u") {
|
|
1258
1259
|
const a = navigator.userAgent;
|
|
@@ -1260,7 +1261,7 @@ class vn {
|
|
|
1260
1261
|
const o = a.match(/Version\/(\d+)/);
|
|
1261
1262
|
n = r && o ? parseInt(o[1], 10) : -1, i = a.indexOf("Firefox") > -1, s = i ? a.match(/Firefox\/([0-9]+)\./)[1] : -1;
|
|
1262
1263
|
}
|
|
1263
|
-
typeof createImageBitmap > "u" || r && n < 17 || i && s < 98 ? this.textureLoader = new
|
|
1264
|
+
typeof createImageBitmap > "u" || r && n < 17 || i && s < 98 ? this.textureLoader = new Tt(this.options.manager) : this.textureLoader = new yt(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new ye(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0);
|
|
1264
1265
|
}
|
|
1265
1266
|
setExtensions(e) {
|
|
1266
1267
|
this.extensions = e;
|
|
@@ -1508,13 +1509,13 @@ class vn {
|
|
|
1508
1509
|
const a = s[0], o = be[n.type], c = oe[n.componentType], l = c.BYTES_PER_ELEMENT, u = l * o, d = n.byteOffset || 0, f = n.bufferView !== void 0 ? r.bufferViews[n.bufferView].byteStride : void 0, m = n.normalized === !0;
|
|
1509
1510
|
let T, p;
|
|
1510
1511
|
if (f && f !== u) {
|
|
1511
|
-
const A = Math.floor(d / f),
|
|
1512
|
-
let N = t.cache.get(
|
|
1513
|
-
N || (T = new c(a, A * f, n.count * f / l), N = new
|
|
1512
|
+
const A = Math.floor(d / f), R = "InterleavedBuffer:" + n.bufferView + ":" + n.componentType + ":" + A + ":" + n.count;
|
|
1513
|
+
let N = t.cache.get(R);
|
|
1514
|
+
N || (T = new c(a, A * f, n.count * f / l), N = new xt(T, f / l), t.cache.add(R, N)), p = new Rt(N, o, d % f / l, m);
|
|
1514
1515
|
} else
|
|
1515
1516
|
a === null ? T = new c(n.count * o) : T = new c(a, d, n.count * o), p = new ue(T, o, m);
|
|
1516
1517
|
if (n.sparse !== void 0) {
|
|
1517
|
-
const A = be.SCALAR,
|
|
1518
|
+
const A = be.SCALAR, R = oe[n.sparse.indices.componentType], N = n.sparse.indices.byteOffset || 0, _ = n.sparse.values.byteOffset || 0, B = new R(s[1], N, n.sparse.count * A), U = new c(s[2], _, n.sparse.count * o);
|
|
1518
1519
|
a !== null && (p = new ue(p.array.slice(), p.itemSize, p.normalized)), p.normalized = !1;
|
|
1519
1520
|
for (let M = 0, g = B.length; M < g; M++) {
|
|
1520
1521
|
const y = B[M];
|
|
@@ -1548,7 +1549,7 @@ class vn {
|
|
|
1548
1549
|
const c = this.loadImageSource(t, r).then(function(l) {
|
|
1549
1550
|
l.flipY = !1, l.name = s.name || a.name || "", l.name === "" && typeof a.uri == "string" && a.uri.startsWith("data:image/") === !1 && (l.name = a.uri);
|
|
1550
1551
|
const d = (i.samplers || {})[s.sampler] || {};
|
|
1551
|
-
return l.magFilter =
|
|
1552
|
+
return l.magFilter = Ke[d.magFilter] || pe, l.minFilter = Ke[d.minFilter] || rt, l.wrapS = Ve[d.wrapS] || Ce, l.wrapT = Ve[d.wrapT] || Ce, l.generateMipmaps = !l.isCompressedTexture && l.minFilter !== it && l.minFilter !== pe, n.associations.set(l, { textures: e }), l;
|
|
1552
1553
|
}).catch(function() {
|
|
1553
1554
|
return null;
|
|
1554
1555
|
});
|
|
@@ -1577,7 +1578,7 @@ class vn {
|
|
|
1577
1578
|
}), t.load(de.resolveURL(u, i.path), m, void 0, f);
|
|
1578
1579
|
});
|
|
1579
1580
|
}).then(function(u) {
|
|
1580
|
-
return c === !0 && a.revokeObjectURL(o), Z(u, s), u.userData.mimeType = s.mimeType ||
|
|
1581
|
+
return c === !0 && a.revokeObjectURL(o), Z(u, s), u.userData.mimeType = s.mimeType || Hn(s.uri), u;
|
|
1581
1582
|
}).catch(function(u) {
|
|
1582
1583
|
throw console.error("THREE.GLTFLoader: Couldn't load texture", o), u;
|
|
1583
1584
|
});
|
|
@@ -1624,11 +1625,11 @@ class vn {
|
|
|
1624
1625
|
if (e.isPoints) {
|
|
1625
1626
|
const a = "PointsMaterial:" + r.uuid;
|
|
1626
1627
|
let o = this.cache.get(a);
|
|
1627
|
-
o || (o = new
|
|
1628
|
+
o || (o = new Lt(), _e.prototype.copy.call(o, r), o.color.copy(r.color), o.map = r.map, o.sizeAttenuation = !1, this.cache.add(a, o)), r = o;
|
|
1628
1629
|
} else if (e.isLine) {
|
|
1629
1630
|
const a = "LineBasicMaterial:" + r.uuid;
|
|
1630
1631
|
let o = this.cache.get(a);
|
|
1631
|
-
o || (o = new
|
|
1632
|
+
o || (o = new Mt(), _e.prototype.copy.call(o, r), o.color.copy(r.color), o.map = r.map, this.cache.add(a, o)), r = o;
|
|
1632
1633
|
}
|
|
1633
1634
|
if (n || i || s) {
|
|
1634
1635
|
let a = "ClonedMaterial:" + r.uuid + ":";
|
|
@@ -1639,7 +1640,7 @@ class vn {
|
|
|
1639
1640
|
e.material = r;
|
|
1640
1641
|
}
|
|
1641
1642
|
getMaterialType() {
|
|
1642
|
-
return
|
|
1643
|
+
return ot;
|
|
1643
1644
|
}
|
|
1644
1645
|
/**
|
|
1645
1646
|
* Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials
|
|
@@ -1667,9 +1668,9 @@ class vn {
|
|
|
1667
1668
|
return d.extendMaterialParams && d.extendMaterialParams(e, a);
|
|
1668
1669
|
})));
|
|
1669
1670
|
}
|
|
1670
|
-
i.doubleSided === !0 && (a.side =
|
|
1671
|
+
i.doubleSided === !0 && (a.side = It);
|
|
1671
1672
|
const l = i.alphaMode || Se.OPAQUE;
|
|
1672
|
-
if (l === Se.BLEND ? (a.transparent = !0, a.depthWrite = !1) : (a.transparent = !1, l === Se.MASK && (a.alphaTest = i.alphaCutoff !== void 0 ? i.alphaCutoff : 0.5)), i.normalTexture !== void 0 && s !== le && (c.push(t.assignTexture(a, "normalMap", i.normalTexture)), a.normalScale = new
|
|
1673
|
+
if (l === Se.BLEND ? (a.transparent = !0, a.depthWrite = !1) : (a.transparent = !1, l === Se.MASK && (a.alphaTest = i.alphaCutoff !== void 0 ? i.alphaCutoff : 0.5)), i.normalTexture !== void 0 && s !== le && (c.push(t.assignTexture(a, "normalMap", i.normalTexture)), a.normalScale = new ke(1, 1), i.normalTexture.scale !== void 0)) {
|
|
1673
1674
|
const u = i.normalTexture.scale;
|
|
1674
1675
|
a.normalScale.set(u, u);
|
|
1675
1676
|
}
|
|
@@ -1690,7 +1691,7 @@ class vn {
|
|
|
1690
1691
|
* @return {string}
|
|
1691
1692
|
*/
|
|
1692
1693
|
createUniqueName(e) {
|
|
1693
|
-
const t =
|
|
1694
|
+
const t = Nt.sanitizeNodeName(e || "");
|
|
1694
1695
|
return t in this.nodeNamesUsed ? t + "_" + ++this.nodeNamesUsed[t] : (this.nodeNamesUsed[t] = 0, t);
|
|
1695
1696
|
}
|
|
1696
1697
|
/**
|
|
@@ -1706,17 +1707,17 @@ class vn {
|
|
|
1706
1707
|
const t = this, r = this.extensions, n = this.primitiveCache;
|
|
1707
1708
|
function i(a) {
|
|
1708
1709
|
return r[E.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a, t).then(function(o) {
|
|
1709
|
-
return
|
|
1710
|
+
return Xe(o, a, t);
|
|
1710
1711
|
});
|
|
1711
1712
|
}
|
|
1712
1713
|
const s = [];
|
|
1713
1714
|
for (let a = 0, o = e.length; a < o; a++) {
|
|
1714
|
-
const c = e[a], l =
|
|
1715
|
+
const c = e[a], l = Fn(c), u = n[l];
|
|
1715
1716
|
if (u)
|
|
1716
1717
|
s.push(u.promise);
|
|
1717
1718
|
else {
|
|
1718
1719
|
let d;
|
|
1719
|
-
c.extensions && c.extensions[E.KHR_DRACO_MESH_COMPRESSION] ? d = i(c) : d =
|
|
1720
|
+
c.extensions && c.extensions[E.KHR_DRACO_MESH_COMPRESSION] ? d = i(c) : d = Xe(new et(), c, t), n[l] = { primitive: c, promise: d }, s.push(d);
|
|
1720
1721
|
}
|
|
1721
1722
|
}
|
|
1722
1723
|
return Promise.all(s);
|
|
@@ -1731,7 +1732,7 @@ class vn {
|
|
|
1731
1732
|
loadMesh(e) {
|
|
1732
1733
|
const t = this, r = this.json, n = this.extensions, i = r.meshes[e], s = i.primitives, a = [];
|
|
1733
1734
|
for (let o = 0, c = s.length; o < c; o++) {
|
|
1734
|
-
const l = s[o].material === void 0 ?
|
|
1735
|
+
const l = s[o].material === void 0 ? Pn(this.cache) : this.getDependency("material", s[o].material);
|
|
1735
1736
|
a.push(l);
|
|
1736
1737
|
}
|
|
1737
1738
|
return a.push(t.loadGeometries(s)), Promise.all(a).then(function(o) {
|
|
@@ -1739,17 +1740,17 @@ class vn {
|
|
|
1739
1740
|
for (let f = 0, m = l.length; f < m; f++) {
|
|
1740
1741
|
const T = l[f], p = s[f];
|
|
1741
1742
|
let A;
|
|
1742
|
-
const
|
|
1743
|
+
const R = c[f];
|
|
1743
1744
|
if (p.mode === j.TRIANGLES || p.mode === j.TRIANGLE_STRIP || p.mode === j.TRIANGLE_FAN || p.mode === void 0)
|
|
1744
|
-
A = i.isSkinnedMesh === !0 ? new
|
|
1745
|
+
A = i.isSkinnedMesh === !0 ? new Ct(T, R) : new Ot(T, R), A.isSkinnedMesh === !0 && A.normalizeSkinWeights(), p.mode === j.TRIANGLE_STRIP ? A.geometry = je(A.geometry, Ze) : p.mode === j.TRIANGLE_FAN && (A.geometry = je(A.geometry, Ie));
|
|
1745
1746
|
else if (p.mode === j.LINES)
|
|
1746
|
-
A = new
|
|
1747
|
+
A = new Pt(T, R);
|
|
1747
1748
|
else if (p.mode === j.LINE_STRIP)
|
|
1748
|
-
A = new
|
|
1749
|
+
A = new Dt(T, R);
|
|
1749
1750
|
else if (p.mode === j.LINE_LOOP)
|
|
1750
|
-
A = new kt(T,
|
|
1751
|
+
A = new kt(T, R);
|
|
1751
1752
|
else if (p.mode === j.POINTS)
|
|
1752
|
-
A = new
|
|
1753
|
+
A = new Ft(T, R);
|
|
1753
1754
|
else
|
|
1754
1755
|
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + p.mode);
|
|
1755
1756
|
Object.keys(A.geometry.morphAttributes).length > 0 && kn(A, i), A.name = t.createUniqueName(i.name || "mesh_" + e), Z(A, i), p.extensions && ne(n, A, p), t.assignFinalMaterial(A), u.push(A);
|
|
@@ -1782,7 +1783,7 @@ class vn {
|
|
|
1782
1783
|
console.warn("THREE.GLTFLoader: Missing camera parameters.");
|
|
1783
1784
|
return;
|
|
1784
1785
|
}
|
|
1785
|
-
return r.type === "perspective" ? t = new
|
|
1786
|
+
return r.type === "perspective" ? t = new at(he.radToDeg(n.yfov), n.aspectRatio || 1, n.znear || 1, n.zfar || 2e6) : r.type === "orthographic" && (t = new Ht(-n.xmag, n.xmag, n.ymag, -n.ymag, n.znear, n.zfar)), r.name && (t.name = this.createUniqueName(r.name)), Z(t, r), Promise.resolve(t);
|
|
1786
1787
|
}
|
|
1787
1788
|
/**
|
|
1788
1789
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins
|
|
@@ -1806,7 +1807,7 @@ class vn {
|
|
|
1806
1807
|
} else
|
|
1807
1808
|
console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', t.joints[c]);
|
|
1808
1809
|
}
|
|
1809
|
-
return new
|
|
1810
|
+
return new vt(a, o);
|
|
1810
1811
|
});
|
|
1811
1812
|
}
|
|
1812
1813
|
/**
|
|
@@ -1819,8 +1820,8 @@ class vn {
|
|
|
1819
1820
|
loadAnimation(e) {
|
|
1820
1821
|
const t = this.json, r = this, n = t.animations[e], i = n.name ? n.name : "animation_" + e, s = [], a = [], o = [], c = [], l = [];
|
|
1821
1822
|
for (let u = 0, d = n.channels.length; u < d; u++) {
|
|
1822
|
-
const f = n.channels[u], m = n.samplers[f.sampler], T = f.target, p = T.node, A = n.parameters !== void 0 ? n.parameters[m.input] : m.input,
|
|
1823
|
-
T.node !== void 0 && (s.push(this.getDependency("node", p)), a.push(this.getDependency("accessor", A)), o.push(this.getDependency("accessor",
|
|
1823
|
+
const f = n.channels[u], m = n.samplers[f.sampler], T = f.target, p = T.node, A = n.parameters !== void 0 ? n.parameters[m.input] : m.input, R = n.parameters !== void 0 ? n.parameters[m.output] : m.output;
|
|
1824
|
+
T.node !== void 0 && (s.push(this.getDependency("node", p)), a.push(this.getDependency("accessor", A)), o.push(this.getDependency("accessor", R)), c.push(m), l.push(T));
|
|
1824
1825
|
}
|
|
1825
1826
|
return Promise.all([
|
|
1826
1827
|
Promise.all(s),
|
|
@@ -1830,8 +1831,8 @@ class vn {
|
|
|
1830
1831
|
Promise.all(l)
|
|
1831
1832
|
]).then(function(u) {
|
|
1832
1833
|
const d = u[0], f = u[1], m = u[2], T = u[3], p = u[4], A = [];
|
|
1833
|
-
for (let
|
|
1834
|
-
const _ = d[
|
|
1834
|
+
for (let R = 0, N = d.length; R < N; R++) {
|
|
1835
|
+
const _ = d[R], B = f[R], U = m[R], M = T[R], g = p[R];
|
|
1835
1836
|
if (_ === void 0) continue;
|
|
1836
1837
|
_.updateMatrix && _.updateMatrix();
|
|
1837
1838
|
const y = r._createAnimationTracks(_, B, U, M, g);
|
|
@@ -1839,7 +1840,7 @@ class vn {
|
|
|
1839
1840
|
for (let S = 0; S < y.length; S++)
|
|
1840
1841
|
A.push(y[S]);
|
|
1841
1842
|
}
|
|
1842
|
-
return new
|
|
1843
|
+
return new Bt(i, void 0, A);
|
|
1843
1844
|
});
|
|
1844
1845
|
}
|
|
1845
1846
|
createNodeMesh(e) {
|
|
@@ -1872,7 +1873,7 @@ class vn {
|
|
|
1872
1873
|
]).then(function(c) {
|
|
1873
1874
|
const l = c[0], u = c[1], d = c[2];
|
|
1874
1875
|
d !== null && l.traverse(function(f) {
|
|
1875
|
-
f.isSkinnedMesh && f.bind(d,
|
|
1876
|
+
f.isSkinnedMesh && f.bind(d, vn);
|
|
1876
1877
|
});
|
|
1877
1878
|
for (let f = 0, m = u.length; f < m; f++)
|
|
1878
1879
|
l.add(u[f]);
|
|
@@ -1896,7 +1897,7 @@ class vn {
|
|
|
1896
1897
|
a.push(c);
|
|
1897
1898
|
}), this.nodeCache[e] = Promise.all(a).then(function(c) {
|
|
1898
1899
|
let l;
|
|
1899
|
-
if (i.isBone === !0 ? l = new
|
|
1900
|
+
if (i.isBone === !0 ? l = new Gt() : c.length > 1 ? l = new Te() : c.length === 1 ? l = c[0] : l = new st(), l !== c[0])
|
|
1900
1901
|
for (let u = 0, d = c.length; u < d; u++)
|
|
1901
1902
|
l.add(c[u]);
|
|
1902
1903
|
if (i.name && (l.userData.name = i.name, l.name = s), Z(l, i), i.extensions && ne(r, l, i), i.matrix !== void 0) {
|
|
@@ -1965,7 +1966,7 @@ class vn {
|
|
|
1965
1966
|
}
|
|
1966
1967
|
break;
|
|
1967
1968
|
}
|
|
1968
|
-
const l = n.interpolation !== void 0 ?
|
|
1969
|
+
const l = n.interpolation !== void 0 ? On[n.interpolation] : ct, u = this._getArrayFromAccessor(r);
|
|
1969
1970
|
for (let d = 0, f = o.length; d < f; d++) {
|
|
1970
1971
|
const m = new c(
|
|
1971
1972
|
o[d] + "." + ee[i.path],
|
|
@@ -1989,13 +1990,13 @@ class vn {
|
|
|
1989
1990
|
}
|
|
1990
1991
|
_createCubicSplineTrackInterpolant(e) {
|
|
1991
1992
|
e.createInterpolant = function(r) {
|
|
1992
|
-
const n = this instanceof Ge ?
|
|
1993
|
+
const n = this instanceof Ge ? Cn : dt;
|
|
1993
1994
|
return new n(this.times, this.values, this.getValueSize() / 3, r);
|
|
1994
1995
|
}, e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0;
|
|
1995
1996
|
}
|
|
1996
1997
|
}
|
|
1997
|
-
function
|
|
1998
|
-
const r = e.attributes, n = new
|
|
1998
|
+
function Gn(h, e, t) {
|
|
1999
|
+
const r = e.attributes, n = new xe();
|
|
1999
2000
|
if (r.POSITION !== void 0) {
|
|
2000
2001
|
const a = t.json.accessors[r.POSITION], o = a.min, c = a.max;
|
|
2001
2002
|
if (o !== void 0 && c !== void 0) {
|
|
@@ -2032,10 +2033,10 @@ function Bn(h, e, t) {
|
|
|
2032
2033
|
n.expandByVector(a);
|
|
2033
2034
|
}
|
|
2034
2035
|
h.boundingBox = n;
|
|
2035
|
-
const s = new
|
|
2036
|
+
const s = new Kt();
|
|
2036
2037
|
n.getCenter(s.center), s.radius = n.min.distanceTo(n.max) / 2, h.boundingSphere = s;
|
|
2037
2038
|
}
|
|
2038
|
-
function
|
|
2039
|
+
function Xe(h, e, t) {
|
|
2039
2040
|
const r = e.attributes, n = [];
|
|
2040
2041
|
function i(s, a) {
|
|
2041
2042
|
return t.getDependency("accessor", s).then(function(o) {
|
|
@@ -2052,11 +2053,11 @@ function Ve(h, e, t) {
|
|
|
2052
2053
|
});
|
|
2053
2054
|
n.push(s);
|
|
2054
2055
|
}
|
|
2055
|
-
return Ne.workingColorSpace !== K && "COLOR_0" in r && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Ne.workingColorSpace}" not supported.`), Z(h, e),
|
|
2056
|
-
return e.targets !== void 0 ?
|
|
2056
|
+
return Ne.workingColorSpace !== K && "COLOR_0" in r && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Ne.workingColorSpace}" not supported.`), Z(h, e), Gn(h, e, t), Promise.all(n).then(function() {
|
|
2057
|
+
return e.targets !== void 0 ? Dn(h, e.targets, t) : h;
|
|
2057
2058
|
});
|
|
2058
2059
|
}
|
|
2059
|
-
class
|
|
2060
|
+
class Un extends Vt {
|
|
2060
2061
|
/**
|
|
2061
2062
|
* Constructs a new RGBE loader.
|
|
2062
2063
|
*
|
|
@@ -2136,8 +2137,8 @@ class Gn extends Kt {
|
|
|
2136
2137
|
F.length || s(4, "unable to allocate buffer space");
|
|
2137
2138
|
let C = 0, w = 0;
|
|
2138
2139
|
const H = 4 * P, I = new Uint8Array(4), $ = new Uint8Array(H);
|
|
2139
|
-
let
|
|
2140
|
-
for (;
|
|
2140
|
+
let Re = S;
|
|
2141
|
+
for (; Re > 0 && w < g.byteLength; ) {
|
|
2141
2142
|
w + 4 > g.byteLength && s(1), I[0] = g[w++], I[1] = g[w++], I[2] = g[w++], I[3] = g[w++], (I[0] != 2 || I[1] != 2 || (I[2] << 8 | I[3]) != P) && s(3, "bad rgbe scanline format");
|
|
2142
2143
|
let W = 0, G;
|
|
2143
2144
|
for (; W < H && w < g.byteLength; ) {
|
|
@@ -2150,12 +2151,12 @@ class Gn extends Kt {
|
|
|
2150
2151
|
} else
|
|
2151
2152
|
$.set(g.subarray(w, w + G), W), W += G, w += G;
|
|
2152
2153
|
}
|
|
2153
|
-
const
|
|
2154
|
-
for (let q = 0; q <
|
|
2154
|
+
const ht = P;
|
|
2155
|
+
for (let q = 0; q < ht; q++) {
|
|
2155
2156
|
let Y = 0;
|
|
2156
2157
|
F[C] = $[q + Y], Y += P, F[C + 1] = $[q + Y], Y += P, F[C + 2] = $[q + Y], Y += P, F[C + 3] = $[q + Y], C += 4;
|
|
2157
2158
|
}
|
|
2158
|
-
|
|
2159
|
+
Re--;
|
|
2159
2160
|
}
|
|
2160
2161
|
return F;
|
|
2161
2162
|
}, m = function(g, y, S, P) {
|
|
@@ -2166,7 +2167,7 @@ class Gn extends Kt {
|
|
|
2166
2167
|
S[P + 0] = ge.toHalfFloat(Math.min(g[y + 0] * C, 65504)), S[P + 1] = ge.toHalfFloat(Math.min(g[y + 1] * C, 65504)), S[P + 2] = ge.toHalfFloat(Math.min(g[y + 2] * C, 65504)), S[P + 3] = ge.toHalfFloat(1);
|
|
2167
2168
|
}, p = new Uint8Array(e);
|
|
2168
2169
|
p.pos = 0;
|
|
2169
|
-
const A = d(p),
|
|
2170
|
+
const A = d(p), R = A.width, N = A.height, _ = f(p.subarray(p.pos), R, N);
|
|
2170
2171
|
let B, U, M;
|
|
2171
2172
|
switch (this.type) {
|
|
2172
2173
|
case Ee:
|
|
@@ -2187,7 +2188,7 @@ class Gn extends Kt {
|
|
|
2187
2188
|
throw new Error("THREE.RGBELoader: Unsupported type: " + this.type);
|
|
2188
2189
|
}
|
|
2189
2190
|
return {
|
|
2190
|
-
width:
|
|
2191
|
+
width: R,
|
|
2191
2192
|
height: N,
|
|
2192
2193
|
data: B,
|
|
2193
2194
|
header: A.string,
|
|
@@ -2232,8 +2233,8 @@ const b = {
|
|
|
2232
2233
|
// basis vectors
|
|
2233
2234
|
e: []
|
|
2234
2235
|
// half width
|
|
2235
|
-
},
|
|
2236
|
-
class
|
|
2236
|
+
}, k = [[], [], []], x = [[], [], []], D = [], se = new O(), re = new O(), ie = new O(), v = new O(), We = new O(), qe = new O(), z = new lt(), Ye = new xe(), Ae = new ae(), Qe = new ae(), Je = new Xt();
|
|
2237
|
+
class De {
|
|
2237
2238
|
/**
|
|
2238
2239
|
* Constructs a new OBB.
|
|
2239
2240
|
*
|
|
@@ -2241,7 +2242,7 @@ class ke {
|
|
|
2241
2242
|
* @param {Vector3} [halfSize] - Positive halfwidth extents of the OBB along each axis.
|
|
2242
2243
|
* @param {Matrix3} [rotation] - The rotation of the OBB.
|
|
2243
2244
|
*/
|
|
2244
|
-
constructor(e = new O(), t = new O(), r = new
|
|
2245
|
+
constructor(e = new O(), t = new O(), r = new lt()) {
|
|
2245
2246
|
this.center = e, this.halfSize = t, this.rotation = r;
|
|
2246
2247
|
}
|
|
2247
2248
|
/**
|
|
@@ -2314,7 +2315,7 @@ class ke {
|
|
|
2314
2315
|
* @returns {boolean} - Whether the given AABB intersects this OBB or not.
|
|
2315
2316
|
*/
|
|
2316
2317
|
intersectsBox3(e) {
|
|
2317
|
-
return this.intersectsOBB(
|
|
2318
|
+
return this.intersectsOBB(jn.fromBox3(e));
|
|
2318
2319
|
}
|
|
2319
2320
|
/**
|
|
2320
2321
|
* Returns `true` if the given bounding sphere intersects this OBB.
|
|
@@ -2323,7 +2324,7 @@ class ke {
|
|
|
2323
2324
|
* @returns {boolean} - Whether the given bounding sphere intersects this OBB or not.
|
|
2324
2325
|
*/
|
|
2325
2326
|
intersectsSphere(e) {
|
|
2326
|
-
return this.clampPoint(e.center,
|
|
2327
|
+
return this.clampPoint(e.center, qe), qe.distanceToSquared(e.center) <= e.radius * e.radius;
|
|
2327
2328
|
}
|
|
2328
2329
|
/**
|
|
2329
2330
|
* Returns `true` if the given OBB intersects this OBB.
|
|
@@ -2336,17 +2337,17 @@ class ke {
|
|
|
2336
2337
|
b.c = this.center, b.e[0] = this.halfSize.x, b.e[1] = this.halfSize.y, b.e[2] = this.halfSize.z, this.rotation.extractBasis(b.u[0], b.u[1], b.u[2]), L.c = e.center, L.e[0] = e.halfSize.x, L.e[1] = e.halfSize.y, L.e[2] = e.halfSize.z, e.rotation.extractBasis(L.u[0], L.u[1], L.u[2]);
|
|
2337
2338
|
for (let i = 0; i < 3; i++)
|
|
2338
2339
|
for (let s = 0; s < 3; s++)
|
|
2339
|
-
|
|
2340
|
-
v.subVectors(L.c, b.c),
|
|
2340
|
+
k[i][s] = b.u[i].dot(L.u[s]);
|
|
2341
|
+
v.subVectors(L.c, b.c), D[0] = v.dot(b.u[0]), D[1] = v.dot(b.u[1]), D[2] = v.dot(b.u[2]);
|
|
2341
2342
|
for (let i = 0; i < 3; i++)
|
|
2342
2343
|
for (let s = 0; s < 3; s++)
|
|
2343
|
-
|
|
2344
|
+
x[i][s] = Math.abs(k[i][s]) + t;
|
|
2344
2345
|
let r, n;
|
|
2345
2346
|
for (let i = 0; i < 3; i++)
|
|
2346
|
-
if (r = b.e[i], n = L.e[0] *
|
|
2347
|
+
if (r = b.e[i], n = L.e[0] * x[i][0] + L.e[1] * x[i][1] + L.e[2] * x[i][2], Math.abs(D[i]) > r + n) return !1;
|
|
2347
2348
|
for (let i = 0; i < 3; i++)
|
|
2348
|
-
if (r = b.e[0] *
|
|
2349
|
-
return r = b.e[1] *
|
|
2349
|
+
if (r = b.e[0] * x[0][i] + b.e[1] * x[1][i] + b.e[2] * x[2][i], n = L.e[i], Math.abs(D[0] * k[0][i] + D[1] * k[1][i] + D[2] * k[2][i]) > r + n) return !1;
|
|
2350
|
+
return r = b.e[1] * x[2][0] + b.e[2] * x[1][0], n = L.e[1] * x[0][2] + L.e[2] * x[0][1], !(Math.abs(D[2] * k[1][0] - D[1] * k[2][0]) > r + n || (r = b.e[1] * x[2][1] + b.e[2] * x[1][1], n = L.e[0] * x[0][2] + L.e[2] * x[0][0], Math.abs(D[2] * k[1][1] - D[1] * k[2][1]) > r + n) || (r = b.e[1] * x[2][2] + b.e[2] * x[1][2], n = L.e[0] * x[0][1] + L.e[1] * x[0][0], Math.abs(D[2] * k[1][2] - D[1] * k[2][2]) > r + n) || (r = b.e[0] * x[2][0] + b.e[2] * x[0][0], n = L.e[1] * x[1][2] + L.e[2] * x[1][1], Math.abs(D[0] * k[2][0] - D[2] * k[0][0]) > r + n) || (r = b.e[0] * x[2][1] + b.e[2] * x[0][1], n = L.e[0] * x[1][2] + L.e[2] * x[1][0], Math.abs(D[0] * k[2][1] - D[2] * k[0][1]) > r + n) || (r = b.e[0] * x[2][2] + b.e[2] * x[0][2], n = L.e[0] * x[1][1] + L.e[1] * x[1][0], Math.abs(D[0] * k[2][2] - D[2] * k[0][2]) > r + n) || (r = b.e[0] * x[1][0] + b.e[1] * x[0][0], n = L.e[1] * x[2][2] + L.e[2] * x[2][1], Math.abs(D[1] * k[0][0] - D[0] * k[1][0]) > r + n) || (r = b.e[0] * x[1][1] + b.e[1] * x[0][1], n = L.e[0] * x[2][2] + L.e[2] * x[2][0], Math.abs(D[1] * k[0][1] - D[0] * k[1][1]) > r + n) || (r = b.e[0] * x[1][2] + b.e[1] * x[0][2], n = L.e[0] * x[2][1] + L.e[1] * x[2][0], Math.abs(D[1] * k[0][2] - D[0] * k[1][2]) > r + n));
|
|
2350
2351
|
}
|
|
2351
2352
|
/**
|
|
2352
2353
|
* Returns `true` if the given plane intersects this OBB.
|
|
@@ -2368,7 +2369,7 @@ class ke {
|
|
|
2368
2369
|
* @return {?Vector3} The intersection point. If no intersection is detected, `null` is returned.
|
|
2369
2370
|
*/
|
|
2370
2371
|
intersectRay(e, t) {
|
|
2371
|
-
return this.getSize(
|
|
2372
|
+
return this.getSize(We), Ye.setFromCenterAndSize(v.set(0, 0, 0), We), Ae.setFromMatrix3(this.rotation), Ae.setPosition(this.center), Qe.copy(Ae).invert(), Je.copy(e).applyMatrix4(Qe), Je.intersectBox(Ye, t) ? t.applyMatrix4(Ae) : null;
|
|
2372
2373
|
}
|
|
2373
2374
|
/**
|
|
2374
2375
|
* Returns `true` if the given ray intersects this OBB.
|
|
@@ -2414,19 +2415,20 @@ class ke {
|
|
|
2414
2415
|
return z.elements[0] *= a, z.elements[1] *= a, z.elements[2] *= a, z.elements[3] *= o, z.elements[4] *= o, z.elements[5] *= o, z.elements[6] *= c, z.elements[7] *= c, z.elements[8] *= c, this.rotation.multiply(z), this.halfSize.x *= r, this.halfSize.y *= n, this.halfSize.z *= i, v.setFromMatrixPosition(e), this.center.add(v), this;
|
|
2415
2416
|
}
|
|
2416
2417
|
}
|
|
2417
|
-
const
|
|
2418
|
+
const jn = new De(), zn = new Un(), Me = {}, Kn = {
|
|
2418
2419
|
enableDamping: !0,
|
|
2419
2420
|
dampingFactor: 0.25,
|
|
2420
2421
|
screenSpacePanning: !1,
|
|
2421
2422
|
minDistance: 0.1,
|
|
2422
2423
|
maxDistance: 1e3,
|
|
2423
2424
|
maxPolarAngle: Math.PI / 2
|
|
2424
|
-
}, Q = new
|
|
2425
|
+
}, Q = new Wt({
|
|
2425
2426
|
antialias: !0,
|
|
2426
2427
|
alpha: !0,
|
|
2427
|
-
precision: "mediump"
|
|
2428
|
+
precision: "mediump",
|
|
2429
|
+
logarithmicDepthBuffer: !0
|
|
2428
2430
|
});
|
|
2429
|
-
function
|
|
2431
|
+
function Yn(h, e) {
|
|
2430
2432
|
const t = Object.assign(
|
|
2431
2433
|
{
|
|
2432
2434
|
css3d: !1,
|
|
@@ -2447,26 +2449,26 @@ function qn(h, e) {
|
|
|
2447
2449
|
e || {}
|
|
2448
2450
|
);
|
|
2449
2451
|
let r, n, i, s, a = [];
|
|
2450
|
-
const o =
|
|
2452
|
+
const o = Ue(0), c = Ue(0), l = new qt({});
|
|
2451
2453
|
l.background = new V("#222b38");
|
|
2452
2454
|
const u = new Te();
|
|
2453
2455
|
l.add(u), Q.setPixelRatio(window.devicePixelRatio);
|
|
2454
|
-
const d = new
|
|
2456
|
+
const d = new at(50, 1, 0.1, 2e3), f = Math.tan(Math.PI / 180 * d.fov / 2);
|
|
2455
2457
|
function m() {
|
|
2456
|
-
const M =
|
|
2458
|
+
const M = R();
|
|
2457
2459
|
if (o.value = M[0], c.value = M[1], d.aspect = o.value / c.value, d.position.set(47, 39, 100), d.fov = 360 / Math.PI * Math.atan(f * (c.value / o.value)), d.updateProjectionMatrix(), Q.setSize(o.value, c.value), r.appendChild(Q.domElement), t.envImage && Vn(l), t.stats && N(), t.css3d && B(), t.axesHelper && t.axesHelper.init) {
|
|
2458
|
-
const g =
|
|
2460
|
+
const g = $t(t.axesHelper.size || 10);
|
|
2459
2461
|
l.add(g);
|
|
2460
2462
|
}
|
|
2461
2463
|
if (t.gridHelper && t.gridHelper.init) {
|
|
2462
|
-
const g =
|
|
2464
|
+
const g = en(
|
|
2463
2465
|
t.gridHelper.size || 150,
|
|
2464
2466
|
t.gridHelper.options || {}
|
|
2465
2467
|
);
|
|
2466
2468
|
l.add(g);
|
|
2467
2469
|
}
|
|
2468
2470
|
if (t.control && t.control.init) {
|
|
2469
|
-
s =
|
|
2471
|
+
s = tn(d, Q.domElement);
|
|
2470
2472
|
const g = t.control.options || Kn;
|
|
2471
2473
|
Object.keys(g).forEach((y) => {
|
|
2472
2474
|
s[y] = g[y];
|
|
@@ -2484,18 +2486,18 @@ function qn(h, e) {
|
|
|
2484
2486
|
}
|
|
2485
2487
|
function A() {
|
|
2486
2488
|
nextTick(() => {
|
|
2487
|
-
const M =
|
|
2489
|
+
const M = R();
|
|
2488
2490
|
o.value = M[0], c.value = M[1], d.aspect = o.value / c.value, d.fov = 360 / Math.PI * Math.atan(f * (c.value / o.value)), d.updateProjectionMatrix(), d.lookAt(l.position), Q.render(l, d), Q.setSize(o.value, c.value), i && i.setSize(o.value, c.value);
|
|
2489
2491
|
});
|
|
2490
2492
|
}
|
|
2491
|
-
function
|
|
2493
|
+
function R() {
|
|
2492
2494
|
return r = document.querySelector(h), [r.clientWidth, r.clientHeight];
|
|
2493
2495
|
}
|
|
2494
2496
|
function N() {
|
|
2495
2497
|
n = new fe(), n.dom.style.cssText = "position:absolute;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000", r.appendChild(n.dom);
|
|
2496
2498
|
}
|
|
2497
2499
|
function _(M, g, y, S) {
|
|
2498
|
-
const P = new
|
|
2500
|
+
const P = new xe().setFromObject(M), F = P.getSize(new O()).length(), C = P.getCenter(new O()), H = F * g * 0.5, I = he.degToRad(y.fov * 0.5), $ = H / Math.tan(I), W = new O().subVectors(y.position, C).multiply(new O(1, 1, 1)).normalize().multiplyScalar($).add(C), G = {
|
|
2499
2501
|
x: W.x,
|
|
2500
2502
|
y: W.y,
|
|
2501
2503
|
z: W.z,
|
|
@@ -2510,10 +2512,10 @@ function qn(h, e) {
|
|
|
2510
2512
|
), y.updateProjectionMatrix(), S.target.copy(C), S.update(), F;
|
|
2511
2513
|
}
|
|
2512
2514
|
function B() {
|
|
2513
|
-
i = new
|
|
2515
|
+
i = new nn(), i.setSize(o.value, c.value), i.domElement.style.position = "absolute", i.domElement.style.top = 0, i.domElement.style.left = 0, i.domElement.style.pointerEvents = "none", r.appendChild(i.domElement);
|
|
2514
2516
|
}
|
|
2515
2517
|
function U() {
|
|
2516
|
-
|
|
2518
|
+
Zt(l);
|
|
2517
2519
|
}
|
|
2518
2520
|
return {
|
|
2519
2521
|
init: m,
|
|
@@ -2531,24 +2533,26 @@ function qn(h, e) {
|
|
|
2531
2533
|
domHeight: c
|
|
2532
2534
|
};
|
|
2533
2535
|
}
|
|
2534
|
-
async function Vn(h, e
|
|
2535
|
-
if (
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2536
|
+
async function Vn(h, e) {
|
|
2537
|
+
if (e) {
|
|
2538
|
+
if (Me[e]) {
|
|
2539
|
+
const t = Me[e];
|
|
2540
|
+
h.environment = t;
|
|
2541
|
+
return;
|
|
2542
|
+
}
|
|
2543
|
+
return new Promise((t, r) => {
|
|
2544
|
+
zn.load(e, t, void 0, r);
|
|
2545
|
+
}).then((t) => {
|
|
2546
|
+
t.mapping = Yt, h.environment = t, Me[e] = t;
|
|
2547
|
+
}).catch((t) => {
|
|
2548
|
+
console.log(" =====> e:", t);
|
|
2549
|
+
});
|
|
2539
2550
|
}
|
|
2540
|
-
return new Promise((t, r) => {
|
|
2541
|
-
zn.load(e, t, void 0, r);
|
|
2542
|
-
}).then((t) => {
|
|
2543
|
-
t.mapping = qt, h.environment = t, Me[e] = t;
|
|
2544
|
-
}).catch((t) => {
|
|
2545
|
-
console.log(" =====> e:", t);
|
|
2546
|
-
});
|
|
2547
2551
|
}
|
|
2548
|
-
const
|
|
2549
|
-
const e = new
|
|
2552
|
+
const Qn = (h = "app") => {
|
|
2553
|
+
const e = new Qt();
|
|
2550
2554
|
e.params.Line.threshold = 8;
|
|
2551
|
-
const t = new
|
|
2555
|
+
const t = new ke(), r = document.getElementById(h);
|
|
2552
2556
|
function n(a, o) {
|
|
2553
2557
|
const { scaleX: c, scaleY: l } = s(r), { clientWidth: u, clientHeight: d } = o, f = o.getBoundingClientRect(), m = u * c, T = d * l, p = a.clientX - f.left, A = a.clientY - f.top;
|
|
2554
2558
|
return t.x = (a.clientX - f.left) / m * 2 - 1, t.y = -((a.clientY - f.top) / T) * 2 + 1, { pointer: t, x: p, y: A };
|
|
@@ -2575,7 +2579,7 @@ const Yn = (h = "app") => {
|
|
|
2575
2579
|
getScale: s,
|
|
2576
2580
|
getIntersects: i
|
|
2577
2581
|
};
|
|
2578
|
-
}, J = [],
|
|
2582
|
+
}, J = [], Jn = new V(16711680), Zn = () => {
|
|
2579
2583
|
const h = () => {
|
|
2580
2584
|
J.splice(0);
|
|
2581
2585
|
}, e = (a, o) => {
|
|
@@ -2584,8 +2588,8 @@ const Yn = (h = "app") => {
|
|
|
2584
2588
|
});
|
|
2585
2589
|
}, t = (a, o) => {
|
|
2586
2590
|
if (o.userData.needCheck && (o.autoUpdateMatrix = !1, o.updateMatrix(), o.updateMatrixWorld(), o.isMesh)) {
|
|
2587
|
-
const c = new
|
|
2588
|
-
o.geometry.userData.obb = new
|
|
2591
|
+
const c = new xe(new O()).setFromObject(o);
|
|
2592
|
+
o.geometry.userData.obb = new De(), o.geometry.userData.obb.halfSize.copy(c.getSize(new O())).multiplyScalar(0.5).multiplyScalar(0.88), o.userData.obb = new De(), o.userData.originColor = o.material.color.clone(), o.userData.parentUid = a, J.push({
|
|
2589
2593
|
object: o,
|
|
2590
2594
|
parentUid: a
|
|
2591
2595
|
});
|
|
@@ -2608,13 +2612,13 @@ const Yn = (h = "app") => {
|
|
|
2608
2612
|
J[o].parentUid === a && J.splice(o, 1);
|
|
2609
2613
|
}
|
|
2610
2614
|
};
|
|
2611
|
-
},
|
|
2612
|
-
const h = new
|
|
2615
|
+
}, $n = () => {
|
|
2616
|
+
const h = new Jt(16777215, 1), e = new tt(16777215, 1, 0);
|
|
2613
2617
|
e.position.set(0, 50, 100), e.angle = Math.PI / 8, e.penumbra = 1, e.decay = 0, e.distance = 0;
|
|
2614
2618
|
const t = e.clone();
|
|
2615
2619
|
return t.position.set(-100, 50, -100), t.angle = Math.PI / 8, t.penumbra = 1, t.decay = 0, t.distance = 0, [h, e, t];
|
|
2616
|
-
},
|
|
2617
|
-
const h = new
|
|
2620
|
+
}, es = () => {
|
|
2621
|
+
const h = new on(), e = new sn();
|
|
2618
2622
|
e.setDecoderPath("/draco/"), h.setDRACOLoader(e);
|
|
2619
2623
|
function t(n, i, s, a) {
|
|
2620
2624
|
return h.load(n, i, s, a);
|
|
@@ -2630,12 +2634,12 @@ const Yn = (h = "app") => {
|
|
|
2630
2634
|
};
|
|
2631
2635
|
};
|
|
2632
2636
|
export {
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2637
|
+
Qn as a,
|
|
2638
|
+
Jn as b,
|
|
2639
|
+
Zn as c,
|
|
2640
|
+
$n as d,
|
|
2641
|
+
es as e,
|
|
2638
2642
|
Vn as i,
|
|
2639
2643
|
J as o,
|
|
2640
|
-
|
|
2644
|
+
Yn as u
|
|
2641
2645
|
};
|