gl-draw 0.15.33 → 0.16.0-beta.10
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 +4 -4
- package/dist/WebGPULineSegments2.module.js +183 -176
- package/dist/core/BaseObject/index.d.ts +6 -2
- package/dist/core/Loader/TextureLoader.d.ts +1 -1
- package/dist/core/Pencil.d.ts +1 -2
- package/dist/index.js +2 -2
- package/dist/index.module.js +486 -582
- package/dist/objects/extrudePolygon/ExtrudeGeometry.d.ts +1 -22
- package/dist/objects/index.js +1 -1
- package/dist/objects/index.module.js +58 -58
- package/dist/objects/node/index.d.ts +1 -1
- package/dist/plugins/index.js +1 -1
- package/dist/plugins/index.module.js +21 -21
- package/package.json +8 -8
- package/dist/utils/Timer.d.ts +0 -72
package/dist/index.module.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
var St = Object.defineProperty, At = Object.defineProperties;
|
|
2
2
|
var Mt = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var Me = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var Rt = Object.prototype.hasOwnProperty, Dt = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var Re = (h, e, t) => e in h ? St(h, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : h[e] = t, U = (h, e) => {
|
|
6
6
|
for (var t in e || (e = {}))
|
|
7
|
-
|
|
7
|
+
Rt.call(e, t) && Re(h, t, e[t]);
|
|
8
8
|
if (Me)
|
|
9
9
|
for (var t of Me(e))
|
|
10
|
-
|
|
10
|
+
Dt.call(e, t) && Re(h, t, e[t]);
|
|
11
11
|
return h;
|
|
12
12
|
}, te = (h, e) => At(h, Mt(e));
|
|
13
13
|
var se = (h, e, t) => new Promise((s, i) => {
|
|
14
14
|
var r = (a) => {
|
|
15
15
|
try {
|
|
16
16
|
n(t.next(a));
|
|
17
|
-
} catch (
|
|
18
|
-
i(
|
|
17
|
+
} catch (d) {
|
|
18
|
+
i(d);
|
|
19
19
|
}
|
|
20
20
|
}, o = (a) => {
|
|
21
21
|
try {
|
|
22
22
|
n(t.throw(a));
|
|
23
|
-
} catch (
|
|
24
|
-
i(
|
|
23
|
+
} catch (d) {
|
|
24
|
+
i(d);
|
|
25
25
|
}
|
|
26
26
|
}, n = (a) => a.done ? s(a.value) : Promise.resolve(a.value).then(r, o);
|
|
27
27
|
n((t = t.apply(h, e)).next());
|
|
@@ -29,12 +29,12 @@ var se = (h, 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
|
|
33
|
-
import { M 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 pt, Group as ze, Camera as es, Loader as mt, 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
|
+
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
|
-
import { RenderPass as
|
|
36
|
-
import { SSAOPass as
|
|
37
|
-
import { UnrealBloomPass as
|
|
35
|
+
import { RenderPass as hs } from "three/examples/jsm/postprocessing/RenderPass";
|
|
36
|
+
import { SSAOPass as cs } from "three/examples/jsm/postprocessing/SSAOPass";
|
|
37
|
+
import { UnrealBloomPass as ds } from "three/examples/jsm/postprocessing/UnrealBloomPass";
|
|
38
38
|
import "three/examples/jsm/lines/LineMaterial";
|
|
39
39
|
import "three/examples/jsm/lines/LineSegmentsGeometry";
|
|
40
40
|
import "three/examples/jsm/renderers/CSS2DRenderer";
|
|
@@ -45,23 +45,23 @@ 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
|
|
48
|
+
import { ShaderPass as ps } from "three/examples/jsm/postprocessing/ShaderPass";
|
|
49
49
|
import { OutputPass as ms } from "three/examples/jsm/postprocessing/OutputPass";
|
|
50
50
|
import { FullScreenQuad as Fe } from "three/examples/jsm/postprocessing/Pass";
|
|
51
|
-
import { RectAreaLightHelper as
|
|
51
|
+
import { RectAreaLightHelper as fs } from "three/examples/jsm/helpers/RectAreaLightHelper";
|
|
52
52
|
import { ViewHelper as us } from "three/examples/jsm/helpers/ViewHelper";
|
|
53
|
-
import { generateUUID as Ne, makePromiseCreator as
|
|
54
|
-
import { DRACOLoader as
|
|
55
|
-
import { EXRLoader as
|
|
56
|
-
import { GLTFLoader as
|
|
57
|
-
import { LottieLoader as
|
|
58
|
-
import { a as
|
|
59
|
-
import { TransformControls as
|
|
53
|
+
import { generateUUID as Ne, makePromiseCreator as _s } from "esus-lite";
|
|
54
|
+
import { DRACOLoader as gs } from "three/examples/jsm/loaders/DRACOLoader";
|
|
55
|
+
import { EXRLoader as ys } from "three/examples/jsm/loaders/EXRLoader";
|
|
56
|
+
import { GLTFLoader as Ie } from "three/examples/jsm/loaders/GLTFLoader";
|
|
57
|
+
import { LottieLoader as vs } from "three/examples/jsm/loaders/LottieLoader";
|
|
58
|
+
import { a as Cs, C as Os, i as Es } from "./isPlainObject.module.js";
|
|
59
|
+
import { TransformControls as Ts } from "three/examples/jsm/controls/TransformControls";
|
|
60
60
|
const M = {
|
|
61
61
|
LEFT: 1,
|
|
62
62
|
RIGHT: 2,
|
|
63
63
|
MIDDLE: 4
|
|
64
|
-
},
|
|
64
|
+
}, c = Object.freeze({
|
|
65
65
|
NONE: 0,
|
|
66
66
|
ROTATE: 1,
|
|
67
67
|
TRUCK: 2,
|
|
@@ -91,20 +91,20 @@ const M = {
|
|
|
91
91
|
function Y(h) {
|
|
92
92
|
return h.isPerspectiveCamera;
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function H(h) {
|
|
95
95
|
return h.isOrthographicCamera;
|
|
96
96
|
}
|
|
97
|
-
const $ = Math.PI * 2,
|
|
97
|
+
const $ = Math.PI * 2, je = Math.PI / 2, ut = 1e-5, ie = Math.PI / 180;
|
|
98
98
|
function k(h, e, t) {
|
|
99
99
|
return Math.max(e, Math.min(t, h));
|
|
100
100
|
}
|
|
101
|
-
function A(h, e =
|
|
101
|
+
function A(h, e = ut) {
|
|
102
102
|
return Math.abs(h) < e;
|
|
103
103
|
}
|
|
104
|
-
function P(h, e, t =
|
|
104
|
+
function P(h, e, t = ut) {
|
|
105
105
|
return A(h - e, t);
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function He(h, e) {
|
|
108
108
|
return Math.round(h / e) * e;
|
|
109
109
|
}
|
|
110
110
|
function re(h) {
|
|
@@ -116,28 +116,28 @@ function oe(h) {
|
|
|
116
116
|
function ce(h, 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
|
-
let
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
const v = (t.value + o *
|
|
119
|
+
let d = h - e;
|
|
120
|
+
const m = e, p = i * s;
|
|
121
|
+
d = k(d, -p, p), e = h - d;
|
|
122
|
+
const v = (t.value + o * d) * r;
|
|
123
123
|
t.value = (t.value - o * v) * a;
|
|
124
|
-
let
|
|
125
|
-
return
|
|
124
|
+
let f = e + (d + v) * a;
|
|
125
|
+
return m - h > 0 == f > m && (f = m, t.value = (f - m) / r), f;
|
|
126
126
|
}
|
|
127
127
|
function Be(h, e, t, s, i = 1 / 0, r, o) {
|
|
128
128
|
s = Math.max(1e-4, s);
|
|
129
|
-
const n = 2 / s, a = n * r,
|
|
130
|
-
let
|
|
131
|
-
const y =
|
|
132
|
-
if (
|
|
133
|
-
const ve = Math.sqrt(
|
|
134
|
-
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
const E = (t.x + n *
|
|
138
|
-
t.x = (t.x - n * E) *
|
|
139
|
-
const V = y - h.x, le = l - h.y,
|
|
140
|
-
return V * xt + le * Lt +
|
|
129
|
+
const n = 2 / s, a = n * r, d = 1 / (1 + a + 0.48 * a * a + 0.235 * a * a * a);
|
|
130
|
+
let m = e.x, p = e.y, v = e.z, f = h.x - m, u = h.y - p, g = h.z - v;
|
|
131
|
+
const y = m, l = p, _ = v, O = i * s, C = O * O, w = f * f + u * u + g * g;
|
|
132
|
+
if (w > C) {
|
|
133
|
+
const ve = Math.sqrt(w);
|
|
134
|
+
f = f / ve * O, u = u / ve * O, g = g / ve * O;
|
|
135
|
+
}
|
|
136
|
+
m = h.x - f, p = h.y - u, v = h.z - g;
|
|
137
|
+
const E = (t.x + n * f) * r, x = (t.y + n * u) * r, R = (t.z + n * g) * r;
|
|
138
|
+
t.x = (t.x - n * E) * d, t.y = (t.y - n * x) * d, t.z = (t.z - n * R) * d, o.x = m + (f + E) * d, o.y = p + (u + x) * d, o.z = v + (g + R) * d;
|
|
139
|
+
const V = y - h.x, le = l - h.y, bt = _ - h.z, xt = o.x - y, Lt = o.y - l, Pt = o.z - _;
|
|
140
|
+
return V * xt + le * Lt + bt * Pt > 0 && (o.x = y, o.y = l, o.z = _, t.x = (o.x - y) / r, t.y = (o.y - l) / r, t.z = (o.z - _) / r), o;
|
|
141
141
|
}
|
|
142
142
|
function Ee(h, e) {
|
|
143
143
|
e.set(0, 0), h.forEach((t) => {
|
|
@@ -145,9 +145,9 @@ function Ee(h, e) {
|
|
|
145
145
|
}), e.x /= h.length, e.y /= h.length;
|
|
146
146
|
}
|
|
147
147
|
function Te(h, e) {
|
|
148
|
-
return
|
|
148
|
+
return H(h) ? (console.warn(`${e} is not supported in OrthographicCamera`), !0) : !1;
|
|
149
149
|
}
|
|
150
|
-
class
|
|
150
|
+
class ws {
|
|
151
151
|
constructor() {
|
|
152
152
|
this._listeners = {};
|
|
153
153
|
}
|
|
@@ -212,17 +212,17 @@ class Ts {
|
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
214
|
const de = 1 / 8, bs = /Mac/.test(navigator.platform);
|
|
215
|
-
let T, Ve,
|
|
216
|
-
class J extends
|
|
215
|
+
let T, Ve, pe, we, D, b, L, G, ne, F, N, Z, Ye, Ze, z, ae, X, We, be, Ke, xe, Le, me;
|
|
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)), pe = 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(), me = new T.Raycaster();
|
|
219
219
|
}
|
|
220
220
|
/**
|
|
221
221
|
* list all ACTIONs
|
|
222
222
|
* @category Statics
|
|
223
223
|
*/
|
|
224
224
|
static get ACTION() {
|
|
225
|
-
return
|
|
225
|
+
return c;
|
|
226
226
|
}
|
|
227
227
|
/**
|
|
228
228
|
* Creates a `CameraControls` instance.
|
|
@@ -243,47 +243,47 @@ class J extends Ts {
|
|
|
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 =
|
|
247
|
-
let
|
|
246
|
+
}, 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 = 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, _, O, C) => {
|
|
247
|
+
let w, E;
|
|
248
248
|
if (Y(this._camera)) {
|
|
249
|
-
const x =
|
|
250
|
-
|
|
251
|
-
} else if (
|
|
249
|
+
const x = b.copy(this._camera.position).sub(this._target), R = this._camera.getEffectiveFOV() * ie, V = x.length() * Math.tan(R * 0.5);
|
|
250
|
+
w = this.truckSpeed * l * V / this._elementRect.height, E = this.truckSpeed * _ * V / this._elementRect.height;
|
|
251
|
+
} else if (H(this._camera)) {
|
|
252
252
|
const x = this._camera;
|
|
253
|
-
|
|
253
|
+
w = this.truckSpeed * l * (x.right - x.left) / x.zoom / this._elementRect.width, E = this.truckSpeed * _ * (x.top - x.bottom) / x.zoom / this._elementRect.height;
|
|
254
254
|
} else
|
|
255
255
|
return;
|
|
256
256
|
C ? (O ? this.setFocalOffset(
|
|
257
|
-
this._focalOffsetEnd.x +
|
|
257
|
+
this._focalOffsetEnd.x + w,
|
|
258
258
|
this._focalOffsetEnd.y,
|
|
259
259
|
this._focalOffsetEnd.z,
|
|
260
260
|
!0
|
|
261
|
-
) : this.truck(
|
|
262
|
-
this._focalOffsetEnd.x +
|
|
261
|
+
) : this.truck(w, 0, !0), this.forward(-E, !0)) : O ? this.setFocalOffset(
|
|
262
|
+
this._focalOffsetEnd.x + w,
|
|
263
263
|
this._focalOffsetEnd.y + E,
|
|
264
264
|
this._focalOffsetEnd.z,
|
|
265
265
|
!0
|
|
266
|
-
) : this.truck(
|
|
266
|
+
) : this.truck(w, E, !0);
|
|
267
267
|
}, this._rotateInternal = (l, _) => {
|
|
268
268
|
const O = $ * this.azimuthRotateSpeed * l / this._elementRect.height, C = $ * this.polarRotateSpeed * _ / this._elementRect.height;
|
|
269
269
|
this.rotate(O, C, !0);
|
|
270
270
|
}, this._dollyInternal = (l, _, O) => {
|
|
271
|
-
const C = Math.pow(0.95, -l * this.dollySpeed),
|
|
271
|
+
const C = Math.pow(0.95, -l * this.dollySpeed), w = this._sphericalEnd.radius, E = this._sphericalEnd.radius * C, x = k(
|
|
272
272
|
E,
|
|
273
273
|
this.minDistance,
|
|
274
274
|
this.maxDistance
|
|
275
|
-
),
|
|
276
|
-
this.infinityDolly && this.dollyToCursor ? this._dollyToNoClamp(E, !0) : this.infinityDolly && !this.dollyToCursor ? (this.dollyInFixed(
|
|
275
|
+
), R = x - E;
|
|
276
|
+
this.infinityDolly && this.dollyToCursor ? this._dollyToNoClamp(E, !0) : this.infinityDolly && !this.dollyToCursor ? (this.dollyInFixed(R, !0), this._dollyToNoClamp(x, !0)) : this._dollyToNoClamp(x, !0), this.dollyToCursor && (this._changedDolly += (this.infinityDolly ? E : x) - w, this._dollyControlCoord.set(_, O)), this._lastDollyDirection = Math.sign(-l);
|
|
277
277
|
}, this._zoomInternal = (l, _, O) => {
|
|
278
|
-
const C = Math.pow(0.95, l * this.dollySpeed),
|
|
279
|
-
this.zoomTo(E, !0), this.dollyToCursor && (this._changedZoom += E -
|
|
278
|
+
const C = Math.pow(0.95, l * this.dollySpeed), w = this._zoom, E = this._zoom * C;
|
|
279
|
+
this.zoomTo(E, !0), this.dollyToCursor && (this._changedZoom += E - w, this._dollyControlCoord.set(_, O));
|
|
280
280
|
}, typeof T == "undefined" && console.error(
|
|
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
|
-
|
|
285
|
-
), this._yAxisUpSpaceInverse = this._yAxisUpSpace.clone().invert(), this._state =
|
|
286
|
-
|
|
284
|
+
pe
|
|
285
|
+
), this._yAxisUpSpaceInverse = this._yAxisUpSpace.clone().invert(), this._state = c.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
|
+
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 = [
|
|
288
288
|
new T.Vector3(),
|
|
289
289
|
new T.Vector3(),
|
|
@@ -293,20 +293,20 @@ class J extends Ts {
|
|
|
293
293
|
new T.Vector3(-1 / 0, -1 / 0, -1 / 0),
|
|
294
294
|
new T.Vector3(1 / 0, 1 / 0, 1 / 0)
|
|
295
295
|
), this._cameraUp0 = this._camera.up.clone(), this._target0 = this._target.clone(), this._position0 = this._camera.position.clone(), this._zoom0 = this._zoom, this._focalOffset0 = this._focalOffset.clone(), this._dollyControlCoord = new T.Vector2(), this.mouseButtons = {
|
|
296
|
-
left:
|
|
297
|
-
middle:
|
|
298
|
-
right:
|
|
299
|
-
wheel: Y(this._camera) ?
|
|
296
|
+
left: c.ROTATE,
|
|
297
|
+
middle: c.DOLLY,
|
|
298
|
+
right: c.TRUCK,
|
|
299
|
+
wheel: Y(this._camera) ? c.DOLLY : H(this._camera) ? c.ZOOM : c.NONE
|
|
300
300
|
}, this.touches = {
|
|
301
|
-
one:
|
|
302
|
-
two: Y(this._camera) ?
|
|
303
|
-
three:
|
|
301
|
+
one: c.TOUCH_ROTATE,
|
|
302
|
+
two: Y(this._camera) ? c.TOUCH_DOLLY_TRUCK : H(this._camera) ? c.TOUCH_ZOOM_TRUCK : c.NONE,
|
|
303
|
+
three: c.TOUCH_TRUCK
|
|
304
304
|
};
|
|
305
305
|
const s = new T.Vector2(), i = new T.Vector2(), r = new T.Vector2(), o = (l) => {
|
|
306
306
|
if (!this._enabled || !this._domElement) return;
|
|
307
307
|
if (this._interactiveArea.left !== 0 || this._interactiveArea.top !== 0 || this._interactiveArea.width !== 1 || this._interactiveArea.height !== 1) {
|
|
308
|
-
const C = this._domElement.getBoundingClientRect(),
|
|
309
|
-
if (
|
|
308
|
+
const C = this._domElement.getBoundingClientRect(), w = (l.clientX - C.left) / (C.right - C.left), E = (l.clientY - C.top) / (C.bottom - C.top);
|
|
309
|
+
if (w < this._interactiveArea.left || w > this._interactiveArea.right || E < this._interactiveArea.top || E > this._interactiveArea.bottom)
|
|
310
310
|
return;
|
|
311
311
|
}
|
|
312
312
|
const _ = l.pointerType !== "mouse" ? null : (l.buttons & M.LEFT) === M.LEFT ? M.LEFT : (l.buttons & M.MIDDLE) === M.MIDDLE ? M.MIDDLE : (l.buttons & M.RIGHT) === M.RIGHT ? M.RIGHT : null;
|
|
@@ -354,7 +354,7 @@ class J extends Ts {
|
|
|
354
354
|
}
|
|
355
355
|
else
|
|
356
356
|
(!this._isDragging && this._lockedPointer || this._isDragging && (l.buttons & M.LEFT) === M.LEFT) && (this._state = this._state | this.mouseButtons.left), this._isDragging && (l.buttons & M.MIDDLE) === M.MIDDLE && (this._state = this._state | this.mouseButtons.middle), this._isDragging && (l.buttons & M.RIGHT) === M.RIGHT && (this._state = this._state | this.mouseButtons.right);
|
|
357
|
-
|
|
357
|
+
f();
|
|
358
358
|
}
|
|
359
359
|
}, a = (l) => {
|
|
360
360
|
const _ = this._findPointerById(l.pointerId);
|
|
@@ -362,7 +362,7 @@ class J extends Ts {
|
|
|
362
362
|
if (_ && this._disposePointer(_), l.pointerType === "touch")
|
|
363
363
|
switch (this._activePointers.length) {
|
|
364
364
|
case 0:
|
|
365
|
-
this._state =
|
|
365
|
+
this._state = c.NONE;
|
|
366
366
|
break;
|
|
367
367
|
case 1:
|
|
368
368
|
this._state = this.touches.one;
|
|
@@ -375,51 +375,51 @@ class J extends Ts {
|
|
|
375
375
|
break;
|
|
376
376
|
}
|
|
377
377
|
else
|
|
378
|
-
this._state =
|
|
378
|
+
this._state = c.NONE;
|
|
379
379
|
u();
|
|
380
380
|
}
|
|
381
381
|
};
|
|
382
|
-
let
|
|
383
|
-
const
|
|
384
|
-
if (!this._domElement || !this._enabled || this.mouseButtons.wheel ===
|
|
382
|
+
let d = -1;
|
|
383
|
+
const m = (l) => {
|
|
384
|
+
if (!this._domElement || !this._enabled || this.mouseButtons.wheel === c.NONE) return;
|
|
385
385
|
if (this._interactiveArea.left !== 0 || this._interactiveArea.top !== 0 || this._interactiveArea.width !== 1 || this._interactiveArea.height !== 1) {
|
|
386
|
-
const E = this._domElement.getBoundingClientRect(), x = (l.clientX - E.left) / (E.right - E.left),
|
|
387
|
-
if (x < this._interactiveArea.left || x > this._interactiveArea.right ||
|
|
386
|
+
const E = this._domElement.getBoundingClientRect(), x = (l.clientX - E.left) / (E.right - E.left), R = (l.clientY - E.top) / (E.bottom - E.top);
|
|
387
|
+
if (x < this._interactiveArea.left || x > this._interactiveArea.right || R < this._interactiveArea.top || R > this._interactiveArea.bottom)
|
|
388
388
|
return;
|
|
389
389
|
}
|
|
390
|
-
if (l.preventDefault(), this.dollyToCursor || this.mouseButtons.wheel ===
|
|
390
|
+
if (l.preventDefault(), this.dollyToCursor || this.mouseButtons.wheel === c.ROTATE || this.mouseButtons.wheel === c.TRUCK) {
|
|
391
391
|
const E = performance.now();
|
|
392
|
-
|
|
392
|
+
d - E < 1e3 && this._getClientRect(this._elementRect), d = E;
|
|
393
393
|
}
|
|
394
|
-
const _ = bs ? -1 : -3, O = l.deltaMode === 1 || l.ctrlKey ? l.deltaY / _ : l.deltaY / (_ * 10), C = this.dollyToCursor ? (l.clientX - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0,
|
|
394
|
+
const _ = bs ? -1 : -3, O = l.deltaMode === 1 || l.ctrlKey ? l.deltaY / _ : l.deltaY / (_ * 10), C = this.dollyToCursor ? (l.clientX - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, w = this.dollyToCursor ? (l.clientY - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
|
|
395
395
|
switch (this.mouseButtons.wheel) {
|
|
396
|
-
case
|
|
396
|
+
case c.ROTATE: {
|
|
397
397
|
this._rotateInternal(l.deltaX, l.deltaY), this._isUserControllingRotate = !0;
|
|
398
398
|
break;
|
|
399
399
|
}
|
|
400
|
-
case
|
|
400
|
+
case c.TRUCK: {
|
|
401
401
|
this._truckInternal(l.deltaX, l.deltaY, !1, !1), this._isUserControllingTruck = !0;
|
|
402
402
|
break;
|
|
403
403
|
}
|
|
404
|
-
case
|
|
404
|
+
case c.SCREEN_PAN: {
|
|
405
405
|
this._truckInternal(l.deltaX, l.deltaY, !1, !0), this._isUserControllingTruck = !0;
|
|
406
406
|
break;
|
|
407
407
|
}
|
|
408
|
-
case
|
|
408
|
+
case c.OFFSET: {
|
|
409
409
|
this._truckInternal(l.deltaX, l.deltaY, !0, !1), this._isUserControllingOffset = !0;
|
|
410
410
|
break;
|
|
411
411
|
}
|
|
412
|
-
case
|
|
413
|
-
this._dollyInternal(-O, C,
|
|
412
|
+
case c.DOLLY: {
|
|
413
|
+
this._dollyInternal(-O, C, w), this._isUserControllingDolly = !0;
|
|
414
414
|
break;
|
|
415
415
|
}
|
|
416
|
-
case
|
|
417
|
-
this._zoomInternal(-O, C,
|
|
416
|
+
case c.ZOOM: {
|
|
417
|
+
this._zoomInternal(-O, C, w), this._isUserControllingZoom = !0;
|
|
418
418
|
break;
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
421
|
this.dispatchEvent({ type: "control" });
|
|
422
|
-
},
|
|
422
|
+
}, p = (l) => {
|
|
423
423
|
if (!(!this._domElement || !this._enabled)) {
|
|
424
424
|
if (this.mouseButtons.right === J.ACTION.NONE) {
|
|
425
425
|
const _ = l instanceof PointerEvent ? l.pointerId : 0, O = this._findPointerById(_);
|
|
@@ -437,9 +437,9 @@ class J extends Ts {
|
|
|
437
437
|
}
|
|
438
438
|
}, v = (l) => {
|
|
439
439
|
if (!this._enabled) return;
|
|
440
|
-
if (Ee(this._activePointers,
|
|
441
|
-
const O =
|
|
442
|
-
r.set(0,
|
|
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
|
+
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);
|
|
445
445
|
}
|
|
@@ -459,32 +459,32 @@ class J extends Ts {
|
|
|
459
459
|
}
|
|
460
460
|
else
|
|
461
461
|
!this._lockedPointer && (l.buttons & M.LEFT) === M.LEFT && (this._state = this._state | this.mouseButtons.left), (l.buttons & M.MIDDLE) === M.MIDDLE && (this._state = this._state | this.mouseButtons.middle), (l.buttons & M.RIGHT) === M.RIGHT && (this._state = this._state | this.mouseButtons.right);
|
|
462
|
-
((this._state &
|
|
463
|
-
},
|
|
462
|
+
((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" });
|
|
463
|
+
}, f = () => {
|
|
464
464
|
if (!this._enabled || !this._dragNeedsUpdate) return;
|
|
465
|
-
this._dragNeedsUpdate = !1, Ee(this._activePointers,
|
|
466
|
-
const _ = this._domElement && this._domElement.ownerDocument.pointerLockElement === this._domElement ? this._lockedPointer || this._activePointers[0] : null, O = _ ? -_.deltaX : i.x -
|
|
467
|
-
if (i.copy(
|
|
468
|
-
const
|
|
469
|
-
(this._state &
|
|
465
|
+
this._dragNeedsUpdate = !1, Ee(this._activePointers, D);
|
|
466
|
+
const _ = this._domElement && this._domElement.ownerDocument.pointerLockElement === this._domElement ? this._lockedPointer || this._activePointers[0] : null, O = _ ? -_.deltaX : i.x - D.x, C = _ ? -_.deltaY : i.y - D.y;
|
|
467
|
+
if (i.copy(D), ((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(O, C), this._isUserControllingRotate = !0), (this._state & c.DOLLY) === c.DOLLY || (this._state & c.ZOOM) === c.ZOOM) {
|
|
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
|
+
(this._state & c.DOLLY) === c.DOLLY ? (this._dollyInternal(
|
|
470
470
|
x * C * de,
|
|
471
|
-
|
|
471
|
+
w,
|
|
472
472
|
E
|
|
473
473
|
), this._isUserControllingDolly = !0) : (this._zoomInternal(
|
|
474
474
|
x * C * de,
|
|
475
|
-
|
|
475
|
+
w,
|
|
476
476
|
E
|
|
477
477
|
), this._isUserControllingZoom = !0);
|
|
478
478
|
}
|
|
479
|
-
if ((this._state &
|
|
480
|
-
const
|
|
479
|
+
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) {
|
|
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
|
-
(this._state &
|
|
483
|
+
(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 * de, V, le), this._isUserControllingDolly = !0) : (this._zoomInternal(R * de, V, le), this._isUserControllingZoom = !0);
|
|
484
484
|
}
|
|
485
|
-
((this._state &
|
|
485
|
+
((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(O, 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(O, 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(O, C, !0, !1), this._isUserControllingOffset = !0), this.dispatchEvent({ type: "control" });
|
|
486
486
|
}, u = () => {
|
|
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 J extends Ts {
|
|
|
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", m, {
|
|
539
539
|
passive: !1
|
|
540
|
-
}), this._domElement.addEventListener("contextmenu",
|
|
540
|
+
}), this._domElement.addEventListener("contextmenu", p);
|
|
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", m, {
|
|
543
543
|
passive: !1
|
|
544
|
-
}), this._domElement.removeEventListener("contextmenu",
|
|
544
|
+
}), this._domElement.removeEventListener("contextmenu", p), this._domElement.ownerDocument.removeEventListener(
|
|
545
545
|
"pointermove",
|
|
546
546
|
n,
|
|
547
547
|
{ passive: !1 }
|
|
@@ -556,7 +556,7 @@ class J extends Ts {
|
|
|
556
556
|
y
|
|
557
557
|
));
|
|
558
558
|
}, this.cancel = () => {
|
|
559
|
-
this._state !==
|
|
559
|
+
this._state !== c.NONE && (this._state = c.NONE, this._activePointers.length = 0, u());
|
|
560
560
|
}, t && this.connect(t), this.update(0);
|
|
561
561
|
}
|
|
562
562
|
/**
|
|
@@ -900,7 +900,7 @@ class J extends Ts {
|
|
|
900
900
|
*/
|
|
901
901
|
truck(e, t, s = !1) {
|
|
902
902
|
this._camera.updateMatrix(), F.setFromMatrixColumn(this._camera.matrix, 0), N.setFromMatrixColumn(this._camera.matrix, 1), F.multiplyScalar(e), N.multiplyScalar(-t);
|
|
903
|
-
const i =
|
|
903
|
+
const i = b.copy(F).add(N), r = L.copy(this._targetEnd).add(i);
|
|
904
904
|
return this.moveTo(r.x, r.y, r.z, s);
|
|
905
905
|
}
|
|
906
906
|
/**
|
|
@@ -910,8 +910,8 @@ class J extends Ts {
|
|
|
910
910
|
* @category Methods
|
|
911
911
|
*/
|
|
912
912
|
forward(e, t = !1) {
|
|
913
|
-
|
|
914
|
-
const s = L.copy(this._targetEnd).add(
|
|
913
|
+
b.setFromMatrixColumn(this._camera.matrix, 0), b.crossVectors(this._camera.up, b), b.multiplyScalar(e);
|
|
914
|
+
const s = L.copy(this._targetEnd).add(b);
|
|
915
915
|
return this.moveTo(s.x, s.y, s.z, t);
|
|
916
916
|
}
|
|
917
917
|
/**
|
|
@@ -921,10 +921,10 @@ class J extends Ts {
|
|
|
921
921
|
* @category Methods
|
|
922
922
|
*/
|
|
923
923
|
elevate(e, t = !1) {
|
|
924
|
-
return
|
|
925
|
-
this._targetEnd.x +
|
|
926
|
-
this._targetEnd.y +
|
|
927
|
-
this._targetEnd.z +
|
|
924
|
+
return b.copy(this._camera.up).multiplyScalar(e), this.moveTo(
|
|
925
|
+
this._targetEnd.x + b.x,
|
|
926
|
+
this._targetEnd.y + b.y,
|
|
927
|
+
this._targetEnd.z + b.z,
|
|
928
928
|
t
|
|
929
929
|
);
|
|
930
930
|
}
|
|
@@ -938,7 +938,7 @@ class J extends Ts {
|
|
|
938
938
|
*/
|
|
939
939
|
moveTo(e, t, s, i = !1) {
|
|
940
940
|
this._isUserControllingTruck = !1;
|
|
941
|
-
const r =
|
|
941
|
+
const r = b.set(e, t, s).sub(this._targetEnd);
|
|
942
942
|
this._encloseToBoundary(this._targetEnd, r, this.boundaryFriction), this._needsUpdate = !0, i || this._target.copy(this._targetEnd);
|
|
943
943
|
const o = !i || 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);
|
|
944
944
|
return this._createOnRestPromise(o);
|
|
@@ -953,7 +953,7 @@ class J extends Ts {
|
|
|
953
953
|
* @category Methods
|
|
954
954
|
*/
|
|
955
955
|
lookInDirectionOf(e, t, s, i = !1) {
|
|
956
|
-
const n =
|
|
956
|
+
const n = b.set(e, t, s).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius).add(this._targetEnd);
|
|
957
957
|
return this.setPosition(
|
|
958
958
|
n.x,
|
|
959
959
|
n.y,
|
|
@@ -981,17 +981,17 @@ class J extends Ts {
|
|
|
981
981
|
paddingBottom: o = 0,
|
|
982
982
|
paddingTop: n = 0
|
|
983
983
|
} = {}) {
|
|
984
|
-
const a = [],
|
|
985
|
-
|
|
984
|
+
const a = [], d = e.isBox3 ? X.copy(e) : X.setFromObject(e);
|
|
985
|
+
d.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(
|
|
990
|
-
const v =
|
|
991
|
-
u &&
|
|
988
|
+
const m = He(this._sphericalEnd.theta, je), p = He(this._sphericalEnd.phi, je);
|
|
989
|
+
a.push(this.rotateTo(m, p, t));
|
|
990
|
+
const v = b.setFromSpherical(this._sphericalEnd).normalize(), f = Ke.setFromUnitVectors(v, we), u = P(Math.abs(v.y), 1);
|
|
991
|
+
u && f.multiply(xe.setFromAxisAngle(pe, m)), f.multiply(this._yAxisUpSpaceInverse);
|
|
992
992
|
const g = We.makeEmpty();
|
|
993
|
-
L.copy(
|
|
994
|
-
const y = g.getSize(
|
|
993
|
+
L.copy(d.min).applyQuaternion(f), g.expandByPoint(L), L.copy(d.min).setX(d.max.x).applyQuaternion(f), g.expandByPoint(L), L.copy(d.min).setY(d.max.y).applyQuaternion(f), g.expandByPoint(L), L.copy(d.max).setZ(d.min.z).applyQuaternion(f), g.expandByPoint(L), L.copy(d.min).setZ(d.max.z).applyQuaternion(f), g.expandByPoint(L), L.copy(d.max).setY(d.min.y).applyQuaternion(f), g.expandByPoint(L), L.copy(d.max).setX(d.min.x).applyQuaternion(f), g.expandByPoint(L), L.copy(d.max).applyQuaternion(f), g.expandByPoint(L), g.min.x -= i, g.min.y -= o, g.max.x += r, g.max.y += n, f.setFromUnitVectors(we, v), u && f.premultiply(xe.invert()), f.premultiply(this._yAxisUpSpace);
|
|
994
|
+
const y = g.getSize(b), l = g.getCenter(L).applyQuaternion(f);
|
|
995
995
|
if (Y(this._camera)) {
|
|
996
996
|
const _ = this.getDistanceToFitBox(
|
|
997
997
|
y.x,
|
|
@@ -1002,11 +1002,11 @@ class J extends Ts {
|
|
|
1002
1002
|
a.push(
|
|
1003
1003
|
this.moveTo(l.x, l.y, l.z, t)
|
|
1004
1004
|
), a.push(this.dollyTo(_, t)), a.push(this.setFocalOffset(0, 0, 0, t));
|
|
1005
|
-
} else if (
|
|
1006
|
-
const _ = this._camera, O = _.right - _.left, C = _.top - _.bottom,
|
|
1005
|
+
} else if (H(this._camera)) {
|
|
1006
|
+
const _ = this._camera, O = _.right - _.left, C = _.top - _.bottom, w = s ? Math.max(O / y.x, C / y.y) : Math.min(O / y.x, C / y.y);
|
|
1007
1007
|
a.push(
|
|
1008
1008
|
this.moveTo(l.x, l.y, l.z, t)
|
|
1009
|
-
), a.push(this.zoomTo(
|
|
1009
|
+
), a.push(this.zoomTo(w, t)), a.push(this.setFocalOffset(0, 0, 0, t));
|
|
1010
1010
|
}
|
|
1011
1011
|
return Promise.all(a);
|
|
1012
1012
|
}
|
|
@@ -1017,7 +1017,7 @@ class J extends Ts {
|
|
|
1017
1017
|
* @category Methods
|
|
1018
1018
|
*/
|
|
1019
1019
|
fitToSphere(e, t) {
|
|
1020
|
-
const s = [], r = "isObject3D" in e ? J.createBoundingSphere(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,
|
|
@@ -1028,9 +1028,9 @@ class J extends Ts {
|
|
|
1028
1028
|
), Y(this._camera)) {
|
|
1029
1029
|
const o = this.getDistanceToFitSphere(r.radius);
|
|
1030
1030
|
s.push(this.dollyTo(o, t));
|
|
1031
|
-
} else if (
|
|
1032
|
-
const o = this._camera.right - this._camera.left, n = this._camera.top - this._camera.bottom, a = 2 * r.radius,
|
|
1033
|
-
s.push(this.zoomTo(
|
|
1031
|
+
} else if (H(this._camera)) {
|
|
1032
|
+
const o = this._camera.right - this._camera.left, n = this._camera.top - this._camera.bottom, a = 2 * r.radius, d = Math.min(o / a, n / a);
|
|
1033
|
+
s.push(this.zoomTo(d, t));
|
|
1034
1034
|
}
|
|
1035
1035
|
return s.push(this.setFocalOffset(0, 0, 0, t)), Promise.all(s);
|
|
1036
1036
|
}
|
|
@@ -1047,11 +1047,11 @@ class J extends Ts {
|
|
|
1047
1047
|
*/
|
|
1048
1048
|
setLookAt(e, t, s, i, r, o, n = !1) {
|
|
1049
1049
|
this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._lastDollyDirection = K.NONE, this._changedDolly = 0;
|
|
1050
|
-
const a = L.set(i, r, o),
|
|
1050
|
+
const a = L.set(i, r, o), d = b.set(e, t, s);
|
|
1051
1051
|
this._targetEnd.copy(a), this._sphericalEnd.setFromVector3(
|
|
1052
|
-
|
|
1052
|
+
d.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 m = !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 J extends Ts {
|
|
|
1064
1064
|
this._sphericalEnd.radius,
|
|
1065
1065
|
this.restThreshold
|
|
1066
1066
|
);
|
|
1067
|
-
return this._createOnRestPromise(
|
|
1067
|
+
return this._createOnRestPromise(m);
|
|
1068
1068
|
}
|
|
1069
1069
|
/**
|
|
1070
1070
|
* Similar to setLookAt, but it interpolates between two states.
|
|
@@ -1084,21 +1084,21 @@ class J extends Ts {
|
|
|
1084
1084
|
* @param enableTransition
|
|
1085
1085
|
* @category Methods
|
|
1086
1086
|
*/
|
|
1087
|
-
lerpLookAt(e, t, s, i, r, o, n, a,
|
|
1087
|
+
lerpLookAt(e, t, s, i, r, o, n, a, d, m, p, v, f, u = !1) {
|
|
1088
1088
|
this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._lastDollyDirection = K.NONE, this._changedDolly = 0;
|
|
1089
|
-
const g =
|
|
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 = G.set(
|
|
1093
|
+
const l = G.set(m, p, v), _ = L.set(n, a, d);
|
|
1094
1094
|
ae.setFromVector3(
|
|
1095
1095
|
_.sub(l).applyQuaternion(this._yAxisUpSpace)
|
|
1096
|
-
), this._targetEnd.copy(g.lerp(l,
|
|
1097
|
-
const O = ae.theta - z.theta, C = ae.phi - z.phi,
|
|
1096
|
+
), this._targetEnd.copy(g.lerp(l, f));
|
|
1097
|
+
const O = ae.theta - z.theta, C = ae.phi - z.phi, w = ae.radius - z.radius;
|
|
1098
1098
|
this._sphericalEnd.set(
|
|
1099
|
-
z.radius +
|
|
1100
|
-
z.phi + C *
|
|
1101
|
-
z.theta + O *
|
|
1099
|
+
z.radius + w * f,
|
|
1100
|
+
z.phi + C * f,
|
|
1101
|
+
z.theta + O * f
|
|
1102
1102
|
), this.normalizeRotations(), this._needsUpdate = !0, u || (this._target.copy(this._targetEnd), this._spherical.copy(this._sphericalEnd));
|
|
1103
1103
|
const E = !u || 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(
|
|
1104
1104
|
this._spherical.theta,
|
|
@@ -1145,7 +1145,7 @@ class J extends Ts {
|
|
|
1145
1145
|
* @category Methods
|
|
1146
1146
|
*/
|
|
1147
1147
|
setTarget(e, t, s, i = !1) {
|
|
1148
|
-
const r = this.getPosition(
|
|
1148
|
+
const r = this.getPosition(b), o = this.setLookAt(
|
|
1149
1149
|
r.x,
|
|
1150
1150
|
r.y,
|
|
1151
1151
|
r.z,
|
|
@@ -1195,8 +1195,8 @@ class J extends Ts {
|
|
|
1195
1195
|
*/
|
|
1196
1196
|
setOrbitPoint(e, t, s) {
|
|
1197
1197
|
this._camera.updateMatrixWorld(), F.setFromMatrixColumn(this._camera.matrixWorldInverse, 0), N.setFromMatrixColumn(this._camera.matrixWorldInverse, 1), Z.setFromMatrixColumn(this._camera.matrixWorldInverse, 2);
|
|
1198
|
-
const i =
|
|
1199
|
-
F.multiplyScalar(o.x), N.multiplyScalar(o.y), Z.multiplyScalar(o.z),
|
|
1198
|
+
const i = b.set(e, t, s), r = i.distanceTo(this._camera.position), o = i.sub(this._camera.position);
|
|
1199
|
+
F.multiplyScalar(o.x), N.multiplyScalar(o.y), Z.multiplyScalar(o.z), b.copy(F).add(N).add(Z), b.z = b.z + r, this.dollyTo(r, !1), this.setFocalOffset(-b.x, b.y, -b.z, !1), this.moveTo(e, t, s, !1);
|
|
1200
1200
|
}
|
|
1201
1201
|
/**
|
|
1202
1202
|
* Set the boundary box that encloses the target of the camera. box3 is in THREE.Box3
|
|
@@ -1311,7 +1311,7 @@ class J extends Ts {
|
|
|
1311
1311
|
reset(e = !1) {
|
|
1312
1312
|
if (!P(this._camera.up.x, this._cameraUp0.x) || !P(this._camera.up.y, this._cameraUp0.y) || !P(this._camera.up.z, this._cameraUp0.z)) {
|
|
1313
1313
|
this._camera.up.copy(this._cameraUp0);
|
|
1314
|
-
const s = this.getPosition(
|
|
1314
|
+
const s = this.getPosition(b);
|
|
1315
1315
|
this.updateCameraUp(), this.setPosition(s.x, s.y, s.z);
|
|
1316
1316
|
}
|
|
1317
1317
|
const t = [
|
|
@@ -1347,7 +1347,7 @@ class J extends Ts {
|
|
|
1347
1347
|
* @category Methods
|
|
1348
1348
|
*/
|
|
1349
1349
|
updateCameraUp() {
|
|
1350
|
-
this._yAxisUpSpace.setFromUnitVectors(this._camera.up,
|
|
1350
|
+
this._yAxisUpSpace.setFromUnitVectors(this._camera.up, pe), this._yAxisUpSpaceInverse.copy(this._yAxisUpSpace).invert();
|
|
1351
1351
|
}
|
|
1352
1352
|
/**
|
|
1353
1353
|
* Apply current camera-up direction to the camera.
|
|
@@ -1355,9 +1355,9 @@ class J extends Ts {
|
|
|
1355
1355
|
* @category Methods
|
|
1356
1356
|
*/
|
|
1357
1357
|
applyCameraUp() {
|
|
1358
|
-
const e =
|
|
1358
|
+
const e = b.subVectors(this._target, this._camera.position).normalize(), t = L.crossVectors(e, this._camera.up);
|
|
1359
1359
|
this._camera.up.crossVectors(t, e).normalize(), this._camera.updateMatrixWorld();
|
|
1360
|
-
const s = this.getPosition(
|
|
1360
|
+
const s = this.getPosition(b);
|
|
1361
1361
|
this.updateCameraUp(), this.setPosition(s.x, s.y, s.z);
|
|
1362
1362
|
}
|
|
1363
1363
|
/**
|
|
@@ -1375,12 +1375,12 @@ class J extends Ts {
|
|
|
1375
1375
|
if (A(t))
|
|
1376
1376
|
this._thetaVelocity.value = 0, this._spherical.theta = this._sphericalEnd.theta;
|
|
1377
1377
|
else {
|
|
1378
|
-
const
|
|
1378
|
+
const p = 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
|
+
p,
|
|
1384
1384
|
1 / 0,
|
|
1385
1385
|
e
|
|
1386
1386
|
), this._needsUpdate = !0;
|
|
@@ -1388,12 +1388,12 @@ class J extends Ts {
|
|
|
1388
1388
|
if (A(s))
|
|
1389
1389
|
this._phiVelocity.value = 0, this._spherical.phi = this._sphericalEnd.phi;
|
|
1390
1390
|
else {
|
|
1391
|
-
const
|
|
1391
|
+
const p = 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
|
+
p,
|
|
1397
1397
|
1 / 0,
|
|
1398
1398
|
e
|
|
1399
1399
|
), this._needsUpdate = !0;
|
|
@@ -1401,12 +1401,12 @@ class J extends Ts {
|
|
|
1401
1401
|
if (A(i))
|
|
1402
1402
|
this._radiusVelocity.value = 0, this._spherical.radius = this._sphericalEnd.radius;
|
|
1403
1403
|
else {
|
|
1404
|
-
const
|
|
1404
|
+
const p = 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
|
+
p,
|
|
1410
1410
|
this.maxSpeed,
|
|
1411
1411
|
e
|
|
1412
1412
|
), this._needsUpdate = !0;
|
|
@@ -1414,12 +1414,12 @@ class J extends Ts {
|
|
|
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 p = this._isUserControllingTruck ? this.draggingSmoothTime : this.smoothTime;
|
|
1418
1418
|
Be(
|
|
1419
1419
|
this._target,
|
|
1420
1420
|
this._targetEnd,
|
|
1421
1421
|
this._targetVelocity,
|
|
1422
|
-
|
|
1422
|
+
p,
|
|
1423
1423
|
this.maxSpeed,
|
|
1424
1424
|
e,
|
|
1425
1425
|
this._target
|
|
@@ -1428,12 +1428,12 @@ class J extends Ts {
|
|
|
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 p = this._isUserControllingOffset ? this.draggingSmoothTime : this.smoothTime;
|
|
1432
1432
|
Be(
|
|
1433
1433
|
this._focalOffset,
|
|
1434
1434
|
this._focalOffsetEnd,
|
|
1435
1435
|
this._focalOffsetVelocity,
|
|
1436
|
-
|
|
1436
|
+
p,
|
|
1437
1437
|
this.maxSpeed,
|
|
1438
1438
|
e,
|
|
1439
1439
|
this._focalOffset
|
|
@@ -1442,57 +1442,57 @@ class J extends Ts {
|
|
|
1442
1442
|
if (A(n))
|
|
1443
1443
|
this._zoomVelocity.value = 0, this._zoom = this._zoomEnd;
|
|
1444
1444
|
else {
|
|
1445
|
-
const
|
|
1445
|
+
const p = 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
|
+
p,
|
|
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 p = this._spherical.radius - this._lastDistance, v = this._camera, f = this._getCameraDirection(ne), u = b.copy(f).cross(v.up).normalize();
|
|
1458
1458
|
u.lengthSq() === 0 && (u.x = 1);
|
|
1459
|
-
const g = L.crossVectors(u,
|
|
1459
|
+
const g = L.crossVectors(u, f), y = this._sphericalEnd.radius * Math.tan(v.getEffectiveFOV() * ie * 0.5), _ = (this._sphericalEnd.radius - p - this._sphericalEnd.radius) / this._sphericalEnd.radius, O = G.copy(this._targetEnd).add(
|
|
1460
1460
|
u.multiplyScalar(
|
|
1461
1461
|
this._dollyControlCoord.x * y * v.aspect
|
|
1462
1462
|
)
|
|
1463
1463
|
).add(
|
|
1464
1464
|
g.multiplyScalar(this._dollyControlCoord.y * y)
|
|
1465
|
-
), C =
|
|
1466
|
-
if (this.infinityDolly && (
|
|
1467
|
-
this._sphericalEnd.radius -=
|
|
1468
|
-
const
|
|
1469
|
-
C.add(
|
|
1465
|
+
), C = b.copy(this._targetEnd).lerp(O, _), w = this._lastDollyDirection === K.IN && this._spherical.radius <= this.minDistance, E = this._lastDollyDirection === K.OUT && this.maxDistance <= this._spherical.radius;
|
|
1466
|
+
if (this.infinityDolly && (w || E)) {
|
|
1467
|
+
this._sphericalEnd.radius -= p, this._spherical.radius -= p;
|
|
1468
|
+
const R = L.copy(f).multiplyScalar(-p);
|
|
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 -=
|
|
1474
|
-
} else if (
|
|
1475
|
-
const
|
|
1473
|
+
this._targetEnd.copy(C), this._target.add(x), this._changedDolly -= p, A(this._changedDolly) && (this._changedDolly = 0);
|
|
1474
|
+
} else if (H(this._camera) && this._changedZoom !== 0) {
|
|
1475
|
+
const p = this._zoom - this._lastZoom, v = this._camera, f = 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), u = L.set(0, 0, -1).applyQuaternion(v.quaternion), g = G.copy(
|
|
1480
|
-
|
|
1479
|
+
).unproject(v), u = L.set(0, 0, -1).applyQuaternion(v.quaternion), g = G.copy(f).add(u.multiplyScalar(-f.dot(v.up))), l = -(this._zoom - p - this._zoom) / this._zoom, _ = this._getCameraDirection(ne), O = this._targetEnd.dot(_), C = b.copy(this._targetEnd).lerp(g, l), w = C.dot(_), E = _.multiplyScalar(
|
|
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 -= p, 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;
|
|
1488
1488
|
const a = this._collisionTest();
|
|
1489
|
-
this._spherical.radius = Math.min(this._spherical.radius, a), this._spherical.makeSafe(), this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target), this._camera.lookAt(this._target), (!A(this._focalOffset.x) || !A(this._focalOffset.y) || !A(this._focalOffset.z)) && (F.setFromMatrixColumn(this._camera.matrix, 0), N.setFromMatrixColumn(this._camera.matrix, 1), Z.setFromMatrixColumn(this._camera.matrix, 2), F.multiplyScalar(this._focalOffset.x), N.multiplyScalar(-this._focalOffset.y), Z.multiplyScalar(this._focalOffset.z),
|
|
1489
|
+
this._spherical.radius = Math.min(this._spherical.radius, a), this._spherical.makeSafe(), this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target), this._camera.lookAt(this._target), (!A(this._focalOffset.x) || !A(this._focalOffset.y) || !A(this._focalOffset.z)) && (F.setFromMatrixColumn(this._camera.matrix, 0), N.setFromMatrixColumn(this._camera.matrix, 1), Z.setFromMatrixColumn(this._camera.matrix, 2), F.multiplyScalar(this._focalOffset.x), N.multiplyScalar(-this._focalOffset.y), Z.multiplyScalar(this._focalOffset.z), b.copy(F).add(N).add(Z), this._camera.position.add(b), this._camera.updateMatrixWorld()), this._boundaryEnclosesCamera && this._encloseToBoundary(
|
|
1490
1490
|
this._camera.position.copy(this._target),
|
|
1491
|
-
|
|
1491
|
+
b.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse),
|
|
1492
1492
|
1
|
|
1493
1493
|
);
|
|
1494
|
-
const
|
|
1495
|
-
return
|
|
1494
|
+
const m = this._needsUpdate;
|
|
1495
|
+
return m && !this._updatedLastTime ? (this._hasRested = !1, this.dispatchEvent({ type: "wake" }), this.dispatchEvent({ type: "update" })) : m ? (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" }))) : !m && 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 = m, this._needsUpdate = !1, m;
|
|
1496
1496
|
}
|
|
1497
1497
|
/**
|
|
1498
1498
|
* Get all state in JSON string
|
|
@@ -1515,7 +1515,7 @@ class J extends Ts {
|
|
|
1515
1515
|
truckSpeed: this.truckSpeed,
|
|
1516
1516
|
dollyToCursor: this.dollyToCursor,
|
|
1517
1517
|
target: this._targetEnd.toArray(),
|
|
1518
|
-
position:
|
|
1518
|
+
position: b.setFromSpherical(this._sphericalEnd).add(this._targetEnd).toArray(),
|
|
1519
1519
|
zoom: this._zoomEnd,
|
|
1520
1520
|
focalOffset: this._focalOffsetEnd.toArray(),
|
|
1521
1521
|
target0: this._target0.toArray(),
|
|
@@ -1533,7 +1533,7 @@ class J extends Ts {
|
|
|
1533
1533
|
fromJSON(e, t = !1) {
|
|
1534
1534
|
const s = JSON.parse(e);
|
|
1535
1535
|
this.enabled = s.enabled, this.minDistance = s.minDistance, this.maxDistance = oe(s.maxDistance), this.minZoom = s.minZoom, this.maxZoom = oe(s.maxZoom), this.minPolarAngle = s.minPolarAngle, this.maxPolarAngle = oe(s.maxPolarAngle), this.minAzimuthAngle = oe(s.minAzimuthAngle), this.maxAzimuthAngle = oe(s.maxAzimuthAngle), this.smoothTime = s.smoothTime, this.draggingSmoothTime = s.draggingSmoothTime, this.dollySpeed = s.dollySpeed, this.truckSpeed = s.truckSpeed, this.dollyToCursor = s.dollyToCursor, this._target0.fromArray(s.target0), this._position0.fromArray(s.position0), this._zoom0 = s.zoom0, this._focalOffset0.fromArray(s.focalOffset0), this.moveTo(s.target[0], s.target[1], s.target[2], t), z.setFromVector3(
|
|
1536
|
-
|
|
1536
|
+
b.fromArray(s.position).sub(this._targetEnd).applyQuaternion(this._yAxisUpSpace)
|
|
1537
1537
|
), this.rotateTo(z.theta, z.phi, t), this.dollyTo(z.radius, t), this.zoomTo(s.zoom, t), this.setFocalOffset(
|
|
1538
1538
|
s.focalOffset[0],
|
|
1539
1539
|
s.focalOffset[1],
|
|
@@ -1598,15 +1598,15 @@ class J extends Ts {
|
|
|
1598
1598
|
if (s === 0)
|
|
1599
1599
|
return e.add(t).add(n);
|
|
1600
1600
|
{
|
|
1601
|
-
const
|
|
1602
|
-
return e.add(L.copy(t).multiplyScalar(
|
|
1601
|
+
const d = 1 + s * a / t.dot(n);
|
|
1602
|
+
return e.add(L.copy(t).multiplyScalar(d)).add(n.multiplyScalar(1 - s));
|
|
1603
1603
|
}
|
|
1604
1604
|
}
|
|
1605
1605
|
_updateNearPlaneCorners() {
|
|
1606
1606
|
if (Y(this._camera)) {
|
|
1607
1607
|
const e = this._camera, t = e.near, s = e.getEffectiveFOV() * ie, i = Math.tan(s * 0.5) * t, r = i * e.aspect;
|
|
1608
1608
|
this._nearPlaneCorners[0].set(-r, -i, 0), this._nearPlaneCorners[1].set(r, -i, 0), this._nearPlaneCorners[2].set(r, i, 0), this._nearPlaneCorners[3].set(-r, i, 0);
|
|
1609
|
-
} else if (
|
|
1609
|
+
} else if (H(this._camera)) {
|
|
1610
1610
|
const e = this._camera, t = 1 / e.zoom, s = e.left * t, i = e.right * t, r = e.top * t, o = e.bottom * t;
|
|
1611
1611
|
this._nearPlaneCorners[0].set(s, r, 0), this._nearPlaneCorners[1].set(i, r, 0), this._nearPlaneCorners[2].set(i, o, 0), this._nearPlaneCorners[3].set(s, o, 0);
|
|
1612
1612
|
}
|
|
@@ -1622,8 +1622,8 @@ class J extends Ts {
|
|
|
1622
1622
|
const r = L.copy(this._nearPlaneCorners[i]);
|
|
1623
1623
|
r.applyMatrix4(Le);
|
|
1624
1624
|
const o = G.addVectors(this._target, r);
|
|
1625
|
-
|
|
1626
|
-
const n =
|
|
1625
|
+
me.set(o, s), me.far = this._spherical.radius + 1;
|
|
1626
|
+
const n = me.intersectObjects(this.colliderMeshes);
|
|
1627
1627
|
n.length !== 0 && n[0].distance < e && (e = n[0].distance);
|
|
1628
1628
|
}
|
|
1629
1629
|
return e;
|
|
@@ -1701,21 +1701,21 @@ class J extends Ts {
|
|
|
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
|
-
|
|
1704
|
+
const m = a.attributes.position;
|
|
1705
|
+
for (let p = 0, v = m.count; p < v; p++)
|
|
1706
|
+
b.fromBufferAttribute(m, p), r = Math.max(r, i.distanceToSquared(b));
|
|
1707
1707
|
}), s.radius = Math.sqrt(r), s;
|
|
1708
1708
|
}
|
|
1709
1709
|
}
|
|
1710
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
|
-
},
|
|
1713
|
-
Q && typeof Q.ownKeys == "function" ?
|
|
1712
|
+
}, fe;
|
|
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);
|
|
1717
1717
|
};
|
|
1718
|
-
function
|
|
1718
|
+
function xs(h) {
|
|
1719
1719
|
console && console.warn && console.warn(h);
|
|
1720
1720
|
}
|
|
1721
1721
|
var _t = Number.isNaN || function(e) {
|
|
@@ -1725,7 +1725,7 @@ function S() {
|
|
|
1725
1725
|
S.init.call(this);
|
|
1726
1726
|
}
|
|
1727
1727
|
Ae.exports = S;
|
|
1728
|
-
Ae.exports.once =
|
|
1728
|
+
Ae.exports.once = As;
|
|
1729
1729
|
S.EventEmitter = S;
|
|
1730
1730
|
S.prototype._events = void 0;
|
|
1731
1731
|
S.prototype._eventsCount = 0;
|
|
@@ -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
|
|
1784
|
-
$e(
|
|
1783
|
+
for (var d = a.length, m = Et(a, d), s = 0; s < d; ++s)
|
|
1784
|
+
$e(m[s], this, t);
|
|
1785
1785
|
return !0;
|
|
1786
1786
|
};
|
|
1787
1787
|
function yt(h, e, t, s) {
|
|
@@ -1795,7 +1795,7 @@ function yt(h, e, t, s) {
|
|
|
1795
1795
|
else if (typeof o == "function" ? o = r[e] = s ? [t, o] : [o, t] : s ? o.unshift(t) : o.push(t), i = gt(h), i > 0 && o.length > i && !o.warned) {
|
|
1796
1796
|
o.warned = !0;
|
|
1797
1797
|
var n = new Error("Possible EventEmitter memory leak detected. " + o.length + " " + String(e) + " listeners added. Use emitter.setMaxListeners() to increase limit");
|
|
1798
|
-
n.name = "MaxListenersExceededWarning", n.emitter = h, n.type = e, n.count = o.length,
|
|
1798
|
+
n.name = "MaxListenersExceededWarning", n.emitter = h, n.type = e, n.count = o.length, xs(n);
|
|
1799
1799
|
}
|
|
1800
1800
|
return h;
|
|
1801
1801
|
}
|
|
@@ -1806,12 +1806,12 @@ S.prototype.on = S.prototype.addListener;
|
|
|
1806
1806
|
S.prototype.prependListener = function(e, t) {
|
|
1807
1807
|
return yt(this, e, t, !0);
|
|
1808
1808
|
};
|
|
1809
|
-
function
|
|
1809
|
+
function Ls() {
|
|
1810
1810
|
if (!this.fired)
|
|
1811
1811
|
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);
|
|
1812
1812
|
}
|
|
1813
1813
|
function vt(h, e, t) {
|
|
1814
|
-
var s = { fired: !1, wrapFn: void 0, target: h, type: e, listener: t }, i =
|
|
1814
|
+
var s = { fired: !1, wrapFn: void 0, target: h, type: e, listener: t }, i = Ls.bind(s);
|
|
1815
1815
|
return i.listener = t, s.wrapFn = i, i;
|
|
1816
1816
|
}
|
|
1817
1817
|
S.prototype.once = function(e, t) {
|
|
@@ -1836,7 +1836,7 @@ S.prototype.removeListener = function(e, t) {
|
|
|
1836
1836
|
}
|
|
1837
1837
|
if (r < 0)
|
|
1838
1838
|
return this;
|
|
1839
|
-
r === 0 ? s.shift() :
|
|
1839
|
+
r === 0 ? s.shift() : Ps(s, r), s.length === 1 && (i[e] = s[0]), i.removeListener !== void 0 && this.emit("removeListener", e, n || t);
|
|
1840
1840
|
}
|
|
1841
1841
|
return this;
|
|
1842
1842
|
};
|
|
@@ -1865,7 +1865,7 @@ function Ct(h, e, t) {
|
|
|
1865
1865
|
if (s === void 0)
|
|
1866
1866
|
return [];
|
|
1867
1867
|
var i = s[e];
|
|
1868
|
-
return i === void 0 ? [] : typeof i == "function" ? t ? [i.listener || i] : [i] : t ?
|
|
1868
|
+
return i === void 0 ? [] : typeof i == "function" ? t ? [i.listener || i] : [i] : t ? Ss(i) : Et(i, i.length);
|
|
1869
1869
|
}
|
|
1870
1870
|
S.prototype.listeners = function(e) {
|
|
1871
1871
|
return Ct(this, e, !0);
|
|
@@ -1889,24 +1889,24 @@ function Ot(h) {
|
|
|
1889
1889
|
return 0;
|
|
1890
1890
|
}
|
|
1891
1891
|
S.prototype.eventNames = function() {
|
|
1892
|
-
return this._eventsCount > 0 ?
|
|
1892
|
+
return this._eventsCount > 0 ? fe(this._events) : [];
|
|
1893
1893
|
};
|
|
1894
1894
|
function Et(h, e) {
|
|
1895
1895
|
for (var t = new Array(e), s = 0; s < e; ++s)
|
|
1896
1896
|
t[s] = h[s];
|
|
1897
1897
|
return t;
|
|
1898
1898
|
}
|
|
1899
|
-
function
|
|
1899
|
+
function Ps(h, e) {
|
|
1900
1900
|
for (; e + 1 < h.length; e++)
|
|
1901
1901
|
h[e] = h[e + 1];
|
|
1902
1902
|
h.pop();
|
|
1903
1903
|
}
|
|
1904
|
-
function
|
|
1904
|
+
function Ss(h) {
|
|
1905
1905
|
for (var e = new Array(h.length), t = 0; t < e.length; ++t)
|
|
1906
1906
|
e[t] = h[t].listener || h[t];
|
|
1907
1907
|
return e;
|
|
1908
1908
|
}
|
|
1909
|
-
function
|
|
1909
|
+
function As(h, e) {
|
|
1910
1910
|
return new Promise(function(t, s) {
|
|
1911
1911
|
function i(o) {
|
|
1912
1912
|
h.removeListener(e, r), s(o);
|
|
@@ -1914,10 +1914,10 @@ function Ss(h, e) {
|
|
|
1914
1914
|
function r() {
|
|
1915
1915
|
typeof h.removeListener == "function" && h.removeListener("error", i), t([].slice.call(arguments));
|
|
1916
1916
|
}
|
|
1917
|
-
Tt(h, e, r, { once: !0 }), e !== "error" &&
|
|
1917
|
+
Tt(h, e, r, { once: !0 }), e !== "error" && Ms(h, i, { once: !0 });
|
|
1918
1918
|
});
|
|
1919
1919
|
}
|
|
1920
|
-
function
|
|
1920
|
+
function Ms(h, e, t) {
|
|
1921
1921
|
typeof h.on == "function" && Tt(h, "error", e, t);
|
|
1922
1922
|
}
|
|
1923
1923
|
function Tt(h, e, t, s) {
|
|
@@ -1931,7 +1931,7 @@ function Tt(h, e, t, s) {
|
|
|
1931
1931
|
throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof h);
|
|
1932
1932
|
}
|
|
1933
1933
|
var ye = Ae.exports;
|
|
1934
|
-
let
|
|
1934
|
+
let Rs = class {
|
|
1935
1935
|
constructor() {
|
|
1936
1936
|
this.mask = 1;
|
|
1937
1937
|
}
|
|
@@ -1962,7 +1962,7 @@ class ee {
|
|
|
1962
1962
|
this.event = new ye.EventEmitter(), this.controllerMap = /* @__PURE__ */ new Map(), this.activeIndex = -1, this.activeControllerSet = /* @__PURE__ */ new Set();
|
|
1963
1963
|
}
|
|
1964
1964
|
addController(e, t) {
|
|
1965
|
-
const s = new
|
|
1965
|
+
const s = new Rs();
|
|
1966
1966
|
return s.disableAll(), t !== void 0 && s.set(t), this.controllerMap.set(e, s), t === this.activeIndex && this.activeControllerSet.add(e), e;
|
|
1967
1967
|
}
|
|
1968
1968
|
removePage(e, t) {
|
|
@@ -1991,11 +1991,11 @@ class ee {
|
|
|
1991
1991
|
}), this.removePage(0), this.controllerMap.clear(), this.event.removeAllListeners(), this.activeControllerSet.clear();
|
|
1992
1992
|
}
|
|
1993
1993
|
}
|
|
1994
|
-
const
|
|
1994
|
+
const wt = {
|
|
1995
1995
|
fov: 45,
|
|
1996
1996
|
near: 1,
|
|
1997
1997
|
far: 1e3,
|
|
1998
|
-
up: new
|
|
1998
|
+
up: new j(0, 1, 0)
|
|
1999
1999
|
};
|
|
2000
2000
|
class Ds extends ee {
|
|
2001
2001
|
constructor(e) {
|
|
@@ -2004,9 +2004,9 @@ class Ds extends ee {
|
|
|
2004
2004
|
get camera() {
|
|
2005
2005
|
return this.controller;
|
|
2006
2006
|
}
|
|
2007
|
-
addPerspectiveCamera(e =
|
|
2008
|
-
const { fov: s, far: i, near: r, up: o, aspect: n } = e, a = n != null ? n : this.width / this.height,
|
|
2009
|
-
return
|
|
2007
|
+
addPerspectiveCamera(e = wt, t) {
|
|
2008
|
+
const { fov: s, far: i, near: r, up: o, aspect: n } = e, a = n != null ? n : this.width / this.height, d = new kt(s, a, r, i);
|
|
2009
|
+
return d.up = o, this.addController(d, t);
|
|
2010
2010
|
}
|
|
2011
2011
|
setPageActive(e) {
|
|
2012
2012
|
super.setPageActive(e, (t, s) => {
|
|
@@ -2072,13 +2072,13 @@ class Ds extends ee {
|
|
|
2072
2072
|
s[7],
|
|
2073
2073
|
s[11],
|
|
2074
2074
|
s[15]
|
|
2075
|
-
), { width: n, height: a } = this,
|
|
2076
|
-
(this.camera.fov !== t.fov || this.camera.aspect !==
|
|
2075
|
+
), { width: n, height: a } = this, d = n / a;
|
|
2076
|
+
(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());
|
|
2077
2077
|
}
|
|
2078
2078
|
}
|
|
2079
2079
|
}
|
|
2080
|
-
const
|
|
2081
|
-
const e = new
|
|
2080
|
+
const Us = (h) => {
|
|
2081
|
+
const e = new ps(
|
|
2082
2082
|
new Ft({
|
|
2083
2083
|
uniforms: {
|
|
2084
2084
|
baseTexture: { value: null },
|
|
@@ -2113,7 +2113,7 @@ const Rs = (h) => {
|
|
|
2113
2113
|
"baseTexture"
|
|
2114
2114
|
);
|
|
2115
2115
|
return e.needsSwap = !0, e;
|
|
2116
|
-
},
|
|
2116
|
+
}, zs = {
|
|
2117
2117
|
name: "OutputShader",
|
|
2118
2118
|
uniforms: {
|
|
2119
2119
|
tDiffuse: { value: null },
|
|
@@ -2207,11 +2207,11 @@ const Rs = (h) => {
|
|
|
2207
2207
|
}`
|
|
2208
2208
|
)
|
|
2209
2209
|
};
|
|
2210
|
-
class
|
|
2210
|
+
class ks extends ms {
|
|
2211
2211
|
constructor() {
|
|
2212
2212
|
super();
|
|
2213
|
-
const e =
|
|
2214
|
-
this.uniforms = Nt.clone(e.uniforms), this.material = new
|
|
2213
|
+
const e = zs;
|
|
2214
|
+
this.uniforms = Nt.clone(e.uniforms), this.material = new It({
|
|
2215
2215
|
name: e.name,
|
|
2216
2216
|
uniforms: this.uniforms,
|
|
2217
2217
|
vertexShader: e.vertexShader,
|
|
@@ -2219,36 +2219,36 @@ class zs extends ms {
|
|
|
2219
2219
|
}), this.fsQuad ? this.fsQuad = new Fe(this.material) : this._fsQuad && (this._fsQuad = new Fe(this.material));
|
|
2220
2220
|
}
|
|
2221
2221
|
}
|
|
2222
|
-
const
|
|
2222
|
+
const Fs = new jt({ color: "black" }), Ns = new at({
|
|
2223
2223
|
color: "black",
|
|
2224
2224
|
sizeAttenuation: !1
|
|
2225
|
-
}),
|
|
2225
|
+
}), Is = new at({
|
|
2226
2226
|
color: "black",
|
|
2227
2227
|
sizeAttenuation: !0
|
|
2228
|
-
}),
|
|
2228
|
+
}), js = new lt({
|
|
2229
2229
|
color: "black",
|
|
2230
2230
|
sizeAttenuation: !0
|
|
2231
|
-
}),
|
|
2231
|
+
}), Hs = new lt({
|
|
2232
2232
|
color: "black",
|
|
2233
2233
|
sizeAttenuation: !1
|
|
2234
|
-
}),
|
|
2234
|
+
}), Bs = new ft({
|
|
2235
2235
|
color: "black",
|
|
2236
2236
|
sizeAttenuation: !1,
|
|
2237
2237
|
lineWidth: 0
|
|
2238
|
-
}), Xe = new
|
|
2238
|
+
}), Xe = new Ht(0), Vs = {
|
|
2239
2239
|
kernelRadius: 8,
|
|
2240
2240
|
minDistance: 5e-3,
|
|
2241
2241
|
maxDistance: 0.1
|
|
2242
|
-
},
|
|
2242
|
+
}, Ys = {
|
|
2243
2243
|
threshold: 0,
|
|
2244
2244
|
strength: 0.4,
|
|
2245
2245
|
radius: 0.1,
|
|
2246
2246
|
bloomAlphaType: 0
|
|
2247
|
-
},
|
|
2247
|
+
}, Zs = {
|
|
2248
2248
|
multisampling: 4,
|
|
2249
2249
|
premultiplieAlpha: !1
|
|
2250
2250
|
};
|
|
2251
|
-
class
|
|
2251
|
+
class Ws {
|
|
2252
2252
|
constructor(e) {
|
|
2253
2253
|
this.bloomComposerActive = !1, this.active = !0, this.bloomSelection = /* @__PURE__ */ new Set(), this.bloomLayer = new Bt(), this.bloomMaterials = {}, this.bloomVisible = {}, this.bloomComposerRenderIng = !1, this.pipViewportState = null, this.options = e;
|
|
2254
2254
|
const {
|
|
@@ -2258,20 +2258,20 @@ class Zs {
|
|
|
2258
2258
|
composerParams: r
|
|
2259
2259
|
} = e, { renderer: o } = t;
|
|
2260
2260
|
this.renderer = o;
|
|
2261
|
-
const { multisampling: n } = r, { maxSamples: a } = o.capabilities,
|
|
2262
|
-
|
|
2263
|
-
|
|
2261
|
+
const { multisampling: n } = r, { maxSamples: a } = o.capabilities, d = o.getDrawingBufferSize(new B()), m = new Vt(
|
|
2262
|
+
d.width,
|
|
2263
|
+
d.height,
|
|
2264
2264
|
{
|
|
2265
2265
|
samples: Math.min(n, a),
|
|
2266
2266
|
type: Yt
|
|
2267
2267
|
}
|
|
2268
|
-
),
|
|
2269
|
-
|
|
2270
|
-
const
|
|
2268
|
+
), p = new ke(o, m), v = this.getSize();
|
|
2269
|
+
p.setSize(v.width, v.height);
|
|
2270
|
+
const f = new hs(
|
|
2271
2271
|
s.scene,
|
|
2272
2272
|
i.camera
|
|
2273
2273
|
);
|
|
2274
|
-
|
|
2274
|
+
p.addPass(f), this.scene = s.scene, this.camera = i.camera, this.finalComposer = p, this.renderPass = f, i.event.on("pageChange", (u) => {
|
|
2275
2275
|
this.changeCamera(u);
|
|
2276
2276
|
}), s.event.on("pageChange", (u) => {
|
|
2277
2277
|
this.changeScene(u);
|
|
@@ -2284,18 +2284,18 @@ class Zs {
|
|
|
2284
2284
|
this.renderPass.scene = e, this.ssaoPass && (this.ssaoPass.scene = e), this.scene = e;
|
|
2285
2285
|
}
|
|
2286
2286
|
addOutputPass() {
|
|
2287
|
-
const { premultiplieAlpha: e } = this.options.composerParams, t = new
|
|
2287
|
+
const { premultiplieAlpha: e } = this.options.composerParams, t = new ks();
|
|
2288
2288
|
this.outputPass = t, this.setPremultiplieAlpha(e), this.finalComposer.addPass(t);
|
|
2289
2289
|
}
|
|
2290
2290
|
setPremultiplieAlpha(e) {
|
|
2291
2291
|
this.outputPass && (this.outputPass.uniforms.premultiplieAlpha.value = e ? 1 : 0);
|
|
2292
2292
|
}
|
|
2293
2293
|
addSSAOPass(e) {
|
|
2294
|
-
const { scene: t, camera: s, renderer: i } = this, r = i.getSize(new B()), o = r.width, n = r.height, a = new
|
|
2294
|
+
const { scene: t, camera: s, renderer: i } = this, r = i.getSize(new B()), o = r.width, n = r.height, a = new cs(t, s, o, n);
|
|
2295
2295
|
a.kernelRadius = e.kernelRadius, a.minDistance = e.minDistance, a.maxDistance = e.maxDistance, this.ssaoPass = a, this.finalComposer.addPass(a);
|
|
2296
2296
|
}
|
|
2297
2297
|
addBloomPass(e) {
|
|
2298
|
-
const { renderer: t } = this, { threshold: s, strength: i, radius: r, bloomAlphaType: o } = e, n = new
|
|
2298
|
+
const { renderer: t } = this, { threshold: s, strength: i, radius: r, bloomAlphaType: o } = e, n = new ds(
|
|
2299
2299
|
new B(window.innerWidth, window.innerHeight),
|
|
2300
2300
|
i,
|
|
2301
2301
|
r,
|
|
@@ -2304,8 +2304,8 @@ class Zs {
|
|
|
2304
2304
|
this.bloomPass = n;
|
|
2305
2305
|
const a = new ke(t);
|
|
2306
2306
|
a.renderToScreen = !1, a.addPass(this.renderPass), a.addPass(n), this.bloomComposer = a;
|
|
2307
|
-
const
|
|
2308
|
-
|
|
2307
|
+
const d = Us(a);
|
|
2308
|
+
d.uniforms.bloomAlphaType.value = o, this.bloomComposer = a, this.finalComposer.addPass(d), this.mixPass = d, this.bloomLayer.set(Oe);
|
|
2309
2309
|
}
|
|
2310
2310
|
setBloomSelection(e, t) {
|
|
2311
2311
|
if (!this.bloomComposer) {
|
|
@@ -2337,16 +2337,16 @@ class Zs {
|
|
|
2337
2337
|
i.isTransformControls || i.isTransformControlsRoot || i.type === "RectAreaLightHelper" ? e.push(i) : t.push(i);
|
|
2338
2338
|
}), t.forEach((i) => {
|
|
2339
2339
|
i.traverse((r) => {
|
|
2340
|
-
var
|
|
2340
|
+
var d;
|
|
2341
2341
|
const o = r, n = r, a = r;
|
|
2342
|
-
if ((
|
|
2342
|
+
if ((d = o.material) != null && d.isShadowMaterial)
|
|
2343
2343
|
e.push(o);
|
|
2344
2344
|
else if (o.material && this.bloomLayer.test(o.layers) === !1) {
|
|
2345
2345
|
if (o.material.transparent === !0 && (o.material.opacity !== 1 || o.material.alphaMap)) {
|
|
2346
2346
|
e.push(o);
|
|
2347
2347
|
return;
|
|
2348
2348
|
}
|
|
2349
|
-
this.bloomMaterials[o.uuid] = o.material, n.isSprite ? n.material.sizeAttenuation ? n.material =
|
|
2349
|
+
this.bloomMaterials[o.uuid] = o.material, n.isSprite ? n.material.sizeAttenuation ? n.material = js : n.material = Hs : o.material instanceof ft ? o.material = Bs : a.isPoints ? a.material.sizeAttenuation ? a.material = Is : a.material = Ns : o.material = Fs;
|
|
2350
2350
|
}
|
|
2351
2351
|
});
|
|
2352
2352
|
}), e.forEach((i) => {
|
|
@@ -2396,12 +2396,12 @@ class Zs {
|
|
|
2396
2396
|
this.bloomMaterials = {}, this.bloomVisible = {}, this.bloomSelection.clear(), this.finalComposer.dispose(), (e = this.bloomComposer) == null || e.dispose();
|
|
2397
2397
|
}
|
|
2398
2398
|
}
|
|
2399
|
-
class
|
|
2399
|
+
class Ks extends ee {
|
|
2400
2400
|
constructor(e) {
|
|
2401
2401
|
super(), this.autoRotateSpeed = 0, this.options = e;
|
|
2402
2402
|
const t = {
|
|
2403
2403
|
Vector2: B,
|
|
2404
|
-
Vector3:
|
|
2404
|
+
Vector3: j,
|
|
2405
2405
|
Vector4: Wt,
|
|
2406
2406
|
Quaternion: ht,
|
|
2407
2407
|
Matrix4: W,
|
|
@@ -2443,8 +2443,8 @@ class Ws extends ee {
|
|
|
2443
2443
|
super.update(e, t), this.autoRotateSpeed && this.cameraControls && (this.cameraControls.azimuthAngle += this.autoRotateSpeed * e * Zt.DEG2RAD);
|
|
2444
2444
|
}
|
|
2445
2445
|
}
|
|
2446
|
-
const qe = new
|
|
2447
|
-
class
|
|
2446
|
+
const qe = new j(), $s = new ht(), Qe = new j(), I = new W(), Gs = new W();
|
|
2447
|
+
class Xs {
|
|
2448
2448
|
/**
|
|
2449
2449
|
* Constructs a new CSS3D renderer.
|
|
2450
2450
|
*
|
|
@@ -2458,34 +2458,34 @@ class Gs {
|
|
|
2458
2458
|
objects: /* @__PURE__ */ new WeakMap()
|
|
2459
2459
|
}, a = e.element !== void 0 ? e.element : document.createElement("div");
|
|
2460
2460
|
a.style.overflow = "hidden", this.domElement = a;
|
|
2461
|
-
const
|
|
2462
|
-
|
|
2463
|
-
const
|
|
2464
|
-
|
|
2461
|
+
const d = document.createElement("div");
|
|
2462
|
+
d.style.transformOrigin = "0 0", d.style.pointerEvents = "none", a.appendChild(d);
|
|
2463
|
+
const m = document.createElement("div");
|
|
2464
|
+
m.style.transformStyle = "preserve-3d", d.appendChild(m), this.getSize = function() {
|
|
2465
2465
|
return {
|
|
2466
2466
|
width: s,
|
|
2467
2467
|
height: i
|
|
2468
2468
|
};
|
|
2469
2469
|
}, this.render = function(y, l) {
|
|
2470
2470
|
const _ = l.projectionMatrix.elements[5] * o;
|
|
2471
|
-
l.view && l.view.enabled ? (
|
|
2471
|
+
l.view && l.view.enabled ? (d.style.transform = `translate( ${-l.view.offsetX * (s / l.view.width)}px, ${-l.view.offsetY * (i / l.view.height)}px )`, d.style.transform += `scale( ${l.view.fullWidth / l.view.width}, ${l.view.fullHeight / l.view.height} )`) : d.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
|
|
2475
|
-
n.camera.style !==
|
|
2474
|
+
const w = l.view && l.view.enabled ? l.view.height / l.view.fullHeight : 1, E = l.isOrthographicCamera ? `scale( ${w} )scale(` + _ + ")translate(" + p(O) + "px," + p(C) + "px)" + v(l.matrixWorldInverse) : `scale( ${w} )translateZ(` + _ + "px)" + v(l.matrixWorldInverse), R = (l.isPerspectiveCamera ? "perspective(" + _ + "px) " : "") + E + "translate(" + r + "px," + o + "px)";
|
|
2475
|
+
n.camera.style !== R && (m.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",
|
|
2477
|
+
s = y, i = l, r = s / 2, o = i / 2, a.style.width = y + "px", a.style.height = l + "px", d.style.width = y + "px", d.style.height = l + "px", m.style.width = y + "px", m.style.height = l + "px";
|
|
2478
2478
|
};
|
|
2479
|
-
function
|
|
2479
|
+
function p(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(" + p(l[0]) + "," + p(-l[1]) + "," + p(l[2]) + "," + p(l[3]) + "," + p(l[4]) + "," + p(-l[5]) + "," + p(l[6]) + "," + p(l[7]) + "," + p(l[8]) + "," + p(-l[9]) + "," + p(l[10]) + "," + p(l[11]) + "," + p(l[12]) + "," + p(-l[13]) + "," + p(l[14]) + "," + p(l[15]) + ")";
|
|
2485
2485
|
}
|
|
2486
|
-
function
|
|
2486
|
+
function f(y) {
|
|
2487
2487
|
const l = y.elements;
|
|
2488
|
-
return "translate(-50%,-50%)" + ("matrix3d(" +
|
|
2488
|
+
return "translate(-50%,-50%)" + ("matrix3d(" + p(l[0]) + "," + p(l[1]) + "," + p(l[2]) + "," + p(l[3]) + "," + p(-l[4]) + "," + p(-l[5]) + "," + p(-l[6]) + "," + p(-l[7]) + "," + p(l[8]) + "," + p(l[9]) + "," + p(l[10]) + "," + p(l[11]) + "," + p(l[12]) + "," + p(l[13]) + "," + p(l[14]) + "," + p(l[15]) + ")");
|
|
2489
2489
|
}
|
|
2490
2490
|
function u(y) {
|
|
2491
2491
|
y.isCSS3DObject && (y.element.style.display = "none");
|
|
@@ -2498,27 +2498,27 @@ class Gs {
|
|
|
2498
2498
|
return;
|
|
2499
2499
|
}
|
|
2500
2500
|
if (y.isCSS3DObject) {
|
|
2501
|
-
const C = y.layers.test(_.layers) === !0,
|
|
2502
|
-
if (
|
|
2501
|
+
const C = y.layers.test(_.layers) === !0, w = y.element;
|
|
2502
|
+
if (w.style.display = C === !0 ? "" : "none", C === !0) {
|
|
2503
2503
|
y.onBeforeRender(t, l, _);
|
|
2504
2504
|
let E;
|
|
2505
|
-
y.isCSS3DSprite ? (
|
|
2505
|
+
y.isCSS3DSprite ? (I.copy(_.matrixWorldInverse), I.transpose(), y.rotation2D !== 0 && I.multiply(Gs.makeRotationZ(y.rotation2D)), y.matrixWorld.decompose(qe, $s, Qe), I.setPosition(qe), I.scale(Qe), I.elements[3] = 0, I.elements[7] = 0, I.elements[11] = 0, I.elements[15] = 1, E = f(I)) : E = f(y.matrixWorld);
|
|
2506
2506
|
const x = n.objects.get(y);
|
|
2507
2507
|
if (x === void 0 || x.style !== E) {
|
|
2508
|
-
|
|
2509
|
-
const
|
|
2510
|
-
n.objects.set(y,
|
|
2508
|
+
w.style.transform = E;
|
|
2509
|
+
const R = { style: E };
|
|
2510
|
+
n.objects.set(y, R);
|
|
2511
2511
|
}
|
|
2512
|
-
|
|
2512
|
+
w.parentNode !== m && m.appendChild(w), y.onAfterRender(t, l, _);
|
|
2513
2513
|
}
|
|
2514
2514
|
}
|
|
2515
|
-
for (let C = 0,
|
|
2515
|
+
for (let C = 0, w = y.children.length; C < w; C++)
|
|
2516
2516
|
g(y.children[C], l, _);
|
|
2517
2517
|
}
|
|
2518
2518
|
}
|
|
2519
2519
|
}
|
|
2520
|
-
const q = new
|
|
2521
|
-
class
|
|
2520
|
+
const q = new j(), Je = new W(), et = new W(), tt = new j(), st = new j();
|
|
2521
|
+
class qs {
|
|
2522
2522
|
/**
|
|
2523
2523
|
* Constructs a new CSS2D renderer.
|
|
2524
2524
|
*
|
|
@@ -2536,18 +2536,18 @@ class Xs {
|
|
|
2536
2536
|
height: i
|
|
2537
2537
|
};
|
|
2538
2538
|
}, this.render = function(u, g) {
|
|
2539
|
-
u.matrixWorldAutoUpdate === !0 && u.updateMatrixWorld(), g.parent === null && g.matrixWorldAutoUpdate === !0 && g.updateMatrixWorld(), Je.copy(g.matrixWorldInverse), et.multiplyMatrices(g.projectionMatrix, Je),
|
|
2539
|
+
u.matrixWorldAutoUpdate === !0 && u.updateMatrixWorld(), g.parent === null && g.matrixWorldAutoUpdate === !0 && g.updateMatrixWorld(), Je.copy(g.matrixWorldInverse), et.multiplyMatrices(g.projectionMatrix, Je), m(u, u, g), f(u);
|
|
2540
2540
|
}, this.setSize = function(u, g) {
|
|
2541
2541
|
s = u, i = g, r = s / 2, o = i / 2, a.style.width = u + "px", a.style.height = g + "px";
|
|
2542
2542
|
};
|
|
2543
|
-
function
|
|
2543
|
+
function d(u) {
|
|
2544
2544
|
u.isCSS2DObject && (u.element.style.display = "none");
|
|
2545
2545
|
for (let g = 0, y = u.children.length; g < y; g++)
|
|
2546
|
-
|
|
2546
|
+
d(u.children[g]);
|
|
2547
2547
|
}
|
|
2548
|
-
function
|
|
2548
|
+
function m(u, g, y) {
|
|
2549
2549
|
if (u.visible === !1) {
|
|
2550
|
-
|
|
2550
|
+
d(u);
|
|
2551
2551
|
return;
|
|
2552
2552
|
}
|
|
2553
2553
|
if (u.isCSS2DObject) {
|
|
@@ -2555,14 +2555,14 @@ class Xs {
|
|
|
2555
2555
|
const l = q.z >= -1 && q.z <= 1 && u.layers.test(y.layers) === !0, _ = u.element;
|
|
2556
2556
|
_.style.display = l === !0 ? "" : "none", l === !0 && (u.onBeforeRender(t, g, y), _.style.transform = "translate(" + -100 * u.center.x + "%," + -100 * u.center.y + "%)translate(" + (q.x * r + r) + "px," + (-q.y * o + o) + "px)", _.parentNode !== a && a.appendChild(_), u.onAfterRender(t, g, y));
|
|
2557
2557
|
const O = {
|
|
2558
|
-
distanceToCameraSquared:
|
|
2558
|
+
distanceToCameraSquared: p(y, u)
|
|
2559
2559
|
};
|
|
2560
2560
|
n.objects.set(u, O);
|
|
2561
2561
|
}
|
|
2562
2562
|
for (let l = 0, _ = u.children.length; l < _; l++)
|
|
2563
|
-
|
|
2563
|
+
m(u.children[l], g, y);
|
|
2564
2564
|
}
|
|
2565
|
-
function
|
|
2565
|
+
function p(u, g) {
|
|
2566
2566
|
return tt.setFromMatrixPosition(u.matrixWorld), st.setFromMatrixPosition(g.matrixWorld), tt.distanceToSquared(st);
|
|
2567
2567
|
}
|
|
2568
2568
|
function v(u) {
|
|
@@ -2571,7 +2571,7 @@ class Xs {
|
|
|
2571
2571
|
y.isCSS2DObject && g.push(y);
|
|
2572
2572
|
}), g;
|
|
2573
2573
|
}
|
|
2574
|
-
function
|
|
2574
|
+
function f(u) {
|
|
2575
2575
|
const g = v(u).sort(function(l, _) {
|
|
2576
2576
|
if (l.renderOrder !== _.renderOrder)
|
|
2577
2577
|
return _.renderOrder - l.renderOrder;
|
|
@@ -2586,12 +2586,12 @@ class Xs {
|
|
|
2586
2586
|
const it = {
|
|
2587
2587
|
zIndex: "auto"
|
|
2588
2588
|
};
|
|
2589
|
-
class
|
|
2589
|
+
class Qs {
|
|
2590
2590
|
constructor(e) {
|
|
2591
2591
|
this.container = e;
|
|
2592
2592
|
}
|
|
2593
2593
|
addRenderer(e, t) {
|
|
2594
|
-
const s = t.container || this.container, i = s.offsetWidth, r = s.offsetHeight, o = e === "css2d" ? new
|
|
2594
|
+
const s = t.container || this.container, i = s.offsetWidth, r = s.offsetHeight, o = e === "css2d" ? new qs() : new Xs();
|
|
2595
2595
|
o.domElement.style.position = "absolute", o.domElement.style.top = "0", o.domElement.style.pointerEvents = "none", o.domElement.style.zIndex = t.zIndex, o.setSize(i, r), s.appendChild(o.domElement), e === "css2d" ? this.css2Drenderer = o : e === "css3d" && (this.css3Drenderer = o);
|
|
2596
2596
|
}
|
|
2597
2597
|
setSize(e, t) {
|
|
@@ -2607,7 +2607,7 @@ class qs {
|
|
|
2607
2607
|
(e = this.css2Drenderer) == null || e.domElement.remove(), (t = this.css3Drenderer) == null || t.domElement.remove(), this.css2Drenderer = void 0, this.css3Drenderer = void 0;
|
|
2608
2608
|
}
|
|
2609
2609
|
}
|
|
2610
|
-
class
|
|
2610
|
+
class Js {
|
|
2611
2611
|
constructor(e) {
|
|
2612
2612
|
this.helpers = {}, this.options = e;
|
|
2613
2613
|
}
|
|
@@ -2616,7 +2616,7 @@ class Qs {
|
|
|
2616
2616
|
let i = this.helpers[t];
|
|
2617
2617
|
if (i === void 0) {
|
|
2618
2618
|
if (e.isScene)
|
|
2619
|
-
i = new
|
|
2619
|
+
i = new De(100);
|
|
2620
2620
|
else if (e.isCamera)
|
|
2621
2621
|
i = new Gt(e);
|
|
2622
2622
|
else if (e.isPointLight)
|
|
@@ -2628,7 +2628,7 @@ class Qs {
|
|
|
2628
2628
|
else if (e.isHemisphereLight)
|
|
2629
2629
|
i = new Jt(e, 10);
|
|
2630
2630
|
else if (e.isRectAreaLight)
|
|
2631
|
-
i = new
|
|
2631
|
+
i = new fs(e);
|
|
2632
2632
|
else {
|
|
2633
2633
|
const r = new ct();
|
|
2634
2634
|
if (r.setFromObject(e, !0), r.isEmpty() === !1) {
|
|
@@ -2664,7 +2664,7 @@ class Qs {
|
|
|
2664
2664
|
}
|
|
2665
2665
|
removeAllExcludeScene() {
|
|
2666
2666
|
Object.keys(this.helpers).forEach((e) => {
|
|
2667
|
-
this.helpers[e] instanceof
|
|
2667
|
+
this.helpers[e] instanceof De || this.remove({
|
|
2668
2668
|
uuid: e
|
|
2669
2669
|
});
|
|
2670
2670
|
});
|
|
@@ -2674,8 +2674,8 @@ class Qs {
|
|
|
2674
2674
|
const { cameraController: i } = this.options;
|
|
2675
2675
|
Object.values(this.helpers).forEach((n) => {
|
|
2676
2676
|
if (n.update && n.update(), n instanceof Ue) {
|
|
2677
|
-
const a = n.material, { object:
|
|
2678
|
-
|
|
2677
|
+
const a = n.material, { object: d } = a.userData;
|
|
2678
|
+
d && n.box.setFromObject(d, !0);
|
|
2679
2679
|
}
|
|
2680
2680
|
}), ((r = this.viewHelper) == null ? void 0 : r.animating) === !0 && (this.viewHelper.update(e), (o = t.cameraControls) == null || o.setPosition(
|
|
2681
2681
|
...i.camera.position.toArray()
|
|
@@ -2700,7 +2700,7 @@ function rt(h) {
|
|
|
2700
2700
|
}));
|
|
2701
2701
|
};
|
|
2702
2702
|
}
|
|
2703
|
-
class
|
|
2703
|
+
class ei {
|
|
2704
2704
|
constructor(e) {
|
|
2705
2705
|
var t;
|
|
2706
2706
|
this.enabled = !0, this.pickFunctionsMap = /* @__PURE__ */ new Map(), this.pickNodeFunctionsMap = /* @__PURE__ */ new Map(), this.pickFunctionsMapIndex = -1, this.pickNodeFunctionsMapIndex = -1, this.activeObjects = /* @__PURE__ */ new Set(), this.activeObject = null, this.prevActiveObjects = /* @__PURE__ */ new Set(), this.objCallbackMap = /* @__PURE__ */ new Map(), this.pickListener = {
|
|
@@ -2715,30 +2715,30 @@ class Js {
|
|
|
2715
2715
|
return;
|
|
2716
2716
|
r.preventDefault();
|
|
2717
2717
|
const o = e === "move" ? t : s, n = [];
|
|
2718
|
-
if (this.pickFunctionsMap.forEach((
|
|
2719
|
-
o.has(
|
|
2720
|
-
objArr:
|
|
2718
|
+
if (this.pickFunctionsMap.forEach((f) => {
|
|
2719
|
+
o.has(f.type) && n.push(te(U({}, f), {
|
|
2720
|
+
objArr: f.objArr instanceof Function ? f.objArr() : f.objArr
|
|
2721
2721
|
}));
|
|
2722
2722
|
}), n.length === 0) return;
|
|
2723
2723
|
this.activeObjects.clear(), this.objCallbackMap.clear(), this.activeObject = null;
|
|
2724
2724
|
const a = this.objCallbackMap;
|
|
2725
|
-
for (const
|
|
2726
|
-
for (const u of
|
|
2725
|
+
for (const f of n)
|
|
2726
|
+
for (const u of f.objArr) {
|
|
2727
2727
|
if (!u.object3d || !u.visibleWithAncestors) continue;
|
|
2728
2728
|
a.has(u) || a.set(u, /* @__PURE__ */ new Map());
|
|
2729
2729
|
const g = a.get(u);
|
|
2730
|
-
g.has(
|
|
2730
|
+
g.has(f.type) || g.set(f.type, []), g.get(f.type).push(f.cb);
|
|
2731
2731
|
}
|
|
2732
2732
|
if (a.size === 0) return;
|
|
2733
|
-
const
|
|
2734
|
-
if (!
|
|
2733
|
+
const d = [...a.keys()].map((f) => f.object3d), m = (v = this.pencil.pick(r, d, !0)) == null ? void 0 : v.intersects;
|
|
2734
|
+
if (!m || m.length === 0)
|
|
2735
2735
|
e === "down" ? this.handleDownOutside(r) : e === "move" && this.handleLeaveEvents(r);
|
|
2736
2736
|
else {
|
|
2737
|
-
const
|
|
2738
|
-
this.processIntersection(
|
|
2737
|
+
const f = m[0];
|
|
2738
|
+
this.processIntersection(f, r, e);
|
|
2739
2739
|
}
|
|
2740
|
-
const
|
|
2741
|
-
this.prevActiveObjects = this.activeObjects, this.activeObjects =
|
|
2740
|
+
const p = this.prevActiveObjects;
|
|
2741
|
+
this.prevActiveObjects = this.activeObjects, this.activeObjects = p, this.activeObjects.clear();
|
|
2742
2742
|
};
|
|
2743
2743
|
this.domElement.addEventListener(
|
|
2744
2744
|
`pointer${e}`,
|
|
@@ -2766,20 +2766,20 @@ class Js {
|
|
|
2766
2766
|
const a = i.get(n);
|
|
2767
2767
|
if (a)
|
|
2768
2768
|
if (t === "move") {
|
|
2769
|
-
const
|
|
2770
|
-
if (
|
|
2771
|
-
for (const
|
|
2772
|
-
|
|
2769
|
+
const d = a.get("enter");
|
|
2770
|
+
if (d && !this.prevActiveObjects.has(n))
|
|
2771
|
+
for (const p of d)
|
|
2772
|
+
p({
|
|
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 m = a.get("move");
|
|
2780
|
+
if (m)
|
|
2781
|
+
for (const p of m)
|
|
2782
|
+
p({
|
|
2783
2783
|
baseObject: n,
|
|
2784
2784
|
realBaseObject: this.activeObject,
|
|
2785
2785
|
mouseEvent: e,
|
|
@@ -2787,23 +2787,23 @@ class Js {
|
|
|
2787
2787
|
intersectionIndex: s
|
|
2788
2788
|
});
|
|
2789
2789
|
} else {
|
|
2790
|
-
const
|
|
2791
|
-
if (
|
|
2792
|
-
for (const
|
|
2793
|
-
|
|
2790
|
+
const d = a.get("down");
|
|
2791
|
+
if (d)
|
|
2792
|
+
for (const p of d)
|
|
2793
|
+
p({
|
|
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 m = a.get("click");
|
|
2801
|
+
if (m) {
|
|
2802
|
+
const p = (v) => {
|
|
2803
2803
|
v.preventDefault();
|
|
2804
|
-
const
|
|
2805
|
-
if (!r && Math.abs(v.clientX - e.clientX) <=
|
|
2806
|
-
for (const u of
|
|
2804
|
+
const f = 5;
|
|
2805
|
+
if (!r && Math.abs(v.clientX - e.clientX) <= f && Math.abs(v.clientY - e.clientY) <= f)
|
|
2806
|
+
for (const u of m)
|
|
2807
2807
|
u({
|
|
2808
2808
|
baseObject: n,
|
|
2809
2809
|
realBaseObject: this.activeObject,
|
|
@@ -2811,9 +2811,9 @@ class Js {
|
|
|
2811
2811
|
sp: o,
|
|
2812
2812
|
intersectionIndex: s
|
|
2813
2813
|
});
|
|
2814
|
-
this.domElement.removeEventListener("pointerup",
|
|
2814
|
+
this.domElement.removeEventListener("pointerup", p);
|
|
2815
2815
|
};
|
|
2816
|
-
this.domElement.addEventListener("pointerup",
|
|
2816
|
+
this.domElement.addEventListener("pointerup", p);
|
|
2817
2817
|
}
|
|
2818
2818
|
}
|
|
2819
2819
|
}
|
|
@@ -2861,13 +2861,13 @@ class Js {
|
|
|
2861
2861
|
for (const n of r) {
|
|
2862
2862
|
const a = n;
|
|
2863
2863
|
a.element.style.pointerEvents = "auto";
|
|
2864
|
-
const
|
|
2865
|
-
this.enabled && (
|
|
2864
|
+
const d = (p) => {
|
|
2865
|
+
this.enabled && (p.preventDefault(), s({
|
|
2866
2866
|
baseObject: a,
|
|
2867
|
-
mouseEvent:
|
|
2867
|
+
mouseEvent: p
|
|
2868
2868
|
}));
|
|
2869
|
-
},
|
|
2870
|
-
a.element.addEventListener(
|
|
2869
|
+
}, m = `pointer${t}`;
|
|
2870
|
+
a.element.addEventListener(m, rt(d), !1), o.push({ arr: a, type: m, listener: d });
|
|
2871
2871
|
}
|
|
2872
2872
|
return this.pickNodeFunctionsMap.set(i, o), i;
|
|
2873
2873
|
}
|
|
@@ -2887,9 +2887,9 @@ class Js {
|
|
|
2887
2887
|
this.pickFunctionsMap.clear(), this.pickNodeFunctionsMap.clear(), this.activeObjects.clear(), this.prevActiveObjects.clear(), this.objCallbackMap.clear();
|
|
2888
2888
|
}
|
|
2889
2889
|
}
|
|
2890
|
-
class
|
|
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 pt(), {
|
|
2893
2893
|
key: "@Scene",
|
|
2894
2894
|
name: "场景",
|
|
2895
2895
|
mList: !1
|
|
@@ -2911,7 +2911,7 @@ class ei extends Js {
|
|
|
2911
2911
|
createBaseObject(e, t = {}) {
|
|
2912
2912
|
const s = U({
|
|
2913
2913
|
mList: !0
|
|
2914
|
-
}, t), i = new
|
|
2914
|
+
}, t), i = new ls();
|
|
2915
2915
|
if (i.object3d = e, i.pencil = this.pencil, i.lead = this, i.mList = this.mList, s.key)
|
|
2916
2916
|
i.key = s.key;
|
|
2917
2917
|
else if (s.target) {
|
|
@@ -2954,35 +2954,35 @@ class ei extends Js {
|
|
|
2954
2954
|
}
|
|
2955
2955
|
draw(e, t, s) {
|
|
2956
2956
|
return se(this, null, function* () {
|
|
2957
|
-
var r, o, n
|
|
2957
|
+
var r, o, n;
|
|
2958
2958
|
const i = this.objectNamesToFactories.get(e);
|
|
2959
2959
|
if (i) {
|
|
2960
2960
|
t || (t = {}), t.target === void 0 && (t.target = s);
|
|
2961
|
-
const
|
|
2962
|
-
let
|
|
2963
|
-
return
|
|
2964
|
-
} :
|
|
2965
|
-
v
|
|
2966
|
-
}),
|
|
2967
|
-
|
|
2961
|
+
const a = t.target, d = (r = t.onTop) != null ? r : 0, m = (o = t.prefab) != null ? o : !1, p = (n = t.create) != null ? n : !0, v = new i().create(t);
|
|
2962
|
+
let f;
|
|
2963
|
+
return a === null ? f = null : typeof a == "string" ? f = this.objects.get(a) : a != null && a.isBaseObject || a ? f = a : m ? f = this.prefabGroup : f = this.group, p === !1 ? v.create = () => {
|
|
2964
|
+
} : p !== !0 && (v.create = () => {
|
|
2965
|
+
p(v);
|
|
2966
|
+
}), v.pencil = this.pencil, v.lead = this, v.mList = this.mList, v.isPrefab = m, v.objectType === "BaseObject" && (v.objectType = `${e}`), v.objectOptions = t, this.setBaseObjectKey(
|
|
2967
|
+
v,
|
|
2968
2968
|
t.key ? `$t:#${t.key}` : "$t:",
|
|
2969
|
-
|
|
2969
|
+
f == null ? void 0 : f.key
|
|
2970
2970
|
), this.objectsPm.set(
|
|
2971
|
-
|
|
2972
|
-
this.addBaseObject(
|
|
2973
|
-
), yield this.objectsPm.get(
|
|
2971
|
+
v,
|
|
2972
|
+
this.addBaseObject(v, f, d)
|
|
2973
|
+
), yield this.objectsPm.get(v), this.objectsPm.delete(v), v;
|
|
2974
2974
|
}
|
|
2975
2975
|
throw new Error(`Unrecognized:${e}`);
|
|
2976
2976
|
});
|
|
2977
2977
|
}
|
|
2978
2978
|
setBaseObjectKey(e, t, s) {
|
|
2979
|
-
const i = e.objectType
|
|
2980
|
-
let
|
|
2979
|
+
const i = e.objectType;
|
|
2980
|
+
let r = t.replace("$t:", i);
|
|
2981
2981
|
if (s) {
|
|
2982
|
-
const [,
|
|
2983
|
-
|
|
2982
|
+
const [, o] = s.split("#");
|
|
2983
|
+
r = r.replace("$p:", o);
|
|
2984
2984
|
}
|
|
2985
|
-
return this.objects.has(
|
|
2985
|
+
return this.objects.has(r) && (r.includes("#") ? r += `-${Ne()}` : r += `#${Ne()}`), e.key = r, this.objects.set(r, e), r;
|
|
2986
2986
|
}
|
|
2987
2987
|
updateBaseObjectKey(e, t) {
|
|
2988
2988
|
var o;
|
|
@@ -3050,7 +3050,7 @@ class ei extends Js {
|
|
|
3050
3050
|
}), this.objects.clear(), this.objectsPm.clear(), this.objMap.clear(), this.objectWrapChindIdMap.clear(), this.objectNamesToFactories.clear();
|
|
3051
3051
|
}
|
|
3052
3052
|
}
|
|
3053
|
-
class
|
|
3053
|
+
class si extends ee {
|
|
3054
3054
|
get lead() {
|
|
3055
3055
|
return this.controller;
|
|
3056
3056
|
}
|
|
@@ -3058,7 +3058,7 @@ class ti extends ee {
|
|
|
3058
3058
|
super(), this.options = e;
|
|
3059
3059
|
}
|
|
3060
3060
|
addLead(e, t, s) {
|
|
3061
|
-
const { pencil: i } = this.options, r = new
|
|
3061
|
+
const { pencil: i } = this.options, r = new ti(i, {
|
|
3062
3062
|
scene: e,
|
|
3063
3063
|
mList: t
|
|
3064
3064
|
});
|
|
@@ -3080,7 +3080,7 @@ class ti extends ee {
|
|
|
3080
3080
|
});
|
|
3081
3081
|
}
|
|
3082
3082
|
}
|
|
3083
|
-
class
|
|
3083
|
+
class ii extends mt {
|
|
3084
3084
|
constructor(e) {
|
|
3085
3085
|
super(e);
|
|
3086
3086
|
}
|
|
@@ -3089,11 +3089,11 @@ class si extends pt {
|
|
|
3089
3089
|
r.setResponseType("blob"), r.setRequestHeader(this.requestHeader), r.setPath(this.path), r.setWithCredentials(this.withCredentials), r.load(
|
|
3090
3090
|
e,
|
|
3091
3091
|
(o) => {
|
|
3092
|
-
const n = o, a = new DecompressionStream("gzip"),
|
|
3093
|
-
new Response(
|
|
3094
|
-
t == null || t(
|
|
3095
|
-
}).catch((
|
|
3096
|
-
i == null || i(
|
|
3092
|
+
const n = o, a = new DecompressionStream("gzip"), d = n.stream().pipeThrough(a);
|
|
3093
|
+
new Response(d).json().then((p) => {
|
|
3094
|
+
t == null || t(p);
|
|
3095
|
+
}).catch((p) => {
|
|
3096
|
+
i == null || i(p);
|
|
3097
3097
|
});
|
|
3098
3098
|
},
|
|
3099
3099
|
s,
|
|
@@ -3101,7 +3101,7 @@ class si extends pt {
|
|
|
3101
3101
|
);
|
|
3102
3102
|
}
|
|
3103
3103
|
}
|
|
3104
|
-
class ot extends
|
|
3104
|
+
class ot extends mt {
|
|
3105
3105
|
constructor(e) {
|
|
3106
3106
|
super(e), this.options = { type: "image" };
|
|
3107
3107
|
}
|
|
@@ -3110,23 +3110,23 @@ class ot extends pt {
|
|
|
3110
3110
|
}
|
|
3111
3111
|
load(e, t, s, i) {
|
|
3112
3112
|
let r, o;
|
|
3113
|
-
this.options.type === "image" ? (o = document.createElement("img"), r = new
|
|
3113
|
+
this.options.type === "image" ? (o = document.createElement("img"), r = new ue(o)) : this.options.type === "video" ? (o = document.createElement("video"), o.preload = "auto", o.autoplay = !1, o.loop = !1, o.muted = !0, o.setAttribute("webkit-playsinline", "webkit-playsinline"), o.setAttribute("playsinline", ""), r = new ts(o)) : r = new ue();
|
|
3114
3114
|
const n = new Se(this.manager);
|
|
3115
3115
|
return n.setResponseType("blob"), n.setRequestHeader(this.requestHeader), n.setPath(this.path), n.setWithCredentials(this.withCredentials), n.load(
|
|
3116
3116
|
e,
|
|
3117
3117
|
(a) => {
|
|
3118
|
-
let
|
|
3119
|
-
const
|
|
3120
|
-
|
|
3118
|
+
let d = a;
|
|
3119
|
+
const m = e.split(".").pop(), p = this.options.type === "image" ? `image/${m || "png"}` : `video/${m || "mp4"}`;
|
|
3120
|
+
d = d.slice(0, a.size, p);
|
|
3121
3121
|
const v = () => {
|
|
3122
|
-
o.removeEventListener("load",
|
|
3123
|
-
},
|
|
3122
|
+
o.removeEventListener("load", f, !1), o.removeEventListener("error", u, !1);
|
|
3123
|
+
}, f = () => {
|
|
3124
3124
|
v(), r.needsUpdate = !0, t && t(r);
|
|
3125
3125
|
}, u = (y) => {
|
|
3126
3126
|
v(), i && i(y), this.manager.itemError(e), this.manager.itemEnd(e);
|
|
3127
3127
|
};
|
|
3128
|
-
o.addEventListener("load",
|
|
3129
|
-
const g = window.URL.createObjectURL(
|
|
3128
|
+
o.addEventListener("load", f, !1), o.addEventListener("error", u, !1);
|
|
3129
|
+
const g = window.URL.createObjectURL(d);
|
|
3130
3130
|
o.src = g;
|
|
3131
3131
|
},
|
|
3132
3132
|
s,
|
|
@@ -3134,7 +3134,7 @@ class ot extends pt {
|
|
|
3134
3134
|
), r;
|
|
3135
3135
|
}
|
|
3136
3136
|
}
|
|
3137
|
-
const
|
|
3137
|
+
const ri = {
|
|
3138
3138
|
images: ["png", "jpg", "jpeg", "ico", "webp", "avif"],
|
|
3139
3139
|
media: ["mp4", "webm", "ogg"],
|
|
3140
3140
|
gltf: ["gltf", "glb"],
|
|
@@ -3143,7 +3143,7 @@ const ii = {
|
|
|
3143
3143
|
exr: ["exr"],
|
|
3144
3144
|
lottie: ["lottie.json"]
|
|
3145
3145
|
};
|
|
3146
|
-
class
|
|
3146
|
+
class oi {
|
|
3147
3147
|
constructor(e) {
|
|
3148
3148
|
this.loadObj = [], this.delLoadArr = [], this.assets = /* @__PURE__ */ new Map(), this.event = new ye.EventEmitter(), this.options = U({
|
|
3149
3149
|
simpleTexture4deleted: !1,
|
|
@@ -3172,7 +3172,7 @@ class ri {
|
|
|
3172
3172
|
const s = this.assets.get(e);
|
|
3173
3173
|
if (!s) {
|
|
3174
3174
|
if ((t === "images" || t === "media" || t === "exr") && this.options.simpleTexture4deleted && this.delLoadArr.includes(e))
|
|
3175
|
-
return new
|
|
3175
|
+
return new ue();
|
|
3176
3176
|
console.warn(`Asset ${e} not found`);
|
|
3177
3177
|
}
|
|
3178
3178
|
return s;
|
|
@@ -3186,7 +3186,7 @@ class ri {
|
|
|
3186
3186
|
if (e.endsWith("json.gzip"))
|
|
3187
3187
|
return "gzipJson";
|
|
3188
3188
|
} else return;
|
|
3189
|
-
for (const [i, r] of Object.entries(
|
|
3189
|
+
for (const [i, r] of Object.entries(ri))
|
|
3190
3190
|
if (r.includes(t))
|
|
3191
3191
|
return i;
|
|
3192
3192
|
}
|
|
@@ -3196,17 +3196,17 @@ class ri {
|
|
|
3196
3196
|
if (e === "media")
|
|
3197
3197
|
return this.videoTextureLoader || (this.videoTextureLoader = new ot(this.loadingManager), this.videoTextureLoader.setOptions({ type: "video" }), this.options.prefix && this.videoTextureLoader.setPath(this.options.prefix)), this.videoTextureLoader;
|
|
3198
3198
|
if (e === "gltf" && (t != null && t.dracoPath))
|
|
3199
|
-
return this.dracoGltfLoader || (this.dracoGltfLoader = new
|
|
3199
|
+
return this.dracoGltfLoader || (this.dracoGltfLoader = new Ie(this.loadingManager), this.dracoLoader = new gs(), this.dracoLoader.setDecoderPath(t == null ? void 0 : t.dracoPath), this.dracoGltfLoader.setDRACOLoader(this.dracoLoader), this.options.prefix && this.dracoGltfLoader.setPath(this.options.prefix)), this.dracoGltfLoader;
|
|
3200
3200
|
if (e === "gltf")
|
|
3201
|
-
return this.gltfLoader || (this.gltfLoader = new
|
|
3201
|
+
return this.gltfLoader || (this.gltfLoader = new Ie(this.loadingManager), this.options.prefix && this.gltfLoader.setPath(this.options.prefix)), this.gltfLoader;
|
|
3202
3202
|
if (e === "lottie")
|
|
3203
|
-
return this.lottieLoader || (this.lottieLoader = new
|
|
3203
|
+
return this.lottieLoader || (this.lottieLoader = new vs(this.loadingManager), this.options.prefix && this.lottieLoader.setPath(this.options.prefix)), this.lottieLoader;
|
|
3204
3204
|
if (e === "gzipJson")
|
|
3205
|
-
return this.gzipJsonLoader || (this.gzipJsonLoader = new
|
|
3205
|
+
return this.gzipJsonLoader || (this.gzipJsonLoader = new ii(this.loadingManager), this.options.prefix && this.gzipJsonLoader.setPath(this.options.prefix)), this.gzipJsonLoader;
|
|
3206
3206
|
if (e === "json")
|
|
3207
3207
|
return this.jsonLoader || (this.jsonLoader = new Se(this.loadingManager), this.jsonLoader.setResponseType("json"), this.options.prefix && this.jsonLoader.setPath(this.options.prefix)), this.jsonLoader;
|
|
3208
3208
|
if (e === "exr")
|
|
3209
|
-
return this.exrLoader || (this.exrLoader = new
|
|
3209
|
+
return this.exrLoader || (this.exrLoader = new ys(this.loadingManager), this.options.prefix && this.exrLoader.setPath(this.options.prefix)), this.exrLoader;
|
|
3210
3210
|
}
|
|
3211
3211
|
add(e, t) {
|
|
3212
3212
|
typeof e == "string" && (e = [e]), e.forEach((s) => {
|
|
@@ -3225,7 +3225,7 @@ class ri {
|
|
|
3225
3225
|
get textureAssets() {
|
|
3226
3226
|
const e = /* @__PURE__ */ new Map();
|
|
3227
3227
|
return this.assets.forEach((t, s) => {
|
|
3228
|
-
(t instanceof
|
|
3228
|
+
(t instanceof ue || t instanceof is || t.isVideoTexture) && e.set(s, t);
|
|
3229
3229
|
}), e;
|
|
3230
3230
|
}
|
|
3231
3231
|
loadAll() {
|
|
@@ -3242,7 +3242,7 @@ class ri {
|
|
|
3242
3242
|
const s = (n = t == null ? void 0 : t.type) != null ? n : this.getAssetType(e);
|
|
3243
3243
|
if (!s)
|
|
3244
3244
|
return;
|
|
3245
|
-
const i = (t == null ? void 0 : t.cache) !== !1, r =
|
|
3245
|
+
const i = (t == null ? void 0 : t.cache) !== !1, r = _s();
|
|
3246
3246
|
if (i) {
|
|
3247
3247
|
if (this.assets.has(e))
|
|
3248
3248
|
return this.assets.get(e);
|
|
@@ -3250,13 +3250,13 @@ class ri {
|
|
|
3250
3250
|
}
|
|
3251
3251
|
const o = this.getLoader(s, t);
|
|
3252
3252
|
try {
|
|
3253
|
-
const
|
|
3254
|
-
if (this.assets.set(e,
|
|
3255
|
-
const
|
|
3256
|
-
|
|
3253
|
+
const d = yield o.loadAsync(e);
|
|
3254
|
+
if (this.assets.set(e, d), r.resolve(d), s === "images" || s === "media" || s === "exr" || s === "lottie") {
|
|
3255
|
+
const m = (a = t == null ? void 0 : t.anisotropy) != null ? a : this.options.anisotropy;
|
|
3256
|
+
d.anisotropy = m;
|
|
3257
3257
|
}
|
|
3258
|
-
return
|
|
3259
|
-
} catch (
|
|
3258
|
+
return d;
|
|
3259
|
+
} catch (d) {
|
|
3260
3260
|
r.reject(`Failed to load ${e}`);
|
|
3261
3261
|
return;
|
|
3262
3262
|
}
|
|
@@ -3277,10 +3277,10 @@ class ri {
|
|
|
3277
3277
|
a.roughnessMap,
|
|
3278
3278
|
a.metalnessMap,
|
|
3279
3279
|
a.aoMap
|
|
3280
|
-
].forEach((
|
|
3281
|
-
if (
|
|
3282
|
-
const
|
|
3283
|
-
|
|
3280
|
+
].forEach((d) => {
|
|
3281
|
+
if (d) {
|
|
3282
|
+
const m = this.getSrcByAsset(d, s);
|
|
3283
|
+
m && t.add(m);
|
|
3284
3284
|
}
|
|
3285
3285
|
});
|
|
3286
3286
|
});
|
|
@@ -3295,10 +3295,10 @@ class ri {
|
|
|
3295
3295
|
this.assets.clear(), (e = this.dracoLoader) == null || e.dispose(), this.event.removeAllListeners(), this.delLoadArr.length = 0, this.loadObj.length = 0;
|
|
3296
3296
|
}
|
|
3297
3297
|
}
|
|
3298
|
-
const
|
|
3298
|
+
const ni = {
|
|
3299
3299
|
prefix: ""
|
|
3300
3300
|
};
|
|
3301
|
-
class
|
|
3301
|
+
class ai extends ee {
|
|
3302
3302
|
get loader() {
|
|
3303
3303
|
return this.controller;
|
|
3304
3304
|
}
|
|
@@ -3306,7 +3306,7 @@ class ni extends ee {
|
|
|
3306
3306
|
super(), this.options = e;
|
|
3307
3307
|
}
|
|
3308
3308
|
addLoader(e, t) {
|
|
3309
|
-
const { loaderParams: s } = this.options, i = new
|
|
3309
|
+
const { loaderParams: s } = this.options, i = new oi(te(U({}, s), {
|
|
3310
3310
|
scene: e
|
|
3311
3311
|
}));
|
|
3312
3312
|
return this.addController(i, t);
|
|
@@ -3317,7 +3317,7 @@ class ni extends ee {
|
|
|
3317
3317
|
});
|
|
3318
3318
|
}
|
|
3319
3319
|
}
|
|
3320
|
-
class
|
|
3320
|
+
class li {
|
|
3321
3321
|
constructor(e) {
|
|
3322
3322
|
this.materials = /* @__PURE__ */ new Map(), this.fixBaseObjects = /* @__PURE__ */ new Map(), this.materialBaseObjectMap = /* @__PURE__ */ new Map(), this.pencil = e;
|
|
3323
3323
|
}
|
|
@@ -3396,8 +3396,8 @@ class ai {
|
|
|
3396
3396
|
if (r.startsWith(i)) {
|
|
3397
3397
|
const n = r.substring(i.length), a = o.clone();
|
|
3398
3398
|
s[n] = a;
|
|
3399
|
-
const
|
|
3400
|
-
this.add(
|
|
3399
|
+
const d = `${t}#${n}`;
|
|
3400
|
+
this.add(d, a);
|
|
3401
3401
|
}
|
|
3402
3402
|
return s;
|
|
3403
3403
|
}
|
|
@@ -3422,15 +3422,15 @@ class ai {
|
|
|
3422
3422
|
if ("__isProxy" in o)
|
|
3423
3423
|
return o;
|
|
3424
3424
|
const n = new Proxy(o, {
|
|
3425
|
-
set: (a,
|
|
3426
|
-
if (typeof
|
|
3427
|
-
const
|
|
3428
|
-
if (
|
|
3429
|
-
const v = a[
|
|
3430
|
-
return this.rmBaseObjectMap(e, v), a[
|
|
3425
|
+
set: (a, d, m) => {
|
|
3426
|
+
if (typeof d == "string" && !Number.isNaN(Number(d))) {
|
|
3427
|
+
const p = Number(d);
|
|
3428
|
+
if (p >= 0 && p < a.length) {
|
|
3429
|
+
const v = a[p];
|
|
3430
|
+
return this.rmBaseObjectMap(e, v), a[p] = m, m && (this.applyColorSpaceToMaterials(m), this.addBaseObjectMap(e)), !0;
|
|
3431
3431
|
}
|
|
3432
3432
|
}
|
|
3433
|
-
return a[
|
|
3433
|
+
return a[d] = m, !0;
|
|
3434
3434
|
}
|
|
3435
3435
|
});
|
|
3436
3436
|
return Object.defineProperty(n, "__isProxy", {
|
|
@@ -3443,8 +3443,8 @@ class ai {
|
|
|
3443
3443
|
}), e.materialList = new Proxy(e.materialList, {
|
|
3444
3444
|
set: (o, n, a) => {
|
|
3445
3445
|
if (typeof n == "string") {
|
|
3446
|
-
const
|
|
3447
|
-
return this.rmBaseObjectMap(e,
|
|
3446
|
+
const d = o[n];
|
|
3447
|
+
return this.rmBaseObjectMap(e, d), o[n] = a, a && (this.applyColorSpaceToMaterials(a), this.addBaseObjectMap(e)), !0;
|
|
3448
3448
|
}
|
|
3449
3449
|
return o[n] = a, !0;
|
|
3450
3450
|
},
|
|
@@ -3452,8 +3452,8 @@ class ai {
|
|
|
3452
3452
|
if (typeof n == "string" && o[n]) {
|
|
3453
3453
|
const a = o[n];
|
|
3454
3454
|
if (Array.isArray(a)) {
|
|
3455
|
-
const
|
|
3456
|
-
return
|
|
3455
|
+
const d = s(a);
|
|
3456
|
+
return d !== a && (o[n] = d), d;
|
|
3457
3457
|
}
|
|
3458
3458
|
return a;
|
|
3459
3459
|
}
|
|
@@ -3496,7 +3496,7 @@ class ai {
|
|
|
3496
3496
|
});
|
|
3497
3497
|
}
|
|
3498
3498
|
applyColorSpaceToMaterials(e) {
|
|
3499
|
-
|
|
3499
|
+
Cs({ material: e });
|
|
3500
3500
|
}
|
|
3501
3501
|
material2array(e) {
|
|
3502
3502
|
return Array.isArray(e) ? e : [e];
|
|
@@ -3530,11 +3530,11 @@ class ai {
|
|
|
3530
3530
|
n !== -1 && (o[n] = t);
|
|
3531
3531
|
} else o === e && (r.material = t);
|
|
3532
3532
|
i.materialList && Object.keys(i.materialList).forEach((n) => {
|
|
3533
|
-
var
|
|
3534
|
-
const a = (
|
|
3533
|
+
var d;
|
|
3534
|
+
const a = (d = i.materialList) == null ? void 0 : d[n];
|
|
3535
3535
|
if (Array.isArray(a)) {
|
|
3536
|
-
const
|
|
3537
|
-
|
|
3536
|
+
const m = a.indexOf(e);
|
|
3537
|
+
m !== -1 && (a[m] = t);
|
|
3538
3538
|
} else a === e && i.materialList && (i.materialList[n] = t);
|
|
3539
3539
|
});
|
|
3540
3540
|
});
|
|
@@ -3544,7 +3544,7 @@ class ai {
|
|
|
3544
3544
|
e.track([...this.materials.values()]), e.dispose(), this.materials.clear(), this.fixBaseObjects.clear(), this.materialBaseObjectMap.clear();
|
|
3545
3545
|
}
|
|
3546
3546
|
}
|
|
3547
|
-
class
|
|
3547
|
+
class hi extends ee {
|
|
3548
3548
|
get mList() {
|
|
3549
3549
|
return this.controller;
|
|
3550
3550
|
}
|
|
@@ -3552,7 +3552,7 @@ class li extends ee {
|
|
|
3552
3552
|
super(), this.options = e;
|
|
3553
3553
|
}
|
|
3554
3554
|
addMList(e, t) {
|
|
3555
|
-
const { pencil: s } = this.options, i = new
|
|
3555
|
+
const { pencil: s } = this.options, i = new li(s);
|
|
3556
3556
|
return this.addController(i, t);
|
|
3557
3557
|
}
|
|
3558
3558
|
removePage(e) {
|
|
@@ -3561,19 +3561,19 @@ class li extends ee {
|
|
|
3561
3561
|
});
|
|
3562
3562
|
}
|
|
3563
3563
|
}
|
|
3564
|
-
const
|
|
3564
|
+
const ci = {
|
|
3565
3565
|
antialias: !1,
|
|
3566
3566
|
devicePixelRatio: window.devicePixelRatio,
|
|
3567
3567
|
powerPreference: "high-performance",
|
|
3568
3568
|
toneMappingExposure: 1,
|
|
3569
3569
|
alpha: !1,
|
|
3570
|
-
outputColorSpace:
|
|
3570
|
+
outputColorSpace: Os.sRGB,
|
|
3571
3571
|
logarithmicDepthBuffer: !1,
|
|
3572
3572
|
preserveDrawingBuffer: !1,
|
|
3573
3573
|
stencil: !1,
|
|
3574
3574
|
depth: !1
|
|
3575
3575
|
};
|
|
3576
|
-
class
|
|
3576
|
+
class di {
|
|
3577
3577
|
constructor(e) {
|
|
3578
3578
|
this.options = e;
|
|
3579
3579
|
const { width: t, height: s, rendererParams: i } = e, {
|
|
@@ -3581,22 +3581,22 @@ class ci {
|
|
|
3581
3581
|
devicePixelRatio: o,
|
|
3582
3582
|
antialias: n,
|
|
3583
3583
|
powerPreference: a,
|
|
3584
|
-
toneMappingExposure:
|
|
3585
|
-
outputColorSpace:
|
|
3586
|
-
logarithmicDepthBuffer:
|
|
3584
|
+
toneMappingExposure: d,
|
|
3585
|
+
outputColorSpace: m,
|
|
3586
|
+
logarithmicDepthBuffer: p,
|
|
3587
3587
|
preserveDrawingBuffer: v,
|
|
3588
|
-
stencil:
|
|
3588
|
+
stencil: f,
|
|
3589
3589
|
depth: u
|
|
3590
3590
|
} = i, g = new rs({
|
|
3591
3591
|
alpha: r,
|
|
3592
3592
|
antialias: n,
|
|
3593
3593
|
powerPreference: a,
|
|
3594
|
-
logarithmicDepthBuffer:
|
|
3594
|
+
logarithmicDepthBuffer: p,
|
|
3595
3595
|
preserveDrawingBuffer: v,
|
|
3596
|
-
stencil:
|
|
3596
|
+
stencil: f,
|
|
3597
3597
|
depth: u
|
|
3598
3598
|
});
|
|
3599
|
-
g.setSize(t, s), g.setPixelRatio(o), g.toneMappingExposure =
|
|
3599
|
+
g.setSize(t, s), g.setPixelRatio(o), g.toneMappingExposure = d, g.outputColorSpace = m, this.renderer = g;
|
|
3600
3600
|
}
|
|
3601
3601
|
setSize(e, t) {
|
|
3602
3602
|
this.renderer.setSize(e, t);
|
|
@@ -3608,8 +3608,8 @@ class ci {
|
|
|
3608
3608
|
this.renderer.render(e, t);
|
|
3609
3609
|
}
|
|
3610
3610
|
setViewport(e) {
|
|
3611
|
-
var a,
|
|
3612
|
-
const { x: t, y: s, width: i, height: r } = e, o = (a = e.scissor) != null ? a : !1, n = (
|
|
3611
|
+
var a, d;
|
|
3612
|
+
const { x: t, y: s, width: i, height: r } = e, o = (a = e.scissor) != null ? a : !1, n = (d = e.scissorTest) != null ? d : !1;
|
|
3613
3613
|
this.renderer.setViewport(t, s, i, r), o && (this.renderer.setScissor(t, s, i, r), this.renderer.setScissorTest(n));
|
|
3614
3614
|
}
|
|
3615
3615
|
dispose() {
|
|
@@ -3617,7 +3617,7 @@ class ci {
|
|
|
3617
3617
|
this.setSize(0, 0), (e = this.renderer) == null || e.clear(), (t = this.renderer) == null || t.dispose(), (s = this.renderer) == null || s.forceContextLoss();
|
|
3618
3618
|
}
|
|
3619
3619
|
}
|
|
3620
|
-
const
|
|
3620
|
+
const pi = {
|
|
3621
3621
|
background: null
|
|
3622
3622
|
};
|
|
3623
3623
|
class mi extends ee {
|
|
@@ -3628,7 +3628,7 @@ class mi extends ee {
|
|
|
3628
3628
|
super(), this.options = e;
|
|
3629
3629
|
}
|
|
3630
3630
|
addScene(e, t) {
|
|
3631
|
-
const s = new
|
|
3631
|
+
const s = new pt();
|
|
3632
3632
|
return e != null && e.background && (s.background = e.background), this.addController(s, t);
|
|
3633
3633
|
}
|
|
3634
3634
|
removePage(e) {
|
|
@@ -3643,10 +3643,10 @@ class mi extends ee {
|
|
|
3643
3643
|
});
|
|
3644
3644
|
}
|
|
3645
3645
|
}
|
|
3646
|
-
class
|
|
3646
|
+
class fi {
|
|
3647
3647
|
constructor(e) {
|
|
3648
3648
|
this.event = new ye.EventEmitter();
|
|
3649
|
-
const { renderer: t, scene: s, camera: i } = e, r = new
|
|
3649
|
+
const { renderer: t, scene: s, camera: i } = e, r = new Ts(
|
|
3650
3650
|
i,
|
|
3651
3651
|
t.domElement
|
|
3652
3652
|
);
|
|
@@ -3716,7 +3716,7 @@ const ui = {
|
|
|
3716
3716
|
antialias: !0,
|
|
3717
3717
|
devicePixelRatio: window.devicePixelRatio
|
|
3718
3718
|
};
|
|
3719
|
-
class
|
|
3719
|
+
class _i {
|
|
3720
3720
|
constructor(e) {
|
|
3721
3721
|
this.options = e;
|
|
3722
3722
|
const { width: t, height: s, rendererParams: i, renderer: r } = e, { devicePixelRatio: o, antialias: n } = i, a = new r({
|
|
@@ -3735,107 +3735,11 @@ class fi {
|
|
|
3735
3735
|
this.setSize(1, 1), (e = this.renderer) == null || e.clear(), (t = this.renderer) == null || t.dispose();
|
|
3736
3736
|
}
|
|
3737
3737
|
}
|
|
3738
|
-
class _i {
|
|
3739
|
-
/**
|
|
3740
|
-
* Constructs a new timer.
|
|
3741
|
-
*/
|
|
3742
|
-
constructor() {
|
|
3743
|
-
this._previousTime = 0, this._currentTime = 0, this._startTime = performance.now(), this._delta = 0, this._elapsed = 0, this._timescale = 1, this._document = null, this._pageVisibilityHandler = null;
|
|
3744
|
-
}
|
|
3745
|
-
/**
|
|
3746
|
-
* Connect the timer to the given document.Calling this method is not mandatory to
|
|
3747
|
-
* use the timer but enables the usage of the Page Visibility API to avoid large time
|
|
3748
|
-
* delta values.
|
|
3749
|
-
*
|
|
3750
|
-
* @param {Document} document - The document.
|
|
3751
|
-
*/
|
|
3752
|
-
connect(e) {
|
|
3753
|
-
this._document = e, e.hidden !== void 0 && (this._pageVisibilityHandler = gi.bind(this), e.addEventListener(
|
|
3754
|
-
"visibilitychange",
|
|
3755
|
-
this._pageVisibilityHandler,
|
|
3756
|
-
!1
|
|
3757
|
-
));
|
|
3758
|
-
}
|
|
3759
|
-
/**
|
|
3760
|
-
* Disconnects the timer from the DOM and also disables the usage of the Page Visibility API.
|
|
3761
|
-
*/
|
|
3762
|
-
disconnect() {
|
|
3763
|
-
this._pageVisibilityHandler !== null && (this._document.removeEventListener(
|
|
3764
|
-
"visibilitychange",
|
|
3765
|
-
this._pageVisibilityHandler
|
|
3766
|
-
), this._pageVisibilityHandler = null), this._document = null;
|
|
3767
|
-
}
|
|
3768
|
-
/**
|
|
3769
|
-
* Returns the time delta in seconds.
|
|
3770
|
-
*
|
|
3771
|
-
* @return {number} The time delta in second.
|
|
3772
|
-
*/
|
|
3773
|
-
getDelta() {
|
|
3774
|
-
return this._delta / 1e3;
|
|
3775
|
-
}
|
|
3776
|
-
/**
|
|
3777
|
-
* Returns the elapsed time in seconds.
|
|
3778
|
-
*
|
|
3779
|
-
* @return {number} The elapsed time in second.
|
|
3780
|
-
*/
|
|
3781
|
-
getElapsed() {
|
|
3782
|
-
return this._elapsed / 1e3;
|
|
3783
|
-
}
|
|
3784
|
-
/**
|
|
3785
|
-
* Returns the timescale.
|
|
3786
|
-
*
|
|
3787
|
-
* @return {number} The timescale.
|
|
3788
|
-
*/
|
|
3789
|
-
getTimescale() {
|
|
3790
|
-
return this._timescale;
|
|
3791
|
-
}
|
|
3792
|
-
/**
|
|
3793
|
-
* Sets the given timescale which scale the time delta computation
|
|
3794
|
-
* in `update()`.
|
|
3795
|
-
*
|
|
3796
|
-
* @param {number} timescale - The timescale to set.
|
|
3797
|
-
* @return {Timer} A reference to this timer.
|
|
3798
|
-
*/
|
|
3799
|
-
setTimescale(e) {
|
|
3800
|
-
return this._timescale = e, this;
|
|
3801
|
-
}
|
|
3802
|
-
/**
|
|
3803
|
-
* Resets the time computation for the current simulation step.
|
|
3804
|
-
*
|
|
3805
|
-
* @return {Timer} A reference to this timer.
|
|
3806
|
-
*/
|
|
3807
|
-
reset() {
|
|
3808
|
-
return this._currentTime = performance.now() - this._startTime, this;
|
|
3809
|
-
}
|
|
3810
|
-
/**
|
|
3811
|
-
* Can be used to free all internal resources. Usually called when
|
|
3812
|
-
* the timer instance isn't required anymore.
|
|
3813
|
-
*/
|
|
3814
|
-
dispose() {
|
|
3815
|
-
this.disconnect();
|
|
3816
|
-
}
|
|
3817
|
-
/**
|
|
3818
|
-
* Updates the internal state of the timer. This method should be called
|
|
3819
|
-
* once per simulation step and before you perform queries against the timer
|
|
3820
|
-
* (e.g. via `getDelta()`).
|
|
3821
|
-
*
|
|
3822
|
-
* @param {number} timestamp - The current time in milliseconds. Can be obtained
|
|
3823
|
-
* from the `requestAnimationFrame` callback argument. If not provided, the current
|
|
3824
|
-
* time will be determined with `performance.now`.
|
|
3825
|
-
* @return {Timer} A reference to this timer.
|
|
3826
|
-
*/
|
|
3827
|
-
update(e) {
|
|
3828
|
-
return this._pageVisibilityHandler !== null && this._document.hidden === !0 ? this._delta = 0 : (this._previousTime = this._currentTime, this._currentTime = (e !== void 0 ? e : performance.now()) - this._startTime, this._delta = (this._currentTime - this._previousTime) * this._timescale, this._elapsed += this._delta), this;
|
|
3829
|
-
}
|
|
3830
|
-
}
|
|
3831
|
-
function gi() {
|
|
3832
|
-
this._document.hidden === !1 && this.reset();
|
|
3833
|
-
}
|
|
3834
3738
|
const _e = class _e {
|
|
3835
3739
|
constructor(e) {
|
|
3836
3740
|
var r, o;
|
|
3837
|
-
this.raycaster = new dt(), this.maxBackufferArea = 5760 * 5760, this.installPlugins = /* @__PURE__ */ new Map(), this._cameraPositon = new
|
|
3838
|
-
isMergeableObject:
|
|
3741
|
+
this.raycaster = new dt(), this.maxBackufferArea = 5760 * 5760, this.installPlugins = /* @__PURE__ */ new Map(), this._cameraPositon = new j(), this._cameraTarget = new j(), this.event = new ye.EventEmitter(), this.timer = new as(), this.userData = {}, this.pageActiveIndex = 0, this.pageCountIndex = 0, this.userSetDprCache = 1, this.viewPadding = [0, 0, 0, 0], this._isDispose = !1, this.event.setMaxListeners(1 / 0), (o = (r = this.timer).connect) == null || o.call(r, document), this.options = Ut(_e.options, e, {
|
|
3742
|
+
isMergeableObject: Es
|
|
3839
3743
|
}), this.userSetDprCache = this.options.renderer.devicePixelRatio;
|
|
3840
3744
|
const {
|
|
3841
3745
|
container: t,
|
|
@@ -3920,50 +3824,50 @@ const _e = class _e {
|
|
|
3920
3824
|
renderer: r,
|
|
3921
3825
|
controls: o,
|
|
3922
3826
|
loader: n
|
|
3923
|
-
} = this.options, { width: a, height:
|
|
3827
|
+
} = this.options, { width: a, height: d } = this.getSize(), m = t ? new _i({
|
|
3924
3828
|
width: a,
|
|
3925
|
-
height:
|
|
3829
|
+
height: d,
|
|
3926
3830
|
//@ts-ignore
|
|
3927
3831
|
renderer: this.options.WebGPURenderer,
|
|
3928
3832
|
rendererParams: ui
|
|
3929
|
-
}) : new
|
|
3833
|
+
}) : new di({
|
|
3930
3834
|
width: a,
|
|
3931
|
-
height:
|
|
3835
|
+
height: d,
|
|
3932
3836
|
rendererParams: te(U({}, r), {
|
|
3933
3837
|
antialias: !1
|
|
3934
3838
|
})
|
|
3935
3839
|
});
|
|
3936
|
-
this.rendererController =
|
|
3937
|
-
const
|
|
3840
|
+
this.rendererController = m;
|
|
3841
|
+
const p = new Ds({
|
|
3938
3842
|
width: a,
|
|
3939
|
-
height:
|
|
3940
|
-
}), v = new mi({}),
|
|
3843
|
+
height: d
|
|
3844
|
+
}), v = new mi({}), f = new Ks({
|
|
3941
3845
|
controlsParams: {
|
|
3942
|
-
domElement: (_ = o == null ? void 0 : o.domElement) != null ? _ :
|
|
3846
|
+
domElement: (_ = o == null ? void 0 : o.domElement) != null ? _ : m.renderer.domElement
|
|
3943
3847
|
}
|
|
3944
|
-
}), u = new
|
|
3848
|
+
}), u = new ai({
|
|
3945
3849
|
loaderParams: U({
|
|
3946
3850
|
anisotropy: this.maxAnisotropy
|
|
3947
3851
|
}, n)
|
|
3948
|
-
}), g = new
|
|
3852
|
+
}), g = new hi({
|
|
3949
3853
|
pencil: this
|
|
3950
|
-
}), y = new
|
|
3854
|
+
}), y = new si({
|
|
3951
3855
|
pencil: this
|
|
3952
3856
|
});
|
|
3953
|
-
this.sceneController = v, this.cameraController =
|
|
3857
|
+
this.sceneController = v, this.cameraController = p, this.controlsController = f, this.loaderController = u, this.mListController = g, this.leadController = y;
|
|
3954
3858
|
const l = this.addPage({
|
|
3955
3859
|
sceneOptions: this.options.scene,
|
|
3956
3860
|
cameraOptions: this.options.camera
|
|
3957
3861
|
});
|
|
3958
3862
|
if (this.showPage(l), s) {
|
|
3959
|
-
const O = new
|
|
3863
|
+
const O = new Js({
|
|
3960
3864
|
container: e,
|
|
3961
3865
|
sceneController: v,
|
|
3962
|
-
cameraController:
|
|
3866
|
+
cameraController: p
|
|
3963
3867
|
});
|
|
3964
3868
|
O.add(v.scene), this.helperController = O, i && O.addViewHelper();
|
|
3965
3869
|
}
|
|
3966
|
-
e.appendChild(
|
|
3870
|
+
e.appendChild(m.renderer.domElement);
|
|
3967
3871
|
}
|
|
3968
3872
|
initComposer() {
|
|
3969
3873
|
const {
|
|
@@ -3972,7 +3876,7 @@ const _e = class _e {
|
|
|
3972
3876
|
ssao: s,
|
|
3973
3877
|
ssaoParams: i,
|
|
3974
3878
|
composer: r
|
|
3975
|
-
} = this.options, o = new
|
|
3879
|
+
} = this.options, o = new Ws({
|
|
3976
3880
|
rendererController: this.rendererController,
|
|
3977
3881
|
sceneController: this.sceneController,
|
|
3978
3882
|
cameraController: this.cameraController,
|
|
@@ -3989,12 +3893,12 @@ const _e = class _e {
|
|
|
3989
3893
|
css3DRendererParams: r
|
|
3990
3894
|
} = this.options;
|
|
3991
3895
|
if (t || s) {
|
|
3992
|
-
const o = new
|
|
3896
|
+
const o = new Qs(e);
|
|
3993
3897
|
t && o.addRenderer("css2d", i), s && o.addRenderer("css3d", r), this.cssRendererController = o;
|
|
3994
3898
|
}
|
|
3995
3899
|
}
|
|
3996
3900
|
initTransformControls() {
|
|
3997
|
-
const e = new
|
|
3901
|
+
const e = new fi({
|
|
3998
3902
|
camera: this.camera,
|
|
3999
3903
|
renderer: this.renderer,
|
|
4000
3904
|
scene: this.scene
|
|
@@ -4032,11 +3936,11 @@ const _e = class _e {
|
|
|
4032
3936
|
composerController: o,
|
|
4033
3937
|
cssRendererController: n,
|
|
4034
3938
|
leadController: a
|
|
4035
|
-
} = this,
|
|
4036
|
-
|
|
4037
|
-
var
|
|
4038
|
-
(
|
|
4039
|
-
}), this.viewPadding.some((
|
|
3939
|
+
} = this, d = this.renderer.getSize(new B());
|
|
3940
|
+
d.x === e && d.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((m) => {
|
|
3941
|
+
var p;
|
|
3942
|
+
(p = m.setSize) == null || p.call(m, e, t);
|
|
3943
|
+
}), this.viewPadding.some((m) => m !== 0) && this.setViewPadding(...this.viewPadding), this.render(), s && this.event.emit("resize", { width: e, height: t }));
|
|
4040
3944
|
}
|
|
4041
3945
|
setDevicePixelRatio(e) {
|
|
4042
3946
|
var n;
|
|
@@ -4067,15 +3971,15 @@ const _e = class _e {
|
|
|
4067
3971
|
const { raycaster: i, options: r } = this, { container: o } = r, n = new B(), a = o.getBoundingClientRect();
|
|
4068
3972
|
if (n.x = (e.clientX - a.left) / (a.right - a.left) * 2 - 1, n.y = -((e.clientY - a.top) / (a.bottom - a.top)) * 2 + 1, this.camera && this.scene) {
|
|
4069
3973
|
i.setFromCamera(n, this.camera);
|
|
4070
|
-
const
|
|
3974
|
+
const d = i.intersectObjects(
|
|
4071
3975
|
t || this.scene.children,
|
|
4072
3976
|
s
|
|
4073
3977
|
);
|
|
4074
|
-
if (
|
|
3978
|
+
if (d.length)
|
|
4075
3979
|
return {
|
|
4076
|
-
object:
|
|
4077
|
-
index:
|
|
4078
|
-
intersects:
|
|
3980
|
+
object: d[0].object,
|
|
3981
|
+
index: d[0].index,
|
|
3982
|
+
intersects: d
|
|
4079
3983
|
};
|
|
4080
3984
|
}
|
|
4081
3985
|
}
|
|
@@ -4085,9 +3989,9 @@ const _e = class _e {
|
|
|
4085
3989
|
return;
|
|
4086
3990
|
this.event.emit("beforeRender"), this.timer.update(), Ce.update();
|
|
4087
3991
|
const e = this.timer.getDelta(), t = this.timer.getElapsed();
|
|
4088
|
-
this.controlsController.update(e, t), this.leadController.update(e, t), this.installPlugins.forEach((
|
|
4089
|
-
var
|
|
4090
|
-
(
|
|
3992
|
+
this.controlsController.update(e, t), this.leadController.update(e, t), this.installPlugins.forEach((d) => {
|
|
3993
|
+
var m;
|
|
3994
|
+
(m = d.update) == null || m.call(d, e, t);
|
|
4091
3995
|
}), (s = this.helperController) == null || s.update(
|
|
4092
3996
|
e,
|
|
4093
3997
|
this.controlsController,
|
|
@@ -4132,11 +4036,11 @@ const _e = class _e {
|
|
|
4132
4036
|
}
|
|
4133
4037
|
}
|
|
4134
4038
|
dispose() {
|
|
4135
|
-
var e, t, s, i, r, o, n, a,
|
|
4039
|
+
var e, t, s, i, r, o, n, a, d, m, p, v, f, u;
|
|
4136
4040
|
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) => {
|
|
4137
4041
|
var y;
|
|
4138
4042
|
(y = g.dispose) == null || y.call(g);
|
|
4139
|
-
}), (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(), (
|
|
4043
|
+
}), (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(), (d = this.rendererController) == null || d.dispose(), (m = this.loaderController) == null || m.dispose(), (p = this.leadController) == null || p.dispose(), (v = this.mListController) == null || v.dispose(), this.cssRendererController = void 0, this.installPlugins.clear(), (f = this.stats) == null || f.dom.remove(), (u = this.renderer) == null || u.domElement.remove(), this._isDispose = !0;
|
|
4140
4044
|
}
|
|
4141
4045
|
};
|
|
4142
4046
|
_e.options = {
|
|
@@ -4145,26 +4049,26 @@ _e.options = {
|
|
|
4145
4049
|
viewHelper: he,
|
|
4146
4050
|
controls: !0,
|
|
4147
4051
|
transformControls: he,
|
|
4148
|
-
renderer:
|
|
4149
|
-
composer:
|
|
4150
|
-
scene:
|
|
4151
|
-
camera:
|
|
4052
|
+
renderer: ci,
|
|
4053
|
+
composer: Zs,
|
|
4054
|
+
scene: pi,
|
|
4055
|
+
camera: wt,
|
|
4152
4056
|
bloom: !1,
|
|
4153
|
-
bloomParams:
|
|
4057
|
+
bloomParams: Ys,
|
|
4154
4058
|
ssao: !1,
|
|
4155
|
-
loader:
|
|
4156
|
-
ssaoParams:
|
|
4059
|
+
loader: ni,
|
|
4060
|
+
ssaoParams: Vs,
|
|
4157
4061
|
css2DRenderer: !1,
|
|
4158
4062
|
css2DRendererParams: U({}, it),
|
|
4159
4063
|
css3DRenderer: !1,
|
|
4160
4064
|
css3DRendererParams: U({}, it)
|
|
4161
4065
|
};
|
|
4162
4066
|
let nt = _e;
|
|
4163
|
-
const
|
|
4067
|
+
const Xi = J.ACTION;
|
|
4164
4068
|
export {
|
|
4165
|
-
|
|
4069
|
+
ls as BaseObject,
|
|
4166
4070
|
nt as Pencil,
|
|
4167
4071
|
Pe as ResourceTracker,
|
|
4168
|
-
|
|
4072
|
+
Xi as cameraControlsAction,
|
|
4169
4073
|
nt as default
|
|
4170
4074
|
};
|