gl-draw 0.15.7 → 0.15.9
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/index.js +2 -2
- package/dist/index.module.js +176 -167
- package/package.json +1 -1
package/dist/index.module.js
CHANGED
|
@@ -26,13 +26,13 @@ var se = (h, e, t) => new Promise((s, i) => {
|
|
|
26
26
|
}, n = (a) => a.done ? s(a.value) : Promise.resolve(a.value).then(r, o);
|
|
27
27
|
n((t = t.apply(h, e)).next());
|
|
28
28
|
});
|
|
29
|
-
import { WebGLRenderer as Ut, Vector3 as I, PerspectiveCamera as zt, Matrix4 as W, Scene as nt, AxesHelper as De, CameraHelper as kt, PointLightHelper as Ft, DirectionalLightHelper as Nt, SpotLightHelper as Ht, HemisphereLightHelper as It, Box3 as at, Box3Helper as Ue, MathUtils as jt, Vector2 as B, Vector4 as Bt, Quaternion as lt, Spherical as Vt, Sphere as Yt, Raycaster as ht, REVISION as Zt, Object3D as Wt, UniformsUtils as Kt, RawShaderMaterial as
|
|
29
|
+
import { WebGLRenderer as Ut, Vector3 as I, PerspectiveCamera as zt, Matrix4 as W, Scene as nt, AxesHelper as De, CameraHelper as kt, PointLightHelper as Ft, DirectionalLightHelper as Nt, SpotLightHelper as Ht, HemisphereLightHelper as It, Box3 as at, Box3Helper as Ue, MathUtils as jt, Vector2 as B, Vector4 as Bt, Quaternion as lt, Spherical as Vt, Sphere as Yt, Raycaster as ht, REVISION as Zt, Object3D as Wt, UniformsUtils as Kt, RawShaderMaterial as $t, ShaderMaterial as Gt, MeshBasicMaterial as Xt, PointsMaterial as ct, SpriteMaterial as dt, Layers as qt, WebGLRenderTarget as Qt, HalfFloatType as Jt, Loader as mt, Texture as ue, VideoTexture as pt, FileLoader as Ae, LoadingManager as es, DataTexture as ts, Group as ze } from "three";
|
|
30
30
|
import { Timer as ss } from "three/examples/jsm/misc/Timer";
|
|
31
31
|
import * as Ce from "@tweenjs/tween.js";
|
|
32
32
|
import is from "deepmerge";
|
|
33
33
|
import rs from "stats-gl";
|
|
34
34
|
import { C as os, c as ns, i as as } from "./isPlainObject.module.js";
|
|
35
|
-
import { R as Pe, M as
|
|
35
|
+
import { R as Pe, M as ft, B as ls } from "./index.module2.js";
|
|
36
36
|
import { RectAreaLightHelper as hs } from "three/examples/jsm/helpers/RectAreaLightHelper";
|
|
37
37
|
import { ViewHelper as cs } from "three/examples/jsm/helpers/ViewHelper";
|
|
38
38
|
import { TransformControls as ds } from "three/examples/jsm/controls/TransformControls";
|
|
@@ -40,8 +40,8 @@ import { EffectComposer as ke } from "three/examples/jsm/postprocessing/EffectCo
|
|
|
40
40
|
import { RenderPass as ms } from "three/examples/jsm/postprocessing/RenderPass";
|
|
41
41
|
import { SSAOPass as ps } from "three/examples/jsm/postprocessing/SSAOPass";
|
|
42
42
|
import { FullScreenQuad as Fe } from "three/examples/jsm/postprocessing/Pass";
|
|
43
|
-
import { OutputPass as
|
|
44
|
-
import { ShaderPass as
|
|
43
|
+
import { OutputPass as fs } from "three/examples/jsm/postprocessing/OutputPass";
|
|
44
|
+
import { ShaderPass as us } from "three/examples/jsm/postprocessing/ShaderPass";
|
|
45
45
|
import { UnrealBloomPass as _s } from "three/examples/jsm/postprocessing/UnrealBloomPass";
|
|
46
46
|
import "three/examples/jsm/renderers/CSS2DRenderer";
|
|
47
47
|
import "three/examples/jsm/renderers/CSS3DRenderer";
|
|
@@ -95,14 +95,14 @@ function Y(h) {
|
|
|
95
95
|
function j(h) {
|
|
96
96
|
return h.isOrthographicCamera;
|
|
97
97
|
}
|
|
98
|
-
const
|
|
98
|
+
const $ = Math.PI * 2, Ie = Math.PI / 2, ut = 1e-5, ie = Math.PI / 180;
|
|
99
99
|
function k(h, e, t) {
|
|
100
100
|
return Math.max(e, Math.min(t, h));
|
|
101
101
|
}
|
|
102
|
-
function S(h, e =
|
|
102
|
+
function S(h, e = ut) {
|
|
103
103
|
return Math.abs(h) < e;
|
|
104
104
|
}
|
|
105
|
-
function P(h, e, t =
|
|
105
|
+
function P(h, e, t = ut) {
|
|
106
106
|
return S(h - e, t);
|
|
107
107
|
}
|
|
108
108
|
function je(h, e) {
|
|
@@ -118,25 +118,25 @@ function he(h, e, t, s, i = 1 / 0, r) {
|
|
|
118
118
|
s = Math.max(1e-4, s);
|
|
119
119
|
const o = 2 / s, n = o * r, a = 1 / (1 + n + 0.48 * n * n + 0.235 * n * n * n);
|
|
120
120
|
let c = h - e;
|
|
121
|
-
const
|
|
121
|
+
const u = e, m = i * s;
|
|
122
122
|
c = k(c, -m, m), e = h - c;
|
|
123
123
|
const v = (t.value + o * c) * r;
|
|
124
124
|
t.value = (t.value - o * v) * a;
|
|
125
125
|
let p = e + (c + v) * a;
|
|
126
|
-
return
|
|
126
|
+
return u - h > 0 == p > u && (p = u, t.value = (p - u) / r), p;
|
|
127
127
|
}
|
|
128
128
|
function Be(h, e, t, s, i = 1 / 0, r, o) {
|
|
129
129
|
s = Math.max(1e-4, s);
|
|
130
130
|
const n = 2 / s, a = n * r, c = 1 / (1 + a + 0.48 * a * a + 0.235 * a * a * a);
|
|
131
|
-
let
|
|
132
|
-
const y =
|
|
131
|
+
let u = e.x, m = e.y, v = e.z, p = h.x - u, f = h.y - m, g = h.z - v;
|
|
132
|
+
const y = u, l = m, _ = v, O = i * s, C = O * O, w = p * p + f * f + g * g;
|
|
133
133
|
if (w > C) {
|
|
134
134
|
const ve = Math.sqrt(w);
|
|
135
|
-
p = p / ve * O,
|
|
135
|
+
p = p / ve * O, f = f / ve * O, g = g / ve * O;
|
|
136
136
|
}
|
|
137
|
-
|
|
138
|
-
const E = (t.x + n * p) * r, b = (t.y + n *
|
|
139
|
-
t.x = (t.x - n * E) * c, t.y = (t.y - n * b) * c, t.z = (t.z - n * R) * c, o.x =
|
|
137
|
+
u = h.x - p, m = h.y - f, v = h.z - g;
|
|
138
|
+
const E = (t.x + n * p) * r, b = (t.y + n * f) * r, R = (t.z + n * g) * r;
|
|
139
|
+
t.x = (t.x - n * E) * c, t.y = (t.y - n * b) * c, t.z = (t.z - n * R) * c, o.x = u + (p + E) * c, o.y = m + (f + b) * c, o.z = v + (g + R) * c;
|
|
140
140
|
const V = y - h.x, le = l - h.y, xt = _ - h.z, bt = o.x - y, Lt = o.y - l, Pt = o.z - _;
|
|
141
141
|
return V * bt + le * Lt + xt * Pt > 0 && (o.x = y, o.y = l, o.z = _, t.x = (o.x - y) / r, t.y = (o.y - l) / r, t.z = (o.z - _) / r), o;
|
|
142
142
|
}
|
|
@@ -213,10 +213,10 @@ class Os {
|
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
const ce = 1 / 8, Es = /Mac/.test(navigator.platform);
|
|
216
|
-
let T, Ve, de, Te, D, x, L,
|
|
216
|
+
let T, Ve, de, Te, D, x, L, G, ne, F, N, Z, Ye, Ze, z, ae, X, We, we, Ke, xe, be, me;
|
|
217
217
|
class J extends Os {
|
|
218
218
|
static install(e) {
|
|
219
|
-
T = e.THREE, Ve = Object.freeze(new T.Vector3(0, 0, 0)), de = Object.freeze(new T.Vector3(0, 1, 0)), Te = Object.freeze(new T.Vector3(0, 0, 1)), D = new T.Vector2(), x = new T.Vector3(), L = new T.Vector3(),
|
|
219
|
+
T = e.THREE, Ve = Object.freeze(new T.Vector3(0, 0, 0)), de = Object.freeze(new T.Vector3(0, 1, 0)), Te = Object.freeze(new T.Vector3(0, 0, 1)), D = new T.Vector2(), x = new T.Vector3(), L = new T.Vector3(), G = new T.Vector3(), ne = new T.Vector3(), F = new T.Vector3(), N = new T.Vector3(), Z = new T.Vector3(), Ye = new T.Vector3(), Ze = new T.Vector3(), z = new T.Spherical(), ae = new T.Spherical(), X = new T.Box3(), We = new T.Box3(), we = new T.Sphere(), Ke = new T.Quaternion(), xe = new T.Quaternion(), be = new T.Matrix4(), me = new T.Raycaster();
|
|
220
220
|
}
|
|
221
221
|
/**
|
|
222
222
|
* list all ACTIONs
|
|
@@ -266,7 +266,7 @@ class J extends Os {
|
|
|
266
266
|
!0
|
|
267
267
|
) : this.truck(w, E, !0);
|
|
268
268
|
}, this._rotateInternal = (l, _) => {
|
|
269
|
-
const O =
|
|
269
|
+
const O = $ * this.azimuthRotateSpeed * l / this._elementRect.height, C = $ * this.polarRotateSpeed * _ / this._elementRect.height;
|
|
270
270
|
this.rotate(O, C, !0);
|
|
271
271
|
}, this._dollyInternal = (l, _, O) => {
|
|
272
272
|
const C = Math.pow(0.95, -l * this.dollySpeed), w = this._sphericalEnd.radius, E = this._sphericalEnd.radius * C, b = k(
|
|
@@ -377,11 +377,11 @@ class J extends Os {
|
|
|
377
377
|
}
|
|
378
378
|
else
|
|
379
379
|
this._state = d.NONE;
|
|
380
|
-
|
|
380
|
+
f();
|
|
381
381
|
}
|
|
382
382
|
};
|
|
383
383
|
let c = -1;
|
|
384
|
-
const
|
|
384
|
+
const u = (l) => {
|
|
385
385
|
if (!this._domElement || !this._enabled || this.mouseButtons.wheel === d.NONE) return;
|
|
386
386
|
if (this._interactiveArea.left !== 0 || this._interactiveArea.top !== 0 || this._interactiveArea.width !== 1 || this._interactiveArea.height !== 1) {
|
|
387
387
|
const E = this._domElement.getBoundingClientRect(), b = (l.clientX - E.left) / (E.right - E.left), R = (l.clientY - E.top) / (E.bottom - E.top);
|
|
@@ -484,7 +484,7 @@ class J extends Os {
|
|
|
484
484
|
(this._state & d.TOUCH_DOLLY) === d.TOUCH_DOLLY || (this._state & d.TOUCH_DOLLY_ROTATE) === d.TOUCH_DOLLY_ROTATE || (this._state & d.TOUCH_DOLLY_TRUCK) === d.TOUCH_DOLLY_TRUCK || (this._state & d.TOUCH_DOLLY_SCREEN_PAN) === d.TOUCH_DOLLY_SCREEN_PAN || (this._state & d.TOUCH_DOLLY_OFFSET) === d.TOUCH_DOLLY_OFFSET ? (this._dollyInternal(R * ce, V, le), this._isUserControllingDolly = !0) : (this._zoomInternal(R * ce, V, le), this._isUserControllingZoom = !0);
|
|
485
485
|
}
|
|
486
486
|
((this._state & d.TRUCK) === d.TRUCK || (this._state & d.TOUCH_TRUCK) === d.TOUCH_TRUCK || (this._state & d.TOUCH_DOLLY_TRUCK) === d.TOUCH_DOLLY_TRUCK || (this._state & d.TOUCH_ZOOM_TRUCK) === d.TOUCH_ZOOM_TRUCK) && (this._truckInternal(O, C, !1, !1), this._isUserControllingTruck = !0), ((this._state & d.SCREEN_PAN) === d.SCREEN_PAN || (this._state & d.TOUCH_SCREEN_PAN) === d.TOUCH_SCREEN_PAN || (this._state & d.TOUCH_DOLLY_SCREEN_PAN) === d.TOUCH_DOLLY_SCREEN_PAN || (this._state & d.TOUCH_ZOOM_SCREEN_PAN) === d.TOUCH_ZOOM_SCREEN_PAN) && (this._truckInternal(O, C, !1, !0), this._isUserControllingTruck = !0), ((this._state & d.OFFSET) === d.OFFSET || (this._state & d.TOUCH_OFFSET) === d.TOUCH_OFFSET || (this._state & d.TOUCH_DOLLY_OFFSET) === d.TOUCH_DOLLY_OFFSET || (this._state & d.TOUCH_ZOOM_OFFSET) === d.TOUCH_ZOOM_OFFSET) && (this._truckInternal(O, C, !0, !1), this._isUserControllingOffset = !0), this.dispatchEvent({ type: "control" });
|
|
487
|
-
},
|
|
487
|
+
}, f = () => {
|
|
488
488
|
Oe(this._activePointers, D), i.copy(D), this._dragNeedsUpdate = !1, (this._activePointers.length === 0 || this._activePointers.length === 1 && this._activePointers[0] === this._lockedPointer) && (this._isDragging = !1), this._activePointers.length === 0 && this._domElement && (this._domElement.ownerDocument.removeEventListener(
|
|
489
489
|
"pointermove",
|
|
490
490
|
n,
|
|
@@ -536,11 +536,11 @@ class J extends Os {
|
|
|
536
536
|
this.unlockPointer();
|
|
537
537
|
};
|
|
538
538
|
this._addAllEventListeners = (l) => {
|
|
539
|
-
this._domElement = l, this._domElement.style.touchAction = "none", this._domElement.style.userSelect = "none", this._domElement.style.webkitUserSelect = "none", this._domElement.addEventListener("pointerdown", o), this._domElement.addEventListener("pointercancel", a), this._domElement.addEventListener("wheel",
|
|
539
|
+
this._domElement = l, this._domElement.style.touchAction = "none", this._domElement.style.userSelect = "none", this._domElement.style.webkitUserSelect = "none", this._domElement.addEventListener("pointerdown", o), this._domElement.addEventListener("pointercancel", a), this._domElement.addEventListener("wheel", u, {
|
|
540
540
|
passive: !1
|
|
541
541
|
}), this._domElement.addEventListener("contextmenu", m);
|
|
542
542
|
}, this._removeAllEventListeners = () => {
|
|
543
|
-
this._domElement && (this._domElement.style.touchAction = "", this._domElement.style.userSelect = "", this._domElement.style.webkitUserSelect = "", this._domElement.removeEventListener("pointerdown", o), this._domElement.removeEventListener("pointercancel", a), this._domElement.removeEventListener("wheel",
|
|
543
|
+
this._domElement && (this._domElement.style.touchAction = "", this._domElement.style.userSelect = "", this._domElement.style.webkitUserSelect = "", this._domElement.removeEventListener("pointerdown", o), this._domElement.removeEventListener("pointercancel", a), this._domElement.removeEventListener("wheel", u, {
|
|
544
544
|
passive: !1
|
|
545
545
|
}), this._domElement.removeEventListener("contextmenu", m), this._domElement.ownerDocument.removeEventListener(
|
|
546
546
|
"pointermove",
|
|
@@ -557,7 +557,7 @@ class J extends Os {
|
|
|
557
557
|
y
|
|
558
558
|
));
|
|
559
559
|
}, this.cancel = () => {
|
|
560
|
-
this._state !== d.NONE && (this._state = d.NONE, this._activePointers.length = 0,
|
|
560
|
+
this._state !== d.NONE && (this._state = d.NONE, this._activePointers.length = 0, f());
|
|
561
561
|
}, t && this.connect(t), this.update(0);
|
|
562
562
|
}
|
|
563
563
|
/**
|
|
@@ -986,12 +986,12 @@ class J extends Os {
|
|
|
986
986
|
c.isEmpty() && (console.warn(
|
|
987
987
|
"camera-controls: fitTo() cannot be used with an empty box. Aborting"
|
|
988
988
|
), Promise.resolve());
|
|
989
|
-
const
|
|
990
|
-
a.push(this.rotateTo(
|
|
991
|
-
const v = x.setFromSpherical(this._sphericalEnd).normalize(), p = Ke.setFromUnitVectors(v, Te),
|
|
992
|
-
|
|
989
|
+
const u = je(this._sphericalEnd.theta, Ie), m = je(this._sphericalEnd.phi, Ie);
|
|
990
|
+
a.push(this.rotateTo(u, m, t));
|
|
991
|
+
const v = x.setFromSpherical(this._sphericalEnd).normalize(), p = Ke.setFromUnitVectors(v, Te), f = P(Math.abs(v.y), 1);
|
|
992
|
+
f && p.multiply(xe.setFromAxisAngle(de, u)), p.multiply(this._yAxisUpSpaceInverse);
|
|
993
993
|
const g = We.makeEmpty();
|
|
994
|
-
L.copy(c.min).applyQuaternion(p), g.expandByPoint(L), L.copy(c.min).setX(c.max.x).applyQuaternion(p), g.expandByPoint(L), L.copy(c.min).setY(c.max.y).applyQuaternion(p), g.expandByPoint(L), L.copy(c.max).setZ(c.min.z).applyQuaternion(p), g.expandByPoint(L), L.copy(c.min).setZ(c.max.z).applyQuaternion(p), g.expandByPoint(L), L.copy(c.max).setY(c.min.y).applyQuaternion(p), g.expandByPoint(L), L.copy(c.max).setX(c.min.x).applyQuaternion(p), g.expandByPoint(L), L.copy(c.max).applyQuaternion(p), g.expandByPoint(L), g.min.x -= i, g.min.y -= o, g.max.x += r, g.max.y += n, p.setFromUnitVectors(Te, v),
|
|
994
|
+
L.copy(c.min).applyQuaternion(p), g.expandByPoint(L), L.copy(c.min).setX(c.max.x).applyQuaternion(p), g.expandByPoint(L), L.copy(c.min).setY(c.max.y).applyQuaternion(p), g.expandByPoint(L), L.copy(c.max).setZ(c.min.z).applyQuaternion(p), g.expandByPoint(L), L.copy(c.min).setZ(c.max.z).applyQuaternion(p), g.expandByPoint(L), L.copy(c.max).setY(c.min.y).applyQuaternion(p), g.expandByPoint(L), L.copy(c.max).setX(c.min.x).applyQuaternion(p), g.expandByPoint(L), L.copy(c.max).applyQuaternion(p), g.expandByPoint(L), g.min.x -= i, g.min.y -= o, g.max.x += r, g.max.y += n, p.setFromUnitVectors(Te, v), f && p.premultiply(xe.invert()), p.premultiply(this._yAxisUpSpace);
|
|
995
995
|
const y = g.getSize(x), l = g.getCenter(L).applyQuaternion(p);
|
|
996
996
|
if (Y(this._camera)) {
|
|
997
997
|
const _ = this.getDistanceToFitBox(
|
|
@@ -1052,7 +1052,7 @@ class J extends Os {
|
|
|
1052
1052
|
this._targetEnd.copy(a), this._sphericalEnd.setFromVector3(
|
|
1053
1053
|
c.sub(a).applyQuaternion(this._yAxisUpSpace)
|
|
1054
1054
|
), this.normalizeRotations(), this._needsUpdate = !0, n || (this._target.copy(this._targetEnd), this._spherical.copy(this._sphericalEnd));
|
|
1055
|
-
const
|
|
1055
|
+
const u = !n || P(this._target.x, this._targetEnd.x, this.restThreshold) && P(this._target.y, this._targetEnd.y, this.restThreshold) && P(this._target.z, this._targetEnd.z, this.restThreshold) && P(
|
|
1056
1056
|
this._spherical.theta,
|
|
1057
1057
|
this._sphericalEnd.theta,
|
|
1058
1058
|
this.restThreshold
|
|
@@ -1065,7 +1065,7 @@ class J extends Os {
|
|
|
1065
1065
|
this._sphericalEnd.radius,
|
|
1066
1066
|
this.restThreshold
|
|
1067
1067
|
);
|
|
1068
|
-
return this._createOnRestPromise(
|
|
1068
|
+
return this._createOnRestPromise(u);
|
|
1069
1069
|
}
|
|
1070
1070
|
/**
|
|
1071
1071
|
* Similar to setLookAt, but it interpolates between two states.
|
|
@@ -1085,13 +1085,13 @@ class J extends Os {
|
|
|
1085
1085
|
* @param enableTransition
|
|
1086
1086
|
* @category Methods
|
|
1087
1087
|
*/
|
|
1088
|
-
lerpLookAt(e, t, s, i, r, o, n, a, c,
|
|
1088
|
+
lerpLookAt(e, t, s, i, r, o, n, a, c, u, m, v, p, f = !1) {
|
|
1089
1089
|
this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._lastDollyDirection = K.NONE, this._changedDolly = 0;
|
|
1090
1090
|
const g = x.set(i, r, o), y = L.set(e, t, s);
|
|
1091
1091
|
z.setFromVector3(
|
|
1092
1092
|
y.sub(g).applyQuaternion(this._yAxisUpSpace)
|
|
1093
1093
|
);
|
|
1094
|
-
const l =
|
|
1094
|
+
const l = G.set(u, m, v), _ = L.set(n, a, c);
|
|
1095
1095
|
ae.setFromVector3(
|
|
1096
1096
|
_.sub(l).applyQuaternion(this._yAxisUpSpace)
|
|
1097
1097
|
), this._targetEnd.copy(g.lerp(l, p));
|
|
@@ -1100,8 +1100,8 @@ class J extends Os {
|
|
|
1100
1100
|
z.radius + w * p,
|
|
1101
1101
|
z.phi + C * p,
|
|
1102
1102
|
z.theta + O * p
|
|
1103
|
-
), this.normalizeRotations(), this._needsUpdate = !0,
|
|
1104
|
-
const E = !
|
|
1103
|
+
), this.normalizeRotations(), this._needsUpdate = !0, f || (this._target.copy(this._targetEnd), this._spherical.copy(this._sphericalEnd));
|
|
1104
|
+
const E = !f || P(this._target.x, this._targetEnd.x, this.restThreshold) && P(this._target.y, this._targetEnd.y, this.restThreshold) && P(this._target.z, this._targetEnd.z, this.restThreshold) && P(
|
|
1105
1105
|
this._spherical.theta,
|
|
1106
1106
|
this._sphericalEnd.theta,
|
|
1107
1107
|
this.restThreshold
|
|
@@ -1296,7 +1296,7 @@ class J extends Os {
|
|
|
1296
1296
|
* @category Methods
|
|
1297
1297
|
*/
|
|
1298
1298
|
normalizeRotations() {
|
|
1299
|
-
this._sphericalEnd.theta = this._sphericalEnd.theta %
|
|
1299
|
+
this._sphericalEnd.theta = this._sphericalEnd.theta % $, this._sphericalEnd.theta < 0 && (this._sphericalEnd.theta += $), this._spherical.theta += $ * Math.round((this._sphericalEnd.theta - this._spherical.theta) / $);
|
|
1300
1300
|
}
|
|
1301
1301
|
/**
|
|
1302
1302
|
* stop all transitions.
|
|
@@ -1455,10 +1455,10 @@ class J extends Os {
|
|
|
1455
1455
|
}
|
|
1456
1456
|
if (this.dollyToCursor) {
|
|
1457
1457
|
if (Y(this._camera) && this._changedDolly !== 0) {
|
|
1458
|
-
const m = this._spherical.radius - this._lastDistance, v = this._camera, p = this._getCameraDirection(ne),
|
|
1459
|
-
|
|
1460
|
-
const g = L.crossVectors(
|
|
1461
|
-
|
|
1458
|
+
const m = this._spherical.radius - this._lastDistance, v = this._camera, p = this._getCameraDirection(ne), f = x.copy(p).cross(v.up).normalize();
|
|
1459
|
+
f.lengthSq() === 0 && (f.x = 1);
|
|
1460
|
+
const g = L.crossVectors(f, p), y = this._sphericalEnd.radius * Math.tan(v.getEffectiveFOV() * ie * 0.5), _ = (this._sphericalEnd.radius - m - this._sphericalEnd.radius) / this._sphericalEnd.radius, O = G.copy(this._targetEnd).add(
|
|
1461
|
+
f.multiplyScalar(
|
|
1462
1462
|
this._dollyControlCoord.x * y * v.aspect
|
|
1463
1463
|
)
|
|
1464
1464
|
).add(
|
|
@@ -1477,7 +1477,7 @@ class J extends Os {
|
|
|
1477
1477
|
this._dollyControlCoord.x,
|
|
1478
1478
|
this._dollyControlCoord.y,
|
|
1479
1479
|
(v.near + v.far) / (v.near - v.far)
|
|
1480
|
-
).unproject(v),
|
|
1480
|
+
).unproject(v), f = L.set(0, 0, -1).applyQuaternion(v.quaternion), g = G.copy(p).add(f.multiplyScalar(-p.dot(v.up))), l = -(this._zoom - m - this._zoom) / this._zoom, _ = this._getCameraDirection(ne), O = this._targetEnd.dot(_), C = x.copy(this._targetEnd).lerp(g, l), w = C.dot(_), E = _.multiplyScalar(
|
|
1481
1481
|
w - O
|
|
1482
1482
|
);
|
|
1483
1483
|
C.sub(E), this._boundary.clampPoint(C, C);
|
|
@@ -1492,8 +1492,8 @@ class J extends Os {
|
|
|
1492
1492
|
x.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse),
|
|
1493
1493
|
1
|
|
1494
1494
|
);
|
|
1495
|
-
const
|
|
1496
|
-
return
|
|
1495
|
+
const u = this._needsUpdate;
|
|
1496
|
+
return u && !this._updatedLastTime ? (this._hasRested = !1, this.dispatchEvent({ type: "wake" }), this.dispatchEvent({ type: "update" })) : u ? (this.dispatchEvent({ type: "update" }), S(t, this.restThreshold) && S(s, this.restThreshold) && S(i, this.restThreshold) && S(r.x, this.restThreshold) && S(r.y, this.restThreshold) && S(r.z, this.restThreshold) && S(o.x, this.restThreshold) && S(o.y, this.restThreshold) && S(o.z, this.restThreshold) && S(n, this.restThreshold) && !this._hasRested && (this._hasRested = !0, this.dispatchEvent({ type: "rest" }))) : !u && this._updatedLastTime && (this._hasRested || (this._hasRested = !0, this.dispatchEvent({ type: "rest" })), this.dispatchEvent({ type: "sleep" })), this._lastDistance = this._spherical.radius, this._lastZoom = this._zoom, this._updatedLastTime = u, this._needsUpdate = !1, u;
|
|
1497
1497
|
}
|
|
1498
1498
|
/**
|
|
1499
1499
|
* Get all state in JSON string
|
|
@@ -1591,7 +1591,7 @@ class J extends Os {
|
|
|
1591
1591
|
const i = t.lengthSq();
|
|
1592
1592
|
if (i === 0)
|
|
1593
1593
|
return e;
|
|
1594
|
-
const r = L.copy(t).add(e), n = this._boundary.clampPoint(r,
|
|
1594
|
+
const r = L.copy(t).add(e), n = this._boundary.clampPoint(r, G).sub(r), a = n.lengthSq();
|
|
1595
1595
|
if (a === 0)
|
|
1596
1596
|
return e.add(t);
|
|
1597
1597
|
if (a === i)
|
|
@@ -1622,7 +1622,7 @@ class J extends Os {
|
|
|
1622
1622
|
for (let i = 0; i < 4; i++) {
|
|
1623
1623
|
const r = L.copy(this._nearPlaneCorners[i]);
|
|
1624
1624
|
r.applyMatrix4(be);
|
|
1625
|
-
const o =
|
|
1625
|
+
const o = G.addVectors(this._target, r);
|
|
1626
1626
|
me.set(o, s), me.far = this._spherical.radius + 1;
|
|
1627
1627
|
const n = me.intersectObjects(this.colliderMeshes);
|
|
1628
1628
|
n.length !== 0 && n[0].distance < e && (e = n[0].distance);
|
|
@@ -1702,18 +1702,18 @@ class J extends Os {
|
|
|
1702
1702
|
if (!n.geometry) return;
|
|
1703
1703
|
const a = n.geometry.clone();
|
|
1704
1704
|
a.applyMatrix4(n.matrixWorld);
|
|
1705
|
-
const
|
|
1706
|
-
for (let m = 0, v =
|
|
1707
|
-
x.fromBufferAttribute(
|
|
1705
|
+
const u = a.attributes.position;
|
|
1706
|
+
for (let m = 0, v = u.count; m < v; m++)
|
|
1707
|
+
x.fromBufferAttribute(u, m), r = Math.max(r, i.distanceToSquared(x));
|
|
1708
1708
|
}), s.radius = Math.sqrt(r), s;
|
|
1709
1709
|
}
|
|
1710
1710
|
}
|
|
1711
|
-
var Se = { exports: {} }, Q = typeof Reflect == "object" ? Reflect : null,
|
|
1711
|
+
var Se = { exports: {} }, Q = typeof Reflect == "object" ? Reflect : null, $e = Q && typeof Q.apply == "function" ? Q.apply : function(e, t, s) {
|
|
1712
1712
|
return Function.prototype.apply.call(e, t, s);
|
|
1713
|
-
},
|
|
1714
|
-
Q && typeof Q.ownKeys == "function" ?
|
|
1713
|
+
}, fe;
|
|
1714
|
+
Q && typeof Q.ownKeys == "function" ? fe = Q.ownKeys : Object.getOwnPropertySymbols ? fe = function(e) {
|
|
1715
1715
|
return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e));
|
|
1716
|
-
} :
|
|
1716
|
+
} : fe = function(e) {
|
|
1717
1717
|
return Object.getOwnPropertyNames(e);
|
|
1718
1718
|
};
|
|
1719
1719
|
function Ts(h) {
|
|
@@ -1731,7 +1731,7 @@ A.EventEmitter = A;
|
|
|
1731
1731
|
A.prototype._events = void 0;
|
|
1732
1732
|
A.prototype._eventsCount = 0;
|
|
1733
1733
|
A.prototype._maxListeners = void 0;
|
|
1734
|
-
var
|
|
1734
|
+
var Ge = 10;
|
|
1735
1735
|
function ge(h) {
|
|
1736
1736
|
if (typeof h != "function")
|
|
1737
1737
|
throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof h);
|
|
@@ -1739,12 +1739,12 @@ function ge(h) {
|
|
|
1739
1739
|
Object.defineProperty(A, "defaultMaxListeners", {
|
|
1740
1740
|
enumerable: !0,
|
|
1741
1741
|
get: function() {
|
|
1742
|
-
return
|
|
1742
|
+
return Ge;
|
|
1743
1743
|
},
|
|
1744
1744
|
set: function(h) {
|
|
1745
1745
|
if (typeof h != "number" || h < 0 || _t(h))
|
|
1746
1746
|
throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + h + ".");
|
|
1747
|
-
|
|
1747
|
+
Ge = h;
|
|
1748
1748
|
}
|
|
1749
1749
|
});
|
|
1750
1750
|
A.init = function() {
|
|
@@ -1779,10 +1779,10 @@ A.prototype.emit = function(e) {
|
|
|
1779
1779
|
if (a === void 0)
|
|
1780
1780
|
return !1;
|
|
1781
1781
|
if (typeof a == "function")
|
|
1782
|
-
|
|
1782
|
+
$e(a, this, t);
|
|
1783
1783
|
else
|
|
1784
|
-
for (var c = a.length,
|
|
1785
|
-
|
|
1784
|
+
for (var c = a.length, u = Et(a, c), s = 0; s < c; ++s)
|
|
1785
|
+
$e(u[s], this, t);
|
|
1786
1786
|
return !0;
|
|
1787
1787
|
};
|
|
1788
1788
|
function yt(h, e, t, s) {
|
|
@@ -1890,7 +1890,7 @@ function Ot(h) {
|
|
|
1890
1890
|
return 0;
|
|
1891
1891
|
}
|
|
1892
1892
|
A.prototype.eventNames = function() {
|
|
1893
|
-
return this._eventsCount > 0 ?
|
|
1893
|
+
return this._eventsCount > 0 ? fe(this._events) : [];
|
|
1894
1894
|
};
|
|
1895
1895
|
function Et(h, e) {
|
|
1896
1896
|
for (var t = new Array(e), s = 0; s < e; ++s)
|
|
@@ -1953,11 +1953,11 @@ class Ss {
|
|
|
1953
1953
|
antialias: n,
|
|
1954
1954
|
powerPreference: a,
|
|
1955
1955
|
toneMappingExposure: c,
|
|
1956
|
-
outputColorSpace:
|
|
1956
|
+
outputColorSpace: u,
|
|
1957
1957
|
logarithmicDepthBuffer: m,
|
|
1958
1958
|
preserveDrawingBuffer: v,
|
|
1959
1959
|
stencil: p,
|
|
1960
|
-
depth:
|
|
1960
|
+
depth: f
|
|
1961
1961
|
} = i, g = new Ut({
|
|
1962
1962
|
alpha: r,
|
|
1963
1963
|
antialias: n,
|
|
@@ -1965,9 +1965,9 @@ class Ss {
|
|
|
1965
1965
|
logarithmicDepthBuffer: m,
|
|
1966
1966
|
preserveDrawingBuffer: v,
|
|
1967
1967
|
stencil: p,
|
|
1968
|
-
depth:
|
|
1968
|
+
depth: f
|
|
1969
1969
|
});
|
|
1970
|
-
g.setSize(t, s), g.setPixelRatio(o), g.toneMappingExposure = c, g.outputColorSpace =
|
|
1970
|
+
g.setSize(t, s), g.setPixelRatio(o), g.toneMappingExposure = c, g.outputColorSpace = u, this.renderer = g;
|
|
1971
1971
|
}
|
|
1972
1972
|
setSize(e, t) {
|
|
1973
1973
|
this.renderer.setSize(e, t);
|
|
@@ -2051,12 +2051,13 @@ class ee {
|
|
|
2051
2051
|
});
|
|
2052
2052
|
}
|
|
2053
2053
|
setPageActive(e, t) {
|
|
2054
|
-
this.activeIndex = e, this.activeControllerSet.clear()
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
)
|
|
2054
|
+
this.activeIndex = e, this.activeControllerSet.clear();
|
|
2055
|
+
const s = Array.from(this.controllerMap.entries()).map(([i, r]) => {
|
|
2056
|
+
const o = r.isEnabled(e);
|
|
2057
|
+
if (t == null || t(i, o), o)
|
|
2058
|
+
return this.activeControllerSet.add(i), i;
|
|
2059
|
+
}).filter(Boolean);
|
|
2060
|
+
this.controller = s[0], this.event.emit("pageChange", this.controller);
|
|
2060
2061
|
}
|
|
2061
2062
|
update(e, t) {
|
|
2062
2063
|
this.activeControllerSet.forEach((s) => {
|
|
@@ -2400,8 +2401,8 @@ class Bs {
|
|
|
2400
2401
|
a.style.overflow = "hidden", this.domElement = a;
|
|
2401
2402
|
const c = document.createElement("div");
|
|
2402
2403
|
c.style.transformOrigin = "0 0", c.style.pointerEvents = "none", a.appendChild(c);
|
|
2403
|
-
const
|
|
2404
|
-
|
|
2404
|
+
const u = document.createElement("div");
|
|
2405
|
+
u.style.transformStyle = "preserve-3d", c.appendChild(u), this.getSize = function() {
|
|
2405
2406
|
return {
|
|
2406
2407
|
width: s,
|
|
2407
2408
|
height: i
|
|
@@ -2412,9 +2413,9 @@ class Bs {
|
|
|
2412
2413
|
let O, C;
|
|
2413
2414
|
l.isOrthographicCamera && (O = -(l.right + l.left) / 2, C = (l.top + l.bottom) / 2);
|
|
2414
2415
|
const w = l.view && l.view.enabled ? l.view.height / l.view.fullHeight : 1, E = l.isOrthographicCamera ? `scale( ${w} )scale(` + _ + ")translate(" + m(O) + "px," + m(C) + "px)" + v(l.matrixWorldInverse) : `scale( ${w} )translateZ(` + _ + "px)" + v(l.matrixWorldInverse), R = (l.isPerspectiveCamera ? "perspective(" + _ + "px) " : "") + E + "translate(" + r + "px," + o + "px)";
|
|
2415
|
-
n.camera.style !== R && (
|
|
2416
|
+
n.camera.style !== R && (u.style.transform = R, n.camera.style = R), g(y, y, l);
|
|
2416
2417
|
}, this.setSize = function(y, l) {
|
|
2417
|
-
s = y, i = l, r = s / 2, o = i / 2, a.style.width = y + "px", a.style.height = l + "px", c.style.width = y + "px", c.style.height = l + "px",
|
|
2418
|
+
s = y, i = l, r = s / 2, o = i / 2, a.style.width = y + "px", a.style.height = l + "px", c.style.width = y + "px", c.style.height = l + "px", u.style.width = y + "px", u.style.height = l + "px";
|
|
2418
2419
|
};
|
|
2419
2420
|
function m(y) {
|
|
2420
2421
|
return Math.abs(y) < 1e-10 ? 0 : y;
|
|
@@ -2427,14 +2428,14 @@ class Bs {
|
|
|
2427
2428
|
const l = y.elements;
|
|
2428
2429
|
return "translate(-50%,-50%)" + ("matrix3d(" + m(l[0]) + "," + m(l[1]) + "," + m(l[2]) + "," + m(l[3]) + "," + m(-l[4]) + "," + m(-l[5]) + "," + m(-l[6]) + "," + m(-l[7]) + "," + m(l[8]) + "," + m(l[9]) + "," + m(l[10]) + "," + m(l[11]) + "," + m(l[12]) + "," + m(l[13]) + "," + m(l[14]) + "," + m(l[15]) + ")");
|
|
2429
2430
|
}
|
|
2430
|
-
function
|
|
2431
|
+
function f(y) {
|
|
2431
2432
|
y.isCSS3DObject && (y.element.style.display = "none");
|
|
2432
2433
|
for (let l = 0, _ = y.children.length; l < _; l++)
|
|
2433
|
-
|
|
2434
|
+
f(y.children[l]);
|
|
2434
2435
|
}
|
|
2435
2436
|
function g(y, l, _, O) {
|
|
2436
2437
|
if (y.visible === !1) {
|
|
2437
|
-
|
|
2438
|
+
f(y);
|
|
2438
2439
|
return;
|
|
2439
2440
|
}
|
|
2440
2441
|
if (y.isCSS3DObject) {
|
|
@@ -2449,7 +2450,7 @@ class Bs {
|
|
|
2449
2450
|
const R = { style: E };
|
|
2450
2451
|
n.objects.set(y, R);
|
|
2451
2452
|
}
|
|
2452
|
-
w.parentNode !==
|
|
2453
|
+
w.parentNode !== u && u.appendChild(w), y.onAfterRender(t, l, _);
|
|
2453
2454
|
}
|
|
2454
2455
|
}
|
|
2455
2456
|
for (let C = 0, w = y.children.length; C < w; C++)
|
|
@@ -2475,44 +2476,44 @@ class Vs {
|
|
|
2475
2476
|
width: s,
|
|
2476
2477
|
height: i
|
|
2477
2478
|
};
|
|
2478
|
-
}, this.render = function(
|
|
2479
|
-
|
|
2480
|
-
}, this.setSize = function(
|
|
2481
|
-
s =
|
|
2479
|
+
}, this.render = function(f, g) {
|
|
2480
|
+
f.matrixWorldAutoUpdate === !0 && f.updateMatrixWorld(), g.parent === null && g.matrixWorldAutoUpdate === !0 && g.updateMatrixWorld(), Qe.copy(g.matrixWorldInverse), Je.multiplyMatrices(g.projectionMatrix, Qe), u(f, f, g), p(f);
|
|
2481
|
+
}, this.setSize = function(f, g) {
|
|
2482
|
+
s = f, i = g, r = s / 2, o = i / 2, a.style.width = f + "px", a.style.height = g + "px";
|
|
2482
2483
|
};
|
|
2483
|
-
function c(
|
|
2484
|
-
|
|
2485
|
-
for (let g = 0, y =
|
|
2486
|
-
c(
|
|
2484
|
+
function c(f) {
|
|
2485
|
+
f.isCSS2DObject && (f.element.style.display = "none");
|
|
2486
|
+
for (let g = 0, y = f.children.length; g < y; g++)
|
|
2487
|
+
c(f.children[g]);
|
|
2487
2488
|
}
|
|
2488
|
-
function f
|
|
2489
|
-
if (
|
|
2490
|
-
c(
|
|
2489
|
+
function u(f, g, y) {
|
|
2490
|
+
if (f.visible === !1) {
|
|
2491
|
+
c(f);
|
|
2491
2492
|
return;
|
|
2492
2493
|
}
|
|
2493
|
-
if (
|
|
2494
|
-
q.setFromMatrixPosition(
|
|
2495
|
-
const l = q.z >= -1 && q.z <= 1 &&
|
|
2496
|
-
_.style.display = l === !0 ? "" : "none", l === !0 && (
|
|
2494
|
+
if (f.isCSS2DObject) {
|
|
2495
|
+
q.setFromMatrixPosition(f.matrixWorld), q.applyMatrix4(Je);
|
|
2496
|
+
const l = q.z >= -1 && q.z <= 1 && f.layers.test(y.layers) === !0, _ = f.element;
|
|
2497
|
+
_.style.display = l === !0 ? "" : "none", l === !0 && (f.onBeforeRender(t, g, y), _.style.transform = "translate(" + -100 * f.center.x + "%," + -100 * f.center.y + "%)translate(" + (q.x * r + r) + "px," + (-q.y * o + o) + "px)", _.parentNode !== a && a.appendChild(_), f.onAfterRender(t, g, y));
|
|
2497
2498
|
const O = {
|
|
2498
|
-
distanceToCameraSquared: m(y,
|
|
2499
|
+
distanceToCameraSquared: m(y, f)
|
|
2499
2500
|
};
|
|
2500
|
-
n.objects.set(
|
|
2501
|
+
n.objects.set(f, O);
|
|
2501
2502
|
}
|
|
2502
|
-
for (let l = 0, _ =
|
|
2503
|
-
f
|
|
2503
|
+
for (let l = 0, _ = f.children.length; l < _; l++)
|
|
2504
|
+
u(f.children[l], g, y);
|
|
2504
2505
|
}
|
|
2505
|
-
function m(
|
|
2506
|
-
return et.setFromMatrixPosition(
|
|
2506
|
+
function m(f, g) {
|
|
2507
|
+
return et.setFromMatrixPosition(f.matrixWorld), tt.setFromMatrixPosition(g.matrixWorld), et.distanceToSquared(tt);
|
|
2507
2508
|
}
|
|
2508
|
-
function v(
|
|
2509
|
+
function v(f) {
|
|
2509
2510
|
const g = [];
|
|
2510
|
-
return
|
|
2511
|
+
return f.traverseVisible(function(y) {
|
|
2511
2512
|
y.isCSS2DObject && g.push(y);
|
|
2512
2513
|
}), g;
|
|
2513
2514
|
}
|
|
2514
|
-
function p(
|
|
2515
|
-
const g = v(
|
|
2515
|
+
function p(f) {
|
|
2516
|
+
const g = v(f).sort(function(l, _) {
|
|
2516
2517
|
if (l.renderOrder !== _.renderOrder)
|
|
2517
2518
|
return _.renderOrder - l.renderOrder;
|
|
2518
2519
|
const O = n.objects.get(l).distanceToCameraSquared, C = n.objects.get(_).distanceToCameraSquared;
|
|
@@ -2641,11 +2642,11 @@ const Zs = {
|
|
|
2641
2642
|
}`
|
|
2642
2643
|
)
|
|
2643
2644
|
};
|
|
2644
|
-
class Ws extends
|
|
2645
|
+
class Ws extends fs {
|
|
2645
2646
|
constructor() {
|
|
2646
2647
|
super();
|
|
2647
2648
|
const e = Zs;
|
|
2648
|
-
this.uniforms = Kt.clone(e.uniforms), this.material = new
|
|
2649
|
+
this.uniforms = Kt.clone(e.uniforms), this.material = new $t({
|
|
2649
2650
|
name: e.name,
|
|
2650
2651
|
uniforms: this.uniforms,
|
|
2651
2652
|
vertexShader: e.vertexShader,
|
|
@@ -2654,8 +2655,8 @@ class Ws extends us {
|
|
|
2654
2655
|
}
|
|
2655
2656
|
}
|
|
2656
2657
|
const Ks = (h) => {
|
|
2657
|
-
const e = new
|
|
2658
|
-
new
|
|
2658
|
+
const e = new us(
|
|
2659
|
+
new Gt({
|
|
2659
2660
|
uniforms: {
|
|
2660
2661
|
baseTexture: { value: null },
|
|
2661
2662
|
bloomTexture: { value: h.renderTarget2.texture },
|
|
@@ -2689,7 +2690,7 @@ const Ks = (h) => {
|
|
|
2689
2690
|
"baseTexture"
|
|
2690
2691
|
);
|
|
2691
2692
|
return e.needsSwap = !0, e;
|
|
2692
|
-
}, Le = 1, pe = !1,
|
|
2693
|
+
}, Le = 1, pe = !1, $s = new Xt({ color: "black" }), Gs = new ct({
|
|
2693
2694
|
color: "black",
|
|
2694
2695
|
sizeAttenuation: !1
|
|
2695
2696
|
}), Xs = new ct({
|
|
@@ -2701,7 +2702,7 @@ const Ks = (h) => {
|
|
|
2701
2702
|
}), Qs = new dt({
|
|
2702
2703
|
color: "black",
|
|
2703
2704
|
sizeAttenuation: !1
|
|
2704
|
-
}), Js = new
|
|
2705
|
+
}), Js = new ft({
|
|
2705
2706
|
color: "black",
|
|
2706
2707
|
sizeAttenuation: 0,
|
|
2707
2708
|
lineWidth: 0
|
|
@@ -2728,23 +2729,23 @@ class ii {
|
|
|
2728
2729
|
composerParams: r
|
|
2729
2730
|
} = e, { renderer: o } = t;
|
|
2730
2731
|
this.renderer = o;
|
|
2731
|
-
const { multisampling: n } = r, { maxSamples: a } = o.capabilities, c = o.getDrawingBufferSize(new B()),
|
|
2732
|
+
const { multisampling: n } = r, { maxSamples: a } = o.capabilities, c = o.getDrawingBufferSize(new B()), u = new Qt(
|
|
2732
2733
|
c.width,
|
|
2733
2734
|
c.height,
|
|
2734
2735
|
{
|
|
2735
2736
|
samples: Math.min(n, a),
|
|
2736
2737
|
type: Jt
|
|
2737
2738
|
}
|
|
2738
|
-
), m = new ke(o,
|
|
2739
|
+
), m = new ke(o, u), v = this.getSize();
|
|
2739
2740
|
m.setSize(v.width, v.height);
|
|
2740
2741
|
const p = new ms(
|
|
2741
2742
|
s.scene,
|
|
2742
2743
|
i.camera
|
|
2743
2744
|
);
|
|
2744
|
-
m.addPass(p), this.scene = s.scene, this.camera = i.camera, this.finalComposer = m, this.renderPass = p, i.event.on("pageChange", (
|
|
2745
|
-
this.changeCamera(
|
|
2746
|
-
}), s.event.on("pageChange", (
|
|
2747
|
-
this.changeScene(
|
|
2745
|
+
m.addPass(p), this.scene = s.scene, this.camera = i.camera, this.finalComposer = m, this.renderPass = p, i.event.on("pageChange", (f) => {
|
|
2746
|
+
this.changeCamera(f);
|
|
2747
|
+
}), s.event.on("pageChange", (f) => {
|
|
2748
|
+
this.changeScene(f);
|
|
2748
2749
|
});
|
|
2749
2750
|
}
|
|
2750
2751
|
changeCamera(e) {
|
|
@@ -2809,7 +2810,7 @@ class ii {
|
|
|
2809
2810
|
s.traverse((i) => {
|
|
2810
2811
|
var a;
|
|
2811
2812
|
const r = i, o = i, n = i;
|
|
2812
|
-
(a = r.material) != null && a.isShadowMaterial ? e.push(r) : r.material && this.bloomLayer.test(r.layers) === !1 && (this.bloomMaterials[r.uuid] = r.material, o.isSprite ? o.material.sizeAttenuation ? o.material = qs : o.material = Qs : r.material instanceof
|
|
2813
|
+
(a = r.material) != null && a.isShadowMaterial ? e.push(r) : r.material && this.bloomLayer.test(r.layers) === !1 && (this.bloomMaterials[r.uuid] = r.material, o.isSprite ? o.material.sizeAttenuation ? o.material = qs : o.material = Qs : r.material instanceof ft ? r.material = Js : n.isPoints ? n.material.sizeAttenuation ? n.material = Xs : n.material = Gs : r.material = $s);
|
|
2813
2814
|
});
|
|
2814
2815
|
}), e.forEach((s) => {
|
|
2815
2816
|
this.bloomVisible[s.uuid] = s.visible, s.visible = !1;
|
|
@@ -2862,22 +2863,22 @@ class it extends mt {
|
|
|
2862
2863
|
}
|
|
2863
2864
|
load(e, t, s, i) {
|
|
2864
2865
|
let r, o;
|
|
2865
|
-
this.options.type === "image" ? (o = document.createElement("img"), r = new
|
|
2866
|
+
this.options.type === "image" ? (o = document.createElement("img"), r = new ue(o)) : this.options.type === "video" ? (o = document.createElement("video"), o.preload = "auto", o.autoplay = !1, o.loop = !1, o.muted = !0, o.setAttribute("webkit-playsinline", "webkit-playsinline"), o.setAttribute("playsinline", ""), r = new pt(o)) : r = new ue();
|
|
2866
2867
|
const n = new Ae(this.manager);
|
|
2867
2868
|
return n.setResponseType("blob"), n.setRequestHeader(this.requestHeader), n.setPath(this.path), n.setWithCredentials(this.withCredentials), n.load(
|
|
2868
2869
|
e,
|
|
2869
2870
|
(a) => {
|
|
2870
2871
|
let c = a;
|
|
2871
|
-
const
|
|
2872
|
+
const u = e.split(".").pop(), m = this.options.type === "image" ? `image/${u || "png"}` : `video/${u || "mp4"}`;
|
|
2872
2873
|
c = c.slice(0, a.size, m);
|
|
2873
2874
|
const v = () => {
|
|
2874
|
-
o.removeEventListener("load", p, !1), o.removeEventListener("error",
|
|
2875
|
+
o.removeEventListener("load", p, !1), o.removeEventListener("error", f, !1);
|
|
2875
2876
|
}, p = () => {
|
|
2876
2877
|
v(), r.needsUpdate = !0, t && t(r);
|
|
2877
|
-
},
|
|
2878
|
+
}, f = (y) => {
|
|
2878
2879
|
v(), i && i(y), this.manager.itemError(e), this.manager.itemEnd(e);
|
|
2879
2880
|
};
|
|
2880
|
-
o.addEventListener("load", p, !1), o.addEventListener("error",
|
|
2881
|
+
o.addEventListener("load", p, !1), o.addEventListener("error", f, !1);
|
|
2881
2882
|
const g = window.URL.createObjectURL(c);
|
|
2882
2883
|
o.src = g;
|
|
2883
2884
|
},
|
|
@@ -2945,7 +2946,7 @@ class ni {
|
|
|
2945
2946
|
const s = this.assets.get(e);
|
|
2946
2947
|
if (!s) {
|
|
2947
2948
|
if ((t === "images" || t === "media" || t === "exr") && this.options.simpleTexture4deleted && this.delLoadArr.includes(e))
|
|
2948
|
-
return new
|
|
2949
|
+
return new ue();
|
|
2949
2950
|
console.warn(`Asset ${e} not found`);
|
|
2950
2951
|
}
|
|
2951
2952
|
return s;
|
|
@@ -2998,7 +2999,7 @@ class ni {
|
|
|
2998
2999
|
get textureAssets() {
|
|
2999
3000
|
const e = /* @__PURE__ */ new Map();
|
|
3000
3001
|
return this.assets.forEach((t, s) => {
|
|
3001
|
-
(t instanceof
|
|
3002
|
+
(t instanceof ue || t instanceof ts || t instanceof pt) && e.set(s, t);
|
|
3002
3003
|
}), e;
|
|
3003
3004
|
}
|
|
3004
3005
|
loadAll() {
|
|
@@ -3026,8 +3027,8 @@ class ni {
|
|
|
3026
3027
|
const c = yield o.loadAsync(e);
|
|
3027
3028
|
if (this.assets.set(e, c), r.resolve(c), s === "images" || s === "media" || s === "exr" || s === "lottie") {
|
|
3028
3029
|
(t == null ? void 0 : t.colorCorrection) !== !1 && ns({ texture: c });
|
|
3029
|
-
const
|
|
3030
|
-
c.anisotropy =
|
|
3030
|
+
const u = (a = t == null ? void 0 : t.anisotropy) != null ? a : this.options.anisotropy;
|
|
3031
|
+
c.anisotropy = u;
|
|
3031
3032
|
}
|
|
3032
3033
|
return c;
|
|
3033
3034
|
} catch (c) {
|
|
@@ -3053,8 +3054,8 @@ class ni {
|
|
|
3053
3054
|
a.aoMap
|
|
3054
3055
|
].forEach((c) => {
|
|
3055
3056
|
if (c) {
|
|
3056
|
-
const
|
|
3057
|
-
|
|
3057
|
+
const u = this.getSrcByAsset(c, s);
|
|
3058
|
+
u && t.add(u);
|
|
3058
3059
|
}
|
|
3059
3060
|
});
|
|
3060
3061
|
});
|
|
@@ -3122,20 +3123,20 @@ class hi {
|
|
|
3122
3123
|
this.activeObjects.clear(), this.objCallbackMap.clear();
|
|
3123
3124
|
const a = this.objCallbackMap;
|
|
3124
3125
|
for (const p of n)
|
|
3125
|
-
for (const
|
|
3126
|
-
if (!
|
|
3127
|
-
a.has(
|
|
3128
|
-
const g = a.get(
|
|
3126
|
+
for (const f of p.objArr) {
|
|
3127
|
+
if (!f.object3d || !f.visibleWithAncestors) continue;
|
|
3128
|
+
a.has(f) || a.set(f, /* @__PURE__ */ new Map());
|
|
3129
|
+
const g = a.get(f);
|
|
3129
3130
|
g.has(p.type) || g.set(p.type, []), g.get(p.type).push(p.cb);
|
|
3130
3131
|
}
|
|
3131
3132
|
if (a.size === 0) return;
|
|
3132
3133
|
const c = [...a.keys()].map((p) => p.object3d);
|
|
3133
3134
|
console.time(`Pick:listener:${e}:pick`);
|
|
3134
|
-
const
|
|
3135
|
-
if (console.timeEnd(`Pick:listener:${e}:pick`), !
|
|
3135
|
+
const u = (v = this.pencil.pick(r, c, !0)) == null ? void 0 : v.intersects;
|
|
3136
|
+
if (console.timeEnd(`Pick:listener:${e}:pick`), !u || u.length === 0)
|
|
3136
3137
|
e === "down" ? this.handleDownOutside(r) : e === "move" && this.handleLeaveEvents(r);
|
|
3137
3138
|
else {
|
|
3138
|
-
const p =
|
|
3139
|
+
const p = u[0];
|
|
3139
3140
|
this.processIntersection(p, r, e);
|
|
3140
3141
|
}
|
|
3141
3142
|
const m = this.prevActiveObjects;
|
|
@@ -3176,9 +3177,9 @@ class hi {
|
|
|
3176
3177
|
sp: o,
|
|
3177
3178
|
intersectionIndex: s
|
|
3178
3179
|
});
|
|
3179
|
-
const
|
|
3180
|
-
if (
|
|
3181
|
-
for (const m of
|
|
3180
|
+
const u = a.get("move");
|
|
3181
|
+
if (u)
|
|
3182
|
+
for (const m of u)
|
|
3182
3183
|
m({
|
|
3183
3184
|
baseObject: n,
|
|
3184
3185
|
mouseEvent: e,
|
|
@@ -3195,14 +3196,14 @@ class hi {
|
|
|
3195
3196
|
sp: o,
|
|
3196
3197
|
intersectionIndex: s
|
|
3197
3198
|
});
|
|
3198
|
-
const
|
|
3199
|
-
if (
|
|
3199
|
+
const u = a.get("click");
|
|
3200
|
+
if (u) {
|
|
3200
3201
|
const m = (v) => {
|
|
3201
3202
|
v.preventDefault();
|
|
3202
3203
|
const p = 5;
|
|
3203
3204
|
if (!r && Math.abs(v.clientX - e.clientX) <= p && Math.abs(v.clientY - e.clientY) <= p)
|
|
3204
|
-
for (const
|
|
3205
|
-
|
|
3205
|
+
for (const f of u)
|
|
3206
|
+
f({
|
|
3206
3207
|
baseObject: n,
|
|
3207
3208
|
mouseEvent: e,
|
|
3208
3209
|
sp: o,
|
|
@@ -3263,8 +3264,8 @@ class hi {
|
|
|
3263
3264
|
baseObject: a,
|
|
3264
3265
|
mouseEvent: m
|
|
3265
3266
|
}));
|
|
3266
|
-
},
|
|
3267
|
-
a.element.addEventListener(
|
|
3267
|
+
}, u = `pointer${t}`;
|
|
3268
|
+
a.element.addEventListener(u, rt(c), !1), o.push({ arr: a, type: u, listener: c });
|
|
3268
3269
|
}
|
|
3269
3270
|
return this.pickNodeFunctionsMap.set(i, o), i;
|
|
3270
3271
|
}
|
|
@@ -3309,7 +3310,13 @@ class ci extends hi {
|
|
|
3309
3310
|
const s = U({
|
|
3310
3311
|
mList: !0
|
|
3311
3312
|
}, t), i = new ls();
|
|
3312
|
-
|
|
3313
|
+
if (i.object3d = e, i.pencil = this.pencil, i.lead = this, i.mList = this.mList, s.key)
|
|
3314
|
+
i.key = s.key;
|
|
3315
|
+
else if (s.target) {
|
|
3316
|
+
const r = s.target.key, o = s.target.children.length;
|
|
3317
|
+
i.key = `${r}__c__${o}`;
|
|
3318
|
+
}
|
|
3319
|
+
return s.name && (e.name = s.name), s.target && s.target.object3d.add(i.object3d), this.objects.set(i.key, i), this.objMap.set(i.object3d, i), this.pencil.options.mList && s.mList && (this.mList.proxyBaseObject(i), this.mList.addBaseObjectMap(i)), i;
|
|
3313
3320
|
}
|
|
3314
3321
|
init(e) {
|
|
3315
3322
|
return Object.keys(e).forEach((t) => {
|
|
@@ -3339,18 +3346,18 @@ class ci extends hi {
|
|
|
3339
3346
|
const i = this.objectNamesToFactories.get(e);
|
|
3340
3347
|
if (i) {
|
|
3341
3348
|
t || (t = {}), t.target === void 0 && (t.target = s);
|
|
3342
|
-
const c = t.target,
|
|
3343
|
-
let
|
|
3344
|
-
return c === null ?
|
|
3349
|
+
const c = t.target, u = (r = t.onTop) != null ? r : 0, m = (o = t.prefab) != null ? o : !1, v = (n = t.create) != null ? n : !0, p = new i().create(t);
|
|
3350
|
+
let f;
|
|
3351
|
+
return c === null ? f = null : typeof c == "string" ? f = this.objects.get(c) : (a = c == null ? void 0 : c.objectType) != null && a.startsWith("BaseObject") || c ? f = c : m ? f = this.prefabGroup : f = this.group, v === !1 ? p.create = () => {
|
|
3345
3352
|
} : v !== !0 && (p.create = () => {
|
|
3346
3353
|
v(p);
|
|
3347
3354
|
}), p.pencil = this.pencil, p.lead = this, p.mList = this.mList, p.prefab = m, p.objectType = `BaseObject#${e}`, p.objectOptions = t, this.setBaseObjectKey(
|
|
3348
3355
|
p,
|
|
3349
3356
|
t.key ? `$t:#${t.key}` : "$t:",
|
|
3350
|
-
|
|
3357
|
+
f == null ? void 0 : f.key
|
|
3351
3358
|
), this.objectsPm.set(
|
|
3352
3359
|
p,
|
|
3353
|
-
this.addBaseObject(p,
|
|
3360
|
+
this.addBaseObject(p, f, u)
|
|
3354
3361
|
), yield this.objectsPm.get(p), this.objectsPm.delete(p), p;
|
|
3355
3362
|
}
|
|
3356
3363
|
throw new Error(`Unrecognized:${e}`);
|
|
@@ -3374,7 +3381,9 @@ class ci extends hi {
|
|
|
3374
3381
|
break;
|
|
3375
3382
|
}
|
|
3376
3383
|
const i = (o = e.parent) == null ? void 0 : o.key, r = this.setBaseObjectKey(e, t, i);
|
|
3377
|
-
return s && this.objects.delete(s), this.pencil.event.emit("lead.updateKey", { baseObject: e, key: r, oldKey: s }),
|
|
3384
|
+
return s && this.objects.delete(s), this.pencil.event.emit("lead.updateKey", { baseObject: e, key: r, oldKey: s }), e.children.forEach((n, a) => {
|
|
3385
|
+
n.key.includes("__c__") && this.updateBaseObjectKey(n, `${r}__c__${a}`);
|
|
3386
|
+
}), r;
|
|
3378
3387
|
}
|
|
3379
3388
|
addBaseObject(e, t, s) {
|
|
3380
3389
|
return se(this, null, function* () {
|
|
@@ -3560,15 +3569,15 @@ class mi {
|
|
|
3560
3569
|
if (o.hasOwnProperty("__isProxy"))
|
|
3561
3570
|
return o;
|
|
3562
3571
|
const n = new Proxy(o, {
|
|
3563
|
-
set: (a, c,
|
|
3572
|
+
set: (a, c, u) => {
|
|
3564
3573
|
if (typeof c == "string" && !isNaN(Number(c))) {
|
|
3565
3574
|
const m = Number(c);
|
|
3566
3575
|
if (m >= 0 && m < a.length) {
|
|
3567
3576
|
const v = a[m];
|
|
3568
|
-
return this.rmBaseObjectMap(e, v), a[m] =
|
|
3577
|
+
return this.rmBaseObjectMap(e, v), a[m] = u, u && this.addBaseObjectMap(e), !0;
|
|
3569
3578
|
}
|
|
3570
3579
|
}
|
|
3571
|
-
return a[c] =
|
|
3580
|
+
return a[c] = u, !0;
|
|
3572
3581
|
}
|
|
3573
3582
|
});
|
|
3574
3583
|
return Object.defineProperty(n, "__isProxy", {
|
|
@@ -3781,7 +3790,7 @@ const _e = class _e {
|
|
|
3781
3790
|
renderer: r,
|
|
3782
3791
|
controls: o,
|
|
3783
3792
|
loader: n
|
|
3784
|
-
} = this.options, { width: a, height: c } = this.getSize(),
|
|
3793
|
+
} = this.options, { width: a, height: c } = this.getSize(), u = t ? new Rs({
|
|
3785
3794
|
width: a,
|
|
3786
3795
|
height: c,
|
|
3787
3796
|
renderer: t.WebGPURenderer,
|
|
@@ -3797,18 +3806,18 @@ const _e = class _e {
|
|
|
3797
3806
|
height: c
|
|
3798
3807
|
}), v = new ks({}), p = new Ns({
|
|
3799
3808
|
controlsParams: {
|
|
3800
|
-
domElement: (_ = o == null ? void 0 : o.domElement) != null ? _ :
|
|
3809
|
+
domElement: (_ = o == null ? void 0 : o.domElement) != null ? _ : u.renderer.domElement
|
|
3801
3810
|
}
|
|
3802
|
-
}),
|
|
3811
|
+
}), f = new li({
|
|
3803
3812
|
loaderParams: U({
|
|
3804
|
-
anisotropy:
|
|
3813
|
+
anisotropy: u.renderer.capabilities.getMaxAnisotropy()
|
|
3805
3814
|
}, n)
|
|
3806
3815
|
}), g = new pi({
|
|
3807
3816
|
pencil: this
|
|
3808
3817
|
}), y = new di({
|
|
3809
3818
|
pencil: this
|
|
3810
3819
|
});
|
|
3811
|
-
this.sceneController = v, this.cameraController = m, this.controlsController = p, this.rendererController =
|
|
3820
|
+
this.sceneController = v, this.cameraController = m, this.controlsController = p, this.rendererController = u, this.loaderController = f, this.mListController = g, this.leadController = y;
|
|
3812
3821
|
const l = this.addPage({
|
|
3813
3822
|
sceneOptions: this.options.scene,
|
|
3814
3823
|
cameraOptions: this.options.camera
|
|
@@ -3821,7 +3830,7 @@ const _e = class _e {
|
|
|
3821
3830
|
});
|
|
3822
3831
|
O.add(v.scene), this.helperController = O, i && O.addViewHelper();
|
|
3823
3832
|
}
|
|
3824
|
-
e.appendChild(
|
|
3833
|
+
e.appendChild(u.renderer.domElement);
|
|
3825
3834
|
}
|
|
3826
3835
|
initComposer() {
|
|
3827
3836
|
const {
|
|
@@ -3891,10 +3900,10 @@ const _e = class _e {
|
|
|
3891
3900
|
cssRendererController: n,
|
|
3892
3901
|
leadController: a
|
|
3893
3902
|
} = this, c = this.renderer.getSize(new B());
|
|
3894
|
-
c.x === e && c.y === t || (r.setSize(e, t), i.setSize(e, t), o == null || o.setSize(e, t), n == null || n.setSize(e, t), a.setSize(e, t), this.installPlugins.forEach((
|
|
3903
|
+
c.x === e && c.y === t || (r.setSize(e, t), i.setSize(e, t), o == null || o.setSize(e, t), n == null || n.setSize(e, t), a.setSize(e, t), this.installPlugins.forEach((u) => {
|
|
3895
3904
|
var m;
|
|
3896
|
-
(m =
|
|
3897
|
-
}), this.viewPadding.some((
|
|
3905
|
+
(m = u.setSize) == null || m.call(u, e, t);
|
|
3906
|
+
}), this.viewPadding.some((u) => u !== 0) && this.setViewPadding(...this.viewPadding), this.render(), s && this.event.emit("resize", { width: e, height: t }));
|
|
3898
3907
|
}
|
|
3899
3908
|
setDevicePixelRatio(e) {
|
|
3900
3909
|
var n;
|
|
@@ -3944,8 +3953,8 @@ const _e = class _e {
|
|
|
3944
3953
|
this.timer.update(), Ce.update();
|
|
3945
3954
|
const e = this.timer.getDelta(), t = this.timer.getElapsed();
|
|
3946
3955
|
this.controlsController.update(e, t), this.leadController.update(e, t), this.installPlugins.forEach((c) => {
|
|
3947
|
-
var
|
|
3948
|
-
(
|
|
3956
|
+
var u;
|
|
3957
|
+
(u = c.update) == null || u.call(c, e, t);
|
|
3949
3958
|
}), (s = this.helperController) == null || s.update(
|
|
3950
3959
|
e,
|
|
3951
3960
|
this.controlsController,
|
|
@@ -3988,11 +3997,11 @@ const _e = class _e {
|
|
|
3988
3997
|
}
|
|
3989
3998
|
}
|
|
3990
3999
|
dispose() {
|
|
3991
|
-
var e, t, s, i, r, o, n, a, c,
|
|
4000
|
+
var e, t, s, i, r, o, n, a, c, u, m, v, p, f;
|
|
3992
4001
|
this.stop(), this.timer.dispose(), Ce.removeAll(), this.event.removeAllListeners(), (e = this.resizeObserver) == null || e.unobserve(this.options.container), this.installPlugins.forEach((g) => {
|
|
3993
4002
|
var y;
|
|
3994
4003
|
(y = g.dispose) == null || y.call(g);
|
|
3995
|
-
}), (t = this.controlsController) == null || t.dispose(), (s = this.transformController) == null || s.dispose(), (i = this.cssRendererController) == null || i.dispose(), (r = this.sceneController) == null || r.dispose(), (o = this.cameraController) == null || o.dispose(), (n = this.helperController) == null || n.dispose(), (a = this.composerController) == null || a.dispose(), (c = this.rendererController) == null || c.dispose(), (
|
|
4004
|
+
}), (t = this.controlsController) == null || t.dispose(), (s = this.transformController) == null || s.dispose(), (i = this.cssRendererController) == null || i.dispose(), (r = this.sceneController) == null || r.dispose(), (o = this.cameraController) == null || o.dispose(), (n = this.helperController) == null || n.dispose(), (a = this.composerController) == null || a.dispose(), (c = this.rendererController) == null || c.dispose(), (u = this.loaderController) == null || u.dispose(), (m = this.leadController) == null || m.dispose(), (v = this.mListController) == null || v.dispose(), this.cssRendererController = void 0, this.installPlugins.clear(), (p = this.stats) == null || p.dom.remove(), (f = this.renderer) == null || f.domElement.remove();
|
|
3996
4005
|
}
|
|
3997
4006
|
};
|
|
3998
4007
|
_e.options = {
|
|
@@ -4017,11 +4026,11 @@ _e.options = {
|
|
|
4017
4026
|
mList: !0
|
|
4018
4027
|
};
|
|
4019
4028
|
let ot = _e;
|
|
4020
|
-
const
|
|
4029
|
+
const $i = J.ACTION;
|
|
4021
4030
|
export {
|
|
4022
4031
|
ls as BaseObject,
|
|
4023
4032
|
ot as Pencil,
|
|
4024
4033
|
Pe as ResourceTracker,
|
|
4025
|
-
|
|
4034
|
+
$i as cameraControlsAction,
|
|
4026
4035
|
ot as default
|
|
4027
4036
|
};
|