@realsee/five 6.7.0-alpha.11 → 6.7.0-alpha.12
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/docs/assets/hierarchy.js +1 -1
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/five.Camera.html +5 -5
- package/docs/classes/five.Five.html +1 -1
- package/docs/classes/five.InternalWebGLRenderer.html +1 -1
- package/docs/classes/five.Model.html +1 -1
- package/docs/classes/five.ModelScene.html +1 -1
- package/docs/classes/five.NetworkSubscribe.html +1 -1
- package/docs/classes/five.PBMContainer.html +1 -1
- package/docs/classes/five.PBMGroup.html +1 -1
- package/docs/classes/five.PBMMesh.html +1 -1
- package/docs/classes/five.PBMMeshMaterial.html +1 -1
- package/docs/classes/five.PBMPointCloud.html +1 -1
- package/docs/classes/five.PBMPointCloudMaterial.html +1 -1
- package/docs/classes/five.PBMSkinnedMesh.html +1 -1
- package/docs/classes/five.PanoCircleMesh.html +1 -1
- package/docs/classes/five.PanoCircleMeshCustom.html +1 -1
- package/docs/classes/five.PanoCircleMeshSolid.html +1 -1
- package/docs/classes/five.Parameter.html +1 -1
- package/docs/classes/five.Scene.html +1 -1
- package/docs/classes/five.Subscribe.html +1 -1
- package/docs/classes/five.Tile3D.html +1 -1
- package/docs/classes/five.TileNode.html +1 -1
- package/docs/classes/five.TrajectoryNode.html +1 -1
- package/docs/classes/five.WorkResolvedObserver.html +1 -1
- package/docs/classes/gltf-loader.DDSLoader.html +1 -1
- package/docs/classes/gltf-loader.DRACOLoader.html +1 -1
- package/docs/classes/gltf-loader.GLTFLoader.html +1 -1
- package/docs/classes/gltf-loader.GLTFObject.html +1 -1
- package/docs/classes/gltf-loader.THREEGLTFLoader.html +1 -1
- package/docs/classes/line.Line.html +1 -1
- package/docs/classes/line.LineGeometry.html +1 -1
- package/docs/classes/line.LineMaterial.html +1 -1
- package/docs/classes/line.LineSegmentsGeometry.html +1 -1
- package/docs/classes/line.THREE_Line2.html +1 -1
- package/docs/classes/line.THREE_LineSegments2.html +1 -1
- package/docs/classes/plugins.BasePlugin.Controller.html +1 -1
- package/docs/classes/plugins.RoundedBoxGeometry.html +1 -1
- package/docs/classes/sticker.Sticker.html +1 -1
- package/docs/classes/vfx.Airflow.html +1 -1
- package/docs/classes/vfx.Flame.html +1 -1
- package/docs/classes/vfx.Particle.html +1 -1
- package/docs/classes/vfx.ParticleGPU.html +1 -1
- package/docs/classes/vfx.SpotLight.html +1 -1
- package/docs/functions/plugins.DynamicPathLinePlugin.html +1 -0
- package/docs/hierarchy.html +1 -1
- package/docs/interfaces/five.AddableObject.html +1 -1
- package/docs/interfaces/five.AjaxOptions.html +1 -1
- package/docs/interfaces/five.BaseEvent.html +1 -1
- package/docs/interfaces/five.EventCallback.html +1 -1
- package/docs/interfaces/five.GestureEvent.html +1 -1
- package/docs/interfaces/five.ImageOptions.html +1 -1
- package/docs/interfaces/five.IntersectEvent.html +1 -1
- package/docs/interfaces/five.IntersectMesh.html +1 -1
- package/docs/interfaces/five.IntersectMeshInterface.html +1 -1
- package/docs/interfaces/five.Intersection.html +1 -1
- package/docs/interfaces/five.LooseWorkPanorama.html +1 -1
- package/docs/interfaces/five.LooseWorkWithExtrinsics.html +1 -1
- package/docs/interfaces/five.ModeChangeEvent.html +1 -1
- package/docs/interfaces/five.ModelControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.ModelEvent.html +1 -1
- package/docs/interfaces/five.ModelLike.html +1 -1
- package/docs/interfaces/five.ModelSceneEvent.html +1 -1
- package/docs/interfaces/five.MovePanoOptions.html +1 -1
- package/docs/interfaces/five.NetworkAbortError.html +1 -1
- package/docs/interfaces/five.NetworkFirbiddenError.html +1 -1
- package/docs/interfaces/five.NetworkOptions.html +1 -1
- package/docs/interfaces/five.NetworkProxyError.html +1 -1
- package/docs/interfaces/five.NetworkResourceEvent.html +1 -1
- package/docs/interfaces/five.NetworkResponseError.html +1 -1
- package/docs/interfaces/five.NetworkTimeoutError.html +1 -1
- package/docs/interfaces/five.ObjectEvent.html +1 -1
- package/docs/interfaces/five.PBMMaterial.html +1 -1
- package/docs/interfaces/five.PBMMeshMaterialParameters.html +1 -1
- package/docs/interfaces/five.PBMPointCloudMaterialParameters.html +1 -1
- package/docs/interfaces/five.PanoCircleMeshInterface.html +1 -1
- package/docs/interfaces/five.PanoEvent.html +1 -1
- package/docs/interfaces/five.PanoTextureEvent.html +1 -1
- package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.ParameterMaterialValue.html +1 -1
- package/docs/interfaces/five.ParameterTilesetValue.html +1 -1
- package/docs/interfaces/five.ParameterValue.html +1 -1
- package/docs/interfaces/five.Pose.html +1 -1
- package/docs/interfaces/five.RenderEvent.html +1 -1
- package/docs/interfaces/five.ResolvedParameterValue.html +1 -1
- package/docs/interfaces/five.State.html +1 -1
- package/docs/interfaces/five.StateEvent.html +1 -1
- package/docs/interfaces/five.TextureOptions.html +1 -1
- package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.ViewLayer.html +1 -1
- package/docs/interfaces/five.WorkCubeImage.html +1 -1
- package/docs/interfaces/five.WorkImage.html +1 -1
- package/docs/interfaces/five.WorkObserver.html +1 -1
- package/docs/interfaces/five.WorkTile.html +1 -1
- package/docs/interfaces/five.WorksEvent.html +1 -1
- package/docs/interfaces/five.XRControllerEvent.html +1 -1
- package/docs/interfaces/five.XRGestureEvent.html +1 -1
- package/docs/interfaces/five.XRPanoramaControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.XRSessionEvent.html +1 -1
- package/docs/interfaces/plugins.BackgroundPluginController.html +1 -1
- package/docs/interfaces/plugins.BackgroundPluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.BasePlugin.State.html +1 -1
- package/docs/interfaces/plugins.DynamicPathLinePluginController.html +67 -0
- package/docs/interfaces/plugins.DynamicPathLinePluginType.Config.html +22 -0
- package/docs/interfaces/plugins.DynamicPathLinePluginType.EventMap.html +26 -0
- package/docs/interfaces/plugins.DynamicPathLinePluginType.Params.html +6 -0
- package/docs/interfaces/plugins.DynamicPathLinePluginType.PathConfig.html +14 -0
- package/docs/interfaces/plugins.DynamicPathLinePluginType.State.html +10 -0
- package/docs/interfaces/plugins.ItemMaskController.html +1 -1
- package/docs/interfaces/plugins.ItemMaskPluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.ItemMaskPluginType.State.html +1 -1
- package/docs/interfaces/plugins.OrientationPluginController.html +1 -1
- package/docs/interfaces/plugins.OrientationPluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.OrientationPluginType.State.html +1 -1
- package/docs/interfaces/plugins.PanoAnimeController.html +1 -1
- package/docs/interfaces/plugins.PanoAnimePluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.PanoAnimePluginType.State.html +1 -1
- package/docs/interfaces/plugins.PluginTemplateType.EventMap.html +1 -1
- package/docs/interfaces/plugins.PluginTemplateType.State.html +1 -1
- package/docs/interfaces/plugins.TrajectoryController.html +1 -1
- package/docs/interfaces/react.FiveInjectionTypes.html +1 -1
- package/docs/modules/plugins.DynamicPathLinePluginType.html +1 -0
- package/docs/modules/plugins.html +1 -1
- package/docs/types/five.ParseOptions.html +1 -1
- package/docs/types/plugins.BasePlugin.EventMap.html +1 -1
- package/docs/types/plugins.DynamicPathLinePluginType.PluginData.html +3 -0
- package/docs/types/plugins.DynamicPathLinePluginType.ServerData.html +3 -0
- package/docs/types/vue.FiveProviderComponent.html +1 -1
- package/five/index.js +53 -53
- package/five/index.mjs +2720 -2705
- package/gltf-loader/index.js +3 -3
- package/gltf-loader/index.mjs +3 -3
- package/line/index.js +3 -3
- package/line/index.mjs +3 -3
- package/package.json +1 -1
- package/plugins/index.d.ts +235 -0
- package/plugins/index.js +213 -15
- package/plugins/index.mjs +2211 -1396
- package/react/index.js +2 -2
- package/react/index.mjs +2 -2
- package/shader-lib/index.d.ts +24 -1
- package/shader-lib/index.js +14 -13
- package/shader-lib/index.mjs +397 -169
- package/sticker/index.js +3 -3
- package/sticker/index.mjs +3 -3
- package/umd/five-gltf-loader.js +3 -3
- package/umd/five-line.js +3 -3
- package/umd/five-plugins.js +213 -15
- package/umd/five-react.js +2 -2
- package/umd/five-shader-lib.js +14 -13
- package/umd/five-sticker.js +3 -3
- package/umd/five-vfx.js +2 -2
- package/umd/five-vue.js +2 -2
- package/umd/five.js +53 -53
- package/vfx/index.js +2 -2
- package/vfx/index.mjs +2 -2
- package/vue/index.d.ts +1 -1
- package/vue/index.js +2 -2
- package/vue/index.mjs +2 -2
- package/work-downloader/index.js +2 -2
- package/work-downloader/index.mjs +2 -2
package/plugins/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five
|
|
4
|
-
* Generated: 2025/
|
|
5
|
-
* Version: 6.7.0-alpha.
|
|
4
|
+
* Generated: 2025/11/4
|
|
5
|
+
* Version: 6.7.0-alpha.12
|
|
6
6
|
* Terms:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
* Update: July 28, 2021
|
|
@@ -252,268 +252,268 @@
|
|
|
252
252
|
* No amendment to or modification of this Agreement will be binding unless in
|
|
253
253
|
* writing and signed by Realsee. You and Realsee hereto confirm that this
|
|
254
254
|
* Agreement and all related documents shall be drafted in English.
|
|
255
|
-
*/import { Subscribe as
|
|
256
|
-
import * as
|
|
257
|
-
import { EventDispatcher as
|
|
258
|
-
import { BasePlugin as
|
|
259
|
-
function
|
|
260
|
-
return /^https?:\/\/|^\/\//.test(
|
|
255
|
+
*/import { Subscribe as Pn, AnimationFrameLoop as ct, Camera as An, PanoCircleMesh as Sn } from "@realsee/five";
|
|
256
|
+
import * as v from "three";
|
|
257
|
+
import { EventDispatcher as Jt, Vector3 as ye, MOUSE as Me, TOUCH as _e, Spherical as Wt, Quaternion as Xt, Vector2 as Te, Object3D as $t, Matrix4 as Mn } from "three";
|
|
258
|
+
import { BasePlugin as Ct } from "@realsee/five/plugins";
|
|
259
|
+
function _n(h) {
|
|
260
|
+
return /^https?:\/\/|^\/\//.test(h) || /^data:/.test(h);
|
|
261
261
|
}
|
|
262
|
-
function
|
|
263
|
-
return
|
|
262
|
+
function Cn(h, o) {
|
|
263
|
+
return _n(o) ? o : "".concat(h).concat(o);
|
|
264
264
|
}
|
|
265
|
-
var
|
|
266
|
-
(function(
|
|
265
|
+
var Xe;
|
|
266
|
+
(function(h) {
|
|
267
267
|
var o = (
|
|
268
268
|
/** @class */
|
|
269
269
|
(function() {
|
|
270
|
-
function e(
|
|
271
|
-
this.hooks = new
|
|
270
|
+
function e(n, t) {
|
|
271
|
+
this.hooks = new Pn(), this.staticPrefix = "//vr-image-4.realsee-cdn.cn", this.five = n, t != null && t.staticPrefix && (this.staticPrefix = t.staticPrefix);
|
|
272
272
|
}
|
|
273
273
|
return e.prototype.getCurrentState = function() {
|
|
274
274
|
return this.state;
|
|
275
|
-
}, e.prototype.absoluteUrl = function(
|
|
276
|
-
return
|
|
275
|
+
}, e.prototype.absoluteUrl = function(n) {
|
|
276
|
+
return Cn(this.staticPrefix, n);
|
|
277
277
|
}, e;
|
|
278
278
|
})()
|
|
279
279
|
);
|
|
280
|
-
|
|
281
|
-
})(
|
|
282
|
-
var
|
|
283
|
-
return
|
|
284
|
-
e.__proto__ =
|
|
285
|
-
} || function(e,
|
|
286
|
-
for (var t in
|
|
287
|
-
},
|
|
280
|
+
h.Controller = o;
|
|
281
|
+
})(Xe || (Xe = {}));
|
|
282
|
+
var Mt = function(h, o) {
|
|
283
|
+
return Mt = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) {
|
|
284
|
+
e.__proto__ = n;
|
|
285
|
+
} || function(e, n) {
|
|
286
|
+
for (var t in n) Object.prototype.hasOwnProperty.call(n, t) && (e[t] = n[t]);
|
|
287
|
+
}, Mt(h, o);
|
|
288
288
|
};
|
|
289
|
-
function
|
|
289
|
+
function he(h, o) {
|
|
290
290
|
if (typeof o != "function" && o !== null)
|
|
291
291
|
throw new TypeError("Class extends value " + String(o) + " is not a constructor or null");
|
|
292
|
-
|
|
292
|
+
Mt(h, o);
|
|
293
293
|
function e() {
|
|
294
|
-
this.constructor =
|
|
294
|
+
this.constructor = h;
|
|
295
295
|
}
|
|
296
|
-
|
|
296
|
+
h.prototype = o === null ? Object.create(o) : (e.prototype = o.prototype, new e());
|
|
297
297
|
}
|
|
298
|
-
var
|
|
299
|
-
return
|
|
300
|
-
for (var e,
|
|
301
|
-
e = arguments[
|
|
302
|
-
for (var
|
|
298
|
+
var V = function() {
|
|
299
|
+
return V = Object.assign || function(o) {
|
|
300
|
+
for (var e, n = 1, t = arguments.length; n < t; n++) {
|
|
301
|
+
e = arguments[n];
|
|
302
|
+
for (var a in e) Object.prototype.hasOwnProperty.call(e, a) && (o[a] = e[a]);
|
|
303
303
|
}
|
|
304
304
|
return o;
|
|
305
|
-
},
|
|
305
|
+
}, V.apply(this, arguments);
|
|
306
306
|
};
|
|
307
|
-
function
|
|
308
|
-
function t(
|
|
309
|
-
return
|
|
310
|
-
|
|
307
|
+
function Le(h, o, e, n) {
|
|
308
|
+
function t(a) {
|
|
309
|
+
return a instanceof e ? a : new e(function(s) {
|
|
310
|
+
s(a);
|
|
311
311
|
});
|
|
312
312
|
}
|
|
313
|
-
return new (e || (e = Promise))(function(
|
|
314
|
-
function l(
|
|
313
|
+
return new (e || (e = Promise))(function(a, s) {
|
|
314
|
+
function l(g) {
|
|
315
315
|
try {
|
|
316
|
-
|
|
317
|
-
} catch (
|
|
318
|
-
|
|
316
|
+
c(n.next(g));
|
|
317
|
+
} catch (y) {
|
|
318
|
+
s(y);
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
|
-
function g
|
|
321
|
+
function f(g) {
|
|
322
322
|
try {
|
|
323
|
-
|
|
324
|
-
} catch (
|
|
325
|
-
|
|
323
|
+
c(n.throw(g));
|
|
324
|
+
} catch (y) {
|
|
325
|
+
s(y);
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
|
-
function
|
|
329
|
-
|
|
328
|
+
function c(g) {
|
|
329
|
+
g.done ? a(g.value) : t(g.value).then(l, f);
|
|
330
330
|
}
|
|
331
|
-
|
|
331
|
+
c((n = n.apply(h, o || [])).next());
|
|
332
332
|
});
|
|
333
333
|
}
|
|
334
|
-
function
|
|
334
|
+
function De(h, o) {
|
|
335
335
|
var e = { label: 0, sent: function() {
|
|
336
|
-
if (
|
|
337
|
-
return
|
|
338
|
-
}, trys: [], ops: [] },
|
|
339
|
-
return
|
|
336
|
+
if (a[0] & 1) throw a[1];
|
|
337
|
+
return a[1];
|
|
338
|
+
}, trys: [], ops: [] }, n, t, a, s = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
|
|
339
|
+
return s.next = l(0), s.throw = l(1), s.return = l(2), typeof Symbol == "function" && (s[Symbol.iterator] = function() {
|
|
340
340
|
return this;
|
|
341
|
-
}),
|
|
342
|
-
function l(
|
|
343
|
-
return function(
|
|
344
|
-
return
|
|
341
|
+
}), s;
|
|
342
|
+
function l(c) {
|
|
343
|
+
return function(g) {
|
|
344
|
+
return f([c, g]);
|
|
345
345
|
};
|
|
346
346
|
}
|
|
347
|
-
function
|
|
348
|
-
if (
|
|
349
|
-
for (;
|
|
350
|
-
if (
|
|
351
|
-
switch (t = 0,
|
|
347
|
+
function f(c) {
|
|
348
|
+
if (n) throw new TypeError("Generator is already executing.");
|
|
349
|
+
for (; s && (s = 0, c[0] && (e = 0)), e; ) try {
|
|
350
|
+
if (n = 1, t && (a = c[0] & 2 ? t.return : c[0] ? t.throw || ((a = t.return) && a.call(t), 0) : t.next) && !(a = a.call(t, c[1])).done) return a;
|
|
351
|
+
switch (t = 0, a && (c = [c[0] & 2, a.value]), c[0]) {
|
|
352
352
|
case 0:
|
|
353
353
|
case 1:
|
|
354
|
-
|
|
354
|
+
a = c;
|
|
355
355
|
break;
|
|
356
356
|
case 4:
|
|
357
|
-
return e.label++, { value:
|
|
357
|
+
return e.label++, { value: c[1], done: !1 };
|
|
358
358
|
case 5:
|
|
359
|
-
e.label++, t =
|
|
359
|
+
e.label++, t = c[1], c = [0];
|
|
360
360
|
continue;
|
|
361
361
|
case 7:
|
|
362
|
-
|
|
362
|
+
c = e.ops.pop(), e.trys.pop();
|
|
363
363
|
continue;
|
|
364
364
|
default:
|
|
365
|
-
if (
|
|
365
|
+
if (a = e.trys, !(a = a.length > 0 && a[a.length - 1]) && (c[0] === 6 || c[0] === 2)) {
|
|
366
366
|
e = 0;
|
|
367
367
|
continue;
|
|
368
368
|
}
|
|
369
|
-
if (
|
|
370
|
-
e.label =
|
|
369
|
+
if (c[0] === 3 && (!a || c[1] > a[0] && c[1] < a[3])) {
|
|
370
|
+
e.label = c[1];
|
|
371
371
|
break;
|
|
372
372
|
}
|
|
373
|
-
if (
|
|
374
|
-
e.label =
|
|
373
|
+
if (c[0] === 6 && e.label < a[1]) {
|
|
374
|
+
e.label = a[1], a = c;
|
|
375
375
|
break;
|
|
376
376
|
}
|
|
377
|
-
if (
|
|
378
|
-
e.label =
|
|
377
|
+
if (a && e.label < a[2]) {
|
|
378
|
+
e.label = a[2], e.ops.push(c);
|
|
379
379
|
break;
|
|
380
380
|
}
|
|
381
|
-
|
|
381
|
+
a[2] && e.ops.pop(), e.trys.pop();
|
|
382
382
|
continue;
|
|
383
383
|
}
|
|
384
|
-
|
|
385
|
-
} catch (
|
|
386
|
-
|
|
384
|
+
c = o.call(h, e);
|
|
385
|
+
} catch (g) {
|
|
386
|
+
c = [6, g], t = 0;
|
|
387
387
|
} finally {
|
|
388
|
-
|
|
388
|
+
n = a = 0;
|
|
389
389
|
}
|
|
390
|
-
if (
|
|
391
|
-
return { value:
|
|
390
|
+
if (c[0] & 5) throw c[1];
|
|
391
|
+
return { value: c[0] ? c[1] : void 0, done: !0 };
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
|
-
function
|
|
395
|
-
if (e || arguments.length === 2) for (var
|
|
396
|
-
(
|
|
397
|
-
return
|
|
394
|
+
function qt(h, o, e) {
|
|
395
|
+
if (e || arguments.length === 2) for (var n = 0, t = o.length, a; n < t; n++)
|
|
396
|
+
(a || !(n in o)) && (a || (a = Array.prototype.slice.call(o, 0, n)), a[n] = o[n]);
|
|
397
|
+
return h.concat(a || Array.prototype.slice.call(o));
|
|
398
398
|
}
|
|
399
|
-
function
|
|
399
|
+
function On(h) {
|
|
400
400
|
return new Promise(function(o, e) {
|
|
401
|
-
var
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
}, o(
|
|
405
|
-
},
|
|
406
|
-
|
|
401
|
+
var n = new Image();
|
|
402
|
+
n.onload = function() {
|
|
403
|
+
n.onload = n.onerror = function() {
|
|
404
|
+
}, o(n);
|
|
405
|
+
}, n.onerror = function(t) {
|
|
406
|
+
n.onload = n.onerror = function() {
|
|
407
407
|
}, e(t);
|
|
408
|
-
},
|
|
408
|
+
}, n.crossOrigin = "", n.src = h;
|
|
409
409
|
});
|
|
410
410
|
}
|
|
411
|
-
var
|
|
412
|
-
return
|
|
411
|
+
var In = typeof performance != "undefined" && typeof performance.timing != "undefined" ? performance.timing.navigationStart : Date.now(), Et = typeof performance != "undefined" ? (function() {
|
|
412
|
+
return In + performance.now();
|
|
413
413
|
}) : (function() {
|
|
414
414
|
return Date.now();
|
|
415
415
|
});
|
|
416
|
-
function st(
|
|
417
|
-
return
|
|
416
|
+
function st(h, o, e) {
|
|
417
|
+
return h + (o - h) * e;
|
|
418
418
|
}
|
|
419
|
-
function
|
|
420
|
-
var t = (o * e + 2 *
|
|
421
|
-
return t * Math.pow(
|
|
419
|
+
function Nn(h, o, e, n) {
|
|
420
|
+
var t = (o * e + 2 * h) / Math.pow(e, 3), a = -(2 * o * e + 3 * h) / Math.pow(e, 2), s = o, l = h;
|
|
421
|
+
return t * Math.pow(n, 3) + a * Math.pow(n, 2) + s * n + l;
|
|
422
422
|
}
|
|
423
|
-
function
|
|
424
|
-
var t = (o * e + 2 *
|
|
425
|
-
return 3 * t * Math.pow(
|
|
423
|
+
function kn(h, o, e, n) {
|
|
424
|
+
var t = (o * e + 2 * h) / Math.pow(e, 3), a = -(2 * o * e + 3 * h) / Math.pow(e, 2), s = o;
|
|
425
|
+
return 3 * t * Math.pow(n, 2) + 2 * a * n + s;
|
|
426
426
|
}
|
|
427
|
-
function
|
|
428
|
-
var t =
|
|
429
|
-
return
|
|
427
|
+
function Ln(h, o, e, n) {
|
|
428
|
+
var t = n[1] - n[0];
|
|
429
|
+
return h = lt(h, n), o = lt(o, n), o - h > t / 2 ? st(h + t, o, e) : h - o > t / 2 ? st(h - t, o, e) : st(h, o, e);
|
|
430
430
|
}
|
|
431
|
-
function lt(
|
|
431
|
+
function lt(h, o) {
|
|
432
432
|
var e = o[1] - o[0];
|
|
433
|
-
return
|
|
433
|
+
return h < o[0] ? lt(h + e, o) : h >= o[1] ? lt(h - e, o) : h;
|
|
434
434
|
}
|
|
435
|
-
function
|
|
436
|
-
return
|
|
435
|
+
function Dn(h, o, e, n) {
|
|
436
|
+
return n ? Ln(h, o, e, n) : st(h, o, e);
|
|
437
437
|
}
|
|
438
|
-
var
|
|
438
|
+
var Kt = (
|
|
439
439
|
/** @class */
|
|
440
440
|
(function() {
|
|
441
|
-
function
|
|
442
|
-
this.config = {}, this.progress = 1, this.ended = !0, this.value = {}, this.startTime =
|
|
441
|
+
function h(o) {
|
|
442
|
+
this.config = {}, this.progress = 1, this.ended = !0, this.value = {}, this.startTime = Et(), this.startVelocity = 0, this.duration = 0, this.keyframes = [];
|
|
443
443
|
for (var e in o) {
|
|
444
|
-
var
|
|
445
|
-
typeof
|
|
444
|
+
var n = o[e];
|
|
445
|
+
typeof n == "number" ? (this.value[e] = n, this.config[e] = { circle: !1 }) : (this.value[e] = n.value, this.config[e] = { circle: n.circle });
|
|
446
446
|
}
|
|
447
447
|
this.keyframes = [
|
|
448
|
-
{ progress: 0, value:
|
|
449
|
-
{ progress: 1, value:
|
|
448
|
+
{ progress: 0, value: V({}, this.value) },
|
|
449
|
+
{ progress: 1, value: V({}, this.value) }
|
|
450
450
|
];
|
|
451
451
|
}
|
|
452
|
-
return
|
|
452
|
+
return h.prototype.getProgress = function(o) {
|
|
453
453
|
var e = o - this.startTime;
|
|
454
|
-
return e < 0 ? 0 : e >= this.duration ? 1 : 1 -
|
|
455
|
-
},
|
|
454
|
+
return e < 0 ? 0 : e >= this.duration ? 1 : 1 - Nn(1, this.startVelocity, this.duration, e);
|
|
455
|
+
}, h.prototype.getValue = function(o) {
|
|
456
456
|
for (var e = 1; e < this.keyframes.length; e++)
|
|
457
457
|
if (this.keyframes[e].progress > o) {
|
|
458
|
-
var
|
|
459
|
-
for (var
|
|
460
|
-
var l = (o -
|
|
461
|
-
s
|
|
458
|
+
var n = this.keyframes[e - 1], t = this.keyframes[e], a = {};
|
|
459
|
+
for (var s in this.config) {
|
|
460
|
+
var l = (o - n.progress) / (t.progress - n.progress);
|
|
461
|
+
a[s] = Dn(n.value[s], t.value[s], l, this.config[s].circle);
|
|
462
462
|
}
|
|
463
|
-
return
|
|
463
|
+
return a;
|
|
464
464
|
}
|
|
465
|
-
return
|
|
466
|
-
},
|
|
465
|
+
return V({}, this.keyframes[this.keyframes.length - 1].value);
|
|
466
|
+
}, h.prototype.getProgressVelocity = function(o) {
|
|
467
467
|
var e = o - this.startTime;
|
|
468
|
-
return e >= this.duration ? 0 :
|
|
469
|
-
},
|
|
468
|
+
return e >= this.duration ? 0 : kn(1, this.startVelocity, this.duration, e);
|
|
469
|
+
}, h.prototype.update = function(o) {
|
|
470
470
|
return this.ended ? !0 : (this.progress = Math.min(1, Math.max(0, this.progress, this.getProgress(o))), this.value = this.getValue(this.progress), this.ended = this.progress >= 1, this.ended && this.callbacks && (this.callbacks[0](), this.callbacks = void 0), this.ended);
|
|
471
|
-
},
|
|
472
|
-
for (var e = this.getProgress(o),
|
|
473
|
-
if (this.keyframes[
|
|
474
|
-
return [this.keyframes[
|
|
471
|
+
}, h.prototype.getKeyFrameSegment = function(o) {
|
|
472
|
+
for (var e = this.getProgress(o), n = 1; n < this.keyframes.length; n++)
|
|
473
|
+
if (this.keyframes[n].progress > e)
|
|
474
|
+
return [this.keyframes[n - 1], this.keyframes[n]];
|
|
475
475
|
return [this.keyframes[this.keyframes.length - 2], this.keyframes[this.keyframes.length - 1]];
|
|
476
|
-
},
|
|
476
|
+
}, h.prototype.getTargetKeyframe = function() {
|
|
477
477
|
return this.keyframes[this.keyframes.length - 1];
|
|
478
|
-
},
|
|
479
|
-
var
|
|
480
|
-
|
|
481
|
-
var
|
|
482
|
-
for (var
|
|
483
|
-
|
|
484
|
-
var
|
|
478
|
+
}, h.prototype.set = function(o, e, n, t) {
|
|
479
|
+
var a;
|
|
480
|
+
n === void 0 && (n = 0), isNaN(e) && (e = 0), isNaN(n) && (n = 0), t = t != null ? t : Et();
|
|
481
|
+
var s = this.getProgress(t), l = this.getValue(s), f = {};
|
|
482
|
+
for (var c in this.config)
|
|
483
|
+
f[c] = (a = o[c]) !== null && a !== void 0 ? a : l[c];
|
|
484
|
+
var g = [
|
|
485
485
|
{ progress: 0, value: l },
|
|
486
|
-
{ progress: 1, value:
|
|
486
|
+
{ progress: 1, value: f }
|
|
487
487
|
];
|
|
488
|
-
return this.setKeyframes(
|
|
489
|
-
},
|
|
490
|
-
var
|
|
491
|
-
if (
|
|
488
|
+
return this.setKeyframes(g, e, n, t);
|
|
489
|
+
}, h.prototype.setKeyframes = function(o, e, n, t) {
|
|
490
|
+
var a = this;
|
|
491
|
+
if (n === void 0 && (n = 0), o.length < 2)
|
|
492
492
|
throw new Error("keyframes invalid.");
|
|
493
|
-
return isNaN(e) && (e = 0), isNaN(
|
|
494
|
-
t = t != null ? t :
|
|
493
|
+
return isNaN(e) && (e = 0), isNaN(n) && (n = 0), this.callbacks && (this.callbacks[1](new Error("motion aborted.")), this.callbacks = void 0), new Promise(function(s, l) {
|
|
494
|
+
t = t != null ? t : Et(), a.progress = 0, a.ended = !1, a.startTime = t, a.startVelocity = n, a.keyframes = o, a.duration = e, e === 0 ? (a.progress = 1, a.value = V({}, o[o.length - 1].value)) : a.value = V({}, o[0].value), a.callbacks = [s, l];
|
|
495
495
|
});
|
|
496
|
-
},
|
|
496
|
+
}, h.prototype.dispose = function() {
|
|
497
497
|
this.callbacks && (this.callbacks[1](new Error("motion dispose.")), this.callbacks = void 0);
|
|
498
|
-
},
|
|
498
|
+
}, h;
|
|
499
499
|
})()
|
|
500
|
-
),
|
|
500
|
+
), Fn = [
|
|
501
501
|
{ progress: 0, value: { scale: 0, opacity: 0, shadow: 2 } },
|
|
502
502
|
{ progress: 0.2, value: { scale: 0.5, opacity: 1, shadow: 1 } },
|
|
503
503
|
{ progress: 0.8, value: { scale: 2, opacity: 0, shadow: 0.5 } },
|
|
504
504
|
{ progress: 1, value: { scale: 2, opacity: 0, shadow: 0.5 } }
|
|
505
|
-
],
|
|
505
|
+
], Bn = [
|
|
506
506
|
{ progress: 0, value: { scale: 0, opacity: 0, shadow: 2 } },
|
|
507
507
|
{ progress: 0.2, value: { scale: 0.4, opacity: 1, shadow: 2 } },
|
|
508
508
|
{ progress: 0.8, value: { scale: 1.6, opacity: 0.4, shadow: 0.5 } },
|
|
509
509
|
{ progress: 1, value: { scale: 2, opacity: 0, shadow: 0.5 } }
|
|
510
|
-
],
|
|
510
|
+
], Un = `
|
|
511
511
|
varying vec2 vUv;
|
|
512
512
|
void main() {
|
|
513
513
|
vUv = uv;
|
|
514
514
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
515
515
|
}
|
|
516
|
-
`,
|
|
516
|
+
`, Rn = `
|
|
517
517
|
varying vec2 vUv;
|
|
518
518
|
uniform sampler2D map;
|
|
519
519
|
uniform vec4 color;
|
|
@@ -559,22 +559,22 @@ void main() {
|
|
|
559
559
|
}
|
|
560
560
|
}
|
|
561
561
|
}
|
|
562
|
-
`,
|
|
562
|
+
`, Vn = (
|
|
563
563
|
/** @class */
|
|
564
|
-
(function(
|
|
565
|
-
|
|
566
|
-
function o(e,
|
|
567
|
-
var t =
|
|
568
|
-
t.canvas = document.createElement("canvas"), t.group = new
|
|
569
|
-
var l = new
|
|
570
|
-
vertexShader:
|
|
571
|
-
fragmentShader:
|
|
564
|
+
(function(h) {
|
|
565
|
+
he(o, h);
|
|
566
|
+
function o(e, n) {
|
|
567
|
+
var t = h.call(this, e) || this;
|
|
568
|
+
t.canvas = document.createElement("canvas"), t.group = new v.Group(), t.wrapper = document.createElement("div"), t.style = document.createElement("style"), t.itemMaskMesh = (function() {
|
|
569
|
+
var l = new v.Mesh(new v.SphereBufferGeometry(1, 60, 40), new v.ShaderMaterial({
|
|
570
|
+
vertexShader: Un,
|
|
571
|
+
fragmentShader: Rn,
|
|
572
572
|
uniforms: {
|
|
573
573
|
map: {
|
|
574
|
-
value: new
|
|
574
|
+
value: new v.Texture()
|
|
575
575
|
},
|
|
576
576
|
color: {
|
|
577
|
-
value: new
|
|
577
|
+
value: new v.Vector4()
|
|
578
578
|
}
|
|
579
579
|
},
|
|
580
580
|
depthWrite: !1,
|
|
@@ -587,19 +587,19 @@ void main() {
|
|
|
587
587
|
}, t.onFiveWantsMoveToPano = function(l) {
|
|
588
588
|
t.state.mode === "box" && t.select();
|
|
589
589
|
}, t.loadPanoMask = function(l) {
|
|
590
|
-
return
|
|
591
|
-
var
|
|
592
|
-
return
|
|
593
|
-
switch (
|
|
590
|
+
return Le(t, void 0, void 0, function() {
|
|
591
|
+
var f, c, g, y, w, x, A, S, O, T;
|
|
592
|
+
return De(this, function(b) {
|
|
593
|
+
switch (b.label) {
|
|
594
594
|
case 0:
|
|
595
|
-
return
|
|
596
|
-
return P.derived_id === String(
|
|
597
|
-
})) === null ||
|
|
595
|
+
return f = this, c = f.five, g = f.canvas, y = f.itemMaskMesh, w = f.data, x = g.getContext("2d"), A = c.observers[l], S = (T = w == null ? void 0 : w.object_mask_list.find(function(P) {
|
|
596
|
+
return P.derived_id === String(A.derivedId);
|
|
597
|
+
})) === null || T === void 0 ? void 0 : T.object_mask_url, S ? [4, On(S)] : [
|
|
598
598
|
2
|
|
599
599
|
/*return*/
|
|
600
600
|
];
|
|
601
601
|
case 1:
|
|
602
|
-
return
|
|
602
|
+
return O = b.sent(), g.width = O.width, g.height = O.height, x == null || x.drawImage(O, 0, 0, O.width, O.height), y.material.uniforms.map.value.image = O, y.material.uniforms.map.value.minFilter = v.LinearFilter, y.material.uniforms.map.value.needsUpdate = !0, y.position.copy(A.position), y.quaternion.copy(A.quaternion), c.scene.add(y), c.needsRender = !0, [
|
|
603
603
|
2
|
|
604
604
|
/*return*/
|
|
605
605
|
];
|
|
@@ -607,59 +607,59 @@ void main() {
|
|
|
607
607
|
});
|
|
608
608
|
});
|
|
609
609
|
}, t.onFiveMouseMove = function(l) {
|
|
610
|
-
var
|
|
610
|
+
var f;
|
|
611
611
|
if (t.state.mode === "mask" && t.five.state.mode === "Panorama") {
|
|
612
|
-
var
|
|
612
|
+
var c = t, g = c.five, y = c.itemMaskMesh, w = g.observers[g.state.panoIndex], x = (f = l.pointers[0]) === null || f === void 0 ? void 0 : f.raycaster;
|
|
613
613
|
if (x) {
|
|
614
|
-
var
|
|
615
|
-
return
|
|
614
|
+
var A = x.intersectObjects(t.group.children.filter(function(S) {
|
|
615
|
+
return S.userData.visible_viewpoint.includes(String(w.derivedId));
|
|
616
616
|
}), !0)[0];
|
|
617
|
-
|
|
617
|
+
A ? y.material.uniforms.color.value = A.object.userData.color : y.material.uniforms.color.value = new v.Vector4(0, 0, 0, 1);
|
|
618
618
|
}
|
|
619
619
|
}
|
|
620
620
|
}, t.onFiveTapGesture = function(l) {
|
|
621
|
-
var
|
|
621
|
+
var f = t.five, c = f.observers[f.state.panoIndex];
|
|
622
622
|
if (l) {
|
|
623
|
-
var
|
|
624
|
-
return x.userData.visible_viewpoint.includes(String(
|
|
623
|
+
var g = l.intersectObjects(t.group.children.filter(function(x) {
|
|
624
|
+
return x.userData.visible_viewpoint.includes(String(c.derivedId));
|
|
625
625
|
}), !0)[0];
|
|
626
|
-
if (
|
|
627
|
-
t.select(
|
|
628
|
-
var
|
|
626
|
+
if (g) {
|
|
627
|
+
t.select(g.object.name), t.stopAnimation && t.stopAnimation(), t.tapPosition = g.point, t.changeTapScreenPosition();
|
|
628
|
+
var y = new Kt({
|
|
629
629
|
opacity: 0,
|
|
630
630
|
scale: 0,
|
|
631
631
|
shadow: 2
|
|
632
|
-
}),
|
|
632
|
+
}), w = new Kt({
|
|
633
633
|
opacity: 0,
|
|
634
634
|
scale: 0,
|
|
635
635
|
shadow: 2
|
|
636
636
|
});
|
|
637
|
-
return
|
|
638
|
-
var
|
|
639
|
-
t.wrapper.firstChild.style.opacity = "".concat(
|
|
640
|
-
}, !1, 0, 10),
|
|
637
|
+
return y.setKeyframes(Fn, 1e3), w.setKeyframes(Bn, 1e3), t.stopAnimation = ct.shared.add(function(x, A) {
|
|
638
|
+
var S, O = y.update(x), T = w.update(x);
|
|
639
|
+
t.wrapper.firstChild.style.opacity = "".concat(y.value.opacity), t.wrapper.firstChild.style.transform = "scale(".concat(y.value.scale, ")"), t.wrapper.firstChild.style.boxShadow = "0 0 0 ".concat(y.value.shadow, "px #fff"), t.wrapper.lastChild.style.opacity = "".concat(w.value.opacity), t.wrapper.lastChild.style.transform = "scale(".concat(w.value.scale, ")"), t.wrapper.lastChild.style.boxShadow = "0 0 0 ".concat(w.value.shadow, "px #fff"), O && T && ((S = t.stopAnimation) === null || S === void 0 || S.call(t), t.stopAnimation = void 0, f.getElement().parentElement.removeChild(t.wrapper));
|
|
640
|
+
}, !1, 0, 10), f.getElement().parentElement.appendChild(t.wrapper), !1;
|
|
641
641
|
}
|
|
642
642
|
}
|
|
643
643
|
}, t.changeTapScreenPosition = function() {
|
|
644
644
|
if (t.tapPosition) {
|
|
645
|
-
var l = t.tapPosition.clone().project(t.five.camera),
|
|
646
|
-
t.wrapper.style.opacity = l.z > 0 && l.z < 1 ? "1" : "0", t.wrapper.style.transform = "translate(".concat(
|
|
645
|
+
var l = t.tapPosition.clone().project(t.five.camera), f = (l.x + 1) / 2, c = -(l.y - 1) / 2;
|
|
646
|
+
t.wrapper.style.opacity = l.z > 0 && l.z < 1 ? "1" : "0", t.wrapper.style.transform = "translate(".concat(f * 100, "%, ").concat(c * 100, "%)");
|
|
647
647
|
}
|
|
648
648
|
}, t.onFiveCameraUpdate = function(l) {
|
|
649
649
|
t.changeTapScreenPosition();
|
|
650
650
|
}, t.dispose = function() {
|
|
651
651
|
t.disable();
|
|
652
652
|
}, t.five = e;
|
|
653
|
-
var
|
|
653
|
+
var a = {
|
|
654
654
|
enabled: !0,
|
|
655
655
|
visible: !0,
|
|
656
656
|
mode: "box",
|
|
657
657
|
selectedId: null,
|
|
658
658
|
selectAll: !1
|
|
659
659
|
};
|
|
660
|
-
t.state = Object.assign(
|
|
661
|
-
var
|
|
662
|
-
return t._config =
|
|
660
|
+
t.state = Object.assign(a, n == null ? void 0 : n.initialState);
|
|
661
|
+
var s = V({}, n == null ? void 0 : n.config);
|
|
662
|
+
return t._config = s, t.group.rotateX(Math.PI), t.wrapper.className = "ItemMaskPlugin", t.wrapper.innerHTML = '<span class="ItemMaskPluginCircle"></span><span class="ItemMaskPluginCircle"></span>', t.style.innerHTML = `
|
|
663
663
|
.ItemMaskPlugin {
|
|
664
664
|
position: absolute;
|
|
665
665
|
top: 0;
|
|
@@ -681,23 +681,23 @@ void main() {
|
|
|
681
681
|
}
|
|
682
682
|
return Object.defineProperty(o.prototype, "config", {
|
|
683
683
|
get: function() {
|
|
684
|
-
return
|
|
684
|
+
return V({}, this._config);
|
|
685
685
|
},
|
|
686
686
|
enumerable: !1,
|
|
687
687
|
configurable: !0
|
|
688
|
-
}), o.prototype.updateState = function(e,
|
|
688
|
+
}), o.prototype.updateState = function(e, n) {
|
|
689
689
|
var t = this.state;
|
|
690
|
-
this.state =
|
|
690
|
+
this.state = V(V({}, this.state), e), this.hooks.emit("stateChange", { state: this.state, prevState: t, userAction: n });
|
|
691
691
|
}, o.prototype.load = function(e) {
|
|
692
|
-
return
|
|
693
|
-
var
|
|
694
|
-
return
|
|
695
|
-
return this.data = e,
|
|
696
|
-
var
|
|
697
|
-
return Number(
|
|
698
|
-
}),
|
|
699
|
-
return Number(
|
|
700
|
-
}),
|
|
692
|
+
return Le(this, void 0, void 0, function() {
|
|
693
|
+
var n, t, a = this;
|
|
694
|
+
return De(this, function(s) {
|
|
695
|
+
return this.data = e, n = e.data_list.map(function(l) {
|
|
696
|
+
var f, c = l.position.end.map(function(C) {
|
|
697
|
+
return Number(C);
|
|
698
|
+
}), g = l.position.start.map(function(C) {
|
|
699
|
+
return Number(C);
|
|
700
|
+
}), y = Math.abs(c[0] - g[0]), w = Math.abs(c[1] - g[1]), x = Math.abs(c[2] - g[2]), A = c[0] / 2 + g[0] / 2, S = c[1] / 2 + g[1] / 2, O = c[2] / 2 + g[2] / 2, T = new v.Vector3(A, S, O), b = new v.BoxBufferGeometry(y, w, x), P = new v.ShaderMaterial({
|
|
701
701
|
vertexShader: `
|
|
702
702
|
varying vec2 vUv;
|
|
703
703
|
void main() {
|
|
@@ -725,41 +725,41 @@ void main() {
|
|
|
725
725
|
}
|
|
726
726
|
}
|
|
727
727
|
`,
|
|
728
|
-
side:
|
|
729
|
-
visible:
|
|
728
|
+
side: v.DoubleSide,
|
|
729
|
+
visible: a.state.selectedId === "".concat(l.category_name).concat(l.index),
|
|
730
730
|
uniforms: {
|
|
731
|
-
opacity: { value:
|
|
731
|
+
opacity: { value: a.state.mode === "box" ? 1 : 0 }
|
|
732
732
|
},
|
|
733
733
|
depthWrite: !1,
|
|
734
734
|
depthTest: !1,
|
|
735
735
|
transparent: !0
|
|
736
|
-
}),
|
|
737
|
-
return
|
|
738
|
-
return
|
|
739
|
-
}).reverse(), !1), [1], !1)))(),
|
|
740
|
-
}), (t = this.group).add.apply(t,
|
|
736
|
+
}), m = new v.Mesh(b, P);
|
|
737
|
+
return m.position.copy(T), m.name = "".concat(l.category_name).concat(l.index), m.userData.color = new ((f = v.Vector4).bind.apply(f, qt(qt([void 0], l.mask_color.map(function(C) {
|
|
738
|
+
return C / 255;
|
|
739
|
+
}).reverse(), !1), [1], !1)))(), m.userData.visible_viewpoint = Object.keys(l.visible_viewpoint), m;
|
|
740
|
+
}), (t = this.group).add.apply(t, n), [
|
|
741
741
|
2
|
|
742
742
|
/*return*/
|
|
743
743
|
];
|
|
744
744
|
});
|
|
745
745
|
});
|
|
746
|
-
}, o.prototype.setState = function(e,
|
|
747
|
-
|
|
748
|
-
var t = this.state,
|
|
749
|
-
if (this.updateState(e,
|
|
750
|
-
var
|
|
751
|
-
e.enabled ? this._enable(
|
|
746
|
+
}, o.prototype.setState = function(e, n) {
|
|
747
|
+
n === void 0 && (n = {});
|
|
748
|
+
var t = this.state, a = n.userAction !== void 0 ? n.userAction : !0;
|
|
749
|
+
if (this.updateState(e, a), e.enabled !== void 0 && t.enabled !== e.enabled) {
|
|
750
|
+
var s = { userAction: a };
|
|
751
|
+
e.enabled ? this._enable(s) : this._disable(s);
|
|
752
752
|
}
|
|
753
753
|
}, o.prototype.setMode = function(e) {
|
|
754
|
-
this.updateState({ mode: e }, !1), e === "mask" ? (this.group.children.forEach(function(
|
|
755
|
-
|
|
756
|
-
}), this.loadPanoMask(this.five.state.panoIndex)) : e === "box" && (this.itemMaskMesh.material.uniforms.color.value = new
|
|
757
|
-
|
|
754
|
+
this.updateState({ mode: e }, !1), e === "mask" ? (this.group.children.forEach(function(n) {
|
|
755
|
+
n.material.uniforms.opacity.value = 0;
|
|
756
|
+
}), this.loadPanoMask(this.five.state.panoIndex)) : e === "box" && (this.itemMaskMesh.material.uniforms.color.value = new v.Vector4(0, 0, 0, 1), this.group.children.forEach(function(n) {
|
|
757
|
+
n.material.uniforms.opacity.value = 1;
|
|
758
758
|
}), this.five.needsRender = !0);
|
|
759
|
-
}, o.prototype.select = function(e,
|
|
760
|
-
var t = this,
|
|
761
|
-
this.updateState({ selectedId: e != null ? e : null }, (
|
|
762
|
-
|
|
759
|
+
}, o.prototype.select = function(e, n) {
|
|
760
|
+
var t = this, a;
|
|
761
|
+
this.updateState({ selectedId: e != null ? e : null }, (a = n == null ? void 0 : n.userAction) !== null && a !== void 0 ? a : !1), this.group.children.forEach(function(s) {
|
|
762
|
+
s.material.visible = t.state.selectAll || s.name === e;
|
|
763
763
|
}), this.five.needsRender = !0;
|
|
764
764
|
}, o.prototype.selectAll = function(e) {
|
|
765
765
|
e === void 0 && (e = !0), this.updateState({ selectAll: !!e }, !1), this.select();
|
|
@@ -768,160 +768,160 @@ void main() {
|
|
|
768
768
|
}, o.prototype._disable = function(e) {
|
|
769
769
|
this.five.off("panoArrived", this.onFivePanoArrived), this.five.off("wantsMoveToPano", this.onFiveWantsMoveToPano), this.five.off("gesture.mousemove", this.onFiveMouseMove), this.five.off("wantsTapGesture", this.onFiveTapGesture), this.five.off("cameraUpdate", this.onFiveCameraUpdate), this.five.scene.remove(this.group), document.head.removeChild(this.style);
|
|
770
770
|
}, o.prototype.enable = function(e) {
|
|
771
|
-
var
|
|
771
|
+
var n;
|
|
772
772
|
if (!this.state.enabled) {
|
|
773
|
-
var t = (
|
|
773
|
+
var t = (n = e == null ? void 0 : e.userAction) !== null && n !== void 0 ? n : !0;
|
|
774
774
|
this.updateState({ enabled: !0 }, t), this._enable({ userAction: t });
|
|
775
775
|
}
|
|
776
776
|
}, o.prototype.disable = function(e) {
|
|
777
|
-
var
|
|
777
|
+
var n;
|
|
778
778
|
if (this.state.enabled !== !1) {
|
|
779
|
-
var t = (
|
|
779
|
+
var t = (n = e == null ? void 0 : e.userAction) !== null && n !== void 0 ? n : !0;
|
|
780
780
|
this.updateState({ enabled: !1 }, t), this._disable({ userAction: t });
|
|
781
781
|
}
|
|
782
782
|
}, o;
|
|
783
|
-
})(
|
|
784
|
-
),
|
|
785
|
-
return new
|
|
783
|
+
})(Xe.Controller)
|
|
784
|
+
), tr = function(h, o) {
|
|
785
|
+
return new Vn(h, o);
|
|
786
786
|
};
|
|
787
787
|
/*! Hammer.JS - v2.0.7 - 2016-04-22
|
|
788
788
|
* http://hammerjs.github.io/
|
|
789
789
|
*
|
|
790
790
|
* Copyright (c) 2016 Jorik Tangelder;
|
|
791
791
|
* Licensed under the MIT license */
|
|
792
|
-
var
|
|
793
|
-
var t = ["", "webkit", "Moz", "MS", "ms", "o"],
|
|
794
|
-
function
|
|
795
|
-
return setTimeout(
|
|
796
|
-
}
|
|
797
|
-
function
|
|
798
|
-
return Array.isArray(
|
|
799
|
-
}
|
|
800
|
-
function
|
|
801
|
-
var
|
|
802
|
-
if (
|
|
803
|
-
if (
|
|
804
|
-
|
|
805
|
-
else if (
|
|
806
|
-
for (
|
|
807
|
-
|
|
792
|
+
var Tt = (function(h, o, e, n) {
|
|
793
|
+
var t = ["", "webkit", "Moz", "MS", "ms", "o"], a = o.createElement ? o.createElement("div") : n, s = "function", l = Math.round, f = Math.abs, c = Date.now;
|
|
794
|
+
function g(r, i, u) {
|
|
795
|
+
return setTimeout(b(r, u), i);
|
|
796
|
+
}
|
|
797
|
+
function y(r, i, u) {
|
|
798
|
+
return Array.isArray(r) ? (w(r, u[i], u), !0) : !1;
|
|
799
|
+
}
|
|
800
|
+
function w(r, i, u) {
|
|
801
|
+
var p;
|
|
802
|
+
if (r)
|
|
803
|
+
if (r.forEach)
|
|
804
|
+
r.forEach(i, u);
|
|
805
|
+
else if (r.length !== n)
|
|
806
|
+
for (p = 0; p < r.length; )
|
|
807
|
+
i.call(u, r[p], p, r), p++;
|
|
808
808
|
else
|
|
809
|
-
for (
|
|
810
|
-
|
|
809
|
+
for (p in r)
|
|
810
|
+
r.hasOwnProperty(p) && i.call(u, r[p], p, r);
|
|
811
811
|
}
|
|
812
|
-
function x(
|
|
813
|
-
var
|
|
814
|
-
` +
|
|
812
|
+
function x(r, i, u) {
|
|
813
|
+
var p = "DEPRECATED METHOD: " + i + `
|
|
814
|
+
` + u + ` AT
|
|
815
815
|
`;
|
|
816
816
|
return function() {
|
|
817
|
-
var
|
|
818
|
-
return
|
|
817
|
+
var E = new Error("get-stack-trace"), M = E && E.stack ? E.stack.replace(/^[^\(]+?[\n$]/gm, "").replace(/^\s+at\s+/gm, "").replace(/^Object.<anonymous>\s*\(/gm, "{anonymous}()@") : "Unknown Stack Trace", k = h.console && (h.console.warn || h.console.log);
|
|
818
|
+
return k && k.call(h.console, p, M), r.apply(this, arguments);
|
|
819
819
|
};
|
|
820
820
|
}
|
|
821
|
-
var
|
|
822
|
-
typeof Object.assign != "function" ?
|
|
823
|
-
if (
|
|
821
|
+
var A;
|
|
822
|
+
typeof Object.assign != "function" ? A = function(i) {
|
|
823
|
+
if (i === n || i === null)
|
|
824
824
|
throw new TypeError("Cannot convert undefined or null to object");
|
|
825
|
-
for (var
|
|
826
|
-
var
|
|
827
|
-
if (
|
|
828
|
-
for (var
|
|
829
|
-
|
|
825
|
+
for (var u = Object(i), p = 1; p < arguments.length; p++) {
|
|
826
|
+
var E = arguments[p];
|
|
827
|
+
if (E !== n && E !== null)
|
|
828
|
+
for (var M in E)
|
|
829
|
+
E.hasOwnProperty(M) && (u[M] = E[M]);
|
|
830
830
|
}
|
|
831
|
+
return u;
|
|
832
|
+
} : A = Object.assign;
|
|
833
|
+
var S = x(function(i, u, p) {
|
|
834
|
+
for (var E = Object.keys(u), M = 0; M < E.length; )
|
|
835
|
+
(!p || p && i[E[M]] === n) && (i[E[M]] = u[E[M]]), M++;
|
|
831
836
|
return i;
|
|
832
|
-
}
|
|
833
|
-
|
|
834
|
-
for (var m = Object.keys(i), E = 0; E < m.length; )
|
|
835
|
-
(!h || h && r[m[E]] === a) && (r[m[E]] = i[m[E]]), E++;
|
|
836
|
-
return r;
|
|
837
|
-
}, "extend", "Use `assign`."), L = x(function(r, i) {
|
|
838
|
-
return C(r, i, !0);
|
|
837
|
+
}, "extend", "Use `assign`."), O = x(function(i, u) {
|
|
838
|
+
return S(i, u, !0);
|
|
839
839
|
}, "merge", "Use `assign`.");
|
|
840
|
-
function
|
|
841
|
-
var
|
|
842
|
-
|
|
840
|
+
function T(r, i, u) {
|
|
841
|
+
var p = i.prototype, E;
|
|
842
|
+
E = r.prototype = Object.create(p), E.constructor = r, E._super = p, u && A(E, u);
|
|
843
843
|
}
|
|
844
|
-
function
|
|
844
|
+
function b(r, i) {
|
|
845
845
|
return function() {
|
|
846
|
-
return
|
|
846
|
+
return r.apply(i, arguments);
|
|
847
847
|
};
|
|
848
848
|
}
|
|
849
|
-
function P(
|
|
850
|
-
return typeof
|
|
849
|
+
function P(r, i) {
|
|
850
|
+
return typeof r == s ? r.apply(i && i[0] || n, i) : r;
|
|
851
851
|
}
|
|
852
|
-
function
|
|
853
|
-
return
|
|
852
|
+
function m(r, i) {
|
|
853
|
+
return r === n ? i : r;
|
|
854
854
|
}
|
|
855
|
-
function
|
|
856
|
-
|
|
857
|
-
|
|
855
|
+
function C(r, i, u) {
|
|
856
|
+
w(U(i), function(p) {
|
|
857
|
+
r.addEventListener(p, u, !1);
|
|
858
858
|
});
|
|
859
859
|
}
|
|
860
|
-
function
|
|
861
|
-
|
|
862
|
-
|
|
860
|
+
function _(r, i, u) {
|
|
861
|
+
w(U(i), function(p) {
|
|
862
|
+
r.removeEventListener(p, u, !1);
|
|
863
863
|
});
|
|
864
864
|
}
|
|
865
|
-
function
|
|
866
|
-
for (;
|
|
867
|
-
if (
|
|
865
|
+
function H(r, i) {
|
|
866
|
+
for (; r; ) {
|
|
867
|
+
if (r == i)
|
|
868
868
|
return !0;
|
|
869
|
-
|
|
869
|
+
r = r.parentNode;
|
|
870
870
|
}
|
|
871
871
|
return !1;
|
|
872
872
|
}
|
|
873
|
-
function
|
|
874
|
-
return
|
|
873
|
+
function G(r, i) {
|
|
874
|
+
return r.indexOf(i) > -1;
|
|
875
875
|
}
|
|
876
|
-
function
|
|
877
|
-
return
|
|
876
|
+
function U(r) {
|
|
877
|
+
return r.trim().split(/\s+/g);
|
|
878
878
|
}
|
|
879
|
-
function
|
|
880
|
-
if (
|
|
881
|
-
return
|
|
882
|
-
for (var
|
|
883
|
-
if (
|
|
884
|
-
return
|
|
885
|
-
|
|
879
|
+
function Q(r, i, u) {
|
|
880
|
+
if (r.indexOf && !u)
|
|
881
|
+
return r.indexOf(i);
|
|
882
|
+
for (var p = 0; p < r.length; ) {
|
|
883
|
+
if (u && r[p][u] == i || !u && r[p] === i)
|
|
884
|
+
return p;
|
|
885
|
+
p++;
|
|
886
886
|
}
|
|
887
887
|
return -1;
|
|
888
888
|
}
|
|
889
|
-
function
|
|
890
|
-
return Array.prototype.slice.call(
|
|
889
|
+
function oe(r) {
|
|
890
|
+
return Array.prototype.slice.call(r, 0);
|
|
891
891
|
}
|
|
892
|
-
function
|
|
893
|
-
for (var
|
|
894
|
-
var
|
|
895
|
-
|
|
892
|
+
function le(r, i, u) {
|
|
893
|
+
for (var p = [], E = [], M = 0; M < r.length; ) {
|
|
894
|
+
var k = r[M][i];
|
|
895
|
+
Q(E, k) < 0 && p.push(r[M]), E[M] = k, M++;
|
|
896
896
|
}
|
|
897
|
-
return
|
|
898
|
-
return
|
|
899
|
-
}),
|
|
900
|
-
}
|
|
901
|
-
function
|
|
902
|
-
for (var
|
|
903
|
-
if (
|
|
904
|
-
return
|
|
905
|
-
|
|
897
|
+
return p = p.sort(function(ce, $) {
|
|
898
|
+
return ce[i] > $[i];
|
|
899
|
+
}), p;
|
|
900
|
+
}
|
|
901
|
+
function J(r, i) {
|
|
902
|
+
for (var u, p, E = i[0].toUpperCase() + i.slice(1), M = 0; M < t.length; ) {
|
|
903
|
+
if (u = t[M], p = u ? u + E : i, p in r)
|
|
904
|
+
return p;
|
|
905
|
+
M++;
|
|
906
906
|
}
|
|
907
|
-
return
|
|
907
|
+
return n;
|
|
908
908
|
}
|
|
909
|
-
var
|
|
910
|
-
function
|
|
911
|
-
return
|
|
909
|
+
var Z = 1;
|
|
910
|
+
function D() {
|
|
911
|
+
return Z++;
|
|
912
912
|
}
|
|
913
|
-
function I(
|
|
914
|
-
var
|
|
915
|
-
return
|
|
913
|
+
function I(r) {
|
|
914
|
+
var i = r.ownerDocument || r;
|
|
915
|
+
return i.defaultView || i.parentWindow || h;
|
|
916
916
|
}
|
|
917
|
-
var
|
|
918
|
-
function
|
|
919
|
-
var
|
|
920
|
-
this.manager =
|
|
921
|
-
P(
|
|
917
|
+
var N = /mobile|tablet|ip(ad|hone|od)|android/i, B = "ontouchstart" in h, Y = J(h, "PointerEvent") !== n, ae = B && N.test(navigator.userAgent), X = "touch", R = "pen", ee = "mouse", j = "kinect", z = 25, L = 1, ie = 2, W = 4, q = 8, Ce = 1, Pe = 2, Oe = 4, Ie = 8, Ae = 16, ue = Pe | Oe, de = Ie | Ae, Ue = ue | de, Re = ["x", "y"], Ne = ["clientX", "clientY"];
|
|
918
|
+
function se(r, i) {
|
|
919
|
+
var u = this;
|
|
920
|
+
this.manager = r, this.callback = i, this.element = r.element, this.target = r.options.inputTarget, this.domHandler = function(p) {
|
|
921
|
+
P(r.options.enable, [r]) && u.handler(p);
|
|
922
922
|
}, this.init();
|
|
923
923
|
}
|
|
924
|
-
|
|
924
|
+
se.prototype = {
|
|
925
925
|
/**
|
|
926
926
|
* should handle the inputEvent data and trigger the callback
|
|
927
927
|
* @virtual
|
|
@@ -932,247 +932,247 @@ var wt = (function(f, o, e, a) {
|
|
|
932
932
|
* bind the events
|
|
933
933
|
*/
|
|
934
934
|
init: function() {
|
|
935
|
-
this.evEl &&
|
|
935
|
+
this.evEl && C(this.element, this.evEl, this.domHandler), this.evTarget && C(this.target, this.evTarget, this.domHandler), this.evWin && C(I(this.element), this.evWin, this.domHandler);
|
|
936
936
|
},
|
|
937
937
|
/**
|
|
938
938
|
* unbind the events
|
|
939
939
|
*/
|
|
940
940
|
destroy: function() {
|
|
941
|
-
this.evEl &&
|
|
941
|
+
this.evEl && _(this.element, this.evEl, this.domHandler), this.evTarget && _(this.target, this.evTarget, this.domHandler), this.evWin && _(I(this.element), this.evWin, this.domHandler);
|
|
942
942
|
}
|
|
943
943
|
};
|
|
944
|
-
function Ke(
|
|
945
|
-
var
|
|
946
|
-
return
|
|
947
|
-
}
|
|
948
|
-
function Ze(
|
|
949
|
-
var
|
|
950
|
-
|
|
951
|
-
}
|
|
952
|
-
function
|
|
953
|
-
var
|
|
954
|
-
|
|
955
|
-
var
|
|
956
|
-
|
|
957
|
-
var
|
|
958
|
-
|
|
959
|
-
var
|
|
960
|
-
|
|
961
|
-
}
|
|
962
|
-
function
|
|
963
|
-
var
|
|
964
|
-
(
|
|
965
|
-
x:
|
|
966
|
-
y:
|
|
967
|
-
},
|
|
968
|
-
x:
|
|
969
|
-
y:
|
|
970
|
-
}),
|
|
971
|
-
}
|
|
972
|
-
function
|
|
973
|
-
var
|
|
974
|
-
if (
|
|
975
|
-
var
|
|
976
|
-
|
|
944
|
+
function Ke(r) {
|
|
945
|
+
var i, u = r.options.inputClass;
|
|
946
|
+
return u ? i = u : Y ? i = ht : ae ? i = $e : B ? i = dt : i = Je, new i(r, Ze);
|
|
947
|
+
}
|
|
948
|
+
function Ze(r, i, u) {
|
|
949
|
+
var p = u.pointers.length, E = u.changedPointers.length, M = i & L && p - E === 0, k = i & (W | q) && p - E === 0;
|
|
950
|
+
u.isFirst = !!M, u.isFinal = !!k, M && (r.session = {}), u.eventType = i, d(r, u), r.emit("hammer.input", u), r.recognize(u), r.session.prevInput = u;
|
|
951
|
+
}
|
|
952
|
+
function d(r, i) {
|
|
953
|
+
var u = r.session, p = i.pointers, E = p.length;
|
|
954
|
+
u.firstInput || (u.firstInput = te(i)), E > 1 && !u.firstMultiple ? u.firstMultiple = te(i) : E === 1 && (u.firstMultiple = !1);
|
|
955
|
+
var M = u.firstInput, k = u.firstMultiple, ne = k ? k.center : M.center, ce = i.center = ve(p);
|
|
956
|
+
i.timeStamp = c(), i.deltaTime = i.timeStamp - M.timeStamp, i.angle = ft(ne, ce), i.distance = Qe(ne, ce), F(u, i), i.offsetDirection = be(i.deltaX, i.deltaY);
|
|
957
|
+
var $ = Ve(i.deltaTime, i.deltaX, i.deltaY);
|
|
958
|
+
i.overallVelocityX = $.x, i.overallVelocityY = $.y, i.overallVelocity = f($.x) > f($.y) ? $.x : $.y, i.scale = k ? an(k.pointers, p) : 1, i.rotation = k ? rn(k.pointers, p) : 0, i.maxPointers = u.prevInput ? i.pointers.length > u.prevInput.maxPointers ? i.pointers.length : u.prevInput.maxPointers : i.pointers.length, K(u, i);
|
|
959
|
+
var ge = r.element;
|
|
960
|
+
H(i.srcEvent.target, ge) && (ge = i.srcEvent.target), i.target = ge;
|
|
961
|
+
}
|
|
962
|
+
function F(r, i) {
|
|
963
|
+
var u = i.center, p = r.offsetDelta || {}, E = r.prevDelta || {}, M = r.prevInput || {};
|
|
964
|
+
(i.eventType === L || M.eventType === W) && (E = r.prevDelta = {
|
|
965
|
+
x: M.deltaX || 0,
|
|
966
|
+
y: M.deltaY || 0
|
|
967
|
+
}, p = r.offsetDelta = {
|
|
968
|
+
x: u.x,
|
|
969
|
+
y: u.y
|
|
970
|
+
}), i.deltaX = E.x + (u.x - p.x), i.deltaY = E.y + (u.y - p.y);
|
|
971
|
+
}
|
|
972
|
+
function K(r, i) {
|
|
973
|
+
var u = r.lastInterval || i, p = i.timeStamp - u.timeStamp, E, M, k, ne;
|
|
974
|
+
if (i.eventType != q && (p > z || u.velocity === n)) {
|
|
975
|
+
var ce = i.deltaX - u.deltaX, $ = i.deltaY - u.deltaY, ge = Ve(p, ce, $);
|
|
976
|
+
M = ge.x, k = ge.y, E = f(ge.x) > f(ge.y) ? ge.x : ge.y, ne = be(ce, $), r.lastInterval = i;
|
|
977
977
|
} else
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
}
|
|
981
|
-
function
|
|
982
|
-
for (var
|
|
983
|
-
|
|
984
|
-
clientX: l(
|
|
985
|
-
clientY: l(
|
|
986
|
-
},
|
|
978
|
+
E = u.velocity, M = u.velocityX, k = u.velocityY, ne = u.direction;
|
|
979
|
+
i.velocity = E, i.velocityX = M, i.velocityY = k, i.direction = ne;
|
|
980
|
+
}
|
|
981
|
+
function te(r) {
|
|
982
|
+
for (var i = [], u = 0; u < r.pointers.length; )
|
|
983
|
+
i[u] = {
|
|
984
|
+
clientX: l(r.pointers[u].clientX),
|
|
985
|
+
clientY: l(r.pointers[u].clientY)
|
|
986
|
+
}, u++;
|
|
987
987
|
return {
|
|
988
|
-
timeStamp:
|
|
989
|
-
pointers:
|
|
990
|
-
center:
|
|
991
|
-
deltaX:
|
|
992
|
-
deltaY:
|
|
988
|
+
timeStamp: c(),
|
|
989
|
+
pointers: i,
|
|
990
|
+
center: ve(i),
|
|
991
|
+
deltaX: r.deltaX,
|
|
992
|
+
deltaY: r.deltaY
|
|
993
993
|
};
|
|
994
994
|
}
|
|
995
|
-
function
|
|
996
|
-
var
|
|
997
|
-
if (
|
|
995
|
+
function ve(r) {
|
|
996
|
+
var i = r.length;
|
|
997
|
+
if (i === 1)
|
|
998
998
|
return {
|
|
999
|
-
x: l(
|
|
1000
|
-
y: l(
|
|
999
|
+
x: l(r[0].clientX),
|
|
1000
|
+
y: l(r[0].clientY)
|
|
1001
1001
|
};
|
|
1002
|
-
for (var
|
|
1003
|
-
|
|
1002
|
+
for (var u = 0, p = 0, E = 0; E < i; )
|
|
1003
|
+
u += r[E].clientX, p += r[E].clientY, E++;
|
|
1004
1004
|
return {
|
|
1005
|
-
x: l(
|
|
1006
|
-
y: l(
|
|
1005
|
+
x: l(u / i),
|
|
1006
|
+
y: l(p / i)
|
|
1007
1007
|
};
|
|
1008
1008
|
}
|
|
1009
|
-
function Ve(
|
|
1009
|
+
function Ve(r, i, u) {
|
|
1010
1010
|
return {
|
|
1011
|
-
x:
|
|
1012
|
-
y:
|
|
1011
|
+
x: i / r || 0,
|
|
1012
|
+
y: u / r || 0
|
|
1013
1013
|
};
|
|
1014
1014
|
}
|
|
1015
|
-
function
|
|
1016
|
-
return
|
|
1015
|
+
function be(r, i) {
|
|
1016
|
+
return r === i ? Ce : f(r) >= f(i) ? r < 0 ? Pe : Oe : i < 0 ? Ie : Ae;
|
|
1017
1017
|
}
|
|
1018
|
-
function Qe(
|
|
1019
|
-
|
|
1020
|
-
var
|
|
1021
|
-
return Math.sqrt(
|
|
1018
|
+
function Qe(r, i, u) {
|
|
1019
|
+
u || (u = Re);
|
|
1020
|
+
var p = i[u[0]] - r[u[0]], E = i[u[1]] - r[u[1]];
|
|
1021
|
+
return Math.sqrt(p * p + E * E);
|
|
1022
1022
|
}
|
|
1023
|
-
function
|
|
1024
|
-
|
|
1025
|
-
var
|
|
1026
|
-
return Math.atan2(
|
|
1023
|
+
function ft(r, i, u) {
|
|
1024
|
+
u || (u = Re);
|
|
1025
|
+
var p = i[u[0]] - r[u[0]], E = i[u[1]] - r[u[1]];
|
|
1026
|
+
return Math.atan2(E, p) * 180 / Math.PI;
|
|
1027
1027
|
}
|
|
1028
|
-
function
|
|
1029
|
-
return
|
|
1028
|
+
function rn(r, i) {
|
|
1029
|
+
return ft(i[1], i[0], Ne) + ft(r[1], r[0], Ne);
|
|
1030
1030
|
}
|
|
1031
|
-
function
|
|
1032
|
-
return Qe(
|
|
1031
|
+
function an(r, i) {
|
|
1032
|
+
return Qe(i[0], i[1], Ne) / Qe(r[0], r[1], Ne);
|
|
1033
1033
|
}
|
|
1034
|
-
var
|
|
1035
|
-
mousedown:
|
|
1036
|
-
mousemove:
|
|
1037
|
-
mouseup:
|
|
1038
|
-
},
|
|
1034
|
+
var on = {
|
|
1035
|
+
mousedown: L,
|
|
1036
|
+
mousemove: ie,
|
|
1037
|
+
mouseup: W
|
|
1038
|
+
}, sn = "mousedown", ln = "mousemove mouseup";
|
|
1039
1039
|
function Je() {
|
|
1040
|
-
this.evEl =
|
|
1040
|
+
this.evEl = sn, this.evWin = ln, this.pressed = !1, se.apply(this, arguments);
|
|
1041
1041
|
}
|
|
1042
|
-
|
|
1042
|
+
T(Je, se, {
|
|
1043
1043
|
/**
|
|
1044
1044
|
* handle mouse events
|
|
1045
1045
|
* @param {Object} ev
|
|
1046
1046
|
*/
|
|
1047
|
-
handler: function(
|
|
1048
|
-
var
|
|
1049
|
-
|
|
1050
|
-
pointers: [
|
|
1051
|
-
changedPointers: [
|
|
1052
|
-
pointerType:
|
|
1053
|
-
srcEvent:
|
|
1047
|
+
handler: function(i) {
|
|
1048
|
+
var u = on[i.type];
|
|
1049
|
+
u & L && (i.button === 0 || i.button === 2) && (this.pressed = !0), u & ie && i.which !== 1 && (u = W), this.pressed && (u & W && (this.pressed = !1), this.callback(this.manager, u, {
|
|
1050
|
+
pointers: [i],
|
|
1051
|
+
changedPointers: [i],
|
|
1052
|
+
pointerType: ee,
|
|
1053
|
+
srcEvent: i
|
|
1054
1054
|
}));
|
|
1055
1055
|
}
|
|
1056
1056
|
});
|
|
1057
|
-
var
|
|
1058
|
-
pointerdown:
|
|
1059
|
-
pointermove:
|
|
1060
|
-
pointerup:
|
|
1061
|
-
pointercancel:
|
|
1062
|
-
pointerout:
|
|
1063
|
-
},
|
|
1064
|
-
2:
|
|
1065
|
-
3:
|
|
1066
|
-
4:
|
|
1067
|
-
5:
|
|
1057
|
+
var Nt = {
|
|
1058
|
+
pointerdown: L,
|
|
1059
|
+
pointermove: ie,
|
|
1060
|
+
pointerup: W,
|
|
1061
|
+
pointercancel: q,
|
|
1062
|
+
pointerout: q
|
|
1063
|
+
}, un = {
|
|
1064
|
+
2: X,
|
|
1065
|
+
3: R,
|
|
1066
|
+
4: ee,
|
|
1067
|
+
5: j
|
|
1068
1068
|
// see https://twitter.com/jacobrossi/status/480596438489890816
|
|
1069
|
-
},
|
|
1070
|
-
|
|
1069
|
+
}, kt = "pointerdown", Lt = "pointermove pointerup pointercancel";
|
|
1070
|
+
h.MSPointerEvent && !h.PointerEvent && (kt = "MSPointerDown", Lt = "MSPointerMove MSPointerUp MSPointerCancel");
|
|
1071
1071
|
function ht() {
|
|
1072
|
-
this.evEl =
|
|
1072
|
+
this.evEl = kt, this.evWin = Lt, se.apply(this, arguments), this.store = this.manager.session.pointerEvents = [];
|
|
1073
1073
|
}
|
|
1074
|
-
|
|
1074
|
+
T(ht, se, {
|
|
1075
1075
|
/**
|
|
1076
1076
|
* handle mouse events
|
|
1077
1077
|
* @param {Object} ev
|
|
1078
1078
|
*/
|
|
1079
|
-
handler: function(
|
|
1080
|
-
var
|
|
1081
|
-
|
|
1082
|
-
pointers:
|
|
1083
|
-
changedPointers: [
|
|
1084
|
-
pointerType:
|
|
1085
|
-
srcEvent:
|
|
1086
|
-
}),
|
|
1079
|
+
handler: function(i) {
|
|
1080
|
+
var u = this.store, p = !1, E = !1, M = i.type.toLowerCase().replace("ms", ""), k = Nt[M], ne = un[i.pointerType] || i.pointerType, ce = ne == X, $ = Q(u, i.pointerId, "pointerId");
|
|
1081
|
+
k & L && (i.button === 0 || i.button === 2 || ce) ? $ < 0 && (u.push(i), $ = u.length - 1) : k & (W | q) ? p = !0 : !ce && i.buttons === 0 && (p = !0, E = !0, k = Nt.pointerup), !($ < 0) && (E || (u[$] = i), this.callback(this.manager, k, {
|
|
1082
|
+
pointers: u,
|
|
1083
|
+
changedPointers: [i],
|
|
1084
|
+
pointerType: ne,
|
|
1085
|
+
srcEvent: u[$]
|
|
1086
|
+
}), p && u.splice($, 1));
|
|
1087
1087
|
}
|
|
1088
1088
|
});
|
|
1089
|
-
var
|
|
1090
|
-
touchstart:
|
|
1091
|
-
touchmove:
|
|
1092
|
-
touchend:
|
|
1093
|
-
touchcancel:
|
|
1094
|
-
},
|
|
1095
|
-
function
|
|
1096
|
-
this.evTarget =
|
|
1097
|
-
}
|
|
1098
|
-
|
|
1099
|
-
handler: function(
|
|
1100
|
-
var
|
|
1101
|
-
if (
|
|
1102
|
-
var
|
|
1103
|
-
|
|
1104
|
-
pointers:
|
|
1105
|
-
changedPointers:
|
|
1106
|
-
pointerType:
|
|
1107
|
-
srcEvent:
|
|
1089
|
+
var cn = {
|
|
1090
|
+
touchstart: L,
|
|
1091
|
+
touchmove: ie,
|
|
1092
|
+
touchend: W,
|
|
1093
|
+
touchcancel: q
|
|
1094
|
+
}, fn = "touchstart", hn = "touchstart touchmove touchend touchcancel";
|
|
1095
|
+
function Dt() {
|
|
1096
|
+
this.evTarget = fn, this.evWin = hn, this.started = !1, se.apply(this, arguments);
|
|
1097
|
+
}
|
|
1098
|
+
T(Dt, se, {
|
|
1099
|
+
handler: function(i) {
|
|
1100
|
+
var u = cn[i.type];
|
|
1101
|
+
if (u === L && (this.started = !0), !!this.started) {
|
|
1102
|
+
var p = dn.call(this, i, u);
|
|
1103
|
+
u & (W | q) && p[0].length - p[1].length === 0 && (this.started = !1), this.callback(this.manager, u, {
|
|
1104
|
+
pointers: p[0],
|
|
1105
|
+
changedPointers: p[1],
|
|
1106
|
+
pointerType: X,
|
|
1107
|
+
srcEvent: i
|
|
1108
1108
|
});
|
|
1109
1109
|
}
|
|
1110
1110
|
}
|
|
1111
1111
|
});
|
|
1112
|
-
function
|
|
1113
|
-
var
|
|
1114
|
-
return
|
|
1115
|
-
}
|
|
1116
|
-
var
|
|
1117
|
-
touchstart:
|
|
1118
|
-
touchmove:
|
|
1119
|
-
touchend:
|
|
1120
|
-
touchcancel:
|
|
1121
|
-
},
|
|
1112
|
+
function dn(r, i) {
|
|
1113
|
+
var u = oe(r.touches), p = oe(r.changedTouches);
|
|
1114
|
+
return i & (W | q) && (u = le(u.concat(p), "identifier")), [u, p];
|
|
1115
|
+
}
|
|
1116
|
+
var pn = {
|
|
1117
|
+
touchstart: L,
|
|
1118
|
+
touchmove: ie,
|
|
1119
|
+
touchend: W,
|
|
1120
|
+
touchcancel: q
|
|
1121
|
+
}, vn = "touchstart touchmove touchend touchcancel";
|
|
1122
1122
|
function $e() {
|
|
1123
|
-
this.evTarget =
|
|
1124
|
-
}
|
|
1125
|
-
|
|
1126
|
-
handler: function(
|
|
1127
|
-
var
|
|
1128
|
-
|
|
1129
|
-
pointers:
|
|
1130
|
-
changedPointers:
|
|
1131
|
-
pointerType:
|
|
1132
|
-
srcEvent:
|
|
1123
|
+
this.evTarget = vn, this.targetIds = {}, se.apply(this, arguments);
|
|
1124
|
+
}
|
|
1125
|
+
T($e, se, {
|
|
1126
|
+
handler: function(i) {
|
|
1127
|
+
var u = pn[i.type], p = mn.call(this, i, u);
|
|
1128
|
+
p && this.callback(this.manager, u, {
|
|
1129
|
+
pointers: p[0],
|
|
1130
|
+
changedPointers: p[1],
|
|
1131
|
+
pointerType: X,
|
|
1132
|
+
srcEvent: i
|
|
1133
1133
|
});
|
|
1134
1134
|
}
|
|
1135
1135
|
});
|
|
1136
|
-
function
|
|
1137
|
-
var
|
|
1138
|
-
if (
|
|
1139
|
-
return
|
|
1140
|
-
var
|
|
1141
|
-
if (
|
|
1142
|
-
return
|
|
1143
|
-
}),
|
|
1144
|
-
for (
|
|
1145
|
-
|
|
1146
|
-
for (
|
|
1147
|
-
|
|
1148
|
-
if (
|
|
1136
|
+
function mn(r, i) {
|
|
1137
|
+
var u = oe(r.touches), p = this.targetIds;
|
|
1138
|
+
if (i & (L | ie) && u.length === 1)
|
|
1139
|
+
return p[u[0].identifier] = !0, [u, u];
|
|
1140
|
+
var E, M, k = oe(r.changedTouches), ne = [], ce = this.target;
|
|
1141
|
+
if (M = u.filter(function($) {
|
|
1142
|
+
return H($.target, ce);
|
|
1143
|
+
}), i === L)
|
|
1144
|
+
for (E = 0; E < M.length; )
|
|
1145
|
+
p[M[E].identifier] = !0, E++;
|
|
1146
|
+
for (E = 0; E < k.length; )
|
|
1147
|
+
p[k[E].identifier] && ne.push(k[E]), i & (W | q) && delete p[k[E].identifier], E++;
|
|
1148
|
+
if (ne.length)
|
|
1149
1149
|
return [
|
|
1150
1150
|
// merge targetTouches with changedTargetTouches so it contains ALL touches, including 'end' and 'cancel'
|
|
1151
|
-
|
|
1152
|
-
|
|
1151
|
+
le(M.concat(ne), "identifier"),
|
|
1152
|
+
ne
|
|
1153
1153
|
];
|
|
1154
1154
|
}
|
|
1155
|
-
var
|
|
1156
|
-
function
|
|
1157
|
-
|
|
1158
|
-
var
|
|
1159
|
-
this.touch = new $e(this.manager,
|
|
1155
|
+
var gn = 2500, Ft = 25;
|
|
1156
|
+
function dt() {
|
|
1157
|
+
se.apply(this, arguments);
|
|
1158
|
+
var r = b(this.handler, this);
|
|
1159
|
+
this.touch = new $e(this.manager, r), this.mouse = new Je(this.manager, r), this.primaryTouch = null, this.lastTouches = [];
|
|
1160
1160
|
}
|
|
1161
|
-
|
|
1161
|
+
T(dt, se, {
|
|
1162
1162
|
/**
|
|
1163
1163
|
* handle mouse and touch events
|
|
1164
1164
|
* @param {Hammer} manager
|
|
1165
1165
|
* @param {String} inputEvent
|
|
1166
1166
|
* @param {Object} inputData
|
|
1167
1167
|
*/
|
|
1168
|
-
handler: function(
|
|
1169
|
-
var
|
|
1170
|
-
if (!(
|
|
1171
|
-
if (
|
|
1172
|
-
|
|
1173
|
-
else if (
|
|
1168
|
+
handler: function(i, u, p) {
|
|
1169
|
+
var E = p.pointerType == X, M = p.pointerType == ee;
|
|
1170
|
+
if (!(M && p.sourceCapabilities && p.sourceCapabilities.firesTouchEvents)) {
|
|
1171
|
+
if (E)
|
|
1172
|
+
yn.call(this, u, p);
|
|
1173
|
+
else if (M && bn.call(this, p))
|
|
1174
1174
|
return;
|
|
1175
|
-
this.callback(
|
|
1175
|
+
this.callback(i, u, p);
|
|
1176
1176
|
}
|
|
1177
1177
|
},
|
|
1178
1178
|
/**
|
|
@@ -1182,40 +1182,40 @@ var wt = (function(f, o, e, a) {
|
|
|
1182
1182
|
this.touch.destroy(), this.mouse.destroy();
|
|
1183
1183
|
}
|
|
1184
1184
|
});
|
|
1185
|
-
function
|
|
1186
|
-
|
|
1187
|
-
}
|
|
1188
|
-
function
|
|
1189
|
-
var
|
|
1190
|
-
if (
|
|
1191
|
-
var
|
|
1192
|
-
this.lastTouches.push(
|
|
1193
|
-
var
|
|
1194
|
-
var
|
|
1195
|
-
|
|
1185
|
+
function yn(r, i) {
|
|
1186
|
+
r & L ? (this.primaryTouch = i.changedPointers[0].identifier, Bt.call(this, i)) : r & (W | q) && Bt.call(this, i);
|
|
1187
|
+
}
|
|
1188
|
+
function Bt(r) {
|
|
1189
|
+
var i = r.changedPointers[0];
|
|
1190
|
+
if (i.identifier === this.primaryTouch) {
|
|
1191
|
+
var u = { x: i.clientX, y: i.clientY };
|
|
1192
|
+
this.lastTouches.push(u);
|
|
1193
|
+
var p = this.lastTouches, E = function() {
|
|
1194
|
+
var M = p.indexOf(u);
|
|
1195
|
+
M > -1 && p.splice(M, 1);
|
|
1196
1196
|
};
|
|
1197
|
-
setTimeout(
|
|
1197
|
+
setTimeout(E, gn);
|
|
1198
1198
|
}
|
|
1199
1199
|
}
|
|
1200
|
-
function
|
|
1201
|
-
for (var
|
|
1202
|
-
var
|
|
1203
|
-
if (
|
|
1200
|
+
function bn(r) {
|
|
1201
|
+
for (var i = r.srcEvent.clientX, u = r.srcEvent.clientY, p = 0; p < this.lastTouches.length; p++) {
|
|
1202
|
+
var E = this.lastTouches[p], M = Math.abs(i - E.x), k = Math.abs(u - E.y);
|
|
1203
|
+
if (M <= Ft && k <= Ft)
|
|
1204
1204
|
return !0;
|
|
1205
1205
|
}
|
|
1206
1206
|
return !1;
|
|
1207
1207
|
}
|
|
1208
|
-
var
|
|
1209
|
-
function
|
|
1210
|
-
this.manager =
|
|
1208
|
+
var Ut = a ? J(a.style, "touchAction") : n, Rt = Ut !== n, Vt = "compute", zt = "auto", pt = "manipulation", ke = "none", ze = "pan-x", je = "pan-y", et = En();
|
|
1209
|
+
function vt(r, i) {
|
|
1210
|
+
this.manager = r, this.set(i);
|
|
1211
1211
|
}
|
|
1212
|
-
|
|
1212
|
+
vt.prototype = {
|
|
1213
1213
|
/**
|
|
1214
1214
|
* set the touchAction value on the element or enable the polyfill
|
|
1215
1215
|
* @param {String} value
|
|
1216
1216
|
*/
|
|
1217
|
-
set: function(
|
|
1218
|
-
|
|
1217
|
+
set: function(r) {
|
|
1218
|
+
r == Vt && (r = this.compute()), Rt && this.manager.element.style && et[r] && (this.manager.element.style[Ut] = r), this.actions = r.toLowerCase().trim();
|
|
1219
1219
|
},
|
|
1220
1220
|
/**
|
|
1221
1221
|
* just re-set the touchAction value
|
|
@@ -1228,57 +1228,57 @@ var wt = (function(f, o, e, a) {
|
|
|
1228
1228
|
* @returns {String} value
|
|
1229
1229
|
*/
|
|
1230
1230
|
compute: function() {
|
|
1231
|
-
var
|
|
1232
|
-
return
|
|
1233
|
-
P(
|
|
1234
|
-
}),
|
|
1231
|
+
var r = [];
|
|
1232
|
+
return w(this.manager.recognizers, function(i) {
|
|
1233
|
+
P(i.options.enable, [i]) && (r = r.concat(i.getTouchAction()));
|
|
1234
|
+
}), wn(r.join(" "));
|
|
1235
1235
|
},
|
|
1236
1236
|
/**
|
|
1237
1237
|
* this method is called on each input cycle and provides the preventing of the browser behavior
|
|
1238
1238
|
* @param {Object} input
|
|
1239
1239
|
*/
|
|
1240
|
-
preventDefaults: function(
|
|
1241
|
-
var
|
|
1240
|
+
preventDefaults: function(r) {
|
|
1241
|
+
var i = r.srcEvent, u = r.offsetDirection;
|
|
1242
1242
|
if (this.manager.session.prevented) {
|
|
1243
|
-
|
|
1243
|
+
i.preventDefault();
|
|
1244
1244
|
return;
|
|
1245
1245
|
}
|
|
1246
|
-
var
|
|
1247
|
-
if (
|
|
1248
|
-
var
|
|
1249
|
-
if (
|
|
1246
|
+
var p = this.actions, E = G(p, ke) && !et[ke], M = G(p, je) && !et[je], k = G(p, ze) && !et[ze];
|
|
1247
|
+
if (E) {
|
|
1248
|
+
var ne = r.pointers.length === 1, ce = r.distance < 2, $ = r.deltaTime < 250;
|
|
1249
|
+
if (ne && ce && $)
|
|
1250
1250
|
return;
|
|
1251
1251
|
}
|
|
1252
|
-
if (!(
|
|
1253
|
-
return this.preventSrc(
|
|
1252
|
+
if (!(k && M) && (E || M && u & ue || k && u & de))
|
|
1253
|
+
return this.preventSrc(i);
|
|
1254
1254
|
},
|
|
1255
1255
|
/**
|
|
1256
1256
|
* call preventDefault to prevent the browser's default behavior (scrolling in most cases)
|
|
1257
1257
|
* @param {Object} srcEvent
|
|
1258
1258
|
*/
|
|
1259
|
-
preventSrc: function(
|
|
1260
|
-
this.manager.session.prevented = !0,
|
|
1259
|
+
preventSrc: function(r) {
|
|
1260
|
+
this.manager.session.prevented = !0, r.preventDefault();
|
|
1261
1261
|
}
|
|
1262
1262
|
};
|
|
1263
|
-
function
|
|
1264
|
-
if (
|
|
1265
|
-
return
|
|
1266
|
-
var
|
|
1267
|
-
return
|
|
1268
|
-
}
|
|
1269
|
-
function
|
|
1270
|
-
if (!
|
|
1263
|
+
function wn(r) {
|
|
1264
|
+
if (G(r, ke))
|
|
1265
|
+
return ke;
|
|
1266
|
+
var i = G(r, ze), u = G(r, je);
|
|
1267
|
+
return i && u ? ke : i || u ? i ? ze : je : G(r, pt) ? pt : zt;
|
|
1268
|
+
}
|
|
1269
|
+
function En() {
|
|
1270
|
+
if (!Rt)
|
|
1271
1271
|
return !1;
|
|
1272
|
-
var
|
|
1273
|
-
return ["auto", "manipulation", "pan-y", "pan-x", "pan-x pan-y", "none"].forEach(function(
|
|
1274
|
-
|
|
1275
|
-
}),
|
|
1272
|
+
var r = {}, i = h.CSS && h.CSS.supports;
|
|
1273
|
+
return ["auto", "manipulation", "pan-y", "pan-x", "pan-x pan-y", "none"].forEach(function(u) {
|
|
1274
|
+
r[u] = i ? h.CSS.supports("touch-action", u) : !0;
|
|
1275
|
+
}), r;
|
|
1276
1276
|
}
|
|
1277
|
-
var tt = 1,
|
|
1278
|
-
function
|
|
1279
|
-
this.options =
|
|
1277
|
+
var tt = 1, fe = 2, Fe = 4, Se = 8, we = Se, Ge = 16, me = 32;
|
|
1278
|
+
function Ee(r) {
|
|
1279
|
+
this.options = A({}, this.defaults, r || {}), this.id = D(), this.manager = null, this.options.enable = m(this.options.enable, !0), this.state = tt, this.simultaneous = {}, this.requireFail = [];
|
|
1280
1280
|
}
|
|
1281
|
-
|
|
1281
|
+
Ee.prototype = {
|
|
1282
1282
|
/**
|
|
1283
1283
|
* @virtual
|
|
1284
1284
|
* @type {Object}
|
|
@@ -1289,50 +1289,50 @@ var wt = (function(f, o, e, a) {
|
|
|
1289
1289
|
* @param {Object} options
|
|
1290
1290
|
* @return {Recognizer}
|
|
1291
1291
|
*/
|
|
1292
|
-
set: function(
|
|
1293
|
-
return
|
|
1292
|
+
set: function(r) {
|
|
1293
|
+
return A(this.options, r), this.manager && this.manager.touchAction.update(), this;
|
|
1294
1294
|
},
|
|
1295
1295
|
/**
|
|
1296
1296
|
* recognize simultaneous with an other recognizer.
|
|
1297
1297
|
* @param {Recognizer} otherRecognizer
|
|
1298
1298
|
* @returns {Recognizer} this
|
|
1299
1299
|
*/
|
|
1300
|
-
recognizeWith: function(
|
|
1301
|
-
if (
|
|
1300
|
+
recognizeWith: function(r) {
|
|
1301
|
+
if (y(r, "recognizeWith", this))
|
|
1302
1302
|
return this;
|
|
1303
|
-
var
|
|
1304
|
-
return
|
|
1303
|
+
var i = this.simultaneous;
|
|
1304
|
+
return r = nt(r, this), i[r.id] || (i[r.id] = r, r.recognizeWith(this)), this;
|
|
1305
1305
|
},
|
|
1306
1306
|
/**
|
|
1307
1307
|
* drop the simultaneous link. it doesnt remove the link on the other recognizer.
|
|
1308
1308
|
* @param {Recognizer} otherRecognizer
|
|
1309
1309
|
* @returns {Recognizer} this
|
|
1310
1310
|
*/
|
|
1311
|
-
dropRecognizeWith: function(
|
|
1312
|
-
return
|
|
1311
|
+
dropRecognizeWith: function(r) {
|
|
1312
|
+
return y(r, "dropRecognizeWith", this) ? this : (r = nt(r, this), delete this.simultaneous[r.id], this);
|
|
1313
1313
|
},
|
|
1314
1314
|
/**
|
|
1315
1315
|
* recognizer can only run when an other is failing
|
|
1316
1316
|
* @param {Recognizer} otherRecognizer
|
|
1317
1317
|
* @returns {Recognizer} this
|
|
1318
1318
|
*/
|
|
1319
|
-
requireFailure: function(
|
|
1320
|
-
if (
|
|
1319
|
+
requireFailure: function(r) {
|
|
1320
|
+
if (y(r, "requireFailure", this))
|
|
1321
1321
|
return this;
|
|
1322
|
-
var
|
|
1323
|
-
return
|
|
1322
|
+
var i = this.requireFail;
|
|
1323
|
+
return r = nt(r, this), Q(i, r) === -1 && (i.push(r), r.requireFailure(this)), this;
|
|
1324
1324
|
},
|
|
1325
1325
|
/**
|
|
1326
1326
|
* drop the requireFailure link. it does not remove the link on the other recognizer.
|
|
1327
1327
|
* @param {Recognizer} otherRecognizer
|
|
1328
1328
|
* @returns {Recognizer} this
|
|
1329
1329
|
*/
|
|
1330
|
-
dropRequireFailure: function(
|
|
1331
|
-
if (
|
|
1330
|
+
dropRequireFailure: function(r) {
|
|
1331
|
+
if (y(r, "dropRequireFailure", this))
|
|
1332
1332
|
return this;
|
|
1333
|
-
|
|
1334
|
-
var
|
|
1335
|
-
return
|
|
1333
|
+
r = nt(r, this);
|
|
1334
|
+
var i = Q(this.requireFail, r);
|
|
1335
|
+
return i > -1 && this.requireFail.splice(i, 1), this;
|
|
1336
1336
|
},
|
|
1337
1337
|
/**
|
|
1338
1338
|
* has require failures boolean
|
|
@@ -1346,20 +1346,20 @@ var wt = (function(f, o, e, a) {
|
|
|
1346
1346
|
* @param {Recognizer} otherRecognizer
|
|
1347
1347
|
* @returns {Boolean}
|
|
1348
1348
|
*/
|
|
1349
|
-
canRecognizeWith: function(
|
|
1350
|
-
return !!this.simultaneous[
|
|
1349
|
+
canRecognizeWith: function(r) {
|
|
1350
|
+
return !!this.simultaneous[r.id];
|
|
1351
1351
|
},
|
|
1352
1352
|
/**
|
|
1353
1353
|
* You should use `tryEmit` instead of `emit` directly to check
|
|
1354
1354
|
* that all the needed recognizers has failed before emitting.
|
|
1355
1355
|
* @param {Object} input
|
|
1356
1356
|
*/
|
|
1357
|
-
emit: function(
|
|
1358
|
-
var
|
|
1359
|
-
function
|
|
1360
|
-
|
|
1357
|
+
emit: function(r) {
|
|
1358
|
+
var i = this, u = this.state;
|
|
1359
|
+
function p(E) {
|
|
1360
|
+
i.manager.emit(E, r);
|
|
1361
1361
|
}
|
|
1362
|
-
|
|
1362
|
+
u < Se && p(i.options.event + jt(u)), p(i.options.event), r.additionalEvent && p(r.additionalEvent), u >= Se && p(i.options.event + jt(u));
|
|
1363
1363
|
},
|
|
1364
1364
|
/**
|
|
1365
1365
|
* Check that all the require failure recognizers has failed,
|
|
@@ -1367,20 +1367,20 @@ var wt = (function(f, o, e, a) {
|
|
|
1367
1367
|
* otherwise, setup the state to FAILED.
|
|
1368
1368
|
* @param {Object} input
|
|
1369
1369
|
*/
|
|
1370
|
-
tryEmit: function(
|
|
1370
|
+
tryEmit: function(r) {
|
|
1371
1371
|
if (this.canEmit())
|
|
1372
|
-
return this.emit(
|
|
1373
|
-
this.state =
|
|
1372
|
+
return this.emit(r);
|
|
1373
|
+
this.state = me;
|
|
1374
1374
|
},
|
|
1375
1375
|
/**
|
|
1376
1376
|
* can we emit?
|
|
1377
1377
|
* @returns {boolean}
|
|
1378
1378
|
*/
|
|
1379
1379
|
canEmit: function() {
|
|
1380
|
-
for (var
|
|
1381
|
-
if (!(this.requireFail[
|
|
1380
|
+
for (var r = 0; r < this.requireFail.length; ) {
|
|
1381
|
+
if (!(this.requireFail[r].state & (me | tt)))
|
|
1382
1382
|
return !1;
|
|
1383
|
-
|
|
1383
|
+
r++;
|
|
1384
1384
|
}
|
|
1385
1385
|
return !0;
|
|
1386
1386
|
},
|
|
@@ -1388,13 +1388,13 @@ var wt = (function(f, o, e, a) {
|
|
|
1388
1388
|
* update the recognizer
|
|
1389
1389
|
* @param {Object} inputData
|
|
1390
1390
|
*/
|
|
1391
|
-
recognize: function(
|
|
1392
|
-
var
|
|
1393
|
-
if (!P(this.options.enable, [this,
|
|
1394
|
-
this.reset(), this.state =
|
|
1391
|
+
recognize: function(r) {
|
|
1392
|
+
var i = A({}, r);
|
|
1393
|
+
if (!P(this.options.enable, [this, i])) {
|
|
1394
|
+
this.reset(), this.state = me;
|
|
1395
1395
|
return;
|
|
1396
1396
|
}
|
|
1397
|
-
this.state & (
|
|
1397
|
+
this.state & (we | Ge | me) && (this.state = tt), this.state = this.process(i), this.state & (fe | Fe | Se | Ge) && this.tryEmit(i);
|
|
1398
1398
|
},
|
|
1399
1399
|
/**
|
|
1400
1400
|
* return the state of the recognizer
|
|
@@ -1403,7 +1403,7 @@ var wt = (function(f, o, e, a) {
|
|
|
1403
1403
|
* @param {Object} inputData
|
|
1404
1404
|
* @returns {Const} STATE
|
|
1405
1405
|
*/
|
|
1406
|
-
process: function(
|
|
1406
|
+
process: function(r) {
|
|
1407
1407
|
},
|
|
1408
1408
|
// jshint ignore:line
|
|
1409
1409
|
/**
|
|
@@ -1421,20 +1421,20 @@ var wt = (function(f, o, e, a) {
|
|
|
1421
1421
|
reset: function() {
|
|
1422
1422
|
}
|
|
1423
1423
|
};
|
|
1424
|
-
function
|
|
1425
|
-
return
|
|
1424
|
+
function jt(r) {
|
|
1425
|
+
return r & Ge ? "cancel" : r & Se ? "end" : r & Fe ? "move" : r & fe ? "start" : "";
|
|
1426
1426
|
}
|
|
1427
|
-
function
|
|
1428
|
-
return
|
|
1427
|
+
function Gt(r) {
|
|
1428
|
+
return r == Ae ? "down" : r == Ie ? "up" : r == Pe ? "left" : r == Oe ? "right" : "";
|
|
1429
1429
|
}
|
|
1430
|
-
function nt(
|
|
1431
|
-
var
|
|
1432
|
-
return
|
|
1430
|
+
function nt(r, i) {
|
|
1431
|
+
var u = i.manager;
|
|
1432
|
+
return u ? u.get(r) : r;
|
|
1433
1433
|
}
|
|
1434
|
-
function
|
|
1435
|
-
|
|
1434
|
+
function pe() {
|
|
1435
|
+
Ee.apply(this, arguments);
|
|
1436
1436
|
}
|
|
1437
|
-
|
|
1437
|
+
T(pe, Ee, {
|
|
1438
1438
|
/**
|
|
1439
1439
|
* @namespace
|
|
1440
1440
|
* @memberof AttrRecognizer
|
|
@@ -1452,9 +1452,9 @@ var wt = (function(f, o, e, a) {
|
|
|
1452
1452
|
* @param {Object} input
|
|
1453
1453
|
* @returns {Boolean} recognized
|
|
1454
1454
|
*/
|
|
1455
|
-
attrTest: function(
|
|
1456
|
-
var
|
|
1457
|
-
return
|
|
1455
|
+
attrTest: function(r) {
|
|
1456
|
+
var i = this.options.pointers;
|
|
1457
|
+
return i === 0 || r.pointers.length === i;
|
|
1458
1458
|
},
|
|
1459
1459
|
/**
|
|
1460
1460
|
* Process the input and return the state for the recognizer
|
|
@@ -1462,15 +1462,15 @@ var wt = (function(f, o, e, a) {
|
|
|
1462
1462
|
* @param {Object} input
|
|
1463
1463
|
* @returns {*} State
|
|
1464
1464
|
*/
|
|
1465
|
-
process: function(
|
|
1466
|
-
var
|
|
1467
|
-
return
|
|
1465
|
+
process: function(r) {
|
|
1466
|
+
var i = this.state, u = r.eventType, p = i & (fe | Fe), E = this.attrTest(r);
|
|
1467
|
+
return p && (u & q || !E) ? i | Ge : p || E ? u & W ? i | Se : i & fe ? i | Fe : fe : me;
|
|
1468
1468
|
}
|
|
1469
1469
|
});
|
|
1470
1470
|
function rt() {
|
|
1471
|
-
|
|
1471
|
+
pe.apply(this, arguments), this.pX = null, this.pY = null;
|
|
1472
1472
|
}
|
|
1473
|
-
|
|
1473
|
+
T(rt, pe, {
|
|
1474
1474
|
/**
|
|
1475
1475
|
* @namespace
|
|
1476
1476
|
* @memberof PanRecognizer
|
|
@@ -1482,26 +1482,26 @@ var wt = (function(f, o, e, a) {
|
|
|
1482
1482
|
direction: Ue
|
|
1483
1483
|
},
|
|
1484
1484
|
getTouchAction: function() {
|
|
1485
|
-
var
|
|
1486
|
-
return
|
|
1485
|
+
var r = this.options.direction, i = [];
|
|
1486
|
+
return r & ue && i.push(je), r & de && i.push(ze), i;
|
|
1487
1487
|
},
|
|
1488
|
-
directionTest: function(
|
|
1489
|
-
var
|
|
1490
|
-
return
|
|
1488
|
+
directionTest: function(r) {
|
|
1489
|
+
var i = this.options, u = !0, p = r.distance, E = r.direction, M = r.deltaX, k = r.deltaY;
|
|
1490
|
+
return E & i.direction || (i.direction & ue ? (E = M === 0 ? Ce : M < 0 ? Pe : Oe, u = M != this.pX, p = Math.abs(r.deltaX)) : (E = k === 0 ? Ce : k < 0 ? Ie : Ae, u = k != this.pY, p = Math.abs(r.deltaY))), r.direction = E, u && p > i.threshold && E & i.direction;
|
|
1491
1491
|
},
|
|
1492
|
-
attrTest: function(
|
|
1493
|
-
return
|
|
1492
|
+
attrTest: function(r) {
|
|
1493
|
+
return pe.prototype.attrTest.call(this, r) && (this.state & fe || !(this.state & fe) && this.directionTest(r));
|
|
1494
1494
|
},
|
|
1495
|
-
emit: function(
|
|
1496
|
-
this.pX =
|
|
1497
|
-
var
|
|
1498
|
-
|
|
1495
|
+
emit: function(r) {
|
|
1496
|
+
this.pX = r.deltaX, this.pY = r.deltaY;
|
|
1497
|
+
var i = Gt(r.direction);
|
|
1498
|
+
i && (r.additionalEvent = this.options.event + i), this._super.emit.call(this, r);
|
|
1499
1499
|
}
|
|
1500
1500
|
});
|
|
1501
|
-
function
|
|
1502
|
-
|
|
1501
|
+
function mt() {
|
|
1502
|
+
pe.apply(this, arguments);
|
|
1503
1503
|
}
|
|
1504
|
-
|
|
1504
|
+
T(mt, pe, {
|
|
1505
1505
|
/**
|
|
1506
1506
|
* @namespace
|
|
1507
1507
|
* @memberof PinchRecognizer
|
|
@@ -1512,23 +1512,23 @@ var wt = (function(f, o, e, a) {
|
|
|
1512
1512
|
pointers: 2
|
|
1513
1513
|
},
|
|
1514
1514
|
getTouchAction: function() {
|
|
1515
|
-
return [
|
|
1515
|
+
return [ke];
|
|
1516
1516
|
},
|
|
1517
|
-
attrTest: function(
|
|
1518
|
-
return this._super.attrTest.call(this,
|
|
1517
|
+
attrTest: function(r) {
|
|
1518
|
+
return this._super.attrTest.call(this, r) && (Math.abs(r.scale - 1) > this.options.threshold || this.state & fe);
|
|
1519
1519
|
},
|
|
1520
|
-
emit: function(
|
|
1521
|
-
if (
|
|
1522
|
-
var
|
|
1523
|
-
|
|
1520
|
+
emit: function(r) {
|
|
1521
|
+
if (r.scale !== 1) {
|
|
1522
|
+
var i = r.scale < 1 ? "in" : "out";
|
|
1523
|
+
r.additionalEvent = this.options.event + i;
|
|
1524
1524
|
}
|
|
1525
|
-
this._super.emit.call(this,
|
|
1525
|
+
this._super.emit.call(this, r);
|
|
1526
1526
|
}
|
|
1527
1527
|
});
|
|
1528
|
-
function
|
|
1529
|
-
|
|
1528
|
+
function gt() {
|
|
1529
|
+
Ee.apply(this, arguments), this._timer = null, this._input = null;
|
|
1530
1530
|
}
|
|
1531
|
-
|
|
1531
|
+
T(gt, Ee, {
|
|
1532
1532
|
/**
|
|
1533
1533
|
* @namespace
|
|
1534
1534
|
* @memberof PressRecognizer
|
|
@@ -1542,31 +1542,31 @@ var wt = (function(f, o, e, a) {
|
|
|
1542
1542
|
// a minimal movement is ok, but keep it low
|
|
1543
1543
|
},
|
|
1544
1544
|
getTouchAction: function() {
|
|
1545
|
-
return [
|
|
1545
|
+
return [zt];
|
|
1546
1546
|
},
|
|
1547
|
-
process: function(
|
|
1548
|
-
var
|
|
1549
|
-
if (this._input =
|
|
1547
|
+
process: function(r) {
|
|
1548
|
+
var i = this.options, u = r.pointers.length === i.pointers, p = r.distance < i.threshold, E = r.deltaTime > i.time;
|
|
1549
|
+
if (this._input = r, !p || !u || r.eventType & (W | q) && !E)
|
|
1550
1550
|
this.reset();
|
|
1551
|
-
else if (
|
|
1552
|
-
this.reset(), this._timer =
|
|
1553
|
-
this.state =
|
|
1554
|
-
},
|
|
1555
|
-
else if (
|
|
1556
|
-
return
|
|
1557
|
-
return
|
|
1551
|
+
else if (r.eventType & L)
|
|
1552
|
+
this.reset(), this._timer = g(function() {
|
|
1553
|
+
this.state = we, this.tryEmit();
|
|
1554
|
+
}, i.time, this);
|
|
1555
|
+
else if (r.eventType & W)
|
|
1556
|
+
return we;
|
|
1557
|
+
return me;
|
|
1558
1558
|
},
|
|
1559
1559
|
reset: function() {
|
|
1560
1560
|
clearTimeout(this._timer);
|
|
1561
1561
|
},
|
|
1562
|
-
emit: function(
|
|
1563
|
-
this.state ===
|
|
1562
|
+
emit: function(r) {
|
|
1563
|
+
this.state === we && (r && r.eventType & W ? this.manager.emit(this.options.event + "up", r) : (this._input.timeStamp = c(), this.manager.emit(this.options.event, this._input)));
|
|
1564
1564
|
}
|
|
1565
1565
|
});
|
|
1566
|
-
function
|
|
1567
|
-
|
|
1566
|
+
function yt() {
|
|
1567
|
+
pe.apply(this, arguments);
|
|
1568
1568
|
}
|
|
1569
|
-
|
|
1569
|
+
T(yt, pe, {
|
|
1570
1570
|
/**
|
|
1571
1571
|
* @namespace
|
|
1572
1572
|
* @memberof RotateRecognizer
|
|
@@ -1577,16 +1577,16 @@ var wt = (function(f, o, e, a) {
|
|
|
1577
1577
|
pointers: 2
|
|
1578
1578
|
},
|
|
1579
1579
|
getTouchAction: function() {
|
|
1580
|
-
return [
|
|
1580
|
+
return [ke];
|
|
1581
1581
|
},
|
|
1582
|
-
attrTest: function(
|
|
1583
|
-
return this._super.attrTest.call(this,
|
|
1582
|
+
attrTest: function(r) {
|
|
1583
|
+
return this._super.attrTest.call(this, r) && (Math.abs(r.rotation) > this.options.threshold || this.state & fe);
|
|
1584
1584
|
}
|
|
1585
1585
|
});
|
|
1586
|
-
function
|
|
1587
|
-
|
|
1586
|
+
function bt() {
|
|
1587
|
+
pe.apply(this, arguments);
|
|
1588
1588
|
}
|
|
1589
|
-
|
|
1589
|
+
T(bt, pe, {
|
|
1590
1590
|
/**
|
|
1591
1591
|
* @namespace
|
|
1592
1592
|
* @memberof SwipeRecognizer
|
|
@@ -1595,25 +1595,25 @@ var wt = (function(f, o, e, a) {
|
|
|
1595
1595
|
event: "swipe",
|
|
1596
1596
|
threshold: 10,
|
|
1597
1597
|
velocity: 0.3,
|
|
1598
|
-
direction:
|
|
1598
|
+
direction: ue | de,
|
|
1599
1599
|
pointers: 1
|
|
1600
1600
|
},
|
|
1601
1601
|
getTouchAction: function() {
|
|
1602
1602
|
return rt.prototype.getTouchAction.call(this);
|
|
1603
1603
|
},
|
|
1604
|
-
attrTest: function(
|
|
1605
|
-
var
|
|
1606
|
-
return
|
|
1604
|
+
attrTest: function(r) {
|
|
1605
|
+
var i = this.options.direction, u;
|
|
1606
|
+
return i & (ue | de) ? u = r.overallVelocity : i & ue ? u = r.overallVelocityX : i & de && (u = r.overallVelocityY), this._super.attrTest.call(this, r) && i & r.offsetDirection && r.distance > this.options.threshold && r.maxPointers == this.options.pointers && f(u) > this.options.velocity && r.eventType & W;
|
|
1607
1607
|
},
|
|
1608
|
-
emit: function(
|
|
1609
|
-
var
|
|
1610
|
-
|
|
1608
|
+
emit: function(r) {
|
|
1609
|
+
var i = Gt(r.offsetDirection);
|
|
1610
|
+
i && this.manager.emit(this.options.event + i, r), this.manager.emit(this.options.event, r);
|
|
1611
1611
|
}
|
|
1612
1612
|
});
|
|
1613
|
-
function
|
|
1614
|
-
|
|
1613
|
+
function it() {
|
|
1614
|
+
Ee.apply(this, arguments), this.pTime = !1, this.pCenter = !1, this._timer = null, this._input = null, this.count = 0;
|
|
1615
1615
|
}
|
|
1616
|
-
|
|
1616
|
+
T(it, Ee, {
|
|
1617
1617
|
/**
|
|
1618
1618
|
* @namespace
|
|
1619
1619
|
* @memberof PinchRecognizer
|
|
@@ -1634,39 +1634,39 @@ var wt = (function(f, o, e, a) {
|
|
|
1634
1634
|
getTouchAction: function() {
|
|
1635
1635
|
return [pt];
|
|
1636
1636
|
},
|
|
1637
|
-
process: function(
|
|
1638
|
-
var
|
|
1639
|
-
if (this.reset(),
|
|
1637
|
+
process: function(r) {
|
|
1638
|
+
var i = this.options, u = r.pointers.length === i.pointers, p = r.distance < i.threshold, E = r.deltaTime < i.time;
|
|
1639
|
+
if (this.reset(), r.eventType & L && this.count === 0)
|
|
1640
1640
|
return this.failTimeout();
|
|
1641
|
-
if (
|
|
1642
|
-
if (
|
|
1641
|
+
if (p && E && u) {
|
|
1642
|
+
if (r.eventType != W)
|
|
1643
1643
|
return this.failTimeout();
|
|
1644
|
-
var
|
|
1645
|
-
this.pTime =
|
|
1646
|
-
var
|
|
1647
|
-
if (
|
|
1648
|
-
return this.hasRequireFailures() ? (this._timer =
|
|
1649
|
-
this.state =
|
|
1650
|
-
},
|
|
1651
|
-
}
|
|
1652
|
-
return
|
|
1644
|
+
var M = this.pTime ? r.timeStamp - this.pTime < i.interval : !0, k = !this.pCenter || Qe(this.pCenter, r.center) < i.posThreshold;
|
|
1645
|
+
this.pTime = r.timeStamp, this.pCenter = r.center, !k || !M ? this.count = 1 : this.count += 1, this._input = r;
|
|
1646
|
+
var ne = this.count % i.taps;
|
|
1647
|
+
if (ne === 0)
|
|
1648
|
+
return this.hasRequireFailures() ? (this._timer = g(function() {
|
|
1649
|
+
this.state = we, this.tryEmit();
|
|
1650
|
+
}, i.interval, this), fe) : we;
|
|
1651
|
+
}
|
|
1652
|
+
return me;
|
|
1653
1653
|
},
|
|
1654
1654
|
failTimeout: function() {
|
|
1655
|
-
return this._timer =
|
|
1656
|
-
this.state =
|
|
1657
|
-
}, this.options.interval, this),
|
|
1655
|
+
return this._timer = g(function() {
|
|
1656
|
+
this.state = me;
|
|
1657
|
+
}, this.options.interval, this), me;
|
|
1658
1658
|
},
|
|
1659
1659
|
reset: function() {
|
|
1660
1660
|
clearTimeout(this._timer);
|
|
1661
1661
|
},
|
|
1662
1662
|
emit: function() {
|
|
1663
|
-
this.state ==
|
|
1663
|
+
this.state == we && (this._input.tapCount = this.count, this.manager.emit(this.options.event, this._input));
|
|
1664
1664
|
}
|
|
1665
1665
|
});
|
|
1666
|
-
function
|
|
1667
|
-
return
|
|
1666
|
+
function Be(r, i) {
|
|
1667
|
+
return i = i || {}, i.recognizers = m(i.recognizers, Be.defaults.preset), new wt(r, i);
|
|
1668
1668
|
}
|
|
1669
|
-
|
|
1669
|
+
Be.VERSION = "2.0.7", Be.defaults = {
|
|
1670
1670
|
/**
|
|
1671
1671
|
* set if DOM events are being triggered.
|
|
1672
1672
|
* But this is slower and unused by simple implementations, so disabled by default.
|
|
@@ -1680,7 +1680,7 @@ var wt = (function(f, o, e, a) {
|
|
|
1680
1680
|
* @type {String}
|
|
1681
1681
|
* @default compute
|
|
1682
1682
|
*/
|
|
1683
|
-
touchAction:
|
|
1683
|
+
touchAction: Vt,
|
|
1684
1684
|
/**
|
|
1685
1685
|
* @type {Boolean}
|
|
1686
1686
|
* @default true
|
|
@@ -1707,13 +1707,13 @@ var wt = (function(f, o, e, a) {
|
|
|
1707
1707
|
*/
|
|
1708
1708
|
preset: [
|
|
1709
1709
|
// RecognizerClass, options, [recognizeWith, ...], [requireFailure, ...]
|
|
1710
|
-
[
|
|
1711
|
-
[
|
|
1712
|
-
[
|
|
1713
|
-
[rt, { direction:
|
|
1714
|
-
[
|
|
1715
|
-
[
|
|
1716
|
-
[
|
|
1710
|
+
[yt, { enable: !1 }],
|
|
1711
|
+
[mt, { enable: !1 }, ["rotate"]],
|
|
1712
|
+
[bt, { direction: ue }],
|
|
1713
|
+
[rt, { direction: ue }, ["swipe"]],
|
|
1714
|
+
[it],
|
|
1715
|
+
[it, { event: "doubletap", taps: 2 }, ["tap"]],
|
|
1716
|
+
[gt]
|
|
1717
1717
|
],
|
|
1718
1718
|
/**
|
|
1719
1719
|
* Some CSS properties can be used to improve the working of Hammer.
|
|
@@ -1762,21 +1762,21 @@ var wt = (function(f, o, e, a) {
|
|
|
1762
1762
|
tapHighlightColor: "rgba(0,0,0,0)"
|
|
1763
1763
|
}
|
|
1764
1764
|
};
|
|
1765
|
-
var
|
|
1766
|
-
function
|
|
1767
|
-
this.options =
|
|
1768
|
-
var
|
|
1769
|
-
|
|
1765
|
+
var Tn = 1, Yt = 2;
|
|
1766
|
+
function wt(r, i) {
|
|
1767
|
+
this.options = A({}, Be.defaults, i || {}), this.options.inputTarget = this.options.inputTarget || r, this.handlers = {}, this.session = {}, this.recognizers = [], this.oldCssProps = {}, this.element = r, this.input = Ke(this), this.touchAction = new vt(this, this.options.touchAction), Ht(this, !0), w(this.options.recognizers, function(u) {
|
|
1768
|
+
var p = this.add(new u[0](u[1]));
|
|
1769
|
+
u[2] && p.recognizeWith(u[2]), u[3] && p.requireFailure(u[3]);
|
|
1770
1770
|
}, this);
|
|
1771
1771
|
}
|
|
1772
|
-
|
|
1772
|
+
wt.prototype = {
|
|
1773
1773
|
/**
|
|
1774
1774
|
* set options
|
|
1775
1775
|
* @param {Object} options
|
|
1776
1776
|
* @returns {Manager}
|
|
1777
1777
|
*/
|
|
1778
|
-
set: function(
|
|
1779
|
-
return
|
|
1778
|
+
set: function(r) {
|
|
1779
|
+
return A(this.options, r), r.touchAction && this.touchAction.update(), r.inputTarget && (this.input.destroy(), this.input.target = r.inputTarget, this.input.init()), this;
|
|
1780
1780
|
},
|
|
1781
1781
|
/**
|
|
1782
1782
|
* stop recognizing for this session.
|
|
@@ -1784,8 +1784,8 @@ var wt = (function(f, o, e, a) {
|
|
|
1784
1784
|
* When forced, the recognizer cycle is stopped immediately.
|
|
1785
1785
|
* @param {Boolean} [force]
|
|
1786
1786
|
*/
|
|
1787
|
-
stop: function(
|
|
1788
|
-
this.session.stopped =
|
|
1787
|
+
stop: function(r) {
|
|
1788
|
+
this.session.stopped = r ? Yt : Tn;
|
|
1789
1789
|
},
|
|
1790
1790
|
/**
|
|
1791
1791
|
* run the recognizers!
|
|
@@ -1793,16 +1793,16 @@ var wt = (function(f, o, e, a) {
|
|
|
1793
1793
|
* it walks through all the recognizers and tries to detect the gesture that is being made
|
|
1794
1794
|
* @param {Object} inputData
|
|
1795
1795
|
*/
|
|
1796
|
-
recognize: function(
|
|
1797
|
-
var
|
|
1798
|
-
if (!
|
|
1799
|
-
this.touchAction.preventDefaults(
|
|
1800
|
-
var
|
|
1801
|
-
(!
|
|
1802
|
-
for (var
|
|
1803
|
-
|
|
1804
|
-
(!
|
|
1805
|
-
|
|
1796
|
+
recognize: function(r) {
|
|
1797
|
+
var i = this.session;
|
|
1798
|
+
if (!i.stopped) {
|
|
1799
|
+
this.touchAction.preventDefaults(r);
|
|
1800
|
+
var u, p = this.recognizers, E = i.curRecognizer;
|
|
1801
|
+
(!E || E && E.state & we) && (E = i.curRecognizer = null);
|
|
1802
|
+
for (var M = 0; M < p.length; )
|
|
1803
|
+
u = p[M], i.stopped !== Yt && // 1
|
|
1804
|
+
(!E || u == E || // 2
|
|
1805
|
+
u.canRecognizeWith(E)) ? u.recognize(r) : u.reset(), !E && u.state & (fe | Fe | Se) && (E = i.curRecognizer = u), M++;
|
|
1806
1806
|
}
|
|
1807
1807
|
},
|
|
1808
1808
|
/**
|
|
@@ -1810,12 +1810,12 @@ var wt = (function(f, o, e, a) {
|
|
|
1810
1810
|
* @param {Recognizer|String} recognizer
|
|
1811
1811
|
* @returns {Recognizer|Null}
|
|
1812
1812
|
*/
|
|
1813
|
-
get: function(
|
|
1814
|
-
if (
|
|
1815
|
-
return
|
|
1816
|
-
for (var
|
|
1817
|
-
if (
|
|
1818
|
-
return
|
|
1813
|
+
get: function(r) {
|
|
1814
|
+
if (r instanceof Ee)
|
|
1815
|
+
return r;
|
|
1816
|
+
for (var i = this.recognizers, u = 0; u < i.length; u++)
|
|
1817
|
+
if (i[u].options.event == r)
|
|
1818
|
+
return i[u];
|
|
1819
1819
|
return null;
|
|
1820
1820
|
},
|
|
1821
1821
|
/**
|
|
@@ -1824,23 +1824,23 @@ var wt = (function(f, o, e, a) {
|
|
|
1824
1824
|
* @param {Recognizer} recognizer
|
|
1825
1825
|
* @returns {Recognizer|Manager}
|
|
1826
1826
|
*/
|
|
1827
|
-
add: function(
|
|
1828
|
-
if (
|
|
1827
|
+
add: function(r) {
|
|
1828
|
+
if (y(r, "add", this))
|
|
1829
1829
|
return this;
|
|
1830
|
-
var
|
|
1831
|
-
return
|
|
1830
|
+
var i = this.get(r.options.event);
|
|
1831
|
+
return i && this.remove(i), this.recognizers.push(r), r.manager = this, this.touchAction.update(), r;
|
|
1832
1832
|
},
|
|
1833
1833
|
/**
|
|
1834
1834
|
* remove a recognizer by name or instance
|
|
1835
1835
|
* @param {Recognizer|String} recognizer
|
|
1836
1836
|
* @returns {Manager}
|
|
1837
1837
|
*/
|
|
1838
|
-
remove: function(
|
|
1839
|
-
if (
|
|
1838
|
+
remove: function(r) {
|
|
1839
|
+
if (y(r, "remove", this))
|
|
1840
1840
|
return this;
|
|
1841
|
-
if (
|
|
1842
|
-
var
|
|
1843
|
-
|
|
1841
|
+
if (r = this.get(r), r) {
|
|
1842
|
+
var i = this.recognizers, u = Q(i, r);
|
|
1843
|
+
u !== -1 && (i.splice(u, 1), this.touchAction.update());
|
|
1844
1844
|
}
|
|
1845
1845
|
return this;
|
|
1846
1846
|
},
|
|
@@ -1850,11 +1850,11 @@ var wt = (function(f, o, e, a) {
|
|
|
1850
1850
|
* @param {Function} handler
|
|
1851
1851
|
* @returns {EventEmitter} this
|
|
1852
1852
|
*/
|
|
1853
|
-
on: function(
|
|
1854
|
-
if (
|
|
1855
|
-
var
|
|
1856
|
-
return
|
|
1857
|
-
|
|
1853
|
+
on: function(r, i) {
|
|
1854
|
+
if (r !== n && i !== n) {
|
|
1855
|
+
var u = this.handlers;
|
|
1856
|
+
return w(U(r), function(p) {
|
|
1857
|
+
u[p] = u[p] || [], u[p].push(i);
|
|
1858
1858
|
}), this;
|
|
1859
1859
|
}
|
|
1860
1860
|
},
|
|
@@ -1864,11 +1864,11 @@ var wt = (function(f, o, e, a) {
|
|
|
1864
1864
|
* @param {Function} [handler]
|
|
1865
1865
|
* @returns {EventEmitter} this
|
|
1866
1866
|
*/
|
|
1867
|
-
off: function(
|
|
1868
|
-
if (
|
|
1869
|
-
var
|
|
1870
|
-
return
|
|
1871
|
-
|
|
1867
|
+
off: function(r, i) {
|
|
1868
|
+
if (r !== n) {
|
|
1869
|
+
var u = this.handlers;
|
|
1870
|
+
return w(U(r), function(p) {
|
|
1871
|
+
i ? u[p] && u[p].splice(Q(u[p], i), 1) : delete u[p];
|
|
1872
1872
|
}), this;
|
|
1873
1873
|
}
|
|
1874
1874
|
},
|
|
@@ -1877,15 +1877,15 @@ var wt = (function(f, o, e, a) {
|
|
|
1877
1877
|
* @param {String} event
|
|
1878
1878
|
* @param {Object} data
|
|
1879
1879
|
*/
|
|
1880
|
-
emit: function(
|
|
1881
|
-
this.options.domEvents &&
|
|
1882
|
-
var
|
|
1883
|
-
if (!(!
|
|
1884
|
-
|
|
1885
|
-
|
|
1880
|
+
emit: function(r, i) {
|
|
1881
|
+
this.options.domEvents && xn(r, i);
|
|
1882
|
+
var u = this.handlers[r] && this.handlers[r].slice();
|
|
1883
|
+
if (!(!u || !u.length)) {
|
|
1884
|
+
i.type = r, i.preventDefault = function() {
|
|
1885
|
+
i.srcEvent.preventDefault();
|
|
1886
1886
|
};
|
|
1887
|
-
for (var
|
|
1888
|
-
|
|
1887
|
+
for (var p = 0; p < u.length; )
|
|
1888
|
+
u[p](i), p++;
|
|
1889
1889
|
}
|
|
1890
1890
|
},
|
|
1891
1891
|
/**
|
|
@@ -1893,87 +1893,87 @@ var wt = (function(f, o, e, a) {
|
|
|
1893
1893
|
* it doesn't unbind dom events, that is the user own responsibility
|
|
1894
1894
|
*/
|
|
1895
1895
|
destroy: function() {
|
|
1896
|
-
this.element &&
|
|
1896
|
+
this.element && Ht(this, !1), this.handlers = {}, this.session = {}, this.input.destroy(), this.element = null;
|
|
1897
1897
|
}
|
|
1898
1898
|
};
|
|
1899
|
-
function
|
|
1900
|
-
var
|
|
1901
|
-
if (
|
|
1902
|
-
var
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
}),
|
|
1899
|
+
function Ht(r, i) {
|
|
1900
|
+
var u = r.element;
|
|
1901
|
+
if (u.style) {
|
|
1902
|
+
var p;
|
|
1903
|
+
w(r.options.cssProps, function(E, M) {
|
|
1904
|
+
p = J(u.style, M), i ? (r.oldCssProps[p] = u.style[p], u.style[p] = E) : u.style[p] = r.oldCssProps[p] || "";
|
|
1905
|
+
}), i || (r.oldCssProps = {});
|
|
1906
1906
|
}
|
|
1907
1907
|
}
|
|
1908
|
-
function
|
|
1909
|
-
var
|
|
1910
|
-
|
|
1908
|
+
function xn(r, i) {
|
|
1909
|
+
var u = o.createEvent("Event");
|
|
1910
|
+
u.initEvent(r, !0, !0), u.gesture = i, i.target.dispatchEvent(u);
|
|
1911
1911
|
}
|
|
1912
|
-
return
|
|
1913
|
-
INPUT_START:
|
|
1914
|
-
INPUT_MOVE:
|
|
1915
|
-
INPUT_END:
|
|
1916
|
-
INPUT_CANCEL:
|
|
1912
|
+
return A(Be, {
|
|
1913
|
+
INPUT_START: L,
|
|
1914
|
+
INPUT_MOVE: ie,
|
|
1915
|
+
INPUT_END: W,
|
|
1916
|
+
INPUT_CANCEL: q,
|
|
1917
1917
|
STATE_POSSIBLE: tt,
|
|
1918
|
-
STATE_BEGAN:
|
|
1919
|
-
STATE_CHANGED:
|
|
1920
|
-
STATE_ENDED:
|
|
1921
|
-
STATE_RECOGNIZED:
|
|
1922
|
-
STATE_CANCELLED:
|
|
1923
|
-
STATE_FAILED:
|
|
1924
|
-
DIRECTION_NONE:
|
|
1925
|
-
DIRECTION_LEFT:
|
|
1918
|
+
STATE_BEGAN: fe,
|
|
1919
|
+
STATE_CHANGED: Fe,
|
|
1920
|
+
STATE_ENDED: Se,
|
|
1921
|
+
STATE_RECOGNIZED: we,
|
|
1922
|
+
STATE_CANCELLED: Ge,
|
|
1923
|
+
STATE_FAILED: me,
|
|
1924
|
+
DIRECTION_NONE: Ce,
|
|
1925
|
+
DIRECTION_LEFT: Pe,
|
|
1926
1926
|
DIRECTION_RIGHT: Oe,
|
|
1927
|
-
DIRECTION_UP:
|
|
1928
|
-
DIRECTION_DOWN:
|
|
1929
|
-
DIRECTION_HORIZONTAL:
|
|
1930
|
-
DIRECTION_VERTICAL:
|
|
1927
|
+
DIRECTION_UP: Ie,
|
|
1928
|
+
DIRECTION_DOWN: Ae,
|
|
1929
|
+
DIRECTION_HORIZONTAL: ue,
|
|
1930
|
+
DIRECTION_VERTICAL: de,
|
|
1931
1931
|
DIRECTION_ALL: Ue,
|
|
1932
|
-
Manager:
|
|
1933
|
-
Input:
|
|
1934
|
-
TouchAction:
|
|
1932
|
+
Manager: wt,
|
|
1933
|
+
Input: se,
|
|
1934
|
+
TouchAction: vt,
|
|
1935
1935
|
TouchInput: $e,
|
|
1936
1936
|
MouseInput: Je,
|
|
1937
1937
|
PointerEventInput: ht,
|
|
1938
|
-
TouchMouseInput:
|
|
1939
|
-
SingleTouchInput:
|
|
1940
|
-
Recognizer:
|
|
1941
|
-
AttrRecognizer:
|
|
1942
|
-
Tap:
|
|
1938
|
+
TouchMouseInput: dt,
|
|
1939
|
+
SingleTouchInput: Dt,
|
|
1940
|
+
Recognizer: Ee,
|
|
1941
|
+
AttrRecognizer: pe,
|
|
1942
|
+
Tap: it,
|
|
1943
1943
|
Pan: rt,
|
|
1944
|
-
Swipe:
|
|
1945
|
-
Pinch:
|
|
1946
|
-
Rotate:
|
|
1947
|
-
Press:
|
|
1948
|
-
on:
|
|
1949
|
-
off:
|
|
1950
|
-
each:
|
|
1951
|
-
merge:
|
|
1952
|
-
extend:
|
|
1953
|
-
assign:
|
|
1954
|
-
inherit:
|
|
1955
|
-
bindFn:
|
|
1956
|
-
prefixed:
|
|
1957
|
-
}),
|
|
1958
|
-
})(typeof window != "undefined" ? window : {}, typeof document != "undefined" ? document : {}), qe = function(
|
|
1959
|
-
o === void 0 && console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'), o === document && console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'), this.object =
|
|
1960
|
-
return
|
|
1944
|
+
Swipe: bt,
|
|
1945
|
+
Pinch: mt,
|
|
1946
|
+
Rotate: yt,
|
|
1947
|
+
Press: gt,
|
|
1948
|
+
on: C,
|
|
1949
|
+
off: _,
|
|
1950
|
+
each: w,
|
|
1951
|
+
merge: O,
|
|
1952
|
+
extend: S,
|
|
1953
|
+
assign: A,
|
|
1954
|
+
inherit: T,
|
|
1955
|
+
bindFn: b,
|
|
1956
|
+
prefixed: J
|
|
1957
|
+
}), Be;
|
|
1958
|
+
})(typeof window != "undefined" ? window : {}, typeof document != "undefined" ? document : {}), qe = function(h, o) {
|
|
1959
|
+
o === void 0 && console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'), o === document && console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'), this.object = h, this.domElement = o, this.enabled = !0, this.target = new ye(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !1, this.keyPanSpeed = 7, this.autoRotate = !1, this.autoRotateSpeed = 2, this.enableKeys = !0, this.keys = { LEFT: 37, UP: 38, RIGHT: 39, BOTTOM: 40 }, this.mouseButtons = { LEFT: Me.ROTATE, MIDDLE: Me.DOLLY, RIGHT: Me.PAN }, this.touches = { ONE: _e.ROTATE, TWO: _e.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this.getPolarAngle = function() {
|
|
1960
|
+
return c.phi;
|
|
1961
1961
|
}, this.getAzimuthalAngle = function() {
|
|
1962
|
-
return
|
|
1962
|
+
return c.theta;
|
|
1963
1963
|
}, this.saveState = function() {
|
|
1964
1964
|
e.target0.copy(e.target), e.position0.copy(e.object.position), e.zoom0 = e.object.zoom;
|
|
1965
1965
|
}, this.reset = function() {
|
|
1966
|
-
e.target.copy(e.target0), e.object.position.copy(e.position0), e.object.zoom = e.zoom0, e.object.updateProjectionMatrix(), e.dispatchEvent(
|
|
1966
|
+
e.target.copy(e.target0), e.object.position.copy(e.position0), e.object.zoom = e.zoom0, e.object.updateProjectionMatrix(), e.dispatchEvent(n), e.update(), l = s.NONE;
|
|
1967
1967
|
}, this.update = (function() {
|
|
1968
|
-
var
|
|
1968
|
+
var d = new ye(), F = new Xt().setFromUnitVectors(h.up, new ye(0, 1, 0)), K = F.clone().inverse(), te = new ye(), ve = new Xt();
|
|
1969
1969
|
return function() {
|
|
1970
|
-
var
|
|
1971
|
-
return
|
|
1970
|
+
var be = e.object.position;
|
|
1971
|
+
return d.copy(be).sub(e.target), d.applyQuaternion(F), c.setFromVector3(d), e.autoRotate && l === s.NONE && U(H()), e.enableDamping ? (c.theta += g.theta * e.dampingFactor, c.phi += g.phi * e.dampingFactor) : (c.theta += g.theta, c.phi += g.phi), c.theta = Math.max(e.minAzimuthAngle, Math.min(e.maxAzimuthAngle, c.theta)), c.phi = Math.max(e.minPolarAngle, Math.min(e.maxPolarAngle, c.phi)), c.makeSafe(), c.radius *= y, c.radius = Math.max(e.minDistance, Math.min(e.maxDistance, c.radius)), e.enableDamping === !0 ? e.target.addScaledVector(w, e.dampingFactor) : e.target.add(w), d.setFromSpherical(c), d.applyQuaternion(K), be.copy(e.target).add(d), e.object.lookAt(e.target), e.enableDamping === !0 ? (g.theta *= 1 - e.dampingFactor, g.phi *= 1 - e.dampingFactor, w.multiplyScalar(1 - e.dampingFactor)) : (g.set(0, 0, 0), w.set(0, 0, 0)), y = 1, x || te.distanceToSquared(e.object.position) > f || 8 * (1 - ve.dot(e.object.quaternion)) > f ? (e.dispatchEvent(n), te.copy(e.object.position), ve.copy(e.object.quaternion), x = !1, !0) : !1;
|
|
1972
1972
|
};
|
|
1973
1973
|
})(), this.dispose = function() {
|
|
1974
|
-
e.domElement.removeEventListener("contextmenu", Ze, !1), e.domElement.removeEventListener("mousedown",
|
|
1974
|
+
e.domElement.removeEventListener("contextmenu", Ze, !1), e.domElement.removeEventListener("mousedown", Ae, !1), e.domElement.removeEventListener("wheel", Ue, !1), e.domElement.removeEventListener("touchstart", Ne, !1), e.domElement.removeEventListener("touchend", Ke, !1), e.domElement.removeEventListener("touchmove", se, !1), document.removeEventListener("mousemove", ue, !1), document.removeEventListener("mouseup", de, !1), e.domElement.removeEventListener("keydown", Re, !1);
|
|
1975
1975
|
};
|
|
1976
|
-
var e = this,
|
|
1976
|
+
var e = this, n = { type: "change" }, t = { type: "start" }, a = { type: "end" }, s = {
|
|
1977
1977
|
NONE: -1,
|
|
1978
1978
|
ROTATE: 0,
|
|
1979
1979
|
DOLLY: 1,
|
|
@@ -1982,440 +1982,440 @@ var wt = (function(f, o, e, a) {
|
|
|
1982
1982
|
TOUCH_PAN: 4,
|
|
1983
1983
|
TOUCH_DOLLY_PAN: 5,
|
|
1984
1984
|
TOUCH_DOLLY_ROTATE: 6
|
|
1985
|
-
}, l =
|
|
1986
|
-
function
|
|
1985
|
+
}, l = s.NONE, f = 1e-6, c = new Wt(), g = new Wt(), y = 1, w = new ye(), x = !1, A = new Te(), S = new Te(), O = new Te(), T = new Te(), b = new Te(), P = new Te(), m = new Te(), C = new Te(), _ = new Te();
|
|
1986
|
+
function H() {
|
|
1987
1987
|
return 2 * Math.PI / 60 / 60 * e.autoRotateSpeed;
|
|
1988
1988
|
}
|
|
1989
|
-
function
|
|
1989
|
+
function G() {
|
|
1990
1990
|
return Math.pow(0.95, e.zoomSpeed);
|
|
1991
1991
|
}
|
|
1992
|
-
function
|
|
1993
|
-
|
|
1992
|
+
function U(d) {
|
|
1993
|
+
g.theta -= d;
|
|
1994
1994
|
}
|
|
1995
|
-
function
|
|
1996
|
-
|
|
1995
|
+
function Q(d) {
|
|
1996
|
+
g.phi -= d;
|
|
1997
1997
|
}
|
|
1998
|
-
var
|
|
1999
|
-
var
|
|
2000
|
-
return function(
|
|
2001
|
-
|
|
1998
|
+
var oe = (function() {
|
|
1999
|
+
var d = new ye();
|
|
2000
|
+
return function(K, te) {
|
|
2001
|
+
d.setFromMatrixColumn(te, 0), d.multiplyScalar(-K), w.add(d);
|
|
2002
2002
|
};
|
|
2003
|
-
})(),
|
|
2004
|
-
var
|
|
2005
|
-
return function(
|
|
2006
|
-
e.screenSpacePanning === !0 ?
|
|
2003
|
+
})(), le = (function() {
|
|
2004
|
+
var d = new ye();
|
|
2005
|
+
return function(K, te) {
|
|
2006
|
+
e.screenSpacePanning === !0 ? d.setFromMatrixColumn(te, 1) : (d.setFromMatrixColumn(te, 0), d.crossVectors(e.object.up, d)), d.multiplyScalar(K), w.add(d);
|
|
2007
2007
|
};
|
|
2008
|
-
})(),
|
|
2009
|
-
var
|
|
2010
|
-
return function(
|
|
2011
|
-
var
|
|
2008
|
+
})(), J = (function() {
|
|
2009
|
+
var d = new ye();
|
|
2010
|
+
return function(K, te) {
|
|
2011
|
+
var ve = e.domElement;
|
|
2012
2012
|
if (e.object.isPerspectiveCamera) {
|
|
2013
2013
|
var Ve = e.object.position;
|
|
2014
|
-
|
|
2015
|
-
var
|
|
2016
|
-
|
|
2017
|
-
} else e.object.isOrthographicCamera ? (
|
|
2014
|
+
d.copy(Ve).sub(e.target);
|
|
2015
|
+
var be = d.length();
|
|
2016
|
+
be *= Math.tan(e.object.fov / 2 * Math.PI / 180), oe(2 * K * be / ve.clientHeight, e.object.matrix), le(2 * te * be / ve.clientHeight, e.object.matrix);
|
|
2017
|
+
} else e.object.isOrthographicCamera ? (oe(K * (e.object.right - e.object.left) / e.object.zoom / ve.clientWidth, e.object.matrix), le(te * (e.object.top - e.object.bottom) / e.object.zoom / ve.clientHeight, e.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), e.enablePan = !1);
|
|
2018
2018
|
};
|
|
2019
2019
|
})();
|
|
2020
|
-
function
|
|
2021
|
-
e.object.isPerspectiveCamera ?
|
|
2020
|
+
function Z(d) {
|
|
2021
|
+
e.object.isPerspectiveCamera ? y /= d : e.object.isOrthographicCamera ? (e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom * d)), e.object.updateProjectionMatrix(), x = !0) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
|
|
2022
2022
|
}
|
|
2023
|
-
function
|
|
2024
|
-
e.object.isPerspectiveCamera ?
|
|
2023
|
+
function D(d) {
|
|
2024
|
+
e.object.isPerspectiveCamera ? y *= d : e.object.isOrthographicCamera ? (e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / d)), e.object.updateProjectionMatrix(), x = !0) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
|
|
2025
2025
|
}
|
|
2026
|
-
function I(
|
|
2027
|
-
|
|
2026
|
+
function I(d) {
|
|
2027
|
+
A.set(d.clientX, d.clientY);
|
|
2028
2028
|
}
|
|
2029
|
-
function
|
|
2030
|
-
|
|
2029
|
+
function N(d) {
|
|
2030
|
+
m.set(d.clientX, d.clientY);
|
|
2031
2031
|
}
|
|
2032
|
-
function
|
|
2033
|
-
|
|
2032
|
+
function B(d) {
|
|
2033
|
+
T.set(d.clientX, d.clientY);
|
|
2034
2034
|
}
|
|
2035
|
-
function Y(
|
|
2036
|
-
|
|
2037
|
-
var
|
|
2038
|
-
|
|
2035
|
+
function Y(d) {
|
|
2036
|
+
S.set(d.clientX, d.clientY), O.subVectors(S, A).multiplyScalar(e.rotateSpeed);
|
|
2037
|
+
var F = e.domElement;
|
|
2038
|
+
U(2 * Math.PI * O.x / F.clientHeight), Q(2 * Math.PI * O.y / F.clientHeight), A.copy(S), e.update();
|
|
2039
2039
|
}
|
|
2040
|
-
function
|
|
2041
|
-
|
|
2040
|
+
function ae(d) {
|
|
2041
|
+
C.set(d.clientX, d.clientY), _.subVectors(C, m), _.y > 0 ? Z(G()) : _.y < 0 && D(G()), m.copy(C), e.update();
|
|
2042
2042
|
}
|
|
2043
|
-
function
|
|
2044
|
-
|
|
2043
|
+
function X(d) {
|
|
2044
|
+
b.set(d.clientX, d.clientY), P.subVectors(b, T).multiplyScalar(e.panSpeed), J(P.x, P.y), T.copy(b), e.update();
|
|
2045
2045
|
}
|
|
2046
|
-
function
|
|
2047
|
-
|
|
2046
|
+
function R(d) {
|
|
2047
|
+
d.deltaY < 0 ? D(G()) : d.deltaY > 0 && Z(G()), e.update();
|
|
2048
2048
|
}
|
|
2049
|
-
function
|
|
2050
|
-
var
|
|
2051
|
-
switch (
|
|
2049
|
+
function ee(d) {
|
|
2050
|
+
var F = !1;
|
|
2051
|
+
switch (d.keyCode) {
|
|
2052
2052
|
case e.keys.UP:
|
|
2053
|
-
|
|
2053
|
+
J(0, e.keyPanSpeed), F = !0;
|
|
2054
2054
|
break;
|
|
2055
2055
|
case e.keys.BOTTOM:
|
|
2056
|
-
|
|
2056
|
+
J(0, -e.keyPanSpeed), F = !0;
|
|
2057
2057
|
break;
|
|
2058
2058
|
case e.keys.LEFT:
|
|
2059
|
-
|
|
2059
|
+
J(e.keyPanSpeed, 0), F = !0;
|
|
2060
2060
|
break;
|
|
2061
2061
|
case e.keys.RIGHT:
|
|
2062
|
-
|
|
2062
|
+
J(-e.keyPanSpeed, 0), F = !0;
|
|
2063
2063
|
break;
|
|
2064
2064
|
}
|
|
2065
|
-
|
|
2065
|
+
F && (d.preventDefault(), e.update());
|
|
2066
2066
|
}
|
|
2067
|
-
function
|
|
2068
|
-
if (
|
|
2069
|
-
|
|
2067
|
+
function j(d) {
|
|
2068
|
+
if (d.touches.length == 1)
|
|
2069
|
+
A.set(d.touches[0].pageX, d.touches[0].pageY);
|
|
2070
2070
|
else {
|
|
2071
|
-
var
|
|
2072
|
-
|
|
2071
|
+
var F = 0.5 * (d.touches[0].pageX + d.touches[1].pageX), K = 0.5 * (d.touches[0].pageY + d.touches[1].pageY);
|
|
2072
|
+
A.set(F, K);
|
|
2073
2073
|
}
|
|
2074
2074
|
}
|
|
2075
|
-
function
|
|
2076
|
-
if (
|
|
2077
|
-
|
|
2075
|
+
function z(d) {
|
|
2076
|
+
if (d.touches.length == 1)
|
|
2077
|
+
T.set(d.touches[0].pageX, d.touches[0].pageY);
|
|
2078
2078
|
else {
|
|
2079
|
-
var
|
|
2080
|
-
|
|
2079
|
+
var F = 0.5 * (d.touches[0].pageX + d.touches[1].pageX), K = 0.5 * (d.touches[0].pageY + d.touches[1].pageY);
|
|
2080
|
+
T.set(F, K);
|
|
2081
2081
|
}
|
|
2082
2082
|
}
|
|
2083
|
-
function
|
|
2084
|
-
var
|
|
2085
|
-
|
|
2083
|
+
function L(d) {
|
|
2084
|
+
var F = d.touches[0].pageX - d.touches[1].pageX, K = d.touches[0].pageY - d.touches[1].pageY, te = Math.sqrt(F * F + K * K);
|
|
2085
|
+
m.set(0, te);
|
|
2086
2086
|
}
|
|
2087
|
-
function
|
|
2088
|
-
e.enableZoom &&
|
|
2087
|
+
function ie(d) {
|
|
2088
|
+
e.enableZoom && L(d), e.enablePan && z(d);
|
|
2089
2089
|
}
|
|
2090
|
-
function
|
|
2091
|
-
e.enableZoom &&
|
|
2090
|
+
function W(d) {
|
|
2091
|
+
e.enableZoom && L(d), e.enableRotate && j(d);
|
|
2092
2092
|
}
|
|
2093
|
-
function
|
|
2094
|
-
if (
|
|
2095
|
-
|
|
2093
|
+
function q(d) {
|
|
2094
|
+
if (d.touches.length == 1)
|
|
2095
|
+
S.set(d.touches[0].pageX, d.touches[0].pageY);
|
|
2096
2096
|
else {
|
|
2097
|
-
var
|
|
2098
|
-
|
|
2097
|
+
var F = 0.5 * (d.touches[0].pageX + d.touches[1].pageX), K = 0.5 * (d.touches[0].pageY + d.touches[1].pageY);
|
|
2098
|
+
S.set(F, K);
|
|
2099
2099
|
}
|
|
2100
|
-
|
|
2101
|
-
var
|
|
2102
|
-
|
|
2100
|
+
O.subVectors(S, A).multiplyScalar(e.rotateSpeed);
|
|
2101
|
+
var te = e.domElement;
|
|
2102
|
+
U(2 * Math.PI * O.x / te.clientHeight), Q(2 * Math.PI * O.y / te.clientHeight), A.copy(S);
|
|
2103
2103
|
}
|
|
2104
|
-
function
|
|
2105
|
-
if (
|
|
2106
|
-
|
|
2104
|
+
function Ce(d) {
|
|
2105
|
+
if (d.touches.length == 1)
|
|
2106
|
+
b.set(d.touches[0].pageX, d.touches[0].pageY);
|
|
2107
2107
|
else {
|
|
2108
|
-
var
|
|
2109
|
-
|
|
2108
|
+
var F = 0.5 * (d.touches[0].pageX + d.touches[1].pageX), K = 0.5 * (d.touches[0].pageY + d.touches[1].pageY);
|
|
2109
|
+
b.set(F, K);
|
|
2110
2110
|
}
|
|
2111
|
-
P.subVectors(
|
|
2111
|
+
P.subVectors(b, T).multiplyScalar(e.panSpeed), J(P.x, P.y), T.copy(b);
|
|
2112
2112
|
}
|
|
2113
|
-
function
|
|
2114
|
-
var
|
|
2115
|
-
|
|
2113
|
+
function Pe(d) {
|
|
2114
|
+
var F = d.touches[0].pageX - d.touches[1].pageX, K = d.touches[0].pageY - d.touches[1].pageY, te = Math.sqrt(F * F + K * K);
|
|
2115
|
+
C.set(0, te), _.set(0, Math.pow(C.y / m.y, e.zoomSpeed)), Z(_.y), m.copy(C);
|
|
2116
2116
|
}
|
|
2117
|
-
function Oe(
|
|
2118
|
-
e.enableZoom &&
|
|
2117
|
+
function Oe(d) {
|
|
2118
|
+
e.enableZoom && Pe(d), e.enablePan && Ce(d);
|
|
2119
2119
|
}
|
|
2120
|
-
function
|
|
2121
|
-
e.enableZoom &&
|
|
2120
|
+
function Ie(d) {
|
|
2121
|
+
e.enableZoom && Pe(d), e.enableRotate && q(d);
|
|
2122
2122
|
}
|
|
2123
|
-
function
|
|
2123
|
+
function Ae(d) {
|
|
2124
2124
|
if (e.enabled !== !1) {
|
|
2125
|
-
|
|
2126
|
-
var
|
|
2127
|
-
switch (
|
|
2125
|
+
d.preventDefault(), e.domElement.focus ? e.domElement.focus() : window.focus();
|
|
2126
|
+
var F;
|
|
2127
|
+
switch (d.button) {
|
|
2128
2128
|
case 0:
|
|
2129
|
-
|
|
2129
|
+
F = e.mouseButtons.LEFT;
|
|
2130
2130
|
break;
|
|
2131
2131
|
case 1:
|
|
2132
|
-
|
|
2132
|
+
F = e.mouseButtons.MIDDLE;
|
|
2133
2133
|
break;
|
|
2134
2134
|
case 2:
|
|
2135
|
-
|
|
2135
|
+
F = e.mouseButtons.RIGHT;
|
|
2136
2136
|
break;
|
|
2137
2137
|
default:
|
|
2138
|
-
|
|
2138
|
+
F = -1;
|
|
2139
2139
|
}
|
|
2140
|
-
switch (
|
|
2141
|
-
case
|
|
2140
|
+
switch (F) {
|
|
2141
|
+
case Me.DOLLY:
|
|
2142
2142
|
if (e.enableZoom === !1) return;
|
|
2143
|
-
|
|
2143
|
+
N(d), l = s.DOLLY;
|
|
2144
2144
|
break;
|
|
2145
|
-
case
|
|
2146
|
-
if (
|
|
2145
|
+
case Me.ROTATE:
|
|
2146
|
+
if (d.ctrlKey || d.metaKey || d.shiftKey) {
|
|
2147
2147
|
if (e.enablePan === !1) return;
|
|
2148
|
-
|
|
2148
|
+
B(d), l = s.PAN;
|
|
2149
2149
|
} else {
|
|
2150
2150
|
if (e.enableRotate === !1) return;
|
|
2151
|
-
I(
|
|
2151
|
+
I(d), l = s.ROTATE;
|
|
2152
2152
|
}
|
|
2153
2153
|
break;
|
|
2154
|
-
case
|
|
2155
|
-
if (
|
|
2154
|
+
case Me.PAN:
|
|
2155
|
+
if (d.ctrlKey || d.metaKey || d.shiftKey) {
|
|
2156
2156
|
if (e.enableRotate === !1) return;
|
|
2157
|
-
I(
|
|
2157
|
+
I(d), l = s.ROTATE;
|
|
2158
2158
|
} else {
|
|
2159
2159
|
if (e.enablePan === !1) return;
|
|
2160
|
-
|
|
2160
|
+
B(d), l = s.PAN;
|
|
2161
2161
|
}
|
|
2162
2162
|
break;
|
|
2163
2163
|
default:
|
|
2164
|
-
l =
|
|
2164
|
+
l = s.NONE;
|
|
2165
2165
|
}
|
|
2166
|
-
l !==
|
|
2166
|
+
l !== s.NONE && (document.addEventListener("mousemove", ue, !1), document.addEventListener("mouseup", de, !1), e.dispatchEvent(t));
|
|
2167
2167
|
}
|
|
2168
2168
|
}
|
|
2169
|
-
function
|
|
2169
|
+
function ue(d) {
|
|
2170
2170
|
if (e.enabled !== !1)
|
|
2171
|
-
switch (
|
|
2172
|
-
case
|
|
2171
|
+
switch (d.preventDefault(), l) {
|
|
2172
|
+
case s.ROTATE:
|
|
2173
2173
|
if (e.enableRotate === !1) return;
|
|
2174
|
-
Y(
|
|
2174
|
+
Y(d);
|
|
2175
2175
|
break;
|
|
2176
|
-
case
|
|
2176
|
+
case s.DOLLY:
|
|
2177
2177
|
if (e.enableZoom === !1) return;
|
|
2178
|
-
|
|
2178
|
+
ae(d);
|
|
2179
2179
|
break;
|
|
2180
|
-
case
|
|
2180
|
+
case s.PAN:
|
|
2181
2181
|
if (e.enablePan === !1) return;
|
|
2182
|
-
|
|
2182
|
+
X(d);
|
|
2183
2183
|
break;
|
|
2184
2184
|
}
|
|
2185
2185
|
}
|
|
2186
|
-
function
|
|
2187
|
-
e.enabled !== !1 && (document.removeEventListener("mousemove",
|
|
2186
|
+
function de(d) {
|
|
2187
|
+
e.enabled !== !1 && (document.removeEventListener("mousemove", ue, !1), document.removeEventListener("mouseup", de, !1), e.dispatchEvent(a), l = s.NONE);
|
|
2188
2188
|
}
|
|
2189
|
-
function Ue(
|
|
2190
|
-
e.enabled === !1 || e.enableZoom === !1 || l !==
|
|
2189
|
+
function Ue(d) {
|
|
2190
|
+
e.enabled === !1 || e.enableZoom === !1 || l !== s.NONE && l !== s.ROTATE || (d.preventDefault(), d.stopPropagation(), e.dispatchEvent(t), R(d), e.dispatchEvent(a));
|
|
2191
2191
|
}
|
|
2192
|
-
function
|
|
2193
|
-
e.enabled === !1 || e.enableKeys === !1 || e.enablePan === !1 ||
|
|
2192
|
+
function Re(d) {
|
|
2193
|
+
e.enabled === !1 || e.enableKeys === !1 || e.enablePan === !1 || ee(d);
|
|
2194
2194
|
}
|
|
2195
|
-
function
|
|
2195
|
+
function Ne(d) {
|
|
2196
2196
|
if (e.enabled !== !1) {
|
|
2197
|
-
switch (
|
|
2197
|
+
switch (d.preventDefault(), d.touches.length) {
|
|
2198
2198
|
case 1:
|
|
2199
2199
|
switch (e.touches.ONE) {
|
|
2200
|
-
case
|
|
2200
|
+
case _e.ROTATE:
|
|
2201
2201
|
if (e.enableRotate === !1) return;
|
|
2202
|
-
|
|
2202
|
+
j(d), l = s.TOUCH_ROTATE;
|
|
2203
2203
|
break;
|
|
2204
|
-
case
|
|
2204
|
+
case _e.PAN:
|
|
2205
2205
|
if (e.enablePan === !1) return;
|
|
2206
|
-
|
|
2206
|
+
z(d), l = s.TOUCH_PAN;
|
|
2207
2207
|
break;
|
|
2208
2208
|
default:
|
|
2209
|
-
l =
|
|
2209
|
+
l = s.NONE;
|
|
2210
2210
|
}
|
|
2211
2211
|
break;
|
|
2212
2212
|
case 2:
|
|
2213
2213
|
switch (e.touches.TWO) {
|
|
2214
|
-
case
|
|
2214
|
+
case _e.DOLLY_PAN:
|
|
2215
2215
|
if (e.enableZoom === !1 && e.enablePan === !1) return;
|
|
2216
|
-
|
|
2216
|
+
ie(d), l = s.TOUCH_DOLLY_PAN;
|
|
2217
2217
|
break;
|
|
2218
|
-
case
|
|
2218
|
+
case _e.DOLLY_ROTATE:
|
|
2219
2219
|
if (e.enableZoom === !1 && e.enableRotate === !1) return;
|
|
2220
|
-
|
|
2220
|
+
W(d), l = s.TOUCH_DOLLY_ROTATE;
|
|
2221
2221
|
break;
|
|
2222
2222
|
default:
|
|
2223
|
-
l =
|
|
2223
|
+
l = s.NONE;
|
|
2224
2224
|
}
|
|
2225
2225
|
break;
|
|
2226
2226
|
default:
|
|
2227
|
-
l =
|
|
2227
|
+
l = s.NONE;
|
|
2228
2228
|
}
|
|
2229
|
-
l !==
|
|
2229
|
+
l !== s.NONE && e.dispatchEvent(t);
|
|
2230
2230
|
}
|
|
2231
2231
|
}
|
|
2232
|
-
function
|
|
2232
|
+
function se(d) {
|
|
2233
2233
|
if (e.enabled !== !1)
|
|
2234
|
-
switch (
|
|
2235
|
-
case
|
|
2234
|
+
switch (d.preventDefault(), d.stopPropagation(), l) {
|
|
2235
|
+
case s.TOUCH_ROTATE:
|
|
2236
2236
|
if (e.enableRotate === !1) return;
|
|
2237
|
-
|
|
2237
|
+
q(d), e.update();
|
|
2238
2238
|
break;
|
|
2239
|
-
case
|
|
2239
|
+
case s.TOUCH_PAN:
|
|
2240
2240
|
if (e.enablePan === !1) return;
|
|
2241
|
-
|
|
2241
|
+
Ce(d), e.update();
|
|
2242
2242
|
break;
|
|
2243
|
-
case
|
|
2243
|
+
case s.TOUCH_DOLLY_PAN:
|
|
2244
2244
|
if (e.enableZoom === !1 && e.enablePan === !1) return;
|
|
2245
|
-
Oe(
|
|
2245
|
+
Oe(d), e.update();
|
|
2246
2246
|
break;
|
|
2247
|
-
case
|
|
2247
|
+
case s.TOUCH_DOLLY_ROTATE:
|
|
2248
2248
|
if (e.enableZoom === !1 && e.enableRotate === !1) return;
|
|
2249
|
-
|
|
2249
|
+
Ie(d), e.update();
|
|
2250
2250
|
break;
|
|
2251
2251
|
default:
|
|
2252
|
-
l =
|
|
2252
|
+
l = s.NONE;
|
|
2253
2253
|
}
|
|
2254
2254
|
}
|
|
2255
|
-
function Ke(
|
|
2256
|
-
e.enabled !== !1 && (e.dispatchEvent(
|
|
2255
|
+
function Ke(d) {
|
|
2256
|
+
e.enabled !== !1 && (e.dispatchEvent(a), l = s.NONE);
|
|
2257
2257
|
}
|
|
2258
|
-
function Ze(
|
|
2259
|
-
e.enabled !== !1 &&
|
|
2258
|
+
function Ze(d) {
|
|
2259
|
+
e.enabled !== !1 && d.preventDefault();
|
|
2260
2260
|
}
|
|
2261
|
-
e.domElement.addEventListener("contextmenu", Ze, !1), e.domElement.addEventListener("mousedown",
|
|
2261
|
+
e.domElement.addEventListener("contextmenu", Ze, !1), e.domElement.addEventListener("mousedown", Ae, !1), e.domElement.addEventListener("wheel", Ue, !1), e.domElement.addEventListener("touchstart", Ne, !1), e.domElement.addEventListener("touchend", Ke, !1), e.domElement.addEventListener("touchmove", se, !1), e.domElement.addEventListener("keydown", Re, !1), e.domElement.tabIndex === -1 && (e.domElement.tabIndex = 0), this.update();
|
|
2262
2262
|
};
|
|
2263
|
-
qe.prototype = Object.create(
|
|
2263
|
+
qe.prototype = Object.create(Jt.prototype);
|
|
2264
2264
|
qe.prototype.constructor = qe;
|
|
2265
|
-
var
|
|
2266
|
-
qe.call(this,
|
|
2265
|
+
var _t = function(h, o) {
|
|
2266
|
+
qe.call(this, h, o), this.mouseButtons.LEFT = Me.PAN, this.mouseButtons.RIGHT = Me.ROTATE, this.touches.ONE = _e.PAN, this.touches.TWO = _e.DOLLY_ROTATE;
|
|
2267
2267
|
};
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
var
|
|
2271
|
-
|
|
2268
|
+
_t.prototype = Object.create(Jt.prototype);
|
|
2269
|
+
_t.prototype.constructor = _t;
|
|
2270
|
+
var xe = function(h) {
|
|
2271
|
+
$t.call(this), this.element = h, this.element.style.position = "absolute", this.element.style.pointerEvents = "auto", this.addEventListener("removed", function() {
|
|
2272
2272
|
this.traverse(function(o) {
|
|
2273
2273
|
o.element instanceof Element && o.element.parentNode !== null && o.element.parentNode.removeChild(o.element);
|
|
2274
2274
|
});
|
|
2275
2275
|
});
|
|
2276
2276
|
};
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
var
|
|
2280
|
-
|
|
2277
|
+
xe.prototype = Object.create($t.prototype);
|
|
2278
|
+
xe.prototype.constructor = xe;
|
|
2279
|
+
var ut = function(h) {
|
|
2280
|
+
xe.call(this, h);
|
|
2281
2281
|
};
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
var
|
|
2285
|
-
var
|
|
2282
|
+
ut.prototype = Object.create(xe.prototype);
|
|
2283
|
+
ut.prototype.constructor = ut;
|
|
2284
|
+
var zn = function() {
|
|
2285
|
+
var h = this, o, e, n, t, a = new Mn(), s = {
|
|
2286
2286
|
camera: { fov: 0, style: "" },
|
|
2287
2287
|
objects: /* @__PURE__ */ new WeakMap()
|
|
2288
2288
|
}, l = document.createElement("div");
|
|
2289
2289
|
l.style.overflow = "hidden", this.domElement = l;
|
|
2290
|
-
var
|
|
2291
|
-
|
|
2292
|
-
var
|
|
2290
|
+
var f = document.createElement("div");
|
|
2291
|
+
f.style.WebkitTransformStyle = "preserve-3d", f.style.transformStyle = "preserve-3d", f.style.pointerEvents = "none", l.appendChild(f);
|
|
2292
|
+
var c = /Trident/i.test(navigator.userAgent);
|
|
2293
2293
|
this.getSize = function() {
|
|
2294
2294
|
return {
|
|
2295
2295
|
width: o,
|
|
2296
2296
|
height: e
|
|
2297
2297
|
};
|
|
2298
|
-
}, this.setSize = function(
|
|
2299
|
-
o =
|
|
2298
|
+
}, this.setSize = function(T, b) {
|
|
2299
|
+
o = T, e = b, n = o / 2, t = e / 2, l.style.width = T + "px", l.style.height = b + "px", f.style.width = T + "px", f.style.height = b + "px";
|
|
2300
2300
|
};
|
|
2301
|
-
function
|
|
2302
|
-
return Math.abs(
|
|
2303
|
-
}
|
|
2304
|
-
function T
|
|
2305
|
-
var
|
|
2306
|
-
return "matrix3d(" +
|
|
2307
|
-
}
|
|
2308
|
-
function
|
|
2309
|
-
var P =
|
|
2310
|
-
return
|
|
2311
|
-
}
|
|
2312
|
-
function x(
|
|
2313
|
-
if (
|
|
2314
|
-
|
|
2315
|
-
var
|
|
2316
|
-
|
|
2317
|
-
var
|
|
2318
|
-
if (
|
|
2319
|
-
|
|
2320
|
-
var
|
|
2321
|
-
|
|
2322
|
-
}
|
|
2323
|
-
|
|
2301
|
+
function g(T) {
|
|
2302
|
+
return Math.abs(T) < 1e-10 ? 0 : T;
|
|
2303
|
+
}
|
|
2304
|
+
function y(T) {
|
|
2305
|
+
var b = T.elements;
|
|
2306
|
+
return "matrix3d(" + g(b[0]) + "," + g(-b[1]) + "," + g(b[2]) + "," + g(b[3]) + "," + g(b[4]) + "," + g(-b[5]) + "," + g(b[6]) + "," + g(b[7]) + "," + g(b[8]) + "," + g(-b[9]) + "," + g(b[10]) + "," + g(b[11]) + "," + g(b[12]) + "," + g(-b[13]) + "," + g(b[14]) + "," + g(b[15]) + ")";
|
|
2307
|
+
}
|
|
2308
|
+
function w(T, b) {
|
|
2309
|
+
var P = T.elements, m = "matrix3d(" + g(P[0]) + "," + g(P[1]) + "," + g(P[2]) + "," + g(P[3]) + "," + g(-P[4]) + "," + g(-P[5]) + "," + g(-P[6]) + "," + g(-P[7]) + "," + g(P[8]) + "," + g(P[9]) + "," + g(P[10]) + "," + g(P[11]) + "," + g(P[12]) + "," + g(P[13]) + "," + g(P[14]) + "," + g(P[15]) + ")";
|
|
2310
|
+
return c ? "translate(-50%,-50%)translate(" + n + "px," + t + "px)" + b + m : "translate(-50%,-50%)" + m;
|
|
2311
|
+
}
|
|
2312
|
+
function x(T, b, P, m) {
|
|
2313
|
+
if (T instanceof xe) {
|
|
2314
|
+
T.onBeforeRender(h, b, P);
|
|
2315
|
+
var C;
|
|
2316
|
+
T instanceof ut ? (a.copy(P.matrixWorldInverse), a.transpose(), a.copyPosition(T.matrixWorld), a.scale(T.scale), a.elements[3] = 0, a.elements[7] = 0, a.elements[11] = 0, a.elements[15] = 1, C = w(a, m)) : C = w(T.matrixWorld, m);
|
|
2317
|
+
var _ = T.element, H = s.objects.get(T);
|
|
2318
|
+
if (H === void 0 || H.style !== C) {
|
|
2319
|
+
_.style.WebkitTransform = C, _.style.transform = C;
|
|
2320
|
+
var G = { style: C };
|
|
2321
|
+
c && (G.distanceToCameraSquared = A(P, T)), s.objects.set(T, G);
|
|
2322
|
+
}
|
|
2323
|
+
_.style.display = T.visible ? "" : "none", _.parentNode !== f && f.appendChild(_), T.onAfterRender(h, b, P);
|
|
2324
2324
|
}
|
|
2325
|
-
for (var
|
|
2326
|
-
x(
|
|
2325
|
+
for (var U = 0, Q = T.children.length; U < Q; U++)
|
|
2326
|
+
x(T.children[U], b, P, m);
|
|
2327
2327
|
}
|
|
2328
|
-
var
|
|
2329
|
-
var
|
|
2330
|
-
return function(P,
|
|
2331
|
-
return
|
|
2328
|
+
var A = (function() {
|
|
2329
|
+
var T = new ye(), b = new ye();
|
|
2330
|
+
return function(P, m) {
|
|
2331
|
+
return T.setFromMatrixPosition(P.matrixWorld), b.setFromMatrixPosition(m.matrixWorld), T.distanceToSquared(b);
|
|
2332
2332
|
};
|
|
2333
2333
|
})();
|
|
2334
|
-
function
|
|
2335
|
-
var
|
|
2336
|
-
return
|
|
2337
|
-
P instanceof
|
|
2338
|
-
}),
|
|
2339
|
-
}
|
|
2340
|
-
function
|
|
2341
|
-
for (var
|
|
2342
|
-
var
|
|
2343
|
-
return
|
|
2344
|
-
}), P =
|
|
2345
|
-
|
|
2346
|
-
}
|
|
2347
|
-
this.render = function(
|
|
2348
|
-
var P =
|
|
2349
|
-
if (
|
|
2350
|
-
var
|
|
2351
|
-
var
|
|
2352
|
-
|
|
2334
|
+
function S(T) {
|
|
2335
|
+
var b = [];
|
|
2336
|
+
return T.traverse(function(P) {
|
|
2337
|
+
P instanceof xe && b.push(P);
|
|
2338
|
+
}), b;
|
|
2339
|
+
}
|
|
2340
|
+
function O(T) {
|
|
2341
|
+
for (var b = S(T).sort(function(_, H) {
|
|
2342
|
+
var G = s.objects.get(_).distanceToCameraSquared, U = s.objects.get(H).distanceToCameraSquared;
|
|
2343
|
+
return G - U;
|
|
2344
|
+
}), P = b.length, m = 0, C = b.length; m < C; m++)
|
|
2345
|
+
b[m].element.style.zIndex = P - m;
|
|
2346
|
+
}
|
|
2347
|
+
this.render = function(T, b) {
|
|
2348
|
+
var P = b.projectionMatrix.elements[5] * t;
|
|
2349
|
+
if (s.camera.fov !== P && (b.isPerspectiveCamera ? (l.style.WebkitPerspective = P + "px", l.style.perspective = P + "px") : (l.style.WebkitPerspective = "", l.style.perspective = ""), s.camera.fov = P), T.autoUpdate === !0 && T.updateMatrixWorld(), b.parent === null && b.updateMatrixWorld(), b.isOrthographicCamera)
|
|
2350
|
+
var m = -(b.right + b.left) / 2, C = (b.top + b.bottom) / 2;
|
|
2351
|
+
var _ = b.isOrthographicCamera ? "scale(" + P + ")translate(" + g(m) + "px," + g(C) + "px)" + y(b.matrixWorldInverse) : "translateZ(" + P + "px)" + y(b.matrixWorldInverse), H = _ + "translate(" + n + "px," + t + "px)";
|
|
2352
|
+
s.camera.style !== H && !c && (f.style.WebkitTransform = H, f.style.transform = H, s.camera.style = H), x(T, T, b, _), c && O(T);
|
|
2353
2353
|
};
|
|
2354
2354
|
};
|
|
2355
|
-
function
|
|
2356
|
-
var
|
|
2357
|
-
return new
|
|
2355
|
+
function Zt(h, o, e) {
|
|
2356
|
+
var n = o.getBoundingClientRect(), t = n.top, a = n.left, s = n.width, l = n.height;
|
|
2357
|
+
return new v.Vector2((h.x - a) / s * 2 - 1, -(h.y - t) / l * 2 + 1);
|
|
2358
2358
|
}
|
|
2359
|
-
var
|
|
2359
|
+
var jn = (
|
|
2360
2360
|
/** @class */
|
|
2361
|
-
(function(
|
|
2362
|
-
|
|
2363
|
-
function o(e,
|
|
2364
|
-
var l =
|
|
2365
|
-
l.type = "RoundedBoxGeometry",
|
|
2366
|
-
var
|
|
2361
|
+
(function(h) {
|
|
2362
|
+
he(o, h);
|
|
2363
|
+
function o(e, n, t, a, s) {
|
|
2364
|
+
var l = h.call(this) || this;
|
|
2365
|
+
l.type = "RoundedBoxGeometry", s = isNaN(s) ? 1 : Math.max(1, Math.floor(s)), e = isNaN(e) ? 1 : e, n = isNaN(n) ? 1 : n, t = isNaN(t) ? 1 : t, a = isNaN(a) ? 0.15 : a, a = Math.min(a, Math.min(e, Math.min(n, Math.min(t))) / 2);
|
|
2366
|
+
var f = e / 2 - a, c = n / 2 - a, g = t / 2 - a;
|
|
2367
2367
|
l.parameters = {
|
|
2368
2368
|
width: e,
|
|
2369
|
-
height:
|
|
2369
|
+
height: n,
|
|
2370
2370
|
depth: t,
|
|
2371
|
-
radius:
|
|
2372
|
-
radiusSegments:
|
|
2371
|
+
radius: a,
|
|
2372
|
+
radiusSegments: s
|
|
2373
2373
|
};
|
|
2374
|
-
var
|
|
2375
|
-
new
|
|
2376
|
-
var
|
|
2377
|
-
|
|
2378
|
-
function
|
|
2379
|
-
for (var
|
|
2380
|
-
new
|
|
2381
|
-
new
|
|
2382
|
-
new
|
|
2383
|
-
new
|
|
2384
|
-
new
|
|
2385
|
-
new
|
|
2386
|
-
new
|
|
2387
|
-
new
|
|
2374
|
+
var y = s + 1, w = y * s + 1 << 3, x = new v.BufferAttribute(new Float32Array(w * 3), 3), A = new v.BufferAttribute(new Float32Array(w * 3), 3), S = [], O = [];
|
|
2375
|
+
new v.Vector3();
|
|
2376
|
+
var T = new v.Vector3(), b = [], P = [], m = [], C = y * s, _ = y * s + 1;
|
|
2377
|
+
H(), U(), G(), Q(), le(), oe();
|
|
2378
|
+
function H() {
|
|
2379
|
+
for (var D = [
|
|
2380
|
+
new v.Vector3(1, 1, 1),
|
|
2381
|
+
new v.Vector3(1, 1, -1),
|
|
2382
|
+
new v.Vector3(-1, 1, -1),
|
|
2383
|
+
new v.Vector3(-1, 1, 1),
|
|
2384
|
+
new v.Vector3(1, -1, 1),
|
|
2385
|
+
new v.Vector3(1, -1, -1),
|
|
2386
|
+
new v.Vector3(-1, -1, -1),
|
|
2387
|
+
new v.Vector3(-1, -1, 1)
|
|
2388
2388
|
], I = 0; I < 8; I++)
|
|
2389
|
-
|
|
2390
|
-
for (var
|
|
2391
|
-
var
|
|
2392
|
-
if (Y ==
|
|
2393
|
-
|
|
2394
|
-
var
|
|
2395
|
-
|
|
2396
|
-
var
|
|
2397
|
-
|
|
2389
|
+
S.push([]), O.push([]);
|
|
2390
|
+
for (var N = Math.PI / 2, B = new v.Vector3(f, c, g), Y = 0; Y <= s; Y++) {
|
|
2391
|
+
var ae = Y / s, X = ae * N, R = Math.cos(X), ee = Math.sin(X);
|
|
2392
|
+
if (Y == s) {
|
|
2393
|
+
T.set(0, 1, 0);
|
|
2394
|
+
var j = T.clone().multiplyScalar(a).add(B);
|
|
2395
|
+
S[0].push(j), b.push(j);
|
|
2396
|
+
var z = T.clone();
|
|
2397
|
+
O[0].push(z), P.push(z);
|
|
2398
2398
|
continue;
|
|
2399
2399
|
}
|
|
2400
|
-
for (var
|
|
2401
|
-
var
|
|
2402
|
-
|
|
2403
|
-
var
|
|
2404
|
-
|
|
2405
|
-
var
|
|
2406
|
-
|
|
2400
|
+
for (var L = 0; L <= s; L++) {
|
|
2401
|
+
var ie = L / s, W = ie * N;
|
|
2402
|
+
T.x = R * Math.cos(W), T.y = ee, T.z = R * Math.sin(W);
|
|
2403
|
+
var j = T.clone().multiplyScalar(a).add(B);
|
|
2404
|
+
S[0].push(j), b.push(j);
|
|
2405
|
+
var z = T.clone().normalize();
|
|
2406
|
+
O[0].push(z), P.push(z);
|
|
2407
2407
|
}
|
|
2408
2408
|
}
|
|
2409
|
-
for (var
|
|
2410
|
-
for (var I = 0; I <
|
|
2411
|
-
var
|
|
2412
|
-
|
|
2413
|
-
var
|
|
2414
|
-
|
|
2409
|
+
for (var q = 1; q < 8; q++)
|
|
2410
|
+
for (var I = 0; I < S[0].length; I++) {
|
|
2411
|
+
var j = S[0][I].clone().multiply(D[q]);
|
|
2412
|
+
S[q].push(j), b.push(j);
|
|
2413
|
+
var z = O[0][I].clone().multiply(D[q]);
|
|
2414
|
+
O[q].push(z), P.push(z);
|
|
2415
2415
|
}
|
|
2416
2416
|
}
|
|
2417
|
-
function
|
|
2418
|
-
for (var
|
|
2417
|
+
function G() {
|
|
2418
|
+
for (var D = [
|
|
2419
2419
|
!0,
|
|
2420
2420
|
!1,
|
|
2421
2421
|
!0,
|
|
@@ -2424,153 +2424,153 @@ var Rn = (
|
|
|
2424
2424
|
!0,
|
|
2425
2425
|
!1,
|
|
2426
2426
|
!0
|
|
2427
|
-
], I =
|
|
2428
|
-
for (var
|
|
2429
|
-
for (var
|
|
2430
|
-
var
|
|
2431
|
-
|
|
2427
|
+
], I = y * (s - 1), N = 0; N < 8; N++) {
|
|
2428
|
+
for (var B = _ * N, Y = 0; Y < s - 1; Y++)
|
|
2429
|
+
for (var ae = Y * y, X = (Y + 1) * y, R = 0; R < s; R++) {
|
|
2430
|
+
var ee = R + 1, j = B + ae + R, z = B + ae + ee, L = B + X + R, ie = B + X + ee;
|
|
2431
|
+
D[N] ? (m.push(j), m.push(L), m.push(z), m.push(z), m.push(L), m.push(ie)) : (m.push(j), m.push(z), m.push(L), m.push(z), m.push(ie), m.push(L));
|
|
2432
2432
|
}
|
|
2433
|
-
for (var
|
|
2434
|
-
var
|
|
2435
|
-
|
|
2433
|
+
for (var R = 0; R < s; R++) {
|
|
2434
|
+
var j = B + I + R, z = B + I + R + 1, L = B + C;
|
|
2435
|
+
D[N] ? (m.push(j), m.push(L), m.push(z)) : (m.push(j), m.push(z), m.push(L));
|
|
2436
2436
|
}
|
|
2437
2437
|
}
|
|
2438
2438
|
}
|
|
2439
|
-
function
|
|
2440
|
-
var
|
|
2441
|
-
|
|
2439
|
+
function U() {
|
|
2440
|
+
var D = C, I = C + _, N = C + _ * 2, B = C + _ * 3;
|
|
2441
|
+
m.push(D), m.push(I), m.push(N), m.push(D), m.push(N), m.push(B), D = C + _ * 4, I = C + _ * 5, N = C + _ * 6, B = C + _ * 7, m.push(D), m.push(N), m.push(I), m.push(D), m.push(B), m.push(N), D = 0, I = _, N = _ * 4, B = _ * 5, m.push(D), m.push(N), m.push(I), m.push(I), m.push(N), m.push(B), D = _ * 2, I = _ * 3, N = _ * 6, B = _ * 7, m.push(D), m.push(N), m.push(I), m.push(I), m.push(N), m.push(B), D = s, I = s + _ * 3, N = s + _ * 4, B = s + _ * 7, m.push(D), m.push(I), m.push(N), m.push(I), m.push(B), m.push(N), D = s + _, I = s + _ * 2, N = s + _ * 5, B = s + _ * 6, m.push(D), m.push(N), m.push(I), m.push(I), m.push(N), m.push(B);
|
|
2442
2442
|
}
|
|
2443
|
-
function
|
|
2444
|
-
for (var
|
|
2445
|
-
for (var I =
|
|
2446
|
-
var
|
|
2447
|
-
|
|
2443
|
+
function Q() {
|
|
2444
|
+
for (var D = 0; D < 4; D++)
|
|
2445
|
+
for (var I = D * _, N = 4 * _ + I, B = (D & 1) === 1, Y = 0; Y < s; Y++) {
|
|
2446
|
+
var ae = Y + 1, X = I + Y, R = I + ae, ee = N + Y, j = N + ae;
|
|
2447
|
+
B ? (m.push(X), m.push(ee), m.push(R), m.push(R), m.push(ee), m.push(j)) : (m.push(X), m.push(R), m.push(ee), m.push(R), m.push(j), m.push(ee));
|
|
2448
2448
|
}
|
|
2449
2449
|
}
|
|
2450
|
-
function
|
|
2451
|
-
for (var
|
|
2452
|
-
for (var
|
|
2453
|
-
var
|
|
2454
|
-
|
|
2450
|
+
function oe() {
|
|
2451
|
+
for (var D = [0, 2, 4, 6], I = [1, 3, 5, 7], N = 0; N < 4; N++)
|
|
2452
|
+
for (var B = _ * D[N], Y = _ * I[N], ae = 1 >= N, X = 0; X < s; X++) {
|
|
2453
|
+
var R = X * y, ee = (X + 1) * y, j = B + R, z = B + ee, L = Y + R, ie = Y + ee;
|
|
2454
|
+
ae ? (m.push(j), m.push(L), m.push(z), m.push(z), m.push(L), m.push(ie)) : (m.push(j), m.push(z), m.push(L), m.push(z), m.push(ie), m.push(L));
|
|
2455
2455
|
}
|
|
2456
2456
|
}
|
|
2457
|
-
function
|
|
2458
|
-
for (var
|
|
2459
|
-
for (var
|
|
2460
|
-
var
|
|
2461
|
-
|
|
2457
|
+
function le() {
|
|
2458
|
+
for (var D = s - 1, I = [0, 1, 4, 5], N = [3, 2, 7, 6], B = [0, 1, 1, 0], Y = 0; Y < 4; Y++)
|
|
2459
|
+
for (var ae = I[Y] * _, X = N[Y] * _, R = 0; R <= D; R++) {
|
|
2460
|
+
var ee = ae + s + R * y, j = ae + (R != D ? s + (R + 1) * y : _ - 1), z = X + s + R * y, L = X + (R != D ? s + (R + 1) * y : _ - 1);
|
|
2461
|
+
B[Y] ? (m.push(ee), m.push(z), m.push(j), m.push(j), m.push(z), m.push(L)) : (m.push(ee), m.push(j), m.push(z), m.push(j), m.push(L), m.push(z));
|
|
2462
2462
|
}
|
|
2463
2463
|
}
|
|
2464
|
-
for (var
|
|
2465
|
-
x.setXYZ(
|
|
2466
|
-
return l.setIndex(new
|
|
2464
|
+
for (var J = 0, Z = 0; Z < b.length; Z++)
|
|
2465
|
+
x.setXYZ(J, b[Z].x, b[Z].y, b[Z].z), A.setXYZ(J, P[Z].x, P[Z].y, P[Z].z), J++;
|
|
2466
|
+
return l.setIndex(new v.BufferAttribute(new Uint16Array(m), 1)), l.setAttribute("position", x), l.setAttribute("normal", A), l;
|
|
2467
2467
|
}
|
|
2468
2468
|
return o;
|
|
2469
|
-
})(
|
|
2469
|
+
})(v.BufferGeometry)
|
|
2470
2470
|
);
|
|
2471
|
-
function
|
|
2472
|
-
return typeof
|
|
2471
|
+
function Ye(h, o) {
|
|
2472
|
+
return typeof h != "number" || typeof o != "number" ? !1 : Math.abs(h - o) < 1e-3;
|
|
2473
2473
|
}
|
|
2474
|
-
function
|
|
2475
|
-
|
|
2476
|
-
return
|
|
2474
|
+
function He(h, o, e, n) {
|
|
2475
|
+
n === void 0 && (n = function(a) {
|
|
2476
|
+
return a;
|
|
2477
2477
|
});
|
|
2478
|
-
var t =
|
|
2479
|
-
return
|
|
2478
|
+
var t = n(e);
|
|
2479
|
+
return h * (1 - t) + o * t;
|
|
2480
2480
|
}
|
|
2481
|
-
var
|
|
2482
|
-
function
|
|
2483
|
-
var
|
|
2484
|
-
return
|
|
2481
|
+
var re = Number((Math.PI / 2).toFixed(5));
|
|
2482
|
+
function Gn(h, o, e) {
|
|
2483
|
+
var n = new v.Shape();
|
|
2484
|
+
return n.moveTo(e, 0), n.lineTo(h - e, 0), n.absarc(h - e, e, e, -re, 0, !1), n.lineTo(h, o - e), n.absarc(h - e, o - e, e, 0, re, !1), n.lineTo(e, o), n.absarc(e, o - e, e, re, Math.PI, !1), n.lineTo(0, e), n.absarc(e, e, e, Math.PI, Math.PI * 1.5, !1), n;
|
|
2485
2485
|
}
|
|
2486
|
-
var
|
|
2486
|
+
var We = function(h) {
|
|
2487
2487
|
var o = document.createElement("div");
|
|
2488
|
-
o.innerText =
|
|
2489
|
-
var e = new
|
|
2490
|
-
return e.name =
|
|
2491
|
-
},
|
|
2492
|
-
var o = new
|
|
2488
|
+
o.innerText = h;
|
|
2489
|
+
var e = new xe(o);
|
|
2490
|
+
return e.name = h, e.scale.set(0.3, 0.3, 0.3), o.style.pointerEvents = "none", o.style.backfaceVisibility = "hidden", e;
|
|
2491
|
+
}, at = function(h) {
|
|
2492
|
+
var o = new v.PlaneGeometry(5, 5), e = new v.MeshBasicMaterial({
|
|
2493
2493
|
transparent: !0,
|
|
2494
2494
|
opacity: 0
|
|
2495
|
-
}),
|
|
2496
|
-
t.innerText =
|
|
2497
|
-
var
|
|
2498
|
-
return
|
|
2499
|
-
},
|
|
2495
|
+
}), n = new v.Mesh(o, e), t = document.createElement("div");
|
|
2496
|
+
t.innerText = h;
|
|
2497
|
+
var a = new xe(t);
|
|
2498
|
+
return a.name = h, a.scale.set(0.3, 0.3, 0.3), t.style.color = "#ffffff", t.style.opacity = "0.5", t.style.pointerEvents = "none", t.style.backfaceVisibility = "hidden", n.rotateX(-re), n.add(a), n;
|
|
2499
|
+
}, Yn = (
|
|
2500
2500
|
/** @class */
|
|
2501
|
-
(function(
|
|
2502
|
-
|
|
2503
|
-
function o(e,
|
|
2504
|
-
var t =
|
|
2505
|
-
t.camera = new
|
|
2506
|
-
var
|
|
2501
|
+
(function(h) {
|
|
2502
|
+
he(o, h);
|
|
2503
|
+
function o(e, n) {
|
|
2504
|
+
var t = h.call(this, e) || this;
|
|
2505
|
+
t.camera = new An(90), t.scene = new v.Scene(), t.renderer = new v.WebGLRenderer({ antialias: !0, alpha: !0 }), t.css3drenderer = new zn(), t.ambientLight = new v.AmbientLight(16777215, 0.7), t.wrapper = document.createElement("div"), t.arrows = document.createElement("div"), t.arrowLeft = document.createElement("div"), t.arrowRight = document.createElement("div"), t.arrowFront = document.createElement("div"), t.arrowBack = document.createElement("div"), t.arrowTop = document.createElement("div"), t.arrowBottom = document.createElement("div"), t.spherical = null, t.dragging = !1, t.style = document.createElement("style"), t.directionalLight = new v.DirectionalLight(16777215, 0.2), t.box = new v.Mesh(new jn(8, 8, 8, 0.5, 20), new v.MeshPhongMaterial({ color: 16777215 })), t.faces = new v.Group(), t.orient = function(l) {
|
|
2506
|
+
var f = l.longitude, c = l.latitude;
|
|
2507
2507
|
t.dragging = !1, t.spherical = null, t.controls.enableDamping = !1, t.five.setState(Object.assign({
|
|
2508
|
-
latitude:
|
|
2509
|
-
},
|
|
2510
|
-
longitude:
|
|
2508
|
+
latitude: c
|
|
2509
|
+
}, f !== void 0 ? {
|
|
2510
|
+
longitude: f + t.config.fixedLongitude
|
|
2511
2511
|
} : {})), t.five.ready().then(function() {
|
|
2512
2512
|
t.controls.enableDamping = !0, t.setState({ arrowsVisible: !0 });
|
|
2513
2513
|
});
|
|
2514
2514
|
}, t.onRenderFrame = function() {
|
|
2515
|
-
var l,
|
|
2515
|
+
var l, f, c, g, y;
|
|
2516
2516
|
if (t.renderer.render(t.scene, t.camera), t.css3drenderer.render(t.scene, t.camera), t.directionalLight.position.copy(t.camera.position), (l = t.controls) === null || l === void 0 || l.update(), t.dragging) {
|
|
2517
2517
|
t.camera.computePose(), t.updateByCamera();
|
|
2518
|
-
var
|
|
2519
|
-
t.five.setState({ longitude: x, latitude:
|
|
2520
|
-
} else if (t.spherical && (!
|
|
2521
|
-
t.spherical = { pi: (
|
|
2522
|
-
var
|
|
2523
|
-
t.five.setState({ longitude: x, latitude:
|
|
2518
|
+
var w = t.camera.pose, x = w.longitude, A = w.latitude;
|
|
2519
|
+
t.five.setState({ longitude: x, latitude: A }, !0), t.updateArrows({ longitude: x, latitude: A });
|
|
2520
|
+
} else if (t.spherical && (!Ye(t.spherical.pi, (f = t.controls) === null || f === void 0 ? void 0 : f.getPolarAngle()) || !Ye(t.spherical.theta, (c = t.controls) === null || c === void 0 ? void 0 : c.getAzimuthalAngle()))) {
|
|
2521
|
+
t.spherical = { pi: (g = t.controls) === null || g === void 0 ? void 0 : g.getPolarAngle(), theta: (y = t.controls) === null || y === void 0 ? void 0 : y.getAzimuthalAngle() }, t.camera.computePose(), t.updateByCamera();
|
|
2522
|
+
var S = t.camera.pose, x = S.longitude, A = S.latitude;
|
|
2523
|
+
t.five.setState({ longitude: x, latitude: A }, !0), t.updateArrows({ longitude: x, latitude: A });
|
|
2524
2524
|
} else
|
|
2525
2525
|
t.spherical = null;
|
|
2526
2526
|
}, t.onTapGesture = function(l) {
|
|
2527
|
-
var
|
|
2528
|
-
|
|
2529
|
-
var
|
|
2530
|
-
if (
|
|
2531
|
-
var x =
|
|
2532
|
-
t.orient({ longitude:
|
|
2527
|
+
var f = l.pointers[0].clientX, c = l.pointers[0].clientY, g = Zt({ x: f, y: c }, t.wrapper), y = new v.Raycaster();
|
|
2528
|
+
y.setFromCamera(g, t.camera);
|
|
2529
|
+
var w = y.intersectObjects(t.faces.children, !1)[0];
|
|
2530
|
+
if (w) {
|
|
2531
|
+
var x = w.object.userData, A = x.longitude, S = x.latitude;
|
|
2532
|
+
t.orient({ longitude: A, latitude: S });
|
|
2533
2533
|
}
|
|
2534
2534
|
}, t.onFiveWantsGesture = function() {
|
|
2535
2535
|
if (t.spherical)
|
|
2536
2536
|
return !1;
|
|
2537
2537
|
}, t.onFiveModeChange = function(l) {
|
|
2538
|
-
t.controls && (t.controls.maxPolarAngle = l === "Topview" ? 0 :
|
|
2538
|
+
t.controls && (t.controls.maxPolarAngle = l === "Topview" ? 0 : re);
|
|
2539
2539
|
}, t.onCameraUpdate = function(l) {
|
|
2540
|
-
var
|
|
2540
|
+
var f = l.state;
|
|
2541
2541
|
if (!t.dragging && !t.spherical) {
|
|
2542
|
-
var
|
|
2543
|
-
t.camera.pose.longitude ===
|
|
2542
|
+
var c = f.longitude, g = f.latitude;
|
|
2543
|
+
t.camera.pose.longitude === c && t.camera.pose.latitude === g || (t.camera.setFromPose({ longitude: c, latitude: g, distance: 20, offset: new v.Vector3(0, 0, 0) }), t.updateByCamera(), t.updateArrows({ longitude: c, latitude: g }));
|
|
2544
2544
|
}
|
|
2545
2545
|
}, t.onPanStart = function(l) {
|
|
2546
2546
|
t.dragging = !0, t.spherical = {};
|
|
2547
2547
|
}, t.onMouseMove = function(l) {
|
|
2548
2548
|
if (!t.dragging) {
|
|
2549
|
-
var
|
|
2550
|
-
|
|
2551
|
-
var
|
|
2552
|
-
t.faces.children.forEach(function(
|
|
2553
|
-
|
|
2554
|
-
}),
|
|
2549
|
+
var f = Zt({ x: l.clientX, y: l.clientY }, t.wrapper), c = new v.Raycaster();
|
|
2550
|
+
c.setFromCamera(f, t.camera);
|
|
2551
|
+
var g = c.intersectObjects(t.faces.children, !1)[0];
|
|
2552
|
+
t.faces.children.forEach(function(y) {
|
|
2553
|
+
y.material.opacity = 0, y.children[0].element.style.color = "";
|
|
2554
|
+
}), g && (g.object.material.opacity = 0.3, g.object.children[0].element.style.color = "#336dff");
|
|
2555
2555
|
}
|
|
2556
2556
|
}, t.onPanEnd = function(l) {
|
|
2557
2557
|
t.dragging = !1, t.spherical = { pi: t.controls.getPolarAngle(), theta: t.controls.getAzimuthalAngle() };
|
|
2558
2558
|
}, t.dispose = function() {
|
|
2559
2559
|
t.disable();
|
|
2560
2560
|
}, t.five = e;
|
|
2561
|
-
var
|
|
2561
|
+
var a = {
|
|
2562
2562
|
enabled: !1,
|
|
2563
2563
|
visible: !0,
|
|
2564
2564
|
arrowsVisible: !1
|
|
2565
2565
|
};
|
|
2566
|
-
t.state = Object.assign(
|
|
2567
|
-
var
|
|
2568
|
-
return t._config =
|
|
2566
|
+
t.state = Object.assign(a, n == null ? void 0 : n.initialState);
|
|
2567
|
+
var s = V({ fixedLongitude: 0, orthoView: !0 }, n == null ? void 0 : n.config);
|
|
2568
|
+
return t._config = s, t.state.enabled && t._enable({ userAction: !1 }), t.mc = new Tt.Manager(t.wrapper), t.mc.add(new Tt.Tap({ interval: 410 })), t.mc.add(new Tt.Pan({ threshold: 10, pointers: 0 })), t.camera.setFromPose({
|
|
2569
2569
|
distance: 20,
|
|
2570
|
-
offset: new
|
|
2570
|
+
offset: new v.Vector3(0, 0, 0),
|
|
2571
2571
|
longitude: e.camera.pose.latitude,
|
|
2572
2572
|
latitude: e.camera.pose.latitude
|
|
2573
|
-
}), t.cylinder = new
|
|
2573
|
+
}), t.cylinder = new v.Mesh(new v.CylinderGeometry(13.2, 14, 0.01, 50, 1, !0), new v.ShaderMaterial({
|
|
2574
2574
|
uniforms: {
|
|
2575
2575
|
radiusTop: { value: 13.2 },
|
|
2576
2576
|
radiusBottom: { value: 14 },
|
|
@@ -2619,31 +2619,31 @@ var Xe = function(f) {
|
|
|
2619
2619
|
}
|
|
2620
2620
|
return Object.defineProperty(o.prototype, "config", {
|
|
2621
2621
|
get: function() {
|
|
2622
|
-
return
|
|
2622
|
+
return V({}, this._config);
|
|
2623
2623
|
},
|
|
2624
2624
|
enumerable: !1,
|
|
2625
2625
|
configurable: !0
|
|
2626
|
-
}), o.prototype.updateState = function(e,
|
|
2626
|
+
}), o.prototype.updateState = function(e, n) {
|
|
2627
2627
|
var t = this.state;
|
|
2628
|
-
this.state =
|
|
2628
|
+
this.state = V(V({}, this.state), e), typeof e.arrowsVisible == "boolean" && this.handleArrowsVisible(e.arrowsVisible), this.hooks.emit("stateChange", { state: this.state, prevState: t, userAction: n });
|
|
2629
2629
|
}, o.prototype.appendTo = function(e) {
|
|
2630
2630
|
if (e) {
|
|
2631
2631
|
e.appendChild(this.wrapper);
|
|
2632
|
-
var
|
|
2633
|
-
this.renderer.setSize(t,
|
|
2632
|
+
var n = this.wrapper.getBoundingClientRect(), t = n.width, a = n.height;
|
|
2633
|
+
this.renderer.setSize(t, a), this.css3drenderer.setSize(t, a);
|
|
2634
2634
|
}
|
|
2635
2635
|
}, o.prototype.init = function() {
|
|
2636
2636
|
this.renderer.setClearAlpha(0), this.renderer.domElement.style.outline = "none", this.initDom(), this.initFaces(), this.initControls(), this.initLights();
|
|
2637
2637
|
var e = this.cylinder;
|
|
2638
2638
|
e.position.y = -3;
|
|
2639
|
-
var
|
|
2640
|
-
|
|
2641
|
-
var t =
|
|
2639
|
+
var n = at("西");
|
|
2640
|
+
n.position.set(-19, 0, 0), e.add(n);
|
|
2641
|
+
var t = at("东");
|
|
2642
2642
|
t.position.set(19, 0, 0), e.add(t);
|
|
2643
|
-
var
|
|
2644
|
-
|
|
2645
|
-
var
|
|
2646
|
-
|
|
2643
|
+
var a = at("北");
|
|
2644
|
+
a.position.set(0, 0, -19), e.add(a);
|
|
2645
|
+
var s = at("南");
|
|
2646
|
+
s.position.set(0, 0, 19), e.add(s), this.updateByCamera(), this.scene.add(e, this.box, this.faces), this.scene.rotation.y = this.config.fixedLongitude;
|
|
2647
2647
|
}, o.prototype.initDom = function() {
|
|
2648
2648
|
this.style.innerHTML = `
|
|
2649
2649
|
.OrientationPlugin .OrientationArrows {
|
|
@@ -2749,11 +2749,11 @@ var Xe = function(f) {
|
|
|
2749
2749
|
}, o.prototype.bindEvents = function() {
|
|
2750
2750
|
var e = this;
|
|
2751
2751
|
this.five.on("renderFrame", this.onRenderFrame), this.five.on("camera.update", this.onCameraUpdate), this.five.on("wantsGesture", this.onFiveWantsGesture), this.five.on("modeChange", this.onFiveModeChange), this.mc.on("tap", this.onTapGesture), this.mc.on("panstart", this.onPanStart), this.mc.on("panend", this.onPanEnd), this.wrapper.addEventListener("mousemove", this.onMouseMove), this.arrowTop.onclick = function() {
|
|
2752
|
-
return e.orient({ longitude: 0, latitude:
|
|
2752
|
+
return e.orient({ longitude: 0, latitude: re });
|
|
2753
2753
|
}, this.arrowLeft.onclick = function() {
|
|
2754
|
-
return e.orient({ longitude: -
|
|
2754
|
+
return e.orient({ longitude: -re, latitude: 0 });
|
|
2755
2755
|
}, this.arrowRight.onclick = function() {
|
|
2756
|
-
return e.orient({ longitude:
|
|
2756
|
+
return e.orient({ longitude: re, latitude: 0 });
|
|
2757
2757
|
}, this.arrowFront.onclick = function() {
|
|
2758
2758
|
return e.orient({ longitude: 0, latitude: 0 });
|
|
2759
2759
|
}, this.arrowBack.onclick = function() {
|
|
@@ -2762,46 +2762,46 @@ var Xe = function(f) {
|
|
|
2762
2762
|
}, o.prototype.unbindEvents = function() {
|
|
2763
2763
|
this.five.off("renderFrame", this.onRenderFrame), this.five.off("camera.update", this.onCameraUpdate), this.five.off("wantsGesture", this.onFiveWantsGesture), this.five.off("modeChange", this.onFiveModeChange), this.mc.off("tap", this.onTapGesture), this.mc.off("panstart", this.onPanStart), this.mc.off("panend", this.onPanEnd), this.wrapper.removeEventListener("mousemove", this.onMouseMove), this.arrowTop.onclick = null, this.arrowLeft.onclick = null, this.arrowRight.onclick = null, this.arrowFront.onclick = null, this.arrowBack.onclick = null;
|
|
2764
2764
|
}, o.prototype.updateByCamera = function() {
|
|
2765
|
-
var e =
|
|
2765
|
+
var e = He(0.2, 1, this.camera.pose.latitude / Math.PI * 2, function(l) {
|
|
2766
2766
|
return l * l;
|
|
2767
|
-
}),
|
|
2767
|
+
}), n = He(11, 13, this.camera.pose.latitude / Math.PI * 2, function(l) {
|
|
2768
2768
|
return l * l;
|
|
2769
|
-
}), t =
|
|
2769
|
+
}), t = He(12, 15, this.camera.pose.latitude / Math.PI * 2, function(l) {
|
|
2770
2770
|
return l * l;
|
|
2771
|
-
}),
|
|
2771
|
+
}), a = He(13, 19, this.camera.pose.latitude / Math.PI * 2, function(l) {
|
|
2772
2772
|
return l * l;
|
|
2773
|
-
}),
|
|
2773
|
+
}), s = He(-0.2, 0.5, this.camera.pose.latitude / Math.PI * 2, function(l) {
|
|
2774
2774
|
return l * l;
|
|
2775
2775
|
});
|
|
2776
|
-
this.cylinder.geometry = new
|
|
2777
|
-
l.position.normalize().multiplyScalar(
|
|
2778
|
-
var
|
|
2779
|
-
|
|
2776
|
+
this.cylinder.geometry = new v.CylinderGeometry(n, t, 0.01, 50, 1, !0), this.cylinder.material.uniforms.radiusTop.value = n, this.cylinder.material.uniforms.radiusBottom.value = t, this.cylinder.material.needsUpdate = !0, this.cylinder.children.forEach(function(l) {
|
|
2777
|
+
l.position.normalize().multiplyScalar(a), l.scale.set(e, e, e);
|
|
2778
|
+
var f = l.children[0];
|
|
2779
|
+
f && (f.element.style.opacity = s.toString());
|
|
2780
2780
|
});
|
|
2781
2781
|
}, o.prototype.updateArrows = function(e) {
|
|
2782
2782
|
e.longitude;
|
|
2783
|
-
var
|
|
2783
|
+
var n = e.latitude, t = re - n < 0.02;
|
|
2784
2784
|
this.setState({ arrowsVisible: t });
|
|
2785
2785
|
}, o.prototype.handleArrowsVisible = function(e) {
|
|
2786
|
-
var
|
|
2786
|
+
var n = this;
|
|
2787
2787
|
if (this.state.enabled)
|
|
2788
2788
|
if (this.cylinder.material.uniforms.opacity.value = e ? 0.4 : 1, this.cylinder.material.needsUpdate = !0, e) {
|
|
2789
|
-
var t = this.five.getCurrentState(),
|
|
2790
|
-
if (
|
|
2791
|
-
this.five.state.mode === "Topview" || this.five.state.mode === "Mapview" ? (this.faces.getObjectByName("上").element.className = "active", this.arrows.innerHTML = "", this.arrows.appendChild(this.arrowBack), this.arrows.appendChild(this.arrowLeft), this.arrows.appendChild(this.arrowRight), this.arrows.appendChild(this.arrowFront), this.arrows.style.transform = "rotate(".concat((
|
|
2789
|
+
var t = this.five.getCurrentState(), a = t.longitude, s = t.latitude;
|
|
2790
|
+
if (re - s < 0.03)
|
|
2791
|
+
this.five.state.mode === "Topview" || this.five.state.mode === "Mapview" ? (this.faces.getObjectByName("上").element.className = "active", this.arrows.innerHTML = "", this.arrows.appendChild(this.arrowBack), this.arrows.appendChild(this.arrowLeft), this.arrows.appendChild(this.arrowRight), this.arrows.appendChild(this.arrowFront), this.arrows.style.transform = "rotate(".concat((a - this.config.fixedLongitude) / Math.PI * 180, "deg)")) : (this.arrows.innerHTML = "", this.faces.getObjectByName("上").element.className = "");
|
|
2792
2792
|
else {
|
|
2793
2793
|
switch (this.arrows.innerHTML = "", this.arrows.appendChild(this.arrowTop), this.config.orthoView && this.five.ready().then(function() {
|
|
2794
|
-
|
|
2795
|
-
return
|
|
2794
|
+
n.five.controller.cameraType = "orthographic", n.five.ready().then(function() {
|
|
2795
|
+
return n.five.controller.cameraMotion.ended = !1;
|
|
2796
2796
|
});
|
|
2797
2797
|
}), !0) {
|
|
2798
|
-
case
|
|
2798
|
+
case Ye(0, a - this.config.fixedLongitude):
|
|
2799
2799
|
this.arrows.appendChild(this.arrowLeft), this.arrows.appendChild(this.arrowRight), this.arrows.appendChild(this.arrowBottom), this.faces.getObjectByName("前").element.className = "active";
|
|
2800
2800
|
break;
|
|
2801
|
-
case
|
|
2801
|
+
case Ye(re, a - this.config.fixedLongitude):
|
|
2802
2802
|
this.arrows.appendChild(this.arrowFront), this.arrows.appendChild(this.arrowBack), this.arrows.appendChild(this.arrowBottom), this.faces.getObjectByName("右").element.className = "active";
|
|
2803
2803
|
break;
|
|
2804
|
-
case
|
|
2804
|
+
case Ye(Math.PI, a - this.config.fixedLongitude):
|
|
2805
2805
|
this.arrows.appendChild(this.arrowRight), this.arrows.appendChild(this.arrowLeft), this.arrows.appendChild(this.arrowBottom), this.faces.getObjectByName("后").element.className = "active";
|
|
2806
2806
|
break;
|
|
2807
2807
|
default:
|
|
@@ -2813,38 +2813,38 @@ var Xe = function(f) {
|
|
|
2813
2813
|
this.arrows.style.display = "block";
|
|
2814
2814
|
} else
|
|
2815
2815
|
this.config.orthoView && (this.five.controller.cameraType = "auto", this.five.ready().then(function() {
|
|
2816
|
-
return
|
|
2816
|
+
return n.five.controller.cameraMotion.ended = !1;
|
|
2817
2817
|
})), this.arrows.style.display = "none", this.faces.children.forEach(function(l) {
|
|
2818
2818
|
l.children[0].element.className = "";
|
|
2819
2819
|
});
|
|
2820
|
-
}, o.prototype.setState = function(e,
|
|
2821
|
-
|
|
2822
|
-
var t = this.state,
|
|
2823
|
-
if (this.updateState(e,
|
|
2824
|
-
var
|
|
2825
|
-
e.enabled ? this._enable(
|
|
2820
|
+
}, o.prototype.setState = function(e, n) {
|
|
2821
|
+
n === void 0 && (n = {});
|
|
2822
|
+
var t = this.state, a = n.userAction !== void 0 ? n.userAction : !0;
|
|
2823
|
+
if (this.updateState(e, a), e.enabled !== void 0 && t.enabled !== e.enabled) {
|
|
2824
|
+
var s = { userAction: a };
|
|
2825
|
+
e.enabled ? this._enable(s) : this._disable(s);
|
|
2826
2826
|
}
|
|
2827
2827
|
}, o.prototype.initLights = function() {
|
|
2828
2828
|
this.directionalLight.target = this.box, this.scene.add(this.ambientLight, this.directionalLight);
|
|
2829
2829
|
}, o.prototype.initFaces = function() {
|
|
2830
|
-
var e =
|
|
2831
|
-
|
|
2832
|
-
var t = new
|
|
2833
|
-
t.userData = { longitude: 0, latitude: 0 }, t.position.z = 4.1, t.add(
|
|
2834
|
-
var
|
|
2835
|
-
|
|
2836
|
-
var
|
|
2837
|
-
|
|
2838
|
-
var l = new
|
|
2839
|
-
l.rotateY(-
|
|
2840
|
-
var
|
|
2841
|
-
|
|
2830
|
+
var e = Gn(7, 7, 0.5), n = new v.ShapeGeometry(e);
|
|
2831
|
+
n.translate(-3.5, -3.5, 0);
|
|
2832
|
+
var t = new v.Mesh(n, new v.MeshBasicMaterial({ transparent: !0, color: 3370495, opacity: 0 }));
|
|
2833
|
+
t.userData = { longitude: 0, latitude: 0 }, t.position.z = 4.1, t.add(We("前"));
|
|
2834
|
+
var a = new v.Mesh(n, new v.MeshBasicMaterial({ transparent: !0, color: 3370495, opacity: 0 }));
|
|
2835
|
+
a.rotateY(Math.PI), a.position.z = -4.1, a.add(We("后")), a.userData = { longitude: Math.PI, latitude: 0 };
|
|
2836
|
+
var s = new v.Mesh(n, new v.MeshBasicMaterial({ transparent: !0, color: 3370495, opacity: 0 }));
|
|
2837
|
+
s.rotateY(re), s.position.x = 4.1, s.add(We("右")), s.userData = { longitude: re, latitude: 0 };
|
|
2838
|
+
var l = new v.Mesh(n, new v.MeshBasicMaterial({ transparent: !0, color: 3370495, opacity: 0 }));
|
|
2839
|
+
l.rotateY(-re), l.position.x = -4.1, l.add(We("左")), l.userData = { longitude: -re, latitude: 0 };
|
|
2840
|
+
var f = new v.Mesh(n, new v.MeshBasicMaterial({ transparent: !0, color: 3370495, opacity: 0 }));
|
|
2841
|
+
f.rotateX(-re), f.position.y = 4.1, f.add(We("上")), f.userData = { longitude: 0, latitude: re }, this.faces.add(t, a, l, s, f);
|
|
2842
2842
|
}, o.prototype.initControls = function() {
|
|
2843
2843
|
var e = this.controls = new qe(this.camera, this.renderer.domElement);
|
|
2844
|
-
e.enableZoom = !1, e.enableDamping = !0, e.enablePan = !1, e.maxPolarAngle =
|
|
2844
|
+
e.enableZoom = !1, e.enableDamping = !0, e.enablePan = !1, e.maxPolarAngle = re, e.dampingFactor = 0.15, e.rotateSpeed = 0.25;
|
|
2845
2845
|
}, o.prototype.load = function(e) {
|
|
2846
|
-
return
|
|
2847
|
-
return
|
|
2846
|
+
return Le(this, void 0, void 0, function() {
|
|
2847
|
+
return De(this, function(n) {
|
|
2848
2848
|
return [
|
|
2849
2849
|
2
|
|
2850
2850
|
/*return*/
|
|
@@ -2852,61 +2852,61 @@ var Xe = function(f) {
|
|
|
2852
2852
|
});
|
|
2853
2853
|
});
|
|
2854
2854
|
}, o.prototype._enable = function(e) {
|
|
2855
|
-
var
|
|
2856
|
-
this.camera.setFromPose({ longitude: t, latitude:
|
|
2855
|
+
var n = this.five.getCurrentState(), t = n.longitude, a = n.latitude;
|
|
2856
|
+
this.camera.setFromPose({ longitude: t, latitude: a, distance: 20, offset: new v.Vector3(0, 0, 0) }), this.updateByCamera(), this.wrapper.appendChild(this.renderer.domElement), this.wrapper.appendChild(this.css3drenderer.domElement), this.bindEvents();
|
|
2857
2857
|
}, o.prototype._disable = function(e) {
|
|
2858
2858
|
this.wrapper.removeChild(this.renderer.domElement), this.wrapper.removeChild(this.css3drenderer.domElement), this.unbindEvents();
|
|
2859
2859
|
}, o.prototype.enable = function(e) {
|
|
2860
|
-
var
|
|
2860
|
+
var n;
|
|
2861
2861
|
if (!this.state.enabled) {
|
|
2862
|
-
var t = (
|
|
2862
|
+
var t = (n = e == null ? void 0 : e.userAction) !== null && n !== void 0 ? n : !0;
|
|
2863
2863
|
this.updateState({ enabled: !0 }, t), this._enable({ userAction: t }), document.head.appendChild(this.style);
|
|
2864
2864
|
}
|
|
2865
2865
|
}, o.prototype.disable = function(e) {
|
|
2866
|
-
var
|
|
2866
|
+
var n;
|
|
2867
2867
|
if (this.state.enabled !== !1) {
|
|
2868
|
-
var t = (
|
|
2868
|
+
var t = (n = e == null ? void 0 : e.userAction) !== null && n !== void 0 ? n : !0;
|
|
2869
2869
|
this.updateState({ enabled: !1 }, t), this._disable({ userAction: t }), document.head.removeChild(this.style);
|
|
2870
2870
|
}
|
|
2871
2871
|
}, o;
|
|
2872
|
-
})(
|
|
2873
|
-
),
|
|
2874
|
-
return new
|
|
2875
|
-
},
|
|
2872
|
+
})(Xe.Controller)
|
|
2873
|
+
), nr = function(h, o) {
|
|
2874
|
+
return new Yn(h, o);
|
|
2875
|
+
}, Hn = (
|
|
2876
2876
|
/** @class */
|
|
2877
|
-
(function(
|
|
2878
|
-
|
|
2879
|
-
function o(e,
|
|
2880
|
-
var t =
|
|
2881
|
-
return t.data = {}, t.pluginName = "BackgroundPlugin", t._onFiveCameraUpdate = function(
|
|
2882
|
-
var
|
|
2883
|
-
t.gradientBg && (t.gradientBg.style.transform = "translateY(-".concat((1 -
|
|
2877
|
+
(function(h) {
|
|
2878
|
+
he(o, h);
|
|
2879
|
+
function o(e, n) {
|
|
2880
|
+
var t = h.call(this, e) || this;
|
|
2881
|
+
return t.data = {}, t.pluginName = "BackgroundPlugin", t._onFiveCameraUpdate = function(a) {
|
|
2882
|
+
var s = (Math.PI / 2 - Math.max(a.latitude, 0)) / (Math.PI / 2), l = Math.max(0.2 - s, 0) * 10;
|
|
2883
|
+
t.gradientBg && (t.gradientBg.style.transform = "translateY(-".concat((1 - s) * 50, "%)")), t.groundBg && (t.groundBg.style.backgroundImage = "radial-gradient(circle, #2E303350 ".concat(l * 100, "%, transparent ").concat(l * 120, "%)"));
|
|
2884
2884
|
}, t._addEventListener = function() {
|
|
2885
2885
|
t.five.on("cameraUpdate", t._onFiveCameraUpdate);
|
|
2886
2886
|
}, t._removeEventListener = function() {
|
|
2887
2887
|
t.five.off("cameraUpdate", t._onFiveCameraUpdate);
|
|
2888
2888
|
}, t.load = function() {
|
|
2889
|
-
return
|
|
2890
|
-
return
|
|
2889
|
+
return Le(t, void 0, void 0, function() {
|
|
2890
|
+
return De(this, function(a) {
|
|
2891
2891
|
return [
|
|
2892
2892
|
2
|
|
2893
2893
|
/*return*/
|
|
2894
2894
|
];
|
|
2895
2895
|
});
|
|
2896
2896
|
});
|
|
2897
|
-
}, t.setState = function(
|
|
2897
|
+
}, t.setState = function(a, s) {
|
|
2898
2898
|
}, t.enable = function() {
|
|
2899
|
-
var
|
|
2900
|
-
if (!
|
|
2899
|
+
var a, s = (a = t.five.getElement()) === null || a === void 0 ? void 0 : a.parentNode;
|
|
2900
|
+
if (!s) {
|
|
2901
2901
|
t.five.ready().then(function() {
|
|
2902
2902
|
return t.enable();
|
|
2903
2903
|
});
|
|
2904
2904
|
return;
|
|
2905
2905
|
}
|
|
2906
|
-
t.state.enabled || (t._onFiveCameraUpdate(t.five.getPose(), !1), t.gradientBg &&
|
|
2907
|
-
}, t.disable = function(
|
|
2908
|
-
var
|
|
2909
|
-
t.state.enabled && ((l = (
|
|
2906
|
+
t.state.enabled || (t._onFiveCameraUpdate(t.five.getPose(), !1), t.gradientBg && s.appendChild(t.gradientBg), t.groundBg && s.appendChild(t.groundBg), t.style && document.head.appendChild(t.style), t._addEventListener(), t.hooks.emit("enable", { userAction: !0 }), t.state.enabled = !0);
|
|
2907
|
+
}, t.disable = function(a) {
|
|
2908
|
+
var s, l, f, c;
|
|
2909
|
+
t.state.enabled && ((l = (s = t.gradientBg) === null || s === void 0 ? void 0 : s.parentNode) === null || l === void 0 || l.removeChild(t.gradientBg), (c = (f = t.groundBg) === null || f === void 0 ? void 0 : f.parentNode) === null || c === void 0 || c.removeChild(t.groundBg), t.style && document.head.removeChild(t.style), t._removeEventListener(), t.hooks.emit("disable", { userAction: !0 }), t.state.enabled = !1);
|
|
2910
2910
|
}, t.dispose = function() {
|
|
2911
2911
|
t._removeEventListener(), t.hooks.emit("disable", { userAction: !0 }), t.state.enabled = !1;
|
|
2912
2912
|
}, t.state = {
|
|
@@ -2935,11 +2935,11 @@ var Xe = function(f) {
|
|
|
2935
2935
|
`, t.enable()), t;
|
|
2936
2936
|
}
|
|
2937
2937
|
return o;
|
|
2938
|
-
})(
|
|
2939
|
-
),
|
|
2940
|
-
return new
|
|
2938
|
+
})(Ct.Controller)
|
|
2939
|
+
), rr = function(h, o) {
|
|
2940
|
+
return new Hn(h, o);
|
|
2941
2941
|
};
|
|
2942
|
-
new
|
|
2942
|
+
new v.Matrix4().fromArray([
|
|
2943
2943
|
1,
|
|
2944
2944
|
0,
|
|
2945
2945
|
0,
|
|
@@ -2957,38 +2957,38 @@ new w.Matrix4().fromArray([
|
|
|
2957
2957
|
0,
|
|
2958
2958
|
1
|
|
2959
2959
|
]);
|
|
2960
|
-
var
|
|
2960
|
+
var xt = (
|
|
2961
2961
|
/** @class */
|
|
2962
2962
|
(function() {
|
|
2963
|
-
function
|
|
2964
|
-
this.R = o, this.Q = e, this.A =
|
|
2963
|
+
function h(o, e, n, t, a) {
|
|
2964
|
+
this.R = o, this.Q = e, this.A = n, this.B = t, this.C = a, this.cov = NaN, this.x = NaN;
|
|
2965
2965
|
}
|
|
2966
|
-
return
|
|
2966
|
+
return h.prototype.filter = function(o, e) {
|
|
2967
2967
|
if (e === void 0 && (e = 0), isNaN(this.x))
|
|
2968
2968
|
this.x = 1 / this.C * o, this.cov = 1 / this.C * this.Q * (1 / this.C);
|
|
2969
2969
|
else {
|
|
2970
|
-
var
|
|
2971
|
-
this.x =
|
|
2970
|
+
var n = this.A * this.x + this.B * e, t = this.A * this.cov * this.A + this.R, a = t * this.C * (1 / (this.C * t * this.C + this.Q));
|
|
2971
|
+
this.x = n + a * (o - this.C * n), this.cov = t - a * this.C * t;
|
|
2972
2972
|
}
|
|
2973
2973
|
return this.x;
|
|
2974
|
-
},
|
|
2974
|
+
}, h;
|
|
2975
2975
|
})()
|
|
2976
|
-
),
|
|
2976
|
+
), Wn = (
|
|
2977
2977
|
/** @class */
|
|
2978
|
-
(function(
|
|
2979
|
-
|
|
2980
|
-
function o(e,
|
|
2981
|
-
var t =
|
|
2978
|
+
(function(h) {
|
|
2979
|
+
he(o, h);
|
|
2980
|
+
function o(e, n) {
|
|
2981
|
+
var t = h.call(this, e) || this;
|
|
2982
2982
|
t.dispose = function() {
|
|
2983
2983
|
t.disable();
|
|
2984
2984
|
}, t.five = e;
|
|
2985
|
-
var
|
|
2985
|
+
var a = {
|
|
2986
2986
|
enabled: !0,
|
|
2987
2987
|
visible: !0
|
|
2988
2988
|
};
|
|
2989
|
-
t.state = Object.assign(
|
|
2990
|
-
var
|
|
2991
|
-
return t._config =
|
|
2989
|
+
t.state = Object.assign(a, n == null ? void 0 : n.initialState);
|
|
2990
|
+
var s = V({}, n == null ? void 0 : n.config);
|
|
2991
|
+
return t._config = s, t.state.enabled && t._enable({ userAction: !1 }), t.cancelAnimation = null, t.skipStart = 0, t.skipEnd = 0, t.location = 0, t.totalDistance = 0, t.trajectory = null, t.currentKeyFrame = null, t.nextKeyframe = null, t.nextButOneKeyframe = null, t.keyframes = [], t.rate = t.config.rate || 1, t.virualCamera = t.five.camera.clone(), t.playingState = {
|
|
2992
2992
|
keyframeIndex: null,
|
|
2993
2993
|
progress: null
|
|
2994
2994
|
}, Object.defineProperties(t, {
|
|
@@ -3004,16 +3004,16 @@ var Et = (
|
|
|
3004
3004
|
}
|
|
3005
3005
|
return Object.defineProperty(o.prototype, "config", {
|
|
3006
3006
|
get: function() {
|
|
3007
|
-
return
|
|
3007
|
+
return V({}, this._config);
|
|
3008
3008
|
},
|
|
3009
3009
|
enumerable: !1,
|
|
3010
3010
|
configurable: !0
|
|
3011
|
-
}), o.prototype.updateState = function(e,
|
|
3011
|
+
}), o.prototype.updateState = function(e, n) {
|
|
3012
3012
|
var t = this.state;
|
|
3013
|
-
this.state =
|
|
3013
|
+
this.state = V(V({}, this.state), e), this.hooks.emit("stateChange", { state: this.state, prevState: t, userAction: n });
|
|
3014
3014
|
}, o.prototype.load = function(e) {
|
|
3015
|
-
return
|
|
3016
|
-
return
|
|
3015
|
+
return Le(this, void 0, void 0, function() {
|
|
3016
|
+
return De(this, function(n) {
|
|
3017
3017
|
return [
|
|
3018
3018
|
2
|
|
3019
3019
|
/*return*/
|
|
@@ -3022,25 +3022,25 @@ var Et = (
|
|
|
3022
3022
|
});
|
|
3023
3023
|
}, o.prototype.loadTrajectory = function(e) {
|
|
3024
3024
|
this.trajectory = e, this.cancelAnimation && this.cancelAnimation(), this.playingState.keyframeIndex = null, this.playingState.progress = null;
|
|
3025
|
-
var
|
|
3025
|
+
var n = 0.01, t = 0.1, a = 1, s = 0, l = 1, f = new xt(n, t, a, s, l), c = new xt(n, t, a, s, l), g = new xt(n, t, a, s, l);
|
|
3026
3026
|
if (this.trajectory && this.trajectory.content.loadState === "READY") {
|
|
3027
|
-
for (var
|
|
3027
|
+
for (var y = this.trajectory.content.data.positionArray, w = new Float32Array(y.length / 3), x = 0; x < w.length; x++)
|
|
3028
3028
|
if (x === 0)
|
|
3029
|
-
|
|
3029
|
+
w[x] = 0;
|
|
3030
3030
|
else {
|
|
3031
|
-
var
|
|
3032
|
-
|
|
3031
|
+
var A = new v.Vector3(y[x - 3], y[x - 2], y[x - 1]), S = new v.Vector3(y[x], y[x + 1], y[x + 2]);
|
|
3032
|
+
w[x] = S.distanceTo(A) + w[x - 1];
|
|
3033
3033
|
}
|
|
3034
|
-
this.totalDistance =
|
|
3035
|
-
for (var x = 0; x <
|
|
3036
|
-
for (var
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
var P =
|
|
3040
|
-
position: new
|
|
3041
|
-
location:
|
|
3034
|
+
this.totalDistance = w[w.length - 1];
|
|
3035
|
+
for (var x = 0; x < w.length; x++) {
|
|
3036
|
+
for (var O = new v.Vector3(0, 0, 0), T = 0, b = x - 5; b < x + 6; b++)
|
|
3037
|
+
b >= 0 && b < w.length && (O.add(new v.Vector3(y[b * 3], y[b * 3 + 1], y[b * 3 + 2])), T++);
|
|
3038
|
+
O.divideScalar(T).applyMatrix4(e.transform);
|
|
3039
|
+
var P = f.filter(O.x), m = c.filter(O.y), C = g.filter(O.z), _ = {
|
|
3040
|
+
position: new v.Vector3(P, m, C),
|
|
3041
|
+
location: w[x]
|
|
3042
3042
|
};
|
|
3043
|
-
this.keyframes.push(
|
|
3043
|
+
this.keyframes.push(_);
|
|
3044
3044
|
}
|
|
3045
3045
|
} else
|
|
3046
3046
|
throw new Error("trajectory content is not ready");
|
|
@@ -3048,42 +3048,42 @@ var Et = (
|
|
|
3048
3048
|
(e.keyframeIndex !== null || e.progress !== null) && (this.cancelAnimation && this.cancelAnimation(), this.playingState.keyframeIndex = e.keyframeIndex ? e.keyframeIndex : this.playingState.keyframeIndex, this.playingState.progress = e.progress ? e.progress : this.playingState.progress, this.play());
|
|
3049
3049
|
}, o.prototype._enable = function(e) {
|
|
3050
3050
|
}, o.prototype.play = function() {
|
|
3051
|
-
var e = this,
|
|
3052
|
-
if (
|
|
3051
|
+
var e = this, n = this.keyframes.length;
|
|
3052
|
+
if (n < 2)
|
|
3053
3053
|
throw new Error("keyframes length must be greater than 2");
|
|
3054
3054
|
var t = {
|
|
3055
3055
|
keyframeIndex: null,
|
|
3056
3056
|
progress: null
|
|
3057
3057
|
};
|
|
3058
|
-
this.playingState.keyframeIndex !== null && this.playingState.progress !== null ? (t.keyframeIndex = this.playingState.keyframeIndex, t.progress = this.playingState.progress) : this.playingState.keyframeIndex === null && this.playingState.progress === null && (this.playingState.keyframeIndex = this.skipStart, this.playingState.progress = 0, this.virualCamera.position.copy(this.keyframes[this.playingState.keyframeIndex].position.clone()), this.virualCamera.lookAt(this.keyframes[1].position.clone()), this.virualCamera.computePose(), this.five.setState(
|
|
3059
|
-
var
|
|
3060
|
-
this.cancelAnimation =
|
|
3061
|
-
if (
|
|
3058
|
+
this.playingState.keyframeIndex !== null && this.playingState.progress !== null ? (t.keyframeIndex = this.playingState.keyframeIndex, t.progress = this.playingState.progress) : this.playingState.keyframeIndex === null && this.playingState.progress === null && (this.playingState.keyframeIndex = this.skipStart, this.playingState.progress = 0, this.virualCamera.position.copy(this.keyframes[this.playingState.keyframeIndex].position.clone()), this.virualCamera.lookAt(this.keyframes[1].position.clone()), this.virualCamera.computePose(), this.five.setState(V({}, this.virualCamera.pose)));
|
|
3059
|
+
var a = this.playingState.keyframeIndex, s = 0;
|
|
3060
|
+
this.cancelAnimation = ct.shared.add(function(l, f) {
|
|
3061
|
+
if (a === n - 1 - e.skipEnd && e.cancelAnimation) {
|
|
3062
3062
|
e.cancelAnimation();
|
|
3063
3063
|
return;
|
|
3064
3064
|
}
|
|
3065
|
-
e.currentKeyFrame = e.keyframes[
|
|
3066
|
-
var
|
|
3067
|
-
e.nextButOneKeyframe !== null ? x = e.nextButOneKeyframe.position.clone().sub(e.nextKeyframe.position.clone()).normalize() : x.copy(
|
|
3068
|
-
var
|
|
3069
|
-
|
|
3070
|
-
var
|
|
3071
|
-
|
|
3072
|
-
var
|
|
3073
|
-
e.virualCamera.position.copy(
|
|
3065
|
+
e.currentKeyFrame = e.keyframes[a], e.nextKeyframe = e.keyframes[a + 1], a + 2 <= n - 1 ? e.nextButOneKeyframe = e.keyframes[a + 2] : e.nextButOneKeyframe = null;
|
|
3066
|
+
var c = e.currentKeyFrame.position.clone(), g = e.nextKeyframe.position.clone(), y = e.nextKeyframe.position.clone().sub(e.currentKeyFrame.position.clone()).normalize(), w = c.clone().add(y.clone().multiplyScalar(0.01)), x = new v.Vector3();
|
|
3067
|
+
e.nextButOneKeyframe !== null ? x = e.nextButOneKeyframe.position.clone().sub(e.nextKeyframe.position.clone()).normalize() : x.copy(y);
|
|
3068
|
+
var A = g.clone().add(x.clone().multiplyScalar(0.01));
|
|
3069
|
+
s += f / 1e3 * e.rate;
|
|
3070
|
+
var S = s / c.distanceTo(g);
|
|
3071
|
+
S = S >= 1 ? 1 : S, t.keyframeIndex !== null && t.progress !== null && (S = t.progress, t.keyframeIndex = null, t.progress = null);
|
|
3072
|
+
var O = c.clone().lerp(g, S), T = w.clone().lerp(A, S);
|
|
3073
|
+
e.virualCamera.position.copy(O), e.virualCamera.lookAt(T), e.virualCamera.updateMatrixWorld(), e.virualCamera.updateMatrix(), e.virualCamera.computePose(), e.five.setState(V({}, e.virualCamera.pose)), e.location = e.keyframes[a].location + c.clone().distanceTo(O), S === 1 ? (s = 0, a++, e.playingState.keyframeIndex = a, e.playingState.progress = 0) : (e.playingState.keyframeIndex = a, e.playingState.progress = S);
|
|
3074
3074
|
});
|
|
3075
3075
|
}, o.prototype.pause = function() {
|
|
3076
3076
|
this.cancelAnimation && this.cancelAnimation();
|
|
3077
3077
|
}, o.prototype.findKeyFrameByLocation = function(e) {
|
|
3078
3078
|
if (this.keyframes.length !== 0) {
|
|
3079
|
-
for (var
|
|
3080
|
-
var
|
|
3081
|
-
if (this.keyframes[
|
|
3082
|
-
return
|
|
3083
|
-
this.keyframes[
|
|
3079
|
+
for (var n = 0, t = this.keyframes.length - 1; n <= t; ) {
|
|
3080
|
+
var a = Math.floor((n + t) / 2);
|
|
3081
|
+
if (this.keyframes[a].location === e)
|
|
3082
|
+
return a;
|
|
3083
|
+
this.keyframes[a].location < e ? n = a + 1 : t = a - 1;
|
|
3084
3084
|
}
|
|
3085
3085
|
return {
|
|
3086
|
-
keyframeIndex:
|
|
3086
|
+
keyframeIndex: n - 1,
|
|
3087
3087
|
progress: 0
|
|
3088
3088
|
};
|
|
3089
3089
|
}
|
|
@@ -3091,26 +3091,26 @@ var Et = (
|
|
|
3091
3091
|
this.playingState.keyframeIndex = null, this.playingState.progress = null;
|
|
3092
3092
|
}, o.prototype._disable = function(e) {
|
|
3093
3093
|
}, o.prototype.enable = function(e) {
|
|
3094
|
-
var
|
|
3094
|
+
var n;
|
|
3095
3095
|
if (!this.state.enabled) {
|
|
3096
|
-
var t = (
|
|
3096
|
+
var t = (n = e == null ? void 0 : e.userAction) !== null && n !== void 0 ? n : !0;
|
|
3097
3097
|
this.updateState({ enabled: !0 }, t), this._enable({ userAction: t });
|
|
3098
3098
|
}
|
|
3099
3099
|
}, o.prototype.disable = function(e) {
|
|
3100
|
-
var
|
|
3100
|
+
var n;
|
|
3101
3101
|
if (this.state.enabled !== !1) {
|
|
3102
|
-
var t = (
|
|
3102
|
+
var t = (n = e == null ? void 0 : e.userAction) !== null && n !== void 0 ? n : !0;
|
|
3103
3103
|
this.updateState({ enabled: !1 }, t), this._disable({ userAction: t });
|
|
3104
3104
|
}
|
|
3105
3105
|
}, o;
|
|
3106
|
-
})(
|
|
3107
|
-
),
|
|
3108
|
-
return new
|
|
3106
|
+
})(Xe.Controller)
|
|
3107
|
+
), ir = function(h, o) {
|
|
3108
|
+
return new Wn(h, o);
|
|
3109
3109
|
};
|
|
3110
|
-
function
|
|
3111
|
-
return
|
|
3110
|
+
function Qt(h, o, e) {
|
|
3111
|
+
return h < o ? o : h > e ? e : h;
|
|
3112
3112
|
}
|
|
3113
|
-
var
|
|
3113
|
+
var Xn = (
|
|
3114
3114
|
/* glsl */
|
|
3115
3115
|
`
|
|
3116
3116
|
varying vec2 vUv;
|
|
@@ -3121,7 +3121,7 @@ void main() {
|
|
|
3121
3121
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
3122
3122
|
}
|
|
3123
3123
|
`
|
|
3124
|
-
),
|
|
3124
|
+
), qn = (
|
|
3125
3125
|
/* glsl */
|
|
3126
3126
|
`
|
|
3127
3127
|
varying vec2 vUv;
|
|
@@ -3143,72 +3143,72 @@ void main() {
|
|
|
3143
3143
|
gl_FragColor.a = gl_FragColor.a * opacity;
|
|
3144
3144
|
}
|
|
3145
3145
|
`
|
|
3146
|
-
),
|
|
3146
|
+
), Kn = [1, 5, 2, 6, 3, 7, 4, 8, 9, 13, 10, 14, 11, 15, 12, 16], Pt = 512, At = 512, ot = 128, Zn = (
|
|
3147
3147
|
/** @class */
|
|
3148
|
-
(function(
|
|
3149
|
-
|
|
3150
|
-
function o(e,
|
|
3151
|
-
var t =
|
|
3152
|
-
t.group = new
|
|
3153
|
-
var l = new
|
|
3148
|
+
(function(h) {
|
|
3149
|
+
he(o, h);
|
|
3150
|
+
function o(e, n) {
|
|
3151
|
+
var t = h.call(this, e) || this;
|
|
3152
|
+
t.group = new v.Group(), t.mesh = (function() {
|
|
3153
|
+
var l = new v.CylinderGeometry(0.12, 0.12, 1, 32, 1, !0);
|
|
3154
3154
|
l.translate(0, 0.5, 0);
|
|
3155
|
-
var
|
|
3156
|
-
vertexShader:
|
|
3157
|
-
fragmentShader:
|
|
3155
|
+
var f = new v.ShaderMaterial({
|
|
3156
|
+
vertexShader: Xn,
|
|
3157
|
+
fragmentShader: qn,
|
|
3158
3158
|
uniforms: {
|
|
3159
|
-
map: { value: new
|
|
3159
|
+
map: { value: new v.Texture() },
|
|
3160
3160
|
progress: { value: 0 },
|
|
3161
3161
|
opacity: { value: 0 }
|
|
3162
3162
|
},
|
|
3163
3163
|
transparent: !0,
|
|
3164
3164
|
depthTest: !1
|
|
3165
|
-
}),
|
|
3166
|
-
return
|
|
3167
|
-
})(), t.panoMesh = new
|
|
3168
|
-
}, t.drawLine = function(l,
|
|
3165
|
+
}), c = new v.Mesh(l, f);
|
|
3166
|
+
return c;
|
|
3167
|
+
})(), t.panoMesh = new Sn({ scale: 1.5 }), t.stop = function() {
|
|
3168
|
+
}, t.drawLine = function(l, f) {
|
|
3169
3169
|
if (t.ctx) {
|
|
3170
|
-
var
|
|
3171
|
-
var
|
|
3172
|
-
return x * ((
|
|
3173
|
-
})(),
|
|
3174
|
-
|
|
3170
|
+
var c = (function() {
|
|
3171
|
+
var w, x = Pt / 16 | 0;
|
|
3172
|
+
return x * ((w = Kn[l]) !== null && w !== void 0 ? w : 0);
|
|
3173
|
+
})(), g = (1 - (f + l * 150) % 1200 / 1200) * (At + ot), y = t.ctx.createLinearGradient(0, g - ot, 0, g);
|
|
3174
|
+
y.addColorStop(0, "rgba(255,255,255,0)"), y.addColorStop(0.5, "rgba(255,255,255,1)"), y.addColorStop(1, "rgba(255,255,255,0)"), t.ctx.fillStyle = y, t.ctx.fillRect(c, g - ot, 3, ot);
|
|
3175
3175
|
}
|
|
3176
3176
|
}, t.anime = function(l) {
|
|
3177
3177
|
if (t.ctx && t.startTime) {
|
|
3178
|
-
t.ctx.clearRect(0, 0,
|
|
3179
|
-
for (var
|
|
3180
|
-
t.drawLine(
|
|
3181
|
-
var
|
|
3182
|
-
t.panoMesh.setOpacity(
|
|
3178
|
+
t.ctx.clearRect(0, 0, Pt, At);
|
|
3179
|
+
for (var f = 0; f < 16; f++)
|
|
3180
|
+
t.drawLine(f, l - t.startTime);
|
|
3181
|
+
var c = Qt((l - t.startTime) / 1e3, 0, 1), g = Qt((l - t.startTime) / 300, 0, t.config.maxOpacity);
|
|
3182
|
+
t.panoMesh.setOpacity(g), t.mesh.material.uniforms.progress.value = c, t.mesh.material.uniforms.opacity.value = g, t.mesh.material.uniforms.map.value.needsUpdate = !0, t.five.needsRender = !0;
|
|
3183
3183
|
}
|
|
3184
3184
|
}, t.dispose = function() {
|
|
3185
3185
|
t.disable();
|
|
3186
3186
|
}, t.five = e;
|
|
3187
|
-
var
|
|
3187
|
+
var a = {
|
|
3188
3188
|
enabled: !1,
|
|
3189
3189
|
visible: !0
|
|
3190
3190
|
};
|
|
3191
|
-
t.state = Object.assign(
|
|
3192
|
-
var
|
|
3193
|
-
return t._config =
|
|
3191
|
+
t.state = Object.assign(a, n == null ? void 0 : n.initialState);
|
|
3192
|
+
var s = V(V({}, n == null ? void 0 : n.config), { maxOpacity: 1 });
|
|
3193
|
+
return t._config = s, typeof document == "undefined" || (t.canvas = document.createElement("canvas"), t.ctx = t.canvas.getContext("2d"), t.canvas.width = Pt, t.canvas.height = At, t.ctx.shadowColor = "rgba(255,255,255,0.5)", t.ctx.shadowBlur = 6, t.ctx.shadowOffsetX = 0, t.ctx.shadowOffsetY = 0, t.mesh.material.uniforms.map.value = new v.CanvasTexture(t.canvas), t.group.add(t.mesh), t.panoMesh.setProgress(1), t.panoMesh.setOpacity(0), t.group.add(t.panoMesh), t.state.enabled && t._enable({ userAction: !1 })), t;
|
|
3194
3194
|
}
|
|
3195
3195
|
return Object.defineProperty(o.prototype, "config", {
|
|
3196
3196
|
get: function() {
|
|
3197
|
-
return
|
|
3197
|
+
return V({}, this._config);
|
|
3198
3198
|
},
|
|
3199
3199
|
enumerable: !1,
|
|
3200
3200
|
configurable: !0
|
|
3201
|
-
}), o.prototype.updateState = function(e,
|
|
3201
|
+
}), o.prototype.updateState = function(e, n) {
|
|
3202
3202
|
var t = this.state;
|
|
3203
|
-
this.state =
|
|
3204
|
-
}, o.prototype.updateConfig = function(e,
|
|
3203
|
+
this.state = V(V({}, this.state), e), this.hooks.emit("stateChange", { state: this.state, prevState: t, userAction: n });
|
|
3204
|
+
}, o.prototype.updateConfig = function(e, n) {
|
|
3205
3205
|
var t;
|
|
3206
|
-
|
|
3207
|
-
var
|
|
3208
|
-
this._config =
|
|
3206
|
+
n === void 0 && (n = {});
|
|
3207
|
+
var a = this.config, s = V(V({}, a), e);
|
|
3208
|
+
this._config = s, this.hooks.emit("configChange", { prevConfig: a, config: s, userAction: (t = n.userAction) !== null && t !== void 0 ? t : !0 });
|
|
3209
3209
|
}, o.prototype.load = function(e) {
|
|
3210
|
-
return
|
|
3211
|
-
return
|
|
3210
|
+
return Le(this, void 0, void 0, function() {
|
|
3211
|
+
return De(this, function(n) {
|
|
3212
3212
|
return [
|
|
3213
3213
|
2
|
|
3214
3214
|
/*return*/
|
|
@@ -3216,46 +3216,861 @@ void main() {
|
|
|
3216
3216
|
});
|
|
3217
3217
|
});
|
|
3218
3218
|
}, o.prototype._enable = function(e) {
|
|
3219
|
-
var
|
|
3219
|
+
var n = this;
|
|
3220
3220
|
this.mesh.position.copy(this.five.observers[this.five.state.panoIndex].standingPosition), this.panoMesh.position.copy(this.five.observers[this.five.state.panoIndex].standingPosition), this.five.ready().then(function() {
|
|
3221
|
-
|
|
3222
|
-
|
|
3221
|
+
n.five.scene.add(n.group), n.stop = ct.shared.add(function(t, a) {
|
|
3222
|
+
n.startTime || (n.startTime = t), n.panoMesh.updateTime(t, a), n.anime(t);
|
|
3223
3223
|
});
|
|
3224
3224
|
});
|
|
3225
3225
|
}, o.prototype._disable = function(e) {
|
|
3226
3226
|
this.five.scene.remove(this.group), this.panoMesh.setOpacity(0), this.startTime = void 0, this.stop(), this.five.needsRender = !0;
|
|
3227
3227
|
}, o.prototype.enable = function(e) {
|
|
3228
|
-
var
|
|
3228
|
+
var n;
|
|
3229
3229
|
if (this.ctx && !this.state.enabled && this.five.observers[this.five.state.panoIndex]) {
|
|
3230
|
-
var t = (
|
|
3230
|
+
var t = (n = e == null ? void 0 : e.userAction) !== null && n !== void 0 ? n : !0;
|
|
3231
3231
|
this.updateState({ enabled: !0 }, t), this._enable({ userAction: t });
|
|
3232
3232
|
}
|
|
3233
3233
|
}, o.prototype.disable = function(e) {
|
|
3234
|
-
var
|
|
3234
|
+
var n;
|
|
3235
3235
|
if (this.state.enabled !== !1) {
|
|
3236
|
-
var t = (
|
|
3236
|
+
var t = (n = e == null ? void 0 : e.userAction) !== null && n !== void 0 ? n : !0;
|
|
3237
3237
|
this.updateState({ enabled: !1 }, t), this._disable({ userAction: t });
|
|
3238
3238
|
}
|
|
3239
|
-
}, o.prototype.setState = function(e,
|
|
3240
|
-
|
|
3241
|
-
var t = this.state,
|
|
3242
|
-
if (this.updateState(e,
|
|
3243
|
-
var
|
|
3244
|
-
e.enabled ? this._enable(
|
|
3239
|
+
}, o.prototype.setState = function(e, n) {
|
|
3240
|
+
n === void 0 && (n = {});
|
|
3241
|
+
var t = this.state, a = n.userAction !== void 0 ? n.userAction : !0;
|
|
3242
|
+
if (this.updateState(e, a), e.enabled !== void 0 && t.enabled !== e.enabled) {
|
|
3243
|
+
var s = { userAction: a };
|
|
3244
|
+
e.enabled ? this._enable(s) : this._disable(s);
|
|
3245
|
+
}
|
|
3246
|
+
}, o;
|
|
3247
|
+
})(Ct.Controller)
|
|
3248
|
+
), ar = function(h, o) {
|
|
3249
|
+
return new Zn(h, o);
|
|
3250
|
+
}, Ot = (
|
|
3251
|
+
/** @class */
|
|
3252
|
+
(function(h) {
|
|
3253
|
+
he(o, h);
|
|
3254
|
+
function o() {
|
|
3255
|
+
var e = h.call(this) || this;
|
|
3256
|
+
e.type = "LineSegmentsGeometry";
|
|
3257
|
+
var n = [-1, 2, 0, 1, 2, 0, -1, 1, 0, 1, 1, 0, -1, 0, 0, 1, 0, 0, -1, -1, 0, 1, -1, 0], t = [-1, 2, 1, 2, -1, 1, 1, 1, -1, -1, 1, -1, -1, -2, 1, -2], a = [0, 2, 1, 2, 3, 1, 2, 4, 3, 4, 5, 3, 4, 6, 5, 6, 7, 5];
|
|
3258
|
+
return e.setIndex(a), e.setAttribute("position", new v.Float32BufferAttribute(n, 3)), e.setAttribute("uv", new v.Float32BufferAttribute(t, 2)), e;
|
|
3259
|
+
}
|
|
3260
|
+
return o.prototype.applyMatrix4 = function(e) {
|
|
3261
|
+
var n = this.attributes.instanceStart, t = this.attributes.instanceEnd;
|
|
3262
|
+
return n !== void 0 && (n.applyMatrix4(e), t.applyMatrix4(e), n.needsUpdate = !0), this.boundingBox !== null && this.computeBoundingBox(), this.boundingSphere !== null && this.computeBoundingSphere(), this;
|
|
3263
|
+
}, o.prototype.setPositions = function(e) {
|
|
3264
|
+
var n;
|
|
3265
|
+
e instanceof Float32Array ? n = e : Array.isArray(e) ? n = new Float32Array(e) : n = new Float32Array();
|
|
3266
|
+
var t = new v.InstancedInterleavedBuffer(n, 6, 1);
|
|
3267
|
+
return this.setAttribute("instanceStart", new v.InterleavedBufferAttribute(t, 3, 0)), this.setAttribute("instanceEnd", new v.InterleavedBufferAttribute(t, 3, 3)), this.computeBoundingBox(), this.computeBoundingSphere(), this;
|
|
3268
|
+
}, o.prototype.setColors = function(e) {
|
|
3269
|
+
var n;
|
|
3270
|
+
e instanceof Float32Array ? n = e : Array.isArray(e) ? n = new Float32Array(e) : n = new Float32Array();
|
|
3271
|
+
var t = new v.InstancedInterleavedBuffer(n, 6, 1);
|
|
3272
|
+
return this.setAttribute("instanceColorStart", new v.InterleavedBufferAttribute(t, 3, 0)), this.setAttribute("instanceColorEnd", new v.InterleavedBufferAttribute(t, 3, 3)), this;
|
|
3273
|
+
}, o.prototype.fromWireframeGeometry = function(e) {
|
|
3274
|
+
return this.setPositions(e.attributes.position.array), this;
|
|
3275
|
+
}, o.prototype.fromEdgesGeometry = function(e) {
|
|
3276
|
+
return this.setPositions(e.attributes.position.array), this;
|
|
3277
|
+
}, o.prototype.fromMesh = function(e) {
|
|
3278
|
+
return this.fromWireframeGeometry(new v.WireframeGeometry(e.geometry)), this;
|
|
3279
|
+
}, o.prototype.fromLineSegments = function(e) {
|
|
3280
|
+
var n = e.geometry;
|
|
3281
|
+
if (n instanceof v.Geometry) {
|
|
3282
|
+
var t = new v.BufferGeometry().fromGeometry(n);
|
|
3283
|
+
this.setPositions(t.attributes.position.array);
|
|
3284
|
+
} else n instanceof v.BufferGeometry && this.setPositions(n.attributes.position.array);
|
|
3285
|
+
return this;
|
|
3286
|
+
}, o.prototype.computeBoundingBox = function() {
|
|
3287
|
+
this.boundingBox === null && (this.boundingBox = new v.Box3());
|
|
3288
|
+
var e = this.attributes.instanceStart, n = this.attributes.instanceEnd;
|
|
3289
|
+
if (e !== void 0 && n !== void 0) {
|
|
3290
|
+
var t = new v.Box3();
|
|
3291
|
+
this.boundingBox.setFromBufferAttribute(e), t.setFromBufferAttribute(n), this.boundingBox.union(t);
|
|
3292
|
+
}
|
|
3293
|
+
}, o.prototype.computeBoundingSphere = function() {
|
|
3294
|
+
this.boundingSphere === null && (this.boundingSphere = new v.Sphere()), this.boundingBox === null && this.computeBoundingBox();
|
|
3295
|
+
var e = this.attributes.instanceStart, n = this.attributes.instanceEnd;
|
|
3296
|
+
if (e !== void 0 && n !== void 0) {
|
|
3297
|
+
var t = this.boundingSphere.center;
|
|
3298
|
+
this.boundingBox.getCenter(t);
|
|
3299
|
+
for (var a = 0, s = new v.Vector3(), l = 0, f = e.count; l < f; l++)
|
|
3300
|
+
s.fromBufferAttribute(e, l), a = Math.max(a, t.distanceToSquared(s)), s.fromBufferAttribute(n, l), a = Math.max(a, t.distanceToSquared(s));
|
|
3301
|
+
this.boundingSphere.radius = Math.sqrt(a), isNaN(this.boundingSphere.radius) && console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.", this);
|
|
3302
|
+
}
|
|
3303
|
+
}, o.prototype.toJSON = function() {
|
|
3304
|
+
}, o;
|
|
3305
|
+
})(v.InstancedBufferGeometry)
|
|
3306
|
+
);
|
|
3307
|
+
Object.assign(Ot.prototype, { isLineSegmentsGeometry: !0 });
|
|
3308
|
+
var St = {
|
|
3309
|
+
uniforms: v.UniformsUtils.merge([
|
|
3310
|
+
v.UniformsLib.common,
|
|
3311
|
+
v.UniformsLib.fog,
|
|
3312
|
+
{
|
|
3313
|
+
linewidth: { value: 1 },
|
|
3314
|
+
resolution: { value: new v.Vector2(1, 1) },
|
|
3315
|
+
dashScale: { value: 1 },
|
|
3316
|
+
dashSize: { value: 1 },
|
|
3317
|
+
gapSize: { value: 1 },
|
|
3318
|
+
opacity: { value: 1 },
|
|
3319
|
+
totalLength: { value: 1 },
|
|
3320
|
+
animationProgress: { value: 0 },
|
|
3321
|
+
time: { value: 0 },
|
|
3322
|
+
// 动画时间
|
|
3323
|
+
waveAmp: { value: 0.15 },
|
|
3324
|
+
// 波动幅度(调大了)
|
|
3325
|
+
waveFreq: { value: 5 },
|
|
3326
|
+
// 波动频率
|
|
3327
|
+
waveDir: { value: 2 },
|
|
3328
|
+
// 波动方向控制:0=无, 1=X, 2=Y, 3=Z
|
|
3329
|
+
startOffset: { value: 0 }
|
|
3330
|
+
// 新起点的偏移距离
|
|
3331
|
+
}
|
|
3332
|
+
]),
|
|
3333
|
+
vertexShader: `
|
|
3334
|
+
#include <common>
|
|
3335
|
+
#include <color_pars_vertex>
|
|
3336
|
+
#include <fog_pars_vertex>
|
|
3337
|
+
#include <logdepthbuf_pars_vertex>
|
|
3338
|
+
#include <clipping_planes_pars_vertex>
|
|
3339
|
+
|
|
3340
|
+
uniform float linewidth;
|
|
3341
|
+
uniform vec2 resolution;
|
|
3342
|
+
uniform float totalLength;
|
|
3343
|
+
uniform float time;
|
|
3344
|
+
uniform float waveAmp;
|
|
3345
|
+
uniform float waveFreq;
|
|
3346
|
+
uniform float waveDir;
|
|
3347
|
+
uniform float startOffset;
|
|
3348
|
+
|
|
3349
|
+
attribute vec3 instanceStart;
|
|
3350
|
+
attribute vec3 instanceEnd;
|
|
3351
|
+
attribute float distanceProgress;
|
|
3352
|
+
attribute vec3 instanceColorStart;
|
|
3353
|
+
attribute vec3 instanceColorEnd;
|
|
3354
|
+
attribute float instanceDistanceStart;
|
|
3355
|
+
attribute float instanceDistanceEnd;
|
|
3356
|
+
|
|
3357
|
+
varying vec2 vUv;
|
|
3358
|
+
varying float vDistanceProgress;
|
|
3359
|
+
|
|
3360
|
+
#ifdef USE_DASH
|
|
3361
|
+
uniform float dashScale;
|
|
3362
|
+
varying float vLineDistance;
|
|
3363
|
+
#endif
|
|
3364
|
+
|
|
3365
|
+
void trimSegment(const in vec4 start, inout vec4 end) {
|
|
3366
|
+
float a = projectionMatrix[2][2];
|
|
3367
|
+
float b = projectionMatrix[3][2];
|
|
3368
|
+
float nearEstimate = -0.5 * b / a;
|
|
3369
|
+
float alpha = (nearEstimate - start.z) / (end.z - start.z);
|
|
3370
|
+
end.xyz = mix(start.xyz, end.xyz, alpha);
|
|
3371
|
+
}
|
|
3372
|
+
|
|
3373
|
+
void main() {
|
|
3374
|
+
#ifdef USE_COLOR
|
|
3375
|
+
vColor.xyz = (position.y < 0.5) ? instanceColorStart : instanceColorEnd;
|
|
3376
|
+
#endif
|
|
3377
|
+
|
|
3378
|
+
#ifdef USE_DASH
|
|
3379
|
+
vLineDistance = (position.y < 0.5) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;
|
|
3380
|
+
#endif
|
|
3381
|
+
|
|
3382
|
+
float aspect = resolution.x / resolution.y;
|
|
3383
|
+
vUv = uv;
|
|
3384
|
+
|
|
3385
|
+
// camera space
|
|
3386
|
+
vec4 start = modelViewMatrix * vec4(instanceStart, 1.0);
|
|
3387
|
+
vec4 end = modelViewMatrix * vec4(instanceEnd, 1.0);
|
|
3388
|
+
|
|
3389
|
+
// ===== 波浪偏移逻辑 =====
|
|
3390
|
+
if (waveDir > 0.5) { // 0 表示不波动
|
|
3391
|
+
float adjustedDistanceStart = max(0.0, instanceDistanceStart - startOffset);
|
|
3392
|
+
float adjustedDistanceEnd = max(0.0, instanceDistanceEnd - startOffset);
|
|
3393
|
+
float adjustedTotalLength = max(0.01, totalLength - startOffset);
|
|
3394
|
+
float phaseStart = adjustedDistanceStart / adjustedTotalLength;
|
|
3395
|
+
float phaseEnd = adjustedDistanceEnd / adjustedTotalLength;
|
|
3396
|
+
float waveStart = sin(phaseStart * waveFreq - time * 2.0) * waveAmp;
|
|
3397
|
+
float waveEnd = sin(phaseEnd * waveFreq - time * 2.0) * waveAmp;
|
|
3398
|
+
|
|
3399
|
+
if (abs(waveDir - 1.0) < 0.1) { // X 方向
|
|
3400
|
+
start.x += waveStart;
|
|
3401
|
+
end.x += waveEnd;
|
|
3402
|
+
} else if (abs(waveDir - 2.0) < 0.1) { // Y 方向
|
|
3403
|
+
start.y += waveStart;
|
|
3404
|
+
end.y += waveEnd;
|
|
3405
|
+
} else if (abs(waveDir - 3.0) < 0.1) { // Z 方向
|
|
3406
|
+
start.z += waveStart;
|
|
3407
|
+
end.z += waveEnd;
|
|
3408
|
+
}
|
|
3409
|
+
}
|
|
3410
|
+
// ======================
|
|
3411
|
+
|
|
3412
|
+
bool perspective = (projectionMatrix[2][3] == -1.0);
|
|
3413
|
+
if (perspective) {
|
|
3414
|
+
if (start.z < 0.0 && end.z >= 0.0) {
|
|
3415
|
+
trimSegment(start, end);
|
|
3416
|
+
} else if (end.z < 0.0 && start.z >= 0.0) {
|
|
3417
|
+
trimSegment(end, start);
|
|
3418
|
+
}
|
|
3419
|
+
}
|
|
3420
|
+
|
|
3421
|
+
vec4 clipStart = projectionMatrix * start;
|
|
3422
|
+
vec4 clipEnd = projectionMatrix * end;
|
|
3423
|
+
|
|
3424
|
+
vec2 ndcStart = clipStart.xy / clipStart.w;
|
|
3425
|
+
vec2 ndcEnd = clipEnd.xy / clipEnd.w;
|
|
3426
|
+
|
|
3427
|
+
vec2 dir = ndcEnd - ndcStart;
|
|
3428
|
+
dir.x *= aspect;
|
|
3429
|
+
dir = normalize(dir);
|
|
3430
|
+
|
|
3431
|
+
vec2 offset = vec2(dir.y, -dir.x);
|
|
3432
|
+
dir.x /= aspect;
|
|
3433
|
+
offset.x /= aspect;
|
|
3434
|
+
|
|
3435
|
+
if (position.x < 0.0) offset *= -1.0;
|
|
3436
|
+
if (position.y < 0.0) {
|
|
3437
|
+
offset += -dir;
|
|
3438
|
+
} else if (position.y > 1.0) {
|
|
3439
|
+
offset += dir;
|
|
3440
|
+
}
|
|
3441
|
+
|
|
3442
|
+
offset *= linewidth;
|
|
3443
|
+
offset /= resolution.y;
|
|
3444
|
+
|
|
3445
|
+
vec4 clip = (position.y < 0.5) ? clipStart : clipEnd;
|
|
3446
|
+
offset *= clip.w;
|
|
3447
|
+
clip.xy += offset;
|
|
3448
|
+
|
|
3449
|
+
gl_Position = clip;
|
|
3450
|
+
|
|
3451
|
+
float adjustedDistanceEnd = max(0.0, instanceDistanceEnd - startOffset);
|
|
3452
|
+
float adjustedTotalLength = max(0.01, totalLength - startOffset);
|
|
3453
|
+
vDistanceProgress = adjustedDistanceEnd / adjustedTotalLength;
|
|
3454
|
+
|
|
3455
|
+
#include <logdepthbuf_vertex>
|
|
3456
|
+
#include <clipping_planes_vertex>
|
|
3457
|
+
#include <fog_vertex>
|
|
3458
|
+
}
|
|
3459
|
+
`,
|
|
3460
|
+
fragmentShader: `
|
|
3461
|
+
uniform vec3 diffuse;
|
|
3462
|
+
uniform float opacity;
|
|
3463
|
+
uniform float animationProgress;
|
|
3464
|
+
varying float vDistanceProgress;
|
|
3465
|
+
|
|
3466
|
+
#ifdef USE_DASH
|
|
3467
|
+
uniform float dashSize;
|
|
3468
|
+
uniform float gapSize;
|
|
3469
|
+
#endif
|
|
3470
|
+
|
|
3471
|
+
varying float vLineDistance;
|
|
3472
|
+
#include <common>
|
|
3473
|
+
#include <color_pars_fragment>
|
|
3474
|
+
#include <fog_pars_fragment>
|
|
3475
|
+
#include <logdepthbuf_pars_fragment>
|
|
3476
|
+
#include <clipping_planes_pars_fragment>
|
|
3477
|
+
varying vec2 vUv;
|
|
3478
|
+
|
|
3479
|
+
void main() {
|
|
3480
|
+
#include <clipping_planes_fragment>
|
|
3481
|
+
|
|
3482
|
+
#ifdef USE_DASH
|
|
3483
|
+
if (vUv.y < -1.0 || vUv.y > 1.0) discard;
|
|
3484
|
+
if (mod(vLineDistance, dashSize + gapSize) > dashSize) discard;
|
|
3485
|
+
#endif
|
|
3486
|
+
|
|
3487
|
+
if (abs(vUv.y) > 1.0) {
|
|
3488
|
+
float a = vUv.x;
|
|
3489
|
+
float b = (vUv.y > 0.0) ? vUv.y - 1.0 : vUv.y + 1.0;
|
|
3490
|
+
float len2 = a * a + b * b;
|
|
3491
|
+
if (len2 > 1.0) discard;
|
|
3492
|
+
}
|
|
3493
|
+
|
|
3494
|
+
vec4 diffuseColor = vec4(diffuse, opacity);
|
|
3495
|
+
#include <logdepthbuf_fragment>
|
|
3496
|
+
#include <color_fragment>
|
|
3497
|
+
|
|
3498
|
+
gl_FragColor = vec4(diffuseColor.rgb, diffuseColor.a);
|
|
3499
|
+
|
|
3500
|
+
float range = 0.3;
|
|
3501
|
+
float alpha = 0.0;
|
|
3502
|
+
float diff = abs(vDistanceProgress - animationProgress);
|
|
3503
|
+
diff = min(diff, 1.0 - diff);
|
|
3504
|
+
if (diff < range) {
|
|
3505
|
+
alpha = 1.0 - diff / range;
|
|
3506
|
+
}
|
|
3507
|
+
if (vDistanceProgress > 0.9) {
|
|
3508
|
+
alpha = min(alpha, (1.0 - vDistanceProgress) / 0.1);
|
|
3509
|
+
}
|
|
3510
|
+
alpha = clamp(alpha, 0.0, 1.0);
|
|
3511
|
+
gl_FragColor.a = alpha;
|
|
3512
|
+
|
|
3513
|
+
#include <tonemapping_fragment>
|
|
3514
|
+
#include <fog_fragment>
|
|
3515
|
+
#include <premultiplied_alpha_fragment>
|
|
3516
|
+
}
|
|
3517
|
+
`
|
|
3518
|
+
}, It = (
|
|
3519
|
+
/** @class */
|
|
3520
|
+
(function(h) {
|
|
3521
|
+
he(o, h);
|
|
3522
|
+
function o(e) {
|
|
3523
|
+
var n = h.call(this, {
|
|
3524
|
+
uniforms: v.UniformsUtils.clone(St.uniforms),
|
|
3525
|
+
vertexShader: St.vertexShader,
|
|
3526
|
+
fragmentShader: St.fragmentShader,
|
|
3527
|
+
clipping: !0
|
|
3528
|
+
}) || this;
|
|
3529
|
+
return n.type = "LineMaterial", n.dashed = !1, Object.defineProperties(n, {
|
|
3530
|
+
color: {
|
|
3531
|
+
enumerable: !0,
|
|
3532
|
+
get: function() {
|
|
3533
|
+
return this.uniforms.diffuse.value;
|
|
3534
|
+
},
|
|
3535
|
+
set: function(t) {
|
|
3536
|
+
this.uniforms.diffuse.value = t;
|
|
3537
|
+
}
|
|
3538
|
+
},
|
|
3539
|
+
linewidth: {
|
|
3540
|
+
enumerable: !0,
|
|
3541
|
+
get: function() {
|
|
3542
|
+
return this.uniforms.linewidth.value;
|
|
3543
|
+
},
|
|
3544
|
+
set: function(t) {
|
|
3545
|
+
this.uniforms.linewidth.value = t;
|
|
3546
|
+
}
|
|
3547
|
+
},
|
|
3548
|
+
dashScale: {
|
|
3549
|
+
enumerable: !0,
|
|
3550
|
+
get: function() {
|
|
3551
|
+
return this.uniforms.dashScale.value;
|
|
3552
|
+
},
|
|
3553
|
+
set: function(t) {
|
|
3554
|
+
this.uniforms.dashScale.value = t;
|
|
3555
|
+
}
|
|
3556
|
+
},
|
|
3557
|
+
dashSize: {
|
|
3558
|
+
enumerable: !0,
|
|
3559
|
+
get: function() {
|
|
3560
|
+
return this.uniforms.dashSize.value;
|
|
3561
|
+
},
|
|
3562
|
+
set: function(t) {
|
|
3563
|
+
this.uniforms.dashSize.value = t;
|
|
3564
|
+
}
|
|
3565
|
+
},
|
|
3566
|
+
gapSize: {
|
|
3567
|
+
enumerable: !0,
|
|
3568
|
+
get: function() {
|
|
3569
|
+
return this.uniforms.gapSize.value;
|
|
3570
|
+
},
|
|
3571
|
+
set: function(t) {
|
|
3572
|
+
this.uniforms.gapSize.value = t;
|
|
3573
|
+
}
|
|
3574
|
+
},
|
|
3575
|
+
opacity: {
|
|
3576
|
+
enumerable: !0,
|
|
3577
|
+
get: function() {
|
|
3578
|
+
return this.uniforms.opacity.value;
|
|
3579
|
+
},
|
|
3580
|
+
set: function(t) {
|
|
3581
|
+
this.uniforms.opacity.value = t;
|
|
3582
|
+
}
|
|
3583
|
+
},
|
|
3584
|
+
resolution: {
|
|
3585
|
+
enumerable: !0,
|
|
3586
|
+
get: function() {
|
|
3587
|
+
return this.uniforms.resolution.value;
|
|
3588
|
+
},
|
|
3589
|
+
set: function(t) {
|
|
3590
|
+
this.uniforms.resolution.value.copy(t);
|
|
3591
|
+
}
|
|
3592
|
+
},
|
|
3593
|
+
time: {
|
|
3594
|
+
enumerable: !0,
|
|
3595
|
+
get: function() {
|
|
3596
|
+
return this.uniforms.time.value;
|
|
3597
|
+
},
|
|
3598
|
+
set: function(t) {
|
|
3599
|
+
this.uniforms.time.value = t;
|
|
3600
|
+
}
|
|
3601
|
+
},
|
|
3602
|
+
waveAmp: {
|
|
3603
|
+
enumerable: !0,
|
|
3604
|
+
get: function() {
|
|
3605
|
+
return this.uniforms.waveAmp.value;
|
|
3606
|
+
},
|
|
3607
|
+
set: function(t) {
|
|
3608
|
+
this.uniforms.waveAmp.value = t;
|
|
3609
|
+
}
|
|
3610
|
+
},
|
|
3611
|
+
waveFreq: {
|
|
3612
|
+
enumerable: !0,
|
|
3613
|
+
get: function() {
|
|
3614
|
+
return this.uniforms.waveFreq.value;
|
|
3615
|
+
},
|
|
3616
|
+
set: function(t) {
|
|
3617
|
+
this.uniforms.waveFreq.value = t;
|
|
3618
|
+
}
|
|
3619
|
+
},
|
|
3620
|
+
waveDir: {
|
|
3621
|
+
enumerable: !0,
|
|
3622
|
+
get: function() {
|
|
3623
|
+
return this.uniforms.waveDir.value;
|
|
3624
|
+
},
|
|
3625
|
+
set: function(t) {
|
|
3626
|
+
this.uniforms.waveDir.value = t;
|
|
3627
|
+
}
|
|
3628
|
+
},
|
|
3629
|
+
startOffset: {
|
|
3630
|
+
enumerable: !0,
|
|
3631
|
+
get: function() {
|
|
3632
|
+
return this.uniforms.startOffset.value;
|
|
3633
|
+
},
|
|
3634
|
+
set: function(t) {
|
|
3635
|
+
this.uniforms.startOffset.value = t;
|
|
3636
|
+
}
|
|
3637
|
+
}
|
|
3638
|
+
}), n.setValues(e), n;
|
|
3639
|
+
}
|
|
3640
|
+
return o;
|
|
3641
|
+
})(v.ShaderMaterial)
|
|
3642
|
+
);
|
|
3643
|
+
Object.assign(It.prototype, { isLineMaterial: !0 });
|
|
3644
|
+
var en = (
|
|
3645
|
+
/** @class */
|
|
3646
|
+
(function(h) {
|
|
3647
|
+
he(o, h);
|
|
3648
|
+
function o(e, n) {
|
|
3649
|
+
var t = h.call(this) || this;
|
|
3650
|
+
return t.type = "LineSegments2", t.geometry = e !== void 0 ? e : new Ot(), t.material = n !== void 0 ? n : new It({ color: Math.random() * 16777215 }), t;
|
|
3651
|
+
}
|
|
3652
|
+
return o.prototype.computeLineDistances = function() {
|
|
3653
|
+
for (var e = this.geometry, n = e.attributes.instanceStart, t = e.attributes.instanceEnd, a = new Float32Array(2 * n.count), s = new v.Vector3(), l = new v.Vector3(), f = 0, c = 0, g = n.count; c < g; c++)
|
|
3654
|
+
s.fromBufferAttribute(n, c), l.fromBufferAttribute(t, c), f += s.distanceTo(l);
|
|
3655
|
+
this.material.uniforms.totalLength.value = f;
|
|
3656
|
+
for (var c = 0, y = 0, g = n.count; c < g; c++, y += 2) {
|
|
3657
|
+
s.fromBufferAttribute(n, c), l.fromBufferAttribute(t, c);
|
|
3658
|
+
var w = s.distanceTo(l);
|
|
3659
|
+
a[y] = y === 0 ? 0 : a[y - 1], a[y + 1] = a[y] + w;
|
|
3660
|
+
}
|
|
3661
|
+
var x = new v.InstancedInterleavedBuffer(a, 2, 1);
|
|
3662
|
+
return e.setAttribute("instanceDistanceStart", new v.InterleavedBufferAttribute(x, 1, 0)), e.setAttribute("instanceDistanceEnd", new v.InterleavedBufferAttribute(x, 1, 1)), this;
|
|
3663
|
+
}, o.prototype.raycast = function(e, n) {
|
|
3664
|
+
e.camera === null && console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');
|
|
3665
|
+
var t = e.ray, a = e.camera, s = a.projectionMatrix, l = this.geometry, f = this.material, c = f.resolution, g = f.linewidth, y = l.attributes.instanceStart, w = l.attributes.instanceEnd, x = new v.Vector4(), A = new v.Vector4(), S = new v.Vector4(), O = new v.Vector3(), T = new v.Matrix4(), b = new v.Line3(), P = new v.Vector3();
|
|
3666
|
+
t.at(1, S), S.w = 1, S.applyMatrix4(a.matrixWorldInverse), S.applyMatrix4(s), S.multiplyScalar(1 / S.w), S.x *= c.x / 2, S.y *= c.y / 2, S.z = 0, O.copy(S);
|
|
3667
|
+
var m = this.matrixWorld;
|
|
3668
|
+
T.multiplyMatrices(a.matrixWorldInverse, m);
|
|
3669
|
+
for (var C = 0, _ = y.count; C < _; C++) {
|
|
3670
|
+
x.fromBufferAttribute(y, C), A.fromBufferAttribute(w, C), x.w = 1, A.w = 1, x.applyMatrix4(T), A.applyMatrix4(T), x.applyMatrix4(s), A.applyMatrix4(s), x.multiplyScalar(1 / x.w), A.multiplyScalar(1 / A.w);
|
|
3671
|
+
var H = x.z < -1 && A.z < -1, G = x.z > 1 && A.z > 1;
|
|
3672
|
+
if (!(H || G)) {
|
|
3673
|
+
x.x *= c.x / 2, x.y *= c.y / 2, A.x *= c.x / 2, A.y *= c.y / 2, b.start.copy(x), b.start.z = 0, b.end.copy(A), b.end.z = 0;
|
|
3674
|
+
var U = b.closestPointToPointParameter(O, !0);
|
|
3675
|
+
b.at(U, P);
|
|
3676
|
+
var Q = v.MathUtils.lerp(x.z, A.z, U), oe = Q >= -1 && Q <= 1, le = O.distanceTo(P) < g * 0.5;
|
|
3677
|
+
if (oe && le) {
|
|
3678
|
+
b.start.fromBufferAttribute(y, C), b.end.fromBufferAttribute(w, C), b.start.applyMatrix4(m), b.end.applyMatrix4(m);
|
|
3679
|
+
var J = new v.Vector3(), Z = new v.Vector3();
|
|
3680
|
+
t.distanceSqToSegment(b.start, b.end, Z, J), n.push({
|
|
3681
|
+
point: Z,
|
|
3682
|
+
pointOnLine: J,
|
|
3683
|
+
distance: t.origin.distanceTo(Z),
|
|
3684
|
+
object: this,
|
|
3685
|
+
faceIndex: C
|
|
3686
|
+
});
|
|
3687
|
+
}
|
|
3688
|
+
}
|
|
3689
|
+
}
|
|
3690
|
+
}, o;
|
|
3691
|
+
})(v.Mesh)
|
|
3692
|
+
);
|
|
3693
|
+
Object.assign(en.prototype, { isLineSegments2: !0 });
|
|
3694
|
+
var tn = (
|
|
3695
|
+
/** @class */
|
|
3696
|
+
(function(h) {
|
|
3697
|
+
he(o, h);
|
|
3698
|
+
function o(e, n) {
|
|
3699
|
+
var t = h.call(this, e, n) || this;
|
|
3700
|
+
return t.type = "Line2", t;
|
|
3701
|
+
}
|
|
3702
|
+
return o;
|
|
3703
|
+
})(en)
|
|
3704
|
+
);
|
|
3705
|
+
Object.assign(tn.prototype, { isLine2: !0 });
|
|
3706
|
+
var nn = (
|
|
3707
|
+
/** @class */
|
|
3708
|
+
(function(h) {
|
|
3709
|
+
he(o, h);
|
|
3710
|
+
function o() {
|
|
3711
|
+
var e = h.call(this) || this;
|
|
3712
|
+
return e.type = "LineGeometry", e;
|
|
3713
|
+
}
|
|
3714
|
+
return o.prototype.setPositions = function(e) {
|
|
3715
|
+
for (var n = e.length - 3, t = new Float32Array(2 * n), a = 0; a < n; a += 3)
|
|
3716
|
+
t[2 * a] = e[a], t[2 * a + 1] = e[a + 1], t[2 * a + 2] = e[a + 2], t[2 * a + 3] = e[a + 3], t[2 * a + 4] = e[a + 4], t[2 * a + 5] = e[a + 5];
|
|
3717
|
+
return h.prototype.setPositions.call(this, t), this;
|
|
3718
|
+
}, o.prototype.setColors = function(e) {
|
|
3719
|
+
for (var n = e.length - 3, t = new Float32Array(2 * n), a = 0; a < n; a += 3)
|
|
3720
|
+
t[2 * a] = e[a], t[2 * a + 1] = e[a + 1], t[2 * a + 2] = e[a + 2], t[2 * a + 3] = e[a + 3], t[2 * a + 4] = e[a + 4], t[2 * a + 5] = e[a + 5];
|
|
3721
|
+
return h.prototype.setColors.call(this, t), this;
|
|
3722
|
+
}, o.prototype.fromLine = function(e) {
|
|
3723
|
+
var n = e.geometry;
|
|
3724
|
+
if (n instanceof v.Geometry) {
|
|
3725
|
+
var t = new v.BufferGeometry().fromGeometry(n);
|
|
3726
|
+
this.setPositions(t.attributes.position.array);
|
|
3727
|
+
} else n instanceof v.BufferGeometry && this.setPositions(n.attributes.position.array);
|
|
3728
|
+
return this;
|
|
3729
|
+
}, o.prototype.copy = function() {
|
|
3730
|
+
return this;
|
|
3731
|
+
}, o;
|
|
3732
|
+
})(Ot)
|
|
3733
|
+
);
|
|
3734
|
+
Object.assign(nn.prototype, { isLineGeometry: !0 });
|
|
3735
|
+
var Qn = (
|
|
3736
|
+
/** @class */
|
|
3737
|
+
(function(h) {
|
|
3738
|
+
he(o, h);
|
|
3739
|
+
function o(e, n) {
|
|
3740
|
+
var t = h.call(this, e) || this;
|
|
3741
|
+
t.paths = /* @__PURE__ */ new Map(), t.animationId = null, t.up = new v.Vector3(0, 1, 0);
|
|
3742
|
+
var a = {
|
|
3743
|
+
enabled: !0,
|
|
3744
|
+
visible: !0,
|
|
3745
|
+
playing: !1
|
|
3746
|
+
};
|
|
3747
|
+
t.state = Object.assign(a, n == null ? void 0 : n.initialState);
|
|
3748
|
+
var s = {
|
|
3749
|
+
lineCount: 6,
|
|
3750
|
+
spacing: 0.02,
|
|
3751
|
+
divisions: 100,
|
|
3752
|
+
lineWidth: 2,
|
|
3753
|
+
color: 16777215,
|
|
3754
|
+
duration: 3,
|
|
3755
|
+
waveAmp: 0.05,
|
|
3756
|
+
waveFreq: 20,
|
|
3757
|
+
particleCount: 50,
|
|
3758
|
+
maxDistance: 0.1
|
|
3759
|
+
};
|
|
3760
|
+
return t._config = V(V({}, s), n == null ? void 0 : n.config), n != null && n.paths && n.paths.length > 0 && n.paths.forEach(function(l) {
|
|
3761
|
+
t.addPath(l);
|
|
3762
|
+
}), t.state.enabled && t._enable({ userAction: !1 }), t;
|
|
3763
|
+
}
|
|
3764
|
+
return Object.defineProperty(o.prototype, "config", {
|
|
3765
|
+
get: function() {
|
|
3766
|
+
return V({}, this._config);
|
|
3767
|
+
},
|
|
3768
|
+
enumerable: !1,
|
|
3769
|
+
configurable: !0
|
|
3770
|
+
}), o.prototype.updateState = function(e, n) {
|
|
3771
|
+
var t = this.state;
|
|
3772
|
+
this.state = V(V({}, this.state), e), this.hooks.emit("stateChange", { state: this.state, prevState: t, userAction: n });
|
|
3773
|
+
}, o.prototype.load = function(e, n) {
|
|
3774
|
+
return Le(this, void 0, void 0, function() {
|
|
3775
|
+
var t, a = this;
|
|
3776
|
+
return De(this, function(s) {
|
|
3777
|
+
return this.clearAllPaths(), e.paths.forEach(function(l) {
|
|
3778
|
+
var f, c, g = l.points.map(function(y) {
|
|
3779
|
+
return new v.Vector3(y.x, y.y, y.z);
|
|
3780
|
+
});
|
|
3781
|
+
a.addPath({
|
|
3782
|
+
id: l.id,
|
|
3783
|
+
points: g,
|
|
3784
|
+
enabled: (f = l.enabled) !== null && f !== void 0 ? f : !0,
|
|
3785
|
+
visible: (c = l.visible) !== null && c !== void 0 ? c : !0,
|
|
3786
|
+
color: l.color,
|
|
3787
|
+
lineWidth: l.lineWidth
|
|
3788
|
+
});
|
|
3789
|
+
}), t = /* @__PURE__ */ new Map(), this.paths.forEach(function(l, f) {
|
|
3790
|
+
t.set(f, l.config);
|
|
3791
|
+
}), this.data = { paths: t }, this.hooks.emit("dataLoaded", this.data), n && this.setState(n), [
|
|
3792
|
+
2
|
|
3793
|
+
/*return*/
|
|
3794
|
+
];
|
|
3795
|
+
});
|
|
3796
|
+
});
|
|
3797
|
+
}, o.prototype.addPath = function(e) {
|
|
3798
|
+
var n, t;
|
|
3799
|
+
if (e.points.length < 2)
|
|
3800
|
+
return console.warn("DynamicPathLinePlugin: 路径 ".concat(e.id, " 至少需要2个点")), !1;
|
|
3801
|
+
if (this.paths.has(e.id))
|
|
3802
|
+
return console.warn("DynamicPathLinePlugin: 路径 ".concat(e.id, " 已存在")), !1;
|
|
3803
|
+
var a = new v.CatmullRomCurve3(e.points), s = this.createLines(e, a), l = this.createParticles(), f = l.particles, c = l.particleGeometry, g = l.particleMaterial, y = l.particleInfos, w = l.particlePositions, x = {
|
|
3804
|
+
id: e.id,
|
|
3805
|
+
config: e,
|
|
3806
|
+
curve: a,
|
|
3807
|
+
lines: s,
|
|
3808
|
+
particles: f,
|
|
3809
|
+
particleGeometry: c,
|
|
3810
|
+
particleMaterial: g,
|
|
3811
|
+
particleInfos: y,
|
|
3812
|
+
particlePositions: w,
|
|
3813
|
+
enabled: (n = e.enabled) !== null && n !== void 0 ? n : !0,
|
|
3814
|
+
visible: (t = e.visible) !== null && t !== void 0 ? t : !0,
|
|
3815
|
+
startOffset: 0
|
|
3816
|
+
};
|
|
3817
|
+
this.paths.set(e.id, x);
|
|
3818
|
+
var A = this.data, S = /* @__PURE__ */ new Map();
|
|
3819
|
+
return this.paths.forEach(function(O, T) {
|
|
3820
|
+
S.set(T, O.config);
|
|
3821
|
+
}), this.data = { paths: S }, this.hooks.emit("dataChange", this.data, A), this.hooks.emit("pathAdd", e.id, e), this.state.playing && this.animationId === null && this.startAnimation(), !0;
|
|
3822
|
+
}, o.prototype.removePath = function(e) {
|
|
3823
|
+
var n = this.paths.get(e);
|
|
3824
|
+
if (!n)
|
|
3825
|
+
return console.warn("DynamicPathLinePlugin: 路径 ".concat(e, " 不存在")), !1;
|
|
3826
|
+
this.disposePathResources(n), this.paths.delete(e);
|
|
3827
|
+
var t = this.data, a = /* @__PURE__ */ new Map();
|
|
3828
|
+
return this.paths.forEach(function(s, l) {
|
|
3829
|
+
a.set(l, s.config);
|
|
3830
|
+
}), this.data = { paths: a }, this.hooks.emit("dataChange", this.data, t), this.hooks.emit("pathRemove", e), !0;
|
|
3831
|
+
}, o.prototype.enablePath = function(e) {
|
|
3832
|
+
var n = this.paths.get(e);
|
|
3833
|
+
return n ? (n.enabled = !0, this.hooks.emit("pathEnable", e), !0) : (console.warn("DynamicPathLinePlugin: 路径 ".concat(e, " 不存在")), !1);
|
|
3834
|
+
}, o.prototype.disablePath = function(e) {
|
|
3835
|
+
var n = this.paths.get(e);
|
|
3836
|
+
return n ? (n.enabled = !1, this.hooks.emit("pathDisable", e), !0) : (console.warn("DynamicPathLinePlugin: 路径 ".concat(e, " 不存在")), !1);
|
|
3837
|
+
}, o.prototype.showPath = function(e) {
|
|
3838
|
+
var n = this.paths.get(e);
|
|
3839
|
+
return n ? (n.visible = !0, n.lines.forEach(function(t) {
|
|
3840
|
+
return t.visible = !0;
|
|
3841
|
+
}), n.particles.visible = !0, this.hooks.emit("pathShow", e), !0) : (console.warn("DynamicPathLinePlugin: 路径 ".concat(e, " 不存在")), !1);
|
|
3842
|
+
}, o.prototype.hidePath = function(e) {
|
|
3843
|
+
var n = this.paths.get(e);
|
|
3844
|
+
return n ? (n.visible = !1, n.lines.forEach(function(t) {
|
|
3845
|
+
return t.visible = !1;
|
|
3846
|
+
}), n.particles.visible = !1, this.hooks.emit("pathHide", e), !0) : (console.warn("DynamicPathLinePlugin: 路径 ".concat(e, " 不存在")), !1);
|
|
3847
|
+
}, o.prototype.getPathIds = function() {
|
|
3848
|
+
return Array.from(this.paths.keys());
|
|
3849
|
+
}, o.prototype.getPathConfig = function(e) {
|
|
3850
|
+
var n = this.paths.get(e);
|
|
3851
|
+
return n ? V({}, n.config) : void 0;
|
|
3852
|
+
}, o.prototype.clearAllPaths = function() {
|
|
3853
|
+
var e = this;
|
|
3854
|
+
this.paths.forEach(function(a) {
|
|
3855
|
+
e.disposePathResources(a);
|
|
3856
|
+
}), this.paths.clear();
|
|
3857
|
+
var n = this.data, t = /* @__PURE__ */ new Map();
|
|
3858
|
+
this.paths.forEach(function(a, s) {
|
|
3859
|
+
t.set(s, a.config);
|
|
3860
|
+
}), this.data = { paths: t }, this.hooks.emit("dataChange", this.data, n);
|
|
3861
|
+
}, o.prototype.getPositions = function(e, n) {
|
|
3862
|
+
for (var t = [], a = [], s = 0, l = [], f = 0; f <= n; f++) {
|
|
3863
|
+
var c = f / n, g = e.getPoint(c);
|
|
3864
|
+
l.push(g.clone()), f > 0 && (s += g.distanceTo(l[f - 1]));
|
|
3865
|
+
}
|
|
3866
|
+
for (var y = 0, f = 0; f < n; f++) {
|
|
3867
|
+
f > 0 && (y += l[f].distanceTo(l[f - 1]));
|
|
3868
|
+
var w = y / s;
|
|
3869
|
+
t.push(l[f].x, l[f].y, l[f].z), a.push(w);
|
|
3870
|
+
}
|
|
3871
|
+
return { positions: t, distanceProgress: a };
|
|
3872
|
+
}, o.prototype.createLines = function(e, n) {
|
|
3873
|
+
for (var t = this, a, s, l = [], f = this._config, c = f.lineCount, g = f.spacing, y = f.divisions, w = f.waveAmp, x = f.waveFreq, A = (a = e.lineWidth) !== null && a !== void 0 ? a : this._config.lineWidth, S = (s = e.color) !== null && s !== void 0 ? s : this._config.color, O = function(P) {
|
|
3874
|
+
var m = (P - (c - 1) / 2) * g, C = e.points.map(function(oe, le) {
|
|
3875
|
+
var J = le / (e.points.length - 1), Z = n.getTangent(J).normalize(), D = new v.Vector3().crossVectors(t.up, Z).normalize(), I = m * Math.abs((le - e.points.length / 2) / e.points.length - 0.5) * -1;
|
|
3876
|
+
return oe.clone().addScaledVector(D, m + I).add(new v.Vector3(0, 0.02 * (P % 2 === 0 ? 1 : 0), 0));
|
|
3877
|
+
}), _ = new v.CatmullRomCurve3(C), H = T.getPositions(_, y).positions, G = new nn();
|
|
3878
|
+
G.setPositions(H);
|
|
3879
|
+
var U = new It({
|
|
3880
|
+
color: S,
|
|
3881
|
+
linewidth: A * (P % 2 === 0 ? 1 : 0.5),
|
|
3882
|
+
transparent: !0,
|
|
3883
|
+
opacity: 1
|
|
3884
|
+
});
|
|
3885
|
+
U.resolution.set(T.five.camera.resolution.x, T.five.camera.resolution.y), P === 0 ? U.waveDir = 1 : P === 1 ? U.waveDir = 2 : P === 2 ? U.waveDir = 0 : P === 3 ? U.waveDir = 3 : P === 4 && (U.waveDir = 1), U.waveAmp = w, U.waveFreq = x, Object.assign(U.uniforms, {
|
|
3886
|
+
time: { value: 0 },
|
|
3887
|
+
startOffset: { value: 0 }
|
|
3888
|
+
});
|
|
3889
|
+
var Q = new tn(G, U);
|
|
3890
|
+
Q.computeLineDistances(), l.push(Q), T.five.scene.add(Q);
|
|
3891
|
+
}, T = this, b = 0; b < c; b++)
|
|
3892
|
+
O(b);
|
|
3893
|
+
return l;
|
|
3894
|
+
}, o.prototype.createParticleMaterial = function() {
|
|
3895
|
+
return new v.ShaderMaterial({
|
|
3896
|
+
transparent: !0,
|
|
3897
|
+
blending: v.AdditiveBlending,
|
|
3898
|
+
depthWrite: !1,
|
|
3899
|
+
uniforms: {
|
|
3900
|
+
pointTexture: { value: new v.TextureLoader().load("https://threejs.org/examples/textures/sprites/circle.png") }
|
|
3901
|
+
},
|
|
3902
|
+
vertexShader: `
|
|
3903
|
+
attribute float size;
|
|
3904
|
+
varying vec2 vUv;
|
|
3905
|
+
void main() {
|
|
3906
|
+
vUv = uv;
|
|
3907
|
+
vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);
|
|
3908
|
+
gl_PointSize = size * (1.0 / -mvPosition.z);
|
|
3909
|
+
gl_Position = projectionMatrix * mvPosition;
|
|
3910
|
+
}
|
|
3911
|
+
`,
|
|
3912
|
+
fragmentShader: `
|
|
3913
|
+
uniform sampler2D pointTexture;
|
|
3914
|
+
void main() {
|
|
3915
|
+
gl_FragColor = texture2D(pointTexture, gl_PointCoord);
|
|
3916
|
+
gl_FragColor.a *= 0.15;
|
|
3917
|
+
}
|
|
3918
|
+
`
|
|
3919
|
+
});
|
|
3920
|
+
}, o.prototype.createParticles = function() {
|
|
3921
|
+
for (var e = this._config.particleCount, n = new Float32Array(e * 3), t = new v.BufferGeometry(), a = this.createParticleMaterial(), s = new v.Points(t, a), l = new Float32Array(e), f = [], c = 0; c < e; c++)
|
|
3922
|
+
n[c * 3] = 9999, n[c * 3 + 1] = 9999, n[c * 3 + 2] = 9999, l[c] = v.MathUtils.randFloat(3, 9), f.push({
|
|
3923
|
+
velocity: new v.Vector3(),
|
|
3924
|
+
life: 3 + Math.random() * 2,
|
|
3925
|
+
age: 0,
|
|
3926
|
+
active: !1,
|
|
3927
|
+
alpha: 0,
|
|
3928
|
+
startPos: new v.Vector3()
|
|
3929
|
+
});
|
|
3930
|
+
return t.setAttribute("position", new v.BufferAttribute(n, 3)), t.setAttribute("size", new v.BufferAttribute(l, 1)), s.frustumCulled = !1, this.five.scene.add(s), { particles: s, particleGeometry: t, particleMaterial: a, particleInfos: f, particlePositions: n };
|
|
3931
|
+
}, o.prototype.projectPointsToScreen = function(e, n) {
|
|
3932
|
+
for (var t = [], a = 0, s = 0; s < e.length; s++) {
|
|
3933
|
+
var l = e[s];
|
|
3934
|
+
s > 0 && (a += l.distanceTo(e[s - 1]));
|
|
3935
|
+
var f = l.clone().project(n), c = f.x < -1 || f.x > 1 || f.y < -1 || f.y > 1 || f.z < 0 || f.z > 1;
|
|
3936
|
+
t.push({
|
|
3937
|
+
point: l.clone(),
|
|
3938
|
+
screenPos: new v.Vector2(f.x, f.y),
|
|
3939
|
+
distanceFromStart: a,
|
|
3940
|
+
isOffscreen: c
|
|
3941
|
+
});
|
|
3942
|
+
}
|
|
3943
|
+
return t;
|
|
3944
|
+
}, o.prototype.findNearestOffscreenPoint = function(e) {
|
|
3945
|
+
for (var n = -1, t = 0, a = -1, s = 0; s < e.length; s++)
|
|
3946
|
+
if (!e[s].isOffscreen) {
|
|
3947
|
+
a = s;
|
|
3948
|
+
break;
|
|
3949
|
+
}
|
|
3950
|
+
if (a === -1)
|
|
3951
|
+
return null;
|
|
3952
|
+
for (var s = a - 1; s >= 0; s--)
|
|
3953
|
+
if (e[s].isOffscreen) {
|
|
3954
|
+
n = s, t = e[s].distanceFromStart;
|
|
3955
|
+
break;
|
|
3956
|
+
}
|
|
3957
|
+
return n === -1 ? { index: 0, distance: 0 } : {
|
|
3958
|
+
index: n,
|
|
3959
|
+
distance: t
|
|
3960
|
+
};
|
|
3961
|
+
}, o.prototype.updateAnimation = function() {
|
|
3962
|
+
var e = performance.now() / 1e3, n = this._config, t = n.duration, a = n.particleCount, s = n.maxDistance, l = e % t / t;
|
|
3963
|
+
this.paths.forEach(function(f) {
|
|
3964
|
+
if (f.enabled) {
|
|
3965
|
+
f.lines.forEach(function(b) {
|
|
3966
|
+
b.material.uniforms.time.value = e, b.material.uniforms.animationProgress.value = l;
|
|
3967
|
+
});
|
|
3968
|
+
var c = null, g = 1 / 0;
|
|
3969
|
+
if (f.lines.forEach(function(b) {
|
|
3970
|
+
for (var P = b.geometry, m = P.attributes.instanceDistanceStart, C = P.attributes.instanceDistanceEnd, _ = m.count, H = 0; H < _; H++) {
|
|
3971
|
+
var G = m.getX(H) / b.material.uniforms.totalLength.value, U = C.getX(H) / b.material.uniforms.totalLength.value;
|
|
3972
|
+
if (l >= G && l <= U) {
|
|
3973
|
+
var Q = (l - G) / (U - G), oe = new v.Vector3().fromBufferAttribute(P.attributes.instanceStart, H), le = new v.Vector3().fromBufferAttribute(P.attributes.instanceEnd, H), J = new v.Vector3().lerpVectors(oe, le, Q), Z = Math.abs(l - (G + U) / 2);
|
|
3974
|
+
Z < g && (g = Z, c = J);
|
|
3975
|
+
}
|
|
3976
|
+
}
|
|
3977
|
+
}), c)
|
|
3978
|
+
for (var y = 0; y < a; y++) {
|
|
3979
|
+
var w = f.particleInfos[y];
|
|
3980
|
+
!w.active && Math.random() < 0.05 && (w.active = !0, w.age = 0, w.life = 3 + Math.random() * 2, w.velocity.set((Math.random() - 0.5) * 1e-4, (Math.random() - 0.5) * 1e-4, (Math.random() - 0.5) * 1e-4), f.particlePositions[y * 3] = c.x, f.particlePositions[y * 3 + 1] = c.y, f.particlePositions[y * 3 + 2] = c.z, w.startPos.copy(c), w.alpha = 0);
|
|
3981
|
+
}
|
|
3982
|
+
for (var y = 0; y < a; y++) {
|
|
3983
|
+
var w = f.particleInfos[y];
|
|
3984
|
+
if (w.active) {
|
|
3985
|
+
w.age += 0.016;
|
|
3986
|
+
var x = f.particlePositions[y * 3] - w.startPos.x, A = f.particlePositions[y * 3 + 1] - w.startPos.y, S = f.particlePositions[y * 3 + 2] - w.startPos.z, O = Math.sqrt(x * x + A * A + S * S);
|
|
3987
|
+
(O >= s || w.age >= w.life) && (w.active = !1, f.particlePositions[y * 3] = 9999, f.particlePositions[y * 3 + 1] = 9999, f.particlePositions[y * 3 + 2] = 9999, w.alpha = 0), w.velocity.x += (Math.random() - 0.5) * 1e-4, w.velocity.z += (Math.random() - 0.5) * 1e-4, w.velocity.y += 1e-4, w.velocity.multiplyScalar(0.99), f.particlePositions[y * 3] += w.velocity.x, f.particlePositions[y * 3 + 1] += w.velocity.y, f.particlePositions[y * 3 + 2] += w.velocity.z;
|
|
3988
|
+
var T = w.age / w.life;
|
|
3989
|
+
T < 0.2 ? w.alpha = T / 0.2 : T > 0.8 ? w.alpha = (1 - T) / 0.2 : w.alpha = 1;
|
|
3990
|
+
}
|
|
3991
|
+
}
|
|
3992
|
+
f.particleGeometry.attributes.position.needsUpdate = !0, f.particleMaterial.opacity = 0.6;
|
|
3993
|
+
}
|
|
3994
|
+
}), this.five.needsRender = !0;
|
|
3995
|
+
}, o.prototype.startAnimation = function() {
|
|
3996
|
+
var e = this;
|
|
3997
|
+
this.animationId === null && this.paths.size !== 0 && (this.animationId = ct.shared.add(function() {
|
|
3998
|
+
e.updateAnimation();
|
|
3999
|
+
}), this.updateState({ playing: !0 }, !1), this.hooks.emit("animationStart"));
|
|
4000
|
+
}, o.prototype.stopAnimation = function() {
|
|
4001
|
+
this.animationId !== null && (this.animationId(), this.animationId = null), this.updateState({ playing: !1 }, !1), this.hooks.emit("animationStop");
|
|
4002
|
+
}, o.prototype._enable = function(e) {
|
|
4003
|
+
this.paths.size > 0 && this.startAnimation();
|
|
4004
|
+
}, o.prototype._disable = function(e) {
|
|
4005
|
+
this.stopAnimation();
|
|
4006
|
+
}, o.prototype.enable = function(e) {
|
|
4007
|
+
var n;
|
|
4008
|
+
if (!this.state.enabled) {
|
|
4009
|
+
var t = (n = e == null ? void 0 : e.userAction) !== null && n !== void 0 ? n : !0;
|
|
4010
|
+
this.updateState({ enabled: !0 }, t), this._enable({ userAction: t });
|
|
4011
|
+
}
|
|
4012
|
+
}, o.prototype.disable = function(e) {
|
|
4013
|
+
var n;
|
|
4014
|
+
if (this.state.enabled !== !1) {
|
|
4015
|
+
var t = (n = e == null ? void 0 : e.userAction) !== null && n !== void 0 ? n : !0;
|
|
4016
|
+
this.updateState({ enabled: !1 }, t), this._disable({ userAction: t });
|
|
3245
4017
|
}
|
|
4018
|
+
}, o.prototype.show = function(e) {
|
|
4019
|
+
var n, t = (n = e == null ? void 0 : e.userAction) !== null && n !== void 0 ? n : !0;
|
|
4020
|
+
this.paths.forEach(function(a) {
|
|
4021
|
+
a.lines.forEach(function(s) {
|
|
4022
|
+
return s.visible = !0;
|
|
4023
|
+
}), a.particles.visible = !0;
|
|
4024
|
+
}), this.updateState({ visible: !0 }, t);
|
|
4025
|
+
}, o.prototype.hide = function(e) {
|
|
4026
|
+
var n, t = (n = e == null ? void 0 : e.userAction) !== null && n !== void 0 ? n : !0;
|
|
4027
|
+
this.paths.forEach(function(a) {
|
|
4028
|
+
a.lines.forEach(function(s) {
|
|
4029
|
+
return s.visible = !1;
|
|
4030
|
+
}), a.particles.visible = !1;
|
|
4031
|
+
}), this.updateState({ visible: !1 }, t);
|
|
4032
|
+
}, o.prototype.setState = function(e, n) {
|
|
4033
|
+
var t;
|
|
4034
|
+
t = n == null ? void 0 : n.userAction, e.enabled !== void 0 && e.enabled !== this.state.enabled && (e.enabled ? this.enable(n) : this.disable(n)), e.visible !== void 0 && e.visible !== this.state.visible && (e.visible ? this.show(n) : this.hide(n)), e.playing !== void 0 && e.playing !== this.state.playing && (e.playing ? this.startAnimation() : this.stopAnimation());
|
|
4035
|
+
}, o.prototype.play = function() {
|
|
4036
|
+
this.startAnimation();
|
|
4037
|
+
}, o.prototype.pause = function() {
|
|
4038
|
+
this.stopAnimation();
|
|
4039
|
+
}, o.prototype.updateScreenProjection = function(e) {
|
|
4040
|
+
var n = this, t = function(s) {
|
|
4041
|
+
var l = n.projectPointsToScreen(s.config.points, n.five.camera), f = n.findNearestOffscreenPoint(l);
|
|
4042
|
+
f && (s.startOffset = f.distance, s.lines.forEach(function(c) {
|
|
4043
|
+
c.material.uniforms.startOffset.value = s.startOffset;
|
|
4044
|
+
}));
|
|
4045
|
+
};
|
|
4046
|
+
if (e) {
|
|
4047
|
+
var a = this.paths.get(e);
|
|
4048
|
+
a && t(a);
|
|
4049
|
+
} else
|
|
4050
|
+
this.paths.forEach(function(s) {
|
|
4051
|
+
s.enabled && t(s);
|
|
4052
|
+
});
|
|
4053
|
+
}, o.prototype.disposePathResources = function(e) {
|
|
4054
|
+
var n = this;
|
|
4055
|
+
e.lines.forEach(function(t) {
|
|
4056
|
+
n.five.scene.remove(t), t.geometry.dispose(), t.material.dispose();
|
|
4057
|
+
}), this.five.scene.remove(e.particles), e.particleGeometry.dispose(), e.particleMaterial.dispose();
|
|
4058
|
+
}, o.prototype.dispose = function() {
|
|
4059
|
+
this.stopAnimation(), this.clearAllPaths(), this.hooks.emit("dispose");
|
|
3246
4060
|
}, o;
|
|
3247
|
-
})(
|
|
3248
|
-
),
|
|
3249
|
-
return new
|
|
4061
|
+
})(Ct.Controller)
|
|
4062
|
+
), or = function(h, o) {
|
|
4063
|
+
return new Qn(h, o);
|
|
3250
4064
|
};
|
|
3251
4065
|
export {
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
4066
|
+
rr as BackgroundPlugin,
|
|
4067
|
+
Xe as BasePlugin,
|
|
4068
|
+
zn as CSS3DRenderer,
|
|
4069
|
+
or as DynamicPathLinePlugin,
|
|
4070
|
+
tr as ItemMaskPlugin,
|
|
3256
4071
|
qe as OrbitControls,
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
4072
|
+
nr as OrientationPlugin,
|
|
4073
|
+
ar as PanoAnimePlugin,
|
|
4074
|
+
jn as RoundedBoxGeometry,
|
|
4075
|
+
ir as TrajectoryPlugin
|
|
3261
4076
|
};
|