gl-draw 0.14.40 → 0.15.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/BaseObject.d.ts +3 -1
- package/dist/core/Lead/Lead.d.ts +3 -2
- package/dist/core/Lead/index.d.ts +2 -1
- package/dist/core/MList/MList.d.ts +25 -0
- package/dist/core/MList/index.d.ts +18 -0
- package/dist/core/Pencil.d.ts +3 -0
- package/dist/index.js +3 -3
- package/dist/index.module.js +953 -819
- package/dist/index.module2.js +52 -55
- package/dist/index2.js +3 -3
- package/dist/plugins/index.js +1 -1
- package/dist/plugins/index.module.js +1 -1
- package/package.json +1 -1
package/dist/index.module.js
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
1
|
+
var St = Object.defineProperty, At = Object.defineProperties;
|
|
2
|
+
var Mt = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var Me = Object.getOwnPropertySymbols;
|
|
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
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var t of
|
|
10
|
-
Dt.call(e, t) &&
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
var
|
|
14
|
-
var r = (
|
|
7
|
+
Rt.call(e, t) && Re(h, t, e[t]);
|
|
8
|
+
if (Me)
|
|
9
|
+
for (var t of Me(e))
|
|
10
|
+
Dt.call(e, t) && Re(h, t, e[t]);
|
|
11
|
+
return h;
|
|
12
|
+
}, te = (h, e) => At(h, Mt(e));
|
|
13
|
+
var se = (h, e, t) => new Promise((s, i) => {
|
|
14
|
+
var r = (l) => {
|
|
15
15
|
try {
|
|
16
|
-
|
|
16
|
+
n(t.next(l));
|
|
17
17
|
} catch (d) {
|
|
18
18
|
i(d);
|
|
19
19
|
}
|
|
20
|
-
}, o = (
|
|
20
|
+
}, o = (l) => {
|
|
21
21
|
try {
|
|
22
|
-
|
|
22
|
+
n(t.throw(l));
|
|
23
23
|
} catch (d) {
|
|
24
24
|
i(d);
|
|
25
25
|
}
|
|
26
|
-
},
|
|
27
|
-
|
|
26
|
+
}, n = (l) => l.done ? s(l.value) : Promise.resolve(l.value).then(r, o);
|
|
27
|
+
n((t = t.apply(h, e)).next());
|
|
28
28
|
});
|
|
29
|
-
import { WebGLRenderer as
|
|
30
|
-
import { Timer as
|
|
29
|
+
import { WebGLRenderer as Ut, Vector2 as B, Vector3 as j, PerspectiveCamera as zt, Matrix4 as W, Scene as nt, AxesHelper as De, CameraHelper as kt, PointLightHelper as Ft, DirectionalLightHelper as Nt, SpotLightHelper as Ht, HemisphereLightHelper as jt, Box3 as at, Box3Helper as Ue, MathUtils as It, Vector4 as Bt, Quaternion as lt, Spherical as Vt, Sphere as Yt, Raycaster as ht, REVISION as Zt, Object3D as Wt, UniformsUtils as Gt, RawShaderMaterial as Kt, ShaderMaterial as Xt, MeshBasicMaterial as $t, PointsMaterial as ct, SpriteMaterial as dt, Layers as qt, WebGLRenderTarget as Qt, HalfFloatType as Jt, Loader as pt, Texture as fe, VideoTexture as mt, FileLoader as Se, LoadingManager as es, DataTexture as ts, Mesh as ss, BufferGeometry as is } from "three";
|
|
30
|
+
import { Timer as rs } from "three/examples/jsm/misc/Timer";
|
|
31
31
|
import * as Ce from "@tweenjs/tween.js";
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import { C as
|
|
35
|
-
import { R as
|
|
36
|
-
import { RectAreaLightHelper as
|
|
37
|
-
import { ViewHelper as
|
|
38
|
-
import { TransformControls as
|
|
39
|
-
import { EffectComposer as
|
|
40
|
-
import { RenderPass as
|
|
41
|
-
import { SSAOPass as
|
|
42
|
-
import { FullScreenQuad as
|
|
43
|
-
import { OutputPass as
|
|
44
|
-
import { ShaderPass as
|
|
45
|
-
import { UnrealBloomPass as
|
|
32
|
+
import os from "deepmerge";
|
|
33
|
+
import ns from "stats-gl";
|
|
34
|
+
import { C as as, c as ls, i as hs } from "./isPlainObject.module.js";
|
|
35
|
+
import { R as Pe, M as ut, B as cs, G as ze } from "./index.module2.js";
|
|
36
|
+
import { RectAreaLightHelper as ds } from "three/examples/jsm/helpers/RectAreaLightHelper";
|
|
37
|
+
import { ViewHelper as ps } from "three/examples/jsm/helpers/ViewHelper";
|
|
38
|
+
import { TransformControls as ms } from "three/examples/jsm/controls/TransformControls";
|
|
39
|
+
import { EffectComposer as ke } from "three/examples/jsm/postprocessing/EffectComposer";
|
|
40
|
+
import { RenderPass as us } from "three/examples/jsm/postprocessing/RenderPass";
|
|
41
|
+
import { SSAOPass as fs } from "three/examples/jsm/postprocessing/SSAOPass";
|
|
42
|
+
import { FullScreenQuad as Fe } from "three/examples/jsm/postprocessing/Pass";
|
|
43
|
+
import { OutputPass as _s } from "three/examples/jsm/postprocessing/OutputPass";
|
|
44
|
+
import { ShaderPass as gs } from "three/examples/jsm/postprocessing/ShaderPass";
|
|
45
|
+
import { UnrealBloomPass as ys } from "three/examples/jsm/postprocessing/UnrealBloomPass";
|
|
46
46
|
import "three/examples/jsm/renderers/CSS2DRenderer";
|
|
47
47
|
import "three/examples/jsm/renderers/CSS3DRenderer";
|
|
48
48
|
import "d3-geo";
|
|
@@ -53,11 +53,11 @@ import "three/examples/jsm/lines/LineSegments2";
|
|
|
53
53
|
import "three/examples/jsm/lines/LineSegmentsGeometry";
|
|
54
54
|
import "three/examples/jsm/lines/LineMaterial";
|
|
55
55
|
import "three-bvh-csg";
|
|
56
|
-
import { GLTFLoader as
|
|
56
|
+
import { GLTFLoader as Ne } from "three/examples/jsm/loaders/GLTFLoader";
|
|
57
57
|
import { DRACOLoader as vs } from "three/examples/jsm/loaders/DRACOLoader";
|
|
58
|
-
import { EXRLoader as
|
|
59
|
-
import { LottieLoader as
|
|
60
|
-
import { makePromiseCreator as
|
|
58
|
+
import { EXRLoader as Cs } from "three/examples/jsm/loaders/EXRLoader";
|
|
59
|
+
import { LottieLoader as Es } from "three/examples/jsm/loaders/LottieLoader";
|
|
60
|
+
import { makePromiseCreator as Os, generateUUID as He } from "esus-lite";
|
|
61
61
|
const M = {
|
|
62
62
|
LEFT: 1,
|
|
63
63
|
RIGHT: 2,
|
|
@@ -89,66 +89,66 @@ const M = {
|
|
|
89
89
|
IN: 1,
|
|
90
90
|
OUT: -1
|
|
91
91
|
};
|
|
92
|
-
function Y(
|
|
93
|
-
return
|
|
92
|
+
function Y(h) {
|
|
93
|
+
return h.isPerspectiveCamera;
|
|
94
94
|
}
|
|
95
|
-
function
|
|
96
|
-
return
|
|
95
|
+
function I(h) {
|
|
96
|
+
return h.isOrthographicCamera;
|
|
97
97
|
}
|
|
98
|
-
const K = Math.PI * 2,
|
|
99
|
-
function k(
|
|
100
|
-
return Math.max(e, Math.min(t,
|
|
98
|
+
const K = Math.PI * 2, je = Math.PI / 2, ft = 1e-5, ie = Math.PI / 180;
|
|
99
|
+
function k(h, e, t) {
|
|
100
|
+
return Math.max(e, Math.min(t, h));
|
|
101
101
|
}
|
|
102
|
-
function A(
|
|
103
|
-
return Math.abs(
|
|
102
|
+
function A(h, e = ft) {
|
|
103
|
+
return Math.abs(h) < e;
|
|
104
104
|
}
|
|
105
|
-
function
|
|
106
|
-
return A(
|
|
105
|
+
function P(h, e, t = ft) {
|
|
106
|
+
return A(h - e, t);
|
|
107
107
|
}
|
|
108
|
-
function Ie(
|
|
109
|
-
return Math.round(
|
|
108
|
+
function Ie(h, e) {
|
|
109
|
+
return Math.round(h / e) * e;
|
|
110
110
|
}
|
|
111
|
-
function
|
|
112
|
-
return isFinite(
|
|
111
|
+
function re(h) {
|
|
112
|
+
return isFinite(h) ? h : h < 0 ? -Number.MAX_VALUE : Number.MAX_VALUE;
|
|
113
113
|
}
|
|
114
|
-
function
|
|
115
|
-
return Math.abs(
|
|
114
|
+
function oe(h) {
|
|
115
|
+
return Math.abs(h) < Number.MAX_VALUE ? h : h * (1 / 0);
|
|
116
116
|
}
|
|
117
|
-
function
|
|
117
|
+
function he(h, e, t, s, i = 1 / 0, r) {
|
|
118
118
|
s = Math.max(1e-4, s);
|
|
119
|
-
const o = 2 / s,
|
|
120
|
-
let d =
|
|
121
|
-
const
|
|
122
|
-
d = k(d, -p, p), e =
|
|
123
|
-
const
|
|
124
|
-
t.value = (t.value - o *
|
|
125
|
-
let
|
|
126
|
-
return
|
|
119
|
+
const o = 2 / s, n = o * r, l = 1 / (1 + n + 0.48 * n * n + 0.235 * n * n * n);
|
|
120
|
+
let d = h - e;
|
|
121
|
+
const _ = e, p = i * s;
|
|
122
|
+
d = k(d, -p, p), e = h - d;
|
|
123
|
+
const E = (t.value + o * d) * r;
|
|
124
|
+
t.value = (t.value - o * E) * l;
|
|
125
|
+
let y = e + (d + E) * l;
|
|
126
|
+
return _ - h > 0 == y > _ && (y = _, t.value = (y - _) / r), y;
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function Be(h, e, t, s, i = 1 / 0, r, o) {
|
|
129
129
|
s = Math.max(1e-4, s);
|
|
130
|
-
const
|
|
131
|
-
let
|
|
132
|
-
const
|
|
133
|
-
if (
|
|
134
|
-
const
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
const O = (t.x +
|
|
139
|
-
t.x = (t.x -
|
|
140
|
-
const
|
|
141
|
-
return
|
|
130
|
+
const n = 2 / s, l = n * r, d = 1 / (1 + l + 0.48 * l * l + 0.235 * l * l * l);
|
|
131
|
+
let _ = e.x, p = e.y, E = e.z, y = h.x - _, m = h.y - p, u = h.z - E;
|
|
132
|
+
const f = _, a = p, g = E, C = i * s, v = C * C, b = y * y + m * m + u * u;
|
|
133
|
+
if (b > v) {
|
|
134
|
+
const ve = Math.sqrt(b);
|
|
135
|
+
y = y / ve * C, m = m / ve * C, u = u / ve * C;
|
|
136
|
+
}
|
|
137
|
+
_ = h.x - y, p = h.y - m, E = h.z - u;
|
|
138
|
+
const O = (t.x + n * y) * r, x = (t.y + n * m) * r, R = (t.z + n * u) * r;
|
|
139
|
+
t.x = (t.x - n * O) * d, t.y = (t.y - n * x) * d, t.z = (t.z - n * R) * d, o.x = _ + (y + O) * d, o.y = p + (m + x) * d, o.z = E + (u + R) * d;
|
|
140
|
+
const V = f - h.x, le = a - h.y, wt = g - h.z, xt = o.x - f, Lt = o.y - a, Pt = o.z - g;
|
|
141
|
+
return V * xt + le * Lt + wt * Pt > 0 && (o.x = f, o.y = a, o.z = g, t.x = (o.x - f) / r, t.y = (o.y - a) / r, t.z = (o.z - g) / r), o;
|
|
142
142
|
}
|
|
143
|
-
function Ee(
|
|
144
|
-
e.set(0, 0),
|
|
143
|
+
function Ee(h, e) {
|
|
144
|
+
e.set(0, 0), h.forEach((t) => {
|
|
145
145
|
e.x += t.clientX, e.y += t.clientY;
|
|
146
|
-
}), e.x /=
|
|
146
|
+
}), e.x /= h.length, e.y /= h.length;
|
|
147
147
|
}
|
|
148
|
-
function Oe(
|
|
149
|
-
return
|
|
148
|
+
function Oe(h, e) {
|
|
149
|
+
return I(h) ? (console.warn(`${e} is not supported in OrthographicCamera`), !0) : !1;
|
|
150
150
|
}
|
|
151
|
-
class
|
|
151
|
+
class Ts {
|
|
152
152
|
constructor() {
|
|
153
153
|
this._listeners = {};
|
|
154
154
|
}
|
|
@@ -212,11 +212,11 @@ class Os {
|
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
|
-
const ce = 1 / 8,
|
|
216
|
-
let T, Ve, de, Te,
|
|
217
|
-
class J extends
|
|
215
|
+
const ce = 1 / 8, bs = /Mac/.test(navigator.platform);
|
|
216
|
+
let T, Ve, de, Te, D, w, L, X, ne, F, N, Z, Ye, Ze, z, ae, $, We, be, Ge, we, xe, pe;
|
|
217
|
+
class J extends Ts {
|
|
218
218
|
static install(e) {
|
|
219
|
-
T = e.THREE, Ve = Object.freeze(new T.Vector3(0, 0, 0)), de = Object.freeze(new T.Vector3(0, 1, 0)), Te = Object.freeze(new T.Vector3(0, 0, 1)),
|
|
219
|
+
T = e.THREE, Ve = Object.freeze(new T.Vector3(0, 0, 0)), de = Object.freeze(new T.Vector3(0, 1, 0)), Te = Object.freeze(new T.Vector3(0, 0, 1)), D = new T.Vector2(), w = new T.Vector3(), L = new T.Vector3(), X = 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(), $ = new T.Box3(), We = new T.Box3(), be = new T.Sphere(), Ge = new T.Quaternion(), we = new T.Quaternion(), xe = new T.Matrix4(), pe = new T.Raycaster();
|
|
220
220
|
}
|
|
221
221
|
/**
|
|
222
222
|
* list all ACTIONs
|
|
@@ -244,47 +244,47 @@ class J extends Os {
|
|
|
244
244
|
*/
|
|
245
245
|
constructor(e, t) {
|
|
246
246
|
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 = () => {
|
|
247
|
-
}, 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 = G.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 = (
|
|
248
|
-
let
|
|
247
|
+
}, 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 = G.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 = (a, g, C, v) => {
|
|
248
|
+
let b, O;
|
|
249
249
|
if (Y(this._camera)) {
|
|
250
|
-
const
|
|
251
|
-
|
|
252
|
-
} else if (
|
|
253
|
-
const
|
|
254
|
-
|
|
250
|
+
const x = w.copy(this._camera.position).sub(this._target), R = this._camera.getEffectiveFOV() * ie, V = x.length() * Math.tan(R * 0.5);
|
|
251
|
+
b = this.truckSpeed * a * V / this._elementRect.height, O = this.truckSpeed * g * V / this._elementRect.height;
|
|
252
|
+
} else if (I(this._camera)) {
|
|
253
|
+
const x = this._camera;
|
|
254
|
+
b = this.truckSpeed * a * (x.right - x.left) / x.zoom / this._elementRect.width, O = this.truckSpeed * g * (x.top - x.bottom) / x.zoom / this._elementRect.height;
|
|
255
255
|
} else
|
|
256
256
|
return;
|
|
257
|
-
|
|
258
|
-
this._focalOffsetEnd.x +
|
|
257
|
+
v ? (C ? this.setFocalOffset(
|
|
258
|
+
this._focalOffsetEnd.x + b,
|
|
259
259
|
this._focalOffsetEnd.y,
|
|
260
260
|
this._focalOffsetEnd.z,
|
|
261
261
|
!0
|
|
262
|
-
) : this.truck(
|
|
263
|
-
this._focalOffsetEnd.x +
|
|
262
|
+
) : this.truck(b, 0, !0), this.forward(-O, !0)) : C ? this.setFocalOffset(
|
|
263
|
+
this._focalOffsetEnd.x + b,
|
|
264
264
|
this._focalOffsetEnd.y + O,
|
|
265
265
|
this._focalOffsetEnd.z,
|
|
266
266
|
!0
|
|
267
|
-
) : this.truck(
|
|
268
|
-
}, this._rotateInternal = (
|
|
269
|
-
const
|
|
270
|
-
this.rotate(
|
|
271
|
-
}, this._dollyInternal = (
|
|
272
|
-
const
|
|
267
|
+
) : this.truck(b, O, !0);
|
|
268
|
+
}, this._rotateInternal = (a, g) => {
|
|
269
|
+
const C = K * this.azimuthRotateSpeed * a / this._elementRect.height, v = K * this.polarRotateSpeed * g / this._elementRect.height;
|
|
270
|
+
this.rotate(C, v, !0);
|
|
271
|
+
}, this._dollyInternal = (a, g, C) => {
|
|
272
|
+
const v = Math.pow(0.95, -a * this.dollySpeed), b = this._sphericalEnd.radius, O = this._sphericalEnd.radius * v, x = k(
|
|
273
273
|
O,
|
|
274
274
|
this.minDistance,
|
|
275
275
|
this.maxDistance
|
|
276
|
-
),
|
|
277
|
-
this.infinityDolly && this.dollyToCursor ? this._dollyToNoClamp(O, !0) : this.infinityDolly && !this.dollyToCursor ? (this.dollyInFixed(
|
|
278
|
-
}, this._zoomInternal = (
|
|
279
|
-
const
|
|
280
|
-
this.zoomTo(O, !0), this.dollyToCursor && (this._changedZoom += O -
|
|
276
|
+
), R = x - O;
|
|
277
|
+
this.infinityDolly && this.dollyToCursor ? this._dollyToNoClamp(O, !0) : this.infinityDolly && !this.dollyToCursor ? (this.dollyInFixed(R, !0), this._dollyToNoClamp(x, !0)) : this._dollyToNoClamp(x, !0), this.dollyToCursor && (this._changedDolly += (this.infinityDolly ? O : x) - b, this._dollyControlCoord.set(g, C)), this._lastDollyDirection = Math.sign(-a);
|
|
278
|
+
}, this._zoomInternal = (a, g, C) => {
|
|
279
|
+
const v = Math.pow(0.95, a * this.dollySpeed), b = this._zoom, O = this._zoom * v;
|
|
280
|
+
this.zoomTo(O, !0), this.dollyToCursor && (this._changedZoom += O - b, this._dollyControlCoord.set(g, C));
|
|
281
281
|
}, typeof T == "undefined" && console.error(
|
|
282
282
|
"camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."
|
|
283
283
|
), this._camera = e, this._yAxisUpSpace = new T.Quaternion().setFromUnitVectors(
|
|
284
284
|
this._camera.up,
|
|
285
285
|
de
|
|
286
286
|
), 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(
|
|
287
|
-
|
|
287
|
+
w.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)
|
|
288
288
|
), 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 = [
|
|
289
289
|
new T.Vector3(),
|
|
290
290
|
new T.Vector3(),
|
|
@@ -297,51 +297,51 @@ class J extends Os {
|
|
|
297
297
|
left: c.ROTATE,
|
|
298
298
|
middle: c.DOLLY,
|
|
299
299
|
right: c.TRUCK,
|
|
300
|
-
wheel: Y(this._camera) ? c.DOLLY :
|
|
300
|
+
wheel: Y(this._camera) ? c.DOLLY : I(this._camera) ? c.ZOOM : c.NONE
|
|
301
301
|
}, this.touches = {
|
|
302
302
|
one: c.TOUCH_ROTATE,
|
|
303
|
-
two: Y(this._camera) ? c.TOUCH_DOLLY_TRUCK :
|
|
303
|
+
two: Y(this._camera) ? c.TOUCH_DOLLY_TRUCK : I(this._camera) ? c.TOUCH_ZOOM_TRUCK : c.NONE,
|
|
304
304
|
three: c.TOUCH_TRUCK
|
|
305
305
|
};
|
|
306
|
-
const s = new T.Vector2(), i = new T.Vector2(), r = new T.Vector2(), o = (
|
|
306
|
+
const s = new T.Vector2(), i = new T.Vector2(), r = new T.Vector2(), o = (a) => {
|
|
307
307
|
if (!this._enabled || !this._domElement) return;
|
|
308
308
|
if (this._interactiveArea.left !== 0 || this._interactiveArea.top !== 0 || this._interactiveArea.width !== 1 || this._interactiveArea.height !== 1) {
|
|
309
|
-
const
|
|
310
|
-
if (
|
|
309
|
+
const v = this._domElement.getBoundingClientRect(), b = (a.clientX - v.left) / (v.right - v.left), O = (a.clientY - v.top) / (v.bottom - v.top);
|
|
310
|
+
if (b < this._interactiveArea.left || b > this._interactiveArea.right || O < this._interactiveArea.top || O > this._interactiveArea.bottom)
|
|
311
311
|
return;
|
|
312
312
|
}
|
|
313
|
-
const
|
|
314
|
-
if (
|
|
315
|
-
const
|
|
316
|
-
|
|
313
|
+
const g = a.pointerType !== "mouse" ? null : (a.buttons & M.LEFT) === M.LEFT ? M.LEFT : (a.buttons & M.MIDDLE) === M.MIDDLE ? M.MIDDLE : (a.buttons & M.RIGHT) === M.RIGHT ? M.RIGHT : null;
|
|
314
|
+
if (g !== null) {
|
|
315
|
+
const v = this._findPointerByMouseButton(g);
|
|
316
|
+
v && this._disposePointer(v);
|
|
317
317
|
}
|
|
318
|
-
if ((
|
|
318
|
+
if ((a.buttons & M.LEFT) === M.LEFT && this._lockedPointer)
|
|
319
319
|
return;
|
|
320
|
-
const
|
|
321
|
-
pointerId:
|
|
322
|
-
clientX:
|
|
323
|
-
clientY:
|
|
320
|
+
const C = {
|
|
321
|
+
pointerId: a.pointerId,
|
|
322
|
+
clientX: a.clientX,
|
|
323
|
+
clientY: a.clientY,
|
|
324
324
|
deltaX: 0,
|
|
325
325
|
deltaY: 0,
|
|
326
|
-
mouseButton:
|
|
326
|
+
mouseButton: g
|
|
327
327
|
};
|
|
328
|
-
this._activePointers.push(
|
|
328
|
+
this._activePointers.push(C), this._domElement.ownerDocument.removeEventListener(
|
|
329
329
|
"pointermove",
|
|
330
|
-
|
|
330
|
+
n,
|
|
331
331
|
{ passive: !1 }
|
|
332
332
|
), this._domElement.ownerDocument.removeEventListener(
|
|
333
333
|
"pointerup",
|
|
334
|
-
|
|
334
|
+
l
|
|
335
335
|
), this._domElement.ownerDocument.addEventListener(
|
|
336
336
|
"pointermove",
|
|
337
|
-
|
|
337
|
+
n,
|
|
338
338
|
{ passive: !1 }
|
|
339
|
-
), this._domElement.ownerDocument.addEventListener("pointerup",
|
|
340
|
-
},
|
|
341
|
-
|
|
342
|
-
const
|
|
343
|
-
if (
|
|
344
|
-
if (
|
|
339
|
+
), this._domElement.ownerDocument.addEventListener("pointerup", l), this._isDragging = !0, E(a);
|
|
340
|
+
}, n = (a) => {
|
|
341
|
+
a.cancelable && a.preventDefault();
|
|
342
|
+
const g = a.pointerId, C = this._lockedPointer || this._findPointerById(g);
|
|
343
|
+
if (C) {
|
|
344
|
+
if (C.clientX = a.clientX, C.clientY = a.clientY, C.deltaX = a.movementX, C.deltaY = a.movementY, this._state = 0, a.pointerType === "touch")
|
|
345
345
|
switch (this._activePointers.length) {
|
|
346
346
|
case 1:
|
|
347
347
|
this._state = this.touches.one;
|
|
@@ -354,13 +354,13 @@ class J extends Os {
|
|
|
354
354
|
break;
|
|
355
355
|
}
|
|
356
356
|
else
|
|
357
|
-
(!this._isDragging && this._lockedPointer || this._isDragging && (
|
|
358
|
-
|
|
357
|
+
(!this._isDragging && this._lockedPointer || this._isDragging && (a.buttons & M.LEFT) === M.LEFT) && (this._state = this._state | this.mouseButtons.left), this._isDragging && (a.buttons & M.MIDDLE) === M.MIDDLE && (this._state = this._state | this.mouseButtons.middle), this._isDragging && (a.buttons & M.RIGHT) === M.RIGHT && (this._state = this._state | this.mouseButtons.right);
|
|
358
|
+
y();
|
|
359
359
|
}
|
|
360
|
-
},
|
|
361
|
-
const
|
|
362
|
-
if (!(
|
|
363
|
-
if (
|
|
360
|
+
}, l = (a) => {
|
|
361
|
+
const g = this._findPointerById(a.pointerId);
|
|
362
|
+
if (!(g && g === this._lockedPointer)) {
|
|
363
|
+
if (g && this._disposePointer(g), a.pointerType === "touch")
|
|
364
364
|
switch (this._activePointers.length) {
|
|
365
365
|
case 0:
|
|
366
366
|
this._state = c.NONE;
|
|
@@ -381,72 +381,72 @@ class J extends Os {
|
|
|
381
381
|
}
|
|
382
382
|
};
|
|
383
383
|
let d = -1;
|
|
384
|
-
const
|
|
384
|
+
const _ = (a) => {
|
|
385
385
|
if (!this._domElement || !this._enabled || this.mouseButtons.wheel === c.NONE) return;
|
|
386
386
|
if (this._interactiveArea.left !== 0 || this._interactiveArea.top !== 0 || this._interactiveArea.width !== 1 || this._interactiveArea.height !== 1) {
|
|
387
|
-
const O = this._domElement.getBoundingClientRect(),
|
|
388
|
-
if (
|
|
387
|
+
const O = this._domElement.getBoundingClientRect(), x = (a.clientX - O.left) / (O.right - O.left), R = (a.clientY - O.top) / (O.bottom - O.top);
|
|
388
|
+
if (x < this._interactiveArea.left || x > this._interactiveArea.right || R < this._interactiveArea.top || R > this._interactiveArea.bottom)
|
|
389
389
|
return;
|
|
390
390
|
}
|
|
391
|
-
if (
|
|
391
|
+
if (a.preventDefault(), this.dollyToCursor || this.mouseButtons.wheel === c.ROTATE || this.mouseButtons.wheel === c.TRUCK) {
|
|
392
392
|
const O = performance.now();
|
|
393
393
|
d - O < 1e3 && this._getClientRect(this._elementRect), d = O;
|
|
394
394
|
}
|
|
395
|
-
const
|
|
395
|
+
const g = bs ? -1 : -3, C = a.deltaMode === 1 || a.ctrlKey ? a.deltaY / g : a.deltaY / (g * 10), v = this.dollyToCursor ? (a.clientX - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, b = this.dollyToCursor ? (a.clientY - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
|
|
396
396
|
switch (this.mouseButtons.wheel) {
|
|
397
397
|
case c.ROTATE: {
|
|
398
|
-
this._rotateInternal(
|
|
398
|
+
this._rotateInternal(a.deltaX, a.deltaY), this._isUserControllingRotate = !0;
|
|
399
399
|
break;
|
|
400
400
|
}
|
|
401
401
|
case c.TRUCK: {
|
|
402
|
-
this._truckInternal(
|
|
402
|
+
this._truckInternal(a.deltaX, a.deltaY, !1, !1), this._isUserControllingTruck = !0;
|
|
403
403
|
break;
|
|
404
404
|
}
|
|
405
405
|
case c.SCREEN_PAN: {
|
|
406
|
-
this._truckInternal(
|
|
406
|
+
this._truckInternal(a.deltaX, a.deltaY, !1, !0), this._isUserControllingTruck = !0;
|
|
407
407
|
break;
|
|
408
408
|
}
|
|
409
409
|
case c.OFFSET: {
|
|
410
|
-
this._truckInternal(
|
|
410
|
+
this._truckInternal(a.deltaX, a.deltaY, !0, !1), this._isUserControllingOffset = !0;
|
|
411
411
|
break;
|
|
412
412
|
}
|
|
413
413
|
case c.DOLLY: {
|
|
414
|
-
this._dollyInternal(-
|
|
414
|
+
this._dollyInternal(-C, v, b), this._isUserControllingDolly = !0;
|
|
415
415
|
break;
|
|
416
416
|
}
|
|
417
417
|
case c.ZOOM: {
|
|
418
|
-
this._zoomInternal(-
|
|
418
|
+
this._zoomInternal(-C, v, b), this._isUserControllingZoom = !0;
|
|
419
419
|
break;
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
422
|
this.dispatchEvent({ type: "control" });
|
|
423
|
-
}, p = (
|
|
423
|
+
}, p = (a) => {
|
|
424
424
|
if (!(!this._domElement || !this._enabled)) {
|
|
425
425
|
if (this.mouseButtons.right === J.ACTION.NONE) {
|
|
426
|
-
const
|
|
427
|
-
|
|
426
|
+
const g = a instanceof PointerEvent ? a.pointerId : 0, C = this._findPointerById(g);
|
|
427
|
+
C && this._disposePointer(C), this._domElement.ownerDocument.removeEventListener(
|
|
428
428
|
"pointermove",
|
|
429
|
-
|
|
429
|
+
n,
|
|
430
430
|
{ passive: !1 }
|
|
431
431
|
), this._domElement.ownerDocument.removeEventListener(
|
|
432
432
|
"pointerup",
|
|
433
|
-
|
|
433
|
+
l
|
|
434
434
|
);
|
|
435
435
|
return;
|
|
436
436
|
}
|
|
437
|
-
|
|
437
|
+
a.preventDefault();
|
|
438
438
|
}
|
|
439
|
-
},
|
|
439
|
+
}, E = (a) => {
|
|
440
440
|
if (!this._enabled) return;
|
|
441
|
-
if (Ee(this._activePointers,
|
|
442
|
-
const
|
|
443
|
-
r.set(0,
|
|
444
|
-
const O = (this._activePointers[0].clientX + this._activePointers[1].clientX) * 0.5,
|
|
445
|
-
i.set(O,
|
|
441
|
+
if (Ee(this._activePointers, D), this._getClientRect(this._elementRect), s.copy(D), i.copy(D), this._activePointers.length >= 2) {
|
|
442
|
+
const C = D.x - this._activePointers[1].clientX, v = D.y - this._activePointers[1].clientY, b = Math.sqrt(C * C + v * v);
|
|
443
|
+
r.set(0, b);
|
|
444
|
+
const O = (this._activePointers[0].clientX + this._activePointers[1].clientX) * 0.5, x = (this._activePointers[0].clientY + this._activePointers[1].clientY) * 0.5;
|
|
445
|
+
i.set(O, x);
|
|
446
446
|
}
|
|
447
|
-
if (this._state = 0, !
|
|
447
|
+
if (this._state = 0, !a)
|
|
448
448
|
this._lockedPointer && (this._state = this._state | this.mouseButtons.left);
|
|
449
|
-
else if ("pointerType" in
|
|
449
|
+
else if ("pointerType" in a && a.pointerType === "touch")
|
|
450
450
|
switch (this._activePointers.length) {
|
|
451
451
|
case 1:
|
|
452
452
|
this._state = this.touches.one;
|
|
@@ -459,39 +459,39 @@ class J extends Os {
|
|
|
459
459
|
break;
|
|
460
460
|
}
|
|
461
461
|
else
|
|
462
|
-
!this._lockedPointer && (
|
|
462
|
+
!this._lockedPointer && (a.buttons & M.LEFT) === M.LEFT && (this._state = this._state | this.mouseButtons.left), (a.buttons & M.MIDDLE) === M.MIDDLE && (this._state = this._state | this.mouseButtons.middle), (a.buttons & M.RIGHT) === M.RIGHT && (this._state = this._state | this.mouseButtons.right);
|
|
463
463
|
((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" });
|
|
464
|
-
},
|
|
464
|
+
}, y = () => {
|
|
465
465
|
if (!this._enabled || !this._dragNeedsUpdate) return;
|
|
466
|
-
this._dragNeedsUpdate = !1, Ee(this._activePointers,
|
|
467
|
-
const
|
|
468
|
-
if (i.copy(
|
|
469
|
-
const
|
|
466
|
+
this._dragNeedsUpdate = !1, Ee(this._activePointers, D);
|
|
467
|
+
const g = this._domElement && this._domElement.ownerDocument.pointerLockElement === this._domElement ? this._lockedPointer || this._activePointers[0] : null, C = g ? -g.deltaX : i.x - D.x, v = g ? -g.deltaY : i.y - D.y;
|
|
468
|
+
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(C, v), this._isUserControllingRotate = !0), (this._state & c.DOLLY) === c.DOLLY || (this._state & c.ZOOM) === c.ZOOM) {
|
|
469
|
+
const b = this.dollyToCursor ? (s.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, O = this.dollyToCursor ? (s.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0, x = this.dollyDragInverted ? -1 : 1;
|
|
470
470
|
(this._state & c.DOLLY) === c.DOLLY ? (this._dollyInternal(
|
|
471
|
-
|
|
472
|
-
|
|
471
|
+
x * v * ce,
|
|
472
|
+
b,
|
|
473
473
|
O
|
|
474
474
|
), this._isUserControllingDolly = !0) : (this._zoomInternal(
|
|
475
|
-
|
|
476
|
-
|
|
475
|
+
x * v * ce,
|
|
476
|
+
b,
|
|
477
477
|
O
|
|
478
478
|
), this._isUserControllingZoom = !0);
|
|
479
479
|
}
|
|
480
480
|
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) {
|
|
481
|
-
const
|
|
482
|
-
r.set(0,
|
|
483
|
-
const
|
|
484
|
-
(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(
|
|
481
|
+
const b = D.x - this._activePointers[1].clientX, O = D.y - this._activePointers[1].clientY, x = Math.sqrt(b * b + O * O), R = r.y - x;
|
|
482
|
+
r.set(0, x);
|
|
483
|
+
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;
|
|
484
|
+
(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 * ce, V, le), this._isUserControllingDolly = !0) : (this._zoomInternal(R * ce, V, le), this._isUserControllingZoom = !0);
|
|
485
485
|
}
|
|
486
|
-
((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(
|
|
486
|
+
((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(C, v, !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(C, v, !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(C, v, !0, !1), this._isUserControllingOffset = !0), this.dispatchEvent({ type: "control" });
|
|
487
487
|
}, m = () => {
|
|
488
|
-
Ee(this._activePointers,
|
|
488
|
+
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(
|
|
489
489
|
"pointermove",
|
|
490
|
-
|
|
490
|
+
n,
|
|
491
491
|
{ passive: !1 }
|
|
492
492
|
), this._domElement.ownerDocument.removeEventListener(
|
|
493
493
|
"pointerup",
|
|
494
|
-
|
|
494
|
+
l
|
|
495
495
|
), this.dispatchEvent({ type: "controlend" }));
|
|
496
496
|
};
|
|
497
497
|
this.lockPointer = () => {
|
|
@@ -504,57 +504,57 @@ class J extends Os {
|
|
|
504
504
|
mouseButton: null
|
|
505
505
|
}, this._activePointers.push(this._lockedPointer), this._domElement.ownerDocument.removeEventListener(
|
|
506
506
|
"pointermove",
|
|
507
|
-
|
|
507
|
+
n,
|
|
508
508
|
{ passive: !1 }
|
|
509
509
|
), this._domElement.ownerDocument.removeEventListener(
|
|
510
510
|
"pointerup",
|
|
511
|
-
|
|
511
|
+
l
|
|
512
512
|
), this._domElement.requestPointerLock(), this._domElement.ownerDocument.addEventListener(
|
|
513
513
|
"pointerlockchange",
|
|
514
514
|
u
|
|
515
515
|
), this._domElement.ownerDocument.addEventListener(
|
|
516
516
|
"pointerlockerror",
|
|
517
|
-
|
|
517
|
+
f
|
|
518
518
|
), this._domElement.ownerDocument.addEventListener(
|
|
519
519
|
"pointermove",
|
|
520
|
-
|
|
520
|
+
n,
|
|
521
521
|
{ passive: !1 }
|
|
522
|
-
), this._domElement.ownerDocument.addEventListener("pointerup",
|
|
522
|
+
), this._domElement.ownerDocument.addEventListener("pointerup", l), E());
|
|
523
523
|
}, this.unlockPointer = () => {
|
|
524
|
-
var
|
|
525
|
-
this._lockedPointer !== null && (this._disposePointer(this._lockedPointer), this._lockedPointer = null), (
|
|
524
|
+
var a, g, C;
|
|
525
|
+
this._lockedPointer !== null && (this._disposePointer(this._lockedPointer), this._lockedPointer = null), (a = this._domElement) === null || a === void 0 || a.ownerDocument.exitPointerLock(), (g = this._domElement) === null || g === void 0 || g.ownerDocument.removeEventListener(
|
|
526
526
|
"pointerlockchange",
|
|
527
527
|
u
|
|
528
|
-
), (
|
|
528
|
+
), (C = this._domElement) === null || C === void 0 || C.ownerDocument.removeEventListener(
|
|
529
529
|
"pointerlockerror",
|
|
530
|
-
|
|
530
|
+
f
|
|
531
531
|
), this.cancel();
|
|
532
532
|
};
|
|
533
533
|
const u = () => {
|
|
534
534
|
this._domElement && this._domElement.ownerDocument.pointerLockElement === this._domElement || this.unlockPointer();
|
|
535
|
-
},
|
|
535
|
+
}, f = () => {
|
|
536
536
|
this.unlockPointer();
|
|
537
537
|
};
|
|
538
|
-
this._addAllEventListeners = (
|
|
539
|
-
this._domElement =
|
|
538
|
+
this._addAllEventListeners = (a) => {
|
|
539
|
+
this._domElement = a, this._domElement.style.touchAction = "none", this._domElement.style.userSelect = "none", this._domElement.style.webkitUserSelect = "none", this._domElement.addEventListener("pointerdown", o), this._domElement.addEventListener("pointercancel", l), this._domElement.addEventListener("wheel", _, {
|
|
540
540
|
passive: !1
|
|
541
541
|
}), this._domElement.addEventListener("contextmenu", p);
|
|
542
542
|
}, this._removeAllEventListeners = () => {
|
|
543
|
-
this._domElement && (this._domElement.style.touchAction = "", this._domElement.style.userSelect = "", this._domElement.style.webkitUserSelect = "", this._domElement.removeEventListener("pointerdown", o), this._domElement.removeEventListener("pointercancel",
|
|
543
|
+
this._domElement && (this._domElement.style.touchAction = "", this._domElement.style.userSelect = "", this._domElement.style.webkitUserSelect = "", this._domElement.removeEventListener("pointerdown", o), this._domElement.removeEventListener("pointercancel", l), this._domElement.removeEventListener("wheel", _, {
|
|
544
544
|
passive: !1
|
|
545
545
|
}), this._domElement.removeEventListener("contextmenu", p), this._domElement.ownerDocument.removeEventListener(
|
|
546
546
|
"pointermove",
|
|
547
|
-
|
|
547
|
+
n,
|
|
548
548
|
{ passive: !1 }
|
|
549
549
|
), this._domElement.ownerDocument.removeEventListener(
|
|
550
550
|
"pointerup",
|
|
551
|
-
|
|
551
|
+
l
|
|
552
552
|
), this._domElement.ownerDocument.removeEventListener(
|
|
553
553
|
"pointerlockchange",
|
|
554
554
|
u
|
|
555
555
|
), this._domElement.ownerDocument.removeEventListener(
|
|
556
556
|
"pointerlockerror",
|
|
557
|
-
|
|
557
|
+
f
|
|
558
558
|
));
|
|
559
559
|
}, this.cancel = () => {
|
|
560
560
|
this._state !== c.NONE && (this._state = c.NONE, this._activePointers.length = 0, m());
|
|
@@ -795,11 +795,11 @@ class J extends Os {
|
|
|
795
795
|
this.maxAzimuthAngle
|
|
796
796
|
), r = k(t, this.minPolarAngle, this.maxPolarAngle);
|
|
797
797
|
this._sphericalEnd.theta = i, this._sphericalEnd.phi = r, this._sphericalEnd.makeSafe(), this._needsUpdate = !0, s || (this._spherical.theta = this._sphericalEnd.theta, this._spherical.phi = this._sphericalEnd.phi);
|
|
798
|
-
const o = !s ||
|
|
798
|
+
const o = !s || P(
|
|
799
799
|
this._spherical.theta,
|
|
800
800
|
this._sphericalEnd.theta,
|
|
801
801
|
this.restThreshold
|
|
802
|
-
) &&
|
|
802
|
+
) && P(
|
|
803
803
|
this._spherical.phi,
|
|
804
804
|
this._sphericalEnd.phi,
|
|
805
805
|
this.restThreshold
|
|
@@ -830,11 +830,11 @@ class J extends Os {
|
|
|
830
830
|
_dollyToNoClamp(e, t = !1) {
|
|
831
831
|
const s = this._sphericalEnd.radius;
|
|
832
832
|
if (this.colliderMeshes.length >= 1) {
|
|
833
|
-
const o = this._collisionTest(),
|
|
833
|
+
const o = this._collisionTest(), n = P(
|
|
834
834
|
o,
|
|
835
835
|
this._spherical.radius
|
|
836
836
|
);
|
|
837
|
-
if (!(s > e) &&
|
|
837
|
+
if (!(s > e) && n) return Promise.resolve();
|
|
838
838
|
this._sphericalEnd.radius = Math.min(
|
|
839
839
|
e,
|
|
840
840
|
o
|
|
@@ -842,7 +842,7 @@ class J extends Os {
|
|
|
842
842
|
} else
|
|
843
843
|
this._sphericalEnd.radius = e;
|
|
844
844
|
this._needsUpdate = !0, t || (this._spherical.radius = this._sphericalEnd.radius);
|
|
845
|
-
const r = !t ||
|
|
845
|
+
const r = !t || P(
|
|
846
846
|
this._spherical.radius,
|
|
847
847
|
this._sphericalEnd.radius,
|
|
848
848
|
this.restThreshold
|
|
@@ -858,9 +858,9 @@ class J extends Os {
|
|
|
858
858
|
*/
|
|
859
859
|
dollyInFixed(e, t = !1) {
|
|
860
860
|
this._targetEnd.add(
|
|
861
|
-
this._getCameraDirection(
|
|
861
|
+
this._getCameraDirection(ne).multiplyScalar(e)
|
|
862
862
|
), t || this._target.copy(this._targetEnd);
|
|
863
|
-
const s = !t ||
|
|
863
|
+
const s = !t || 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);
|
|
864
864
|
return this._createOnRestPromise(s);
|
|
865
865
|
}
|
|
866
866
|
/**
|
|
@@ -882,7 +882,7 @@ class J extends Os {
|
|
|
882
882
|
*/
|
|
883
883
|
zoomTo(e, t = !1) {
|
|
884
884
|
this._isUserControllingZoom = !1, this._zoomEnd = k(e, this.minZoom, this.maxZoom), this._needsUpdate = !0, t || (this._zoom = this._zoomEnd);
|
|
885
|
-
const s = !t ||
|
|
885
|
+
const s = !t || P(this._zoom, this._zoomEnd, this.restThreshold);
|
|
886
886
|
return this._changedZoom = 0, this._createOnRestPromise(s);
|
|
887
887
|
}
|
|
888
888
|
/**
|
|
@@ -901,7 +901,7 @@ class J extends Os {
|
|
|
901
901
|
*/
|
|
902
902
|
truck(e, t, s = !1) {
|
|
903
903
|
this._camera.updateMatrix(), F.setFromMatrixColumn(this._camera.matrix, 0), N.setFromMatrixColumn(this._camera.matrix, 1), F.multiplyScalar(e), N.multiplyScalar(-t);
|
|
904
|
-
const i =
|
|
904
|
+
const i = w.copy(F).add(N), r = L.copy(this._targetEnd).add(i);
|
|
905
905
|
return this.moveTo(r.x, r.y, r.z, s);
|
|
906
906
|
}
|
|
907
907
|
/**
|
|
@@ -911,8 +911,8 @@ class J extends Os {
|
|
|
911
911
|
* @category Methods
|
|
912
912
|
*/
|
|
913
913
|
forward(e, t = !1) {
|
|
914
|
-
|
|
915
|
-
const s =
|
|
914
|
+
w.setFromMatrixColumn(this._camera.matrix, 0), w.crossVectors(this._camera.up, w), w.multiplyScalar(e);
|
|
915
|
+
const s = L.copy(this._targetEnd).add(w);
|
|
916
916
|
return this.moveTo(s.x, s.y, s.z, t);
|
|
917
917
|
}
|
|
918
918
|
/**
|
|
@@ -922,10 +922,10 @@ class J extends Os {
|
|
|
922
922
|
* @category Methods
|
|
923
923
|
*/
|
|
924
924
|
elevate(e, t = !1) {
|
|
925
|
-
return
|
|
926
|
-
this._targetEnd.x +
|
|
927
|
-
this._targetEnd.y +
|
|
928
|
-
this._targetEnd.z +
|
|
925
|
+
return w.copy(this._camera.up).multiplyScalar(e), this.moveTo(
|
|
926
|
+
this._targetEnd.x + w.x,
|
|
927
|
+
this._targetEnd.y + w.y,
|
|
928
|
+
this._targetEnd.z + w.z,
|
|
929
929
|
t
|
|
930
930
|
);
|
|
931
931
|
}
|
|
@@ -939,9 +939,9 @@ class J extends Os {
|
|
|
939
939
|
*/
|
|
940
940
|
moveTo(e, t, s, i = !1) {
|
|
941
941
|
this._isUserControllingTruck = !1;
|
|
942
|
-
const r =
|
|
942
|
+
const r = w.set(e, t, s).sub(this._targetEnd);
|
|
943
943
|
this._encloseToBoundary(this._targetEnd, r, this.boundaryFriction), this._needsUpdate = !0, i || this._target.copy(this._targetEnd);
|
|
944
|
-
const o = !i ||
|
|
944
|
+
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);
|
|
945
945
|
return this._createOnRestPromise(o);
|
|
946
946
|
}
|
|
947
947
|
/**
|
|
@@ -954,11 +954,11 @@ class J extends Os {
|
|
|
954
954
|
* @category Methods
|
|
955
955
|
*/
|
|
956
956
|
lookInDirectionOf(e, t, s, i = !1) {
|
|
957
|
-
const
|
|
957
|
+
const n = w.set(e, t, s).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius).add(this._targetEnd);
|
|
958
958
|
return this.setPosition(
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
959
|
+
n.x,
|
|
960
|
+
n.y,
|
|
961
|
+
n.z,
|
|
962
962
|
i
|
|
963
963
|
);
|
|
964
964
|
}
|
|
@@ -980,36 +980,36 @@ class J extends Os {
|
|
|
980
980
|
paddingLeft: i = 0,
|
|
981
981
|
paddingRight: r = 0,
|
|
982
982
|
paddingBottom: o = 0,
|
|
983
|
-
paddingTop:
|
|
983
|
+
paddingTop: n = 0
|
|
984
984
|
} = {}) {
|
|
985
|
-
const
|
|
985
|
+
const l = [], d = e.isBox3 ? $.copy(e) : $.setFromObject(e);
|
|
986
986
|
d.isEmpty() && (console.warn(
|
|
987
987
|
"camera-controls: fitTo() cannot be used with an empty box. Aborting"
|
|
988
988
|
), Promise.resolve());
|
|
989
|
-
const
|
|
990
|
-
|
|
991
|
-
const
|
|
992
|
-
m &&
|
|
993
|
-
const u =
|
|
994
|
-
|
|
995
|
-
const
|
|
989
|
+
const _ = Ie(this._sphericalEnd.theta, je), p = Ie(this._sphericalEnd.phi, je);
|
|
990
|
+
l.push(this.rotateTo(_, p, t));
|
|
991
|
+
const E = w.setFromSpherical(this._sphericalEnd).normalize(), y = Ge.setFromUnitVectors(E, Te), m = P(Math.abs(E.y), 1);
|
|
992
|
+
m && y.multiply(we.setFromAxisAngle(de, _)), y.multiply(this._yAxisUpSpaceInverse);
|
|
993
|
+
const u = We.makeEmpty();
|
|
994
|
+
L.copy(d.min).applyQuaternion(y), u.expandByPoint(L), L.copy(d.min).setX(d.max.x).applyQuaternion(y), u.expandByPoint(L), L.copy(d.min).setY(d.max.y).applyQuaternion(y), u.expandByPoint(L), L.copy(d.max).setZ(d.min.z).applyQuaternion(y), u.expandByPoint(L), L.copy(d.min).setZ(d.max.z).applyQuaternion(y), u.expandByPoint(L), L.copy(d.max).setY(d.min.y).applyQuaternion(y), u.expandByPoint(L), L.copy(d.max).setX(d.min.x).applyQuaternion(y), u.expandByPoint(L), L.copy(d.max).applyQuaternion(y), u.expandByPoint(L), u.min.x -= i, u.min.y -= o, u.max.x += r, u.max.y += n, y.setFromUnitVectors(Te, E), m && y.premultiply(we.invert()), y.premultiply(this._yAxisUpSpace);
|
|
995
|
+
const f = u.getSize(w), a = u.getCenter(L).applyQuaternion(y);
|
|
996
996
|
if (Y(this._camera)) {
|
|
997
|
-
const
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
997
|
+
const g = this.getDistanceToFitBox(
|
|
998
|
+
f.x,
|
|
999
|
+
f.y,
|
|
1000
|
+
f.z,
|
|
1001
1001
|
s
|
|
1002
1002
|
);
|
|
1003
|
-
|
|
1004
|
-
this.moveTo(
|
|
1005
|
-
),
|
|
1006
|
-
} else if (
|
|
1007
|
-
const
|
|
1008
|
-
|
|
1009
|
-
this.moveTo(
|
|
1010
|
-
),
|
|
1003
|
+
l.push(
|
|
1004
|
+
this.moveTo(a.x, a.y, a.z, t)
|
|
1005
|
+
), l.push(this.dollyTo(g, t)), l.push(this.setFocalOffset(0, 0, 0, t));
|
|
1006
|
+
} else if (I(this._camera)) {
|
|
1007
|
+
const g = this._camera, C = g.right - g.left, v = g.top - g.bottom, b = s ? Math.max(C / f.x, v / f.y) : Math.min(C / f.x, v / f.y);
|
|
1008
|
+
l.push(
|
|
1009
|
+
this.moveTo(a.x, a.y, a.z, t)
|
|
1010
|
+
), l.push(this.zoomTo(b, t)), l.push(this.setFocalOffset(0, 0, 0, t));
|
|
1011
1011
|
}
|
|
1012
|
-
return Promise.all(
|
|
1012
|
+
return Promise.all(l);
|
|
1013
1013
|
}
|
|
1014
1014
|
/**
|
|
1015
1015
|
* Fit the viewport to the sphere or the bounding sphere of the object.
|
|
@@ -1018,7 +1018,7 @@ class J extends Os {
|
|
|
1018
1018
|
* @category Methods
|
|
1019
1019
|
*/
|
|
1020
1020
|
fitToSphere(e, t) {
|
|
1021
|
-
const s = [], r = "isObject3D" in e ? J.createBoundingSphere(e,
|
|
1021
|
+
const s = [], r = "isObject3D" in e ? J.createBoundingSphere(e, be) : be.copy(e);
|
|
1022
1022
|
if (s.push(
|
|
1023
1023
|
this.moveTo(
|
|
1024
1024
|
r.center.x,
|
|
@@ -1029,8 +1029,8 @@ class J extends Os {
|
|
|
1029
1029
|
), Y(this._camera)) {
|
|
1030
1030
|
const o = this.getDistanceToFitSphere(r.radius);
|
|
1031
1031
|
s.push(this.dollyTo(o, t));
|
|
1032
|
-
} else if (
|
|
1033
|
-
const o = this._camera.right - this._camera.left,
|
|
1032
|
+
} else if (I(this._camera)) {
|
|
1033
|
+
const o = this._camera.right - this._camera.left, n = this._camera.top - this._camera.bottom, l = 2 * r.radius, d = Math.min(o / l, n / l);
|
|
1034
1034
|
s.push(this.zoomTo(d, t));
|
|
1035
1035
|
}
|
|
1036
1036
|
return s.push(this.setFocalOffset(0, 0, 0, t)), Promise.all(s);
|
|
@@ -1046,26 +1046,26 @@ class J extends Os {
|
|
|
1046
1046
|
* @param enableTransition
|
|
1047
1047
|
* @category Methods
|
|
1048
1048
|
*/
|
|
1049
|
-
setLookAt(e, t, s, i, r, o,
|
|
1049
|
+
setLookAt(e, t, s, i, r, o, n = !1) {
|
|
1050
1050
|
this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._lastDollyDirection = G.NONE, this._changedDolly = 0;
|
|
1051
|
-
const
|
|
1052
|
-
this._targetEnd.copy(
|
|
1053
|
-
d.sub(
|
|
1054
|
-
), this.normalizeRotations(), this._needsUpdate = !0,
|
|
1055
|
-
const
|
|
1051
|
+
const l = L.set(i, r, o), d = w.set(e, t, s);
|
|
1052
|
+
this._targetEnd.copy(l), this._sphericalEnd.setFromVector3(
|
|
1053
|
+
d.sub(l).applyQuaternion(this._yAxisUpSpace)
|
|
1054
|
+
), this.normalizeRotations(), this._needsUpdate = !0, n || (this._target.copy(this._targetEnd), this._spherical.copy(this._sphericalEnd));
|
|
1055
|
+
const _ = !n || P(this._target.x, this._targetEnd.x, this.restThreshold) && P(this._target.y, this._targetEnd.y, this.restThreshold) && P(this._target.z, this._targetEnd.z, this.restThreshold) && P(
|
|
1056
1056
|
this._spherical.theta,
|
|
1057
1057
|
this._sphericalEnd.theta,
|
|
1058
1058
|
this.restThreshold
|
|
1059
|
-
) &&
|
|
1059
|
+
) && P(
|
|
1060
1060
|
this._spherical.phi,
|
|
1061
1061
|
this._sphericalEnd.phi,
|
|
1062
1062
|
this.restThreshold
|
|
1063
|
-
) &&
|
|
1063
|
+
) && P(
|
|
1064
1064
|
this._spherical.radius,
|
|
1065
1065
|
this._sphericalEnd.radius,
|
|
1066
1066
|
this.restThreshold
|
|
1067
1067
|
);
|
|
1068
|
-
return this._createOnRestPromise(
|
|
1068
|
+
return this._createOnRestPromise(_);
|
|
1069
1069
|
}
|
|
1070
1070
|
/**
|
|
1071
1071
|
* Similar to setLookAt, but it interpolates between two states.
|
|
@@ -1085,31 +1085,31 @@ class J extends Os {
|
|
|
1085
1085
|
* @param enableTransition
|
|
1086
1086
|
* @category Methods
|
|
1087
1087
|
*/
|
|
1088
|
-
lerpLookAt(e, t, s, i, r, o,
|
|
1088
|
+
lerpLookAt(e, t, s, i, r, o, n, l, d, _, p, E, y, m = !1) {
|
|
1089
1089
|
this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._lastDollyDirection = G.NONE, this._changedDolly = 0;
|
|
1090
|
-
const u =
|
|
1090
|
+
const u = w.set(i, r, o), f = L.set(e, t, s);
|
|
1091
1091
|
z.setFromVector3(
|
|
1092
|
-
|
|
1092
|
+
f.sub(u).applyQuaternion(this._yAxisUpSpace)
|
|
1093
1093
|
);
|
|
1094
|
-
const
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
), this._targetEnd.copy(u.lerp(
|
|
1098
|
-
const
|
|
1094
|
+
const a = X.set(_, p, E), g = L.set(n, l, d);
|
|
1095
|
+
ae.setFromVector3(
|
|
1096
|
+
g.sub(a).applyQuaternion(this._yAxisUpSpace)
|
|
1097
|
+
), this._targetEnd.copy(u.lerp(a, y));
|
|
1098
|
+
const C = ae.theta - z.theta, v = ae.phi - z.phi, b = ae.radius - z.radius;
|
|
1099
1099
|
this._sphericalEnd.set(
|
|
1100
|
-
z.radius +
|
|
1101
|
-
z.phi +
|
|
1102
|
-
z.theta +
|
|
1100
|
+
z.radius + b * y,
|
|
1101
|
+
z.phi + v * y,
|
|
1102
|
+
z.theta + C * y
|
|
1103
1103
|
), this.normalizeRotations(), this._needsUpdate = !0, m || (this._target.copy(this._targetEnd), this._spherical.copy(this._sphericalEnd));
|
|
1104
|
-
const O = !m ||
|
|
1104
|
+
const O = !m || P(this._target.x, this._targetEnd.x, this.restThreshold) && P(this._target.y, this._targetEnd.y, this.restThreshold) && P(this._target.z, this._targetEnd.z, this.restThreshold) && P(
|
|
1105
1105
|
this._spherical.theta,
|
|
1106
1106
|
this._sphericalEnd.theta,
|
|
1107
1107
|
this.restThreshold
|
|
1108
|
-
) &&
|
|
1108
|
+
) && P(
|
|
1109
1109
|
this._spherical.phi,
|
|
1110
1110
|
this._sphericalEnd.phi,
|
|
1111
1111
|
this.restThreshold
|
|
1112
|
-
) &&
|
|
1112
|
+
) && P(
|
|
1113
1113
|
this._spherical.radius,
|
|
1114
1114
|
this._sphericalEnd.radius,
|
|
1115
1115
|
this.restThreshold
|
|
@@ -1146,7 +1146,7 @@ class J extends Os {
|
|
|
1146
1146
|
* @category Methods
|
|
1147
1147
|
*/
|
|
1148
1148
|
setTarget(e, t, s, i = !1) {
|
|
1149
|
-
const r = this.getPosition(
|
|
1149
|
+
const r = this.getPosition(w), o = this.setLookAt(
|
|
1150
1150
|
r.x,
|
|
1151
1151
|
r.y,
|
|
1152
1152
|
r.z,
|
|
@@ -1171,15 +1171,15 @@ class J extends Os {
|
|
|
1171
1171
|
*/
|
|
1172
1172
|
setFocalOffset(e, t, s, i = !1) {
|
|
1173
1173
|
this._isUserControllingOffset = !1, this._focalOffsetEnd.set(e, t, s), this._needsUpdate = !0, i || this._focalOffset.copy(this._focalOffsetEnd);
|
|
1174
|
-
const r = !i ||
|
|
1174
|
+
const r = !i || P(
|
|
1175
1175
|
this._focalOffset.x,
|
|
1176
1176
|
this._focalOffsetEnd.x,
|
|
1177
1177
|
this.restThreshold
|
|
1178
|
-
) &&
|
|
1178
|
+
) && P(
|
|
1179
1179
|
this._focalOffset.y,
|
|
1180
1180
|
this._focalOffsetEnd.y,
|
|
1181
1181
|
this.restThreshold
|
|
1182
|
-
) &&
|
|
1182
|
+
) && P(
|
|
1183
1183
|
this._focalOffset.z,
|
|
1184
1184
|
this._focalOffsetEnd.z,
|
|
1185
1185
|
this.restThreshold
|
|
@@ -1196,8 +1196,8 @@ class J extends Os {
|
|
|
1196
1196
|
*/
|
|
1197
1197
|
setOrbitPoint(e, t, s) {
|
|
1198
1198
|
this._camera.updateMatrixWorld(), F.setFromMatrixColumn(this._camera.matrixWorldInverse, 0), N.setFromMatrixColumn(this._camera.matrixWorldInverse, 1), Z.setFromMatrixColumn(this._camera.matrixWorldInverse, 2);
|
|
1199
|
-
const i =
|
|
1200
|
-
F.multiplyScalar(o.x), N.multiplyScalar(o.y), Z.multiplyScalar(o.z),
|
|
1199
|
+
const i = w.set(e, t, s), r = i.distanceTo(this._camera.position), o = i.sub(this._camera.position);
|
|
1200
|
+
F.multiplyScalar(o.x), N.multiplyScalar(o.y), Z.multiplyScalar(o.z), w.copy(F).add(N).add(Z), w.z = w.z + r, this.dollyTo(r, !1), this.setFocalOffset(-w.x, w.y, -w.z, !1), this.moveTo(e, t, s, !1);
|
|
1201
1201
|
}
|
|
1202
1202
|
/**
|
|
1203
1203
|
* Set the boundary box that encloses the target of the camera. box3 is in THREE.Box3
|
|
@@ -1238,8 +1238,8 @@ class J extends Os {
|
|
|
1238
1238
|
getDistanceToFitBox(e, t, s, i = !1) {
|
|
1239
1239
|
if (Oe(this._camera, "getDistanceToFitBox"))
|
|
1240
1240
|
return this._spherical.radius;
|
|
1241
|
-
const r = e / t, o = this._camera.getEffectiveFOV() *
|
|
1242
|
-
return ((i ? r >
|
|
1241
|
+
const r = e / t, o = this._camera.getEffectiveFOV() * ie, n = this._camera.aspect;
|
|
1242
|
+
return ((i ? r > n : r < n) ? t : e / n) * 0.5 / Math.tan(o * 0.5) + s * 0.5;
|
|
1243
1243
|
}
|
|
1244
1244
|
/**
|
|
1245
1245
|
* Calculate the distance to fit the sphere.
|
|
@@ -1250,7 +1250,7 @@ class J extends Os {
|
|
|
1250
1250
|
getDistanceToFitSphere(e) {
|
|
1251
1251
|
if (Oe(this._camera, "getDistanceToFitSphere"))
|
|
1252
1252
|
return this._spherical.radius;
|
|
1253
|
-
const t = this._camera.getEffectiveFOV() *
|
|
1253
|
+
const t = this._camera.getEffectiveFOV() * ie, s = Math.atan(Math.tan(t * 0.5) * this._camera.aspect) * 2, i = 1 < this._camera.aspect ? t : s;
|
|
1254
1254
|
return e / Math.sin(i * 0.5);
|
|
1255
1255
|
}
|
|
1256
1256
|
/**
|
|
@@ -1310,9 +1310,9 @@ class J extends Os {
|
|
|
1310
1310
|
* @category Methods
|
|
1311
1311
|
*/
|
|
1312
1312
|
reset(e = !1) {
|
|
1313
|
-
if (!
|
|
1313
|
+
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)) {
|
|
1314
1314
|
this._camera.up.copy(this._cameraUp0);
|
|
1315
|
-
const s = this.getPosition(
|
|
1315
|
+
const s = this.getPosition(w);
|
|
1316
1316
|
this.updateCameraUp(), this.setPosition(s.x, s.y, s.z);
|
|
1317
1317
|
}
|
|
1318
1318
|
const t = [
|
|
@@ -1356,9 +1356,9 @@ class J extends Os {
|
|
|
1356
1356
|
* @category Methods
|
|
1357
1357
|
*/
|
|
1358
1358
|
applyCameraUp() {
|
|
1359
|
-
const e =
|
|
1359
|
+
const e = w.subVectors(this._target, this._camera.position).normalize(), t = L.crossVectors(e, this._camera.up);
|
|
1360
1360
|
this._camera.up.crossVectors(t, e).normalize(), this._camera.updateMatrixWorld();
|
|
1361
|
-
const s = this.getPosition(
|
|
1361
|
+
const s = this.getPosition(w);
|
|
1362
1362
|
this.updateCameraUp(), this.setPosition(s.x, s.y, s.z);
|
|
1363
1363
|
}
|
|
1364
1364
|
/**
|
|
@@ -1369,15 +1369,15 @@ class J extends Os {
|
|
|
1369
1369
|
* @category Methods
|
|
1370
1370
|
*/
|
|
1371
1371
|
update(e) {
|
|
1372
|
-
const t = this._sphericalEnd.theta - this._spherical.theta, s = this._sphericalEnd.phi - this._spherical.phi, i = this._sphericalEnd.radius - this._spherical.radius, r =
|
|
1372
|
+
const t = this._sphericalEnd.theta - this._spherical.theta, s = this._sphericalEnd.phi - this._spherical.phi, i = this._sphericalEnd.radius - this._spherical.radius, r = Ye.subVectors(this._targetEnd, this._target), o = Ze.subVectors(
|
|
1373
1373
|
this._focalOffsetEnd,
|
|
1374
1374
|
this._focalOffset
|
|
1375
|
-
),
|
|
1375
|
+
), n = this._zoomEnd - this._zoom;
|
|
1376
1376
|
if (A(t))
|
|
1377
1377
|
this._thetaVelocity.value = 0, this._spherical.theta = this._sphericalEnd.theta;
|
|
1378
1378
|
else {
|
|
1379
1379
|
const p = this._isUserControllingRotate ? this.draggingSmoothTime : this.smoothTime;
|
|
1380
|
-
this._spherical.theta =
|
|
1380
|
+
this._spherical.theta = he(
|
|
1381
1381
|
this._spherical.theta,
|
|
1382
1382
|
this._sphericalEnd.theta,
|
|
1383
1383
|
this._thetaVelocity,
|
|
@@ -1390,7 +1390,7 @@ class J extends Os {
|
|
|
1390
1390
|
this._phiVelocity.value = 0, this._spherical.phi = this._sphericalEnd.phi;
|
|
1391
1391
|
else {
|
|
1392
1392
|
const p = this._isUserControllingRotate ? this.draggingSmoothTime : this.smoothTime;
|
|
1393
|
-
this._spherical.phi =
|
|
1393
|
+
this._spherical.phi = he(
|
|
1394
1394
|
this._spherical.phi,
|
|
1395
1395
|
this._sphericalEnd.phi,
|
|
1396
1396
|
this._phiVelocity,
|
|
@@ -1403,7 +1403,7 @@ class J extends Os {
|
|
|
1403
1403
|
this._radiusVelocity.value = 0, this._spherical.radius = this._sphericalEnd.radius;
|
|
1404
1404
|
else {
|
|
1405
1405
|
const p = this._isUserControllingDolly ? this.draggingSmoothTime : this.smoothTime;
|
|
1406
|
-
this._spherical.radius =
|
|
1406
|
+
this._spherical.radius = he(
|
|
1407
1407
|
this._spherical.radius,
|
|
1408
1408
|
this._sphericalEnd.radius,
|
|
1409
1409
|
this._radiusVelocity,
|
|
@@ -1416,7 +1416,7 @@ class J extends Os {
|
|
|
1416
1416
|
this._targetVelocity.set(0, 0, 0), this._target.copy(this._targetEnd);
|
|
1417
1417
|
else {
|
|
1418
1418
|
const p = this._isUserControllingTruck ? this.draggingSmoothTime : this.smoothTime;
|
|
1419
|
-
|
|
1419
|
+
Be(
|
|
1420
1420
|
this._target,
|
|
1421
1421
|
this._targetEnd,
|
|
1422
1422
|
this._targetVelocity,
|
|
@@ -1430,7 +1430,7 @@ class J extends Os {
|
|
|
1430
1430
|
this._focalOffsetVelocity.set(0, 0, 0), this._focalOffset.copy(this._focalOffsetEnd);
|
|
1431
1431
|
else {
|
|
1432
1432
|
const p = this._isUserControllingOffset ? this.draggingSmoothTime : this.smoothTime;
|
|
1433
|
-
|
|
1433
|
+
Be(
|
|
1434
1434
|
this._focalOffset,
|
|
1435
1435
|
this._focalOffsetEnd,
|
|
1436
1436
|
this._focalOffsetVelocity,
|
|
@@ -1440,11 +1440,11 @@ class J extends Os {
|
|
|
1440
1440
|
this._focalOffset
|
|
1441
1441
|
), this._needsUpdate = !0;
|
|
1442
1442
|
}
|
|
1443
|
-
if (A(
|
|
1443
|
+
if (A(n))
|
|
1444
1444
|
this._zoomVelocity.value = 0, this._zoom = this._zoomEnd;
|
|
1445
1445
|
else {
|
|
1446
1446
|
const p = this._isUserControllingZoom ? this.draggingSmoothTime : this.smoothTime;
|
|
1447
|
-
this._zoom =
|
|
1447
|
+
this._zoom = he(
|
|
1448
1448
|
this._zoom,
|
|
1449
1449
|
this._zoomEnd,
|
|
1450
1450
|
this._zoomVelocity,
|
|
@@ -1455,45 +1455,45 @@ class J extends Os {
|
|
|
1455
1455
|
}
|
|
1456
1456
|
if (this.dollyToCursor) {
|
|
1457
1457
|
if (Y(this._camera) && this._changedDolly !== 0) {
|
|
1458
|
-
const p = this._spherical.radius - this._lastDistance,
|
|
1458
|
+
const p = this._spherical.radius - this._lastDistance, E = this._camera, y = this._getCameraDirection(ne), m = w.copy(y).cross(E.up).normalize();
|
|
1459
1459
|
m.lengthSq() === 0 && (m.x = 1);
|
|
1460
|
-
const u =
|
|
1460
|
+
const u = L.crossVectors(m, y), f = this._sphericalEnd.radius * Math.tan(E.getEffectiveFOV() * ie * 0.5), g = (this._sphericalEnd.radius - p - this._sphericalEnd.radius) / this._sphericalEnd.radius, C = X.copy(this._targetEnd).add(
|
|
1461
1461
|
m.multiplyScalar(
|
|
1462
|
-
this._dollyControlCoord.x *
|
|
1462
|
+
this._dollyControlCoord.x * f * E.aspect
|
|
1463
1463
|
)
|
|
1464
1464
|
).add(
|
|
1465
|
-
u.multiplyScalar(this._dollyControlCoord.y *
|
|
1466
|
-
),
|
|
1467
|
-
if (this.infinityDolly && (
|
|
1465
|
+
u.multiplyScalar(this._dollyControlCoord.y * f)
|
|
1466
|
+
), v = w.copy(this._targetEnd).lerp(C, g), b = this._lastDollyDirection === G.IN && this._spherical.radius <= this.minDistance, O = this._lastDollyDirection === G.OUT && this.maxDistance <= this._spherical.radius;
|
|
1467
|
+
if (this.infinityDolly && (b || O)) {
|
|
1468
1468
|
this._sphericalEnd.radius -= p, this._spherical.radius -= p;
|
|
1469
|
-
const
|
|
1470
|
-
|
|
1469
|
+
const R = L.copy(y).multiplyScalar(-p);
|
|
1470
|
+
v.add(R);
|
|
1471
1471
|
}
|
|
1472
|
-
this._boundary.clampPoint(
|
|
1473
|
-
const
|
|
1474
|
-
this._targetEnd.copy(
|
|
1475
|
-
} else if (
|
|
1476
|
-
const p = this._zoom - this._lastZoom,
|
|
1472
|
+
this._boundary.clampPoint(v, v);
|
|
1473
|
+
const x = L.subVectors(v, this._targetEnd);
|
|
1474
|
+
this._targetEnd.copy(v), this._target.add(x), this._changedDolly -= p, A(this._changedDolly) && (this._changedDolly = 0);
|
|
1475
|
+
} else if (I(this._camera) && this._changedZoom !== 0) {
|
|
1476
|
+
const p = this._zoom - this._lastZoom, E = this._camera, y = w.set(
|
|
1477
1477
|
this._dollyControlCoord.x,
|
|
1478
1478
|
this._dollyControlCoord.y,
|
|
1479
|
-
(
|
|
1480
|
-
).unproject(
|
|
1481
|
-
|
|
1479
|
+
(E.near + E.far) / (E.near - E.far)
|
|
1480
|
+
).unproject(E), m = L.set(0, 0, -1).applyQuaternion(E.quaternion), u = X.copy(y).add(m.multiplyScalar(-y.dot(E.up))), a = -(this._zoom - p - this._zoom) / this._zoom, g = this._getCameraDirection(ne), C = this._targetEnd.dot(g), v = w.copy(this._targetEnd).lerp(u, a), b = v.dot(g), O = g.multiplyScalar(
|
|
1481
|
+
b - C
|
|
1482
1482
|
);
|
|
1483
|
-
|
|
1484
|
-
const
|
|
1485
|
-
this._targetEnd.copy(
|
|
1483
|
+
v.sub(O), this._boundary.clampPoint(v, v);
|
|
1484
|
+
const x = L.subVectors(v, this._targetEnd);
|
|
1485
|
+
this._targetEnd.copy(v), this._target.add(x), this._changedZoom -= p, A(this._changedZoom) && (this._changedZoom = 0);
|
|
1486
1486
|
}
|
|
1487
1487
|
}
|
|
1488
1488
|
this._camera.zoom !== this._zoom && (this._camera.zoom = this._zoom, this._camera.updateProjectionMatrix(), this._updateNearPlaneCorners(), this._needsUpdate = !0), this._dragNeedsUpdate = !0;
|
|
1489
|
-
const
|
|
1490
|
-
this._spherical.radius = Math.min(this._spherical.radius,
|
|
1489
|
+
const l = this._collisionTest();
|
|
1490
|
+
this._spherical.radius = Math.min(this._spherical.radius, l), 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), w.copy(F).add(N).add(Z), this._camera.position.add(w), this._camera.updateMatrixWorld()), this._boundaryEnclosesCamera && this._encloseToBoundary(
|
|
1491
1491
|
this._camera.position.copy(this._target),
|
|
1492
|
-
|
|
1492
|
+
w.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse),
|
|
1493
1493
|
1
|
|
1494
1494
|
);
|
|
1495
|
-
const
|
|
1496
|
-
return
|
|
1495
|
+
const _ = this._needsUpdate;
|
|
1496
|
+
return _ && !this._updatedLastTime ? (this._hasRested = !1, this.dispatchEvent({ type: "wake" }), this.dispatchEvent({ type: "update" })) : _ ? (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" }))) : !_ && 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 = _, this._needsUpdate = !1, _;
|
|
1497
1497
|
}
|
|
1498
1498
|
/**
|
|
1499
1499
|
* Get all state in JSON string
|
|
@@ -1503,20 +1503,20 @@ class J extends Os {
|
|
|
1503
1503
|
return JSON.stringify({
|
|
1504
1504
|
enabled: this._enabled,
|
|
1505
1505
|
minDistance: this.minDistance,
|
|
1506
|
-
maxDistance:
|
|
1506
|
+
maxDistance: re(this.maxDistance),
|
|
1507
1507
|
minZoom: this.minZoom,
|
|
1508
|
-
maxZoom:
|
|
1508
|
+
maxZoom: re(this.maxZoom),
|
|
1509
1509
|
minPolarAngle: this.minPolarAngle,
|
|
1510
|
-
maxPolarAngle:
|
|
1511
|
-
minAzimuthAngle:
|
|
1512
|
-
maxAzimuthAngle:
|
|
1510
|
+
maxPolarAngle: re(this.maxPolarAngle),
|
|
1511
|
+
minAzimuthAngle: re(this.minAzimuthAngle),
|
|
1512
|
+
maxAzimuthAngle: re(this.maxAzimuthAngle),
|
|
1513
1513
|
smoothTime: this.smoothTime,
|
|
1514
1514
|
draggingSmoothTime: this.draggingSmoothTime,
|
|
1515
1515
|
dollySpeed: this.dollySpeed,
|
|
1516
1516
|
truckSpeed: this.truckSpeed,
|
|
1517
1517
|
dollyToCursor: this.dollyToCursor,
|
|
1518
1518
|
target: this._targetEnd.toArray(),
|
|
1519
|
-
position:
|
|
1519
|
+
position: w.setFromSpherical(this._sphericalEnd).add(this._targetEnd).toArray(),
|
|
1520
1520
|
zoom: this._zoomEnd,
|
|
1521
1521
|
focalOffset: this._focalOffsetEnd.toArray(),
|
|
1522
1522
|
target0: this._target0.toArray(),
|
|
@@ -1533,8 +1533,8 @@ class J extends Os {
|
|
|
1533
1533
|
*/
|
|
1534
1534
|
fromJSON(e, t = !1) {
|
|
1535
1535
|
const s = JSON.parse(e);
|
|
1536
|
-
this.enabled = s.enabled, this.minDistance = s.minDistance, this.maxDistance =
|
|
1537
|
-
|
|
1536
|
+
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(
|
|
1537
|
+
w.fromArray(s.position).sub(this._targetEnd).applyQuaternion(this._yAxisUpSpace)
|
|
1538
1538
|
), this.rotateTo(z.theta, z.phi, t), this.dollyTo(z.radius, t), this.zoomTo(s.zoom, t), this.setFocalOffset(
|
|
1539
1539
|
s.focalOffset[0],
|
|
1540
1540
|
s.focalOffset[1],
|
|
@@ -1591,23 +1591,23 @@ class J extends Os {
|
|
|
1591
1591
|
const i = t.lengthSq();
|
|
1592
1592
|
if (i === 0)
|
|
1593
1593
|
return e;
|
|
1594
|
-
const r =
|
|
1595
|
-
if (
|
|
1594
|
+
const r = L.copy(t).add(e), n = this._boundary.clampPoint(r, X).sub(r), l = n.lengthSq();
|
|
1595
|
+
if (l === 0)
|
|
1596
1596
|
return e.add(t);
|
|
1597
|
-
if (
|
|
1597
|
+
if (l === i)
|
|
1598
1598
|
return e;
|
|
1599
1599
|
if (s === 0)
|
|
1600
|
-
return e.add(t).add(
|
|
1600
|
+
return e.add(t).add(n);
|
|
1601
1601
|
{
|
|
1602
|
-
const d = 1 + s *
|
|
1603
|
-
return e.add(
|
|
1602
|
+
const d = 1 + s * l / t.dot(n);
|
|
1603
|
+
return e.add(L.copy(t).multiplyScalar(d)).add(n.multiplyScalar(1 - s));
|
|
1604
1604
|
}
|
|
1605
1605
|
}
|
|
1606
1606
|
_updateNearPlaneCorners() {
|
|
1607
1607
|
if (Y(this._camera)) {
|
|
1608
|
-
const e = this._camera, t = e.near, s = e.getEffectiveFOV() *
|
|
1608
|
+
const e = this._camera, t = e.near, s = e.getEffectiveFOV() * ie, i = Math.tan(s * 0.5) * t, r = i * e.aspect;
|
|
1609
1609
|
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);
|
|
1610
|
-
} else if (
|
|
1610
|
+
} else if (I(this._camera)) {
|
|
1611
1611
|
const e = this._camera, t = 1 / e.zoom, s = e.left * t, i = e.right * t, r = e.top * t, o = e.bottom * t;
|
|
1612
1612
|
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);
|
|
1613
1613
|
}
|
|
@@ -1617,15 +1617,15 @@ class J extends Os {
|
|
|
1617
1617
|
let e = 1 / 0;
|
|
1618
1618
|
if (!(this.colliderMeshes.length >= 1) || Oe(this._camera, "_collisionTest"))
|
|
1619
1619
|
return e;
|
|
1620
|
-
const s = this._getTargetDirection(
|
|
1621
|
-
|
|
1620
|
+
const s = this._getTargetDirection(ne);
|
|
1621
|
+
xe.lookAt(Ve, s, this._camera.up);
|
|
1622
1622
|
for (let i = 0; i < 4; i++) {
|
|
1623
|
-
const r =
|
|
1624
|
-
r.applyMatrix4(
|
|
1623
|
+
const r = L.copy(this._nearPlaneCorners[i]);
|
|
1624
|
+
r.applyMatrix4(xe);
|
|
1625
1625
|
const o = X.addVectors(this._target, r);
|
|
1626
1626
|
pe.set(o, s), pe.far = this._spherical.radius + 1;
|
|
1627
|
-
const
|
|
1628
|
-
|
|
1627
|
+
const n = pe.intersectObjects(this.colliderMeshes);
|
|
1628
|
+
n.length !== 0 && n[0].distance < e && (e = n[0].distance);
|
|
1629
1629
|
}
|
|
1630
1630
|
return e;
|
|
1631
1631
|
}
|
|
@@ -1692,23 +1692,23 @@ class J extends Os {
|
|
|
1692
1692
|
}
|
|
1693
1693
|
static createBoundingSphere(e, t = new T.Sphere()) {
|
|
1694
1694
|
const s = t, i = s.center;
|
|
1695
|
-
|
|
1696
|
-
o.isMesh &&
|
|
1697
|
-
}),
|
|
1695
|
+
$.makeEmpty(), e.traverseVisible((o) => {
|
|
1696
|
+
o.isMesh && $.expandByObject(o);
|
|
1697
|
+
}), $.getCenter(i);
|
|
1698
1698
|
let r = 0;
|
|
1699
1699
|
return e.traverseVisible((o) => {
|
|
1700
1700
|
if (!o.isMesh) return;
|
|
1701
|
-
const
|
|
1702
|
-
if (!
|
|
1703
|
-
const
|
|
1704
|
-
|
|
1705
|
-
const
|
|
1706
|
-
for (let p = 0,
|
|
1707
|
-
|
|
1701
|
+
const n = o;
|
|
1702
|
+
if (!n.geometry) return;
|
|
1703
|
+
const l = n.geometry.clone();
|
|
1704
|
+
l.applyMatrix4(n.matrixWorld);
|
|
1705
|
+
const _ = l.attributes.position;
|
|
1706
|
+
for (let p = 0, E = _.count; p < E; p++)
|
|
1707
|
+
w.fromBufferAttribute(_, p), r = Math.max(r, i.distanceToSquared(w));
|
|
1708
1708
|
}), s.radius = Math.sqrt(r), s;
|
|
1709
1709
|
}
|
|
1710
1710
|
}
|
|
1711
|
-
var
|
|
1711
|
+
var Ae = { exports: {} }, Q = typeof Reflect == "object" ? Reflect : null, Ke = Q && typeof Q.apply == "function" ? Q.apply : function(e, t, s) {
|
|
1712
1712
|
return Function.prototype.apply.call(e, t, s);
|
|
1713
1713
|
}, ue;
|
|
1714
1714
|
Q && typeof Q.ownKeys == "function" ? ue = Q.ownKeys : Object.getOwnPropertySymbols ? ue = function(e) {
|
|
@@ -1716,50 +1716,50 @@ Q && typeof Q.ownKeys == "function" ? ue = Q.ownKeys : Object.getOwnPropertySymb
|
|
|
1716
1716
|
} : ue = function(e) {
|
|
1717
1717
|
return Object.getOwnPropertyNames(e);
|
|
1718
1718
|
};
|
|
1719
|
-
function ws(
|
|
1720
|
-
console && console.warn && console.warn(
|
|
1719
|
+
function ws(h) {
|
|
1720
|
+
console && console.warn && console.warn(h);
|
|
1721
1721
|
}
|
|
1722
|
-
var
|
|
1722
|
+
var _t = Number.isNaN || function(e) {
|
|
1723
1723
|
return e !== e;
|
|
1724
1724
|
};
|
|
1725
1725
|
function S() {
|
|
1726
1726
|
S.init.call(this);
|
|
1727
1727
|
}
|
|
1728
|
-
|
|
1729
|
-
|
|
1728
|
+
Ae.exports = S;
|
|
1729
|
+
Ae.exports.once = Ss;
|
|
1730
1730
|
S.EventEmitter = S;
|
|
1731
1731
|
S.prototype._events = void 0;
|
|
1732
1732
|
S.prototype._eventsCount = 0;
|
|
1733
1733
|
S.prototype._maxListeners = void 0;
|
|
1734
|
-
var
|
|
1735
|
-
function ge(
|
|
1736
|
-
if (typeof
|
|
1737
|
-
throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof
|
|
1734
|
+
var Xe = 10;
|
|
1735
|
+
function ge(h) {
|
|
1736
|
+
if (typeof h != "function")
|
|
1737
|
+
throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof h);
|
|
1738
1738
|
}
|
|
1739
1739
|
Object.defineProperty(S, "defaultMaxListeners", {
|
|
1740
1740
|
enumerable: !0,
|
|
1741
1741
|
get: function() {
|
|
1742
|
-
return
|
|
1742
|
+
return Xe;
|
|
1743
1743
|
},
|
|
1744
|
-
set: function(
|
|
1745
|
-
if (typeof
|
|
1746
|
-
throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' +
|
|
1747
|
-
|
|
1744
|
+
set: function(h) {
|
|
1745
|
+
if (typeof h != "number" || h < 0 || _t(h))
|
|
1746
|
+
throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + h + ".");
|
|
1747
|
+
Xe = h;
|
|
1748
1748
|
}
|
|
1749
1749
|
});
|
|
1750
1750
|
S.init = function() {
|
|
1751
1751
|
(this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) && (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
|
|
1752
1752
|
};
|
|
1753
1753
|
S.prototype.setMaxListeners = function(e) {
|
|
1754
|
-
if (typeof e != "number" || e < 0 ||
|
|
1754
|
+
if (typeof e != "number" || e < 0 || _t(e))
|
|
1755
1755
|
throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + e + ".");
|
|
1756
1756
|
return this._maxListeners = e, this;
|
|
1757
1757
|
};
|
|
1758
|
-
function
|
|
1759
|
-
return
|
|
1758
|
+
function gt(h) {
|
|
1759
|
+
return h._maxListeners === void 0 ? S.defaultMaxListeners : h._maxListeners;
|
|
1760
1760
|
}
|
|
1761
1761
|
S.prototype.getMaxListeners = function() {
|
|
1762
|
-
return
|
|
1762
|
+
return gt(this);
|
|
1763
1763
|
};
|
|
1764
1764
|
S.prototype.emit = function(e) {
|
|
1765
1765
|
for (var t = [], s = 1; s < arguments.length; s++) t.push(arguments[s]);
|
|
@@ -1772,47 +1772,47 @@ S.prototype.emit = function(e) {
|
|
|
1772
1772
|
var o;
|
|
1773
1773
|
if (t.length > 0 && (o = t[0]), o instanceof Error)
|
|
1774
1774
|
throw o;
|
|
1775
|
-
var
|
|
1776
|
-
throw
|
|
1775
|
+
var n = new Error("Unhandled error." + (o ? " (" + o.message + ")" : ""));
|
|
1776
|
+
throw n.context = o, n;
|
|
1777
1777
|
}
|
|
1778
|
-
var
|
|
1779
|
-
if (
|
|
1778
|
+
var l = r[e];
|
|
1779
|
+
if (l === void 0)
|
|
1780
1780
|
return !1;
|
|
1781
|
-
if (typeof
|
|
1782
|
-
|
|
1781
|
+
if (typeof l == "function")
|
|
1782
|
+
Ke(l, this, t);
|
|
1783
1783
|
else
|
|
1784
|
-
for (var d =
|
|
1785
|
-
|
|
1784
|
+
for (var d = l.length, _ = Ot(l, d), s = 0; s < d; ++s)
|
|
1785
|
+
Ke(_[s], this, t);
|
|
1786
1786
|
return !0;
|
|
1787
1787
|
};
|
|
1788
|
-
function
|
|
1788
|
+
function yt(h, e, t, s) {
|
|
1789
1789
|
var i, r, o;
|
|
1790
|
-
if (ge(t), r =
|
|
1790
|
+
if (ge(t), r = h._events, r === void 0 ? (r = h._events = /* @__PURE__ */ Object.create(null), h._eventsCount = 0) : (r.newListener !== void 0 && (h.emit(
|
|
1791
1791
|
"newListener",
|
|
1792
1792
|
e,
|
|
1793
1793
|
t.listener ? t.listener : t
|
|
1794
|
-
), r =
|
|
1795
|
-
o = r[e] = t, ++
|
|
1796
|
-
else if (typeof o == "function" ? o = r[e] = s ? [t, o] : [o, t] : s ? o.unshift(t) : o.push(t), i =
|
|
1794
|
+
), r = h._events), o = r[e]), o === void 0)
|
|
1795
|
+
o = r[e] = t, ++h._eventsCount;
|
|
1796
|
+
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) {
|
|
1797
1797
|
o.warned = !0;
|
|
1798
|
-
var
|
|
1799
|
-
|
|
1798
|
+
var n = new Error("Possible EventEmitter memory leak detected. " + o.length + " " + String(e) + " listeners added. Use emitter.setMaxListeners() to increase limit");
|
|
1799
|
+
n.name = "MaxListenersExceededWarning", n.emitter = h, n.type = e, n.count = o.length, ws(n);
|
|
1800
1800
|
}
|
|
1801
|
-
return
|
|
1801
|
+
return h;
|
|
1802
1802
|
}
|
|
1803
1803
|
S.prototype.addListener = function(e, t) {
|
|
1804
|
-
return
|
|
1804
|
+
return yt(this, e, t, !1);
|
|
1805
1805
|
};
|
|
1806
1806
|
S.prototype.on = S.prototype.addListener;
|
|
1807
1807
|
S.prototype.prependListener = function(e, t) {
|
|
1808
|
-
return
|
|
1808
|
+
return yt(this, e, t, !0);
|
|
1809
1809
|
};
|
|
1810
1810
|
function xs() {
|
|
1811
1811
|
if (!this.fired)
|
|
1812
1812
|
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);
|
|
1813
1813
|
}
|
|
1814
|
-
function vt(
|
|
1815
|
-
var s = { fired: !1, wrapFn: void 0, target:
|
|
1814
|
+
function vt(h, e, t) {
|
|
1815
|
+
var s = { fired: !1, wrapFn: void 0, target: h, type: e, listener: t }, i = xs.bind(s);
|
|
1816
1816
|
return i.listener = t, s.wrapFn = i, i;
|
|
1817
1817
|
}
|
|
1818
1818
|
S.prototype.once = function(e, t) {
|
|
@@ -1822,7 +1822,7 @@ S.prototype.prependOnceListener = function(e, t) {
|
|
|
1822
1822
|
return ge(t), this.prependListener(e, vt(this, e, t)), this;
|
|
1823
1823
|
};
|
|
1824
1824
|
S.prototype.removeListener = function(e, t) {
|
|
1825
|
-
var s, i, r, o,
|
|
1825
|
+
var s, i, r, o, n;
|
|
1826
1826
|
if (ge(t), i = this._events, i === void 0)
|
|
1827
1827
|
return this;
|
|
1828
1828
|
if (s = i[e], s === void 0)
|
|
@@ -1832,12 +1832,12 @@ S.prototype.removeListener = function(e, t) {
|
|
|
1832
1832
|
else if (typeof s != "function") {
|
|
1833
1833
|
for (r = -1, o = s.length - 1; o >= 0; o--)
|
|
1834
1834
|
if (s[o] === t || s[o].listener === t) {
|
|
1835
|
-
|
|
1835
|
+
n = s[o].listener, r = o;
|
|
1836
1836
|
break;
|
|
1837
1837
|
}
|
|
1838
1838
|
if (r < 0)
|
|
1839
1839
|
return this;
|
|
1840
|
-
r === 0 ? s.shift() :
|
|
1840
|
+
r === 0 ? s.shift() : Ls(s, r), s.length === 1 && (i[e] = s[0]), i.removeListener !== void 0 && this.emit("removeListener", e, n || t);
|
|
1841
1841
|
}
|
|
1842
1842
|
return this;
|
|
1843
1843
|
};
|
|
@@ -1861,27 +1861,27 @@ S.prototype.removeAllListeners = function(e) {
|
|
|
1861
1861
|
this.removeListener(e, t[i]);
|
|
1862
1862
|
return this;
|
|
1863
1863
|
};
|
|
1864
|
-
function
|
|
1865
|
-
var s =
|
|
1864
|
+
function Ct(h, e, t) {
|
|
1865
|
+
var s = h._events;
|
|
1866
1866
|
if (s === void 0)
|
|
1867
1867
|
return [];
|
|
1868
1868
|
var i = s[e];
|
|
1869
|
-
return i === void 0 ? [] : typeof i == "function" ? t ? [i.listener || i] : [i] : t ? Ps(i) :
|
|
1869
|
+
return i === void 0 ? [] : typeof i == "function" ? t ? [i.listener || i] : [i] : t ? Ps(i) : Ot(i, i.length);
|
|
1870
1870
|
}
|
|
1871
1871
|
S.prototype.listeners = function(e) {
|
|
1872
|
-
return
|
|
1872
|
+
return Ct(this, e, !0);
|
|
1873
1873
|
};
|
|
1874
1874
|
S.prototype.rawListeners = function(e) {
|
|
1875
|
-
return
|
|
1875
|
+
return Ct(this, e, !1);
|
|
1876
1876
|
};
|
|
1877
|
-
S.listenerCount = function(
|
|
1878
|
-
return typeof
|
|
1877
|
+
S.listenerCount = function(h, e) {
|
|
1878
|
+
return typeof h.listenerCount == "function" ? h.listenerCount(e) : Et.call(h, e);
|
|
1879
1879
|
};
|
|
1880
|
-
S.prototype.listenerCount =
|
|
1881
|
-
function
|
|
1880
|
+
S.prototype.listenerCount = Et;
|
|
1881
|
+
function Et(h) {
|
|
1882
1882
|
var e = this._events;
|
|
1883
1883
|
if (e !== void 0) {
|
|
1884
|
-
var t = e[
|
|
1884
|
+
var t = e[h];
|
|
1885
1885
|
if (typeof t == "function")
|
|
1886
1886
|
return 1;
|
|
1887
1887
|
if (t !== void 0)
|
|
@@ -1892,82 +1892,82 @@ function Ct(l) {
|
|
|
1892
1892
|
S.prototype.eventNames = function() {
|
|
1893
1893
|
return this._eventsCount > 0 ? ue(this._events) : [];
|
|
1894
1894
|
};
|
|
1895
|
-
function
|
|
1895
|
+
function Ot(h, e) {
|
|
1896
1896
|
for (var t = new Array(e), s = 0; s < e; ++s)
|
|
1897
|
-
t[s] =
|
|
1897
|
+
t[s] = h[s];
|
|
1898
1898
|
return t;
|
|
1899
1899
|
}
|
|
1900
|
-
function
|
|
1901
|
-
for (; e + 1 <
|
|
1902
|
-
|
|
1903
|
-
|
|
1900
|
+
function Ls(h, e) {
|
|
1901
|
+
for (; e + 1 < h.length; e++)
|
|
1902
|
+
h[e] = h[e + 1];
|
|
1903
|
+
h.pop();
|
|
1904
1904
|
}
|
|
1905
|
-
function Ps(
|
|
1906
|
-
for (var e = new Array(
|
|
1907
|
-
e[t] =
|
|
1905
|
+
function Ps(h) {
|
|
1906
|
+
for (var e = new Array(h.length), t = 0; t < e.length; ++t)
|
|
1907
|
+
e[t] = h[t].listener || h[t];
|
|
1908
1908
|
return e;
|
|
1909
1909
|
}
|
|
1910
|
-
function
|
|
1910
|
+
function Ss(h, e) {
|
|
1911
1911
|
return new Promise(function(t, s) {
|
|
1912
1912
|
function i(o) {
|
|
1913
|
-
|
|
1913
|
+
h.removeListener(e, r), s(o);
|
|
1914
1914
|
}
|
|
1915
1915
|
function r() {
|
|
1916
|
-
typeof
|
|
1916
|
+
typeof h.removeListener == "function" && h.removeListener("error", i), t([].slice.call(arguments));
|
|
1917
1917
|
}
|
|
1918
|
-
|
|
1918
|
+
Tt(h, e, r, { once: !0 }), e !== "error" && As(h, i, { once: !0 });
|
|
1919
1919
|
});
|
|
1920
1920
|
}
|
|
1921
|
-
function
|
|
1922
|
-
typeof
|
|
1921
|
+
function As(h, e, t) {
|
|
1922
|
+
typeof h.on == "function" && Tt(h, "error", e, t);
|
|
1923
1923
|
}
|
|
1924
|
-
function
|
|
1925
|
-
if (typeof
|
|
1926
|
-
s.once ?
|
|
1927
|
-
else if (typeof
|
|
1928
|
-
|
|
1929
|
-
s.once &&
|
|
1924
|
+
function Tt(h, e, t, s) {
|
|
1925
|
+
if (typeof h.on == "function")
|
|
1926
|
+
s.once ? h.once(e, t) : h.on(e, t);
|
|
1927
|
+
else if (typeof h.addEventListener == "function")
|
|
1928
|
+
h.addEventListener(e, function i(r) {
|
|
1929
|
+
s.once && h.removeEventListener(e, i), t(r);
|
|
1930
1930
|
});
|
|
1931
1931
|
else
|
|
1932
|
-
throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof
|
|
1932
|
+
throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof h);
|
|
1933
1933
|
}
|
|
1934
|
-
var
|
|
1935
|
-
const
|
|
1934
|
+
var ye = Ae.exports;
|
|
1935
|
+
const Ms = {
|
|
1936
1936
|
antialias: !1,
|
|
1937
1937
|
devicePixelRatio: window.devicePixelRatio,
|
|
1938
1938
|
powerPreference: "high-performance",
|
|
1939
1939
|
toneMappingExposure: 1,
|
|
1940
1940
|
alpha: !1,
|
|
1941
|
-
outputColorSpace:
|
|
1941
|
+
outputColorSpace: as.sRGB,
|
|
1942
1942
|
logarithmicDepthBuffer: !1,
|
|
1943
1943
|
preserveDrawingBuffer: !1,
|
|
1944
1944
|
stencil: !1,
|
|
1945
1945
|
depth: !1
|
|
1946
1946
|
};
|
|
1947
|
-
class
|
|
1947
|
+
class Rs {
|
|
1948
1948
|
constructor(e) {
|
|
1949
1949
|
this.options = e;
|
|
1950
1950
|
const { width: t, height: s, rendererParams: i } = e, {
|
|
1951
1951
|
alpha: r,
|
|
1952
1952
|
devicePixelRatio: o,
|
|
1953
|
-
antialias:
|
|
1954
|
-
powerPreference:
|
|
1953
|
+
antialias: n,
|
|
1954
|
+
powerPreference: l,
|
|
1955
1955
|
toneMappingExposure: d,
|
|
1956
|
-
outputColorSpace:
|
|
1956
|
+
outputColorSpace: _,
|
|
1957
1957
|
logarithmicDepthBuffer: p,
|
|
1958
|
-
preserveDrawingBuffer:
|
|
1959
|
-
stencil:
|
|
1958
|
+
preserveDrawingBuffer: E,
|
|
1959
|
+
stencil: y,
|
|
1960
1960
|
depth: m
|
|
1961
|
-
} = i, u = new
|
|
1961
|
+
} = i, u = new Ut({
|
|
1962
1962
|
alpha: r,
|
|
1963
|
-
antialias:
|
|
1964
|
-
powerPreference:
|
|
1963
|
+
antialias: n,
|
|
1964
|
+
powerPreference: l,
|
|
1965
1965
|
logarithmicDepthBuffer: p,
|
|
1966
|
-
preserveDrawingBuffer:
|
|
1967
|
-
stencil:
|
|
1966
|
+
preserveDrawingBuffer: E,
|
|
1967
|
+
stencil: y,
|
|
1968
1968
|
depth: m
|
|
1969
1969
|
});
|
|
1970
|
-
u.setSize(t, s), u.setPixelRatio(o), u.toneMappingExposure = d, u.outputColorSpace =
|
|
1970
|
+
u.setSize(t, s), u.setPixelRatio(o), u.toneMappingExposure = d, u.outputColorSpace = _, this.renderer = u;
|
|
1971
1971
|
}
|
|
1972
1972
|
setSize(e, t) {
|
|
1973
1973
|
this.renderer.setSize(e, t);
|
|
@@ -1979,18 +1979,18 @@ class Ms {
|
|
|
1979
1979
|
this.renderer.render(e, t);
|
|
1980
1980
|
}
|
|
1981
1981
|
setViewport(e) {
|
|
1982
|
-
var
|
|
1983
|
-
const { x: t, y: s, width: i, height: r } = e, o = (
|
|
1984
|
-
this.renderer.setViewport(t, s, i, r), o && (this.renderer.setScissor(t, s, i, r), this.renderer.setScissorTest(
|
|
1982
|
+
var l, d;
|
|
1983
|
+
const { x: t, y: s, width: i, height: r } = e, o = (l = e.scissor) != null ? l : !1, n = (d = e.scissorTest) != null ? d : !1;
|
|
1984
|
+
this.renderer.setViewport(t, s, i, r), o && (this.renderer.setScissor(t, s, i, r), this.renderer.setScissorTest(n));
|
|
1985
1985
|
}
|
|
1986
1986
|
setViewPadding(e = 0, t = 0, s = 0, i = 0) {
|
|
1987
|
-
const { width: r, height: o } = this.renderer.getSize(new
|
|
1987
|
+
const { width: r, height: o } = this.renderer.getSize(new B()), n = {
|
|
1988
1988
|
x: i,
|
|
1989
1989
|
y: s,
|
|
1990
1990
|
width: r - i - t,
|
|
1991
1991
|
height: o - e - s
|
|
1992
1992
|
};
|
|
1993
|
-
this.setViewport(
|
|
1993
|
+
this.setViewport(n);
|
|
1994
1994
|
}
|
|
1995
1995
|
dispose() {
|
|
1996
1996
|
var e, t;
|
|
@@ -2001,13 +2001,13 @@ const Ds = {
|
|
|
2001
2001
|
antialias: !0,
|
|
2002
2002
|
devicePixelRatio: window.devicePixelRatio
|
|
2003
2003
|
};
|
|
2004
|
-
class
|
|
2004
|
+
class Us {
|
|
2005
2005
|
constructor(e) {
|
|
2006
2006
|
this.options = e;
|
|
2007
|
-
const { width: t, height: s, rendererParams: i, renderer: r } = e, { devicePixelRatio: o, antialias:
|
|
2008
|
-
antialias:
|
|
2007
|
+
const { width: t, height: s, rendererParams: i, renderer: r } = e, { devicePixelRatio: o, antialias: n } = i, l = new r({
|
|
2008
|
+
antialias: n
|
|
2009
2009
|
});
|
|
2010
|
-
|
|
2010
|
+
l.setSize(t, s), l.setPixelRatio(o), this.renderer = l;
|
|
2011
2011
|
}
|
|
2012
2012
|
setSize(e, t) {
|
|
2013
2013
|
this.renderer.setSize(e, t);
|
|
@@ -2020,7 +2020,7 @@ class Rs {
|
|
|
2020
2020
|
this.setSize(1, 1), (e = this.renderer) == null || e.clear(), (t = this.renderer) == null || t.dispose();
|
|
2021
2021
|
}
|
|
2022
2022
|
}
|
|
2023
|
-
let
|
|
2023
|
+
let zs = class {
|
|
2024
2024
|
constructor() {
|
|
2025
2025
|
this.mask = 1;
|
|
2026
2026
|
}
|
|
@@ -2046,12 +2046,12 @@ let Us = class {
|
|
|
2046
2046
|
return (this.mask & (1 << e | 0)) !== 0;
|
|
2047
2047
|
}
|
|
2048
2048
|
};
|
|
2049
|
-
class
|
|
2049
|
+
class ee {
|
|
2050
2050
|
constructor() {
|
|
2051
|
-
this.event = new
|
|
2051
|
+
this.event = new ye.EventEmitter(), this.controllerMap = /* @__PURE__ */ new Map(), this.activeIndex = -1, this.activeControllerSet = /* @__PURE__ */ new Set();
|
|
2052
2052
|
}
|
|
2053
2053
|
addController(e, t) {
|
|
2054
|
-
const s = new
|
|
2054
|
+
const s = new zs();
|
|
2055
2055
|
return s.disableAll(), t !== void 0 && s.set(t), this.controllerMap.set(e, s), t === this.activeIndex && this.activeControllerSet.add(e), e;
|
|
2056
2056
|
}
|
|
2057
2057
|
removePage(e, t) {
|
|
@@ -2079,21 +2079,21 @@ class ae {
|
|
|
2079
2079
|
}), this.removePage(0), this.controllerMap.clear(), this.event.removeAllListeners(), this.activeControllerSet.clear();
|
|
2080
2080
|
}
|
|
2081
2081
|
}
|
|
2082
|
-
const
|
|
2082
|
+
const bt = {
|
|
2083
2083
|
fov: 45,
|
|
2084
2084
|
near: 1,
|
|
2085
2085
|
far: 1e3,
|
|
2086
|
-
up: new
|
|
2086
|
+
up: new j(0, 1, 0)
|
|
2087
2087
|
};
|
|
2088
|
-
class
|
|
2088
|
+
class ks extends ee {
|
|
2089
2089
|
constructor(e) {
|
|
2090
2090
|
super(), this.width = 0, this.height = 0, this.width = e.width, this.height = e.height;
|
|
2091
2091
|
}
|
|
2092
2092
|
get camera() {
|
|
2093
2093
|
return this.controller;
|
|
2094
2094
|
}
|
|
2095
|
-
addPerspectiveCamera(e =
|
|
2096
|
-
const { fov: s, far: i, near: r, up: o, aspect:
|
|
2095
|
+
addPerspectiveCamera(e = bt, t) {
|
|
2096
|
+
const { fov: s, far: i, near: r, up: o, aspect: n } = e, l = n != null ? n : this.width / this.height, d = new zt(s, l, r, i);
|
|
2097
2097
|
return d.up = o, this.addController(d, t);
|
|
2098
2098
|
}
|
|
2099
2099
|
setPageActive(e) {
|
|
@@ -2160,15 +2160,15 @@ class zs extends ae {
|
|
|
2160
2160
|
s[7],
|
|
2161
2161
|
s[11],
|
|
2162
2162
|
s[15]
|
|
2163
|
-
), { width:
|
|
2163
|
+
), { width: n, height: l } = this, d = n / l;
|
|
2164
2164
|
(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());
|
|
2165
2165
|
}
|
|
2166
2166
|
}
|
|
2167
2167
|
}
|
|
2168
|
-
const
|
|
2168
|
+
const Fs = {
|
|
2169
2169
|
background: null
|
|
2170
2170
|
};
|
|
2171
|
-
class
|
|
2171
|
+
class Ns extends ee {
|
|
2172
2172
|
get scene() {
|
|
2173
2173
|
return this.controller;
|
|
2174
2174
|
}
|
|
@@ -2176,12 +2176,12 @@ class Fs extends ae {
|
|
|
2176
2176
|
super(), this.options = e;
|
|
2177
2177
|
}
|
|
2178
2178
|
addScene(e, t) {
|
|
2179
|
-
const s = new
|
|
2179
|
+
const s = new nt();
|
|
2180
2180
|
return e != null && e.background && (s.background = e.background), this.addController(s, t);
|
|
2181
2181
|
}
|
|
2182
2182
|
removePage(e) {
|
|
2183
2183
|
super.removePage(e, (t) => {
|
|
2184
|
-
const s = new
|
|
2184
|
+
const s = new Pe();
|
|
2185
2185
|
s.track(t), s.dispose();
|
|
2186
2186
|
});
|
|
2187
2187
|
}
|
|
@@ -2191,7 +2191,7 @@ class Fs extends ae {
|
|
|
2191
2191
|
});
|
|
2192
2192
|
}
|
|
2193
2193
|
}
|
|
2194
|
-
class
|
|
2194
|
+
class Hs {
|
|
2195
2195
|
constructor(e) {
|
|
2196
2196
|
this.helpers = {}, this.options = e;
|
|
2197
2197
|
}
|
|
@@ -2202,21 +2202,21 @@ class Ns {
|
|
|
2202
2202
|
if (e.isScene)
|
|
2203
2203
|
i = new De(100);
|
|
2204
2204
|
else if (e.isCamera)
|
|
2205
|
-
i = new
|
|
2205
|
+
i = new kt(e);
|
|
2206
2206
|
else if (e.isPointLight)
|
|
2207
|
-
i = new kt(e, 1);
|
|
2208
|
-
else if (e.isDirectionalLight)
|
|
2209
2207
|
i = new Ft(e, 1);
|
|
2208
|
+
else if (e.isDirectionalLight)
|
|
2209
|
+
i = new Nt(e, 1);
|
|
2210
2210
|
else if (e.isSpotLight)
|
|
2211
|
-
i = new
|
|
2211
|
+
i = new Ht(e);
|
|
2212
2212
|
else if (e.isHemisphereLight)
|
|
2213
|
-
i = new
|
|
2213
|
+
i = new jt(e, 10);
|
|
2214
2214
|
else if (e.isRectAreaLight)
|
|
2215
|
-
i = new
|
|
2215
|
+
i = new ds(e);
|
|
2216
2216
|
else {
|
|
2217
|
-
const r = new
|
|
2217
|
+
const r = new at();
|
|
2218
2218
|
if (r.setFromObject(e, !0), r.isEmpty() === !1) {
|
|
2219
|
-
i = new
|
|
2219
|
+
i = new Ue(r);
|
|
2220
2220
|
const o = i.material;
|
|
2221
2221
|
o.userData.object = e, o.depthTest = !1, o.transparent = !0;
|
|
2222
2222
|
} else
|
|
@@ -2226,7 +2226,7 @@ class Ns {
|
|
|
2226
2226
|
}
|
|
2227
2227
|
}
|
|
2228
2228
|
addViewHelper() {
|
|
2229
|
-
const { cameraController: e, container: t } = this.options, s = new
|
|
2229
|
+
const { cameraController: e, container: t } = this.options, s = new ps(e.camera, t);
|
|
2230
2230
|
t.addEventListener("pointerdown", (i) => {
|
|
2231
2231
|
i.preventDefault(), s.handleClick(i);
|
|
2232
2232
|
}), this.viewHelper = s;
|
|
@@ -2256,10 +2256,10 @@ class Ns {
|
|
|
2256
2256
|
update(e, t, s) {
|
|
2257
2257
|
var r, o;
|
|
2258
2258
|
const { cameraController: i } = this.options;
|
|
2259
|
-
Object.values(this.helpers).forEach((
|
|
2260
|
-
if (
|
|
2261
|
-
const
|
|
2262
|
-
d &&
|
|
2259
|
+
Object.values(this.helpers).forEach((n) => {
|
|
2260
|
+
if (n.update && n.update(), n instanceof Ue) {
|
|
2261
|
+
const l = n.material, { object: d } = l.userData;
|
|
2262
|
+
d && n.box.setFromObject(d, !0);
|
|
2263
2263
|
}
|
|
2264
2264
|
}), ((r = this.viewHelper) == null ? void 0 : r.animating) === !0 && (this.viewHelper.update(e), (o = t.cameraControls) == null || o.setPosition(
|
|
2265
2265
|
...i.camera.position.toArray()
|
|
@@ -2276,18 +2276,18 @@ class Ns {
|
|
|
2276
2276
|
this.helpers = {}, (e = this.viewHelper) == null || e.dispose();
|
|
2277
2277
|
}
|
|
2278
2278
|
}
|
|
2279
|
-
class
|
|
2279
|
+
class js extends ee {
|
|
2280
2280
|
constructor(e) {
|
|
2281
2281
|
super(), this.autoRotateSpeed = 0, this.options = e;
|
|
2282
2282
|
const t = {
|
|
2283
|
-
Vector2:
|
|
2284
|
-
Vector3:
|
|
2285
|
-
Vector4:
|
|
2286
|
-
Quaternion:
|
|
2283
|
+
Vector2: B,
|
|
2284
|
+
Vector3: j,
|
|
2285
|
+
Vector4: Bt,
|
|
2286
|
+
Quaternion: lt,
|
|
2287
2287
|
Matrix4: W,
|
|
2288
2288
|
Spherical: Vt,
|
|
2289
|
-
Box3:
|
|
2290
|
-
Sphere:
|
|
2289
|
+
Box3: at,
|
|
2290
|
+
Sphere: Yt,
|
|
2291
2291
|
Raycaster: ht
|
|
2292
2292
|
};
|
|
2293
2293
|
J.install({ THREE: t });
|
|
@@ -2325,24 +2325,24 @@ class Hs extends ae {
|
|
|
2325
2325
|
}
|
|
2326
2326
|
class Is {
|
|
2327
2327
|
constructor(e) {
|
|
2328
|
-
this.event = new
|
|
2329
|
-
const { renderer: t, scene: s, camera: i } = e, r = new
|
|
2328
|
+
this.event = new ye.EventEmitter();
|
|
2329
|
+
const { renderer: t, scene: s, camera: i } = e, r = new ms(
|
|
2330
2330
|
i,
|
|
2331
2331
|
t.domElement
|
|
2332
2332
|
);
|
|
2333
2333
|
if (r.getHelper) {
|
|
2334
2334
|
const o = r.getHelper();
|
|
2335
|
-
if (s.add(o), +
|
|
2336
|
-
const
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2335
|
+
if (s.add(o), +Zt < 170) {
|
|
2336
|
+
const n = r._root;
|
|
2337
|
+
n.dispose = () => {
|
|
2338
|
+
n.traverse((l) => {
|
|
2339
|
+
l.geometry && l.geometry.dispose(), l.material && l.material.dispose();
|
|
2340
2340
|
});
|
|
2341
2341
|
}, r.dispose = () => {
|
|
2342
|
-
r.disconnect(),
|
|
2342
|
+
r.disconnect(), n.dispose();
|
|
2343
2343
|
};
|
|
2344
2344
|
}
|
|
2345
|
-
} else r instanceof
|
|
2345
|
+
} else r instanceof Wt && s.add(r);
|
|
2346
2346
|
this.controls = r, this.addEvent();
|
|
2347
2347
|
}
|
|
2348
2348
|
get detach() {
|
|
@@ -2392,8 +2392,8 @@ class Is {
|
|
|
2392
2392
|
this.event.removeAllListeners(), (e = this.controls) == null || e.dispose();
|
|
2393
2393
|
}
|
|
2394
2394
|
}
|
|
2395
|
-
const
|
|
2396
|
-
class
|
|
2395
|
+
const $e = new j(), Bs = new lt(), qe = new j(), H = new W(), Vs = new W();
|
|
2396
|
+
class Ys {
|
|
2397
2397
|
/**
|
|
2398
2398
|
* Constructs a new CSS3D renderer.
|
|
2399
2399
|
*
|
|
@@ -2402,72 +2402,72 @@ class Bs {
|
|
|
2402
2402
|
constructor(e = {}) {
|
|
2403
2403
|
const t = this;
|
|
2404
2404
|
let s, i, r, o;
|
|
2405
|
-
const
|
|
2405
|
+
const n = {
|
|
2406
2406
|
camera: { style: "" },
|
|
2407
2407
|
objects: /* @__PURE__ */ new WeakMap()
|
|
2408
|
-
},
|
|
2409
|
-
|
|
2408
|
+
}, l = e.element !== void 0 ? e.element : document.createElement("div");
|
|
2409
|
+
l.style.overflow = "hidden", this.domElement = l;
|
|
2410
2410
|
const d = document.createElement("div");
|
|
2411
|
-
d.style.transformOrigin = "0 0", d.style.pointerEvents = "none",
|
|
2412
|
-
const
|
|
2413
|
-
|
|
2411
|
+
d.style.transformOrigin = "0 0", d.style.pointerEvents = "none", l.appendChild(d);
|
|
2412
|
+
const _ = document.createElement("div");
|
|
2413
|
+
_.style.transformStyle = "preserve-3d", d.appendChild(_), this.getSize = function() {
|
|
2414
2414
|
return {
|
|
2415
2415
|
width: s,
|
|
2416
2416
|
height: i
|
|
2417
2417
|
};
|
|
2418
|
-
}, this.render = function(
|
|
2419
|
-
const
|
|
2420
|
-
|
|
2421
|
-
let
|
|
2422
|
-
|
|
2423
|
-
const
|
|
2424
|
-
|
|
2425
|
-
}, this.setSize = function(
|
|
2426
|
-
s =
|
|
2418
|
+
}, this.render = function(f, a) {
|
|
2419
|
+
const g = a.projectionMatrix.elements[5] * o;
|
|
2420
|
+
a.view && a.view.enabled ? (d.style.transform = `translate( ${-a.view.offsetX * (s / a.view.width)}px, ${-a.view.offsetY * (i / a.view.height)}px )`, d.style.transform += `scale( ${a.view.fullWidth / a.view.width}, ${a.view.fullHeight / a.view.height} )`) : d.style.transform = "", f.matrixWorldAutoUpdate === !0 && f.updateMatrixWorld(), a.parent === null && a.matrixWorldAutoUpdate === !0 && a.updateMatrixWorld();
|
|
2421
|
+
let C, v;
|
|
2422
|
+
a.isOrthographicCamera && (C = -(a.right + a.left) / 2, v = (a.top + a.bottom) / 2);
|
|
2423
|
+
const b = a.view && a.view.enabled ? a.view.height / a.view.fullHeight : 1, O = a.isOrthographicCamera ? `scale( ${b} )scale(` + g + ")translate(" + p(C) + "px," + p(v) + "px)" + E(a.matrixWorldInverse) : `scale( ${b} )translateZ(` + g + "px)" + E(a.matrixWorldInverse), R = (a.isPerspectiveCamera ? "perspective(" + g + "px) " : "") + O + "translate(" + r + "px," + o + "px)";
|
|
2424
|
+
n.camera.style !== R && (_.style.transform = R, n.camera.style = R), u(f, f, a);
|
|
2425
|
+
}, this.setSize = function(f, a) {
|
|
2426
|
+
s = f, i = a, r = s / 2, o = i / 2, l.style.width = f + "px", l.style.height = a + "px", d.style.width = f + "px", d.style.height = a + "px", _.style.width = f + "px", _.style.height = a + "px";
|
|
2427
2427
|
};
|
|
2428
|
-
function p(
|
|
2429
|
-
return Math.abs(
|
|
2428
|
+
function p(f) {
|
|
2429
|
+
return Math.abs(f) < 1e-10 ? 0 : f;
|
|
2430
2430
|
}
|
|
2431
|
-
function
|
|
2432
|
-
const
|
|
2433
|
-
return "matrix3d(" + p(
|
|
2431
|
+
function E(f) {
|
|
2432
|
+
const a = f.elements;
|
|
2433
|
+
return "matrix3d(" + p(a[0]) + "," + p(-a[1]) + "," + p(a[2]) + "," + p(a[3]) + "," + p(a[4]) + "," + p(-a[5]) + "," + p(a[6]) + "," + p(a[7]) + "," + p(a[8]) + "," + p(-a[9]) + "," + p(a[10]) + "," + p(a[11]) + "," + p(a[12]) + "," + p(-a[13]) + "," + p(a[14]) + "," + p(a[15]) + ")";
|
|
2434
2434
|
}
|
|
2435
|
-
function
|
|
2436
|
-
const
|
|
2437
|
-
return "translate(-50%,-50%)" + ("matrix3d(" + p(
|
|
2435
|
+
function y(f) {
|
|
2436
|
+
const a = f.elements;
|
|
2437
|
+
return "translate(-50%,-50%)" + ("matrix3d(" + p(a[0]) + "," + p(a[1]) + "," + p(a[2]) + "," + p(a[3]) + "," + p(-a[4]) + "," + p(-a[5]) + "," + p(-a[6]) + "," + p(-a[7]) + "," + p(a[8]) + "," + p(a[9]) + "," + p(a[10]) + "," + p(a[11]) + "," + p(a[12]) + "," + p(a[13]) + "," + p(a[14]) + "," + p(a[15]) + ")");
|
|
2438
2438
|
}
|
|
2439
|
-
function m(
|
|
2440
|
-
|
|
2441
|
-
for (let
|
|
2442
|
-
m(
|
|
2439
|
+
function m(f) {
|
|
2440
|
+
f.isCSS3DObject && (f.element.style.display = "none");
|
|
2441
|
+
for (let a = 0, g = f.children.length; a < g; a++)
|
|
2442
|
+
m(f.children[a]);
|
|
2443
2443
|
}
|
|
2444
|
-
function u(
|
|
2445
|
-
if (
|
|
2446
|
-
m(
|
|
2444
|
+
function u(f, a, g, C) {
|
|
2445
|
+
if (f.visible === !1) {
|
|
2446
|
+
m(f);
|
|
2447
2447
|
return;
|
|
2448
2448
|
}
|
|
2449
|
-
if (
|
|
2450
|
-
const
|
|
2451
|
-
if (
|
|
2452
|
-
|
|
2449
|
+
if (f.isCSS3DObject) {
|
|
2450
|
+
const v = f.layers.test(g.layers) === !0, b = f.element;
|
|
2451
|
+
if (b.style.display = v === !0 ? "" : "none", v === !0) {
|
|
2452
|
+
f.onBeforeRender(t, a, g);
|
|
2453
2453
|
let O;
|
|
2454
|
-
|
|
2455
|
-
const
|
|
2456
|
-
if (
|
|
2457
|
-
|
|
2458
|
-
const
|
|
2459
|
-
|
|
2454
|
+
f.isCSS3DSprite ? (H.copy(g.matrixWorldInverse), H.transpose(), f.rotation2D !== 0 && H.multiply(Vs.makeRotationZ(f.rotation2D)), f.matrixWorld.decompose($e, Bs, qe), H.setPosition($e), H.scale(qe), H.elements[3] = 0, H.elements[7] = 0, H.elements[11] = 0, H.elements[15] = 1, O = y(H)) : O = y(f.matrixWorld);
|
|
2455
|
+
const x = n.objects.get(f);
|
|
2456
|
+
if (x === void 0 || x.style !== O) {
|
|
2457
|
+
b.style.transform = O;
|
|
2458
|
+
const R = { style: O };
|
|
2459
|
+
n.objects.set(f, R);
|
|
2460
2460
|
}
|
|
2461
|
-
|
|
2461
|
+
b.parentNode !== _ && _.appendChild(b), f.onAfterRender(t, a, g);
|
|
2462
2462
|
}
|
|
2463
2463
|
}
|
|
2464
|
-
for (let
|
|
2465
|
-
u(
|
|
2464
|
+
for (let v = 0, b = f.children.length; v < b; v++)
|
|
2465
|
+
u(f.children[v], a, g);
|
|
2466
2466
|
}
|
|
2467
2467
|
}
|
|
2468
2468
|
}
|
|
2469
|
-
const
|
|
2470
|
-
class
|
|
2469
|
+
const q = new j(), Qe = new W(), Je = new W(), et = new j(), tt = new j();
|
|
2470
|
+
class Zs {
|
|
2471
2471
|
/**
|
|
2472
2472
|
* Constructs a new CSS2D renderer.
|
|
2473
2473
|
*
|
|
@@ -2476,71 +2476,71 @@ class Ys {
|
|
|
2476
2476
|
constructor(e = {}) {
|
|
2477
2477
|
const t = this;
|
|
2478
2478
|
let s, i, r, o;
|
|
2479
|
-
const
|
|
2479
|
+
const n = {
|
|
2480
2480
|
objects: /* @__PURE__ */ new WeakMap()
|
|
2481
|
-
},
|
|
2482
|
-
|
|
2481
|
+
}, l = e.element !== void 0 ? e.element : document.createElement("div");
|
|
2482
|
+
l.style.overflow = "hidden", this.domElement = l, this.getSize = function() {
|
|
2483
2483
|
return {
|
|
2484
2484
|
width: s,
|
|
2485
2485
|
height: i
|
|
2486
2486
|
};
|
|
2487
2487
|
}, this.render = function(m, u) {
|
|
2488
|
-
m.matrixWorldAutoUpdate === !0 && m.updateMatrixWorld(), u.parent === null && u.matrixWorldAutoUpdate === !0 && u.updateMatrixWorld(),
|
|
2488
|
+
m.matrixWorldAutoUpdate === !0 && m.updateMatrixWorld(), u.parent === null && u.matrixWorldAutoUpdate === !0 && u.updateMatrixWorld(), Qe.copy(u.matrixWorldInverse), Je.multiplyMatrices(u.projectionMatrix, Qe), _(m, m, u), y(m);
|
|
2489
2489
|
}, this.setSize = function(m, u) {
|
|
2490
|
-
s = m, i = u, r = s / 2, o = i / 2,
|
|
2490
|
+
s = m, i = u, r = s / 2, o = i / 2, l.style.width = m + "px", l.style.height = u + "px";
|
|
2491
2491
|
};
|
|
2492
2492
|
function d(m) {
|
|
2493
2493
|
m.isCSS2DObject && (m.element.style.display = "none");
|
|
2494
|
-
for (let u = 0,
|
|
2494
|
+
for (let u = 0, f = m.children.length; u < f; u++)
|
|
2495
2495
|
d(m.children[u]);
|
|
2496
2496
|
}
|
|
2497
|
-
function
|
|
2497
|
+
function _(m, u, f) {
|
|
2498
2498
|
if (m.visible === !1) {
|
|
2499
2499
|
d(m);
|
|
2500
2500
|
return;
|
|
2501
2501
|
}
|
|
2502
2502
|
if (m.isCSS2DObject) {
|
|
2503
|
-
|
|
2504
|
-
const
|
|
2505
|
-
|
|
2506
|
-
const
|
|
2507
|
-
distanceToCameraSquared: p(
|
|
2503
|
+
q.setFromMatrixPosition(m.matrixWorld), q.applyMatrix4(Je);
|
|
2504
|
+
const a = q.z >= -1 && q.z <= 1 && m.layers.test(f.layers) === !0, g = m.element;
|
|
2505
|
+
g.style.display = a === !0 ? "" : "none", a === !0 && (m.onBeforeRender(t, u, f), g.style.transform = "translate(" + -100 * m.center.x + "%," + -100 * m.center.y + "%)translate(" + (q.x * r + r) + "px," + (-q.y * o + o) + "px)", g.parentNode !== l && l.appendChild(g), m.onAfterRender(t, u, f));
|
|
2506
|
+
const C = {
|
|
2507
|
+
distanceToCameraSquared: p(f, m)
|
|
2508
2508
|
};
|
|
2509
|
-
|
|
2509
|
+
n.objects.set(m, C);
|
|
2510
2510
|
}
|
|
2511
|
-
for (let
|
|
2512
|
-
|
|
2511
|
+
for (let a = 0, g = m.children.length; a < g; a++)
|
|
2512
|
+
_(m.children[a], u, f);
|
|
2513
2513
|
}
|
|
2514
2514
|
function p(m, u) {
|
|
2515
|
-
return
|
|
2515
|
+
return et.setFromMatrixPosition(m.matrixWorld), tt.setFromMatrixPosition(u.matrixWorld), et.distanceToSquared(tt);
|
|
2516
2516
|
}
|
|
2517
|
-
function
|
|
2517
|
+
function E(m) {
|
|
2518
2518
|
const u = [];
|
|
2519
|
-
return m.traverseVisible(function(
|
|
2520
|
-
|
|
2519
|
+
return m.traverseVisible(function(f) {
|
|
2520
|
+
f.isCSS2DObject && u.push(f);
|
|
2521
2521
|
}), u;
|
|
2522
2522
|
}
|
|
2523
|
-
function
|
|
2524
|
-
const u =
|
|
2525
|
-
if (
|
|
2526
|
-
return
|
|
2527
|
-
const
|
|
2528
|
-
return
|
|
2529
|
-
}),
|
|
2530
|
-
for (let
|
|
2531
|
-
u[
|
|
2523
|
+
function y(m) {
|
|
2524
|
+
const u = E(m).sort(function(a, g) {
|
|
2525
|
+
if (a.renderOrder !== g.renderOrder)
|
|
2526
|
+
return g.renderOrder - a.renderOrder;
|
|
2527
|
+
const C = n.objects.get(a).distanceToCameraSquared, v = n.objects.get(g).distanceToCameraSquared;
|
|
2528
|
+
return C - v;
|
|
2529
|
+
}), f = u.length;
|
|
2530
|
+
for (let a = 0, g = u.length; a < g; a++)
|
|
2531
|
+
u[a].element.style.zIndex = f - a;
|
|
2532
2532
|
}
|
|
2533
2533
|
}
|
|
2534
2534
|
}
|
|
2535
|
-
const
|
|
2535
|
+
const st = {
|
|
2536
2536
|
zIndex: "auto"
|
|
2537
2537
|
};
|
|
2538
|
-
class
|
|
2538
|
+
class Ws {
|
|
2539
2539
|
constructor(e) {
|
|
2540
2540
|
this.container = e;
|
|
2541
2541
|
}
|
|
2542
2542
|
addRenderer(e, t) {
|
|
2543
|
-
const s = t.container || this.container, i = s.offsetWidth, r = s.offsetHeight, o = e === "css2d" ? new
|
|
2543
|
+
const s = t.container || this.container, i = s.offsetWidth, r = s.offsetHeight, o = e === "css2d" ? new Zs() : new Ys();
|
|
2544
2544
|
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);
|
|
2545
2545
|
}
|
|
2546
2546
|
setSize(e, t) {
|
|
@@ -2556,7 +2556,7 @@ class Zs {
|
|
|
2556
2556
|
(e = this.css2Drenderer) == null || e.domElement.remove(), (t = this.css3Drenderer) == null || t.domElement.remove(), this.css2Drenderer = void 0, this.css3Drenderer = void 0;
|
|
2557
2557
|
}
|
|
2558
2558
|
}
|
|
2559
|
-
const
|
|
2559
|
+
const Gs = {
|
|
2560
2560
|
name: "OutputShader",
|
|
2561
2561
|
uniforms: {
|
|
2562
2562
|
tDiffuse: { value: null },
|
|
@@ -2650,24 +2650,24 @@ const Ws = {
|
|
|
2650
2650
|
}`
|
|
2651
2651
|
)
|
|
2652
2652
|
};
|
|
2653
|
-
class
|
|
2653
|
+
class Ks extends _s {
|
|
2654
2654
|
constructor() {
|
|
2655
2655
|
super();
|
|
2656
|
-
const e =
|
|
2657
|
-
this.uniforms =
|
|
2656
|
+
const e = Gs;
|
|
2657
|
+
this.uniforms = Gt.clone(e.uniforms), this.material = new Kt({
|
|
2658
2658
|
name: e.name,
|
|
2659
2659
|
uniforms: this.uniforms,
|
|
2660
2660
|
vertexShader: e.vertexShader,
|
|
2661
2661
|
fragmentShader: e.fragmentShader
|
|
2662
|
-
}), this.fsQuad ? this.fsQuad = new
|
|
2662
|
+
}), this.fsQuad ? this.fsQuad = new Fe(this.material) : this._fsQuad && (this._fsQuad = new Fe(this.material));
|
|
2663
2663
|
}
|
|
2664
2664
|
}
|
|
2665
|
-
const
|
|
2666
|
-
const e = new
|
|
2667
|
-
new
|
|
2665
|
+
const Xs = (h) => {
|
|
2666
|
+
const e = new gs(
|
|
2667
|
+
new Xt({
|
|
2668
2668
|
uniforms: {
|
|
2669
2669
|
baseTexture: { value: null },
|
|
2670
|
-
bloomTexture: { value:
|
|
2670
|
+
bloomTexture: { value: h.renderTarget2.texture },
|
|
2671
2671
|
bloomAlphaType: { value: 0 }
|
|
2672
2672
|
},
|
|
2673
2673
|
vertexShader: `
|
|
@@ -2698,36 +2698,36 @@ const Ks = (l) => {
|
|
|
2698
2698
|
"baseTexture"
|
|
2699
2699
|
);
|
|
2700
2700
|
return e.needsSwap = !0, e;
|
|
2701
|
-
},
|
|
2701
|
+
}, Le = 1, me = !1, $s = new $t({ color: "black" }), qs = new ct({
|
|
2702
2702
|
color: "black",
|
|
2703
2703
|
sizeAttenuation: !1
|
|
2704
|
-
}),
|
|
2704
|
+
}), Qs = new ct({
|
|
2705
2705
|
color: "black",
|
|
2706
2706
|
sizeAttenuation: !0
|
|
2707
|
-
}),
|
|
2707
|
+
}), Js = new dt({
|
|
2708
2708
|
color: "black",
|
|
2709
2709
|
sizeAttenuation: !0
|
|
2710
|
-
}),
|
|
2710
|
+
}), ei = new dt({
|
|
2711
2711
|
color: "black",
|
|
2712
2712
|
sizeAttenuation: !1
|
|
2713
|
-
}),
|
|
2713
|
+
}), ti = new ut({
|
|
2714
2714
|
color: "black",
|
|
2715
2715
|
sizeAttenuation: 0,
|
|
2716
2716
|
lineWidth: 0
|
|
2717
|
-
}),
|
|
2717
|
+
}), si = {
|
|
2718
2718
|
kernelRadius: 8,
|
|
2719
2719
|
minDistance: 5e-3,
|
|
2720
2720
|
maxDistance: 0.1
|
|
2721
|
-
},
|
|
2721
|
+
}, ii = {
|
|
2722
2722
|
threshold: 0,
|
|
2723
2723
|
strength: 0.4,
|
|
2724
2724
|
radius: 0.1,
|
|
2725
2725
|
bloomAlphaType: 0
|
|
2726
|
-
},
|
|
2726
|
+
}, ri = {
|
|
2727
2727
|
multisampling: 4,
|
|
2728
2728
|
premultiplieAlpha: !1
|
|
2729
2729
|
};
|
|
2730
|
-
class
|
|
2730
|
+
class oi {
|
|
2731
2731
|
constructor(e) {
|
|
2732
2732
|
this.bloomComposerActive = !1, this.active = !0, this.bloomSelection = /* @__PURE__ */ new Set(), this.bloomLayer = new qt(), this.bloomMaterials = {}, this.bloomVisible = {}, this.pipViewportState = null, this.options = e;
|
|
2733
2733
|
const {
|
|
@@ -2737,20 +2737,20 @@ class ri {
|
|
|
2737
2737
|
composerParams: r
|
|
2738
2738
|
} = e, { renderer: o } = t;
|
|
2739
2739
|
this.renderer = o;
|
|
2740
|
-
const { multisampling:
|
|
2740
|
+
const { multisampling: n } = r, { maxSamples: l } = o.capabilities, d = o.getDrawingBufferSize(new B()), _ = new Qt(
|
|
2741
2741
|
d.width,
|
|
2742
2742
|
d.height,
|
|
2743
2743
|
{
|
|
2744
|
-
samples: Math.min(
|
|
2745
|
-
type:
|
|
2744
|
+
samples: Math.min(n, l),
|
|
2745
|
+
type: Jt
|
|
2746
2746
|
}
|
|
2747
|
-
), p = new
|
|
2748
|
-
p.setSize(
|
|
2749
|
-
const
|
|
2747
|
+
), p = new ke(o, _), E = this.getSize();
|
|
2748
|
+
p.setSize(E.width, E.height);
|
|
2749
|
+
const y = new us(
|
|
2750
2750
|
s.scene,
|
|
2751
2751
|
i.camera
|
|
2752
2752
|
);
|
|
2753
|
-
p.addPass(
|
|
2753
|
+
p.addPass(y), this.scene = s.scene, this.camera = i.camera, this.finalComposer = p, this.renderPass = y, i.event.on("pageChange", (m) => {
|
|
2754
2754
|
this.changeCamera(m);
|
|
2755
2755
|
}), s.event.on("pageChange", (m) => {
|
|
2756
2756
|
this.changeScene(m);
|
|
@@ -2763,28 +2763,28 @@ class ri {
|
|
|
2763
2763
|
this.renderPass.scene = e, this.ssaoPass && (this.ssaoPass.scene = e), this.scene = e;
|
|
2764
2764
|
}
|
|
2765
2765
|
addOutputPass() {
|
|
2766
|
-
const { premultiplieAlpha: e } = this.options.composerParams, t = new
|
|
2766
|
+
const { premultiplieAlpha: e } = this.options.composerParams, t = new Ks();
|
|
2767
2767
|
this.outputPass = t, this.setPremultiplieAlpha(e), this.finalComposer.addPass(t);
|
|
2768
2768
|
}
|
|
2769
2769
|
setPremultiplieAlpha(e) {
|
|
2770
2770
|
this.outputPass && (this.outputPass.uniforms.premultiplieAlpha.value = e ? 1 : 0);
|
|
2771
2771
|
}
|
|
2772
2772
|
addSSAOPass(e) {
|
|
2773
|
-
const { scene: t, camera: s, renderer: i } = this, r = i.getSize(new
|
|
2774
|
-
|
|
2773
|
+
const { scene: t, camera: s, renderer: i } = this, r = i.getSize(new B()), o = r.width, n = r.height, l = new fs(t, s, o, n);
|
|
2774
|
+
l.kernelRadius = e.kernelRadius, l.minDistance = e.minDistance, l.maxDistance = e.maxDistance, this.ssaoPass = l, this.finalComposer.addPass(l);
|
|
2775
2775
|
}
|
|
2776
2776
|
addBloomPass(e) {
|
|
2777
|
-
const { renderer: t } = this, { threshold: s, strength: i, radius: r, bloomAlphaType: o } = e,
|
|
2778
|
-
new
|
|
2777
|
+
const { renderer: t } = this, { threshold: s, strength: i, radius: r, bloomAlphaType: o } = e, n = new ys(
|
|
2778
|
+
new B(window.innerWidth, window.innerHeight),
|
|
2779
2779
|
i,
|
|
2780
2780
|
r,
|
|
2781
2781
|
s
|
|
2782
2782
|
);
|
|
2783
|
-
this.bloomPass =
|
|
2784
|
-
const
|
|
2785
|
-
|
|
2786
|
-
const d =
|
|
2787
|
-
d.uniforms.bloomAlphaType.value = o, this.bloomComposer =
|
|
2783
|
+
this.bloomPass = n;
|
|
2784
|
+
const l = new ke(t);
|
|
2785
|
+
l.renderToScreen = !1, l.addPass(this.renderPass), l.addPass(n), this.bloomComposer = l;
|
|
2786
|
+
const d = Xs(l);
|
|
2787
|
+
d.uniforms.bloomAlphaType.value = o, this.bloomComposer = l, this.finalComposer.addPass(d), this.mixPass = d, this.bloomLayer.set(Le);
|
|
2788
2788
|
}
|
|
2789
2789
|
setBloomSelection(e, t) {
|
|
2790
2790
|
if (!this.bloomComposer) {
|
|
@@ -2793,7 +2793,7 @@ class ri {
|
|
|
2793
2793
|
}
|
|
2794
2794
|
e.traverse((s) => {
|
|
2795
2795
|
const { object3d: i } = s;
|
|
2796
|
-
i && (t ? (this.bloomSelection.add(s), i.layers.enable(
|
|
2796
|
+
i && (t ? (this.bloomSelection.add(s), i.layers.enable(Le)) : (this.bloomSelection.delete(s), i.layers.disable(Le)));
|
|
2797
2797
|
}), this.bloomSelection.size === 0 ? this.bloomComposerActive = !1 : this.bloomComposerActive = !0;
|
|
2798
2798
|
}
|
|
2799
2799
|
enable() {
|
|
@@ -2816,9 +2816,9 @@ class ri {
|
|
|
2816
2816
|
s.isTransformControls || s.isTransformControlsRoot || s.type === "RectAreaLightHelper" ? e.push(s) : t.push(s);
|
|
2817
2817
|
}), t.forEach((s) => {
|
|
2818
2818
|
s.traverse((i) => {
|
|
2819
|
-
var
|
|
2820
|
-
const r = i, o = i,
|
|
2821
|
-
(
|
|
2819
|
+
var l;
|
|
2820
|
+
const r = i, o = i, n = i;
|
|
2821
|
+
(l = r.material) != null && l.isShadowMaterial ? e.push(r) : r.material && this.bloomLayer.test(r.layers) === !1 && (this.bloomMaterials[r.uuid] = r.material, o.isSprite ? o.material.sizeAttenuation ? o.material = Js : o.material = ei : r.material instanceof ut ? r.material = ti : n.isPoints ? n.material.sizeAttenuation ? n.material = Qs : n.material = qs : r.material = $s);
|
|
2822
2822
|
});
|
|
2823
2823
|
}), e.forEach((s) => {
|
|
2824
2824
|
this.bloomVisible[s.uuid] = s.visible, s.visible = !1;
|
|
@@ -2834,7 +2834,7 @@ class ri {
|
|
|
2834
2834
|
this.bloomComposerActive && this.bloomComposer ? (this.mixPass.enabled = !0, this.darkenNonBloomed(), this.bloomComposer.render(), this.restoreNonBloomed()) : this.mixPass && (this.mixPass.enabled = !1), this.finalComposer.render();
|
|
2835
2835
|
}
|
|
2836
2836
|
getSize() {
|
|
2837
|
-
return this.renderer.getSize(new
|
|
2837
|
+
return this.renderer.getSize(new B());
|
|
2838
2838
|
}
|
|
2839
2839
|
render() {
|
|
2840
2840
|
if (!this.active) return;
|
|
@@ -2842,7 +2842,7 @@ class ri {
|
|
|
2842
2842
|
if (this.finalComposerRender(), this.pipViewportState) {
|
|
2843
2843
|
e.setPageActive(31), e.setAspect(
|
|
2844
2844
|
this.pipViewportState.width / this.pipViewportState.height
|
|
2845
|
-
), t.setViewport(
|
|
2845
|
+
), t.setViewport(te(U({}, this.pipViewportState), {
|
|
2846
2846
|
scissor: !0,
|
|
2847
2847
|
scissorTest: !0
|
|
2848
2848
|
})), this.finalComposerRender(), e.setPageActive(s.activeIndex);
|
|
@@ -2862,7 +2862,7 @@ class ri {
|
|
|
2862
2862
|
this.bloomMaterials = {}, this.bloomVisible = {}, this.bloomSelection.clear(), this.finalComposer.dispose(), (e = this.bloomComposer) == null || e.dispose();
|
|
2863
2863
|
}
|
|
2864
2864
|
}
|
|
2865
|
-
class
|
|
2865
|
+
class it extends pt {
|
|
2866
2866
|
constructor(e) {
|
|
2867
2867
|
super(e), this.options = { type: "image" };
|
|
2868
2868
|
}
|
|
@@ -2871,22 +2871,22 @@ class st extends dt {
|
|
|
2871
2871
|
}
|
|
2872
2872
|
load(e, t, s, i) {
|
|
2873
2873
|
let r, o;
|
|
2874
|
-
this.options.type === "image" ? (o = document.createElement("img"), r = new fe(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
|
|
2875
|
-
const
|
|
2876
|
-
return
|
|
2874
|
+
this.options.type === "image" ? (o = document.createElement("img"), r = new fe(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 mt(o)) : r = new fe();
|
|
2875
|
+
const n = new Se(this.manager);
|
|
2876
|
+
return n.setResponseType("blob"), n.setRequestHeader(this.requestHeader), n.setPath(this.path), n.setWithCredentials(this.withCredentials), n.load(
|
|
2877
2877
|
e,
|
|
2878
|
-
(
|
|
2879
|
-
let d =
|
|
2880
|
-
const
|
|
2881
|
-
d = d.slice(0,
|
|
2882
|
-
const
|
|
2883
|
-
o.removeEventListener("load",
|
|
2884
|
-
},
|
|
2885
|
-
|
|
2886
|
-
}, m = (
|
|
2887
|
-
|
|
2878
|
+
(l) => {
|
|
2879
|
+
let d = l;
|
|
2880
|
+
const _ = e.split(".").pop(), p = this.options.type === "image" ? `image/${_ || "png"}` : `video/${_ || "mp4"}`;
|
|
2881
|
+
d = d.slice(0, l.size, p);
|
|
2882
|
+
const E = () => {
|
|
2883
|
+
o.removeEventListener("load", y, !1), o.removeEventListener("error", m, !1);
|
|
2884
|
+
}, y = () => {
|
|
2885
|
+
E(), r.needsUpdate = !0, t && t(r);
|
|
2886
|
+
}, m = (f) => {
|
|
2887
|
+
E(), i && i(f), this.manager.itemError(e), this.manager.itemEnd(e);
|
|
2888
2888
|
};
|
|
2889
|
-
o.addEventListener("load",
|
|
2889
|
+
o.addEventListener("load", y, !1), o.addEventListener("error", m, !1);
|
|
2890
2890
|
const u = window.URL.createObjectURL(d);
|
|
2891
2891
|
o.src = u;
|
|
2892
2892
|
},
|
|
@@ -2895,16 +2895,16 @@ class st extends dt {
|
|
|
2895
2895
|
), r;
|
|
2896
2896
|
}
|
|
2897
2897
|
}
|
|
2898
|
-
class
|
|
2898
|
+
class ni extends pt {
|
|
2899
2899
|
constructor(e) {
|
|
2900
2900
|
super(e);
|
|
2901
2901
|
}
|
|
2902
2902
|
load(e, t, s, i) {
|
|
2903
|
-
const r = new
|
|
2903
|
+
const r = new Se(this.manager);
|
|
2904
2904
|
r.setResponseType("blob"), r.setRequestHeader(this.requestHeader), r.setPath(this.path), r.setWithCredentials(this.withCredentials), r.load(
|
|
2905
2905
|
e,
|
|
2906
2906
|
(o) => {
|
|
2907
|
-
const
|
|
2907
|
+
const n = o, l = new DecompressionStream("gzip"), d = n.stream().pipeThrough(l);
|
|
2908
2908
|
new Response(d).json().then((p) => {
|
|
2909
2909
|
t == null || t(p);
|
|
2910
2910
|
}).catch((p) => {
|
|
@@ -2916,7 +2916,7 @@ class oi extends dt {
|
|
|
2916
2916
|
);
|
|
2917
2917
|
}
|
|
2918
2918
|
}
|
|
2919
|
-
const
|
|
2919
|
+
const ai = {
|
|
2920
2920
|
images: ["png", "jpg", "jpeg", "ico", "webp", "avif"],
|
|
2921
2921
|
media: ["mp4", "webm", "ogg"],
|
|
2922
2922
|
gltf: ["gltf", "glb"],
|
|
@@ -2925,12 +2925,12 @@ const ni = {
|
|
|
2925
2925
|
exr: ["exr"],
|
|
2926
2926
|
lottie: ["lottie.json"]
|
|
2927
2927
|
};
|
|
2928
|
-
class
|
|
2928
|
+
class li {
|
|
2929
2929
|
constructor(e) {
|
|
2930
|
-
this.loadObj = [], this.delLoadArr = [], this.assets = /* @__PURE__ */ new Map(), this.event = new
|
|
2930
|
+
this.loadObj = [], this.delLoadArr = [], this.assets = /* @__PURE__ */ new Map(), this.event = new ye.EventEmitter(), this.options = U({
|
|
2931
2931
|
simpleTexture4deleted: !1,
|
|
2932
2932
|
prefix: ""
|
|
2933
|
-
}, e), this.loadingManager = new
|
|
2933
|
+
}, e), this.loadingManager = new es(
|
|
2934
2934
|
() => {
|
|
2935
2935
|
},
|
|
2936
2936
|
(t, s, i) => {
|
|
@@ -2968,27 +2968,27 @@ class ai {
|
|
|
2968
2968
|
if (e.endsWith("json.gzip"))
|
|
2969
2969
|
return "gzipJson";
|
|
2970
2970
|
} else return;
|
|
2971
|
-
for (const [i, r] of Object.entries(
|
|
2971
|
+
for (const [i, r] of Object.entries(ai))
|
|
2972
2972
|
if (r.includes(t))
|
|
2973
2973
|
return i;
|
|
2974
2974
|
}
|
|
2975
2975
|
getLoader(e, t) {
|
|
2976
2976
|
if (e === "images")
|
|
2977
|
-
return this.textureLoader || (this.textureLoader = new
|
|
2977
|
+
return this.textureLoader || (this.textureLoader = new it(this.loadingManager), this.options.prefix && this.textureLoader.setPath(this.options.prefix)), this.textureLoader;
|
|
2978
2978
|
if (e === "media")
|
|
2979
|
-
return this.videoTextureLoader || (this.videoTextureLoader = new
|
|
2979
|
+
return this.videoTextureLoader || (this.videoTextureLoader = new it(this.loadingManager), this.videoTextureLoader.setOptions({ type: "video" }), this.options.prefix && this.videoTextureLoader.setPath(this.options.prefix)), this.videoTextureLoader;
|
|
2980
2980
|
if (e === "gltf" && (t != null && t.dracoPath))
|
|
2981
|
-
return this.dracoGltfLoader || (this.dracoGltfLoader = new
|
|
2981
|
+
return this.dracoGltfLoader || (this.dracoGltfLoader = new Ne(this.loadingManager), this.dracoLoader = new vs(), 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;
|
|
2982
2982
|
if (e === "gltf")
|
|
2983
|
-
return this.gltfLoader || (this.gltfLoader = new
|
|
2983
|
+
return this.gltfLoader || (this.gltfLoader = new Ne(this.loadingManager), this.options.prefix && this.gltfLoader.setPath(this.options.prefix)), this.gltfLoader;
|
|
2984
2984
|
if (e === "lottie")
|
|
2985
|
-
return this.lottieLoader || (this.lottieLoader = new
|
|
2985
|
+
return this.lottieLoader || (this.lottieLoader = new Es(this.loadingManager), this.options.prefix && this.lottieLoader.setPath(this.options.prefix)), this.lottieLoader;
|
|
2986
2986
|
if (e === "gzipJson")
|
|
2987
|
-
return this.gzipJsonLoader || (this.gzipJsonLoader = new
|
|
2987
|
+
return this.gzipJsonLoader || (this.gzipJsonLoader = new ni(this.loadingManager), this.options.prefix && this.gzipJsonLoader.setPath(this.options.prefix)), this.gzipJsonLoader;
|
|
2988
2988
|
if (e === "json")
|
|
2989
|
-
return this.jsonLoader || (this.jsonLoader = new
|
|
2989
|
+
return this.jsonLoader || (this.jsonLoader = new Se(this.loadingManager), this.jsonLoader.setResponseType("json"), this.options.prefix && this.jsonLoader.setPath(this.options.prefix)), this.jsonLoader;
|
|
2990
2990
|
if (e === "exr")
|
|
2991
|
-
return this.exrLoader || (this.exrLoader = new
|
|
2991
|
+
return this.exrLoader || (this.exrLoader = new Cs(this.loadingManager), this.options.prefix && this.exrLoader.setPath(this.options.prefix)), this.exrLoader;
|
|
2992
2992
|
}
|
|
2993
2993
|
add(e, t) {
|
|
2994
2994
|
typeof e == "string" && (e = [e]), e.forEach((s) => {
|
|
@@ -3007,11 +3007,11 @@ class ai {
|
|
|
3007
3007
|
get textureAssets() {
|
|
3008
3008
|
const e = /* @__PURE__ */ new Map();
|
|
3009
3009
|
return this.assets.forEach((t, s) => {
|
|
3010
|
-
(t instanceof fe || t instanceof
|
|
3010
|
+
(t instanceof fe || t instanceof ts || t instanceof mt) && e.set(s, t);
|
|
3011
3011
|
}), e;
|
|
3012
3012
|
}
|
|
3013
3013
|
loadAll() {
|
|
3014
|
-
return
|
|
3014
|
+
return se(this, null, function* () {
|
|
3015
3015
|
const e = this.loadObj.filter((t) => !this.delLoadArr.includes(t.src));
|
|
3016
3016
|
return yield Promise.all(
|
|
3017
3017
|
e.map((t) => this.load(t.src, t))
|
|
@@ -3019,12 +3019,12 @@ class ai {
|
|
|
3019
3019
|
});
|
|
3020
3020
|
}
|
|
3021
3021
|
load(e, t) {
|
|
3022
|
-
return
|
|
3023
|
-
var
|
|
3024
|
-
const s = (
|
|
3022
|
+
return se(this, null, function* () {
|
|
3023
|
+
var n, l;
|
|
3024
|
+
const s = (n = t == null ? void 0 : t.type) != null ? n : this.getAssetType(e);
|
|
3025
3025
|
if (!s)
|
|
3026
3026
|
return;
|
|
3027
|
-
const i = (t == null ? void 0 : t.cache) !== !1, r =
|
|
3027
|
+
const i = (t == null ? void 0 : t.cache) !== !1, r = Os();
|
|
3028
3028
|
if (i) {
|
|
3029
3029
|
if (this.assets.has(e))
|
|
3030
3030
|
return this.assets.get(e);
|
|
@@ -3034,9 +3034,9 @@ class ai {
|
|
|
3034
3034
|
try {
|
|
3035
3035
|
const d = yield o.loadAsync(e);
|
|
3036
3036
|
if (this.assets.set(e, d), r.resolve(d), s === "images" || s === "media" || s === "exr" || s === "lottie") {
|
|
3037
|
-
(t == null ? void 0 : t.colorCorrection) !== !1 &&
|
|
3038
|
-
const
|
|
3039
|
-
d.anisotropy =
|
|
3037
|
+
(t == null ? void 0 : t.colorCorrection) !== !1 && ls({ texture: d });
|
|
3038
|
+
const _ = (l = t == null ? void 0 : t.anisotropy) != null ? l : this.options.anisotropy;
|
|
3039
|
+
d.anisotropy = _;
|
|
3040
3040
|
}
|
|
3041
3041
|
return d;
|
|
3042
3042
|
} catch (d) {
|
|
@@ -3052,18 +3052,18 @@ class ai {
|
|
|
3052
3052
|
const t = /* @__PURE__ */ new Set(), s = this.textureAssets;
|
|
3053
3053
|
e.traverse((r) => {
|
|
3054
3054
|
const o = r;
|
|
3055
|
-
o.material && (Array.isArray(o.material) ? o.material : [o.material]).forEach((
|
|
3055
|
+
o.material && (Array.isArray(o.material) ? o.material : [o.material]).forEach((l) => {
|
|
3056
3056
|
[
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3057
|
+
l.map,
|
|
3058
|
+
l.emissiveMap,
|
|
3059
|
+
l.normalMap,
|
|
3060
|
+
l.roughnessMap,
|
|
3061
|
+
l.metalnessMap,
|
|
3062
|
+
l.aoMap
|
|
3063
3063
|
].forEach((d) => {
|
|
3064
3064
|
if (d) {
|
|
3065
|
-
const
|
|
3066
|
-
|
|
3065
|
+
const _ = this.getSrcByAsset(d, s);
|
|
3066
|
+
_ && t.add(_);
|
|
3067
3067
|
}
|
|
3068
3068
|
});
|
|
3069
3069
|
});
|
|
@@ -3081,7 +3081,7 @@ class ai {
|
|
|
3081
3081
|
const hi = {
|
|
3082
3082
|
prefix: ""
|
|
3083
3083
|
};
|
|
3084
|
-
class
|
|
3084
|
+
class ci extends ee {
|
|
3085
3085
|
get loader() {
|
|
3086
3086
|
return this.controller;
|
|
3087
3087
|
}
|
|
@@ -3089,7 +3089,7 @@ class li extends ae {
|
|
|
3089
3089
|
super(), this.options = e;
|
|
3090
3090
|
}
|
|
3091
3091
|
addLoader(e, t) {
|
|
3092
|
-
const { loaderParams: s } = this.options, i = new
|
|
3092
|
+
const { loaderParams: s } = this.options, i = new li(te(U({}, s), {
|
|
3093
3093
|
scene: e
|
|
3094
3094
|
}));
|
|
3095
3095
|
return this.addController(i, t);
|
|
@@ -3100,24 +3100,24 @@ class li extends ae {
|
|
|
3100
3100
|
});
|
|
3101
3101
|
}
|
|
3102
3102
|
}
|
|
3103
|
-
class
|
|
3103
|
+
class di extends cs {
|
|
3104
3104
|
constructor(e) {
|
|
3105
3105
|
super(), this.options = U({}, e);
|
|
3106
3106
|
}
|
|
3107
3107
|
create() {
|
|
3108
3108
|
var e;
|
|
3109
|
-
this.object3d = (e = this.options.scene) != null ? e : new
|
|
3109
|
+
this.object3d = (e = this.options.scene) != null ? e : new nt();
|
|
3110
3110
|
}
|
|
3111
3111
|
}
|
|
3112
|
-
function
|
|
3112
|
+
function rt(h) {
|
|
3113
3113
|
let e = !1, t = [];
|
|
3114
3114
|
return function(...s) {
|
|
3115
3115
|
t = s, e || (e = !0, requestAnimationFrame(() => {
|
|
3116
|
-
e = !1,
|
|
3116
|
+
e = !1, h(...t);
|
|
3117
3117
|
}));
|
|
3118
3118
|
};
|
|
3119
3119
|
}
|
|
3120
|
-
class
|
|
3120
|
+
class pi {
|
|
3121
3121
|
constructor(e) {
|
|
3122
3122
|
var t;
|
|
3123
3123
|
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.prevActiveObjects = /* @__PURE__ */ new Set(), this.objCallbackMap = /* @__PURE__ */ new Map(), this.pickListener = {
|
|
@@ -3127,33 +3127,33 @@ class di {
|
|
|
3127
3127
|
}
|
|
3128
3128
|
addPickListener(e) {
|
|
3129
3129
|
const t = /* @__PURE__ */ new Set(["move", "enter", "leave"]), s = /* @__PURE__ */ new Set(["down", "downOutside", "click"]), i = (r) => {
|
|
3130
|
-
var
|
|
3130
|
+
var y;
|
|
3131
3131
|
if (!this.enabled)
|
|
3132
3132
|
return;
|
|
3133
3133
|
r.preventDefault();
|
|
3134
|
-
const o = e === "move" ? t : s,
|
|
3134
|
+
const o = e === "move" ? t : s, n = [];
|
|
3135
3135
|
if (this.pickFunctionsMap.forEach((m) => {
|
|
3136
|
-
o.has(m.type) &&
|
|
3136
|
+
o.has(m.type) && n.push(te(U({}, m), {
|
|
3137
3137
|
objArr: m.objArr instanceof Function ? m.objArr() : m.objArr
|
|
3138
3138
|
}));
|
|
3139
|
-
}),
|
|
3139
|
+
}), n.length === 0) return;
|
|
3140
3140
|
this.activeObjects.clear(), this.objCallbackMap.clear();
|
|
3141
|
-
const
|
|
3142
|
-
for (const m of
|
|
3141
|
+
const l = this.objCallbackMap, d = [];
|
|
3142
|
+
for (const m of n)
|
|
3143
3143
|
for (const u of m.objArr) {
|
|
3144
3144
|
if (!u.object3d || !u.visibleWithAncestors) continue;
|
|
3145
|
-
|
|
3146
|
-
const
|
|
3147
|
-
|
|
3145
|
+
l.has(u) || (l.set(u, /* @__PURE__ */ new Map()), d.push(u));
|
|
3146
|
+
const f = l.get(u);
|
|
3147
|
+
f.has(m.type) || f.set(m.type, []), f.get(m.type).push(m.cb);
|
|
3148
3148
|
}
|
|
3149
3149
|
if (d.length === 0) return;
|
|
3150
|
-
const
|
|
3151
|
-
|
|
3150
|
+
const _ = d.map((m) => m.object3d);
|
|
3151
|
+
_.forEach((m) => {
|
|
3152
3152
|
m.isGroup && m.traverse((u) => {
|
|
3153
|
-
u instanceof
|
|
3153
|
+
u instanceof ss && _.push(u);
|
|
3154
3154
|
});
|
|
3155
3155
|
});
|
|
3156
|
-
const p = (
|
|
3156
|
+
const p = (y = this.pencil.pick(r, _, !1)) == null ? void 0 : y.intersects;
|
|
3157
3157
|
if (!p || p.length === 0)
|
|
3158
3158
|
e === "down" ? this.handleDownOutside(r) : e === "move" && this.handleLeaveEvents(r);
|
|
3159
3159
|
else {
|
|
@@ -3161,12 +3161,12 @@ class di {
|
|
|
3161
3161
|
const m = p[0];
|
|
3162
3162
|
this.processIntersection(m, r, e);
|
|
3163
3163
|
}
|
|
3164
|
-
const
|
|
3165
|
-
this.prevActiveObjects = this.activeObjects, this.activeObjects =
|
|
3164
|
+
const E = this.prevActiveObjects;
|
|
3165
|
+
this.prevActiveObjects = this.activeObjects, this.activeObjects = E, this.activeObjects.clear();
|
|
3166
3166
|
};
|
|
3167
3167
|
this.domElement.addEventListener(
|
|
3168
3168
|
`pointer${e}`,
|
|
3169
|
-
|
|
3169
|
+
rt(i),
|
|
3170
3170
|
{ passive: !1 }
|
|
3171
3171
|
);
|
|
3172
3172
|
}
|
|
@@ -3177,8 +3177,8 @@ class di {
|
|
|
3177
3177
|
const i = this.objCallbackMap, r = e.index || -1;
|
|
3178
3178
|
let o = e.object;
|
|
3179
3179
|
for (; o; ) {
|
|
3180
|
-
const
|
|
3181
|
-
|
|
3180
|
+
const n = this.pencil.lead.objMap.get(o);
|
|
3181
|
+
n && i.has(n) && this.activeObjects.add(n), o = o.parent;
|
|
3182
3182
|
}
|
|
3183
3183
|
s === "move" ? this.handleLeaveEvents(t) : s === "down" && this.handleDownOutside(t), this.processObjectHierarchy(t, s, r);
|
|
3184
3184
|
}
|
|
@@ -3188,48 +3188,48 @@ class di {
|
|
|
3188
3188
|
const o = () => {
|
|
3189
3189
|
r = !0;
|
|
3190
3190
|
};
|
|
3191
|
-
for (const
|
|
3191
|
+
for (const n of this.activeObjects) {
|
|
3192
3192
|
if (r) break;
|
|
3193
|
-
const
|
|
3194
|
-
if (
|
|
3193
|
+
const l = i.get(n);
|
|
3194
|
+
if (l)
|
|
3195
3195
|
if (t === "move") {
|
|
3196
|
-
const d =
|
|
3197
|
-
if (d && !this.prevActiveObjects.has(
|
|
3196
|
+
const d = l.get("enter");
|
|
3197
|
+
if (d && !this.prevActiveObjects.has(n))
|
|
3198
3198
|
for (const p of d)
|
|
3199
3199
|
p({
|
|
3200
|
-
baseObject:
|
|
3200
|
+
baseObject: n,
|
|
3201
3201
|
mouseEvent: e,
|
|
3202
3202
|
sp: o,
|
|
3203
3203
|
intersectionIndex: s
|
|
3204
3204
|
});
|
|
3205
|
-
const
|
|
3206
|
-
if (
|
|
3207
|
-
for (const p of
|
|
3205
|
+
const _ = l.get("move");
|
|
3206
|
+
if (_)
|
|
3207
|
+
for (const p of _)
|
|
3208
3208
|
p({
|
|
3209
|
-
baseObject:
|
|
3209
|
+
baseObject: n,
|
|
3210
3210
|
mouseEvent: e,
|
|
3211
3211
|
sp: o,
|
|
3212
3212
|
intersectionIndex: s
|
|
3213
3213
|
});
|
|
3214
3214
|
} else {
|
|
3215
|
-
const d =
|
|
3215
|
+
const d = l.get("down");
|
|
3216
3216
|
if (d)
|
|
3217
3217
|
for (const p of d)
|
|
3218
3218
|
p({
|
|
3219
|
-
baseObject:
|
|
3219
|
+
baseObject: n,
|
|
3220
3220
|
mouseEvent: e,
|
|
3221
3221
|
sp: o,
|
|
3222
3222
|
intersectionIndex: s
|
|
3223
3223
|
});
|
|
3224
|
-
const
|
|
3225
|
-
if (
|
|
3226
|
-
const p = (
|
|
3227
|
-
|
|
3228
|
-
const
|
|
3229
|
-
if (!r && Math.abs(
|
|
3230
|
-
for (const m of
|
|
3224
|
+
const _ = l.get("click");
|
|
3225
|
+
if (_) {
|
|
3226
|
+
const p = (E) => {
|
|
3227
|
+
E.preventDefault();
|
|
3228
|
+
const y = 5;
|
|
3229
|
+
if (!r && Math.abs(E.clientX - e.clientX) <= y && Math.abs(E.clientY - e.clientY) <= y)
|
|
3230
|
+
for (const m of _)
|
|
3231
3231
|
m({
|
|
3232
|
-
baseObject:
|
|
3232
|
+
baseObject: n,
|
|
3233
3233
|
mouseEvent: e,
|
|
3234
3234
|
sp: o,
|
|
3235
3235
|
intersectionIndex: s
|
|
@@ -3268,9 +3268,9 @@ class di {
|
|
|
3268
3268
|
i === "mousemove" ? i = "move" : i === "mouseenter" ? i = "enter" : i === "mouseleave" && (i = "leave"), this.pickFunctionsMapIndex += 1;
|
|
3269
3269
|
const r = this.pickFunctionsMapIndex;
|
|
3270
3270
|
return this.pickFunctionsMap.set(r, { objArr: e, type: i, cb: s }), this.pickListener.move || Array.from(this.pickFunctionsMap.values()).some(
|
|
3271
|
-
(
|
|
3271
|
+
(n) => ["move", "enter", "leave"].includes(n.type)
|
|
3272
3272
|
) && (this.pickListener.move = !0, this.addPickListener("move")), this.pickListener.down || Array.from(this.pickFunctionsMap.values()).some(
|
|
3273
|
-
(
|
|
3273
|
+
(n) => ["down", "downOutside", "click"].includes(n.type)
|
|
3274
3274
|
) && (this.pickListener.down = !0, this.addPickListener("down")), r;
|
|
3275
3275
|
}
|
|
3276
3276
|
removePick(e) {
|
|
@@ -3281,16 +3281,16 @@ class di {
|
|
|
3281
3281
|
return console.warn("handlePickNode:err:不支持 downOutside"), -1;
|
|
3282
3282
|
this.pickNodeFunctionsMapIndex += 1;
|
|
3283
3283
|
const i = this.pickNodeFunctionsMapIndex, r = e instanceof Function ? e() : e, o = [];
|
|
3284
|
-
for (const
|
|
3285
|
-
const
|
|
3286
|
-
|
|
3284
|
+
for (const n of r) {
|
|
3285
|
+
const l = n;
|
|
3286
|
+
l.element.style.pointerEvents = "auto";
|
|
3287
3287
|
const d = (p) => {
|
|
3288
3288
|
this.enabled && (p.preventDefault(), s({
|
|
3289
|
-
baseObject:
|
|
3289
|
+
baseObject: l,
|
|
3290
3290
|
mouseEvent: p
|
|
3291
3291
|
}));
|
|
3292
|
-
},
|
|
3293
|
-
|
|
3292
|
+
}, _ = `pointer${t}`;
|
|
3293
|
+
l.element.addEventListener(_, rt(d), !1), o.push({ arr: l, type: _, listener: d });
|
|
3294
3294
|
}
|
|
3295
3295
|
return this.pickNodeFunctionsMap.set(i, o), i;
|
|
3296
3296
|
}
|
|
@@ -3310,11 +3310,11 @@ class di {
|
|
|
3310
3310
|
this.pickFunctionsMap.clear(), this.pickNodeFunctionsMap.clear(), this.activeObjects.clear(), this.prevActiveObjects.clear(), this.objCallbackMap.clear();
|
|
3311
3311
|
}
|
|
3312
3312
|
}
|
|
3313
|
-
class
|
|
3313
|
+
class mi extends pi {
|
|
3314
3314
|
constructor(e, t) {
|
|
3315
|
-
super(e), this.objMap = /* @__PURE__ */ new Map(), this.objects = /* @__PURE__ */ new Map(), this.objectsPm = /* @__PURE__ */ new Map(), this.objectNamesToFactories = /* @__PURE__ */ new Map(), this.scene = new
|
|
3315
|
+
super(e), this.objMap = /* @__PURE__ */ new Map(), this.objects = /* @__PURE__ */ new Map(), this.objectsPm = /* @__PURE__ */ new Map(), this.objectNamesToFactories = /* @__PURE__ */ new Map(), this.scene = new di({
|
|
3316
3316
|
scene: t.scene
|
|
3317
|
-
}), this.scene.create(), this.scene.lead = this, this.scene.pencil = e, this.scene.key = "Scene", this.scene.object3d.name = "场景", this.group = new
|
|
3317
|
+
}), this.mList = t.mList, this.scene.create(), this.scene.lead = this, this.scene.pencil = e, this.scene.mList = this.mList, this.scene.key = "Scene", this.scene.object3d.name = "场景", this.group = new ze(), this.group.create(), this.group.lead = this, this.group.pencil = e, this.group.mList = this.mList, this.group.key = "@Group", this.group.object3d.name = "物体组", this.prefabGroup = new ze(), this.prefabGroup.create(), this.prefabGroup.lead = this, this.prefabGroup.pencil = e, this.prefabGroup.mList = this.mList, this.prefabGroup.key = "@PrefabGroup", this.prefabGroup.object3d.name = "预制组", this.scene.add(this.group.object3d, this.prefabGroup.object3d), this.objects.set("@Scene", this.scene), this.objects.set("@Group", this.group), this.objects.set("@PrefabGroup", this.prefabGroup), this.objMap.set(this.scene.object3d, this.scene), this.objMap.set(this.group.object3d, this.group), this.objMap.set(this.prefabGroup.object3d, this.prefabGroup);
|
|
3318
3318
|
}
|
|
3319
3319
|
get objectsPromise() {
|
|
3320
3320
|
return this.objectsPm.values();
|
|
@@ -3337,29 +3337,29 @@ class pi extends di {
|
|
|
3337
3337
|
getAllObject(e, t) {
|
|
3338
3338
|
e.includes("#") && console.warn("getAllObject:err:不支持 #", e);
|
|
3339
3339
|
const { key: s } = t || {}, i = `${e}${s ? `#${s}` : ""}`, r = [];
|
|
3340
|
-
return this.objects.forEach((o,
|
|
3341
|
-
(
|
|
3340
|
+
return this.objects.forEach((o, n) => {
|
|
3341
|
+
(n.startsWith(s ? i : `${i}#`) || n === i) && r.push(o);
|
|
3342
3342
|
}), r;
|
|
3343
3343
|
}
|
|
3344
3344
|
draw(e, t, s) {
|
|
3345
|
-
return
|
|
3346
|
-
var r, o,
|
|
3345
|
+
return se(this, null, function* () {
|
|
3346
|
+
var r, o, n, l;
|
|
3347
3347
|
const i = this.objectNamesToFactories.get(e);
|
|
3348
3348
|
if (i) {
|
|
3349
3349
|
t || (t = {}), t.target === void 0 && (t.target = s);
|
|
3350
|
-
const d = t.target,
|
|
3350
|
+
const d = t.target, _ = (r = t.onTop) != null ? r : 0, p = (o = t.prefab) != null ? o : !1, E = (n = t.create) != null ? n : !0, y = new i().create(t);
|
|
3351
3351
|
let m;
|
|
3352
|
-
return d === null ? m = null : typeof d == "string" ? m = this.objects.get(d) : (
|
|
3353
|
-
} :
|
|
3354
|
-
|
|
3355
|
-
}),
|
|
3356
|
-
|
|
3352
|
+
return d === null ? m = null : typeof d == "string" ? m = this.objects.get(d) : (l = d == null ? void 0 : d.objectType) != null && l.startsWith("BaseObject") || d ? m = d : p ? m = this.prefabGroup : m = this.group, E === !1 ? y.create = () => {
|
|
3353
|
+
} : E !== !0 && (y.create = () => {
|
|
3354
|
+
E(y);
|
|
3355
|
+
}), y.pencil = this.pencil, y.lead = this, y.mList = this.mList, y.prefab = p, y.objectType = `BaseObject#${e}`, y.objectOptions = t, this.setBaseObjectKey(
|
|
3356
|
+
y,
|
|
3357
3357
|
t.key ? `$t:#${t.key}` : "$t:",
|
|
3358
3358
|
m == null ? void 0 : m.key
|
|
3359
3359
|
), this.objectsPm.set(
|
|
3360
|
-
|
|
3361
|
-
this.addBaseObject(
|
|
3362
|
-
), yield this.objectsPm.get(
|
|
3360
|
+
y.key,
|
|
3361
|
+
this.addBaseObject(y, m, _)
|
|
3362
|
+
), yield this.objectsPm.get(y.key), this.objectsPm.delete(y.key), y;
|
|
3363
3363
|
}
|
|
3364
3364
|
throw new Error(`Unrecognized:${e}`);
|
|
3365
3365
|
});
|
|
@@ -3368,17 +3368,17 @@ class pi extends di {
|
|
|
3368
3368
|
const i = e.objectType, [, r] = i.split("#");
|
|
3369
3369
|
let o = t.replace("$t:", r);
|
|
3370
3370
|
if (s) {
|
|
3371
|
-
const [,
|
|
3372
|
-
o = o.replace("$p:",
|
|
3371
|
+
const [, n] = s.split("#");
|
|
3372
|
+
o = o.replace("$p:", n);
|
|
3373
3373
|
}
|
|
3374
|
-
return this.objects.has(o) && (o.includes("#") ? o += `-${
|
|
3374
|
+
return this.objects.has(o) && (o.includes("#") ? o += `-${He()}` : o += `#${He()}`), e.key = o, this.objects.set(o, e), o;
|
|
3375
3375
|
}
|
|
3376
3376
|
updateBaseObjectKey(e, t) {
|
|
3377
3377
|
var o;
|
|
3378
3378
|
let s;
|
|
3379
|
-
for (const [
|
|
3380
|
-
if (
|
|
3381
|
-
s =
|
|
3379
|
+
for (const [n, l] of this.objects.entries())
|
|
3380
|
+
if (l === e) {
|
|
3381
|
+
s = n;
|
|
3382
3382
|
break;
|
|
3383
3383
|
}
|
|
3384
3384
|
const i = (o = e.parent) == null ? void 0 : o.key;
|
|
@@ -3389,28 +3389,22 @@ class pi extends di {
|
|
|
3389
3389
|
return this.pencil.event.emit("updateKey", e, r, s), r;
|
|
3390
3390
|
}
|
|
3391
3391
|
addBaseObject(e, t, s) {
|
|
3392
|
-
return
|
|
3393
|
-
yield e.create(), e.object3d && (s && e.setTop(s), t !== null && (t.add(e.object3d), this.objMap.set(e.object3d, e))), e.render(), this.pencil.event.emit("draw", e);
|
|
3392
|
+
return se(this, null, function* () {
|
|
3393
|
+
yield e.create(), e.object3d && (this.mList.proxyBaseObject(e), this.mList.addByBaseObject(e), s && e.setTop(s), t !== null && (t.add(e.object3d), this.objMap.set(e.object3d, e))), e.render(), this.pencil.event.emit("draw", e);
|
|
3394
3394
|
});
|
|
3395
3395
|
}
|
|
3396
3396
|
erase(...e) {
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
handleErase(e, ...t) {
|
|
3403
|
-
[...t].forEach((s) => {
|
|
3404
|
-
const i = [];
|
|
3405
|
-
if (typeof s == "string") {
|
|
3406
|
-
const [r, o] = s.split("#");
|
|
3407
|
-
i.push(...this.getAllObject(r, { key: o }));
|
|
3397
|
+
[...e].forEach((t) => {
|
|
3398
|
+
const s = [];
|
|
3399
|
+
if (typeof t == "string") {
|
|
3400
|
+
const [i, r] = t.split("#");
|
|
3401
|
+
s.push(...this.getAllObject(i, { key: r }));
|
|
3408
3402
|
} else
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3403
|
+
s.push(t);
|
|
3404
|
+
s.forEach((i) => {
|
|
3405
|
+
i.dispose();
|
|
3412
3406
|
});
|
|
3413
|
-
});
|
|
3407
|
+
}), this.pencil.event.emit("erase", ...e);
|
|
3414
3408
|
}
|
|
3415
3409
|
update(e, t) {
|
|
3416
3410
|
this.objects.forEach((s) => {
|
|
@@ -3433,18 +3427,19 @@ class pi extends di {
|
|
|
3433
3427
|
}), this.objects.clear(), this.objectsPm.clear(), this.objMap.clear(), this.objectNamesToFactories.clear();
|
|
3434
3428
|
}
|
|
3435
3429
|
}
|
|
3436
|
-
class
|
|
3430
|
+
class ui extends ee {
|
|
3437
3431
|
get lead() {
|
|
3438
3432
|
return this.controller;
|
|
3439
3433
|
}
|
|
3440
3434
|
constructor(e) {
|
|
3441
3435
|
super(), this.options = e;
|
|
3442
3436
|
}
|
|
3443
|
-
addLead(e, t) {
|
|
3444
|
-
const { pencil:
|
|
3445
|
-
scene: e
|
|
3437
|
+
addLead(e, t, s) {
|
|
3438
|
+
const { pencil: i } = this.options, r = new mi(i, {
|
|
3439
|
+
scene: e,
|
|
3440
|
+
mList: t
|
|
3446
3441
|
});
|
|
3447
|
-
return this.addController(
|
|
3442
|
+
return this.addController(r, s);
|
|
3448
3443
|
}
|
|
3449
3444
|
removePage(e) {
|
|
3450
3445
|
super.removePage(e, (t) => {
|
|
@@ -3462,11 +3457,143 @@ class mi extends ae {
|
|
|
3462
3457
|
});
|
|
3463
3458
|
}
|
|
3464
3459
|
}
|
|
3460
|
+
class fi {
|
|
3461
|
+
constructor(e) {
|
|
3462
|
+
this.materials = /* @__PURE__ */ new Map(), this.materialBaseObjectMap = /* @__PURE__ */ new Map(), this.fixBufferGeometry = new is(), this.pencil = e;
|
|
3463
|
+
}
|
|
3464
|
+
add(e, t, s) {
|
|
3465
|
+
if (this.getKey(t) || this.materials.set(e, t), s) {
|
|
3466
|
+
const i = this.materialBaseObjectMap.get(t);
|
|
3467
|
+
i && !i.includes(s) ? i.push(s) : this.materialBaseObjectMap.set(t, [s]);
|
|
3468
|
+
}
|
|
3469
|
+
this.emitObject3dChange();
|
|
3470
|
+
}
|
|
3471
|
+
get(e) {
|
|
3472
|
+
const t = this.materials.get(e);
|
|
3473
|
+
return t || console.warn(`Material with key "${e}" not found.`), t;
|
|
3474
|
+
}
|
|
3475
|
+
getKey(e) {
|
|
3476
|
+
for (const [t, s] of this.materials.entries())
|
|
3477
|
+
if (s === e)
|
|
3478
|
+
return t;
|
|
3479
|
+
}
|
|
3480
|
+
addMultiple(e, t) {
|
|
3481
|
+
for (const [s, i] of Object.entries(t)) {
|
|
3482
|
+
const r = `${e}#${s}`;
|
|
3483
|
+
i && this.add(r, i);
|
|
3484
|
+
}
|
|
3485
|
+
}
|
|
3486
|
+
getMultiple(e) {
|
|
3487
|
+
const t = {}, s = `${e}#`;
|
|
3488
|
+
let i = !1;
|
|
3489
|
+
for (const [r, o] of this.materials.entries())
|
|
3490
|
+
if (r.startsWith(s)) {
|
|
3491
|
+
const n = r.substring(s.length);
|
|
3492
|
+
t[n] = o, i = !0;
|
|
3493
|
+
}
|
|
3494
|
+
return i ? t : null;
|
|
3495
|
+
}
|
|
3496
|
+
copyMultiple(e, t) {
|
|
3497
|
+
const s = {}, i = `${e}#`;
|
|
3498
|
+
for (const [r, o] of this.materials.entries())
|
|
3499
|
+
if (r.startsWith(i)) {
|
|
3500
|
+
const n = r.substring(i.length), l = o.clone();
|
|
3501
|
+
s[n] = l;
|
|
3502
|
+
const d = `${t}#${n}`;
|
|
3503
|
+
this.add(d, l);
|
|
3504
|
+
}
|
|
3505
|
+
return s;
|
|
3506
|
+
}
|
|
3507
|
+
disposeMaterial(e) {
|
|
3508
|
+
const t = new Pe();
|
|
3509
|
+
t.track([e]), t.dispose();
|
|
3510
|
+
}
|
|
3511
|
+
remove(e) {
|
|
3512
|
+
const t = this.materials.get(e);
|
|
3513
|
+
t && (this.materialBaseObjectMap.delete(t), this.disposeMaterial(t)), this.materials.delete(e), this.emitObject3dChange();
|
|
3514
|
+
}
|
|
3515
|
+
removeByMaterial(e) {
|
|
3516
|
+
[...this.materials.entries()].some(([t, s]) => s === e ? (this.remove(t), !0) : !1);
|
|
3517
|
+
}
|
|
3518
|
+
proxyBaseObject(e) {
|
|
3519
|
+
const t = e.object3d, s = (i) => new Proxy(i, {
|
|
3520
|
+
set: (r, o, n) => {
|
|
3521
|
+
if (typeof o == "string" && !isNaN(Number(o))) {
|
|
3522
|
+
const l = Number(o);
|
|
3523
|
+
if (l >= 0 && l < r.length) {
|
|
3524
|
+
const d = r[l];
|
|
3525
|
+
return this.rmBaseObjectMap(e, d), r[l] = n, this.addByBaseObject(e), !0;
|
|
3526
|
+
}
|
|
3527
|
+
}
|
|
3528
|
+
return Reflect.set(r, o, n);
|
|
3529
|
+
}
|
|
3530
|
+
});
|
|
3531
|
+
e.object3d = new Proxy(t, {
|
|
3532
|
+
set: (i, r, o) => r === "material" ? (this.rmBaseObjectMap(e), Array.isArray(o) ? i.material = s(o) : i.material = o, this.addByBaseObject(e), !0) : Reflect.set(i, r, o),
|
|
3533
|
+
get: (i, r) => {
|
|
3534
|
+
if (r === "material") {
|
|
3535
|
+
const o = i.material;
|
|
3536
|
+
if (Array.isArray(o) && !o.hasOwnProperty("__isProxy")) {
|
|
3537
|
+
const n = s(o);
|
|
3538
|
+
Object.defineProperty(n, "__isProxy", {
|
|
3539
|
+
value: !0,
|
|
3540
|
+
enumerable: !1
|
|
3541
|
+
}), i.material = n;
|
|
3542
|
+
}
|
|
3543
|
+
}
|
|
3544
|
+
return Reflect.get(i, r);
|
|
3545
|
+
}
|
|
3546
|
+
});
|
|
3547
|
+
}
|
|
3548
|
+
addByBaseObject(e) {
|
|
3549
|
+
const t = e.object3d;
|
|
3550
|
+
t.material && (Array.isArray(t.material) ? t.material : [t.material]).forEach((i) => {
|
|
3551
|
+
this.add(i.uuid, i, e);
|
|
3552
|
+
});
|
|
3553
|
+
}
|
|
3554
|
+
rmBaseObjectMap(e, t) {
|
|
3555
|
+
this.materialBaseObjectMap.forEach((s, i) => {
|
|
3556
|
+
if (t && i !== t)
|
|
3557
|
+
return;
|
|
3558
|
+
const r = s.indexOf(e);
|
|
3559
|
+
r !== -1 && (s.splice(r, 1), s.length === 0 && (this.materialBaseObjectMap.delete(i), this.disposeMaterial(i)));
|
|
3560
|
+
});
|
|
3561
|
+
}
|
|
3562
|
+
getBaseObjectByMaterial(e) {
|
|
3563
|
+
const t = this.materialBaseObjectMap.get(e);
|
|
3564
|
+
return t || null;
|
|
3565
|
+
}
|
|
3566
|
+
emitObject3dChange() {
|
|
3567
|
+
var e;
|
|
3568
|
+
(e = this.pencil) == null || e.event.emit("baseObjectListChange");
|
|
3569
|
+
}
|
|
3570
|
+
dispose() {
|
|
3571
|
+
const e = new Pe();
|
|
3572
|
+
e.track([...this.materials.values()]), e.dispose(), this.fixBufferGeometry.dispose(), this.materials.clear(), this.materialBaseObjectMap.clear();
|
|
3573
|
+
}
|
|
3574
|
+
}
|
|
3575
|
+
class _i extends ee {
|
|
3576
|
+
get mList() {
|
|
3577
|
+
return this.controller;
|
|
3578
|
+
}
|
|
3579
|
+
constructor(e) {
|
|
3580
|
+
super(), this.options = e;
|
|
3581
|
+
}
|
|
3582
|
+
addMList(e, t) {
|
|
3583
|
+
const { pencil: s } = this.options, i = new fi(s);
|
|
3584
|
+
return this.addController(i, t);
|
|
3585
|
+
}
|
|
3586
|
+
removePage(e) {
|
|
3587
|
+
super.removePage(e, (t) => {
|
|
3588
|
+
t.dispose();
|
|
3589
|
+
});
|
|
3590
|
+
}
|
|
3591
|
+
}
|
|
3465
3592
|
const _e = class _e {
|
|
3466
3593
|
constructor(e) {
|
|
3467
3594
|
var r, o;
|
|
3468
|
-
this.raycaster = new ht(), this.maxBackufferArea = 5760 * 5760, this.installPlugins = /* @__PURE__ */ new Map(), this._cameraPositon = new
|
|
3469
|
-
isMergeableObject:
|
|
3595
|
+
this.raycaster = new ht(), 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 rs(), this.userData = {}, this.pageActiveIndex = 0, this.pageCountIndex = 0, this.userSetDprCache = 1, this.event.setMaxListeners(1 / 0), (o = (r = this.timer).connect) == null || o.call(r, document), this.options = os(_e.options, e, {
|
|
3596
|
+
isMergeableObject: hs
|
|
3470
3597
|
}), this.userSetDprCache = this.options.renderer.devicePixelRatio;
|
|
3471
3598
|
const {
|
|
3472
3599
|
container: t,
|
|
@@ -3474,10 +3601,10 @@ const _e = class _e {
|
|
|
3474
3601
|
transformControls: i
|
|
3475
3602
|
} = this.options;
|
|
3476
3603
|
if (this.init(), this.options.WebGPUTHREE || this.initComposer(), this.initCSSRenderer(), i && this.initTransformControls(), s) {
|
|
3477
|
-
const
|
|
3604
|
+
const n = new ns({
|
|
3478
3605
|
horizontal: !1
|
|
3479
3606
|
});
|
|
3480
|
-
|
|
3607
|
+
n.dom.style.position = "absolute", n.init(this.renderer), t.appendChild(n.dom), this.stats = n;
|
|
3481
3608
|
}
|
|
3482
3609
|
this.initResizeObserver(), this.tweenUpdateRaf();
|
|
3483
3610
|
}
|
|
@@ -3511,6 +3638,9 @@ const _e = class _e {
|
|
|
3511
3638
|
get lead() {
|
|
3512
3639
|
return this.leadController.lead;
|
|
3513
3640
|
}
|
|
3641
|
+
get mList() {
|
|
3642
|
+
return this.mListController.mList;
|
|
3643
|
+
}
|
|
3514
3644
|
tweenUpdateRaf() {
|
|
3515
3645
|
Ce.update(), this.TweenRaf = requestAnimationFrame(this.tweenUpdateRaf.bind(this));
|
|
3516
3646
|
}
|
|
@@ -3525,19 +3655,21 @@ const _e = class _e {
|
|
|
3525
3655
|
t,
|
|
3526
3656
|
s
|
|
3527
3657
|
), r = this.sceneController.addScene(e, s);
|
|
3528
|
-
|
|
3658
|
+
r.add(i), this.controlsController.addCameraControls(i, s), this.loaderController.addLoader(r, s);
|
|
3659
|
+
const o = this.mListController.addMList(null, s);
|
|
3660
|
+
return this.leadController.addLead(r, o, s), this.pageCountIndex = s, s;
|
|
3529
3661
|
}
|
|
3530
3662
|
removePage(e) {
|
|
3531
|
-
this.cameraController.removePage(e), this.sceneController.removePage(e), this.controlsController.removePage(e), this.loaderController.removePage(e), this.leadController.removePage(e), this.pageCountIndex === e && (this.pageCountIndex -= 1), this.pageActiveIndex === e && (this.render(), this.showPage(0));
|
|
3663
|
+
this.cameraController.removePage(e), this.sceneController.removePage(e), this.controlsController.removePage(e), this.loaderController.removePage(e), this.mListController.removePage(e), this.leadController.removePage(e), this.pageCountIndex === e && (this.pageCountIndex -= 1), this.pageActiveIndex === e && (this.render(), this.showPage(0));
|
|
3532
3664
|
}
|
|
3533
3665
|
showPage(e) {
|
|
3534
3666
|
var s;
|
|
3535
3667
|
if (e === this.pageActiveIndex) return;
|
|
3536
3668
|
const t = this.scene;
|
|
3537
|
-
this.sceneController.setPageActive(e), t && ((s = this.cssRendererController) == null || s.render(t, this.camera)), this.cameraController.setPageActive(e), this.controlsController.setPageActive(e), this.loaderController.setPageActive(e), this.leadController.setPageActive(e), this.pageActiveIndex = e;
|
|
3669
|
+
this.sceneController.setPageActive(e), t && ((s = this.cssRendererController) == null || s.render(t, this.camera)), this.cameraController.setPageActive(e), this.controlsController.setPageActive(e), this.loaderController.setPageActive(e), this.mListController.setPageActive(e), this.leadController.setPageActive(e), this.pageActiveIndex = e;
|
|
3538
3670
|
}
|
|
3539
3671
|
init() {
|
|
3540
|
-
var
|
|
3672
|
+
var g;
|
|
3541
3673
|
const {
|
|
3542
3674
|
container: e,
|
|
3543
3675
|
WebGPUTHREE: t,
|
|
@@ -3545,46 +3677,48 @@ const _e = class _e {
|
|
|
3545
3677
|
viewHelper: i,
|
|
3546
3678
|
renderer: r,
|
|
3547
3679
|
controls: o,
|
|
3548
|
-
loader:
|
|
3549
|
-
} = this.options, { width:
|
|
3550
|
-
width:
|
|
3680
|
+
loader: n
|
|
3681
|
+
} = this.options, { width: l, height: d } = this.getSize(), _ = t ? new Us({
|
|
3682
|
+
width: l,
|
|
3551
3683
|
height: d,
|
|
3552
3684
|
renderer: t.WebGPURenderer,
|
|
3553
3685
|
rendererParams: Ds
|
|
3554
|
-
}) : new
|
|
3555
|
-
width:
|
|
3686
|
+
}) : new Rs({
|
|
3687
|
+
width: l,
|
|
3556
3688
|
height: d,
|
|
3557
|
-
rendererParams:
|
|
3689
|
+
rendererParams: te(U({}, r), {
|
|
3558
3690
|
antialias: !1
|
|
3559
3691
|
})
|
|
3560
|
-
}), p = new
|
|
3561
|
-
width:
|
|
3692
|
+
}), p = new ks({
|
|
3693
|
+
width: l,
|
|
3562
3694
|
height: d
|
|
3563
|
-
}),
|
|
3695
|
+
}), E = new Ns({}), y = new js({
|
|
3564
3696
|
controlsParams: {
|
|
3565
|
-
domElement: (
|
|
3697
|
+
domElement: (g = o == null ? void 0 : o.domElement) != null ? g : _.renderer.domElement
|
|
3566
3698
|
}
|
|
3567
|
-
}), m = new
|
|
3699
|
+
}), m = new ci({
|
|
3568
3700
|
loaderParams: U({
|
|
3569
|
-
anisotropy:
|
|
3570
|
-
},
|
|
3571
|
-
}), u = new
|
|
3701
|
+
anisotropy: _.renderer.capabilities.getMaxAnisotropy()
|
|
3702
|
+
}, n)
|
|
3703
|
+
}), u = new _i({
|
|
3704
|
+
pencil: this
|
|
3705
|
+
}), f = new ui({
|
|
3572
3706
|
pencil: this
|
|
3573
3707
|
});
|
|
3574
|
-
this.sceneController =
|
|
3575
|
-
const
|
|
3708
|
+
this.sceneController = E, this.cameraController = p, this.controlsController = y, this.rendererController = _, this.loaderController = m, this.mListController = u, this.leadController = f;
|
|
3709
|
+
const a = this.addPage({
|
|
3576
3710
|
sceneOptions: this.options.scene,
|
|
3577
3711
|
cameraOptions: this.options.camera
|
|
3578
3712
|
});
|
|
3579
|
-
if (this.showPage(
|
|
3580
|
-
const
|
|
3713
|
+
if (this.showPage(a), s) {
|
|
3714
|
+
const C = new Hs({
|
|
3581
3715
|
container: e,
|
|
3582
|
-
sceneController:
|
|
3716
|
+
sceneController: E,
|
|
3583
3717
|
cameraController: p
|
|
3584
3718
|
});
|
|
3585
|
-
|
|
3719
|
+
C.add(E.scene), this.helperController = C, i && C.addViewHelper();
|
|
3586
3720
|
}
|
|
3587
|
-
e.appendChild(
|
|
3721
|
+
e.appendChild(_.renderer.domElement);
|
|
3588
3722
|
}
|
|
3589
3723
|
initComposer() {
|
|
3590
3724
|
const {
|
|
@@ -3593,7 +3727,7 @@ const _e = class _e {
|
|
|
3593
3727
|
ssao: s,
|
|
3594
3728
|
ssaoParams: i,
|
|
3595
3729
|
composer: r
|
|
3596
|
-
} = this.options, o = new
|
|
3730
|
+
} = this.options, o = new oi({
|
|
3597
3731
|
rendererController: this.rendererController,
|
|
3598
3732
|
sceneController: this.sceneController,
|
|
3599
3733
|
cameraController: this.cameraController,
|
|
@@ -3610,7 +3744,7 @@ const _e = class _e {
|
|
|
3610
3744
|
css3DRendererParams: r
|
|
3611
3745
|
} = this.options;
|
|
3612
3746
|
if (t || s) {
|
|
3613
|
-
const o = new
|
|
3747
|
+
const o = new Ws(e);
|
|
3614
3748
|
t && o.addRenderer("css2d", i), s && o.addRenderer("css3d", r), this.cssRendererController = o;
|
|
3615
3749
|
}
|
|
3616
3750
|
}
|
|
@@ -3651,16 +3785,16 @@ const _e = class _e {
|
|
|
3651
3785
|
rendererController: i,
|
|
3652
3786
|
cameraController: r,
|
|
3653
3787
|
composerController: o,
|
|
3654
|
-
cssRendererController:
|
|
3655
|
-
leadController:
|
|
3656
|
-
} = this, d = this.renderer.getSize(new
|
|
3657
|
-
d.x === e && d.y === t || (r.setSize(e, t), i.setSize(e, t), o == null || o.setSize(e, t),
|
|
3788
|
+
cssRendererController: n,
|
|
3789
|
+
leadController: l
|
|
3790
|
+
} = this, d = this.renderer.getSize(new B());
|
|
3791
|
+
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), l.setSize(e, t), this.installPlugins.forEach((_) => {
|
|
3658
3792
|
var p;
|
|
3659
|
-
(p =
|
|
3793
|
+
(p = _.setSize) == null || p.call(_, e, t);
|
|
3660
3794
|
}), this.render(), s && this.event.emit("resize", { width: e, height: t }));
|
|
3661
3795
|
}
|
|
3662
3796
|
setDevicePixelRatio(e) {
|
|
3663
|
-
var
|
|
3797
|
+
var n;
|
|
3664
3798
|
this.userSetDprCache = e;
|
|
3665
3799
|
const { width: t, height: s } = this.getSize();
|
|
3666
3800
|
let i = Math.sqrt(this.maxBackufferArea / (t * s));
|
|
@@ -3673,12 +3807,12 @@ const _e = class _e {
|
|
|
3673
3807
|
r
|
|
3674
3808
|
);
|
|
3675
3809
|
const o = this.renderer.getPixelRatio();
|
|
3676
|
-
r !== o && (this.rendererController.setPixelRatio(r), (
|
|
3810
|
+
r !== o && (this.rendererController.setPixelRatio(r), (n = this.composerController) == null || n.setPixelRatio(r));
|
|
3677
3811
|
}
|
|
3678
3812
|
pick(e, t, s = !0) {
|
|
3679
|
-
const { raycaster: i, options: r } = this, { container: o } = r,
|
|
3680
|
-
if (
|
|
3681
|
-
i.setFromCamera(
|
|
3813
|
+
const { raycaster: i, options: r } = this, { container: o } = r, n = new B(), l = o.getBoundingClientRect();
|
|
3814
|
+
if (n.x = (e.clientX - l.left) / (l.right - l.left) * 2 - 1, n.y = -((e.clientY - l.top) / (l.bottom - l.top)) * 2 + 1, this.camera && this.scene) {
|
|
3815
|
+
i.setFromCamera(n, this.camera);
|
|
3682
3816
|
const d = i.intersectObjects(
|
|
3683
3817
|
t || this.scene.children,
|
|
3684
3818
|
s
|
|
@@ -3692,19 +3826,19 @@ const _e = class _e {
|
|
|
3692
3826
|
}
|
|
3693
3827
|
}
|
|
3694
3828
|
render() {
|
|
3695
|
-
var s, i, r, o,
|
|
3829
|
+
var s, i, r, o, n, l;
|
|
3696
3830
|
if (!this.camera || !this.scene)
|
|
3697
3831
|
return;
|
|
3698
3832
|
this.timer.update(), Ce.update();
|
|
3699
3833
|
const e = this.timer.getDelta(), t = this.timer.getElapsed();
|
|
3700
3834
|
this.controlsController.update(e, t), this.leadController.update(e, t), this.installPlugins.forEach((d) => {
|
|
3701
|
-
var
|
|
3702
|
-
(
|
|
3835
|
+
var _;
|
|
3836
|
+
(_ = d.update) == null || _.call(d, e, t);
|
|
3703
3837
|
}), (s = this.helperController) == null || s.update(
|
|
3704
3838
|
e,
|
|
3705
3839
|
this.controlsController,
|
|
3706
3840
|
this.cameraTarget
|
|
3707
|
-
), (i = this.composerController) != null && i.active ? this.composerController.render() : (r = this.rendererController) == null || r.render(this.scene, this.camera), (o = this.helperController) == null || o.renderViewHelper(this.renderer), (
|
|
3841
|
+
), (i = this.composerController) != null && i.active ? this.composerController.render() : (r = this.rendererController) == null || r.render(this.scene, this.camera), (o = this.helperController) == null || o.renderViewHelper(this.renderer), (n = this.cssRendererController) == null || n.render(this.scene, this.camera), (l = this.stats) == null || l.update(), this.event.emit("render", { delta: e, elapsed: t });
|
|
3708
3842
|
}
|
|
3709
3843
|
start() {
|
|
3710
3844
|
window.cancelAnimationFrame(this.TweenRaf), this.renderer.setAnimationLoop(this.render.bind(this)), this.event.emit("start");
|
|
@@ -3742,11 +3876,11 @@ const _e = class _e {
|
|
|
3742
3876
|
}
|
|
3743
3877
|
}
|
|
3744
3878
|
dispose() {
|
|
3745
|
-
var e, t, s, i, r, o,
|
|
3746
|
-
this.stop(), this.timer.dispose(), Ce.removeAll(), this.event.removeAllListeners(), (e = this.resizeObserver) == null || e.unobserve(this.options.container), this.installPlugins.forEach((
|
|
3747
|
-
var
|
|
3748
|
-
(
|
|
3749
|
-
}), (t = this.controlsController) == null || t.dispose(), (s = this.transformController) == null || s.dispose(), (i = this.cssRendererController) == null || i.dispose(), (r = this.sceneController) == null || r.dispose(), (o = this.cameraController) == null || o.dispose(), (
|
|
3879
|
+
var e, t, s, i, r, o, n, l, d, _, p, E, y, m;
|
|
3880
|
+
this.stop(), this.timer.dispose(), Ce.removeAll(), this.event.removeAllListeners(), (e = this.resizeObserver) == null || e.unobserve(this.options.container), this.installPlugins.forEach((u) => {
|
|
3881
|
+
var f;
|
|
3882
|
+
(f = u.dispose) == null || f.call(u);
|
|
3883
|
+
}), (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(), (l = this.composerController) == null || l.dispose(), (d = this.rendererController) == null || d.dispose(), (_ = this.loaderController) == null || _.dispose(), (p = this.leadController) == null || p.dispose(), (E = this.mListController) == null || E.dispose(), this.cssRendererController = void 0, this.installPlugins.clear(), (y = this.stats) == null || y.dom.remove(), (m = this.renderer) == null || m.domElement.remove();
|
|
3750
3884
|
}
|
|
3751
3885
|
};
|
|
3752
3886
|
_e.options = {
|
|
@@ -3755,26 +3889,26 @@ _e.options = {
|
|
|
3755
3889
|
viewHelper: me,
|
|
3756
3890
|
controls: !0,
|
|
3757
3891
|
transformControls: me,
|
|
3758
|
-
renderer:
|
|
3759
|
-
composer:
|
|
3760
|
-
scene:
|
|
3761
|
-
camera:
|
|
3892
|
+
renderer: Ms,
|
|
3893
|
+
composer: ri,
|
|
3894
|
+
scene: Fs,
|
|
3895
|
+
camera: bt,
|
|
3762
3896
|
bloom: !1,
|
|
3763
|
-
bloomParams:
|
|
3897
|
+
bloomParams: ii,
|
|
3764
3898
|
ssao: !1,
|
|
3765
3899
|
loader: hi,
|
|
3766
|
-
ssaoParams:
|
|
3900
|
+
ssaoParams: si,
|
|
3767
3901
|
css2DRenderer: !1,
|
|
3768
|
-
css2DRendererParams: U({},
|
|
3902
|
+
css2DRendererParams: U({}, st),
|
|
3769
3903
|
css3DRenderer: !1,
|
|
3770
|
-
css3DRendererParams: U({},
|
|
3904
|
+
css3DRendererParams: U({}, st)
|
|
3771
3905
|
};
|
|
3772
|
-
let
|
|
3773
|
-
const
|
|
3906
|
+
let ot = _e;
|
|
3907
|
+
const qi = J.ACTION;
|
|
3774
3908
|
export {
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3909
|
+
cs as BaseObject,
|
|
3910
|
+
ot as Pencil,
|
|
3911
|
+
Pe as ResourceTracker,
|
|
3912
|
+
qi as cameraControlsAction,
|
|
3913
|
+
ot as default
|
|
3780
3914
|
};
|