gl-draw 0.14.14 → 0.14.15
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/core/Lead/Lead.d.ts +0 -3
- package/dist/index.js +2 -2
- package/dist/index.module.js +266 -277
- package/dist/index.module2.js +368 -345
- package/dist/index2.js +5 -5
- package/package.json +1 -1
package/dist/index.module.js
CHANGED
|
@@ -2,29 +2,29 @@ var ft = Object.defineProperty, _t = Object.defineProperties;
|
|
|
2
2
|
var gt = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var Le = Object.getOwnPropertySymbols;
|
|
4
4
|
var vt = Object.prototype.hasOwnProperty, Ct = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var Se = (
|
|
5
|
+
var Se = (l, e, t) => e in l ? ft(l, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[e] = t, z = (l, e) => {
|
|
6
6
|
for (var t in e || (e = {}))
|
|
7
|
-
vt.call(e, t) && Se(
|
|
7
|
+
vt.call(e, t) && Se(l, t, e[t]);
|
|
8
8
|
if (Le)
|
|
9
9
|
for (var t of Le(e))
|
|
10
|
-
Ct.call(e, t) && Se(
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
var
|
|
14
|
-
var r = (
|
|
10
|
+
Ct.call(e, t) && Se(l, t, e[t]);
|
|
11
|
+
return l;
|
|
12
|
+
}, Q = (l, e) => _t(l, gt(e));
|
|
13
|
+
var J = (l, e, t) => new Promise((s, i) => {
|
|
14
|
+
var r = (h) => {
|
|
15
15
|
try {
|
|
16
|
-
a(t.next(
|
|
16
|
+
a(t.next(h));
|
|
17
17
|
} catch (d) {
|
|
18
18
|
i(d);
|
|
19
19
|
}
|
|
20
|
-
}, o = (
|
|
20
|
+
}, o = (h) => {
|
|
21
21
|
try {
|
|
22
|
-
a(t.throw(
|
|
22
|
+
a(t.throw(h));
|
|
23
23
|
} catch (d) {
|
|
24
24
|
i(d);
|
|
25
25
|
}
|
|
26
|
-
}, a = (
|
|
27
|
-
a((t = t.apply(
|
|
26
|
+
}, a = (h) => h.done ? s(h.value) : Promise.resolve(h.value).then(r, o);
|
|
27
|
+
a((t = t.apply(l, e)).next());
|
|
28
28
|
});
|
|
29
29
|
import * as O from "three";
|
|
30
30
|
import { Vector3 as oe, Quaternion as yt, Matrix4 as fe, UniformsUtils as Et, RawShaderMaterial as Ot } from "three";
|
|
@@ -84,69 +84,69 @@ const D = {
|
|
|
84
84
|
TOUCH_SCREEN_PAN: 131072,
|
|
85
85
|
TOUCH_DOLLY_SCREEN_PAN: 262144,
|
|
86
86
|
TOUCH_ZOOM_SCREEN_PAN: 524288
|
|
87
|
-
}),
|
|
87
|
+
}), Z = {
|
|
88
88
|
NONE: 0,
|
|
89
89
|
IN: 1,
|
|
90
90
|
OUT: -1
|
|
91
91
|
};
|
|
92
|
-
function Y(
|
|
93
|
-
return
|
|
92
|
+
function Y(l) {
|
|
93
|
+
return l.isPerspectiveCamera;
|
|
94
94
|
}
|
|
95
|
-
function j(
|
|
96
|
-
return
|
|
95
|
+
function j(l) {
|
|
96
|
+
return l.isOrthographicCamera;
|
|
97
97
|
}
|
|
98
|
-
const
|
|
99
|
-
function k(
|
|
100
|
-
return Math.max(e, Math.min(t,
|
|
98
|
+
const W = Math.PI * 2, Ue = Math.PI / 2, tt = 1e-5, ee = Math.PI / 180;
|
|
99
|
+
function k(l, e, t) {
|
|
100
|
+
return Math.max(e, Math.min(t, l));
|
|
101
101
|
}
|
|
102
|
-
function M(
|
|
103
|
-
return Math.abs(
|
|
102
|
+
function M(l, e = tt) {
|
|
103
|
+
return Math.abs(l) < e;
|
|
104
104
|
}
|
|
105
|
-
function S(
|
|
106
|
-
return M(
|
|
105
|
+
function S(l, e, t = tt) {
|
|
106
|
+
return M(l - e, t);
|
|
107
107
|
}
|
|
108
|
-
function ze(
|
|
109
|
-
return Math.round(
|
|
108
|
+
function ze(l, e) {
|
|
109
|
+
return Math.round(l / e) * e;
|
|
110
110
|
}
|
|
111
|
-
function te(
|
|
112
|
-
return isFinite(
|
|
111
|
+
function te(l) {
|
|
112
|
+
return isFinite(l) ? l : l < 0 ? -Number.MAX_VALUE : Number.MAX_VALUE;
|
|
113
113
|
}
|
|
114
|
-
function se(
|
|
115
|
-
return Math.abs(
|
|
114
|
+
function se(l) {
|
|
115
|
+
return Math.abs(l) < Number.MAX_VALUE ? l : l * (1 / 0);
|
|
116
116
|
}
|
|
117
|
-
function
|
|
117
|
+
function he(l, e, t, s, i = 1 / 0, r) {
|
|
118
118
|
s = Math.max(1e-4, s);
|
|
119
|
-
const o = 2 / s, a = o * r,
|
|
120
|
-
let d =
|
|
119
|
+
const o = 2 / s, a = o * r, h = 1 / (1 + a + 0.48 * a * a + 0.235 * a * a * a);
|
|
120
|
+
let d = l - e;
|
|
121
121
|
const f = e, p = i * s;
|
|
122
|
-
d = k(d, -p, p), e =
|
|
122
|
+
d = k(d, -p, p), e = l - d;
|
|
123
123
|
const y = (t.value + o * d) * r;
|
|
124
|
-
t.value = (t.value - o * y) *
|
|
125
|
-
let v = e + (d + y) *
|
|
126
|
-
return f -
|
|
124
|
+
t.value = (t.value - o * y) * h;
|
|
125
|
+
let v = e + (d + y) * h;
|
|
126
|
+
return f - l > 0 == v > f && (v = f, t.value = (v - f) / r), v;
|
|
127
127
|
}
|
|
128
|
-
function Fe(
|
|
128
|
+
function Fe(l, e, t, s, i = 1 / 0, r, o) {
|
|
129
129
|
s = Math.max(1e-4, s);
|
|
130
|
-
const a = 2 / s,
|
|
131
|
-
let f = e.x, p = e.y, y = e.z, v =
|
|
130
|
+
const a = 2 / s, h = a * r, d = 1 / (1 + h + 0.48 * h * h + 0.235 * h * h * h);
|
|
131
|
+
let f = e.x, p = e.y, y = e.z, v = l.x - f, m = l.y - p, u = l.z - y;
|
|
132
132
|
const _ = f, n = p, g = y, E = i * s, C = E * E, w = v * v + m * m + u * u;
|
|
133
133
|
if (w > C) {
|
|
134
134
|
const ve = Math.sqrt(w);
|
|
135
135
|
v = v / ve * E, m = m / ve * E, u = u / ve * E;
|
|
136
136
|
}
|
|
137
|
-
f =
|
|
137
|
+
f = l.x - v, p = l.y - m, y = l.z - u;
|
|
138
138
|
const T = (t.x + a * v) * r, P = (t.y + a * m) * r, R = (t.z + a * u) * r;
|
|
139
139
|
t.x = (t.x - a * T) * d, t.y = (t.y - a * P) * d, t.z = (t.z - a * R) * d, o.x = f + (v + T) * d, o.y = p + (m + P) * d, o.z = y + (u + R) * d;
|
|
140
|
-
const V = _ -
|
|
140
|
+
const V = _ - l.x, ae = n - l.y, dt = g - l.z, pt = o.x - _, mt = o.y - n, ut = o.z - g;
|
|
141
141
|
return V * pt + ae * mt + dt * ut > 0 && (o.x = _, o.y = n, o.z = g, t.x = (o.x - _) / r, t.y = (o.y - n) / r, t.z = (o.z - g) / r), o;
|
|
142
142
|
}
|
|
143
|
-
function ye(
|
|
144
|
-
e.set(0, 0),
|
|
143
|
+
function ye(l, e) {
|
|
144
|
+
e.set(0, 0), l.forEach((t) => {
|
|
145
145
|
e.x += t.clientX, e.y += t.clientY;
|
|
146
|
-
}), e.x /=
|
|
146
|
+
}), e.x /= l.length, e.y /= l.length;
|
|
147
147
|
}
|
|
148
|
-
function Ee(
|
|
149
|
-
return j(
|
|
148
|
+
function Ee(l, e) {
|
|
149
|
+
return j(l) ? (console.warn(`${e} is not supported in OrthographicCamera`), !0) : !1;
|
|
150
150
|
}
|
|
151
151
|
class Bt {
|
|
152
152
|
constructor() {
|
|
@@ -212,9 +212,9 @@ class Bt {
|
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
|
-
const
|
|
216
|
-
let x, ke, ce, Oe,
|
|
217
|
-
class
|
|
215
|
+
const le = 1 / 8, Zt = /Mac/.test(navigator.platform);
|
|
216
|
+
let x, ke, ce, Oe, U, b, L, G, ie, N, H, B, Ne, He, F, re, K, Ie, Te, je, xe, we, de;
|
|
217
|
+
class $ extends Bt {
|
|
218
218
|
/**
|
|
219
219
|
* Injects THREE as the dependency. You can then proceed to use CameraControls.
|
|
220
220
|
*
|
|
@@ -256,7 +256,7 @@ class J extends Bt {
|
|
|
256
256
|
* @category Statics
|
|
257
257
|
*/
|
|
258
258
|
static install(e) {
|
|
259
|
-
x = e.THREE, ke = Object.freeze(new x.Vector3(0, 0, 0)), ce = Object.freeze(new x.Vector3(0, 1, 0)), Oe = Object.freeze(new x.Vector3(0, 0, 1)),
|
|
259
|
+
x = e.THREE, ke = Object.freeze(new x.Vector3(0, 0, 0)), ce = Object.freeze(new x.Vector3(0, 1, 0)), Oe = Object.freeze(new x.Vector3(0, 0, 1)), U = new x.Vector2(), b = new x.Vector3(), L = new x.Vector3(), G = new x.Vector3(), ie = new x.Vector3(), N = new x.Vector3(), H = new x.Vector3(), B = new x.Vector3(), Ne = new x.Vector3(), He = new x.Vector3(), F = new x.Spherical(), re = new x.Spherical(), K = new x.Box3(), Ie = new x.Box3(), Te = new x.Sphere(), je = new x.Quaternion(), xe = new x.Quaternion(), we = new x.Matrix4(), de = new x.Raycaster();
|
|
260
260
|
}
|
|
261
261
|
/**
|
|
262
262
|
* list all ACTIONs
|
|
@@ -284,7 +284,7 @@ class J extends Bt {
|
|
|
284
284
|
*/
|
|
285
285
|
constructor(e, t) {
|
|
286
286
|
super(), this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.minDistance = Number.EPSILON, this.maxDistance = 1 / 0, this.infinityDolly = !1, this.minZoom = 0.01, this.maxZoom = 1 / 0, this.smoothTime = 0.25, this.draggingSmoothTime = 0.125, this.maxSpeed = 1 / 0, this.azimuthRotateSpeed = 1, this.polarRotateSpeed = 1, this.dollySpeed = 1, this.dollyDragInverted = !1, this.truckSpeed = 2, this.dollyToCursor = !1, this.dragToOffset = !1, this.boundaryFriction = 0, this.restThreshold = 0.01, this.colliderMeshes = [], this.cancel = () => {
|
|
287
|
-
}, this._enabled = !0, this._state = c.NONE, this._viewport = null, this._changedDolly = 0, this._changedZoom = 0, this._hasRested = !0, this._boundaryEnclosesCamera = !1, this._needsUpdate = !0, this._updatedLastTime = !1, this._elementRect = new DOMRect(), this._isDragging = !1, this._dragNeedsUpdate = !0, this._activePointers = [], this._lockedPointer = null, this._interactiveArea = new DOMRect(0, 0, 1, 1), this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._isUserControllingOffset = !1, this._isUserControllingZoom = !1, this._lastDollyDirection =
|
|
287
|
+
}, this._enabled = !0, this._state = c.NONE, this._viewport = null, this._changedDolly = 0, this._changedZoom = 0, this._hasRested = !0, this._boundaryEnclosesCamera = !1, this._needsUpdate = !0, this._updatedLastTime = !1, this._elementRect = new DOMRect(), this._isDragging = !1, this._dragNeedsUpdate = !0, this._activePointers = [], this._lockedPointer = null, this._interactiveArea = new DOMRect(0, 0, 1, 1), this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._isUserControllingOffset = !1, this._isUserControllingZoom = !1, this._lastDollyDirection = Z.NONE, this._thetaVelocity = { value: 0 }, this._phiVelocity = { value: 0 }, this._radiusVelocity = { value: 0 }, this._targetVelocity = new x.Vector3(), this._focalOffsetVelocity = new x.Vector3(), this._zoomVelocity = { value: 0 }, this._truckInternal = (n, g, E, C) => {
|
|
288
288
|
let w, T;
|
|
289
289
|
if (Y(this._camera)) {
|
|
290
290
|
const P = b.copy(this._camera.position).sub(this._target), R = this._camera.getEffectiveFOV() * ee, V = P.length() * Math.tan(R * 0.5);
|
|
@@ -306,7 +306,7 @@ class J extends Bt {
|
|
|
306
306
|
!0
|
|
307
307
|
) : this.truck(w, T, !0);
|
|
308
308
|
}, this._rotateInternal = (n, g) => {
|
|
309
|
-
const E =
|
|
309
|
+
const E = W * this.azimuthRotateSpeed * n / this._elementRect.height, C = W * this.polarRotateSpeed * g / this._elementRect.height;
|
|
310
310
|
this.rotate(E, C, !0);
|
|
311
311
|
}, this._dollyInternal = (n, g, E) => {
|
|
312
312
|
const C = Math.pow(0.95, -n * this.dollySpeed), w = this._sphericalEnd.radius, T = this._sphericalEnd.radius * C, P = k(
|
|
@@ -371,12 +371,12 @@ class J extends Bt {
|
|
|
371
371
|
{ passive: !1 }
|
|
372
372
|
), this._domElement.ownerDocument.removeEventListener(
|
|
373
373
|
"pointerup",
|
|
374
|
-
|
|
374
|
+
h
|
|
375
375
|
), this._domElement.ownerDocument.addEventListener(
|
|
376
376
|
"pointermove",
|
|
377
377
|
a,
|
|
378
378
|
{ passive: !1 }
|
|
379
|
-
), this._domElement.ownerDocument.addEventListener("pointerup",
|
|
379
|
+
), this._domElement.ownerDocument.addEventListener("pointerup", h), this._isDragging = !0, y(n);
|
|
380
380
|
}, a = (n) => {
|
|
381
381
|
n.cancelable && n.preventDefault();
|
|
382
382
|
const g = n.pointerId, E = this._lockedPointer || this._findPointerById(g);
|
|
@@ -397,7 +397,7 @@ class J extends Bt {
|
|
|
397
397
|
(!this._isDragging && this._lockedPointer || this._isDragging && (n.buttons & D.LEFT) === D.LEFT) && (this._state = this._state | this.mouseButtons.left), this._isDragging && (n.buttons & D.MIDDLE) === D.MIDDLE && (this._state = this._state | this.mouseButtons.middle), this._isDragging && (n.buttons & D.RIGHT) === D.RIGHT && (this._state = this._state | this.mouseButtons.right);
|
|
398
398
|
v();
|
|
399
399
|
}
|
|
400
|
-
},
|
|
400
|
+
}, h = (n) => {
|
|
401
401
|
const g = this._findPointerById(n.pointerId);
|
|
402
402
|
if (!(g && g === this._lockedPointer)) {
|
|
403
403
|
if (g && this._disposePointer(g), n.pointerType === "touch")
|
|
@@ -462,7 +462,7 @@ class J extends Bt {
|
|
|
462
462
|
this.dispatchEvent({ type: "control" });
|
|
463
463
|
}, p = (n) => {
|
|
464
464
|
if (!(!this._domElement || !this._enabled)) {
|
|
465
|
-
if (this.mouseButtons.right ===
|
|
465
|
+
if (this.mouseButtons.right === $.ACTION.NONE) {
|
|
466
466
|
const g = n instanceof PointerEvent ? n.pointerId : 0, E = this._findPointerById(g);
|
|
467
467
|
E && this._disposePointer(E), this._domElement.ownerDocument.removeEventListener(
|
|
468
468
|
"pointermove",
|
|
@@ -470,7 +470,7 @@ class J extends Bt {
|
|
|
470
470
|
{ passive: !1 }
|
|
471
471
|
), this._domElement.ownerDocument.removeEventListener(
|
|
472
472
|
"pointerup",
|
|
473
|
-
|
|
473
|
+
h
|
|
474
474
|
);
|
|
475
475
|
return;
|
|
476
476
|
}
|
|
@@ -478,8 +478,8 @@ class J extends Bt {
|
|
|
478
478
|
}
|
|
479
479
|
}, y = (n) => {
|
|
480
480
|
if (!this._enabled) return;
|
|
481
|
-
if (ye(this._activePointers,
|
|
482
|
-
const E =
|
|
481
|
+
if (ye(this._activePointers, U), this._getClientRect(this._elementRect), s.copy(U), i.copy(U), this._activePointers.length >= 2) {
|
|
482
|
+
const E = U.x - this._activePointers[1].clientX, C = U.y - this._activePointers[1].clientY, w = Math.sqrt(E * E + C * C);
|
|
483
483
|
r.set(0, w);
|
|
484
484
|
const T = (this._activePointers[0].clientX + this._activePointers[1].clientX) * 0.5, P = (this._activePointers[0].clientY + this._activePointers[1].clientY) * 0.5;
|
|
485
485
|
i.set(T, P);
|
|
@@ -503,35 +503,35 @@ class J extends Bt {
|
|
|
503
503
|
((this._state & c.ROTATE) === c.ROTATE || (this._state & c.TOUCH_ROTATE) === c.TOUCH_ROTATE || (this._state & c.TOUCH_DOLLY_ROTATE) === c.TOUCH_DOLLY_ROTATE || (this._state & c.TOUCH_ZOOM_ROTATE) === c.TOUCH_ZOOM_ROTATE) && (this._sphericalEnd.theta = this._spherical.theta, this._sphericalEnd.phi = this._spherical.phi, this._thetaVelocity.value = 0, this._phiVelocity.value = 0), ((this._state & c.TRUCK) === c.TRUCK || (this._state & c.SCREEN_PAN) === c.SCREEN_PAN || (this._state & c.TOUCH_TRUCK) === c.TOUCH_TRUCK || (this._state & c.TOUCH_SCREEN_PAN) === c.TOUCH_SCREEN_PAN || (this._state & c.TOUCH_DOLLY_TRUCK) === c.TOUCH_DOLLY_TRUCK || (this._state & c.TOUCH_DOLLY_SCREEN_PAN) === c.TOUCH_DOLLY_SCREEN_PAN || (this._state & c.TOUCH_ZOOM_TRUCK) === c.TOUCH_ZOOM_TRUCK || (this._state & c.TOUCH_ZOOM_SCREEN_PAN) === c.TOUCH_DOLLY_SCREEN_PAN) && (this._targetEnd.copy(this._target), this._targetVelocity.set(0, 0, 0)), ((this._state & c.DOLLY) === c.DOLLY || (this._state & c.TOUCH_DOLLY) === c.TOUCH_DOLLY || (this._state & c.TOUCH_DOLLY_TRUCK) === c.TOUCH_DOLLY_TRUCK || (this._state & c.TOUCH_DOLLY_SCREEN_PAN) === c.TOUCH_DOLLY_SCREEN_PAN || (this._state & c.TOUCH_DOLLY_OFFSET) === c.TOUCH_DOLLY_OFFSET || (this._state & c.TOUCH_DOLLY_ROTATE) === c.TOUCH_DOLLY_ROTATE) && (this._sphericalEnd.radius = this._spherical.radius, this._radiusVelocity.value = 0), ((this._state & c.ZOOM) === c.ZOOM || (this._state & c.TOUCH_ZOOM) === c.TOUCH_ZOOM || (this._state & c.TOUCH_ZOOM_TRUCK) === c.TOUCH_ZOOM_TRUCK || (this._state & c.TOUCH_ZOOM_SCREEN_PAN) === c.TOUCH_ZOOM_SCREEN_PAN || (this._state & c.TOUCH_ZOOM_OFFSET) === c.TOUCH_ZOOM_OFFSET || (this._state & c.TOUCH_ZOOM_ROTATE) === c.TOUCH_ZOOM_ROTATE) && (this._zoomEnd = this._zoom, this._zoomVelocity.value = 0), ((this._state & c.OFFSET) === c.OFFSET || (this._state & c.TOUCH_OFFSET) === c.TOUCH_OFFSET || (this._state & c.TOUCH_DOLLY_OFFSET) === c.TOUCH_DOLLY_OFFSET || (this._state & c.TOUCH_ZOOM_OFFSET) === c.TOUCH_ZOOM_OFFSET) && (this._focalOffsetEnd.copy(this._focalOffset), this._focalOffsetVelocity.set(0, 0, 0)), this.dispatchEvent({ type: "controlstart" });
|
|
504
504
|
}, v = () => {
|
|
505
505
|
if (!this._enabled || !this._dragNeedsUpdate) return;
|
|
506
|
-
this._dragNeedsUpdate = !1, ye(this._activePointers,
|
|
507
|
-
const g = this._domElement && this._domElement.ownerDocument.pointerLockElement === this._domElement ? this._lockedPointer || this._activePointers[0] : null, E = g ? -g.deltaX : i.x -
|
|
508
|
-
if (i.copy(
|
|
506
|
+
this._dragNeedsUpdate = !1, ye(this._activePointers, U);
|
|
507
|
+
const g = this._domElement && this._domElement.ownerDocument.pointerLockElement === this._domElement ? this._lockedPointer || this._activePointers[0] : null, E = g ? -g.deltaX : i.x - U.x, C = g ? -g.deltaY : i.y - U.y;
|
|
508
|
+
if (i.copy(U), ((this._state & c.ROTATE) === c.ROTATE || (this._state & c.TOUCH_ROTATE) === c.TOUCH_ROTATE || (this._state & c.TOUCH_DOLLY_ROTATE) === c.TOUCH_DOLLY_ROTATE || (this._state & c.TOUCH_ZOOM_ROTATE) === c.TOUCH_ZOOM_ROTATE) && (this._rotateInternal(E, C), this._isUserControllingRotate = !0), (this._state & c.DOLLY) === c.DOLLY || (this._state & c.ZOOM) === c.ZOOM) {
|
|
509
509
|
const w = this.dollyToCursor ? (s.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, T = this.dollyToCursor ? (s.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0, P = this.dollyDragInverted ? -1 : 1;
|
|
510
510
|
(this._state & c.DOLLY) === c.DOLLY ? (this._dollyInternal(
|
|
511
|
-
P * C *
|
|
511
|
+
P * C * le,
|
|
512
512
|
w,
|
|
513
513
|
T
|
|
514
514
|
), this._isUserControllingDolly = !0) : (this._zoomInternal(
|
|
515
|
-
P * C *
|
|
515
|
+
P * C * le,
|
|
516
516
|
w,
|
|
517
517
|
T
|
|
518
518
|
), this._isUserControllingZoom = !0);
|
|
519
519
|
}
|
|
520
520
|
if ((this._state & c.TOUCH_DOLLY) === c.TOUCH_DOLLY || (this._state & c.TOUCH_ZOOM) === c.TOUCH_ZOOM || (this._state & c.TOUCH_DOLLY_TRUCK) === c.TOUCH_DOLLY_TRUCK || (this._state & c.TOUCH_ZOOM_TRUCK) === c.TOUCH_ZOOM_TRUCK || (this._state & c.TOUCH_DOLLY_SCREEN_PAN) === c.TOUCH_DOLLY_SCREEN_PAN || (this._state & c.TOUCH_ZOOM_SCREEN_PAN) === c.TOUCH_ZOOM_SCREEN_PAN || (this._state & c.TOUCH_DOLLY_OFFSET) === c.TOUCH_DOLLY_OFFSET || (this._state & c.TOUCH_ZOOM_OFFSET) === c.TOUCH_ZOOM_OFFSET || (this._state & c.TOUCH_DOLLY_ROTATE) === c.TOUCH_DOLLY_ROTATE || (this._state & c.TOUCH_ZOOM_ROTATE) === c.TOUCH_ZOOM_ROTATE) {
|
|
521
|
-
const w =
|
|
521
|
+
const w = U.x - this._activePointers[1].clientX, T = U.y - this._activePointers[1].clientY, P = Math.sqrt(w * w + T * T), R = r.y - P;
|
|
522
522
|
r.set(0, P);
|
|
523
523
|
const V = this.dollyToCursor ? (i.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, ae = this.dollyToCursor ? (i.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
|
|
524
|
-
(this._state & c.TOUCH_DOLLY) === c.TOUCH_DOLLY || (this._state & c.TOUCH_DOLLY_ROTATE) === c.TOUCH_DOLLY_ROTATE || (this._state & c.TOUCH_DOLLY_TRUCK) === c.TOUCH_DOLLY_TRUCK || (this._state & c.TOUCH_DOLLY_SCREEN_PAN) === c.TOUCH_DOLLY_SCREEN_PAN || (this._state & c.TOUCH_DOLLY_OFFSET) === c.TOUCH_DOLLY_OFFSET ? (this._dollyInternal(R *
|
|
524
|
+
(this._state & c.TOUCH_DOLLY) === c.TOUCH_DOLLY || (this._state & c.TOUCH_DOLLY_ROTATE) === c.TOUCH_DOLLY_ROTATE || (this._state & c.TOUCH_DOLLY_TRUCK) === c.TOUCH_DOLLY_TRUCK || (this._state & c.TOUCH_DOLLY_SCREEN_PAN) === c.TOUCH_DOLLY_SCREEN_PAN || (this._state & c.TOUCH_DOLLY_OFFSET) === c.TOUCH_DOLLY_OFFSET ? (this._dollyInternal(R * le, V, ae), this._isUserControllingDolly = !0) : (this._zoomInternal(R * le, V, ae), this._isUserControllingZoom = !0);
|
|
525
525
|
}
|
|
526
526
|
((this._state & c.TRUCK) === c.TRUCK || (this._state & c.TOUCH_TRUCK) === c.TOUCH_TRUCK || (this._state & c.TOUCH_DOLLY_TRUCK) === c.TOUCH_DOLLY_TRUCK || (this._state & c.TOUCH_ZOOM_TRUCK) === c.TOUCH_ZOOM_TRUCK) && (this._truckInternal(E, C, !1, !1), this._isUserControllingTruck = !0), ((this._state & c.SCREEN_PAN) === c.SCREEN_PAN || (this._state & c.TOUCH_SCREEN_PAN) === c.TOUCH_SCREEN_PAN || (this._state & c.TOUCH_DOLLY_SCREEN_PAN) === c.TOUCH_DOLLY_SCREEN_PAN || (this._state & c.TOUCH_ZOOM_SCREEN_PAN) === c.TOUCH_ZOOM_SCREEN_PAN) && (this._truckInternal(E, C, !1, !0), this._isUserControllingTruck = !0), ((this._state & c.OFFSET) === c.OFFSET || (this._state & c.TOUCH_OFFSET) === c.TOUCH_OFFSET || (this._state & c.TOUCH_DOLLY_OFFSET) === c.TOUCH_DOLLY_OFFSET || (this._state & c.TOUCH_ZOOM_OFFSET) === c.TOUCH_ZOOM_OFFSET) && (this._truckInternal(E, C, !0, !1), this._isUserControllingOffset = !0), this.dispatchEvent({ type: "control" });
|
|
527
527
|
}, m = () => {
|
|
528
|
-
ye(this._activePointers,
|
|
528
|
+
ye(this._activePointers, U), i.copy(U), 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(
|
|
529
529
|
"pointermove",
|
|
530
530
|
a,
|
|
531
531
|
{ passive: !1 }
|
|
532
532
|
), this._domElement.ownerDocument.removeEventListener(
|
|
533
533
|
"pointerup",
|
|
534
|
-
|
|
534
|
+
h
|
|
535
535
|
), this.dispatchEvent({ type: "controlend" }));
|
|
536
536
|
};
|
|
537
537
|
this.lockPointer = () => {
|
|
@@ -548,7 +548,7 @@ class J extends Bt {
|
|
|
548
548
|
{ passive: !1 }
|
|
549
549
|
), this._domElement.ownerDocument.removeEventListener(
|
|
550
550
|
"pointerup",
|
|
551
|
-
|
|
551
|
+
h
|
|
552
552
|
), this._domElement.requestPointerLock(), this._domElement.ownerDocument.addEventListener(
|
|
553
553
|
"pointerlockchange",
|
|
554
554
|
u
|
|
@@ -559,7 +559,7 @@ class J extends Bt {
|
|
|
559
559
|
"pointermove",
|
|
560
560
|
a,
|
|
561
561
|
{ passive: !1 }
|
|
562
|
-
), this._domElement.ownerDocument.addEventListener("pointerup",
|
|
562
|
+
), this._domElement.ownerDocument.addEventListener("pointerup", h), y());
|
|
563
563
|
}, this.unlockPointer = () => {
|
|
564
564
|
var n, g, E;
|
|
565
565
|
this._lockedPointer !== null && (this._disposePointer(this._lockedPointer), this._lockedPointer = null), (n = this._domElement) === null || n === void 0 || n.ownerDocument.exitPointerLock(), (g = this._domElement) === null || g === void 0 || g.ownerDocument.removeEventListener(
|
|
@@ -576,11 +576,11 @@ class J extends Bt {
|
|
|
576
576
|
this.unlockPointer();
|
|
577
577
|
};
|
|
578
578
|
this._addAllEventListeners = (n) => {
|
|
579
|
-
this._domElement = n, this._domElement.style.touchAction = "none", this._domElement.style.userSelect = "none", this._domElement.style.webkitUserSelect = "none", this._domElement.addEventListener("pointerdown", o), this._domElement.addEventListener("pointercancel",
|
|
579
|
+
this._domElement = n, this._domElement.style.touchAction = "none", this._domElement.style.userSelect = "none", this._domElement.style.webkitUserSelect = "none", this._domElement.addEventListener("pointerdown", o), this._domElement.addEventListener("pointercancel", h), this._domElement.addEventListener("wheel", f, {
|
|
580
580
|
passive: !1
|
|
581
581
|
}), this._domElement.addEventListener("contextmenu", p);
|
|
582
582
|
}, this._removeAllEventListeners = () => {
|
|
583
|
-
this._domElement && (this._domElement.style.touchAction = "", this._domElement.style.userSelect = "", this._domElement.style.webkitUserSelect = "", this._domElement.removeEventListener("pointerdown", o), this._domElement.removeEventListener("pointercancel",
|
|
583
|
+
this._domElement && (this._domElement.style.touchAction = "", this._domElement.style.userSelect = "", this._domElement.style.webkitUserSelect = "", this._domElement.removeEventListener("pointerdown", o), this._domElement.removeEventListener("pointercancel", h), this._domElement.removeEventListener("wheel", f, {
|
|
584
584
|
passive: !1
|
|
585
585
|
}), this._domElement.removeEventListener("contextmenu", p), this._domElement.ownerDocument.removeEventListener(
|
|
586
586
|
"pointermove",
|
|
@@ -588,7 +588,7 @@ class J extends Bt {
|
|
|
588
588
|
{ passive: !1 }
|
|
589
589
|
), this._domElement.ownerDocument.removeEventListener(
|
|
590
590
|
"pointerup",
|
|
591
|
-
|
|
591
|
+
h
|
|
592
592
|
), this._domElement.ownerDocument.removeEventListener(
|
|
593
593
|
"pointerlockchange",
|
|
594
594
|
u
|
|
@@ -862,7 +862,7 @@ class J extends Bt {
|
|
|
862
862
|
* @category Methods
|
|
863
863
|
*/
|
|
864
864
|
dollyTo(e, t = !1) {
|
|
865
|
-
return this._isUserControllingDolly = !1, this._lastDollyDirection =
|
|
865
|
+
return this._isUserControllingDolly = !1, this._lastDollyDirection = Z.NONE, this._changedDolly = 0, this._dollyToNoClamp(
|
|
866
866
|
k(e, this.minDistance, this.maxDistance),
|
|
867
867
|
t
|
|
868
868
|
);
|
|
@@ -1022,12 +1022,12 @@ class J extends Bt {
|
|
|
1022
1022
|
paddingBottom: o = 0,
|
|
1023
1023
|
paddingTop: a = 0
|
|
1024
1024
|
} = {}) {
|
|
1025
|
-
const
|
|
1025
|
+
const h = [], d = e.isBox3 ? K.copy(e) : K.setFromObject(e);
|
|
1026
1026
|
d.isEmpty() && (console.warn(
|
|
1027
1027
|
"camera-controls: fitTo() cannot be used with an empty box. Aborting"
|
|
1028
1028
|
), Promise.resolve());
|
|
1029
1029
|
const f = ze(this._sphericalEnd.theta, Ue), p = ze(this._sphericalEnd.phi, Ue);
|
|
1030
|
-
|
|
1030
|
+
h.push(this.rotateTo(f, p, t));
|
|
1031
1031
|
const y = b.setFromSpherical(this._sphericalEnd).normalize(), v = je.setFromUnitVectors(y, Oe), m = S(Math.abs(y.y), 1);
|
|
1032
1032
|
m && v.multiply(xe.setFromAxisAngle(ce, f)), v.multiply(this._yAxisUpSpaceInverse);
|
|
1033
1033
|
const u = Ie.makeEmpty();
|
|
@@ -1040,16 +1040,16 @@ class J extends Bt {
|
|
|
1040
1040
|
_.z,
|
|
1041
1041
|
s
|
|
1042
1042
|
);
|
|
1043
|
-
|
|
1043
|
+
h.push(
|
|
1044
1044
|
this.moveTo(n.x, n.y, n.z, t)
|
|
1045
|
-
),
|
|
1045
|
+
), h.push(this.dollyTo(g, t)), h.push(this.setFocalOffset(0, 0, 0, t));
|
|
1046
1046
|
} else if (j(this._camera)) {
|
|
1047
1047
|
const g = this._camera, E = g.right - g.left, C = g.top - g.bottom, w = s ? Math.max(E / _.x, C / _.y) : Math.min(E / _.x, C / _.y);
|
|
1048
|
-
|
|
1048
|
+
h.push(
|
|
1049
1049
|
this.moveTo(n.x, n.y, n.z, t)
|
|
1050
|
-
),
|
|
1050
|
+
), h.push(this.zoomTo(w, t)), h.push(this.setFocalOffset(0, 0, 0, t));
|
|
1051
1051
|
}
|
|
1052
|
-
return Promise.all(
|
|
1052
|
+
return Promise.all(h);
|
|
1053
1053
|
}
|
|
1054
1054
|
/**
|
|
1055
1055
|
* Fit the viewport to the sphere or the bounding sphere of the object.
|
|
@@ -1058,7 +1058,7 @@ class J extends Bt {
|
|
|
1058
1058
|
* @category Methods
|
|
1059
1059
|
*/
|
|
1060
1060
|
fitToSphere(e, t) {
|
|
1061
|
-
const s = [], r = "isObject3D" in e ?
|
|
1061
|
+
const s = [], r = "isObject3D" in e ? $.createBoundingSphere(e, Te) : Te.copy(e);
|
|
1062
1062
|
if (s.push(
|
|
1063
1063
|
this.moveTo(
|
|
1064
1064
|
r.center.x,
|
|
@@ -1070,7 +1070,7 @@ class J extends Bt {
|
|
|
1070
1070
|
const o = this.getDistanceToFitSphere(r.radius);
|
|
1071
1071
|
s.push(this.dollyTo(o, t));
|
|
1072
1072
|
} else if (j(this._camera)) {
|
|
1073
|
-
const o = this._camera.right - this._camera.left, a = this._camera.top - this._camera.bottom,
|
|
1073
|
+
const o = this._camera.right - this._camera.left, a = this._camera.top - this._camera.bottom, h = 2 * r.radius, d = Math.min(o / h, a / h);
|
|
1074
1074
|
s.push(this.zoomTo(d, t));
|
|
1075
1075
|
}
|
|
1076
1076
|
return s.push(this.setFocalOffset(0, 0, 0, t)), Promise.all(s);
|
|
@@ -1087,10 +1087,10 @@ class J extends Bt {
|
|
|
1087
1087
|
* @category Methods
|
|
1088
1088
|
*/
|
|
1089
1089
|
setLookAt(e, t, s, i, r, o, a = !1) {
|
|
1090
|
-
this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._lastDollyDirection =
|
|
1091
|
-
const
|
|
1092
|
-
this._targetEnd.copy(
|
|
1093
|
-
d.sub(
|
|
1090
|
+
this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._lastDollyDirection = Z.NONE, this._changedDolly = 0;
|
|
1091
|
+
const h = L.set(i, r, o), d = b.set(e, t, s);
|
|
1092
|
+
this._targetEnd.copy(h), this._sphericalEnd.setFromVector3(
|
|
1093
|
+
d.sub(h).applyQuaternion(this._yAxisUpSpace)
|
|
1094
1094
|
), this.normalizeRotations(), this._needsUpdate = !0, a || (this._target.copy(this._targetEnd), this._spherical.copy(this._sphericalEnd));
|
|
1095
1095
|
const f = !a || S(this._target.x, this._targetEnd.x, this.restThreshold) && S(this._target.y, this._targetEnd.y, this.restThreshold) && S(this._target.z, this._targetEnd.z, this.restThreshold) && S(
|
|
1096
1096
|
this._spherical.theta,
|
|
@@ -1125,13 +1125,13 @@ class J extends Bt {
|
|
|
1125
1125
|
* @param enableTransition
|
|
1126
1126
|
* @category Methods
|
|
1127
1127
|
*/
|
|
1128
|
-
lerpLookAt(e, t, s, i, r, o, a,
|
|
1129
|
-
this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._lastDollyDirection =
|
|
1128
|
+
lerpLookAt(e, t, s, i, r, o, a, h, d, f, p, y, v, m = !1) {
|
|
1129
|
+
this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._lastDollyDirection = Z.NONE, this._changedDolly = 0;
|
|
1130
1130
|
const u = b.set(i, r, o), _ = L.set(e, t, s);
|
|
1131
1131
|
F.setFromVector3(
|
|
1132
1132
|
_.sub(u).applyQuaternion(this._yAxisUpSpace)
|
|
1133
1133
|
);
|
|
1134
|
-
const n =
|
|
1134
|
+
const n = G.set(f, p, y), g = L.set(a, h, d);
|
|
1135
1135
|
re.setFromVector3(
|
|
1136
1136
|
g.sub(n).applyQuaternion(this._yAxisUpSpace)
|
|
1137
1137
|
), this._targetEnd.copy(u.lerp(n, v));
|
|
@@ -1336,7 +1336,7 @@ class J extends Bt {
|
|
|
1336
1336
|
* @category Methods
|
|
1337
1337
|
*/
|
|
1338
1338
|
normalizeRotations() {
|
|
1339
|
-
this._sphericalEnd.theta = this._sphericalEnd.theta %
|
|
1339
|
+
this._sphericalEnd.theta = this._sphericalEnd.theta % W, this._sphericalEnd.theta < 0 && (this._sphericalEnd.theta += W), this._spherical.theta += W * Math.round((this._sphericalEnd.theta - this._spherical.theta) / W);
|
|
1340
1340
|
}
|
|
1341
1341
|
/**
|
|
1342
1342
|
* stop all transitions.
|
|
@@ -1417,7 +1417,7 @@ class J extends Bt {
|
|
|
1417
1417
|
this._thetaVelocity.value = 0, this._spherical.theta = this._sphericalEnd.theta;
|
|
1418
1418
|
else {
|
|
1419
1419
|
const p = this._isUserControllingRotate ? this.draggingSmoothTime : this.smoothTime;
|
|
1420
|
-
this._spherical.theta =
|
|
1420
|
+
this._spherical.theta = he(
|
|
1421
1421
|
this._spherical.theta,
|
|
1422
1422
|
this._sphericalEnd.theta,
|
|
1423
1423
|
this._thetaVelocity,
|
|
@@ -1430,7 +1430,7 @@ class J extends Bt {
|
|
|
1430
1430
|
this._phiVelocity.value = 0, this._spherical.phi = this._sphericalEnd.phi;
|
|
1431
1431
|
else {
|
|
1432
1432
|
const p = this._isUserControllingRotate ? this.draggingSmoothTime : this.smoothTime;
|
|
1433
|
-
this._spherical.phi =
|
|
1433
|
+
this._spherical.phi = he(
|
|
1434
1434
|
this._spherical.phi,
|
|
1435
1435
|
this._sphericalEnd.phi,
|
|
1436
1436
|
this._phiVelocity,
|
|
@@ -1443,7 +1443,7 @@ class J extends Bt {
|
|
|
1443
1443
|
this._radiusVelocity.value = 0, this._spherical.radius = this._sphericalEnd.radius;
|
|
1444
1444
|
else {
|
|
1445
1445
|
const p = this._isUserControllingDolly ? this.draggingSmoothTime : this.smoothTime;
|
|
1446
|
-
this._spherical.radius =
|
|
1446
|
+
this._spherical.radius = he(
|
|
1447
1447
|
this._spherical.radius,
|
|
1448
1448
|
this._sphericalEnd.radius,
|
|
1449
1449
|
this._radiusVelocity,
|
|
@@ -1484,7 +1484,7 @@ class J extends Bt {
|
|
|
1484
1484
|
this._zoomVelocity.value = 0, this._zoom = this._zoomEnd;
|
|
1485
1485
|
else {
|
|
1486
1486
|
const p = this._isUserControllingZoom ? this.draggingSmoothTime : this.smoothTime;
|
|
1487
|
-
this._zoom =
|
|
1487
|
+
this._zoom = he(
|
|
1488
1488
|
this._zoom,
|
|
1489
1489
|
this._zoomEnd,
|
|
1490
1490
|
this._zoomVelocity,
|
|
@@ -1497,13 +1497,13 @@ class J extends Bt {
|
|
|
1497
1497
|
if (Y(this._camera) && this._changedDolly !== 0) {
|
|
1498
1498
|
const p = this._spherical.radius - this._lastDistance, y = this._camera, v = this._getCameraDirection(ie), m = b.copy(v).cross(y.up).normalize();
|
|
1499
1499
|
m.lengthSq() === 0 && (m.x = 1);
|
|
1500
|
-
const u = L.crossVectors(m, v), _ = this._sphericalEnd.radius * Math.tan(y.getEffectiveFOV() * ee * 0.5), g = (this._sphericalEnd.radius - p - this._sphericalEnd.radius) / this._sphericalEnd.radius, E =
|
|
1500
|
+
const u = L.crossVectors(m, v), _ = this._sphericalEnd.radius * Math.tan(y.getEffectiveFOV() * ee * 0.5), g = (this._sphericalEnd.radius - p - this._sphericalEnd.radius) / this._sphericalEnd.radius, E = G.copy(this._targetEnd).add(
|
|
1501
1501
|
m.multiplyScalar(
|
|
1502
1502
|
this._dollyControlCoord.x * _ * y.aspect
|
|
1503
1503
|
)
|
|
1504
1504
|
).add(
|
|
1505
1505
|
u.multiplyScalar(this._dollyControlCoord.y * _)
|
|
1506
|
-
), C = b.copy(this._targetEnd).lerp(E, g), w = this._lastDollyDirection ===
|
|
1506
|
+
), C = b.copy(this._targetEnd).lerp(E, g), w = this._lastDollyDirection === Z.IN && this._spherical.radius <= this.minDistance, T = this._lastDollyDirection === Z.OUT && this.maxDistance <= this._spherical.radius;
|
|
1507
1507
|
if (this.infinityDolly && (w || T)) {
|
|
1508
1508
|
this._sphericalEnd.radius -= p, this._spherical.radius -= p;
|
|
1509
1509
|
const R = L.copy(v).multiplyScalar(-p);
|
|
@@ -1517,7 +1517,7 @@ class J extends Bt {
|
|
|
1517
1517
|
this._dollyControlCoord.x,
|
|
1518
1518
|
this._dollyControlCoord.y,
|
|
1519
1519
|
(y.near + y.far) / (y.near - y.far)
|
|
1520
|
-
).unproject(y), m = L.set(0, 0, -1).applyQuaternion(y.quaternion), u =
|
|
1520
|
+
).unproject(y), m = L.set(0, 0, -1).applyQuaternion(y.quaternion), u = G.copy(v).add(m.multiplyScalar(-v.dot(y.up))), n = -(this._zoom - p - this._zoom) / this._zoom, g = this._getCameraDirection(ie), E = this._targetEnd.dot(g), C = b.copy(this._targetEnd).lerp(u, n), w = C.dot(g), T = g.multiplyScalar(
|
|
1521
1521
|
w - E
|
|
1522
1522
|
);
|
|
1523
1523
|
C.sub(T), this._boundary.clampPoint(C, C);
|
|
@@ -1526,8 +1526,8 @@ class J extends Bt {
|
|
|
1526
1526
|
}
|
|
1527
1527
|
}
|
|
1528
1528
|
this._camera.zoom !== this._zoom && (this._camera.zoom = this._zoom, this._camera.updateProjectionMatrix(), this._updateNearPlaneCorners(), this._needsUpdate = !0), this._dragNeedsUpdate = !0;
|
|
1529
|
-
const
|
|
1530
|
-
this._spherical.radius = Math.min(this._spherical.radius,
|
|
1529
|
+
const h = this._collisionTest();
|
|
1530
|
+
this._spherical.radius = Math.min(this._spherical.radius, h), this._spherical.makeSafe(), this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target), this._camera.lookAt(this._target), (!M(this._focalOffset.x) || !M(this._focalOffset.y) || !M(this._focalOffset.z)) && (N.setFromMatrixColumn(this._camera.matrix, 0), H.setFromMatrixColumn(this._camera.matrix, 1), B.setFromMatrixColumn(this._camera.matrix, 2), N.multiplyScalar(this._focalOffset.x), H.multiplyScalar(-this._focalOffset.y), B.multiplyScalar(this._focalOffset.z), b.copy(N).add(H).add(B), this._camera.position.add(b), this._camera.updateMatrixWorld()), this._boundaryEnclosesCamera && this._encloseToBoundary(
|
|
1531
1531
|
this._camera.position.copy(this._target),
|
|
1532
1532
|
b.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse),
|
|
1533
1533
|
1
|
|
@@ -1631,15 +1631,15 @@ class J extends Bt {
|
|
|
1631
1631
|
const i = t.lengthSq();
|
|
1632
1632
|
if (i === 0)
|
|
1633
1633
|
return e;
|
|
1634
|
-
const r = L.copy(t).add(e), a = this._boundary.clampPoint(r,
|
|
1635
|
-
if (
|
|
1634
|
+
const r = L.copy(t).add(e), a = this._boundary.clampPoint(r, G).sub(r), h = a.lengthSq();
|
|
1635
|
+
if (h === 0)
|
|
1636
1636
|
return e.add(t);
|
|
1637
|
-
if (
|
|
1637
|
+
if (h === i)
|
|
1638
1638
|
return e;
|
|
1639
1639
|
if (s === 0)
|
|
1640
1640
|
return e.add(t).add(a);
|
|
1641
1641
|
{
|
|
1642
|
-
const d = 1 + s *
|
|
1642
|
+
const d = 1 + s * h / t.dot(a);
|
|
1643
1643
|
return e.add(L.copy(t).multiplyScalar(d)).add(a.multiplyScalar(1 - s));
|
|
1644
1644
|
}
|
|
1645
1645
|
}
|
|
@@ -1662,7 +1662,7 @@ class J extends Bt {
|
|
|
1662
1662
|
for (let i = 0; i < 4; i++) {
|
|
1663
1663
|
const r = L.copy(this._nearPlaneCorners[i]);
|
|
1664
1664
|
r.applyMatrix4(we);
|
|
1665
|
-
const o =
|
|
1665
|
+
const o = G.addVectors(this._target, r);
|
|
1666
1666
|
de.set(o, s), de.far = this._spherical.radius + 1;
|
|
1667
1667
|
const a = de.intersectObjects(this.colliderMeshes);
|
|
1668
1668
|
a.length !== 0 && a[0].distance < e && (e = a[0].distance);
|
|
@@ -1732,32 +1732,32 @@ class J extends Bt {
|
|
|
1732
1732
|
}
|
|
1733
1733
|
static createBoundingSphere(e, t = new x.Sphere()) {
|
|
1734
1734
|
const s = t, i = s.center;
|
|
1735
|
-
|
|
1736
|
-
o.isMesh &&
|
|
1737
|
-
}),
|
|
1735
|
+
K.makeEmpty(), e.traverseVisible((o) => {
|
|
1736
|
+
o.isMesh && K.expandByObject(o);
|
|
1737
|
+
}), K.getCenter(i);
|
|
1738
1738
|
let r = 0;
|
|
1739
1739
|
return e.traverseVisible((o) => {
|
|
1740
1740
|
if (!o.isMesh) return;
|
|
1741
1741
|
const a = o;
|
|
1742
1742
|
if (!a.geometry) return;
|
|
1743
|
-
const
|
|
1744
|
-
|
|
1745
|
-
const f =
|
|
1743
|
+
const h = a.geometry.clone();
|
|
1744
|
+
h.applyMatrix4(a.matrixWorld);
|
|
1745
|
+
const f = h.attributes.position;
|
|
1746
1746
|
for (let p = 0, y = f.count; p < y; p++)
|
|
1747
1747
|
b.fromBufferAttribute(f, p), r = Math.max(r, i.distanceToSquared(b));
|
|
1748
1748
|
}), s.radius = Math.sqrt(r), s;
|
|
1749
1749
|
}
|
|
1750
1750
|
}
|
|
1751
|
-
var Pe = { exports: {} },
|
|
1751
|
+
var Pe = { exports: {} }, q = typeof Reflect == "object" ? Reflect : null, Ve = q && typeof q.apply == "function" ? q.apply : function(e, t, s) {
|
|
1752
1752
|
return Function.prototype.apply.call(e, t, s);
|
|
1753
1753
|
}, me;
|
|
1754
|
-
|
|
1754
|
+
q && typeof q.ownKeys == "function" ? me = q.ownKeys : Object.getOwnPropertySymbols ? me = function(e) {
|
|
1755
1755
|
return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e));
|
|
1756
1756
|
} : me = function(e) {
|
|
1757
1757
|
return Object.getOwnPropertyNames(e);
|
|
1758
1758
|
};
|
|
1759
|
-
function Wt(
|
|
1760
|
-
console && console.warn && console.warn(
|
|
1759
|
+
function Wt(l) {
|
|
1760
|
+
console && console.warn && console.warn(l);
|
|
1761
1761
|
}
|
|
1762
1762
|
var st = Number.isNaN || function(e) {
|
|
1763
1763
|
return e !== e;
|
|
@@ -1772,19 +1772,19 @@ A.prototype._events = void 0;
|
|
|
1772
1772
|
A.prototype._eventsCount = 0;
|
|
1773
1773
|
A.prototype._maxListeners = void 0;
|
|
1774
1774
|
var Ye = 10;
|
|
1775
|
-
function _e(
|
|
1776
|
-
if (typeof
|
|
1777
|
-
throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof
|
|
1775
|
+
function _e(l) {
|
|
1776
|
+
if (typeof l != "function")
|
|
1777
|
+
throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof l);
|
|
1778
1778
|
}
|
|
1779
1779
|
Object.defineProperty(A, "defaultMaxListeners", {
|
|
1780
1780
|
enumerable: !0,
|
|
1781
1781
|
get: function() {
|
|
1782
1782
|
return Ye;
|
|
1783
1783
|
},
|
|
1784
|
-
set: function(
|
|
1785
|
-
if (typeof
|
|
1786
|
-
throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' +
|
|
1787
|
-
Ye =
|
|
1784
|
+
set: function(l) {
|
|
1785
|
+
if (typeof l != "number" || l < 0 || st(l))
|
|
1786
|
+
throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + l + ".");
|
|
1787
|
+
Ye = l;
|
|
1788
1788
|
}
|
|
1789
1789
|
});
|
|
1790
1790
|
A.init = function() {
|
|
@@ -1795,8 +1795,8 @@ A.prototype.setMaxListeners = function(e) {
|
|
|
1795
1795
|
throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + e + ".");
|
|
1796
1796
|
return this._maxListeners = e, this;
|
|
1797
1797
|
};
|
|
1798
|
-
function it(
|
|
1799
|
-
return
|
|
1798
|
+
function it(l) {
|
|
1799
|
+
return l._maxListeners === void 0 ? A.defaultMaxListeners : l._maxListeners;
|
|
1800
1800
|
}
|
|
1801
1801
|
A.prototype.getMaxListeners = function() {
|
|
1802
1802
|
return it(this);
|
|
@@ -1815,30 +1815,30 @@ A.prototype.emit = function(e) {
|
|
|
1815
1815
|
var a = new Error("Unhandled error." + (o ? " (" + o.message + ")" : ""));
|
|
1816
1816
|
throw a.context = o, a;
|
|
1817
1817
|
}
|
|
1818
|
-
var
|
|
1819
|
-
if (
|
|
1818
|
+
var h = r[e];
|
|
1819
|
+
if (h === void 0)
|
|
1820
1820
|
return !1;
|
|
1821
|
-
if (typeof
|
|
1822
|
-
Ve(
|
|
1821
|
+
if (typeof h == "function")
|
|
1822
|
+
Ve(h, this, t);
|
|
1823
1823
|
else
|
|
1824
|
-
for (var d =
|
|
1824
|
+
for (var d = h.length, f = ht(h, d), s = 0; s < d; ++s)
|
|
1825
1825
|
Ve(f[s], this, t);
|
|
1826
1826
|
return !0;
|
|
1827
1827
|
};
|
|
1828
|
-
function rt(
|
|
1828
|
+
function rt(l, e, t, s) {
|
|
1829
1829
|
var i, r, o;
|
|
1830
|
-
if (_e(t), r =
|
|
1830
|
+
if (_e(t), r = l._events, r === void 0 ? (r = l._events = /* @__PURE__ */ Object.create(null), l._eventsCount = 0) : (r.newListener !== void 0 && (l.emit(
|
|
1831
1831
|
"newListener",
|
|
1832
1832
|
e,
|
|
1833
1833
|
t.listener ? t.listener : t
|
|
1834
|
-
), r =
|
|
1835
|
-
o = r[e] = t, ++
|
|
1836
|
-
else if (typeof o == "function" ? o = r[e] = s ? [t, o] : [o, t] : s ? o.unshift(t) : o.push(t), i = it(
|
|
1834
|
+
), r = l._events), o = r[e]), o === void 0)
|
|
1835
|
+
o = r[e] = t, ++l._eventsCount;
|
|
1836
|
+
else if (typeof o == "function" ? o = r[e] = s ? [t, o] : [o, t] : s ? o.unshift(t) : o.push(t), i = it(l), i > 0 && o.length > i && !o.warned) {
|
|
1837
1837
|
o.warned = !0;
|
|
1838
1838
|
var a = new Error("Possible EventEmitter memory leak detected. " + o.length + " " + String(e) + " listeners added. Use emitter.setMaxListeners() to increase limit");
|
|
1839
|
-
a.name = "MaxListenersExceededWarning", a.emitter =
|
|
1839
|
+
a.name = "MaxListenersExceededWarning", a.emitter = l, a.type = e, a.count = o.length, Wt(a);
|
|
1840
1840
|
}
|
|
1841
|
-
return
|
|
1841
|
+
return l;
|
|
1842
1842
|
}
|
|
1843
1843
|
A.prototype.addListener = function(e, t) {
|
|
1844
1844
|
return rt(this, e, t, !1);
|
|
@@ -1851,8 +1851,8 @@ function Gt() {
|
|
|
1851
1851
|
if (!this.fired)
|
|
1852
1852
|
return this.target.removeListener(this.type, this.wrapFn), this.fired = !0, arguments.length === 0 ? this.listener.call(this.target) : this.listener.apply(this.target, arguments);
|
|
1853
1853
|
}
|
|
1854
|
-
function ot(
|
|
1855
|
-
var s = { fired: !1, wrapFn: void 0, target:
|
|
1854
|
+
function ot(l, e, t) {
|
|
1855
|
+
var s = { fired: !1, wrapFn: void 0, target: l, type: e, listener: t }, i = Gt.bind(s);
|
|
1856
1856
|
return i.listener = t, s.wrapFn = i, i;
|
|
1857
1857
|
}
|
|
1858
1858
|
A.prototype.once = function(e, t) {
|
|
@@ -1901,12 +1901,12 @@ A.prototype.removeAllListeners = function(e) {
|
|
|
1901
1901
|
this.removeListener(e, t[i]);
|
|
1902
1902
|
return this;
|
|
1903
1903
|
};
|
|
1904
|
-
function nt(
|
|
1905
|
-
var s =
|
|
1904
|
+
function nt(l, e, t) {
|
|
1905
|
+
var s = l._events;
|
|
1906
1906
|
if (s === void 0)
|
|
1907
1907
|
return [];
|
|
1908
1908
|
var i = s[e];
|
|
1909
|
-
return i === void 0 ? [] : typeof i == "function" ? t ? [i.listener || i] : [i] : t ? Xt(i) :
|
|
1909
|
+
return i === void 0 ? [] : typeof i == "function" ? t ? [i.listener || i] : [i] : t ? Xt(i) : ht(i, i.length);
|
|
1910
1910
|
}
|
|
1911
1911
|
A.prototype.listeners = function(e) {
|
|
1912
1912
|
return nt(this, e, !0);
|
|
@@ -1914,14 +1914,14 @@ A.prototype.listeners = function(e) {
|
|
|
1914
1914
|
A.prototype.rawListeners = function(e) {
|
|
1915
1915
|
return nt(this, e, !1);
|
|
1916
1916
|
};
|
|
1917
|
-
A.listenerCount = function(
|
|
1918
|
-
return typeof
|
|
1917
|
+
A.listenerCount = function(l, e) {
|
|
1918
|
+
return typeof l.listenerCount == "function" ? l.listenerCount(e) : at.call(l, e);
|
|
1919
1919
|
};
|
|
1920
1920
|
A.prototype.listenerCount = at;
|
|
1921
|
-
function at(
|
|
1921
|
+
function at(l) {
|
|
1922
1922
|
var e = this._events;
|
|
1923
1923
|
if (e !== void 0) {
|
|
1924
|
-
var t = e[
|
|
1924
|
+
var t = e[l];
|
|
1925
1925
|
if (typeof t == "function")
|
|
1926
1926
|
return 1;
|
|
1927
1927
|
if (t !== void 0)
|
|
@@ -1932,44 +1932,44 @@ function at(h) {
|
|
|
1932
1932
|
A.prototype.eventNames = function() {
|
|
1933
1933
|
return this._eventsCount > 0 ? me(this._events) : [];
|
|
1934
1934
|
};
|
|
1935
|
-
function
|
|
1935
|
+
function ht(l, e) {
|
|
1936
1936
|
for (var t = new Array(e), s = 0; s < e; ++s)
|
|
1937
|
-
t[s] =
|
|
1937
|
+
t[s] = l[s];
|
|
1938
1938
|
return t;
|
|
1939
1939
|
}
|
|
1940
|
-
function Kt(
|
|
1941
|
-
for (; e + 1 <
|
|
1942
|
-
|
|
1943
|
-
|
|
1940
|
+
function Kt(l, e) {
|
|
1941
|
+
for (; e + 1 < l.length; e++)
|
|
1942
|
+
l[e] = l[e + 1];
|
|
1943
|
+
l.pop();
|
|
1944
1944
|
}
|
|
1945
|
-
function Xt(
|
|
1946
|
-
for (var e = new Array(
|
|
1947
|
-
e[t] =
|
|
1945
|
+
function Xt(l) {
|
|
1946
|
+
for (var e = new Array(l.length), t = 0; t < e.length; ++t)
|
|
1947
|
+
e[t] = l[t].listener || l[t];
|
|
1948
1948
|
return e;
|
|
1949
1949
|
}
|
|
1950
|
-
function qt(
|
|
1950
|
+
function qt(l, e) {
|
|
1951
1951
|
return new Promise(function(t, s) {
|
|
1952
1952
|
function i(o) {
|
|
1953
|
-
|
|
1953
|
+
l.removeListener(e, r), s(o);
|
|
1954
1954
|
}
|
|
1955
1955
|
function r() {
|
|
1956
|
-
typeof
|
|
1956
|
+
typeof l.removeListener == "function" && l.removeListener("error", i), t([].slice.call(arguments));
|
|
1957
1957
|
}
|
|
1958
|
-
|
|
1958
|
+
lt(l, e, r, { once: !0 }), e !== "error" && $t(l, i, { once: !0 });
|
|
1959
1959
|
});
|
|
1960
1960
|
}
|
|
1961
|
-
function $t(
|
|
1962
|
-
typeof
|
|
1961
|
+
function $t(l, e, t) {
|
|
1962
|
+
typeof l.on == "function" && lt(l, "error", e, t);
|
|
1963
1963
|
}
|
|
1964
|
-
function
|
|
1965
|
-
if (typeof
|
|
1966
|
-
s.once ?
|
|
1967
|
-
else if (typeof
|
|
1968
|
-
|
|
1969
|
-
s.once &&
|
|
1964
|
+
function lt(l, e, t, s) {
|
|
1965
|
+
if (typeof l.on == "function")
|
|
1966
|
+
s.once ? l.once(e, t) : l.on(e, t);
|
|
1967
|
+
else if (typeof l.addEventListener == "function")
|
|
1968
|
+
l.addEventListener(e, function i(r) {
|
|
1969
|
+
s.once && l.removeEventListener(e, i), t(r);
|
|
1970
1970
|
});
|
|
1971
1971
|
else
|
|
1972
|
-
throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof
|
|
1972
|
+
throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof l);
|
|
1973
1973
|
}
|
|
1974
1974
|
var ge = Pe.exports;
|
|
1975
1975
|
const Qt = {
|
|
@@ -1991,7 +1991,7 @@ class Jt {
|
|
|
1991
1991
|
alpha: r,
|
|
1992
1992
|
devicePixelRatio: o,
|
|
1993
1993
|
antialias: a,
|
|
1994
|
-
powerPreference:
|
|
1994
|
+
powerPreference: h,
|
|
1995
1995
|
toneMappingExposure: d,
|
|
1996
1996
|
outputColorSpace: f,
|
|
1997
1997
|
logarithmicDepthBuffer: p,
|
|
@@ -2001,7 +2001,7 @@ class Jt {
|
|
|
2001
2001
|
} = i, u = new O.WebGLRenderer({
|
|
2002
2002
|
alpha: r,
|
|
2003
2003
|
antialias: a,
|
|
2004
|
-
powerPreference:
|
|
2004
|
+
powerPreference: h,
|
|
2005
2005
|
logarithmicDepthBuffer: p,
|
|
2006
2006
|
preserveDrawingBuffer: y,
|
|
2007
2007
|
stencil: v,
|
|
@@ -2019,8 +2019,8 @@ class Jt {
|
|
|
2019
2019
|
this.renderer.render(e, t);
|
|
2020
2020
|
}
|
|
2021
2021
|
setViewport(e) {
|
|
2022
|
-
var
|
|
2023
|
-
const { x: t, y: s, width: i, height: r } = e, o = (
|
|
2022
|
+
var h, d;
|
|
2023
|
+
const { x: t, y: s, width: i, height: r } = e, o = (h = e.scissor) != null ? h : !1, a = (d = e.scissorTest) != null ? d : !1;
|
|
2024
2024
|
this.renderer.setViewport(t, s, i, r), o && (this.renderer.setScissor(t, s, i, r), this.renderer.setScissorTest(a));
|
|
2025
2025
|
}
|
|
2026
2026
|
setViewPadding(e = 0, t = 0, s = 0, i = 0) {
|
|
@@ -2044,10 +2044,10 @@ const es = {
|
|
|
2044
2044
|
class ts {
|
|
2045
2045
|
constructor(e) {
|
|
2046
2046
|
this.options = e;
|
|
2047
|
-
const { width: t, height: s, rendererParams: i, renderer: r } = e, { devicePixelRatio: o, antialias: a } = i,
|
|
2047
|
+
const { width: t, height: s, rendererParams: i, renderer: r } = e, { devicePixelRatio: o, antialias: a } = i, h = new r({
|
|
2048
2048
|
antialias: a
|
|
2049
2049
|
});
|
|
2050
|
-
|
|
2050
|
+
h.setSize(t, s), h.setPixelRatio(o), this.renderer = h;
|
|
2051
2051
|
}
|
|
2052
2052
|
setSize(e, t) {
|
|
2053
2053
|
this.renderer.setSize(e, t);
|
|
@@ -2133,7 +2133,7 @@ class is extends ne {
|
|
|
2133
2133
|
return this.controller;
|
|
2134
2134
|
}
|
|
2135
2135
|
addPerspectiveCamera(e = ct, t) {
|
|
2136
|
-
const { fov: s, far: i, near: r, up: o, aspect: a } = e,
|
|
2136
|
+
const { fov: s, far: i, near: r, up: o, aspect: a } = e, h = a != null ? a : this.width / this.height, d = new O.PerspectiveCamera(s, h, r, i);
|
|
2137
2137
|
return d.up = o, this.addController(d, t);
|
|
2138
2138
|
}
|
|
2139
2139
|
setSize(e, t) {
|
|
@@ -2193,7 +2193,7 @@ class is extends ne {
|
|
|
2193
2193
|
s[7],
|
|
2194
2194
|
s[11],
|
|
2195
2195
|
s[15]
|
|
2196
|
-
), { width: a, height:
|
|
2196
|
+
), { width: a, height: h } = this, d = a / h;
|
|
2197
2197
|
(this.camera.fov !== t.fov || this.camera.aspect !== d || !this.camera.matrixWorld.equals(r) || !this.camera.matrixWorldInverse.equals(o)) && (this.camera.fov = t.fov, this.camera.updateProjectionMatrix(), this.camera.matrixAutoUpdate = !1, this.camera.matrixWorld.copy(r), this.camera.matrixWorldInverse.copy(o), this.camera.aspect = d, this.camera.updateProjectionMatrix());
|
|
2198
2198
|
}
|
|
2199
2199
|
}
|
|
@@ -2291,7 +2291,7 @@ class ns {
|
|
|
2291
2291
|
const { cameraController: i } = this.options;
|
|
2292
2292
|
Object.values(this.helpers).forEach((a) => {
|
|
2293
2293
|
if (a.update && a.update(), a instanceof O.Box3Helper) {
|
|
2294
|
-
const
|
|
2294
|
+
const h = a.material, { object: d } = h.userData;
|
|
2295
2295
|
d && a.box.setFromObject(d, !0);
|
|
2296
2296
|
}
|
|
2297
2297
|
}), ((r = this.viewHelper) == null ? void 0 : r.animating) === !0 && (this.viewHelper.update(e), (o = t.cameraControls) == null || o.setPosition(
|
|
@@ -2311,13 +2311,13 @@ class ns {
|
|
|
2311
2311
|
}
|
|
2312
2312
|
class as extends ne {
|
|
2313
2313
|
constructor(e) {
|
|
2314
|
-
super(), this.autoRotateSpeed = 0, this.options = e,
|
|
2314
|
+
super(), this.autoRotateSpeed = 0, this.options = e, $.install({ THREE: O });
|
|
2315
2315
|
}
|
|
2316
2316
|
get cameraControls() {
|
|
2317
2317
|
return this.controller;
|
|
2318
2318
|
}
|
|
2319
2319
|
addCameraControls(e, t) {
|
|
2320
|
-
const { domElement: s } = this.options.controlsParams, i = new
|
|
2320
|
+
const { domElement: s } = this.options.controlsParams, i = new $(e, s);
|
|
2321
2321
|
return i.setLookAt(0, 0, 400, 0, 0, 0, !1), this.addController(i, t);
|
|
2322
2322
|
}
|
|
2323
2323
|
setPageActive(e) {
|
|
@@ -2344,7 +2344,7 @@ class as extends ne {
|
|
|
2344
2344
|
super.update(e, t), this.autoRotateSpeed && this.cameraControls && (this.cameraControls.azimuthAngle += this.autoRotateSpeed * e * O.MathUtils.DEG2RAD);
|
|
2345
2345
|
}
|
|
2346
2346
|
}
|
|
2347
|
-
class
|
|
2347
|
+
class hs {
|
|
2348
2348
|
constructor(e) {
|
|
2349
2349
|
this.event = new ge.EventEmitter();
|
|
2350
2350
|
const { renderer: t, scene: s, camera: i } = e, r = new Rt(
|
|
@@ -2356,8 +2356,8 @@ class ls {
|
|
|
2356
2356
|
if (s.add(o), +O.REVISION < 170) {
|
|
2357
2357
|
const a = r._root;
|
|
2358
2358
|
a.dispose = () => {
|
|
2359
|
-
a.traverse((
|
|
2360
|
-
|
|
2359
|
+
a.traverse((h) => {
|
|
2360
|
+
h.geometry && h.geometry.dispose(), h.material && h.material.dispose();
|
|
2361
2361
|
});
|
|
2362
2362
|
}, r.dispose = () => {
|
|
2363
2363
|
r.disconnect(), a.dispose();
|
|
@@ -2413,7 +2413,7 @@ class ls {
|
|
|
2413
2413
|
this.event.removeAllListeners(), (e = this.controls) == null || e.dispose();
|
|
2414
2414
|
}
|
|
2415
2415
|
}
|
|
2416
|
-
const Be = new oe(),
|
|
2416
|
+
const Be = new oe(), ls = new yt(), Ze = new oe(), I = new fe(), cs = new fe();
|
|
2417
2417
|
class ds {
|
|
2418
2418
|
constructor(e = {}) {
|
|
2419
2419
|
const t = this;
|
|
@@ -2421,10 +2421,10 @@ class ds {
|
|
|
2421
2421
|
const a = {
|
|
2422
2422
|
camera: { style: "" },
|
|
2423
2423
|
objects: /* @__PURE__ */ new WeakMap()
|
|
2424
|
-
},
|
|
2425
|
-
|
|
2424
|
+
}, h = e.element !== void 0 ? e.element : document.createElement("div");
|
|
2425
|
+
h.style.overflow = "hidden", this.domElement = h;
|
|
2426
2426
|
const d = document.createElement("div");
|
|
2427
|
-
d.style.transformOrigin = "0 0", d.style.pointerEvents = "none",
|
|
2427
|
+
d.style.transformOrigin = "0 0", d.style.pointerEvents = "none", h.appendChild(d);
|
|
2428
2428
|
const f = document.createElement("div");
|
|
2429
2429
|
f.style.transformStyle = "preserve-3d", d.appendChild(f), this.getSize = function() {
|
|
2430
2430
|
return {
|
|
@@ -2439,7 +2439,7 @@ class ds {
|
|
|
2439
2439
|
const w = n.view && n.view.enabled ? n.view.height / n.view.fullHeight : 1, T = n.isOrthographicCamera ? `scale( ${w} )scale(` + g + ")translate(" + p(E) + "px," + p(C) + "px)" + y(n.matrixWorldInverse) : `scale( ${w} )translateZ(` + g + "px)" + y(n.matrixWorldInverse), R = (n.isPerspectiveCamera ? "perspective(" + g + "px) " : "") + T + "translate(" + r + "px," + o + "px)";
|
|
2440
2440
|
a.camera.style !== R && (f.style.transform = R, a.camera.style = R), u(_, _, n);
|
|
2441
2441
|
}, this.setSize = function(_, n) {
|
|
2442
|
-
s = _, i = n, r = s / 2, o = i / 2,
|
|
2442
|
+
s = _, i = n, r = s / 2, o = i / 2, h.style.width = _ + "px", h.style.height = n + "px", d.style.width = _ + "px", d.style.height = n + "px", f.style.width = _ + "px", f.style.height = n + "px";
|
|
2443
2443
|
};
|
|
2444
2444
|
function p(_) {
|
|
2445
2445
|
return Math.abs(_) < 1e-10 ? 0 : _;
|
|
@@ -2467,7 +2467,7 @@ class ds {
|
|
|
2467
2467
|
if (w.style.display = C === !0 ? "" : "none", C === !0) {
|
|
2468
2468
|
_.onBeforeRender(t, n, g);
|
|
2469
2469
|
let T;
|
|
2470
|
-
_.isCSS3DSprite ? (I.copy(g.matrixWorldInverse), I.transpose(), _.rotation2D !== 0 && I.multiply(cs.makeRotationZ(_.rotation2D)), _.matrixWorld.decompose(Be,
|
|
2470
|
+
_.isCSS3DSprite ? (I.copy(g.matrixWorldInverse), I.transpose(), _.rotation2D !== 0 && I.multiply(cs.makeRotationZ(_.rotation2D)), _.matrixWorld.decompose(Be, ls, Ze), I.setPosition(Be), I.scale(Ze), I.elements[3] = 0, I.elements[7] = 0, I.elements[11] = 0, I.elements[15] = 1, T = v(I)) : T = v(_.matrixWorld);
|
|
2471
2471
|
const P = a.objects.get(_);
|
|
2472
2472
|
if (P === void 0 || P.style !== T) {
|
|
2473
2473
|
w.style.transform = T;
|
|
@@ -2482,15 +2482,15 @@ class ds {
|
|
|
2482
2482
|
}
|
|
2483
2483
|
}
|
|
2484
2484
|
}
|
|
2485
|
-
const
|
|
2485
|
+
const X = new oe(), We = new fe(), Ge = new fe(), Ke = new oe(), Xe = new oe();
|
|
2486
2486
|
class ps {
|
|
2487
2487
|
constructor(e = {}) {
|
|
2488
2488
|
const t = this;
|
|
2489
2489
|
let s, i, r, o;
|
|
2490
2490
|
const a = {
|
|
2491
2491
|
objects: /* @__PURE__ */ new WeakMap()
|
|
2492
|
-
},
|
|
2493
|
-
|
|
2492
|
+
}, h = e.element !== void 0 ? e.element : document.createElement("div");
|
|
2493
|
+
h.style.overflow = "hidden", this.domElement = h, this.getSize = function() {
|
|
2494
2494
|
return {
|
|
2495
2495
|
width: s,
|
|
2496
2496
|
height: i
|
|
@@ -2498,7 +2498,7 @@ class ps {
|
|
|
2498
2498
|
}, this.render = function(m, u) {
|
|
2499
2499
|
m.matrixWorldAutoUpdate === !0 && m.updateMatrixWorld(), u.parent === null && u.matrixWorldAutoUpdate === !0 && u.updateMatrixWorld(), We.copy(u.matrixWorldInverse), Ge.multiplyMatrices(u.projectionMatrix, We), f(m, m, u), v(m);
|
|
2500
2500
|
}, this.setSize = function(m, u) {
|
|
2501
|
-
s = m, i = u, r = s / 2, o = i / 2,
|
|
2501
|
+
s = m, i = u, r = s / 2, o = i / 2, h.style.width = m + "px", h.style.height = u + "px";
|
|
2502
2502
|
};
|
|
2503
2503
|
function d(m) {
|
|
2504
2504
|
m.isCSS2DObject && (m.element.style.display = "none");
|
|
@@ -2511,9 +2511,9 @@ class ps {
|
|
|
2511
2511
|
return;
|
|
2512
2512
|
}
|
|
2513
2513
|
if (m.isCSS2DObject) {
|
|
2514
|
-
|
|
2515
|
-
const n =
|
|
2516
|
-
g.style.display = n === !0 ? "" : "none", n === !0 && (m.onBeforeRender(t, u, _), g.style.transform = "translate(" + -100 * m.center.x + "%," + -100 * m.center.y + "%)translate(" + (
|
|
2514
|
+
X.setFromMatrixPosition(m.matrixWorld), X.applyMatrix4(Ge);
|
|
2515
|
+
const n = X.z >= -1 && X.z <= 1 && m.layers.test(_.layers) === !0, g = m.element;
|
|
2516
|
+
g.style.display = n === !0 ? "" : "none", n === !0 && (m.onBeforeRender(t, u, _), g.style.transform = "translate(" + -100 * m.center.x + "%," + -100 * m.center.y + "%)translate(" + (X.x * r + r) + "px," + (-X.y * o + o) + "px)", g.parentNode !== h && h.appendChild(g), m.onAfterRender(t, u, _));
|
|
2517
2517
|
const E = {
|
|
2518
2518
|
distanceToCameraSquared: p(_, m)
|
|
2519
2519
|
};
|
|
@@ -2669,12 +2669,12 @@ class fs extends kt {
|
|
|
2669
2669
|
}), this.fsQuad = new Ft(this.material);
|
|
2670
2670
|
}
|
|
2671
2671
|
}
|
|
2672
|
-
const _s = (
|
|
2672
|
+
const _s = (l) => {
|
|
2673
2673
|
const e = new Nt(
|
|
2674
2674
|
new O.ShaderMaterial({
|
|
2675
2675
|
uniforms: {
|
|
2676
2676
|
baseTexture: { value: null },
|
|
2677
|
-
bloomTexture: { value:
|
|
2677
|
+
bloomTexture: { value: l.renderTarget2.texture },
|
|
2678
2678
|
bloomAlphaType: { value: 0 }
|
|
2679
2679
|
},
|
|
2680
2680
|
vertexShader: `
|
|
@@ -2744,13 +2744,13 @@ class bs {
|
|
|
2744
2744
|
composerParams: r
|
|
2745
2745
|
} = e, { renderer: o } = t;
|
|
2746
2746
|
this.renderer = o;
|
|
2747
|
-
const { multisampling: a } = r, { maxSamples:
|
|
2747
|
+
const { multisampling: a } = r, { maxSamples: h } = o.capabilities, d = o.getDrawingBufferSize(
|
|
2748
2748
|
new O.Vector2()
|
|
2749
2749
|
), f = new O.WebGLRenderTarget(
|
|
2750
2750
|
d.width,
|
|
2751
2751
|
d.height,
|
|
2752
2752
|
{
|
|
2753
|
-
samples: Math.min(a,
|
|
2753
|
+
samples: Math.min(a, h),
|
|
2754
2754
|
type: O.HalfFloatType
|
|
2755
2755
|
}
|
|
2756
2756
|
), p = new Me(o, f), y = this.getSize();
|
|
@@ -2779,8 +2779,8 @@ class bs {
|
|
|
2779
2779
|
this.outputPass && (this.outputPass.uniforms.premultiplieAlpha.value = e ? 1 : 0);
|
|
2780
2780
|
}
|
|
2781
2781
|
addSSAOPass(e) {
|
|
2782
|
-
const { scene: t, camera: s, renderer: i } = this, r = i.getSize(new O.Vector2()), o = r.width, a = r.height,
|
|
2783
|
-
|
|
2782
|
+
const { scene: t, camera: s, renderer: i } = this, r = i.getSize(new O.Vector2()), o = r.width, a = r.height, h = new zt(t, s, o, a);
|
|
2783
|
+
h.kernelRadius = e.kernelRadius, h.minDistance = e.minDistance, h.maxDistance = e.maxDistance, this.ssaoPass = h, this.finalComposer.addPass(h);
|
|
2784
2784
|
}
|
|
2785
2785
|
addBloomPass(e) {
|
|
2786
2786
|
const { renderer: t } = this, { threshold: s, strength: i, radius: r, bloomAlphaType: o } = e, a = new Ht(
|
|
@@ -2790,10 +2790,10 @@ class bs {
|
|
|
2790
2790
|
s
|
|
2791
2791
|
);
|
|
2792
2792
|
this.bloomPass = a;
|
|
2793
|
-
const
|
|
2794
|
-
|
|
2795
|
-
const d = _s(
|
|
2796
|
-
d.uniforms.bloomAlphaType.value = o, this.bloomComposer =
|
|
2793
|
+
const h = new Me(t);
|
|
2794
|
+
h.renderToScreen = !1, h.addPass(this.renderPass), h.addPass(a), this.bloomComposer = h;
|
|
2795
|
+
const d = _s(h);
|
|
2796
|
+
d.uniforms.bloomAlphaType.value = o, this.bloomComposer = h, this.finalComposer.addPass(d), this.mixPass = d, this.bloomLayer.set(be);
|
|
2797
2797
|
}
|
|
2798
2798
|
toggleBloomSelection(e, t) {
|
|
2799
2799
|
if (!this.bloomComposer) {
|
|
@@ -2830,9 +2830,9 @@ class bs {
|
|
|
2830
2830
|
s.isTransformControls || s.isTransformControlsRoot || s.type === "RectAreaLightHelper" ? e.push(s) : t.push(s);
|
|
2831
2831
|
}), t.forEach((s) => {
|
|
2832
2832
|
s.traverse((i) => {
|
|
2833
|
-
var
|
|
2833
|
+
var h;
|
|
2834
2834
|
const r = i, o = i, a = i;
|
|
2835
|
-
(
|
|
2835
|
+
(h = r.material) != null && h.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 = ys : o.material = Es : r.material instanceof et ? r.material = Os : a.isPoints ? a.material.sizeAttenuation ? a.material = Cs : a.material = vs : r.material = gs);
|
|
2836
2836
|
});
|
|
2837
2837
|
}), e.forEach((s) => {
|
|
2838
2838
|
this.bloomVisible[s.uuid] = s.visible, s.visible = !1;
|
|
@@ -2863,7 +2863,7 @@ class bs {
|
|
|
2863
2863
|
height: i.height,
|
|
2864
2864
|
scissor: !0,
|
|
2865
2865
|
scissorTest: !1
|
|
2866
|
-
}), this.finalComposerRender(), e.setPageActive(31), t.setViewport(
|
|
2866
|
+
}), this.finalComposerRender(), e.setPageActive(31), t.setViewport(Q(z({}, this.pipViewportState), {
|
|
2867
2867
|
scissor: !0,
|
|
2868
2868
|
scissorTest: !0
|
|
2869
2869
|
})), this.finalComposerRender();
|
|
@@ -2888,10 +2888,10 @@ class $e extends O.Loader {
|
|
|
2888
2888
|
const a = new O.FileLoader(this.manager);
|
|
2889
2889
|
return a.setResponseType("blob"), a.setRequestHeader(this.requestHeader), a.setPath(this.path), a.setWithCredentials(this.withCredentials), a.load(
|
|
2890
2890
|
e,
|
|
2891
|
-
(
|
|
2892
|
-
let d =
|
|
2891
|
+
(h) => {
|
|
2892
|
+
let d = h;
|
|
2893
2893
|
const f = e.split(".").pop(), p = this.options.type === "image" ? `image/${f || "png"}` : `video/${f || "mp4"}`;
|
|
2894
|
-
d = d.slice(0,
|
|
2894
|
+
d = d.slice(0, h.size, p);
|
|
2895
2895
|
const y = () => {
|
|
2896
2896
|
o.removeEventListener("load", v, !1), o.removeEventListener("error", m, !1);
|
|
2897
2897
|
}, v = () => {
|
|
@@ -2917,7 +2917,7 @@ class Ps extends O.Loader {
|
|
|
2917
2917
|
r.setResponseType("blob"), r.setRequestHeader(this.requestHeader), r.setPath(this.path), r.setWithCredentials(this.withCredentials), r.load(
|
|
2918
2918
|
e,
|
|
2919
2919
|
(o) => {
|
|
2920
|
-
const a = o,
|
|
2920
|
+
const a = o, h = new DecompressionStream("gzip"), d = a.stream().pipeThrough(h);
|
|
2921
2921
|
new Response(d).json().then((p) => {
|
|
2922
2922
|
t == null || t(p);
|
|
2923
2923
|
}).catch((p) => {
|
|
@@ -2940,7 +2940,7 @@ const Ls = {
|
|
|
2940
2940
|
};
|
|
2941
2941
|
class Ss {
|
|
2942
2942
|
constructor(e) {
|
|
2943
|
-
this.loadObj = [], this.delLoadArr = [], this.assets = /* @__PURE__ */ new Map(), this.event = new ge.EventEmitter(), this.options =
|
|
2943
|
+
this.loadObj = [], this.delLoadArr = [], this.assets = /* @__PURE__ */ new Map(), this.event = new ge.EventEmitter(), this.options = z({
|
|
2944
2944
|
simpleTexture4deleted: !1,
|
|
2945
2945
|
prefix: ""
|
|
2946
2946
|
}, e), this.loadingManager = new O.LoadingManager(
|
|
@@ -3005,7 +3005,7 @@ class Ss {
|
|
|
3005
3005
|
}
|
|
3006
3006
|
add(e, t) {
|
|
3007
3007
|
typeof e == "string" && (e = [e]), e.forEach((s) => {
|
|
3008
|
-
const i =
|
|
3008
|
+
const i = z({
|
|
3009
3009
|
src: s
|
|
3010
3010
|
}, t);
|
|
3011
3011
|
this.loadObj.push(i);
|
|
@@ -3024,7 +3024,7 @@ class Ss {
|
|
|
3024
3024
|
}), e;
|
|
3025
3025
|
}
|
|
3026
3026
|
loadAll() {
|
|
3027
|
-
return
|
|
3027
|
+
return J(this, null, function* () {
|
|
3028
3028
|
const e = this.loadObj.filter((t) => !this.delLoadArr.includes(t.src));
|
|
3029
3029
|
return yield Promise.all(
|
|
3030
3030
|
e.map((t) => this.load(t.src, t))
|
|
@@ -3032,8 +3032,8 @@ class Ss {
|
|
|
3032
3032
|
});
|
|
3033
3033
|
}
|
|
3034
3034
|
load(e, t) {
|
|
3035
|
-
return
|
|
3036
|
-
var a,
|
|
3035
|
+
return J(this, null, function* () {
|
|
3036
|
+
var a, h;
|
|
3037
3037
|
const s = (a = t == null ? void 0 : t.type) != null ? a : this.getAssetType(e);
|
|
3038
3038
|
if (!s)
|
|
3039
3039
|
return;
|
|
@@ -3048,7 +3048,7 @@ class Ss {
|
|
|
3048
3048
|
const d = yield o.loadAsync(e);
|
|
3049
3049
|
if (this.assets.set(e, d), r.resolve(d), s === "images" || s === "media" || s === "exr" || s === "lottie") {
|
|
3050
3050
|
(t == null ? void 0 : t.colorCorrection) !== !1 && Pt({ texture: d });
|
|
3051
|
-
const f = (
|
|
3051
|
+
const f = (h = t == null ? void 0 : t.anisotropy) != null ? h : this.options.anisotropy;
|
|
3052
3052
|
d.anisotropy = f;
|
|
3053
3053
|
}
|
|
3054
3054
|
return d;
|
|
@@ -3065,14 +3065,14 @@ class Ss {
|
|
|
3065
3065
|
const t = /* @__PURE__ */ new Set(), s = this.textureAssets;
|
|
3066
3066
|
e.traverse((r) => {
|
|
3067
3067
|
const o = r;
|
|
3068
|
-
o.material && (Array.isArray(o.material) ? o.material : [o.material]).forEach((
|
|
3068
|
+
o.material && (Array.isArray(o.material) ? o.material : [o.material]).forEach((h) => {
|
|
3069
3069
|
[
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3070
|
+
h.map,
|
|
3071
|
+
h.emissiveMap,
|
|
3072
|
+
h.normalMap,
|
|
3073
|
+
h.roughnessMap,
|
|
3074
|
+
h.metalnessMap,
|
|
3075
|
+
h.aoMap
|
|
3076
3076
|
].forEach((d) => {
|
|
3077
3077
|
if (d) {
|
|
3078
3078
|
const f = this.getSrcByAsset(d, s);
|
|
@@ -3102,7 +3102,7 @@ class Ms extends ne {
|
|
|
3102
3102
|
super(), this.options = e;
|
|
3103
3103
|
}
|
|
3104
3104
|
addLoader(e, t) {
|
|
3105
|
-
const { loaderParams: s } = this.options, i = new Ss(
|
|
3105
|
+
const { loaderParams: s } = this.options, i = new Ss(Q(z({}, s), {
|
|
3106
3106
|
scene: e
|
|
3107
3107
|
}));
|
|
3108
3108
|
return this.addController(i, t);
|
|
@@ -3115,18 +3115,18 @@ class Ms extends ne {
|
|
|
3115
3115
|
}
|
|
3116
3116
|
class Ds extends At {
|
|
3117
3117
|
constructor(e) {
|
|
3118
|
-
super(), this.options =
|
|
3118
|
+
super(), this.options = z({}, e);
|
|
3119
3119
|
}
|
|
3120
3120
|
create() {
|
|
3121
3121
|
var e;
|
|
3122
3122
|
this.object3d = (e = this.options.scene) != null ? e : new O.Scene();
|
|
3123
3123
|
}
|
|
3124
3124
|
}
|
|
3125
|
-
function Qe(
|
|
3125
|
+
function Qe(l) {
|
|
3126
3126
|
let e = !1, t = [];
|
|
3127
3127
|
return function(...s) {
|
|
3128
3128
|
t = s, e || (e = !0, requestAnimationFrame(() => {
|
|
3129
|
-
e = !1,
|
|
3129
|
+
e = !1, l(...t);
|
|
3130
3130
|
}));
|
|
3131
3131
|
};
|
|
3132
3132
|
}
|
|
@@ -3146,17 +3146,17 @@ class Rs {
|
|
|
3146
3146
|
r.preventDefault();
|
|
3147
3147
|
const o = e === "move" ? t : s, a = [];
|
|
3148
3148
|
if (this.pickFunctionsMap.forEach((m) => {
|
|
3149
|
-
o.has(m.type) && a.push(
|
|
3149
|
+
o.has(m.type) && a.push(Q(z({}, m), {
|
|
3150
3150
|
objArr: m.objArr instanceof Function ? m.objArr() : m.objArr
|
|
3151
3151
|
}));
|
|
3152
3152
|
}), a.length === 0) return;
|
|
3153
3153
|
this.activeObjects.clear(), this.objCallbackMap.clear();
|
|
3154
|
-
const
|
|
3154
|
+
const h = this.objCallbackMap, d = [];
|
|
3155
3155
|
for (const m of a)
|
|
3156
3156
|
for (const u of m.objArr) {
|
|
3157
3157
|
if (!u.object3d || !u.visibleWithAncestors) continue;
|
|
3158
|
-
|
|
3159
|
-
const _ =
|
|
3158
|
+
h.has(u) || (h.set(u, /* @__PURE__ */ new Map()), d.push(u));
|
|
3159
|
+
const _ = h.get(u);
|
|
3160
3160
|
_.has(m.type) || _.set(m.type, []), _.get(m.type).push(m.cb);
|
|
3161
3161
|
}
|
|
3162
3162
|
if (d.length === 0) return;
|
|
@@ -3203,10 +3203,10 @@ class Rs {
|
|
|
3203
3203
|
};
|
|
3204
3204
|
for (const a of this.activeObjects) {
|
|
3205
3205
|
if (r) break;
|
|
3206
|
-
const
|
|
3207
|
-
if (
|
|
3206
|
+
const h = i.get(a);
|
|
3207
|
+
if (h)
|
|
3208
3208
|
if (t === "move") {
|
|
3209
|
-
const d =
|
|
3209
|
+
const d = h.get("enter");
|
|
3210
3210
|
if (d && !this.prevActiveObjects.has(a))
|
|
3211
3211
|
for (const p of d)
|
|
3212
3212
|
p({
|
|
@@ -3215,7 +3215,7 @@ class Rs {
|
|
|
3215
3215
|
sp: o,
|
|
3216
3216
|
intersectionIndex: s
|
|
3217
3217
|
});
|
|
3218
|
-
const f =
|
|
3218
|
+
const f = h.get("move");
|
|
3219
3219
|
if (f)
|
|
3220
3220
|
for (const p of f)
|
|
3221
3221
|
p({
|
|
@@ -3225,7 +3225,7 @@ class Rs {
|
|
|
3225
3225
|
intersectionIndex: s
|
|
3226
3226
|
});
|
|
3227
3227
|
} else {
|
|
3228
|
-
const d =
|
|
3228
|
+
const d = h.get("down");
|
|
3229
3229
|
if (d)
|
|
3230
3230
|
for (const p of d)
|
|
3231
3231
|
p({
|
|
@@ -3234,7 +3234,7 @@ class Rs {
|
|
|
3234
3234
|
sp: o,
|
|
3235
3235
|
intersectionIndex: s
|
|
3236
3236
|
});
|
|
3237
|
-
const f =
|
|
3237
|
+
const f = h.get("click");
|
|
3238
3238
|
if (f) {
|
|
3239
3239
|
const p = (y) => {
|
|
3240
3240
|
y.preventDefault();
|
|
@@ -3295,15 +3295,15 @@ class Rs {
|
|
|
3295
3295
|
this.pickNodeFunctionsMapIndex += 1;
|
|
3296
3296
|
const i = this.pickNodeFunctionsMapIndex, r = e instanceof Function ? e() : e, o = [];
|
|
3297
3297
|
for (const a of r) {
|
|
3298
|
-
const
|
|
3299
|
-
|
|
3298
|
+
const h = a;
|
|
3299
|
+
h.element.style.pointerEvents = "auto";
|
|
3300
3300
|
const d = (p) => {
|
|
3301
3301
|
this.enabled && (p.preventDefault(), s({
|
|
3302
|
-
baseObject:
|
|
3302
|
+
baseObject: h,
|
|
3303
3303
|
mouseEvent: p
|
|
3304
3304
|
}));
|
|
3305
3305
|
}, f = `pointer${t}`;
|
|
3306
|
-
|
|
3306
|
+
h.element.addEventListener(f, Qe(d), !1), o.push({ arr: h, type: f, listener: d });
|
|
3307
3307
|
}
|
|
3308
3308
|
return this.pickNodeFunctionsMap.set(i, o), i;
|
|
3309
3309
|
}
|
|
@@ -3354,20 +3354,9 @@ class Us extends Rs {
|
|
|
3354
3354
|
(a.startsWith(s ? i : `${i}#`) || a === i) && r.push(o);
|
|
3355
3355
|
}), r;
|
|
3356
3356
|
}
|
|
3357
|
-
instantiate(s) {
|
|
3358
|
-
return W(this, arguments, function* (e, {
|
|
3359
|
-
create: t
|
|
3360
|
-
} = {}) {
|
|
3361
|
-
const { objectType: i, objectOptions: r } = e, [, o] = i.split("#"), a = yield this.draw(o, Z(U({}, r || {}), {
|
|
3362
|
-
create: t,
|
|
3363
|
-
prefab: !1
|
|
3364
|
-
}));
|
|
3365
|
-
return a.isInstantiate = !0, a;
|
|
3366
|
-
});
|
|
3367
|
-
}
|
|
3368
3357
|
draw(e, t, s) {
|
|
3369
|
-
return
|
|
3370
|
-
var r, o, a,
|
|
3358
|
+
return J(this, null, function* () {
|
|
3359
|
+
var r, o, a, h;
|
|
3371
3360
|
const i = this.objectNamesToFactories.get(e);
|
|
3372
3361
|
if (i) {
|
|
3373
3362
|
t || (t = {}), t.target === void 0 && (t.target = s);
|
|
@@ -3376,7 +3365,7 @@ class Us extends Rs {
|
|
|
3376
3365
|
this.objects.has(f) && (f.includes("#") ? f += `-${Re()}` : f += `#${Re()}`);
|
|
3377
3366
|
const p = t.target, y = (r = t.onTop) != null ? r : 0, v = (o = t.prefab) != null ? o : !1, m = (a = t.create) != null ? a : !0, u = new i().create(t);
|
|
3378
3367
|
let _;
|
|
3379
|
-
p === null ? _ = null : typeof p == "string" ? _ = this.objects.get(p) : (
|
|
3368
|
+
p === null ? _ = null : typeof p == "string" ? _ = this.objects.get(p) : (h = p == null ? void 0 : p.objectType) != null && h.startsWith("BaseObject") || p ? _ = p : v ? _ = this.prefabGroup : _ = this.group, m === !1 ? u.create = () => {
|
|
3380
3369
|
} : m !== !0 && (u.create = () => {
|
|
3381
3370
|
m(u);
|
|
3382
3371
|
}), u.pencil = this.pencil, u.lead = this, u.key = f, u.prefab = v, u.objectType = `BaseObject#${e}`, u.objectOptions = t, this.objects.set(f, u);
|
|
@@ -3387,7 +3376,7 @@ class Us extends Rs {
|
|
|
3387
3376
|
});
|
|
3388
3377
|
}
|
|
3389
3378
|
addBaseObject(e, t, s) {
|
|
3390
|
-
return
|
|
3379
|
+
return J(this, null, function* () {
|
|
3391
3380
|
return yield e.create(), e.object3d && (s && e.setTop(s), t !== null && (t.add(e.object3d), this.objMap.set(e.object3d, e))), e.render(), e;
|
|
3392
3381
|
});
|
|
3393
3382
|
}
|
|
@@ -3544,26 +3533,26 @@ const ue = class ue {
|
|
|
3544
3533
|
renderer: r,
|
|
3545
3534
|
controls: o,
|
|
3546
3535
|
loader: a
|
|
3547
|
-
} = this.options, { width:
|
|
3548
|
-
width:
|
|
3536
|
+
} = this.options, { width: h, height: d } = this.getSize(), f = t ? new ts({
|
|
3537
|
+
width: h,
|
|
3549
3538
|
height: d,
|
|
3550
3539
|
renderer: t.WebGPURenderer,
|
|
3551
3540
|
rendererParams: es
|
|
3552
3541
|
}) : new Jt({
|
|
3553
|
-
width:
|
|
3542
|
+
width: h,
|
|
3554
3543
|
height: d,
|
|
3555
|
-
rendererParams:
|
|
3544
|
+
rendererParams: Q(z({}, r), {
|
|
3556
3545
|
antialias: !1
|
|
3557
3546
|
})
|
|
3558
3547
|
}), p = new is({
|
|
3559
|
-
width:
|
|
3548
|
+
width: h,
|
|
3560
3549
|
height: d
|
|
3561
3550
|
}), y = new os({}), v = new as({
|
|
3562
3551
|
controlsParams: {
|
|
3563
3552
|
domElement: (n = o == null ? void 0 : o.domElement) != null ? n : f.renderer.domElement
|
|
3564
3553
|
}
|
|
3565
3554
|
}), m = new Ms({
|
|
3566
|
-
loaderParams:
|
|
3555
|
+
loaderParams: z({
|
|
3567
3556
|
anisotropy: f.renderer.capabilities.getMaxAnisotropy()
|
|
3568
3557
|
}, a)
|
|
3569
3558
|
}), u = new zs({
|
|
@@ -3597,7 +3586,7 @@ const ue = class ue {
|
|
|
3597
3586
|
cameraController: this.cameraController,
|
|
3598
3587
|
composerParams: r
|
|
3599
3588
|
});
|
|
3600
|
-
this.composerController = o, e && o.addBloomPass(
|
|
3589
|
+
this.composerController = o, e && o.addBloomPass(z({}, t)), s && o.addSSAOPass(z({}, i)), o.addOutputPass();
|
|
3601
3590
|
}
|
|
3602
3591
|
initCSSRenderer() {
|
|
3603
3592
|
const {
|
|
@@ -3613,7 +3602,7 @@ const ue = class ue {
|
|
|
3613
3602
|
}
|
|
3614
3603
|
}
|
|
3615
3604
|
initTransformControls() {
|
|
3616
|
-
const e = new
|
|
3605
|
+
const e = new hs({
|
|
3617
3606
|
camera: this.camera,
|
|
3618
3607
|
renderer: this.renderer,
|
|
3619
3608
|
scene: this.scene
|
|
@@ -3650,9 +3639,9 @@ const ue = class ue {
|
|
|
3650
3639
|
cameraController: r,
|
|
3651
3640
|
composerController: o,
|
|
3652
3641
|
cssRendererController: a,
|
|
3653
|
-
leadController:
|
|
3642
|
+
leadController: h
|
|
3654
3643
|
} = this, d = this.renderer.getSize(new O.Vector2());
|
|
3655
|
-
d.x === e && d.y === t || (r.setSize(e, t), i.setSize(e, t), o == null || o.setSize(e, t), a == null || a.setSize(e, t),
|
|
3644
|
+
d.x === e && d.y === t || (r.setSize(e, t), i.setSize(e, t), o == null || o.setSize(e, t), a == null || a.setSize(e, t), h.setSize(e, t), this.installPlugins.forEach((f) => {
|
|
3656
3645
|
var p;
|
|
3657
3646
|
(p = f.setSize) == null || p.call(f, e, t);
|
|
3658
3647
|
}), this.render(), s && this.event.emit("resize", { width: e, height: t }));
|
|
@@ -3674,8 +3663,8 @@ const ue = class ue {
|
|
|
3674
3663
|
r !== o && (this.rendererController.setPixelRatio(r), (a = this.composerController) == null || a.setPixelRatio(r));
|
|
3675
3664
|
}
|
|
3676
3665
|
pick(e, t, s = !0) {
|
|
3677
|
-
const { raycaster: i, options: r } = this, { container: o } = r, a = new O.Vector2(),
|
|
3678
|
-
if (a.x = (e.clientX -
|
|
3666
|
+
const { raycaster: i, options: r } = this, { container: o } = r, a = new O.Vector2(), h = o.getBoundingClientRect();
|
|
3667
|
+
if (a.x = (e.clientX - h.left) / (h.right - h.left) * 2 - 1, a.y = -((e.clientY - h.top) / (h.bottom - h.top)) * 2 + 1, this.camera && this.scene) {
|
|
3679
3668
|
i.setFromCamera(a, this.camera);
|
|
3680
3669
|
const d = i.intersectObjects(
|
|
3681
3670
|
t || this.scene.children,
|
|
@@ -3690,7 +3679,7 @@ const ue = class ue {
|
|
|
3690
3679
|
}
|
|
3691
3680
|
}
|
|
3692
3681
|
render() {
|
|
3693
|
-
var s, i, r, o, a,
|
|
3682
|
+
var s, i, r, o, a, h;
|
|
3694
3683
|
if (!this.camera || !this.scene)
|
|
3695
3684
|
return;
|
|
3696
3685
|
this.timer.update(), Ce.update();
|
|
@@ -3702,7 +3691,7 @@ const ue = class ue {
|
|
|
3702
3691
|
e,
|
|
3703
3692
|
this.controlsController,
|
|
3704
3693
|
this.cameraTarget
|
|
3705
|
-
), (i = this.composerController) != null && i.active ? this.composerController.render() : (r = this.rendererController) == null || r.render(this.scene, this.camera), (o = this.helperController) == null || o.renderViewHelper(this.renderer), (a = this.cssRendererController) == null || a.render(this.scene, this.camera), (
|
|
3694
|
+
), (i = this.composerController) != null && i.active ? this.composerController.render() : (r = this.rendererController) == null || r.render(this.scene, this.camera), (o = this.helperController) == null || o.renderViewHelper(this.renderer), (a = this.cssRendererController) == null || a.render(this.scene, this.camera), (h = this.stats) == null || h.update(), this.event.emit("render", { delta: e, elapsed: t });
|
|
3706
3695
|
}
|
|
3707
3696
|
start() {
|
|
3708
3697
|
window.cancelAnimationFrame(this.TweenRaf), this.renderer.setAnimationLoop(this.render.bind(this)), this.event.emit("start");
|
|
@@ -3753,11 +3742,11 @@ const ue = class ue {
|
|
|
3753
3742
|
}
|
|
3754
3743
|
}
|
|
3755
3744
|
dispose() {
|
|
3756
|
-
var e, t, s, i, r, o, a,
|
|
3745
|
+
var e, t, s, i, r, o, a, h, d, f, p, y, v;
|
|
3757
3746
|
this.stop(), this.timer.dispose(), Ce.removeAll(), this.event.removeAllListeners(), (e = this.resizeObserver) == null || e.unobserve(this.options.container), this.installPlugins.forEach((m) => {
|
|
3758
3747
|
var u;
|
|
3759
3748
|
(u = m.dispose) == null || u.call(m);
|
|
3760
|
-
}), (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(), (a = this.helperController) == null || a.dispose(), (
|
|
3749
|
+
}), (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(), (a = this.helperController) == null || a.dispose(), (h = this.composerController) == null || h.dispose(), (d = this.rendererController) == null || d.dispose(), (f = this.loaderController) == null || f.dispose(), (p = this.leadController) == null || p.dispose(), this.cssRendererController = void 0, this.installPlugins.clear(), (y = this.stats) == null || y.dom.remove(), (v = this.renderer) == null || v.domElement.remove();
|
|
3761
3750
|
}
|
|
3762
3751
|
};
|
|
3763
3752
|
ue.options = {
|
|
@@ -3776,12 +3765,12 @@ ue.options = {
|
|
|
3776
3765
|
loader: As,
|
|
3777
3766
|
ssaoParams: Ts,
|
|
3778
3767
|
css2DRenderer: !1,
|
|
3779
|
-
css2DRendererParams:
|
|
3768
|
+
css2DRendererParams: z({}, qe),
|
|
3780
3769
|
css3DRenderer: !1,
|
|
3781
|
-
css3DRendererParams:
|
|
3770
|
+
css3DRendererParams: z({}, qe)
|
|
3782
3771
|
};
|
|
3783
3772
|
let Je = ue;
|
|
3784
|
-
const fi =
|
|
3773
|
+
const fi = $.ACTION;
|
|
3785
3774
|
export {
|
|
3786
3775
|
At as BaseObject,
|
|
3787
3776
|
Je as Pencil,
|