gl-draw 0.16.0-beta.13 → 0.16.0-beta.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/WebGPULineSegments2.js +3 -3
- package/dist/WebGPULineSegments2.module.js +37 -33
- package/dist/index.js +2 -2
- package/dist/index.module.js +212 -216
- package/package.json +1 -1
package/dist/index.module.js
CHANGED
|
@@ -2,15 +2,15 @@ var St = Object.defineProperty, At = Object.defineProperties;
|
|
|
2
2
|
var Mt = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var Me = Object.getOwnPropertySymbols;
|
|
4
4
|
var Rt = Object.prototype.hasOwnProperty, Dt = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var Re = (c, e, t) => e in c ? St(c, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : c[e] = t,
|
|
5
|
+
var Re = (c, e, t) => e in c ? St(c, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : c[e] = t, U = (c, e) => {
|
|
6
6
|
for (var t in e || (e = {}))
|
|
7
7
|
Rt.call(e, t) && Re(c, t, e[t]);
|
|
8
8
|
if (Me)
|
|
9
9
|
for (var t of Me(e))
|
|
10
10
|
Dt.call(e, t) && Re(c, t, e[t]);
|
|
11
11
|
return c;
|
|
12
|
-
},
|
|
13
|
-
var
|
|
12
|
+
}, te = (c, e) => At(c, Mt(e));
|
|
13
|
+
var se = (c, e, t) => new Promise((s, i) => {
|
|
14
14
|
var r = (a) => {
|
|
15
15
|
try {
|
|
16
16
|
n(t.next(a));
|
|
@@ -29,7 +29,7 @@ var $ = (c, e, t) => new Promise((s, i) => {
|
|
|
29
29
|
import * as Ce from "@tweenjs/tween.js";
|
|
30
30
|
import Ut from "deepmerge";
|
|
31
31
|
import zt from "stats-gl";
|
|
32
|
-
import { Vector3 as j, PerspectiveCamera as kt, Matrix4 as W, ShaderMaterial as Ft, UniformsUtils as Nt, RawShaderMaterial as It, MeshBasicMaterial as jt, PointsMaterial as at, SpriteMaterial as lt, Color as Ht, Layers as Bt, Vector2 as B, WebGLRenderTarget as Vt, HalfFloatType as Yt, MathUtils as Zt, Vector4 as Wt, Quaternion as ht, Spherical as Kt, Box3 as ct, Sphere as $t, Raycaster as dt, AxesHelper as De, CameraHelper as Gt, PointLightHelper as Xt, DirectionalLightHelper as qt, SpotLightHelper as Qt, HemisphereLightHelper as Jt, Box3Helper as Ue, Scene as
|
|
32
|
+
import { Vector3 as j, PerspectiveCamera as kt, Matrix4 as W, ShaderMaterial as Ft, UniformsUtils as Nt, RawShaderMaterial as It, MeshBasicMaterial as jt, PointsMaterial as at, SpriteMaterial as lt, Color as Ht, Layers as Bt, Vector2 as B, WebGLRenderTarget as Vt, HalfFloatType as Yt, MathUtils as Zt, Vector4 as Wt, Quaternion as ht, Spherical as Kt, Box3 as ct, Sphere as $t, Raycaster as dt, AxesHelper as De, CameraHelper as Gt, PointLightHelper as Xt, DirectionalLightHelper as qt, SpotLightHelper as Qt, HemisphereLightHelper as Jt, Box3Helper as Ue, Scene as mt, Group as ze, Camera as es, Loader as pt, FileLoader as Se, Texture as ue, VideoTexture as ts, LoadingManager as ss, DataTexture as is, WebGLRenderer as rs, REVISION as os, Object3D as ns, Timer as as } from "three";
|
|
33
33
|
import { M as ft, B as Oe, a as ls, R as Pe, I as he } from "./WebGPULineSegments2.module.js";
|
|
34
34
|
import { EffectComposer as ke } from "three/examples/jsm/postprocessing/EffectComposer";
|
|
35
35
|
import { RenderPass as hs } from "three/examples/jsm/postprocessing/RenderPass";
|
|
@@ -45,8 +45,8 @@ import "three/examples/jsm/utils/BufferGeometryUtils";
|
|
|
45
45
|
import "three-bvh-csg";
|
|
46
46
|
import "three/examples/jsm/lights/RectAreaLightUniformsLib";
|
|
47
47
|
import "three/examples/jsm/lines/LineSegments2";
|
|
48
|
-
import { ShaderPass as
|
|
49
|
-
import { OutputPass as
|
|
48
|
+
import { ShaderPass as ms } from "three/examples/jsm/postprocessing/ShaderPass";
|
|
49
|
+
import { OutputPass as ps } from "three/examples/jsm/postprocessing/OutputPass";
|
|
50
50
|
import { FullScreenQuad as Fe } from "three/examples/jsm/postprocessing/Pass";
|
|
51
51
|
import { RectAreaLightHelper as fs } from "three/examples/jsm/helpers/RectAreaLightHelper";
|
|
52
52
|
import { ViewHelper as us } from "three/examples/jsm/helpers/ViewHelper";
|
|
@@ -83,7 +83,7 @@ const M = {
|
|
|
83
83
|
TOUCH_SCREEN_PAN: 131072,
|
|
84
84
|
TOUCH_DOLLY_SCREEN_PAN: 262144,
|
|
85
85
|
TOUCH_ZOOM_SCREEN_PAN: 524288
|
|
86
|
-
}),
|
|
86
|
+
}), K = {
|
|
87
87
|
NONE: 0,
|
|
88
88
|
IN: 1,
|
|
89
89
|
OUT: -1
|
|
@@ -94,7 +94,7 @@ function Y(c) {
|
|
|
94
94
|
function H(c) {
|
|
95
95
|
return c.isOrthographicCamera;
|
|
96
96
|
}
|
|
97
|
-
const
|
|
97
|
+
const $ = Math.PI * 2, je = Math.PI / 2, ut = 1e-5, ie = Math.PI / 180;
|
|
98
98
|
function k(c, e, t) {
|
|
99
99
|
return Math.max(e, Math.min(t, c));
|
|
100
100
|
}
|
|
@@ -117,25 +117,25 @@ function ce(c, e, t, s, i = 1 / 0, r) {
|
|
|
117
117
|
s = Math.max(1e-4, s);
|
|
118
118
|
const o = 2 / s, n = o * r, a = 1 / (1 + n + 0.48 * n * n + 0.235 * n * n * n);
|
|
119
119
|
let h = c - e;
|
|
120
|
-
const
|
|
121
|
-
h = k(h, -
|
|
120
|
+
const p = e, m = i * s;
|
|
121
|
+
h = k(h, -m, m), e = c - h;
|
|
122
122
|
const v = (t.value + o * h) * r;
|
|
123
123
|
t.value = (t.value - o * v) * a;
|
|
124
124
|
let _ = e + (h + v) * a;
|
|
125
|
-
return
|
|
125
|
+
return p - c > 0 == _ > p && (_ = p, t.value = (_ - p) / r), _;
|
|
126
126
|
}
|
|
127
127
|
function Be(c, e, t, s, i = 1 / 0, r, o) {
|
|
128
128
|
s = Math.max(1e-4, s);
|
|
129
129
|
const n = 2 / s, a = n * r, h = 1 / (1 + a + 0.48 * a * a + 0.235 * a * a * a);
|
|
130
|
-
let
|
|
131
|
-
const y =
|
|
130
|
+
let p = e.x, m = e.y, v = e.z, _ = c.x - p, f = c.y - m, g = c.z - v;
|
|
131
|
+
const y = p, l = m, u = v, O = i * s, C = O * O, w = _ * _ + f * f + g * g;
|
|
132
132
|
if (w > C) {
|
|
133
133
|
const ve = Math.sqrt(w);
|
|
134
134
|
_ = _ / ve * O, f = f / ve * O, g = g / ve * O;
|
|
135
135
|
}
|
|
136
|
-
|
|
136
|
+
p = c.x - _, m = c.y - f, v = c.z - g;
|
|
137
137
|
const E = (t.x + n * _) * r, x = (t.y + n * f) * r, R = (t.z + n * g) * r;
|
|
138
|
-
t.x = (t.x - n * E) * h, t.y = (t.y - n * x) * h, t.z = (t.z - n * R) * h, o.x =
|
|
138
|
+
t.x = (t.x - n * E) * h, t.y = (t.y - n * x) * h, t.z = (t.z - n * R) * h, o.x = p + (_ + E) * h, o.y = m + (f + x) * h, o.z = v + (g + R) * h;
|
|
139
139
|
const V = y - c.x, le = l - c.y, bt = u - c.z, xt = o.x - y, Lt = o.y - l, Pt = o.z - u;
|
|
140
140
|
return V * xt + le * Lt + bt * Pt > 0 && (o.x = y, o.y = l, o.z = u, t.x = (o.x - y) / r, t.y = (o.y - l) / r, t.z = (o.z - u) / r), o;
|
|
141
141
|
}
|
|
@@ -212,10 +212,10 @@ class ws {
|
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
214
|
const de = 1 / 8, bs = /Mac/.test(navigator.platform);
|
|
215
|
-
let T, Ve,
|
|
216
|
-
class
|
|
215
|
+
let T, Ve, me, we, D, b, L, G, ne, F, N, Z, Ye, Ze, z, ae, X, We, be, Ke, xe, Le, pe;
|
|
216
|
+
class J extends ws {
|
|
217
217
|
static install(e) {
|
|
218
|
-
T = e.THREE, Ve = Object.freeze(new T.Vector3(0, 0, 0)),
|
|
218
|
+
T = e.THREE, Ve = Object.freeze(new T.Vector3(0, 0, 0)), me = Object.freeze(new T.Vector3(0, 1, 0)), we = Object.freeze(new T.Vector3(0, 0, 1)), D = new T.Vector2(), b = 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(), be = new T.Sphere(), Ke = new T.Quaternion(), xe = new T.Quaternion(), Le = new T.Matrix4(), pe = new T.Raycaster();
|
|
219
219
|
}
|
|
220
220
|
/**
|
|
221
221
|
* list all ACTIONs
|
|
@@ -243,7 +243,7 @@ class te extends ws {
|
|
|
243
243
|
*/
|
|
244
244
|
constructor(e, t) {
|
|
245
245
|
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 = () => {
|
|
246
|
-
}, this._enabled = !0, this._state = d.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 =
|
|
246
|
+
}, this._enabled = !0, this._state = d.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 = K.NONE, this._thetaVelocity = { value: 0 }, this._phiVelocity = { value: 0 }, this._radiusVelocity = { value: 0 }, this._targetVelocity = new T.Vector3(), this._focalOffsetVelocity = new T.Vector3(), this._zoomVelocity = { value: 0 }, this._truckInternal = (l, u, O, C) => {
|
|
247
247
|
let w, E;
|
|
248
248
|
if (Y(this._camera)) {
|
|
249
249
|
const x = b.copy(this._camera.position).sub(this._target), R = this._camera.getEffectiveFOV() * ie, V = x.length() * Math.tan(R * 0.5);
|
|
@@ -265,7 +265,7 @@ class te extends ws {
|
|
|
265
265
|
!0
|
|
266
266
|
) : this.truck(w, E, !0);
|
|
267
267
|
}, this._rotateInternal = (l, u) => {
|
|
268
|
-
const O =
|
|
268
|
+
const O = $ * this.azimuthRotateSpeed * l / this._elementRect.height, C = $ * this.polarRotateSpeed * u / this._elementRect.height;
|
|
269
269
|
this.rotate(O, C, !0);
|
|
270
270
|
}, this._dollyInternal = (l, u, O) => {
|
|
271
271
|
const C = Math.pow(0.95, -l * this.dollySpeed), w = this._sphericalEnd.radius, E = this._sphericalEnd.radius * C, x = k(
|
|
@@ -281,7 +281,7 @@ class te extends ws {
|
|
|
281
281
|
"camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."
|
|
282
282
|
), this._camera = e, this._yAxisUpSpace = new T.Quaternion().setFromUnitVectors(
|
|
283
283
|
this._camera.up,
|
|
284
|
-
|
|
284
|
+
me
|
|
285
285
|
), this._yAxisUpSpaceInverse = this._yAxisUpSpace.clone().invert(), this._state = d.NONE, this._target = new T.Vector3(), this._targetEnd = this._target.clone(), this._focalOffset = new T.Vector3(), this._focalOffsetEnd = this._focalOffset.clone(), this._spherical = new T.Spherical().setFromVector3(
|
|
286
286
|
b.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)
|
|
287
287
|
), this._sphericalEnd = this._spherical.clone(), this._lastDistance = this._spherical.radius, this._zoom = this._camera.zoom, this._zoomEnd = this._zoom, this._lastZoom = this._zoom, this._nearPlaneCorners = [
|
|
@@ -380,7 +380,7 @@ class te extends ws {
|
|
|
380
380
|
}
|
|
381
381
|
};
|
|
382
382
|
let h = -1;
|
|
383
|
-
const
|
|
383
|
+
const p = (l) => {
|
|
384
384
|
if (!this._domElement || !this._enabled || this.mouseButtons.wheel === d.NONE) return;
|
|
385
385
|
if (this._interactiveArea.left !== 0 || this._interactiveArea.top !== 0 || this._interactiveArea.width !== 1 || this._interactiveArea.height !== 1) {
|
|
386
386
|
const E = this._domElement.getBoundingClientRect(), x = (l.clientX - E.left) / (E.right - E.left), R = (l.clientY - E.top) / (E.bottom - E.top);
|
|
@@ -419,9 +419,9 @@ class te extends ws {
|
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
421
|
this.dispatchEvent({ type: "control" });
|
|
422
|
-
},
|
|
422
|
+
}, m = (l) => {
|
|
423
423
|
if (!(!this._domElement || !this._enabled)) {
|
|
424
|
-
if (this.mouseButtons.right ===
|
|
424
|
+
if (this.mouseButtons.right === J.ACTION.NONE) {
|
|
425
425
|
const u = l instanceof PointerEvent ? l.pointerId : 0, O = this._findPointerById(u);
|
|
426
426
|
O && this._disposePointer(O), this._domElement.ownerDocument.removeEventListener(
|
|
427
427
|
"pointermove",
|
|
@@ -437,8 +437,8 @@ class te extends ws {
|
|
|
437
437
|
}
|
|
438
438
|
}, v = (l) => {
|
|
439
439
|
if (!this._enabled) return;
|
|
440
|
-
if (Ee(this._activePointers,
|
|
441
|
-
const O =
|
|
440
|
+
if (Ee(this._activePointers, D), this._getClientRect(this._elementRect), s.copy(D), i.copy(D), this._activePointers.length >= 2) {
|
|
441
|
+
const O = D.x - this._activePointers[1].clientX, C = D.y - this._activePointers[1].clientY, w = Math.sqrt(O * O + C * C);
|
|
442
442
|
r.set(0, w);
|
|
443
443
|
const E = (this._activePointers[0].clientX + this._activePointers[1].clientX) * 0.5, x = (this._activePointers[0].clientY + this._activePointers[1].clientY) * 0.5;
|
|
444
444
|
i.set(E, x);
|
|
@@ -462,9 +462,9 @@ class te extends ws {
|
|
|
462
462
|
((this._state & d.ROTATE) === d.ROTATE || (this._state & d.TOUCH_ROTATE) === d.TOUCH_ROTATE || (this._state & d.TOUCH_DOLLY_ROTATE) === d.TOUCH_DOLLY_ROTATE || (this._state & d.TOUCH_ZOOM_ROTATE) === d.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 & d.TRUCK) === d.TRUCK || (this._state & d.SCREEN_PAN) === d.SCREEN_PAN || (this._state & d.TOUCH_TRUCK) === d.TOUCH_TRUCK || (this._state & d.TOUCH_SCREEN_PAN) === d.TOUCH_SCREEN_PAN || (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_ZOOM_TRUCK) === d.TOUCH_ZOOM_TRUCK || (this._state & d.TOUCH_ZOOM_SCREEN_PAN) === d.TOUCH_DOLLY_SCREEN_PAN) && (this._targetEnd.copy(this._target), this._targetVelocity.set(0, 0, 0)), ((this._state & d.DOLLY) === d.DOLLY || (this._state & d.TOUCH_DOLLY) === d.TOUCH_DOLLY || (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._state & d.TOUCH_DOLLY_ROTATE) === d.TOUCH_DOLLY_ROTATE) && (this._sphericalEnd.radius = this._spherical.radius, this._radiusVelocity.value = 0), ((this._state & d.ZOOM) === d.ZOOM || (this._state & d.TOUCH_ZOOM) === d.TOUCH_ZOOM || (this._state & d.TOUCH_ZOOM_TRUCK) === d.TOUCH_ZOOM_TRUCK || (this._state & d.TOUCH_ZOOM_SCREEN_PAN) === d.TOUCH_ZOOM_SCREEN_PAN || (this._state & d.TOUCH_ZOOM_OFFSET) === d.TOUCH_ZOOM_OFFSET || (this._state & d.TOUCH_ZOOM_ROTATE) === d.TOUCH_ZOOM_ROTATE) && (this._zoomEnd = this._zoom, this._zoomVelocity.value = 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._focalOffsetEnd.copy(this._focalOffset), this._focalOffsetVelocity.set(0, 0, 0)), this.dispatchEvent({ type: "controlstart" });
|
|
463
463
|
}, _ = () => {
|
|
464
464
|
if (!this._enabled || !this._dragNeedsUpdate) return;
|
|
465
|
-
this._dragNeedsUpdate = !1, Ee(this._activePointers,
|
|
466
|
-
const u = this._domElement && this._domElement.ownerDocument.pointerLockElement === this._domElement ? this._lockedPointer || this._activePointers[0] : null, O = u ? -u.deltaX : i.x -
|
|
467
|
-
if (i.copy(
|
|
465
|
+
this._dragNeedsUpdate = !1, Ee(this._activePointers, D);
|
|
466
|
+
const u = this._domElement && this._domElement.ownerDocument.pointerLockElement === this._domElement ? this._lockedPointer || this._activePointers[0] : null, O = u ? -u.deltaX : i.x - D.x, C = u ? -u.deltaY : i.y - D.y;
|
|
467
|
+
if (i.copy(D), ((this._state & d.ROTATE) === d.ROTATE || (this._state & d.TOUCH_ROTATE) === d.TOUCH_ROTATE || (this._state & d.TOUCH_DOLLY_ROTATE) === d.TOUCH_DOLLY_ROTATE || (this._state & d.TOUCH_ZOOM_ROTATE) === d.TOUCH_ZOOM_ROTATE) && (this._rotateInternal(O, C), this._isUserControllingRotate = !0), (this._state & d.DOLLY) === d.DOLLY || (this._state & d.ZOOM) === d.ZOOM) {
|
|
468
468
|
const w = this.dollyToCursor ? (s.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, E = this.dollyToCursor ? (s.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0, x = this.dollyDragInverted ? -1 : 1;
|
|
469
469
|
(this._state & d.DOLLY) === d.DOLLY ? (this._dollyInternal(
|
|
470
470
|
x * C * de,
|
|
@@ -477,14 +477,14 @@ class te extends ws {
|
|
|
477
477
|
), this._isUserControllingZoom = !0);
|
|
478
478
|
}
|
|
479
479
|
if ((this._state & d.TOUCH_DOLLY) === d.TOUCH_DOLLY || (this._state & d.TOUCH_ZOOM) === d.TOUCH_ZOOM || (this._state & d.TOUCH_DOLLY_TRUCK) === d.TOUCH_DOLLY_TRUCK || (this._state & d.TOUCH_ZOOM_TRUCK) === d.TOUCH_ZOOM_TRUCK || (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._state & d.TOUCH_DOLLY_OFFSET) === d.TOUCH_DOLLY_OFFSET || (this._state & d.TOUCH_ZOOM_OFFSET) === d.TOUCH_ZOOM_OFFSET || (this._state & d.TOUCH_DOLLY_ROTATE) === d.TOUCH_DOLLY_ROTATE || (this._state & d.TOUCH_ZOOM_ROTATE) === d.TOUCH_ZOOM_ROTATE) {
|
|
480
|
-
const w =
|
|
480
|
+
const w = D.x - this._activePointers[1].clientX, E = D.y - this._activePointers[1].clientY, x = Math.sqrt(w * w + E * E), R = r.y - x;
|
|
481
481
|
r.set(0, x);
|
|
482
482
|
const V = this.dollyToCursor ? (i.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, le = this.dollyToCursor ? (i.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
|
|
483
483
|
(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 * de, V, le), this._isUserControllingDolly = !0) : (this._zoomInternal(R * de, V, le), this._isUserControllingZoom = !0);
|
|
484
484
|
}
|
|
485
485
|
((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" });
|
|
486
486
|
}, f = () => {
|
|
487
|
-
Ee(this._activePointers,
|
|
487
|
+
Ee(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(
|
|
488
488
|
"pointermove",
|
|
489
489
|
n,
|
|
490
490
|
{ passive: !1 }
|
|
@@ -535,13 +535,13 @@ class te extends ws {
|
|
|
535
535
|
this.unlockPointer();
|
|
536
536
|
};
|
|
537
537
|
this._addAllEventListeners = (l) => {
|
|
538
|
-
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",
|
|
538
|
+
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", p, {
|
|
539
539
|
passive: !1
|
|
540
|
-
}), this._domElement.addEventListener("contextmenu",
|
|
540
|
+
}), this._domElement.addEventListener("contextmenu", m);
|
|
541
541
|
}, this._removeAllEventListeners = () => {
|
|
542
|
-
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",
|
|
542
|
+
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", p, {
|
|
543
543
|
passive: !1
|
|
544
|
-
}), this._domElement.removeEventListener("contextmenu",
|
|
544
|
+
}), this._domElement.removeEventListener("contextmenu", m), this._domElement.ownerDocument.removeEventListener(
|
|
545
545
|
"pointermove",
|
|
546
546
|
n,
|
|
547
547
|
{ passive: !1 }
|
|
@@ -821,7 +821,7 @@ class te extends ws {
|
|
|
821
821
|
* @category Methods
|
|
822
822
|
*/
|
|
823
823
|
dollyTo(e, t = !1) {
|
|
824
|
-
return this._isUserControllingDolly = !1, this._lastDollyDirection =
|
|
824
|
+
return this._isUserControllingDolly = !1, this._lastDollyDirection = K.NONE, this._changedDolly = 0, this._dollyToNoClamp(
|
|
825
825
|
k(e, this.minDistance, this.maxDistance),
|
|
826
826
|
t
|
|
827
827
|
);
|
|
@@ -981,14 +981,14 @@ class te extends ws {
|
|
|
981
981
|
paddingBottom: o = 0,
|
|
982
982
|
paddingTop: n = 0
|
|
983
983
|
} = {}) {
|
|
984
|
-
const a = [], h = e.isBox3 ?
|
|
984
|
+
const a = [], h = e.isBox3 ? X.copy(e) : X.setFromObject(e);
|
|
985
985
|
h.isEmpty() && (console.warn(
|
|
986
986
|
"camera-controls: fitTo() cannot be used with an empty box. Aborting"
|
|
987
987
|
), Promise.resolve());
|
|
988
|
-
const
|
|
989
|
-
a.push(this.rotateTo(
|
|
988
|
+
const p = He(this._sphericalEnd.theta, je), m = He(this._sphericalEnd.phi, je);
|
|
989
|
+
a.push(this.rotateTo(p, m, t));
|
|
990
990
|
const v = b.setFromSpherical(this._sphericalEnd).normalize(), _ = Ke.setFromUnitVectors(v, we), f = P(Math.abs(v.y), 1);
|
|
991
|
-
f && _.multiply(xe.setFromAxisAngle(
|
|
991
|
+
f && _.multiply(xe.setFromAxisAngle(me, p)), _.multiply(this._yAxisUpSpaceInverse);
|
|
992
992
|
const g = We.makeEmpty();
|
|
993
993
|
L.copy(h.min).applyQuaternion(_), g.expandByPoint(L), L.copy(h.min).setX(h.max.x).applyQuaternion(_), g.expandByPoint(L), L.copy(h.min).setY(h.max.y).applyQuaternion(_), g.expandByPoint(L), L.copy(h.max).setZ(h.min.z).applyQuaternion(_), g.expandByPoint(L), L.copy(h.min).setZ(h.max.z).applyQuaternion(_), g.expandByPoint(L), L.copy(h.max).setY(h.min.y).applyQuaternion(_), g.expandByPoint(L), L.copy(h.max).setX(h.min.x).applyQuaternion(_), g.expandByPoint(L), L.copy(h.max).applyQuaternion(_), g.expandByPoint(L), g.min.x -= i, g.min.y -= o, g.max.x += r, g.max.y += n, _.setFromUnitVectors(we, v), f && _.premultiply(xe.invert()), _.premultiply(this._yAxisUpSpace);
|
|
994
994
|
const y = g.getSize(b), l = g.getCenter(L).applyQuaternion(_);
|
|
@@ -1017,7 +1017,7 @@ class te extends ws {
|
|
|
1017
1017
|
* @category Methods
|
|
1018
1018
|
*/
|
|
1019
1019
|
fitToSphere(e, t) {
|
|
1020
|
-
const s = [], r = "isObject3D" in e ?
|
|
1020
|
+
const s = [], r = "isObject3D" in e ? J.createBoundingSphere(e, be) : be.copy(e);
|
|
1021
1021
|
if (s.push(
|
|
1022
1022
|
this.moveTo(
|
|
1023
1023
|
r.center.x,
|
|
@@ -1046,12 +1046,12 @@ class te extends ws {
|
|
|
1046
1046
|
* @category Methods
|
|
1047
1047
|
*/
|
|
1048
1048
|
setLookAt(e, t, s, i, r, o, n = !1) {
|
|
1049
|
-
this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._lastDollyDirection =
|
|
1049
|
+
this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._lastDollyDirection = K.NONE, this._changedDolly = 0;
|
|
1050
1050
|
const a = L.set(i, r, o), h = b.set(e, t, s);
|
|
1051
1051
|
this._targetEnd.copy(a), this._sphericalEnd.setFromVector3(
|
|
1052
1052
|
h.sub(a).applyQuaternion(this._yAxisUpSpace)
|
|
1053
1053
|
), this.normalizeRotations(), this._needsUpdate = !0, n || (this._target.copy(this._targetEnd), this._spherical.copy(this._sphericalEnd));
|
|
1054
|
-
const
|
|
1054
|
+
const p = !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(
|
|
1055
1055
|
this._spherical.theta,
|
|
1056
1056
|
this._sphericalEnd.theta,
|
|
1057
1057
|
this.restThreshold
|
|
@@ -1064,7 +1064,7 @@ class te extends ws {
|
|
|
1064
1064
|
this._sphericalEnd.radius,
|
|
1065
1065
|
this.restThreshold
|
|
1066
1066
|
);
|
|
1067
|
-
return this._createOnRestPromise(
|
|
1067
|
+
return this._createOnRestPromise(p);
|
|
1068
1068
|
}
|
|
1069
1069
|
/**
|
|
1070
1070
|
* Similar to setLookAt, but it interpolates between two states.
|
|
@@ -1084,13 +1084,13 @@ class te extends ws {
|
|
|
1084
1084
|
* @param enableTransition
|
|
1085
1085
|
* @category Methods
|
|
1086
1086
|
*/
|
|
1087
|
-
lerpLookAt(e, t, s, i, r, o, n, a, h,
|
|
1088
|
-
this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._lastDollyDirection =
|
|
1087
|
+
lerpLookAt(e, t, s, i, r, o, n, a, h, p, m, v, _, f = !1) {
|
|
1088
|
+
this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._lastDollyDirection = K.NONE, this._changedDolly = 0;
|
|
1089
1089
|
const g = b.set(i, r, o), y = L.set(e, t, s);
|
|
1090
1090
|
z.setFromVector3(
|
|
1091
1091
|
y.sub(g).applyQuaternion(this._yAxisUpSpace)
|
|
1092
1092
|
);
|
|
1093
|
-
const l =
|
|
1093
|
+
const l = G.set(p, m, v), u = L.set(n, a, h);
|
|
1094
1094
|
ae.setFromVector3(
|
|
1095
1095
|
u.sub(l).applyQuaternion(this._yAxisUpSpace)
|
|
1096
1096
|
), this._targetEnd.copy(g.lerp(l, _));
|
|
@@ -1295,7 +1295,7 @@ class te extends ws {
|
|
|
1295
1295
|
* @category Methods
|
|
1296
1296
|
*/
|
|
1297
1297
|
normalizeRotations() {
|
|
1298
|
-
this._sphericalEnd.theta = this._sphericalEnd.theta %
|
|
1298
|
+
this._sphericalEnd.theta = this._sphericalEnd.theta % $, this._sphericalEnd.theta < 0 && (this._sphericalEnd.theta += $), this._spherical.theta += $ * Math.round((this._sphericalEnd.theta - this._spherical.theta) / $);
|
|
1299
1299
|
}
|
|
1300
1300
|
/**
|
|
1301
1301
|
* stop all transitions.
|
|
@@ -1347,7 +1347,7 @@ class te extends ws {
|
|
|
1347
1347
|
* @category Methods
|
|
1348
1348
|
*/
|
|
1349
1349
|
updateCameraUp() {
|
|
1350
|
-
this._yAxisUpSpace.setFromUnitVectors(this._camera.up,
|
|
1350
|
+
this._yAxisUpSpace.setFromUnitVectors(this._camera.up, me), this._yAxisUpSpaceInverse.copy(this._yAxisUpSpace).invert();
|
|
1351
1351
|
}
|
|
1352
1352
|
/**
|
|
1353
1353
|
* Apply current camera-up direction to the camera.
|
|
@@ -1375,12 +1375,12 @@ class te extends ws {
|
|
|
1375
1375
|
if (A(t))
|
|
1376
1376
|
this._thetaVelocity.value = 0, this._spherical.theta = this._sphericalEnd.theta;
|
|
1377
1377
|
else {
|
|
1378
|
-
const
|
|
1378
|
+
const m = this._isUserControllingRotate ? this.draggingSmoothTime : this.smoothTime;
|
|
1379
1379
|
this._spherical.theta = ce(
|
|
1380
1380
|
this._spherical.theta,
|
|
1381
1381
|
this._sphericalEnd.theta,
|
|
1382
1382
|
this._thetaVelocity,
|
|
1383
|
-
|
|
1383
|
+
m,
|
|
1384
1384
|
1 / 0,
|
|
1385
1385
|
e
|
|
1386
1386
|
), this._needsUpdate = !0;
|
|
@@ -1388,12 +1388,12 @@ class te extends ws {
|
|
|
1388
1388
|
if (A(s))
|
|
1389
1389
|
this._phiVelocity.value = 0, this._spherical.phi = this._sphericalEnd.phi;
|
|
1390
1390
|
else {
|
|
1391
|
-
const
|
|
1391
|
+
const m = this._isUserControllingRotate ? this.draggingSmoothTime : this.smoothTime;
|
|
1392
1392
|
this._spherical.phi = ce(
|
|
1393
1393
|
this._spherical.phi,
|
|
1394
1394
|
this._sphericalEnd.phi,
|
|
1395
1395
|
this._phiVelocity,
|
|
1396
|
-
|
|
1396
|
+
m,
|
|
1397
1397
|
1 / 0,
|
|
1398
1398
|
e
|
|
1399
1399
|
), this._needsUpdate = !0;
|
|
@@ -1401,12 +1401,12 @@ class te extends ws {
|
|
|
1401
1401
|
if (A(i))
|
|
1402
1402
|
this._radiusVelocity.value = 0, this._spherical.radius = this._sphericalEnd.radius;
|
|
1403
1403
|
else {
|
|
1404
|
-
const
|
|
1404
|
+
const m = this._isUserControllingDolly ? this.draggingSmoothTime : this.smoothTime;
|
|
1405
1405
|
this._spherical.radius = ce(
|
|
1406
1406
|
this._spherical.radius,
|
|
1407
1407
|
this._sphericalEnd.radius,
|
|
1408
1408
|
this._radiusVelocity,
|
|
1409
|
-
|
|
1409
|
+
m,
|
|
1410
1410
|
this.maxSpeed,
|
|
1411
1411
|
e
|
|
1412
1412
|
), this._needsUpdate = !0;
|
|
@@ -1414,12 +1414,12 @@ class te extends ws {
|
|
|
1414
1414
|
if (A(r.x) && A(r.y) && A(r.z))
|
|
1415
1415
|
this._targetVelocity.set(0, 0, 0), this._target.copy(this._targetEnd);
|
|
1416
1416
|
else {
|
|
1417
|
-
const
|
|
1417
|
+
const m = this._isUserControllingTruck ? this.draggingSmoothTime : this.smoothTime;
|
|
1418
1418
|
Be(
|
|
1419
1419
|
this._target,
|
|
1420
1420
|
this._targetEnd,
|
|
1421
1421
|
this._targetVelocity,
|
|
1422
|
-
|
|
1422
|
+
m,
|
|
1423
1423
|
this.maxSpeed,
|
|
1424
1424
|
e,
|
|
1425
1425
|
this._target
|
|
@@ -1428,12 +1428,12 @@ class te extends ws {
|
|
|
1428
1428
|
if (A(o.x) && A(o.y) && A(o.z))
|
|
1429
1429
|
this._focalOffsetVelocity.set(0, 0, 0), this._focalOffset.copy(this._focalOffsetEnd);
|
|
1430
1430
|
else {
|
|
1431
|
-
const
|
|
1431
|
+
const m = this._isUserControllingOffset ? this.draggingSmoothTime : this.smoothTime;
|
|
1432
1432
|
Be(
|
|
1433
1433
|
this._focalOffset,
|
|
1434
1434
|
this._focalOffsetEnd,
|
|
1435
1435
|
this._focalOffsetVelocity,
|
|
1436
|
-
|
|
1436
|
+
m,
|
|
1437
1437
|
this.maxSpeed,
|
|
1438
1438
|
e,
|
|
1439
1439
|
this._focalOffset
|
|
@@ -1442,46 +1442,46 @@ class te extends ws {
|
|
|
1442
1442
|
if (A(n))
|
|
1443
1443
|
this._zoomVelocity.value = 0, this._zoom = this._zoomEnd;
|
|
1444
1444
|
else {
|
|
1445
|
-
const
|
|
1445
|
+
const m = this._isUserControllingZoom ? this.draggingSmoothTime : this.smoothTime;
|
|
1446
1446
|
this._zoom = ce(
|
|
1447
1447
|
this._zoom,
|
|
1448
1448
|
this._zoomEnd,
|
|
1449
1449
|
this._zoomVelocity,
|
|
1450
|
-
|
|
1450
|
+
m,
|
|
1451
1451
|
1 / 0,
|
|
1452
1452
|
e
|
|
1453
1453
|
);
|
|
1454
1454
|
}
|
|
1455
1455
|
if (this.dollyToCursor) {
|
|
1456
1456
|
if (Y(this._camera) && this._changedDolly !== 0) {
|
|
1457
|
-
const
|
|
1457
|
+
const m = this._spherical.radius - this._lastDistance, v = this._camera, _ = this._getCameraDirection(ne), f = b.copy(_).cross(v.up).normalize();
|
|
1458
1458
|
f.lengthSq() === 0 && (f.x = 1);
|
|
1459
|
-
const g = L.crossVectors(f, _), y = this._sphericalEnd.radius * Math.tan(v.getEffectiveFOV() * ie * 0.5), u = (this._sphericalEnd.radius -
|
|
1459
|
+
const g = L.crossVectors(f, _), y = this._sphericalEnd.radius * Math.tan(v.getEffectiveFOV() * ie * 0.5), u = (this._sphericalEnd.radius - m - this._sphericalEnd.radius) / this._sphericalEnd.radius, O = G.copy(this._targetEnd).add(
|
|
1460
1460
|
f.multiplyScalar(
|
|
1461
1461
|
this._dollyControlCoord.x * y * v.aspect
|
|
1462
1462
|
)
|
|
1463
1463
|
).add(
|
|
1464
1464
|
g.multiplyScalar(this._dollyControlCoord.y * y)
|
|
1465
|
-
), C = b.copy(this._targetEnd).lerp(O, u), w = this._lastDollyDirection ===
|
|
1465
|
+
), C = b.copy(this._targetEnd).lerp(O, u), w = this._lastDollyDirection === K.IN && this._spherical.radius <= this.minDistance, E = this._lastDollyDirection === K.OUT && this.maxDistance <= this._spherical.radius;
|
|
1466
1466
|
if (this.infinityDolly && (w || E)) {
|
|
1467
|
-
this._sphericalEnd.radius -=
|
|
1468
|
-
const R = L.copy(_).multiplyScalar(-
|
|
1467
|
+
this._sphericalEnd.radius -= m, this._spherical.radius -= m;
|
|
1468
|
+
const R = L.copy(_).multiplyScalar(-m);
|
|
1469
1469
|
C.add(R);
|
|
1470
1470
|
}
|
|
1471
1471
|
this._boundary.clampPoint(C, C);
|
|
1472
1472
|
const x = L.subVectors(C, this._targetEnd);
|
|
1473
|
-
this._targetEnd.copy(C), this._target.add(x), this._changedDolly -=
|
|
1473
|
+
this._targetEnd.copy(C), this._target.add(x), this._changedDolly -= m, A(this._changedDolly) && (this._changedDolly = 0);
|
|
1474
1474
|
} else if (H(this._camera) && this._changedZoom !== 0) {
|
|
1475
|
-
const
|
|
1475
|
+
const m = this._zoom - this._lastZoom, v = this._camera, _ = b.set(
|
|
1476
1476
|
this._dollyControlCoord.x,
|
|
1477
1477
|
this._dollyControlCoord.y,
|
|
1478
1478
|
(v.near + v.far) / (v.near - v.far)
|
|
1479
|
-
).unproject(v), f = L.set(0, 0, -1).applyQuaternion(v.quaternion), g =
|
|
1479
|
+
).unproject(v), f = L.set(0, 0, -1).applyQuaternion(v.quaternion), g = G.copy(_).add(f.multiplyScalar(-_.dot(v.up))), l = -(this._zoom - m - this._zoom) / this._zoom, u = this._getCameraDirection(ne), O = this._targetEnd.dot(u), C = b.copy(this._targetEnd).lerp(g, l), w = C.dot(u), E = u.multiplyScalar(
|
|
1480
1480
|
w - O
|
|
1481
1481
|
);
|
|
1482
1482
|
C.sub(E), this._boundary.clampPoint(C, C);
|
|
1483
1483
|
const x = L.subVectors(C, this._targetEnd);
|
|
1484
|
-
this._targetEnd.copy(C), this._target.add(x), this._changedZoom -=
|
|
1484
|
+
this._targetEnd.copy(C), this._target.add(x), this._changedZoom -= m, A(this._changedZoom) && (this._changedZoom = 0);
|
|
1485
1485
|
}
|
|
1486
1486
|
}
|
|
1487
1487
|
this._camera.zoom !== this._zoom && (this._camera.zoom = this._zoom, this._camera.updateProjectionMatrix(), this._updateNearPlaneCorners(), this._needsUpdate = !0), this._dragNeedsUpdate = !0;
|
|
@@ -1491,8 +1491,8 @@ class te extends ws {
|
|
|
1491
1491
|
b.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse),
|
|
1492
1492
|
1
|
|
1493
1493
|
);
|
|
1494
|
-
const
|
|
1495
|
-
return
|
|
1494
|
+
const p = this._needsUpdate;
|
|
1495
|
+
return p && !this._updatedLastTime ? (this._hasRested = !1, this.dispatchEvent({ type: "wake" }), this.dispatchEvent({ type: "update" })) : p ? (this.dispatchEvent({ type: "update" }), A(t, this.restThreshold) && A(s, this.restThreshold) && A(i, this.restThreshold) && A(r.x, this.restThreshold) && A(r.y, this.restThreshold) && A(r.z, this.restThreshold) && A(o.x, this.restThreshold) && A(o.y, this.restThreshold) && A(o.z, this.restThreshold) && A(n, this.restThreshold) && !this._hasRested && (this._hasRested = !0, this.dispatchEvent({ type: "rest" }))) : !p && 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 = p, this._needsUpdate = !1, p;
|
|
1496
1496
|
}
|
|
1497
1497
|
/**
|
|
1498
1498
|
* Get all state in JSON string
|
|
@@ -1590,7 +1590,7 @@ class te extends ws {
|
|
|
1590
1590
|
const i = t.lengthSq();
|
|
1591
1591
|
if (i === 0)
|
|
1592
1592
|
return e;
|
|
1593
|
-
const r = L.copy(t).add(e), n = this._boundary.clampPoint(r,
|
|
1593
|
+
const r = L.copy(t).add(e), n = this._boundary.clampPoint(r, G).sub(r), a = n.lengthSq();
|
|
1594
1594
|
if (a === 0)
|
|
1595
1595
|
return e.add(t);
|
|
1596
1596
|
if (a === i)
|
|
@@ -1621,9 +1621,9 @@ class te extends ws {
|
|
|
1621
1621
|
for (let i = 0; i < 4; i++) {
|
|
1622
1622
|
const r = L.copy(this._nearPlaneCorners[i]);
|
|
1623
1623
|
r.applyMatrix4(Le);
|
|
1624
|
-
const o =
|
|
1625
|
-
|
|
1626
|
-
const n =
|
|
1624
|
+
const o = G.addVectors(this._target, r);
|
|
1625
|
+
pe.set(o, s), pe.far = this._spherical.radius + 1;
|
|
1626
|
+
const n = pe.intersectObjects(this.colliderMeshes);
|
|
1627
1627
|
n.length !== 0 && n[0].distance < e && (e = n[0].distance);
|
|
1628
1628
|
}
|
|
1629
1629
|
return e;
|
|
@@ -1691,9 +1691,9 @@ class te extends ws {
|
|
|
1691
1691
|
}
|
|
1692
1692
|
static createBoundingSphere(e, t = new T.Sphere()) {
|
|
1693
1693
|
const s = t, i = s.center;
|
|
1694
|
-
|
|
1695
|
-
o.isMesh &&
|
|
1696
|
-
}),
|
|
1694
|
+
X.makeEmpty(), e.traverseVisible((o) => {
|
|
1695
|
+
o.isMesh && X.expandByObject(o);
|
|
1696
|
+
}), X.getCenter(i);
|
|
1697
1697
|
let r = 0;
|
|
1698
1698
|
return e.traverseVisible((o) => {
|
|
1699
1699
|
if (!o.isMesh) return;
|
|
@@ -1701,16 +1701,16 @@ class te extends ws {
|
|
|
1701
1701
|
if (!n.geometry) return;
|
|
1702
1702
|
const a = n.geometry.clone();
|
|
1703
1703
|
a.applyMatrix4(n.matrixWorld);
|
|
1704
|
-
const
|
|
1705
|
-
for (let
|
|
1706
|
-
b.fromBufferAttribute(
|
|
1704
|
+
const p = a.attributes.position;
|
|
1705
|
+
for (let m = 0, v = p.count; m < v; m++)
|
|
1706
|
+
b.fromBufferAttribute(p, m), r = Math.max(r, i.distanceToSquared(b));
|
|
1707
1707
|
}), s.radius = Math.sqrt(r), s;
|
|
1708
1708
|
}
|
|
1709
1709
|
}
|
|
1710
|
-
var Ae = { exports: {} },
|
|
1710
|
+
var Ae = { exports: {} }, Q = typeof Reflect == "object" ? Reflect : null, $e = Q && typeof Q.apply == "function" ? Q.apply : function(e, t, s) {
|
|
1711
1711
|
return Function.prototype.apply.call(e, t, s);
|
|
1712
1712
|
}, fe;
|
|
1713
|
-
|
|
1713
|
+
Q && typeof Q.ownKeys == "function" ? fe = Q.ownKeys : Object.getOwnPropertySymbols ? fe = function(e) {
|
|
1714
1714
|
return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e));
|
|
1715
1715
|
} : fe = function(e) {
|
|
1716
1716
|
return Object.getOwnPropertyNames(e);
|
|
@@ -1780,8 +1780,8 @@ S.prototype.emit = function(e) {
|
|
|
1780
1780
|
if (typeof a == "function")
|
|
1781
1781
|
$e(a, this, t);
|
|
1782
1782
|
else
|
|
1783
|
-
for (var h = a.length,
|
|
1784
|
-
$e(
|
|
1783
|
+
for (var h = a.length, p = Et(a, h), s = 0; s < h; ++s)
|
|
1784
|
+
$e(p[s], this, t);
|
|
1785
1785
|
return !0;
|
|
1786
1786
|
};
|
|
1787
1787
|
function yt(c, e, t, s) {
|
|
@@ -1957,7 +1957,7 @@ let Rs = class {
|
|
|
1957
1957
|
return (this.mask & (1 << e | 0)) !== 0;
|
|
1958
1958
|
}
|
|
1959
1959
|
};
|
|
1960
|
-
class
|
|
1960
|
+
class ee {
|
|
1961
1961
|
constructor() {
|
|
1962
1962
|
this.event = new ye.EventEmitter(), this.controllerMap = /* @__PURE__ */ new Map(), this.activeIndex = -1, this.activeControllerSet = /* @__PURE__ */ new Set();
|
|
1963
1963
|
}
|
|
@@ -1997,7 +1997,7 @@ const wt = {
|
|
|
1997
1997
|
far: 1e3,
|
|
1998
1998
|
up: new j(0, 1, 0)
|
|
1999
1999
|
};
|
|
2000
|
-
class Ds extends
|
|
2000
|
+
class Ds extends ee {
|
|
2001
2001
|
constructor(e) {
|
|
2002
2002
|
super(), this.width = 0, this.height = 0, this.width = e.width, this.height = e.height;
|
|
2003
2003
|
}
|
|
@@ -2078,7 +2078,7 @@ class Ds extends se {
|
|
|
2078
2078
|
}
|
|
2079
2079
|
}
|
|
2080
2080
|
const Us = (c) => {
|
|
2081
|
-
const e = new
|
|
2081
|
+
const e = new ms(
|
|
2082
2082
|
new Ft({
|
|
2083
2083
|
uniforms: {
|
|
2084
2084
|
baseTexture: { value: null },
|
|
@@ -2207,7 +2207,7 @@ const Us = (c) => {
|
|
|
2207
2207
|
}`
|
|
2208
2208
|
)
|
|
2209
2209
|
};
|
|
2210
|
-
class ks extends
|
|
2210
|
+
class ks extends ps {
|
|
2211
2211
|
constructor() {
|
|
2212
2212
|
super();
|
|
2213
2213
|
const e = zs;
|
|
@@ -2258,20 +2258,20 @@ class Ws {
|
|
|
2258
2258
|
composerParams: r
|
|
2259
2259
|
} = e, { renderer: o } = t;
|
|
2260
2260
|
this.renderer = o;
|
|
2261
|
-
const { multisampling: n } = r, { maxSamples: a } = o.capabilities, h = o.getDrawingBufferSize(new B()),
|
|
2261
|
+
const { multisampling: n } = r, { maxSamples: a } = o.capabilities, h = o.getDrawingBufferSize(new B()), p = new Vt(
|
|
2262
2262
|
h.width,
|
|
2263
2263
|
h.height,
|
|
2264
2264
|
{
|
|
2265
2265
|
samples: Math.min(n, a),
|
|
2266
2266
|
type: Yt
|
|
2267
2267
|
}
|
|
2268
|
-
),
|
|
2269
|
-
|
|
2268
|
+
), m = new ke(o, p), v = this.getSize();
|
|
2269
|
+
m.setSize(v.width, v.height);
|
|
2270
2270
|
const _ = new hs(
|
|
2271
2271
|
s.scene,
|
|
2272
2272
|
i.camera
|
|
2273
2273
|
);
|
|
2274
|
-
|
|
2274
|
+
m.addPass(_), this.scene = s.scene, this.camera = i.camera, this.finalComposer = m, this.renderPass = _, i.event.on("pageChange", (f) => {
|
|
2275
2275
|
this.changeCamera(f);
|
|
2276
2276
|
}), s.event.on("pageChange", (f) => {
|
|
2277
2277
|
this.changeScene(f);
|
|
@@ -2376,7 +2376,7 @@ class Ws {
|
|
|
2376
2376
|
if (this.finalComposerRender(), this.pipViewportState) {
|
|
2377
2377
|
e.setPageActive(31), e.setAspect(
|
|
2378
2378
|
this.pipViewportState.width / this.pipViewportState.height
|
|
2379
|
-
), t.setViewport(
|
|
2379
|
+
), t.setViewport(te(U({}, this.pipViewportState), {
|
|
2380
2380
|
scissor: !0,
|
|
2381
2381
|
scissorTest: !0
|
|
2382
2382
|
})), this.finalComposerRender(), e.setPageActive(s.activeIndex);
|
|
@@ -2396,7 +2396,7 @@ class Ws {
|
|
|
2396
2396
|
this.bloomMaterials = {}, this.bloomVisible = {}, this.bloomSelection.clear(), this.finalComposer.dispose(), (e = this.bloomComposer) == null || e.dispose();
|
|
2397
2397
|
}
|
|
2398
2398
|
}
|
|
2399
|
-
class Ks extends
|
|
2399
|
+
class Ks extends ee {
|
|
2400
2400
|
constructor(e) {
|
|
2401
2401
|
super(), this.autoRotateSpeed = 0, this.options = e;
|
|
2402
2402
|
const t = {
|
|
@@ -2410,13 +2410,13 @@ class Ks extends se {
|
|
|
2410
2410
|
Sphere: $t,
|
|
2411
2411
|
Raycaster: dt
|
|
2412
2412
|
};
|
|
2413
|
-
|
|
2413
|
+
J.install({ THREE: t });
|
|
2414
2414
|
}
|
|
2415
2415
|
get cameraControls() {
|
|
2416
2416
|
return this.controller;
|
|
2417
2417
|
}
|
|
2418
2418
|
addCameraControls(e, t) {
|
|
2419
|
-
const { domElement: s } = this.options.controlsParams, i = new
|
|
2419
|
+
const { domElement: s } = this.options.controlsParams, i = new J(e, s);
|
|
2420
2420
|
return i.setLookAt(0, 0, 400, 0, 0, 0, !1), this.addController(i, t);
|
|
2421
2421
|
}
|
|
2422
2422
|
setPageActive(e) {
|
|
@@ -2460,8 +2460,8 @@ class Xs {
|
|
|
2460
2460
|
a.style.overflow = "hidden", this.domElement = a;
|
|
2461
2461
|
const h = document.createElement("div");
|
|
2462
2462
|
h.style.transformOrigin = "0 0", h.style.pointerEvents = "none", a.appendChild(h);
|
|
2463
|
-
const
|
|
2464
|
-
|
|
2463
|
+
const p = document.createElement("div");
|
|
2464
|
+
p.style.transformStyle = "preserve-3d", h.appendChild(p), this.getSize = function() {
|
|
2465
2465
|
return {
|
|
2466
2466
|
width: s,
|
|
2467
2467
|
height: i
|
|
@@ -2471,21 +2471,21 @@ class Xs {
|
|
|
2471
2471
|
l.view && l.view.enabled ? (h.style.transform = `translate( ${-l.view.offsetX * (s / l.view.width)}px, ${-l.view.offsetY * (i / l.view.height)}px )`, h.style.transform += `scale( ${l.view.fullWidth / l.view.width}, ${l.view.fullHeight / l.view.height} )`) : h.style.transform = "", y.matrixWorldAutoUpdate === !0 && y.updateMatrixWorld(), l.parent === null && l.matrixWorldAutoUpdate === !0 && l.updateMatrixWorld();
|
|
2472
2472
|
let O, C;
|
|
2473
2473
|
l.isOrthographicCamera && (O = -(l.right + l.left) / 2, C = (l.top + l.bottom) / 2);
|
|
2474
|
-
const w = l.view && l.view.enabled ? l.view.height / l.view.fullHeight : 1, E = l.isOrthographicCamera ? `scale( ${w} )scale(` + u + ")translate(" +
|
|
2475
|
-
n.camera.style !== R && (
|
|
2474
|
+
const w = l.view && l.view.enabled ? l.view.height / l.view.fullHeight : 1, E = l.isOrthographicCamera ? `scale( ${w} )scale(` + u + ")translate(" + m(O) + "px," + m(C) + "px)" + v(l.matrixWorldInverse) : `scale( ${w} )translateZ(` + u + "px)" + v(l.matrixWorldInverse), R = (l.isPerspectiveCamera ? "perspective(" + u + "px) " : "") + E + "translate(" + r + "px," + o + "px)";
|
|
2475
|
+
n.camera.style !== R && (p.style.transform = R, n.camera.style = R), g(y, y, l);
|
|
2476
2476
|
}, this.setSize = function(y, l) {
|
|
2477
|
-
s = y, i = l, r = s / 2, o = i / 2, a.style.width = y + "px", a.style.height = l + "px", h.style.width = y + "px", h.style.height = l + "px",
|
|
2477
|
+
s = y, i = l, r = s / 2, o = i / 2, a.style.width = y + "px", a.style.height = l + "px", h.style.width = y + "px", h.style.height = l + "px", p.style.width = y + "px", p.style.height = l + "px";
|
|
2478
2478
|
};
|
|
2479
|
-
function
|
|
2479
|
+
function m(y) {
|
|
2480
2480
|
return Math.abs(y) < 1e-10 ? 0 : y;
|
|
2481
2481
|
}
|
|
2482
2482
|
function v(y) {
|
|
2483
2483
|
const l = y.elements;
|
|
2484
|
-
return "matrix3d(" +
|
|
2484
|
+
return "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]) + ")";
|
|
2485
2485
|
}
|
|
2486
2486
|
function _(y) {
|
|
2487
2487
|
const l = y.elements;
|
|
2488
|
-
return "translate(-50%,-50%)" + ("matrix3d(" +
|
|
2488
|
+
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]) + ")");
|
|
2489
2489
|
}
|
|
2490
2490
|
function f(y) {
|
|
2491
2491
|
y.isCSS3DObject && (y.element.style.display = "none");
|
|
@@ -2509,7 +2509,7 @@ class Xs {
|
|
|
2509
2509
|
const R = { style: E };
|
|
2510
2510
|
n.objects.set(y, R);
|
|
2511
2511
|
}
|
|
2512
|
-
w.parentNode !==
|
|
2512
|
+
w.parentNode !== p && p.appendChild(w), y.onAfterRender(t, l, u);
|
|
2513
2513
|
}
|
|
2514
2514
|
}
|
|
2515
2515
|
for (let C = 0, w = y.children.length; C < w; C++)
|
|
@@ -2517,7 +2517,7 @@ class Xs {
|
|
|
2517
2517
|
}
|
|
2518
2518
|
}
|
|
2519
2519
|
}
|
|
2520
|
-
const
|
|
2520
|
+
const q = new j(), Je = new W(), et = new W(), tt = new j(), st = new j();
|
|
2521
2521
|
class qs {
|
|
2522
2522
|
/**
|
|
2523
2523
|
* Constructs a new CSS2D renderer.
|
|
@@ -2536,7 +2536,7 @@ class qs {
|
|
|
2536
2536
|
height: i
|
|
2537
2537
|
};
|
|
2538
2538
|
}, this.render = function(f, g) {
|
|
2539
|
-
f.matrixWorldAutoUpdate === !0 && f.updateMatrixWorld(), g.parent === null && g.matrixWorldAutoUpdate === !0 && g.updateMatrixWorld(), Je.copy(g.matrixWorldInverse), et.multiplyMatrices(g.projectionMatrix, Je),
|
|
2539
|
+
f.matrixWorldAutoUpdate === !0 && f.updateMatrixWorld(), g.parent === null && g.matrixWorldAutoUpdate === !0 && g.updateMatrixWorld(), Je.copy(g.matrixWorldInverse), et.multiplyMatrices(g.projectionMatrix, Je), p(f, f, g), _(f);
|
|
2540
2540
|
}, this.setSize = function(f, g) {
|
|
2541
2541
|
s = f, i = g, r = s / 2, o = i / 2, a.style.width = f + "px", a.style.height = g + "px";
|
|
2542
2542
|
};
|
|
@@ -2545,24 +2545,24 @@ class qs {
|
|
|
2545
2545
|
for (let g = 0, y = f.children.length; g < y; g++)
|
|
2546
2546
|
h(f.children[g]);
|
|
2547
2547
|
}
|
|
2548
|
-
function
|
|
2548
|
+
function p(f, g, y) {
|
|
2549
2549
|
if (f.visible === !1) {
|
|
2550
2550
|
h(f);
|
|
2551
2551
|
return;
|
|
2552
2552
|
}
|
|
2553
2553
|
if (f.isCSS2DObject) {
|
|
2554
|
-
|
|
2555
|
-
const l =
|
|
2556
|
-
u.style.display = l === !0 ? "" : "none", l === !0 && (f.onBeforeRender(t, g, y), u.style.transform = "translate(" + -100 * f.center.x + "%," + -100 * f.center.y + "%)translate(" + (
|
|
2554
|
+
q.setFromMatrixPosition(f.matrixWorld), q.applyMatrix4(et);
|
|
2555
|
+
const l = q.z >= -1 && q.z <= 1 && f.layers.test(y.layers) === !0, u = f.element;
|
|
2556
|
+
u.style.display = l === !0 ? "" : "none", l === !0 && (f.onBeforeRender(t, g, y), u.style.transform = "translate(" + -100 * f.center.x + "%," + -100 * f.center.y + "%)translate(" + (q.x * r + r) + "px," + (-q.y * o + o) + "px)", u.parentNode !== a && a.appendChild(u), f.onAfterRender(t, g, y));
|
|
2557
2557
|
const O = {
|
|
2558
|
-
distanceToCameraSquared:
|
|
2558
|
+
distanceToCameraSquared: m(y, f)
|
|
2559
2559
|
};
|
|
2560
2560
|
n.objects.set(f, O);
|
|
2561
2561
|
}
|
|
2562
2562
|
for (let l = 0, u = f.children.length; l < u; l++)
|
|
2563
|
-
|
|
2563
|
+
p(f.children[l], g, y);
|
|
2564
2564
|
}
|
|
2565
|
-
function
|
|
2565
|
+
function m(f, g) {
|
|
2566
2566
|
return tt.setFromMatrixPosition(f.matrixWorld), st.setFromMatrixPosition(g.matrixWorld), tt.distanceToSquared(st);
|
|
2567
2567
|
}
|
|
2568
2568
|
function v(f) {
|
|
@@ -2716,7 +2716,7 @@ class ei {
|
|
|
2716
2716
|
r.preventDefault();
|
|
2717
2717
|
const o = e === "move" ? t : s, n = [];
|
|
2718
2718
|
if (this.pickFunctionsMap.forEach((_) => {
|
|
2719
|
-
o.has(_.type) && n.push(
|
|
2719
|
+
o.has(_.type) && n.push(te(U({}, _), {
|
|
2720
2720
|
objArr: _.objArr instanceof Function ? _.objArr() : _.objArr
|
|
2721
2721
|
}));
|
|
2722
2722
|
}), n.length === 0) return;
|
|
@@ -2730,15 +2730,15 @@ class ei {
|
|
|
2730
2730
|
g.has(_.type) || g.set(_.type, []), g.get(_.type).push(_.cb);
|
|
2731
2731
|
}
|
|
2732
2732
|
if (a.size === 0) return;
|
|
2733
|
-
const h = [...a.keys()].map((_) => _.object3d),
|
|
2734
|
-
if (!
|
|
2733
|
+
const h = [...a.keys()].map((_) => _.object3d), p = (v = this.pencil.pick(r, h, !0)) == null ? void 0 : v.intersects;
|
|
2734
|
+
if (!p || p.length === 0)
|
|
2735
2735
|
e === "down" ? this.handleDownOutside(r) : e === "move" && this.handleLeaveEvents(r);
|
|
2736
2736
|
else {
|
|
2737
|
-
const _ =
|
|
2737
|
+
const _ = p[0];
|
|
2738
2738
|
this.processIntersection(_, r, e);
|
|
2739
2739
|
}
|
|
2740
|
-
const
|
|
2741
|
-
this.prevActiveObjects = this.activeObjects, this.activeObjects =
|
|
2740
|
+
const m = this.prevActiveObjects;
|
|
2741
|
+
this.prevActiveObjects = this.activeObjects, this.activeObjects = m, this.activeObjects.clear();
|
|
2742
2742
|
};
|
|
2743
2743
|
this.domElement.addEventListener(
|
|
2744
2744
|
`pointer${e}`,
|
|
@@ -2768,18 +2768,18 @@ class ei {
|
|
|
2768
2768
|
if (t === "move") {
|
|
2769
2769
|
const h = a.get("enter");
|
|
2770
2770
|
if (h && !this.prevActiveObjects.has(n))
|
|
2771
|
-
for (const
|
|
2772
|
-
|
|
2771
|
+
for (const m of h)
|
|
2772
|
+
m({
|
|
2773
2773
|
baseObject: n,
|
|
2774
2774
|
realBaseObject: this.activeObject,
|
|
2775
2775
|
mouseEvent: e,
|
|
2776
2776
|
sp: o,
|
|
2777
2777
|
intersectionIndex: s
|
|
2778
2778
|
});
|
|
2779
|
-
const
|
|
2780
|
-
if (
|
|
2781
|
-
for (const
|
|
2782
|
-
|
|
2779
|
+
const p = a.get("move");
|
|
2780
|
+
if (p)
|
|
2781
|
+
for (const m of p)
|
|
2782
|
+
m({
|
|
2783
2783
|
baseObject: n,
|
|
2784
2784
|
realBaseObject: this.activeObject,
|
|
2785
2785
|
mouseEvent: e,
|
|
@@ -2789,21 +2789,21 @@ class ei {
|
|
|
2789
2789
|
} else {
|
|
2790
2790
|
const h = a.get("down");
|
|
2791
2791
|
if (h)
|
|
2792
|
-
for (const
|
|
2793
|
-
|
|
2792
|
+
for (const m of h)
|
|
2793
|
+
m({
|
|
2794
2794
|
baseObject: n,
|
|
2795
2795
|
realBaseObject: this.activeObject,
|
|
2796
2796
|
mouseEvent: e,
|
|
2797
2797
|
sp: o,
|
|
2798
2798
|
intersectionIndex: s
|
|
2799
2799
|
});
|
|
2800
|
-
const
|
|
2801
|
-
if (
|
|
2802
|
-
const
|
|
2800
|
+
const p = a.get("click");
|
|
2801
|
+
if (p) {
|
|
2802
|
+
const m = (v) => {
|
|
2803
2803
|
v.preventDefault();
|
|
2804
2804
|
const _ = 5;
|
|
2805
2805
|
if (!r && Math.abs(v.clientX - e.clientX) <= _ && Math.abs(v.clientY - e.clientY) <= _)
|
|
2806
|
-
for (const f of
|
|
2806
|
+
for (const f of p)
|
|
2807
2807
|
f({
|
|
2808
2808
|
baseObject: n,
|
|
2809
2809
|
realBaseObject: this.activeObject,
|
|
@@ -2811,9 +2811,9 @@ class ei {
|
|
|
2811
2811
|
sp: o,
|
|
2812
2812
|
intersectionIndex: s
|
|
2813
2813
|
});
|
|
2814
|
-
this.domElement.removeEventListener("pointerup",
|
|
2814
|
+
this.domElement.removeEventListener("pointerup", m);
|
|
2815
2815
|
};
|
|
2816
|
-
this.domElement.addEventListener("pointerup",
|
|
2816
|
+
this.domElement.addEventListener("pointerup", m);
|
|
2817
2817
|
}
|
|
2818
2818
|
}
|
|
2819
2819
|
}
|
|
@@ -2861,13 +2861,13 @@ class ei {
|
|
|
2861
2861
|
for (const n of r) {
|
|
2862
2862
|
const a = n;
|
|
2863
2863
|
a.element.style.pointerEvents = "auto";
|
|
2864
|
-
const h = (
|
|
2865
|
-
this.enabled && (
|
|
2864
|
+
const h = (m) => {
|
|
2865
|
+
this.enabled && (m.preventDefault(), s({
|
|
2866
2866
|
baseObject: a,
|
|
2867
|
-
mouseEvent:
|
|
2867
|
+
mouseEvent: m
|
|
2868
2868
|
}));
|
|
2869
|
-
},
|
|
2870
|
-
a.element.addEventListener(
|
|
2869
|
+
}, p = `pointer${t}`;
|
|
2870
|
+
a.element.addEventListener(p, rt(h), !1), o.push({ arr: a, type: p, listener: h });
|
|
2871
2871
|
}
|
|
2872
2872
|
return this.pickNodeFunctionsMap.set(i, o), i;
|
|
2873
2873
|
}
|
|
@@ -2889,7 +2889,7 @@ class ei {
|
|
|
2889
2889
|
}
|
|
2890
2890
|
class ti extends ei {
|
|
2891
2891
|
constructor(e, t) {
|
|
2892
|
-
super(e), this.objMap = /* @__PURE__ */ new Map(), this.objects = /* @__PURE__ */ new Map(), this.objectsPm = /* @__PURE__ */ new Map(), this.objectWrapChindIdMap = /* @__PURE__ */ new Map(), this.objectNamesToFactories = /* @__PURE__ */ new Map(), this.mList = t.mList, this.scene = this.createBaseObject(t.scene || new
|
|
2892
|
+
super(e), this.objMap = /* @__PURE__ */ new Map(), this.objects = /* @__PURE__ */ new Map(), this.objectsPm = /* @__PURE__ */ new Map(), this.objectWrapChindIdMap = /* @__PURE__ */ new Map(), this.objectNamesToFactories = /* @__PURE__ */ new Map(), this.mList = t.mList, this.scene = this.createBaseObject(t.scene || new mt(), {
|
|
2893
2893
|
key: "@Scene",
|
|
2894
2894
|
name: "场景",
|
|
2895
2895
|
mList: !1
|
|
@@ -2909,14 +2909,10 @@ class ti extends ei {
|
|
|
2909
2909
|
return this.objectsPm.values();
|
|
2910
2910
|
}
|
|
2911
2911
|
createBaseObject(e, t = {}) {
|
|
2912
|
-
const s =
|
|
2912
|
+
const s = U({
|
|
2913
2913
|
mList: !0
|
|
2914
2914
|
}, t), i = new ls();
|
|
2915
|
-
if (i.object3d = e, i.pencil = this.pencil, i.lead = this, i.mList = this.mList,
|
|
2916
|
-
return this.createBaseObject(e.clone(), K(D({}, s), {
|
|
2917
|
-
target: i.parent
|
|
2918
|
-
}));
|
|
2919
|
-
}), s.key)
|
|
2915
|
+
if (i.object3d = e, i.pencil = this.pencil, i.lead = this, i.mList = this.mList, s.key)
|
|
2920
2916
|
i.key = s.key;
|
|
2921
2917
|
else if (s.target) {
|
|
2922
2918
|
const r = s.target.key;
|
|
@@ -2957,32 +2953,32 @@ class ti extends ei {
|
|
|
2957
2953
|
}), r;
|
|
2958
2954
|
}
|
|
2959
2955
|
draw(e, t, s) {
|
|
2960
|
-
return
|
|
2961
|
-
var
|
|
2956
|
+
return se(this, null, function* () {
|
|
2957
|
+
var m, v, _;
|
|
2962
2958
|
const i = this.objectNamesToFactories.get(String(e));
|
|
2963
2959
|
if (!i)
|
|
2964
2960
|
throw new Error(`Unrecognized factory: ${String(e)}`);
|
|
2965
2961
|
t || (t = {}), t.target === void 0 && (t.target = s);
|
|
2966
|
-
const r = t.target, o = (
|
|
2967
|
-
let
|
|
2962
|
+
const r = t.target, o = (m = t.onTop) != null ? m : 0, n = (v = t.prefab) != null ? v : !1, a = (_ = t.create) != null ? _ : !0, h = new i().create(t);
|
|
2963
|
+
let p;
|
|
2968
2964
|
if (r === null)
|
|
2969
|
-
|
|
2965
|
+
p = null;
|
|
2970
2966
|
else if (typeof r == "string") {
|
|
2971
2967
|
const f = this.objects.get(r);
|
|
2972
2968
|
if (!f)
|
|
2973
2969
|
throw new Error(`Object with key "${r}" not found`);
|
|
2974
|
-
|
|
2975
|
-
} else r != null && r.isBaseObject || r ?
|
|
2970
|
+
p = f;
|
|
2971
|
+
} else r != null && r.isBaseObject || r ? p = r : n ? p = this.prefabGroup : p = this.group;
|
|
2976
2972
|
return a === !1 ? h.create = () => {
|
|
2977
2973
|
} : a !== !0 && (h.create = () => {
|
|
2978
2974
|
a(h);
|
|
2979
2975
|
}), h.pencil = this.pencil, h.lead = this, h.mList = this.mList, h.isPrefab = n, h.objectType === "BaseObject" && (h.objectType = `${e}`), h.objectOptions = t, this.setBaseObjectKey(
|
|
2980
2976
|
h,
|
|
2981
2977
|
t.key ? `$t:#${t.key}` : "$t:",
|
|
2982
|
-
|
|
2978
|
+
p == null ? void 0 : p.key
|
|
2983
2979
|
), this.objectsPm.set(
|
|
2984
2980
|
h,
|
|
2985
|
-
this.addBaseObject(h,
|
|
2981
|
+
this.addBaseObject(h, p, o)
|
|
2986
2982
|
), yield this.objectsPm.get(h), this.objectsPm.delete(h), h;
|
|
2987
2983
|
});
|
|
2988
2984
|
}
|
|
@@ -3009,7 +3005,7 @@ class ti extends ei {
|
|
|
3009
3005
|
}), r;
|
|
3010
3006
|
}
|
|
3011
3007
|
addBaseObject(e, t, s) {
|
|
3012
|
-
return
|
|
3008
|
+
return se(this, null, function* () {
|
|
3013
3009
|
if (yield e.create(), e.object3d) {
|
|
3014
3010
|
const i = e.object3d;
|
|
3015
3011
|
i.material && Array.isArray(i.material) && (i.material = i.material.slice()), this.mList.proxyBaseObject(e), this.mList.addBaseObjectMap(e), s && e.setTop(s), t !== null && t.object3d.add(e.object3d), this.objMap.set(e.object3d, e), i.children.forEach((r) => {
|
|
@@ -3061,7 +3057,7 @@ class ti extends ei {
|
|
|
3061
3057
|
}), this.objects.clear(), this.objectsPm.clear(), this.objMap.clear(), this.objectWrapChindIdMap.clear(), this.objectNamesToFactories.clear();
|
|
3062
3058
|
}
|
|
3063
3059
|
}
|
|
3064
|
-
class si extends
|
|
3060
|
+
class si extends ee {
|
|
3065
3061
|
get lead() {
|
|
3066
3062
|
return this.controller;
|
|
3067
3063
|
}
|
|
@@ -3091,7 +3087,7 @@ class si extends se {
|
|
|
3091
3087
|
});
|
|
3092
3088
|
}
|
|
3093
3089
|
}
|
|
3094
|
-
class ii extends
|
|
3090
|
+
class ii extends pt {
|
|
3095
3091
|
constructor(e) {
|
|
3096
3092
|
super(e);
|
|
3097
3093
|
}
|
|
@@ -3101,10 +3097,10 @@ class ii extends mt {
|
|
|
3101
3097
|
e,
|
|
3102
3098
|
(o) => {
|
|
3103
3099
|
const n = o, a = new DecompressionStream("gzip"), h = n.stream().pipeThrough(a);
|
|
3104
|
-
new Response(h).json().then((
|
|
3105
|
-
t == null || t(
|
|
3106
|
-
}).catch((
|
|
3107
|
-
i == null || i(
|
|
3100
|
+
new Response(h).json().then((m) => {
|
|
3101
|
+
t == null || t(m);
|
|
3102
|
+
}).catch((m) => {
|
|
3103
|
+
i == null || i(m);
|
|
3108
3104
|
});
|
|
3109
3105
|
},
|
|
3110
3106
|
s,
|
|
@@ -3112,7 +3108,7 @@ class ii extends mt {
|
|
|
3112
3108
|
);
|
|
3113
3109
|
}
|
|
3114
3110
|
}
|
|
3115
|
-
class ot extends
|
|
3111
|
+
class ot extends pt {
|
|
3116
3112
|
constructor(e) {
|
|
3117
3113
|
super(e), this.options = { type: "image" };
|
|
3118
3114
|
}
|
|
@@ -3127,8 +3123,8 @@ class ot extends mt {
|
|
|
3127
3123
|
e,
|
|
3128
3124
|
(a) => {
|
|
3129
3125
|
let h = a;
|
|
3130
|
-
const
|
|
3131
|
-
h = h.slice(0, a.size,
|
|
3126
|
+
const p = e.split(".").pop(), m = this.options.type === "image" ? `image/${p || "png"}` : `video/${p || "mp4"}`;
|
|
3127
|
+
h = h.slice(0, a.size, m);
|
|
3132
3128
|
const v = () => {
|
|
3133
3129
|
o.removeEventListener("load", _, !1), o.removeEventListener("error", f, !1);
|
|
3134
3130
|
}, _ = () => {
|
|
@@ -3156,7 +3152,7 @@ const ri = {
|
|
|
3156
3152
|
};
|
|
3157
3153
|
class oi {
|
|
3158
3154
|
constructor(e) {
|
|
3159
|
-
this.loadObj = [], this.delLoadArr = [], this.assets = /* @__PURE__ */ new Map(), this.event = new ye.EventEmitter(), this.options =
|
|
3155
|
+
this.loadObj = [], this.delLoadArr = [], this.assets = /* @__PURE__ */ new Map(), this.event = new ye.EventEmitter(), this.options = U({
|
|
3160
3156
|
simpleTexture4deleted: !1,
|
|
3161
3157
|
prefix: ""
|
|
3162
3158
|
}, e), this.loadingManager = new ss(
|
|
@@ -3221,7 +3217,7 @@ class oi {
|
|
|
3221
3217
|
}
|
|
3222
3218
|
add(e, t) {
|
|
3223
3219
|
typeof e == "string" && (e = [e]), e.forEach((s) => {
|
|
3224
|
-
const i =
|
|
3220
|
+
const i = U({
|
|
3225
3221
|
src: s
|
|
3226
3222
|
}, t);
|
|
3227
3223
|
this.loadObj.push(i);
|
|
@@ -3240,7 +3236,7 @@ class oi {
|
|
|
3240
3236
|
}), e;
|
|
3241
3237
|
}
|
|
3242
3238
|
loadAll() {
|
|
3243
|
-
return
|
|
3239
|
+
return se(this, null, function* () {
|
|
3244
3240
|
const e = this.loadObj.filter((t) => !this.delLoadArr.includes(t.src));
|
|
3245
3241
|
return yield Promise.all(
|
|
3246
3242
|
e.map((t) => this.load(t.src, t))
|
|
@@ -3248,7 +3244,7 @@ class oi {
|
|
|
3248
3244
|
});
|
|
3249
3245
|
}
|
|
3250
3246
|
load(e, t) {
|
|
3251
|
-
return
|
|
3247
|
+
return se(this, null, function* () {
|
|
3252
3248
|
var n, a;
|
|
3253
3249
|
const s = (n = t == null ? void 0 : t.type) != null ? n : this.getAssetType(e);
|
|
3254
3250
|
if (!s)
|
|
@@ -3263,8 +3259,8 @@ class oi {
|
|
|
3263
3259
|
try {
|
|
3264
3260
|
const h = yield o.loadAsync(e);
|
|
3265
3261
|
if (this.assets.set(e, h), r.resolve(h), s === "images" || s === "media" || s === "exr" || s === "lottie") {
|
|
3266
|
-
const
|
|
3267
|
-
h.anisotropy =
|
|
3262
|
+
const p = (a = t == null ? void 0 : t.anisotropy) != null ? a : this.options.anisotropy;
|
|
3263
|
+
h.anisotropy = p;
|
|
3268
3264
|
}
|
|
3269
3265
|
return h;
|
|
3270
3266
|
} catch (h) {
|
|
@@ -3290,8 +3286,8 @@ class oi {
|
|
|
3290
3286
|
a.aoMap
|
|
3291
3287
|
].forEach((h) => {
|
|
3292
3288
|
if (h) {
|
|
3293
|
-
const
|
|
3294
|
-
|
|
3289
|
+
const p = this.getSrcByAsset(h, s);
|
|
3290
|
+
p && t.add(p);
|
|
3295
3291
|
}
|
|
3296
3292
|
});
|
|
3297
3293
|
});
|
|
@@ -3309,7 +3305,7 @@ class oi {
|
|
|
3309
3305
|
const ni = {
|
|
3310
3306
|
prefix: ""
|
|
3311
3307
|
};
|
|
3312
|
-
class ai extends
|
|
3308
|
+
class ai extends ee {
|
|
3313
3309
|
get loader() {
|
|
3314
3310
|
return this.controller;
|
|
3315
3311
|
}
|
|
@@ -3317,7 +3313,7 @@ class ai extends se {
|
|
|
3317
3313
|
super(), this.options = e;
|
|
3318
3314
|
}
|
|
3319
3315
|
addLoader(e, t) {
|
|
3320
|
-
const { loaderParams: s } = this.options, i = new oi(
|
|
3316
|
+
const { loaderParams: s } = this.options, i = new oi(te(U({}, s), {
|
|
3321
3317
|
scene: e
|
|
3322
3318
|
}));
|
|
3323
3319
|
return this.addController(i, t);
|
|
@@ -3433,15 +3429,15 @@ class li {
|
|
|
3433
3429
|
if ("__isProxy" in o)
|
|
3434
3430
|
return o;
|
|
3435
3431
|
const n = new Proxy(o, {
|
|
3436
|
-
set: (a, h,
|
|
3432
|
+
set: (a, h, p) => {
|
|
3437
3433
|
if (typeof h == "string" && !Number.isNaN(Number(h))) {
|
|
3438
|
-
const
|
|
3439
|
-
if (
|
|
3440
|
-
const v = a[
|
|
3441
|
-
return this.rmBaseObjectMap(e, v), a[
|
|
3434
|
+
const m = Number(h);
|
|
3435
|
+
if (m >= 0 && m < a.length) {
|
|
3436
|
+
const v = a[m];
|
|
3437
|
+
return this.rmBaseObjectMap(e, v), a[m] = p, p && (this.applyColorSpaceToMaterials(p), this.addBaseObjectMap(e)), !0;
|
|
3442
3438
|
}
|
|
3443
3439
|
}
|
|
3444
|
-
return a[h] =
|
|
3440
|
+
return a[h] = p, !0;
|
|
3445
3441
|
}
|
|
3446
3442
|
});
|
|
3447
3443
|
return Object.defineProperty(n, "__isProxy", {
|
|
@@ -3544,8 +3540,8 @@ class li {
|
|
|
3544
3540
|
var h;
|
|
3545
3541
|
const a = (h = i.materialList) == null ? void 0 : h[n];
|
|
3546
3542
|
if (Array.isArray(a)) {
|
|
3547
|
-
const
|
|
3548
|
-
|
|
3543
|
+
const p = a.indexOf(e);
|
|
3544
|
+
p !== -1 && (a[p] = t);
|
|
3549
3545
|
} else a === e && i.materialList && (i.materialList[n] = t);
|
|
3550
3546
|
});
|
|
3551
3547
|
});
|
|
@@ -3555,7 +3551,7 @@ class li {
|
|
|
3555
3551
|
e.track([...this.materials.values()]), e.dispose(), this.materials.clear(), this.fixBaseObjects.clear(), this.materialBaseObjectMap.clear();
|
|
3556
3552
|
}
|
|
3557
3553
|
}
|
|
3558
|
-
class hi extends
|
|
3554
|
+
class hi extends ee {
|
|
3559
3555
|
get mList() {
|
|
3560
3556
|
return this.controller;
|
|
3561
3557
|
}
|
|
@@ -3593,8 +3589,8 @@ class di {
|
|
|
3593
3589
|
antialias: n,
|
|
3594
3590
|
powerPreference: a,
|
|
3595
3591
|
toneMappingExposure: h,
|
|
3596
|
-
outputColorSpace:
|
|
3597
|
-
logarithmicDepthBuffer:
|
|
3592
|
+
outputColorSpace: p,
|
|
3593
|
+
logarithmicDepthBuffer: m,
|
|
3598
3594
|
preserveDrawingBuffer: v,
|
|
3599
3595
|
stencil: _,
|
|
3600
3596
|
depth: f
|
|
@@ -3602,12 +3598,12 @@ class di {
|
|
|
3602
3598
|
alpha: r,
|
|
3603
3599
|
antialias: n,
|
|
3604
3600
|
powerPreference: a,
|
|
3605
|
-
logarithmicDepthBuffer:
|
|
3601
|
+
logarithmicDepthBuffer: m,
|
|
3606
3602
|
preserveDrawingBuffer: v,
|
|
3607
3603
|
stencil: _,
|
|
3608
3604
|
depth: f
|
|
3609
3605
|
});
|
|
3610
|
-
g.setSize(t, s), g.setPixelRatio(o), g.toneMappingExposure = h, g.outputColorSpace =
|
|
3606
|
+
g.setSize(t, s), g.setPixelRatio(o), g.toneMappingExposure = h, g.outputColorSpace = p, this.renderer = g;
|
|
3611
3607
|
}
|
|
3612
3608
|
setSize(e, t) {
|
|
3613
3609
|
this.renderer.setSize(e, t);
|
|
@@ -3628,10 +3624,10 @@ class di {
|
|
|
3628
3624
|
this.setSize(0, 0), (e = this.renderer) == null || e.clear(), (t = this.renderer) == null || t.dispose(), (s = this.renderer) == null || s.forceContextLoss();
|
|
3629
3625
|
}
|
|
3630
3626
|
}
|
|
3631
|
-
const
|
|
3627
|
+
const mi = {
|
|
3632
3628
|
background: null
|
|
3633
3629
|
};
|
|
3634
|
-
class
|
|
3630
|
+
class pi extends ee {
|
|
3635
3631
|
get scene() {
|
|
3636
3632
|
return this.controller;
|
|
3637
3633
|
}
|
|
@@ -3639,7 +3635,7 @@ class mi extends se {
|
|
|
3639
3635
|
super(), this.options = e;
|
|
3640
3636
|
}
|
|
3641
3637
|
addScene(e, t) {
|
|
3642
|
-
const s = new
|
|
3638
|
+
const s = new mt();
|
|
3643
3639
|
return e != null && e.background && (s.background = e.background), this.addController(s, t);
|
|
3644
3640
|
}
|
|
3645
3641
|
removePage(e) {
|
|
@@ -3835,7 +3831,7 @@ const _e = class _e {
|
|
|
3835
3831
|
renderer: r,
|
|
3836
3832
|
controls: o,
|
|
3837
3833
|
loader: n
|
|
3838
|
-
} = this.options, { width: a, height: h } = this.getSize(),
|
|
3834
|
+
} = this.options, { width: a, height: h } = this.getSize(), p = t ? new _i({
|
|
3839
3835
|
width: a,
|
|
3840
3836
|
height: h,
|
|
3841
3837
|
//@ts-ignore
|
|
@@ -3844,20 +3840,20 @@ const _e = class _e {
|
|
|
3844
3840
|
}) : new di({
|
|
3845
3841
|
width: a,
|
|
3846
3842
|
height: h,
|
|
3847
|
-
rendererParams:
|
|
3843
|
+
rendererParams: te(U({}, r), {
|
|
3848
3844
|
antialias: !1
|
|
3849
3845
|
})
|
|
3850
3846
|
});
|
|
3851
|
-
this.rendererController =
|
|
3852
|
-
const
|
|
3847
|
+
this.rendererController = p;
|
|
3848
|
+
const m = new Ds({
|
|
3853
3849
|
width: a,
|
|
3854
3850
|
height: h
|
|
3855
|
-
}), v = new
|
|
3851
|
+
}), v = new pi({}), _ = new Ks({
|
|
3856
3852
|
controlsParams: {
|
|
3857
|
-
domElement: (u = o == null ? void 0 : o.domElement) != null ? u :
|
|
3853
|
+
domElement: (u = o == null ? void 0 : o.domElement) != null ? u : p.renderer.domElement
|
|
3858
3854
|
}
|
|
3859
3855
|
}), f = new ai({
|
|
3860
|
-
loaderParams:
|
|
3856
|
+
loaderParams: U({
|
|
3861
3857
|
anisotropy: this.maxAnisotropy
|
|
3862
3858
|
}, n)
|
|
3863
3859
|
}), g = new hi({
|
|
@@ -3865,7 +3861,7 @@ const _e = class _e {
|
|
|
3865
3861
|
}), y = new si({
|
|
3866
3862
|
pencil: this
|
|
3867
3863
|
});
|
|
3868
|
-
this.sceneController = v, this.cameraController =
|
|
3864
|
+
this.sceneController = v, this.cameraController = m, this.controlsController = _, this.loaderController = f, this.mListController = g, this.leadController = y;
|
|
3869
3865
|
const l = this.addPage({
|
|
3870
3866
|
sceneOptions: this.options.scene,
|
|
3871
3867
|
cameraOptions: this.options.camera
|
|
@@ -3874,11 +3870,11 @@ const _e = class _e {
|
|
|
3874
3870
|
const O = new Js({
|
|
3875
3871
|
container: e,
|
|
3876
3872
|
sceneController: v,
|
|
3877
|
-
cameraController:
|
|
3873
|
+
cameraController: m
|
|
3878
3874
|
});
|
|
3879
3875
|
O.add(v.scene), this.helperController = O, i && O.addViewHelper();
|
|
3880
3876
|
}
|
|
3881
|
-
e.appendChild(
|
|
3877
|
+
e.appendChild(p.renderer.domElement);
|
|
3882
3878
|
}
|
|
3883
3879
|
initComposer() {
|
|
3884
3880
|
const {
|
|
@@ -3893,7 +3889,7 @@ const _e = class _e {
|
|
|
3893
3889
|
cameraController: this.cameraController,
|
|
3894
3890
|
composerParams: r
|
|
3895
3891
|
});
|
|
3896
|
-
this.composerController = o, e && o.addBloomPass(
|
|
3892
|
+
this.composerController = o, e && o.addBloomPass(U({}, t)), s && o.addSSAOPass(U({}, i)), o.addOutputPass();
|
|
3897
3893
|
}
|
|
3898
3894
|
initCSSRenderer() {
|
|
3899
3895
|
const {
|
|
@@ -3948,10 +3944,10 @@ const _e = class _e {
|
|
|
3948
3944
|
cssRendererController: n,
|
|
3949
3945
|
leadController: a
|
|
3950
3946
|
} = this, h = this.renderer.getSize(new B());
|
|
3951
|
-
h.x === e && h.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((
|
|
3952
|
-
var
|
|
3953
|
-
(
|
|
3954
|
-
}), this.viewPadding.some((
|
|
3947
|
+
h.x === e && h.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((p) => {
|
|
3948
|
+
var m;
|
|
3949
|
+
(m = p.setSize) == null || m.call(p, e, t);
|
|
3950
|
+
}), this.viewPadding.some((p) => p !== 0) && this.setViewPadding(...this.viewPadding), this.render(), s && this.event.emit("resize", { width: e, height: t }));
|
|
3955
3951
|
}
|
|
3956
3952
|
setDevicePixelRatio(e) {
|
|
3957
3953
|
var n;
|
|
@@ -4001,8 +3997,8 @@ const _e = class _e {
|
|
|
4001
3997
|
this.event.emit("beforeRender"), this.timer.update(), Ce.update();
|
|
4002
3998
|
const e = this.timer.getDelta(), t = this.timer.getElapsed();
|
|
4003
3999
|
this.controlsController.update(e, t), this.leadController.update(e, t), this.installPlugins.forEach((h) => {
|
|
4004
|
-
var
|
|
4005
|
-
(
|
|
4000
|
+
var p;
|
|
4001
|
+
(p = h.update) == null || p.call(h, e, t);
|
|
4006
4002
|
}), (s = this.helperController) == null || s.update(
|
|
4007
4003
|
e,
|
|
4008
4004
|
this.controlsController,
|
|
@@ -4047,11 +4043,11 @@ const _e = class _e {
|
|
|
4047
4043
|
}
|
|
4048
4044
|
}
|
|
4049
4045
|
dispose() {
|
|
4050
|
-
var e, t, s, i, r, o, n, a, h,
|
|
4046
|
+
var e, t, s, i, r, o, n, a, h, p, m, v, _, f;
|
|
4051
4047
|
this.handeleResize(1, 1, !1), this.stop(), this.timer.dispose(), Ce.removeAll(), this.event.removeAllListeners(), (e = this.resizeObserver) == null || e.unobserve(this.options.container), this.installPlugins.forEach((g) => {
|
|
4052
4048
|
var y;
|
|
4053
4049
|
(y = g.dispose) == null || y.call(g);
|
|
4054
|
-
}), (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(), (h = this.rendererController) == null || h.dispose(), (
|
|
4050
|
+
}), (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(), (h = this.rendererController) == null || h.dispose(), (p = this.loaderController) == null || p.dispose(), (m = this.leadController) == null || m.dispose(), (v = this.mListController) == null || v.dispose(), this.cssRendererController = void 0, this.installPlugins.clear(), (_ = this.stats) == null || _.dom.remove(), (f = this.renderer) == null || f.domElement.remove(), this._isDispose = !0;
|
|
4055
4051
|
}
|
|
4056
4052
|
};
|
|
4057
4053
|
_e.options = {
|
|
@@ -4062,7 +4058,7 @@ _e.options = {
|
|
|
4062
4058
|
transformControls: he,
|
|
4063
4059
|
renderer: ci,
|
|
4064
4060
|
composer: Zs,
|
|
4065
|
-
scene:
|
|
4061
|
+
scene: mi,
|
|
4066
4062
|
camera: wt,
|
|
4067
4063
|
bloom: !1,
|
|
4068
4064
|
bloomParams: Ys,
|
|
@@ -4070,12 +4066,12 @@ _e.options = {
|
|
|
4070
4066
|
loader: ni,
|
|
4071
4067
|
ssaoParams: Vs,
|
|
4072
4068
|
css2DRenderer: !1,
|
|
4073
|
-
css2DRendererParams:
|
|
4069
|
+
css2DRendererParams: U({}, it),
|
|
4074
4070
|
css3DRenderer: !1,
|
|
4075
|
-
css3DRendererParams:
|
|
4071
|
+
css3DRendererParams: U({}, it)
|
|
4076
4072
|
};
|
|
4077
4073
|
let nt = _e;
|
|
4078
|
-
const Xi =
|
|
4074
|
+
const Xi = J.ACTION;
|
|
4079
4075
|
export {
|
|
4080
4076
|
ls as BaseObject,
|
|
4081
4077
|
nt as Pencil,
|