@realsee/five 6.8.0 → 6.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ai_guides/features/flowing-light-2d-pass.md +64 -10
- package/ai_guides/features/flowing-light-3d-pass.md +64 -10
- 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.AdaptiveLuminancePass.html +1 -1
- package/docs/classes/five.BoundingMesh.html +1 -1
- package/docs/classes/five.Camera.html +1 -1
- package/docs/classes/five.EyeDomeLightingPass.html +1 -1
- package/docs/classes/five.Five.html +1 -1
- package/docs/classes/five.FivePass.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.PBMCustomShader.html +1 -1
- package/docs/classes/five.PBMGSObject.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.PBMPanoFilter.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.PBMUpdateable.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.CSS2DObject.html +10 -0
- package/docs/classes/plugins.CSS2DRenderer.html +7 -0
- package/docs/classes/plugins.CSS3DObject.html +1 -1
- package/docs/classes/plugins.CSS3DSprite.html +1 -1
- package/docs/classes/plugins.Object3DHelperController.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/documents/features_flowing-light-2d-pass.html +28 -15
- package/docs/documents/features_flowing-light-3d-pass.html +27 -14
- package/docs/functions/plugins.CSS2DPlugin.html +1 -0
- package/docs/functions/react.getPlugin.html +2 -0
- package/docs/functions/react.setPlugin.html +2 -0
- package/docs/functions/react.useFivePlugin.html +8 -0
- package/docs/functions/react.withFive.html +1 -1
- 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.BaseExtendableEvent.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.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.ModelSceneEvent.html +1 -1
- package/docs/interfaces/five.ModelTileEvent.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.PanoPrepareEvent.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.WorkObserverProto.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.CSS2DPluginController.html +49 -0
- package/docs/interfaces/plugins.CSS2DPluginType.Config.html +2 -0
- package/docs/interfaces/plugins.CSS2DPluginType.CreateCSS2DObjectType.html +8 -0
- package/docs/interfaces/plugins.CSS2DPluginType.EventMap.html +10 -0
- package/docs/interfaces/plugins.CSS2DPluginType.Params.html +4 -0
- package/docs/interfaces/plugins.CSS2DPluginType.State.html +8 -0
- package/docs/interfaces/plugins.CSS2DRendererParameters.html +2 -0
- package/docs/interfaces/plugins.CSS3DPluginController.html +12 -12
- package/docs/interfaces/plugins.CSS3DPluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.CSS3DPluginType.State.html +1 -1
- package/docs/interfaces/plugins.DynamicPathLinePluginController.html +1 -1
- package/docs/interfaces/plugins.DynamicPathLinePluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.DynamicPathLinePluginType.State.html +1 -1
- package/docs/interfaces/plugins.GaussianSplattingEntranceAnimationController.html +1 -1
- package/docs/interfaces/plugins.GaussianSplattingEntranceAnimationPluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.GaussianSplattingEntranceAnimationPluginType.State.html +1 -1
- 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.Object3DHelperPluginType.BaseController.html +1 -1
- package/docs/interfaces/plugins.Object3DHelperPluginType.BaseHelper.html +1 -1
- package/docs/interfaces/plugins.Object3DHelperPluginType.BoundingBoxController.html +1 -1
- package/docs/interfaces/plugins.Object3DHelperPluginType.MoveController.html +1 -1
- package/docs/interfaces/plugins.Object3DHelperPluginType.MoveHelperAbstract.html +1 -1
- package/docs/interfaces/plugins.Object3DHelperPluginType.RotateController.html +1 -1
- package/docs/interfaces/plugins.Object3DHelperPluginType.RotateHelperAbstract.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.FiveAppProps.html +11 -0
- package/docs/interfaces/react.FiveInjectionTypes.html +1 -1
- package/docs/modules/plugins.CSS2DPluginType.html +1 -0
- package/docs/modules/plugins.html +1 -1
- package/docs/modules/react.html +1 -1
- package/docs/types/five.ParseOptions.html +1 -1
- package/docs/types/plugins.BasePlugin.EventMap.html +1 -1
- package/docs/types/plugins.CSS2DPluginType.PluginData.html +1 -0
- package/docs/types/plugins.CSS2DPluginType.ServerData.html +1 -0
- package/docs/variables/react.FiveApp.html +3 -0
- package/docs/variables/react.FiveAutoCanvas.html +3 -0
- package/five/index.js +5 -5
- package/five/index.mjs +65 -65
- package/five/renderer/postprocessing/passes/flowing-light-2d-pass.d.ts +6 -1
- package/five/renderer/postprocessing/passes/flowing-light-3d-pass.d.ts +3 -1
- 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/CSS2DPlugin/Controller.d.ts +59 -0
- package/plugins/CSS2DPlugin/index.d.ts +5 -0
- package/plugins/CSS2DPlugin/typing.d.ts +30 -0
- package/plugins/index.d.ts +2 -0
- package/plugins/index.js +24 -4
- package/plugins/index.mjs +557 -393
- package/plugins/thirdParty/CSS2DRenderer.d.ts +37 -0
- package/react/autoCanvas.d.ts +9 -0
- package/react/fiveApp.d.ts +22 -0
- package/react/hooks/useFivePlugin.d.ts +26 -0
- package/react/index.d.ts +4 -0
- package/react/index.js +3 -3
- package/react/index.mjs +291 -175
- package/react/withFive.d.ts +1 -1
- package/shader-lib/index.js +2 -2
- package/shader-lib/index.mjs +2 -2
- 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 +24 -4
- package/umd/five-react.js +3 -3
- package/umd/five-shader-lib.js +2 -2
- 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 +5 -5
- package/vfx/index.js +2 -2
- package/vfx/index.mjs +2 -2
- 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: 4/
|
|
5
|
-
* Version: 6.8.
|
|
4
|
+
* Generated: 2026/4/28
|
|
5
|
+
* Version: 6.8.1
|
|
6
6
|
* Terms:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
* Update: July 28, 2021
|
|
@@ -738,14 +738,14 @@ var O = class {
|
|
|
738
738
|
var n = t.ownerDocument || t;
|
|
739
739
|
return n.defaultView || n.parentWindow || e;
|
|
740
740
|
}
|
|
741
|
-
var ie = /mobile|tablet|ip(ad|hone|od)|android/i, ae = "ontouchstart" in e, k = ee(e, "PointerEvent") !== r, A = ae && ie.test(navigator.userAgent), j = "touch", oe = "pen", se = "mouse", ce = "kinect", le = 25, M = 1, N = 2, P = 4, F = 8,
|
|
742
|
-
function
|
|
741
|
+
var ie = /mobile|tablet|ip(ad|hone|od)|android/i, ae = "ontouchstart" in e, k = ee(e, "PointerEvent") !== r, A = ae && ie.test(navigator.userAgent), j = "touch", oe = "pen", se = "mouse", ce = "kinect", le = 25, M = 1, N = 2, P = 4, F = 8, I = 1, L = 2, R = 4, z = 8, B = 16, V = L | R, H = z | B, ue = V | H, de = ["x", "y"], fe = ["clientX", "clientY"];
|
|
742
|
+
function U(e, t) {
|
|
743
743
|
var n = this;
|
|
744
744
|
this.manager = e, this.callback = t, this.element = e.element, this.target = e.options.inputTarget, this.domHandler = function(t) {
|
|
745
745
|
y(e.options.enable, [e]) && n.handler(t);
|
|
746
746
|
}, this.init();
|
|
747
747
|
}
|
|
748
|
-
|
|
748
|
+
U.prototype = {
|
|
749
749
|
handler: function() {},
|
|
750
750
|
init: function() {
|
|
751
751
|
this.evEl && x(this.element, this.evEl, this.domHandler), this.evTarget && x(this.target, this.evTarget, this.domHandler), this.evWin && x(re(this.element), this.evWin, this.domHandler);
|
|
@@ -754,25 +754,25 @@ var O = class {
|
|
|
754
754
|
this.evEl && S(this.element, this.evEl, this.domHandler), this.evTarget && S(this.target, this.evTarget, this.domHandler), this.evWin && S(re(this.element), this.evWin, this.domHandler);
|
|
755
755
|
}
|
|
756
756
|
};
|
|
757
|
-
function
|
|
757
|
+
function pe(e) {
|
|
758
758
|
var t;
|
|
759
|
-
return t = e.options.inputClass || (k ?
|
|
759
|
+
return t = e.options.inputClass || (k ? Pe : A ? He : ae ? Ke : ke), new t(e, me);
|
|
760
760
|
}
|
|
761
|
-
function
|
|
761
|
+
function me(e, t, n) {
|
|
762
762
|
var r = n.pointers.length, i = n.changedPointers.length, a = t & M && r - i === 0, o = t & (P | F) && r - i === 0;
|
|
763
|
-
n.isFirst = !!a, n.isFinal = !!o, a && (e.session = {}), n.eventType = t,
|
|
763
|
+
n.isFirst = !!a, n.isFinal = !!o, a && (e.session = {}), n.eventType = t, he(e, n), e.emit("hammer.input", n), e.recognize(n), e.session.prevInput = n;
|
|
764
764
|
}
|
|
765
|
-
function
|
|
765
|
+
function he(e, t) {
|
|
766
766
|
var n = e.session, r = t.pointers, i = r.length;
|
|
767
|
-
n.firstInput || (n.firstInput =
|
|
768
|
-
var a = n.firstInput, o = n.firstMultiple, s = o ? o.center : a.center, u = t.center =
|
|
769
|
-
t.timeStamp = l(), t.deltaTime = t.timeStamp - a.timeStamp, t.angle =
|
|
770
|
-
var d =
|
|
771
|
-
t.overallVelocityX = d.x, t.overallVelocityY = d.y, t.overallVelocity = c(d.x) > c(d.y) ? d.x : d.y, t.scale = o ?
|
|
767
|
+
n.firstInput || (n.firstInput = ve(t)), i > 1 && !n.firstMultiple ? n.firstMultiple = ve(t) : i === 1 && (n.firstMultiple = !1);
|
|
768
|
+
var a = n.firstInput, o = n.firstMultiple, s = o ? o.center : a.center, u = t.center = ye(r);
|
|
769
|
+
t.timeStamp = l(), t.deltaTime = t.timeStamp - a.timeStamp, t.angle = Ce(s, u), t.distance = Se(s, u), ge(n, t), t.offsetDirection = xe(t.deltaX, t.deltaY);
|
|
770
|
+
var d = be(t.deltaTime, t.deltaX, t.deltaY);
|
|
771
|
+
t.overallVelocityX = d.x, t.overallVelocityY = d.y, t.overallVelocity = c(d.x) > c(d.y) ? d.x : d.y, t.scale = o ? Te(o.pointers, r) : 1, t.rotation = o ? we(o.pointers, r) : 0, t.maxPointers = n.prevInput ? t.pointers.length > n.prevInput.maxPointers ? t.pointers.length : n.prevInput.maxPointers : t.pointers.length, _e(n, t);
|
|
772
772
|
var f = e.element;
|
|
773
773
|
C(t.srcEvent.target, f) && (f = t.srcEvent.target), t.target = f;
|
|
774
774
|
}
|
|
775
|
-
function
|
|
775
|
+
function ge(e, t) {
|
|
776
776
|
var n = t.center, r = e.offsetDelta || {}, i = e.prevDelta || {}, a = e.prevInput || {};
|
|
777
777
|
(t.eventType === M || a.eventType === P) && (i = e.prevDelta = {
|
|
778
778
|
x: a.deltaX || 0,
|
|
@@ -782,15 +782,15 @@ var O = class {
|
|
|
782
782
|
y: n.y
|
|
783
783
|
}), t.deltaX = i.x + (n.x - r.x), t.deltaY = i.y + (n.y - r.y);
|
|
784
784
|
}
|
|
785
|
-
function
|
|
785
|
+
function _e(e, t) {
|
|
786
786
|
var n = e.lastInterval || t, i = t.timeStamp - n.timeStamp, a, o, s, l;
|
|
787
787
|
if (t.eventType != F && (i > le || n.velocity === r)) {
|
|
788
|
-
var u = t.deltaX - n.deltaX, d = t.deltaY - n.deltaY, f =
|
|
789
|
-
o = f.x, s = f.y, a = c(f.x) > c(f.y) ? f.x : f.y, l =
|
|
788
|
+
var u = t.deltaX - n.deltaX, d = t.deltaY - n.deltaY, f = be(i, u, d);
|
|
789
|
+
o = f.x, s = f.y, a = c(f.x) > c(f.y) ? f.x : f.y, l = xe(u, d), e.lastInterval = t;
|
|
790
790
|
} else a = n.velocity, o = n.velocityX, s = n.velocityY, l = n.direction;
|
|
791
791
|
t.velocity = a, t.velocityX = o, t.velocityY = s, t.direction = l;
|
|
792
792
|
}
|
|
793
|
-
function
|
|
793
|
+
function ve(e) {
|
|
794
794
|
for (var t = [], n = 0; n < e.pointers.length;) t[n] = {
|
|
795
795
|
clientX: s(e.pointers[n].clientX),
|
|
796
796
|
clientY: s(e.pointers[n].clientY)
|
|
@@ -798,12 +798,12 @@ var O = class {
|
|
|
798
798
|
return {
|
|
799
799
|
timeStamp: l(),
|
|
800
800
|
pointers: t,
|
|
801
|
-
center:
|
|
801
|
+
center: ye(t),
|
|
802
802
|
deltaX: e.deltaX,
|
|
803
803
|
deltaY: e.deltaY
|
|
804
804
|
};
|
|
805
805
|
}
|
|
806
|
-
function
|
|
806
|
+
function ye(e) {
|
|
807
807
|
var t = e.length;
|
|
808
808
|
if (t === 1) return {
|
|
809
809
|
x: s(e[0].clientX),
|
|
@@ -815,41 +815,41 @@ var O = class {
|
|
|
815
815
|
y: s(r / t)
|
|
816
816
|
};
|
|
817
817
|
}
|
|
818
|
-
function
|
|
818
|
+
function be(e, t, n) {
|
|
819
819
|
return {
|
|
820
820
|
x: t / e || 0,
|
|
821
821
|
y: n / e || 0
|
|
822
822
|
};
|
|
823
823
|
}
|
|
824
|
-
function
|
|
825
|
-
return e === t ?
|
|
824
|
+
function xe(e, t) {
|
|
825
|
+
return e === t ? I : c(e) >= c(t) ? e < 0 ? L : R : t < 0 ? z : B;
|
|
826
826
|
}
|
|
827
|
-
function
|
|
828
|
-
n || (n =
|
|
827
|
+
function Se(e, t, n) {
|
|
828
|
+
n || (n = de);
|
|
829
829
|
var r = t[n[0]] - e[n[0]], i = t[n[1]] - e[n[1]];
|
|
830
830
|
return Math.sqrt(r * r + i * i);
|
|
831
831
|
}
|
|
832
|
-
function
|
|
833
|
-
n || (n =
|
|
832
|
+
function Ce(e, t, n) {
|
|
833
|
+
n || (n = de);
|
|
834
834
|
var r = t[n[0]] - e[n[0]], i = t[n[1]] - e[n[1]];
|
|
835
835
|
return Math.atan2(i, r) * 180 / Math.PI;
|
|
836
836
|
}
|
|
837
|
-
function
|
|
838
|
-
return
|
|
837
|
+
function we(e, t) {
|
|
838
|
+
return Ce(t[1], t[0], fe) + Ce(e[1], e[0], fe);
|
|
839
839
|
}
|
|
840
|
-
function
|
|
841
|
-
return
|
|
840
|
+
function Te(e, t) {
|
|
841
|
+
return Se(t[0], t[1], fe) / Se(e[0], e[1], fe);
|
|
842
842
|
}
|
|
843
|
-
var
|
|
843
|
+
var Ee = {
|
|
844
844
|
mousedown: M,
|
|
845
845
|
mousemove: N,
|
|
846
846
|
mouseup: P
|
|
847
|
-
},
|
|
848
|
-
function
|
|
849
|
-
this.evEl =
|
|
847
|
+
}, De = "mousedown", Oe = "mousemove mouseup";
|
|
848
|
+
function ke() {
|
|
849
|
+
this.evEl = De, this.evWin = Oe, this.pressed = !1, U.apply(this, arguments);
|
|
850
850
|
}
|
|
851
|
-
_(
|
|
852
|
-
var t =
|
|
851
|
+
_(ke, U, { handler: function(e) {
|
|
852
|
+
var t = Ee[e.type];
|
|
853
853
|
t & M && (e.button === 0 || e.button === 2) && (this.pressed = !0), t & N && e.which !== 1 && (t = P), this.pressed && (t & P && (this.pressed = !1), this.callback(this.manager, t, {
|
|
854
854
|
pointers: [e],
|
|
855
855
|
changedPointers: [e],
|
|
@@ -857,44 +857,44 @@ var O = class {
|
|
|
857
857
|
srcEvent: e
|
|
858
858
|
}));
|
|
859
859
|
} });
|
|
860
|
-
var
|
|
860
|
+
var Ae = {
|
|
861
861
|
pointerdown: M,
|
|
862
862
|
pointermove: N,
|
|
863
863
|
pointerup: P,
|
|
864
864
|
pointercancel: F,
|
|
865
865
|
pointerout: F
|
|
866
|
-
},
|
|
866
|
+
}, je = {
|
|
867
867
|
2: j,
|
|
868
868
|
3: oe,
|
|
869
869
|
4: se,
|
|
870
870
|
5: ce
|
|
871
|
-
},
|
|
872
|
-
e.MSPointerEvent && !e.PointerEvent && (
|
|
873
|
-
function
|
|
874
|
-
this.evEl =
|
|
875
|
-
}
|
|
876
|
-
_(
|
|
877
|
-
var t = this.store, n = !1, r = !1, i =
|
|
878
|
-
i & M && (e.button === 0 || e.button === 2 || o) ? s < 0 && (t.push(e), s = t.length - 1) : i & (P | F) ? n = !0 : !o && e.buttons === 0 && (n = !0, r = !0, i =
|
|
871
|
+
}, Me = "pointerdown", Ne = "pointermove pointerup pointercancel";
|
|
872
|
+
e.MSPointerEvent && !e.PointerEvent && (Me = "MSPointerDown", Ne = "MSPointerMove MSPointerUp MSPointerCancel");
|
|
873
|
+
function Pe() {
|
|
874
|
+
this.evEl = Me, this.evWin = Ne, U.apply(this, arguments), this.store = this.manager.session.pointerEvents = [];
|
|
875
|
+
}
|
|
876
|
+
_(Pe, U, { handler: function(e) {
|
|
877
|
+
var t = this.store, n = !1, r = !1, i = Ae[e.type.toLowerCase().replace("ms", "")], a = je[e.pointerType] || e.pointerType, o = a == j, s = E(t, e.pointerId, "pointerId");
|
|
878
|
+
i & M && (e.button === 0 || e.button === 2 || o) ? s < 0 && (t.push(e), s = t.length - 1) : i & (P | F) ? n = !0 : !o && e.buttons === 0 && (n = !0, r = !0, i = Ae.pointerup), !(s < 0) && (r || (t[s] = e), this.callback(this.manager, i, {
|
|
879
879
|
pointers: t,
|
|
880
880
|
changedPointers: [e],
|
|
881
881
|
pointerType: a,
|
|
882
882
|
srcEvent: t[s]
|
|
883
883
|
}), n && t.splice(s, 1));
|
|
884
884
|
} });
|
|
885
|
-
var
|
|
885
|
+
var Fe = {
|
|
886
886
|
touchstart: M,
|
|
887
887
|
touchmove: N,
|
|
888
888
|
touchend: P,
|
|
889
889
|
touchcancel: F
|
|
890
|
-
},
|
|
891
|
-
function
|
|
892
|
-
this.evTarget =
|
|
890
|
+
}, Ie = "touchstart", Le = "touchstart touchmove touchend touchcancel";
|
|
891
|
+
function Re() {
|
|
892
|
+
this.evTarget = Ie, this.evWin = Le, this.started = !1, U.apply(this, arguments);
|
|
893
893
|
}
|
|
894
|
-
_(
|
|
895
|
-
var t =
|
|
894
|
+
_(Re, U, { handler: function(e) {
|
|
895
|
+
var t = Fe[e.type];
|
|
896
896
|
if (t === M && (this.started = !0), this.started) {
|
|
897
|
-
var n =
|
|
897
|
+
var n = ze.call(this, e, t);
|
|
898
898
|
t & (P | F) && n[0].length - n[1].length === 0 && (this.started = !1), this.callback(this.manager, t, {
|
|
899
899
|
pointers: n[0],
|
|
900
900
|
changedPointers: n[1],
|
|
@@ -903,21 +903,21 @@ var O = class {
|
|
|
903
903
|
});
|
|
904
904
|
}
|
|
905
905
|
} });
|
|
906
|
-
function
|
|
906
|
+
function ze(e, t) {
|
|
907
907
|
var n = D(e.touches), r = D(e.changedTouches);
|
|
908
908
|
return t & (P | F) && (n = O(n.concat(r), "identifier", !0)), [n, r];
|
|
909
909
|
}
|
|
910
|
-
var
|
|
910
|
+
var Be = {
|
|
911
911
|
touchstart: M,
|
|
912
912
|
touchmove: N,
|
|
913
913
|
touchend: P,
|
|
914
914
|
touchcancel: F
|
|
915
|
-
},
|
|
916
|
-
function
|
|
917
|
-
this.evTarget =
|
|
915
|
+
}, Ve = "touchstart touchmove touchend touchcancel";
|
|
916
|
+
function He() {
|
|
917
|
+
this.evTarget = Ve, this.targetIds = {}, U.apply(this, arguments);
|
|
918
918
|
}
|
|
919
|
-
_(
|
|
920
|
-
var t =
|
|
919
|
+
_(He, U, { handler: function(e) {
|
|
920
|
+
var t = Be[e.type], n = Ue.call(this, e, t);
|
|
921
921
|
n && this.callback(this.manager, t, {
|
|
922
922
|
pointers: n[0],
|
|
923
923
|
changedPointers: n[1],
|
|
@@ -925,7 +925,7 @@ var O = class {
|
|
|
925
925
|
srcEvent: e
|
|
926
926
|
});
|
|
927
927
|
} });
|
|
928
|
-
function
|
|
928
|
+
function Ue(e, t) {
|
|
929
929
|
var n = D(e.touches), r = this.targetIds;
|
|
930
930
|
if (t & (M | N) && n.length === 1) return r[n[0].identifier] = !0, [n, n];
|
|
931
931
|
var i, a, o = D(e.changedTouches), s = [], c = this.target;
|
|
@@ -935,18 +935,18 @@ var O = class {
|
|
|
935
935
|
for (i = 0; i < o.length;) r[o[i].identifier] && s.push(o[i]), t & (P | F) && delete r[o[i].identifier], i++;
|
|
936
936
|
if (s.length) return [O(a.concat(s), "identifier", !0), s];
|
|
937
937
|
}
|
|
938
|
-
var
|
|
939
|
-
function
|
|
940
|
-
|
|
938
|
+
var We = 2500, Ge = 25;
|
|
939
|
+
function Ke() {
|
|
940
|
+
U.apply(this, arguments);
|
|
941
941
|
var e = v(this.handler, this);
|
|
942
|
-
this.touch = new
|
|
942
|
+
this.touch = new He(this.manager, e), this.mouse = new ke(this.manager, e), this.primaryTouch = null, this.lastTouches = [];
|
|
943
943
|
}
|
|
944
|
-
_(
|
|
944
|
+
_(Ke, U, {
|
|
945
945
|
handler: function(e, t, n) {
|
|
946
946
|
var r = n.pointerType == j, i = n.pointerType == se;
|
|
947
947
|
if (!(i && n.sourceCapabilities && n.sourceCapabilities.firesTouchEvents)) {
|
|
948
|
-
if (r)
|
|
949
|
-
else if (i &&
|
|
948
|
+
if (r) qe.call(this, t, n);
|
|
949
|
+
else if (i && Ye.call(this, n)) return;
|
|
950
950
|
this.callback(e, t, n);
|
|
951
951
|
}
|
|
952
952
|
},
|
|
@@ -954,10 +954,10 @@ var O = class {
|
|
|
954
954
|
this.touch.destroy(), this.mouse.destroy();
|
|
955
955
|
}
|
|
956
956
|
});
|
|
957
|
-
function
|
|
958
|
-
e & M ? (this.primaryTouch = t.changedPointers[0].identifier,
|
|
957
|
+
function qe(e, t) {
|
|
958
|
+
e & M ? (this.primaryTouch = t.changedPointers[0].identifier, Je.call(this, t)) : e & (P | F) && Je.call(this, t);
|
|
959
959
|
}
|
|
960
|
-
function
|
|
960
|
+
function Je(e) {
|
|
961
961
|
var t = e.changedPointers[0];
|
|
962
962
|
if (t.identifier === this.primaryTouch) {
|
|
963
963
|
var n = {
|
|
@@ -969,23 +969,23 @@ var O = class {
|
|
|
969
969
|
setTimeout(function() {
|
|
970
970
|
var e = r.indexOf(n);
|
|
971
971
|
e > -1 && r.splice(e, 1);
|
|
972
|
-
},
|
|
972
|
+
}, We);
|
|
973
973
|
}
|
|
974
974
|
}
|
|
975
|
-
function
|
|
975
|
+
function Ye(e) {
|
|
976
976
|
for (var t = e.srcEvent.clientX, n = e.srcEvent.clientY, r = 0; r < this.lastTouches.length; r++) {
|
|
977
977
|
var i = this.lastTouches[r], a = Math.abs(t - i.x), o = Math.abs(n - i.y);
|
|
978
|
-
if (a <=
|
|
978
|
+
if (a <= Ge && o <= Ge) return !0;
|
|
979
979
|
}
|
|
980
980
|
return !1;
|
|
981
981
|
}
|
|
982
|
-
var
|
|
983
|
-
function
|
|
982
|
+
var Xe = a ? ee(a.style, "touchAction") : r, Ze = Xe !== r, Qe = "compute", $e = "auto", et = "manipulation", W = "none", tt = "pan-x", nt = "pan-y", G = it();
|
|
983
|
+
function K(e, t) {
|
|
984
984
|
this.manager = e, this.set(t);
|
|
985
985
|
}
|
|
986
|
-
|
|
986
|
+
K.prototype = {
|
|
987
987
|
set: function(e) {
|
|
988
|
-
e ==
|
|
988
|
+
e == Qe && (e = this.compute()), Ze && this.manager.element.style && G[e] && (this.manager.element.style[Xe] = e), this.actions = e.toLowerCase().trim();
|
|
989
989
|
},
|
|
990
990
|
update: function() {
|
|
991
991
|
this.set(this.manager.options.touchAction);
|
|
@@ -994,7 +994,7 @@ var O = class {
|
|
|
994
994
|
var e = [];
|
|
995
995
|
return f(this.manager.recognizers, function(t) {
|
|
996
996
|
y(t.options.enable, [t]) && (e = e.concat(t.getTouchAction()));
|
|
997
|
-
}),
|
|
997
|
+
}), rt(e.join(" "));
|
|
998
998
|
},
|
|
999
999
|
preventDefaults: function(e) {
|
|
1000
1000
|
var t = e.srcEvent, n = e.offsetDirection;
|
|
@@ -1002,24 +1002,24 @@ var O = class {
|
|
|
1002
1002
|
t.preventDefault();
|
|
1003
1003
|
return;
|
|
1004
1004
|
}
|
|
1005
|
-
var r = this.actions, i = w(r,
|
|
1005
|
+
var r = this.actions, i = w(r, W) && !G[W], a = w(r, nt) && !G[nt], o = w(r, tt) && !G[tt];
|
|
1006
1006
|
if (i) {
|
|
1007
1007
|
var s = e.pointers.length === 1, c = e.distance < 2, l = e.deltaTime < 250;
|
|
1008
1008
|
if (s && c && l) return;
|
|
1009
1009
|
}
|
|
1010
|
-
if (!(o && a) && (i || a && n &
|
|
1010
|
+
if (!(o && a) && (i || a && n & V || o && n & H)) return this.preventSrc(t);
|
|
1011
1011
|
},
|
|
1012
1012
|
preventSrc: function(e) {
|
|
1013
1013
|
this.manager.session.prevented = !0, e.preventDefault();
|
|
1014
1014
|
}
|
|
1015
1015
|
};
|
|
1016
|
-
function
|
|
1017
|
-
if (w(e,
|
|
1018
|
-
var t = w(e,
|
|
1019
|
-
return t && n ?
|
|
1016
|
+
function rt(e) {
|
|
1017
|
+
if (w(e, W)) return W;
|
|
1018
|
+
var t = w(e, tt), n = w(e, nt);
|
|
1019
|
+
return t && n ? W : t || n ? t ? tt : nt : w(e, et) ? et : $e;
|
|
1020
1020
|
}
|
|
1021
|
-
function
|
|
1022
|
-
if (!
|
|
1021
|
+
function it() {
|
|
1022
|
+
if (!Ze) return !1;
|
|
1023
1023
|
var t = {}, n = e.CSS && e.CSS.supports;
|
|
1024
1024
|
return [
|
|
1025
1025
|
"auto",
|
|
@@ -1032,9 +1032,9 @@ var O = class {
|
|
|
1032
1032
|
t[r] = n ? e.CSS.supports("touch-action", r) : !0;
|
|
1033
1033
|
}), t;
|
|
1034
1034
|
}
|
|
1035
|
-
var
|
|
1035
|
+
var at = 1, q = 2, ot = 4, J = 8, Y = J, st = 16, X = 32;
|
|
1036
1036
|
function Z(e) {
|
|
1037
|
-
this.options = m({}, this.defaults, e || {}), this.id = ne(), this.manager = null, this.options.enable = b(this.options.enable, !0), this.state =
|
|
1037
|
+
this.options = m({}, this.defaults, e || {}), this.id = ne(), this.manager = null, this.options.enable = b(this.options.enable, !0), this.state = at, this.simultaneous = {}, this.requireFail = [];
|
|
1038
1038
|
}
|
|
1039
1039
|
Z.prototype = {
|
|
1040
1040
|
defaults: {},
|
|
@@ -1071,7 +1071,7 @@ var O = class {
|
|
|
1071
1071
|
function r(n) {
|
|
1072
1072
|
t.manager.emit(n, e);
|
|
1073
1073
|
}
|
|
1074
|
-
n <
|
|
1074
|
+
n < J && r(t.options.event + ct(n)), r(t.options.event), e.additionalEvent && r(e.additionalEvent), n >= J && r(t.options.event + ct(n));
|
|
1075
1075
|
},
|
|
1076
1076
|
tryEmit: function(e) {
|
|
1077
1077
|
if (this.canEmit()) return this.emit(e);
|
|
@@ -1079,7 +1079,7 @@ var O = class {
|
|
|
1079
1079
|
},
|
|
1080
1080
|
canEmit: function() {
|
|
1081
1081
|
for (var e = 0; e < this.requireFail.length;) {
|
|
1082
|
-
if (!(this.requireFail[e].state & (X |
|
|
1082
|
+
if (!(this.requireFail[e].state & (X | at))) return !1;
|
|
1083
1083
|
e++;
|
|
1084
1084
|
}
|
|
1085
1085
|
return !0;
|
|
@@ -1090,17 +1090,17 @@ var O = class {
|
|
|
1090
1090
|
this.reset(), this.state = X;
|
|
1091
1091
|
return;
|
|
1092
1092
|
}
|
|
1093
|
-
this.state & (
|
|
1093
|
+
this.state & (Y | st | X) && (this.state = at), this.state = this.process(t), this.state & (q | ot | J | st) && this.tryEmit(t);
|
|
1094
1094
|
},
|
|
1095
1095
|
process: function(e) {},
|
|
1096
1096
|
getTouchAction: function() {},
|
|
1097
1097
|
reset: function() {}
|
|
1098
1098
|
};
|
|
1099
1099
|
function ct(e) {
|
|
1100
|
-
return e &
|
|
1100
|
+
return e & st ? "cancel" : e & J ? "end" : e & ot ? "move" : e & q ? "start" : "";
|
|
1101
1101
|
}
|
|
1102
1102
|
function lt(e) {
|
|
1103
|
-
return e ==
|
|
1103
|
+
return e == B ? "down" : e == z ? "up" : e == L ? "left" : e == R ? "right" : "";
|
|
1104
1104
|
}
|
|
1105
1105
|
function ut(e, t) {
|
|
1106
1106
|
var n = t.manager;
|
|
@@ -1116,8 +1116,8 @@ var O = class {
|
|
|
1116
1116
|
return t === 0 || e.pointers.length === t;
|
|
1117
1117
|
},
|
|
1118
1118
|
process: function(e) {
|
|
1119
|
-
var t = this.state, n = e.eventType, r = t & (
|
|
1120
|
-
return r && (n & F || !i) ? t |
|
|
1119
|
+
var t = this.state, n = e.eventType, r = t & (q | ot), i = this.attrTest(e);
|
|
1120
|
+
return r && (n & F || !i) ? t | st : r || i ? n & P ? t | J : t & q ? t | ot : q : X;
|
|
1121
1121
|
}
|
|
1122
1122
|
});
|
|
1123
1123
|
function dt() {
|
|
@@ -1128,18 +1128,18 @@ var O = class {
|
|
|
1128
1128
|
event: "pan",
|
|
1129
1129
|
threshold: 10,
|
|
1130
1130
|
pointers: 1,
|
|
1131
|
-
direction:
|
|
1131
|
+
direction: ue
|
|
1132
1132
|
},
|
|
1133
1133
|
getTouchAction: function() {
|
|
1134
1134
|
var e = this.options.direction, t = [];
|
|
1135
|
-
return e &
|
|
1135
|
+
return e & V && t.push(nt), e & H && t.push(tt), t;
|
|
1136
1136
|
},
|
|
1137
1137
|
directionTest: function(e) {
|
|
1138
1138
|
var t = this.options, n = !0, r = e.distance, i = e.direction, a = e.deltaX, o = e.deltaY;
|
|
1139
|
-
return i & t.direction || (t.direction &
|
|
1139
|
+
return i & t.direction || (t.direction & V ? (i = a === 0 ? I : a < 0 ? L : R, n = a != this.pX, r = Math.abs(e.deltaX)) : (i = o === 0 ? I : o < 0 ? z : B, n = o != this.pY, r = Math.abs(e.deltaY))), e.direction = i, n && r > t.threshold && i & t.direction;
|
|
1140
1140
|
},
|
|
1141
1141
|
attrTest: function(e) {
|
|
1142
|
-
return Q.prototype.attrTest.call(this, e) && (this.state &
|
|
1142
|
+
return Q.prototype.attrTest.call(this, e) && (this.state & q || !(this.state & q) && this.directionTest(e));
|
|
1143
1143
|
},
|
|
1144
1144
|
emit: function(e) {
|
|
1145
1145
|
this.pX = e.deltaX, this.pY = e.deltaY;
|
|
@@ -1157,10 +1157,10 @@ var O = class {
|
|
|
1157
1157
|
pointers: 2
|
|
1158
1158
|
},
|
|
1159
1159
|
getTouchAction: function() {
|
|
1160
|
-
return [
|
|
1160
|
+
return [W];
|
|
1161
1161
|
},
|
|
1162
1162
|
attrTest: function(e) {
|
|
1163
|
-
return this._super.attrTest.call(this, e) && (Math.abs(e.scale - 1) > this.options.threshold || this.state &
|
|
1163
|
+
return this._super.attrTest.call(this, e) && (Math.abs(e.scale - 1) > this.options.threshold || this.state & q);
|
|
1164
1164
|
},
|
|
1165
1165
|
emit: function(e) {
|
|
1166
1166
|
if (e.scale !== 1) {
|
|
@@ -1181,22 +1181,22 @@ var O = class {
|
|
|
1181
1181
|
threshold: 9
|
|
1182
1182
|
},
|
|
1183
1183
|
getTouchAction: function() {
|
|
1184
|
-
return [
|
|
1184
|
+
return [$e];
|
|
1185
1185
|
},
|
|
1186
1186
|
process: function(e) {
|
|
1187
1187
|
var t = this.options, n = e.pointers.length === t.pointers, r = e.distance < t.threshold, i = e.deltaTime > t.time;
|
|
1188
1188
|
if (this._input = e, !r || !n || e.eventType & (P | F) && !i) this.reset();
|
|
1189
1189
|
else if (e.eventType & M) this.reset(), this._timer = u(function() {
|
|
1190
|
-
this.state =
|
|
1190
|
+
this.state = Y, this.tryEmit();
|
|
1191
1191
|
}, t.time, this);
|
|
1192
|
-
else if (e.eventType & P) return
|
|
1192
|
+
else if (e.eventType & P) return Y;
|
|
1193
1193
|
return X;
|
|
1194
1194
|
},
|
|
1195
1195
|
reset: function() {
|
|
1196
1196
|
clearTimeout(this._timer);
|
|
1197
1197
|
},
|
|
1198
1198
|
emit: function(e) {
|
|
1199
|
-
this.state ===
|
|
1199
|
+
this.state === Y && (e && e.eventType & P ? this.manager.emit(this.options.event + "up", e) : (this._input.timeStamp = l(), this.manager.emit(this.options.event, this._input)));
|
|
1200
1200
|
}
|
|
1201
1201
|
});
|
|
1202
1202
|
function mt() {
|
|
@@ -1209,10 +1209,10 @@ var O = class {
|
|
|
1209
1209
|
pointers: 2
|
|
1210
1210
|
},
|
|
1211
1211
|
getTouchAction: function() {
|
|
1212
|
-
return [
|
|
1212
|
+
return [W];
|
|
1213
1213
|
},
|
|
1214
1214
|
attrTest: function(e) {
|
|
1215
|
-
return this._super.attrTest.call(this, e) && (Math.abs(e.rotation) > this.options.threshold || this.state &
|
|
1215
|
+
return this._super.attrTest.call(this, e) && (Math.abs(e.rotation) > this.options.threshold || this.state & q);
|
|
1216
1216
|
}
|
|
1217
1217
|
});
|
|
1218
1218
|
function ht() {
|
|
@@ -1223,7 +1223,7 @@ var O = class {
|
|
|
1223
1223
|
event: "swipe",
|
|
1224
1224
|
threshold: 10,
|
|
1225
1225
|
velocity: .3,
|
|
1226
|
-
direction:
|
|
1226
|
+
direction: V | H,
|
|
1227
1227
|
pointers: 1
|
|
1228
1228
|
},
|
|
1229
1229
|
getTouchAction: function() {
|
|
@@ -1231,7 +1231,7 @@ var O = class {
|
|
|
1231
1231
|
},
|
|
1232
1232
|
attrTest: function(e) {
|
|
1233
1233
|
var t = this.options.direction, n;
|
|
1234
|
-
return t & (
|
|
1234
|
+
return t & (V | H) ? n = e.overallVelocity : t & V ? n = e.overallVelocityX : t & H && (n = e.overallVelocityY), this._super.attrTest.call(this, e) && t & e.offsetDirection && e.distance > this.options.threshold && e.maxPointers == this.options.pointers && c(n) > this.options.velocity && e.eventType & P;
|
|
1235
1235
|
},
|
|
1236
1236
|
emit: function(e) {
|
|
1237
1237
|
var t = lt(e.offsetDirection);
|
|
@@ -1252,17 +1252,17 @@ var O = class {
|
|
|
1252
1252
|
posThreshold: 10
|
|
1253
1253
|
},
|
|
1254
1254
|
getTouchAction: function() {
|
|
1255
|
-
return [
|
|
1255
|
+
return [et];
|
|
1256
1256
|
},
|
|
1257
1257
|
process: function(e) {
|
|
1258
1258
|
var t = this.options, n = e.pointers.length === t.pointers, r = e.distance < t.threshold, i = e.deltaTime < t.time;
|
|
1259
1259
|
if (this.reset(), e.eventType & M && this.count === 0) return this.failTimeout();
|
|
1260
1260
|
if (r && i && n) {
|
|
1261
1261
|
if (e.eventType != P) return this.failTimeout();
|
|
1262
|
-
var a = this.pTime ? e.timeStamp - this.pTime < t.interval : !0, o = !this.pCenter ||
|
|
1262
|
+
var a = this.pTime ? e.timeStamp - this.pTime < t.interval : !0, o = !this.pCenter || Se(this.pCenter, e.center) < t.posThreshold;
|
|
1263
1263
|
if (this.pTime = e.timeStamp, this.pCenter = e.center, !o || !a ? this.count = 1 : this.count += 1, this._input = e, this.count % t.taps === 0) return this.hasRequireFailures() ? (this._timer = u(function() {
|
|
1264
|
-
this.state =
|
|
1265
|
-
}, t.interval, this),
|
|
1264
|
+
this.state = Y, this.tryEmit();
|
|
1265
|
+
}, t.interval, this), q) : Y;
|
|
1266
1266
|
}
|
|
1267
1267
|
return X;
|
|
1268
1268
|
},
|
|
@@ -1275,15 +1275,15 @@ var O = class {
|
|
|
1275
1275
|
clearTimeout(this._timer);
|
|
1276
1276
|
},
|
|
1277
1277
|
emit: function() {
|
|
1278
|
-
this.state ==
|
|
1278
|
+
this.state == Y && (this._input.tapCount = this.count, this.manager.emit(this.options.event, this._input));
|
|
1279
1279
|
}
|
|
1280
1280
|
});
|
|
1281
|
-
function
|
|
1282
|
-
return t = t || {}, t.recognizers = b(t.recognizers,
|
|
1281
|
+
function _t(e, t) {
|
|
1282
|
+
return t = t || {}, t.recognizers = b(t.recognizers, _t.defaults.preset), new bt(e, t);
|
|
1283
1283
|
}
|
|
1284
|
-
|
|
1284
|
+
_t.VERSION = "2.0.7", _t.defaults = {
|
|
1285
1285
|
domEvents: !1,
|
|
1286
|
-
touchAction:
|
|
1286
|
+
touchAction: Qe,
|
|
1287
1287
|
enable: !0,
|
|
1288
1288
|
inputTarget: null,
|
|
1289
1289
|
inputClass: null,
|
|
@@ -1294,10 +1294,10 @@ var O = class {
|
|
|
1294
1294
|
{ enable: !1 },
|
|
1295
1295
|
["rotate"]
|
|
1296
1296
|
],
|
|
1297
|
-
[ht, { direction:
|
|
1297
|
+
[ht, { direction: V }],
|
|
1298
1298
|
[
|
|
1299
1299
|
dt,
|
|
1300
|
-
{ direction:
|
|
1300
|
+
{ direction: V },
|
|
1301
1301
|
["swipe"]
|
|
1302
1302
|
],
|
|
1303
1303
|
[gt],
|
|
@@ -1320,27 +1320,27 @@ var O = class {
|
|
|
1320
1320
|
tapHighlightColor: "rgba(0,0,0,0)"
|
|
1321
1321
|
}
|
|
1322
1322
|
};
|
|
1323
|
-
var
|
|
1324
|
-
function
|
|
1325
|
-
this.options = m({},
|
|
1323
|
+
var vt = 1, yt = 2;
|
|
1324
|
+
function bt(e, t) {
|
|
1325
|
+
this.options = m({}, _t.defaults, t || {}), this.options.inputTarget = this.options.inputTarget || e, this.handlers = {}, this.session = {}, this.recognizers = [], this.oldCssProps = {}, this.element = e, this.input = pe(this), this.touchAction = new K(this, this.options.touchAction), xt(this, !0), f(this.options.recognizers, function(e) {
|
|
1326
1326
|
var t = this.add(new e[0](e[1]));
|
|
1327
1327
|
e[2] && t.recognizeWith(e[2]), e[3] && t.requireFailure(e[3]);
|
|
1328
1328
|
}, this);
|
|
1329
1329
|
}
|
|
1330
|
-
|
|
1330
|
+
bt.prototype = {
|
|
1331
1331
|
set: function(e) {
|
|
1332
1332
|
return m(this.options, e), e.touchAction && this.touchAction.update(), e.inputTarget && (this.input.destroy(), this.input.target = e.inputTarget, this.input.init()), this;
|
|
1333
1333
|
},
|
|
1334
1334
|
stop: function(e) {
|
|
1335
|
-
this.session.stopped = e ?
|
|
1335
|
+
this.session.stopped = e ? yt : vt;
|
|
1336
1336
|
},
|
|
1337
1337
|
recognize: function(e) {
|
|
1338
1338
|
var t = this.session;
|
|
1339
1339
|
if (!t.stopped) {
|
|
1340
1340
|
this.touchAction.preventDefaults(e);
|
|
1341
1341
|
var n, r = this.recognizers, i = t.curRecognizer;
|
|
1342
|
-
(!i || i && i.state &
|
|
1343
|
-
for (var a = 0; a < r.length;) n = r[a], t.stopped !==
|
|
1342
|
+
(!i || i && i.state & Y) && (i = t.curRecognizer = null);
|
|
1343
|
+
for (var a = 0; a < r.length;) n = r[a], t.stopped !== yt && (!i || n == i || n.canRecognizeWith(i)) ? n.recognize(e) : n.reset(), !i && n.state & (q | ot | J) && (i = t.curRecognizer = n), a++;
|
|
1344
1344
|
}
|
|
1345
1345
|
},
|
|
1346
1346
|
get: function(e) {
|
|
@@ -1378,7 +1378,7 @@ var O = class {
|
|
|
1378
1378
|
}
|
|
1379
1379
|
},
|
|
1380
1380
|
emit: function(e, t) {
|
|
1381
|
-
this.options.domEvents &&
|
|
1381
|
+
this.options.domEvents && St(e, t);
|
|
1382
1382
|
var n = this.handlers[e] && this.handlers[e].slice();
|
|
1383
1383
|
if (!(!n || !n.length)) {
|
|
1384
1384
|
t.type = e, t.preventDefault = function() {
|
|
@@ -1388,10 +1388,10 @@ var O = class {
|
|
|
1388
1388
|
}
|
|
1389
1389
|
},
|
|
1390
1390
|
destroy: function() {
|
|
1391
|
-
this.element &&
|
|
1391
|
+
this.element && xt(this, !1), this.handlers = {}, this.session = {}, this.input.destroy(), this.element = null;
|
|
1392
1392
|
}
|
|
1393
1393
|
};
|
|
1394
|
-
function
|
|
1394
|
+
function xt(e, t) {
|
|
1395
1395
|
var n = e.element;
|
|
1396
1396
|
if (n.style) {
|
|
1397
1397
|
var r;
|
|
@@ -1400,38 +1400,38 @@ var O = class {
|
|
|
1400
1400
|
}), t || (e.oldCssProps = {});
|
|
1401
1401
|
}
|
|
1402
1402
|
}
|
|
1403
|
-
function
|
|
1403
|
+
function St(e, n) {
|
|
1404
1404
|
var r = t.createEvent("Event");
|
|
1405
1405
|
r.initEvent(e, !0, !0), r.gesture = n, n.target.dispatchEvent(r);
|
|
1406
1406
|
}
|
|
1407
|
-
return m(
|
|
1407
|
+
return m(_t, {
|
|
1408
1408
|
INPUT_START: M,
|
|
1409
1409
|
INPUT_MOVE: N,
|
|
1410
1410
|
INPUT_END: P,
|
|
1411
1411
|
INPUT_CANCEL: F,
|
|
1412
|
-
STATE_POSSIBLE:
|
|
1413
|
-
STATE_BEGAN:
|
|
1414
|
-
STATE_CHANGED:
|
|
1415
|
-
STATE_ENDED:
|
|
1416
|
-
STATE_RECOGNIZED:
|
|
1417
|
-
STATE_CANCELLED:
|
|
1412
|
+
STATE_POSSIBLE: at,
|
|
1413
|
+
STATE_BEGAN: q,
|
|
1414
|
+
STATE_CHANGED: ot,
|
|
1415
|
+
STATE_ENDED: J,
|
|
1416
|
+
STATE_RECOGNIZED: Y,
|
|
1417
|
+
STATE_CANCELLED: st,
|
|
1418
1418
|
STATE_FAILED: X,
|
|
1419
|
-
DIRECTION_NONE:
|
|
1420
|
-
DIRECTION_LEFT:
|
|
1421
|
-
DIRECTION_RIGHT:
|
|
1422
|
-
DIRECTION_UP:
|
|
1423
|
-
DIRECTION_DOWN:
|
|
1424
|
-
DIRECTION_HORIZONTAL:
|
|
1425
|
-
DIRECTION_VERTICAL:
|
|
1426
|
-
DIRECTION_ALL:
|
|
1427
|
-
Manager:
|
|
1428
|
-
Input:
|
|
1429
|
-
TouchAction:
|
|
1430
|
-
TouchInput:
|
|
1431
|
-
MouseInput:
|
|
1432
|
-
PointerEventInput:
|
|
1433
|
-
TouchMouseInput:
|
|
1434
|
-
SingleTouchInput:
|
|
1419
|
+
DIRECTION_NONE: I,
|
|
1420
|
+
DIRECTION_LEFT: L,
|
|
1421
|
+
DIRECTION_RIGHT: R,
|
|
1422
|
+
DIRECTION_UP: z,
|
|
1423
|
+
DIRECTION_DOWN: B,
|
|
1424
|
+
DIRECTION_HORIZONTAL: V,
|
|
1425
|
+
DIRECTION_VERTICAL: H,
|
|
1426
|
+
DIRECTION_ALL: ue,
|
|
1427
|
+
Manager: bt,
|
|
1428
|
+
Input: U,
|
|
1429
|
+
TouchAction: K,
|
|
1430
|
+
TouchInput: He,
|
|
1431
|
+
MouseInput: ke,
|
|
1432
|
+
PointerEventInput: Pe,
|
|
1433
|
+
TouchMouseInput: Ke,
|
|
1434
|
+
SingleTouchInput: Re,
|
|
1435
1435
|
Recognizer: Z,
|
|
1436
1436
|
AttrRecognizer: Q,
|
|
1437
1437
|
Tap: gt,
|
|
@@ -1449,7 +1449,7 @@ var O = class {
|
|
|
1449
1449
|
inherit: _,
|
|
1450
1450
|
bindFn: v,
|
|
1451
1451
|
prefixed: ee
|
|
1452
|
-
}),
|
|
1452
|
+
}), _t;
|
|
1453
1453
|
})(typeof window < "u" ? window : {}, typeof document < "u" ? document : {}, "Hammer"), A = function(e, t) {
|
|
1454
1454
|
t === void 0 && console.warn("THREE.OrbitControls: The second parameter \"domElement\" is now mandatory."), t === document && console.error("THREE.OrbitControls: \"document\" should not be used as the target \"domElement\". Please use \"renderer.domElement\" instead."), this.object = e, this.domElement = t, this.enabled = !0, this.target = new p(), this.minDistance = 0, this.maxDistance = Infinity, this.minZoom = 0, this.maxZoom = Infinity, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -Infinity, this.maxAzimuthAngle = Infinity, this.enableDamping = !1, this.dampingFactor = .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 = {
|
|
1455
1455
|
LEFT: 37,
|
|
@@ -1478,7 +1478,7 @@ var O = class {
|
|
|
1478
1478
|
return t.copy(e).sub(n.target), t.applyQuaternion(i), h.setFromVector3(t), n.autoRotate && c === s.NONE && ne(ee()), n.enableDamping ? (h.theta += g.theta * n.dampingFactor, h.phi += g.phi * n.dampingFactor) : (h.theta += g.theta, h.phi += g.phi), h.theta = Math.max(n.minAzimuthAngle, Math.min(n.maxAzimuthAngle, h.theta)), h.phi = Math.max(n.minPolarAngle, Math.min(n.maxPolarAngle, h.phi)), h.makeSafe(), h.radius *= _, h.radius = Math.max(n.minDistance, Math.min(n.maxDistance, h.radius)), n.enableDamping === !0 ? n.target.addScaledVector(v, n.dampingFactor) : n.target.add(v), t.setFromSpherical(h), t.applyQuaternion(a), e.copy(n.target).add(t), n.object.lookAt(n.target), n.enableDamping === !0 ? (g.theta *= 1 - n.dampingFactor, g.phi *= 1 - n.dampingFactor, v.multiplyScalar(1 - n.dampingFactor)) : (g.set(0, 0, 0), v.set(0, 0, 0)), _ = 1, y || o.distanceToSquared(n.object.position) > m || 8 * (1 - u.dot(n.object.quaternion)) > m ? (n.dispatchEvent(r), o.copy(n.object.position), u.copy(n.object.quaternion), y = !1, !0) : !1;
|
|
1479
1479
|
};
|
|
1480
1480
|
}(), this.dispose = function() {
|
|
1481
|
-
n.domElement.removeEventListener("contextmenu",
|
|
1481
|
+
n.domElement.removeEventListener("contextmenu", be, !1), n.domElement.removeEventListener("mousedown", U, !1), n.domElement.removeEventListener("wheel", he, !1), n.domElement.removeEventListener("touchstart", _e, !1), n.domElement.removeEventListener("touchend", ye, !1), n.domElement.removeEventListener("touchmove", ve, !1), document.removeEventListener("mousemove", pe, !1), document.removeEventListener("mouseup", me, !1), n.domElement.removeEventListener("keydown", ge, !1);
|
|
1482
1482
|
};
|
|
1483
1483
|
var n = this, r = { type: "change" }, i = { type: "start" }, a = { type: "end" }, s = {
|
|
1484
1484
|
NONE: -1,
|
|
@@ -1571,31 +1571,31 @@ var O = class {
|
|
|
1571
1571
|
}
|
|
1572
1572
|
t && (e.preventDefault(), n.update());
|
|
1573
1573
|
}
|
|
1574
|
-
function
|
|
1574
|
+
function I(e) {
|
|
1575
1575
|
if (e.touches.length == 1) b.set(e.touches[0].pageX, e.touches[0].pageY);
|
|
1576
1576
|
else {
|
|
1577
1577
|
var t = .5 * (e.touches[0].pageX + e.touches[1].pageX), n = .5 * (e.touches[0].pageY + e.touches[1].pageY);
|
|
1578
1578
|
b.set(t, n);
|
|
1579
1579
|
}
|
|
1580
1580
|
}
|
|
1581
|
-
function
|
|
1581
|
+
function L(e) {
|
|
1582
1582
|
if (e.touches.length == 1) C.set(e.touches[0].pageX, e.touches[0].pageY);
|
|
1583
1583
|
else {
|
|
1584
1584
|
var t = .5 * (e.touches[0].pageX + e.touches[1].pageX), n = .5 * (e.touches[0].pageY + e.touches[1].pageY);
|
|
1585
1585
|
C.set(t, n);
|
|
1586
1586
|
}
|
|
1587
1587
|
}
|
|
1588
|
-
function
|
|
1588
|
+
function R(e) {
|
|
1589
1589
|
var t = e.touches[0].pageX - e.touches[1].pageX, n = e.touches[0].pageY - e.touches[1].pageY, r = Math.sqrt(t * t + n * n);
|
|
1590
1590
|
E.set(0, r);
|
|
1591
1591
|
}
|
|
1592
|
-
function R(e) {
|
|
1593
|
-
n.enableZoom && L(e), n.enablePan && I(e);
|
|
1594
|
-
}
|
|
1595
1592
|
function z(e) {
|
|
1596
|
-
n.enableZoom &&
|
|
1593
|
+
n.enableZoom && R(e), n.enablePan && L(e);
|
|
1597
1594
|
}
|
|
1598
1595
|
function B(e) {
|
|
1596
|
+
n.enableZoom && R(e), n.enableRotate && I(e);
|
|
1597
|
+
}
|
|
1598
|
+
function V(e) {
|
|
1599
1599
|
if (e.touches.length == 1) x.set(e.touches[0].pageX, e.touches[0].pageY);
|
|
1600
1600
|
else {
|
|
1601
1601
|
var t = .5 * (e.touches[0].pageX + e.touches[1].pageX), r = .5 * (e.touches[0].pageY + e.touches[1].pageY);
|
|
@@ -1605,7 +1605,7 @@ var O = class {
|
|
|
1605
1605
|
var i = n.domElement;
|
|
1606
1606
|
ne(2 * Math.PI * S.x / i.clientHeight), re(2 * Math.PI * S.y / i.clientHeight), b.copy(x);
|
|
1607
1607
|
}
|
|
1608
|
-
function
|
|
1608
|
+
function H(e) {
|
|
1609
1609
|
if (e.touches.length == 1) w.set(e.touches[0].pageX, e.touches[0].pageY);
|
|
1610
1610
|
else {
|
|
1611
1611
|
var t = .5 * (e.touches[0].pageX + e.touches[1].pageX), r = .5 * (e.touches[0].pageY + e.touches[1].pageY);
|
|
@@ -1613,17 +1613,17 @@ var O = class {
|
|
|
1613
1613
|
}
|
|
1614
1614
|
T.subVectors(w, C).multiplyScalar(n.panSpeed), k(T.x, T.y), C.copy(w);
|
|
1615
1615
|
}
|
|
1616
|
-
function
|
|
1616
|
+
function ue(e) {
|
|
1617
1617
|
var t = e.touches[0].pageX - e.touches[1].pageX, r = e.touches[0].pageY - e.touches[1].pageY, i = Math.sqrt(t * t + r * r);
|
|
1618
1618
|
D.set(0, i), O.set(0, Math.pow(D.y / E.y, n.zoomSpeed)), A(O.y), E.copy(D);
|
|
1619
1619
|
}
|
|
1620
|
-
function
|
|
1621
|
-
n.enableZoom &&
|
|
1620
|
+
function de(e) {
|
|
1621
|
+
n.enableZoom && ue(e), n.enablePan && H(e);
|
|
1622
1622
|
}
|
|
1623
|
-
function
|
|
1624
|
-
n.enableZoom &&
|
|
1623
|
+
function fe(e) {
|
|
1624
|
+
n.enableZoom && ue(e), n.enableRotate && V(e);
|
|
1625
1625
|
}
|
|
1626
|
-
function
|
|
1626
|
+
function U(e) {
|
|
1627
1627
|
if (n.enabled !== !1) {
|
|
1628
1628
|
e.preventDefault(), n.domElement.focus ? n.domElement.focus() : window.focus();
|
|
1629
1629
|
var t;
|
|
@@ -1664,10 +1664,10 @@ var O = class {
|
|
|
1664
1664
|
break;
|
|
1665
1665
|
default: c = s.NONE;
|
|
1666
1666
|
}
|
|
1667
|
-
c !== s.NONE && (document.addEventListener("mousemove",
|
|
1667
|
+
c !== s.NONE && (document.addEventListener("mousemove", pe, !1), document.addEventListener("mouseup", me, !1), n.dispatchEvent(i));
|
|
1668
1668
|
}
|
|
1669
1669
|
}
|
|
1670
|
-
function
|
|
1670
|
+
function pe(e) {
|
|
1671
1671
|
if (n.enabled !== !1) switch (e.preventDefault(), c) {
|
|
1672
1672
|
case s.ROTATE:
|
|
1673
1673
|
if (n.enableRotate === !1) return;
|
|
@@ -1683,27 +1683,27 @@ var O = class {
|
|
|
1683
1683
|
break;
|
|
1684
1684
|
}
|
|
1685
1685
|
}
|
|
1686
|
-
function
|
|
1687
|
-
n.enabled !== !1 && (document.removeEventListener("mousemove",
|
|
1686
|
+
function me(e) {
|
|
1687
|
+
n.enabled !== !1 && (document.removeEventListener("mousemove", pe, !1), document.removeEventListener("mouseup", me, !1), n.dispatchEvent(a), c = s.NONE);
|
|
1688
1688
|
}
|
|
1689
|
-
function
|
|
1689
|
+
function he(e) {
|
|
1690
1690
|
n.enabled === !1 || n.enableZoom === !1 || c !== s.NONE && c !== s.ROTATE || (e.preventDefault(), e.stopPropagation(), n.dispatchEvent(i), P(e), n.dispatchEvent(a));
|
|
1691
1691
|
}
|
|
1692
|
-
function
|
|
1692
|
+
function ge(e) {
|
|
1693
1693
|
n.enabled === !1 || n.enableKeys === !1 || n.enablePan === !1 || F(e);
|
|
1694
1694
|
}
|
|
1695
|
-
function
|
|
1695
|
+
function _e(e) {
|
|
1696
1696
|
if (n.enabled !== !1) {
|
|
1697
1697
|
switch (e.preventDefault(), e.touches.length) {
|
|
1698
1698
|
case 1:
|
|
1699
1699
|
switch (n.touches.ONE) {
|
|
1700
1700
|
case d.ROTATE:
|
|
1701
1701
|
if (n.enableRotate === !1) return;
|
|
1702
|
-
|
|
1702
|
+
I(e), c = s.TOUCH_ROTATE;
|
|
1703
1703
|
break;
|
|
1704
1704
|
case d.PAN:
|
|
1705
1705
|
if (n.enablePan === !1) return;
|
|
1706
|
-
|
|
1706
|
+
L(e), c = s.TOUCH_PAN;
|
|
1707
1707
|
break;
|
|
1708
1708
|
default: c = s.NONE;
|
|
1709
1709
|
}
|
|
@@ -1712,11 +1712,11 @@ var O = class {
|
|
|
1712
1712
|
switch (n.touches.TWO) {
|
|
1713
1713
|
case d.DOLLY_PAN:
|
|
1714
1714
|
if (n.enableZoom === !1 && n.enablePan === !1) return;
|
|
1715
|
-
|
|
1715
|
+
z(e), c = s.TOUCH_DOLLY_PAN;
|
|
1716
1716
|
break;
|
|
1717
1717
|
case d.DOLLY_ROTATE:
|
|
1718
1718
|
if (n.enableZoom === !1 && n.enableRotate === !1) return;
|
|
1719
|
-
|
|
1719
|
+
B(e), c = s.TOUCH_DOLLY_ROTATE;
|
|
1720
1720
|
break;
|
|
1721
1721
|
default: c = s.NONE;
|
|
1722
1722
|
}
|
|
@@ -1726,34 +1726,34 @@ var O = class {
|
|
|
1726
1726
|
c !== s.NONE && n.dispatchEvent(i);
|
|
1727
1727
|
}
|
|
1728
1728
|
}
|
|
1729
|
-
function
|
|
1729
|
+
function ve(e) {
|
|
1730
1730
|
if (n.enabled !== !1) switch (e.preventDefault(), e.stopPropagation(), c) {
|
|
1731
1731
|
case s.TOUCH_ROTATE:
|
|
1732
1732
|
if (n.enableRotate === !1) return;
|
|
1733
|
-
|
|
1733
|
+
V(e), n.update();
|
|
1734
1734
|
break;
|
|
1735
1735
|
case s.TOUCH_PAN:
|
|
1736
1736
|
if (n.enablePan === !1) return;
|
|
1737
|
-
|
|
1737
|
+
H(e), n.update();
|
|
1738
1738
|
break;
|
|
1739
1739
|
case s.TOUCH_DOLLY_PAN:
|
|
1740
1740
|
if (n.enableZoom === !1 && n.enablePan === !1) return;
|
|
1741
|
-
|
|
1741
|
+
de(e), n.update();
|
|
1742
1742
|
break;
|
|
1743
1743
|
case s.TOUCH_DOLLY_ROTATE:
|
|
1744
1744
|
if (n.enableZoom === !1 && n.enableRotate === !1) return;
|
|
1745
|
-
|
|
1745
|
+
fe(e), n.update();
|
|
1746
1746
|
break;
|
|
1747
1747
|
default: c = s.NONE;
|
|
1748
1748
|
}
|
|
1749
1749
|
}
|
|
1750
|
-
function
|
|
1750
|
+
function ye(e) {
|
|
1751
1751
|
n.enabled !== !1 && (n.dispatchEvent(a), c = s.NONE);
|
|
1752
1752
|
}
|
|
1753
|
-
function
|
|
1753
|
+
function be(e) {
|
|
1754
1754
|
n.enabled !== !1 && e.preventDefault();
|
|
1755
1755
|
}
|
|
1756
|
-
n.domElement.addEventListener("contextmenu",
|
|
1756
|
+
n.domElement.addEventListener("contextmenu", be, !1), n.domElement.addEventListener("mousedown", U, !1), n.domElement.addEventListener("wheel", he, !1), n.domElement.addEventListener("touchstart", _e, !1), n.domElement.addEventListener("touchend", ye, !1), n.domElement.addEventListener("touchmove", ve, !1), n.domElement.addEventListener("keydown", ge, !1), n.domElement.tabIndex === -1 && (n.domElement.tabIndex = 0), this.update();
|
|
1757
1757
|
};
|
|
1758
1758
|
A.prototype = Object.create(a.prototype), A.prototype.constructor = A;
|
|
1759
1759
|
var j = function(e, t) {
|
|
@@ -1882,13 +1882,13 @@ var oe = new p(), se = new l(), ce = new p(), le = class extends c {
|
|
|
1882
1882
|
};
|
|
1883
1883
|
//#endregion
|
|
1884
1884
|
//#region build/five/utils/calculateThreeMouse.js
|
|
1885
|
-
function
|
|
1885
|
+
function I(e, t, n) {
|
|
1886
1886
|
let { top: r, left: a, width: o, height: s } = t.getBoundingClientRect();
|
|
1887
1887
|
return n && (a += o * n.left, r += s * (1 - n.bottom - n.height), o *= n.width, s *= n.height), new i.Vector2((e.x - a) / o * 2 - 1, -(e.y - r) / s * 2 + 1);
|
|
1888
1888
|
}
|
|
1889
1889
|
//#endregion
|
|
1890
1890
|
//#region build/plugins/OrientationPlugin/RoundedBoxGeometry.js
|
|
1891
|
-
var
|
|
1891
|
+
var L = class extends i.BufferGeometry {
|
|
1892
1892
|
constructor(e, t, n, r, a) {
|
|
1893
1893
|
super(), this.type = "RoundedBoxGeometry", a = isNaN(a) ? 1 : Math.max(1, Math.floor(a)), e = isNaN(e) ? 1 : e, t = isNaN(t) ? 1 : t, n = isNaN(n) ? 1 : n, r = isNaN(r) ? .15 : r, r = Math.min(r, Math.min(e, Math.min(t, Math.min(n))) / 2);
|
|
1894
1894
|
let o = e / 2 - r, s = t / 2 - r, c = n / 2 - r;
|
|
@@ -2033,32 +2033,32 @@ var I = class extends i.BufferGeometry {
|
|
|
2033
2033
|
};
|
|
2034
2034
|
//#endregion
|
|
2035
2035
|
//#region build/plugins/OrientationPlugin/Controller.js
|
|
2036
|
-
function
|
|
2036
|
+
function R(e, t) {
|
|
2037
2037
|
return typeof e != "number" || typeof t != "number" ? !1 : Math.abs(e - t) < .001;
|
|
2038
2038
|
}
|
|
2039
|
-
function
|
|
2039
|
+
function z(e, t, n, r = (e) => e) {
|
|
2040
2040
|
let i = r(n);
|
|
2041
2041
|
return e * (1 - i) + t * i;
|
|
2042
2042
|
}
|
|
2043
|
-
var
|
|
2044
|
-
function
|
|
2043
|
+
var B = Number((Math.PI / 2).toFixed(5));
|
|
2044
|
+
function V(e, t, n) {
|
|
2045
2045
|
let r = new i.Shape();
|
|
2046
|
-
return r.moveTo(n, 0), r.lineTo(e - n, 0), r.absarc(e - n, n, n, -
|
|
2046
|
+
return r.moveTo(n, 0), r.lineTo(e - n, 0), r.absarc(e - n, n, n, -B, 0, !1), r.lineTo(e, t - n), r.absarc(e - n, t - n, n, 0, B, !1), r.lineTo(n, t), r.absarc(n, t - n, n, B, Math.PI, !1), r.lineTo(0, n), r.absarc(n, n, n, Math.PI, Math.PI * 1.5, !1), r;
|
|
2047
2047
|
}
|
|
2048
|
-
var
|
|
2048
|
+
var H = (e) => {
|
|
2049
2049
|
let t = document.createElement("div");
|
|
2050
2050
|
t.innerText = e;
|
|
2051
2051
|
let n = new le(t);
|
|
2052
2052
|
return n.name = e, n.scale.set(.3, .3, .3), t.style.pointerEvents = "none", t.style.backfaceVisibility = "hidden", n;
|
|
2053
|
-
},
|
|
2053
|
+
}, ue = (e) => {
|
|
2054
2054
|
let t = new i.PlaneGeometry(5, 5), n = new i.MeshBasicMaterial({
|
|
2055
2055
|
transparent: !0,
|
|
2056
2056
|
opacity: 0
|
|
2057
2057
|
}), r = new i.Mesh(t, n), a = document.createElement("div");
|
|
2058
2058
|
a.innerText = e;
|
|
2059
2059
|
let o = new le(a);
|
|
2060
|
-
return o.name = e, o.scale.set(.3, .3, .3), a.style.color = "#ffffff", a.style.opacity = "0.5", a.style.pointerEvents = "none", a.style.backfaceVisibility = "hidden", r.rotateX(-
|
|
2061
|
-
},
|
|
2060
|
+
return o.name = e, o.scale.set(.3, .3, .3), a.style.color = "#ffffff", a.style.opacity = "0.5", a.style.pointerEvents = "none", a.style.backfaceVisibility = "hidden", r.rotateX(-B), r.add(o), r;
|
|
2061
|
+
}, de = class extends _.Controller {
|
|
2062
2062
|
get config() {
|
|
2063
2063
|
return Object.assign({}, this._config);
|
|
2064
2064
|
}
|
|
@@ -2074,7 +2074,7 @@ var V = (e) => {
|
|
|
2074
2074
|
super(e), this.camera = new t(90), this.scene = new i.Scene(), this.renderer = new i.WebGLRenderer({
|
|
2075
2075
|
antialias: !0,
|
|
2076
2076
|
alpha: !0
|
|
2077
|
-
}), this.css3drenderer = new F(), this.ambientLight = new i.AmbientLight(16777215, .7), this.wrapper = document.createElement("div"), this.arrows = document.createElement("div"), this.arrowLeft = document.createElement("div"), this.arrowRight = document.createElement("div"), this.arrowFront = document.createElement("div"), this.arrowBack = document.createElement("div"), this.arrowTop = document.createElement("div"), this.arrowBottom = document.createElement("div"), this.spherical = null, this.dragging = !1, this.style = document.createElement("style"), this.directionalLight = new i.DirectionalLight(16777215, .2), this.box = new i.Mesh(new
|
|
2077
|
+
}), this.css3drenderer = new F(), this.ambientLight = new i.AmbientLight(16777215, .7), this.wrapper = document.createElement("div"), this.arrows = document.createElement("div"), this.arrowLeft = document.createElement("div"), this.arrowRight = document.createElement("div"), this.arrowFront = document.createElement("div"), this.arrowBack = document.createElement("div"), this.arrowTop = document.createElement("div"), this.arrowBottom = document.createElement("div"), this.spherical = null, this.dragging = !1, this.style = document.createElement("style"), this.directionalLight = new i.DirectionalLight(16777215, .2), this.box = new i.Mesh(new L(8, 8, 8, .5, 20), new i.MeshPhongMaterial({ color: 16777215 })), this.faces = new i.Group(), this.orient = ({ longitude: e, latitude: t }) => {
|
|
2078
2078
|
this.dragging = !1, this.spherical = null, this.controls.enableDamping = !1, this.five.setState(Object.assign({ latitude: t }, e === void 0 ? {} : { longitude: e + this.config.fixedLongitude })), this.five.ready().then(() => {
|
|
2079
2079
|
this.controls.enableDamping = !0, this.setState({ arrowsVisible: !0 });
|
|
2080
2080
|
});
|
|
@@ -2090,7 +2090,7 @@ var V = (e) => {
|
|
|
2090
2090
|
longitude: e,
|
|
2091
2091
|
latitude: t
|
|
2092
2092
|
});
|
|
2093
|
-
} else if (this.spherical && (!
|
|
2093
|
+
} else if (this.spherical && (!R(this.spherical.pi, (t = this.controls) == null ? void 0 : t.getPolarAngle()) || !R(this.spherical.theta, (n = this.controls) == null ? void 0 : n.getAzimuthalAngle()))) {
|
|
2094
2094
|
this.spherical = {
|
|
2095
2095
|
pi: (r = this.controls) == null ? void 0 : r.getPolarAngle(),
|
|
2096
2096
|
theta: (i = this.controls) == null ? void 0 : i.getAzimuthalAngle()
|
|
@@ -2105,7 +2105,7 @@ var V = (e) => {
|
|
|
2105
2105
|
});
|
|
2106
2106
|
} else this.spherical = null;
|
|
2107
2107
|
}, this.onTapGesture = (e) => {
|
|
2108
|
-
let t = e.pointers[0].clientX, n = e.pointers[0].clientY, r =
|
|
2108
|
+
let t = e.pointers[0].clientX, n = e.pointers[0].clientY, r = I({
|
|
2109
2109
|
x: t,
|
|
2110
2110
|
y: n
|
|
2111
2111
|
}, this.wrapper), a = new i.Raycaster();
|
|
@@ -2121,7 +2121,7 @@ var V = (e) => {
|
|
|
2121
2121
|
}, this.onFiveWantsGesture = () => {
|
|
2122
2122
|
if (this.spherical) return !1;
|
|
2123
2123
|
}, this.onFiveModeChange = (e) => {
|
|
2124
|
-
this.controls && (this.controls.maxPolarAngle = e === "Topview" ? 0 :
|
|
2124
|
+
this.controls && (this.controls.maxPolarAngle = e === "Topview" ? 0 : B);
|
|
2125
2125
|
}, this.onCameraUpdate = ({ state: e }) => {
|
|
2126
2126
|
if (this.dragging || this.spherical) return;
|
|
2127
2127
|
let { longitude: t, latitude: n } = e;
|
|
@@ -2138,7 +2138,7 @@ var V = (e) => {
|
|
|
2138
2138
|
this.dragging = !0, this.spherical = {};
|
|
2139
2139
|
}, this.onMouseMove = (e) => {
|
|
2140
2140
|
if (this.dragging) return;
|
|
2141
|
-
let t =
|
|
2141
|
+
let t = I({
|
|
2142
2142
|
x: e.clientX,
|
|
2143
2143
|
y: e.clientY
|
|
2144
2144
|
}, this.wrapper), n = new i.Raycaster();
|
|
@@ -2190,13 +2190,13 @@ var V = (e) => {
|
|
|
2190
2190
|
this.renderer.setClearAlpha(0), this.renderer.domElement.style.outline = "none", this.initDom(), this.initFaces(), this.initControls(), this.initLights();
|
|
2191
2191
|
let e = this.cylinder;
|
|
2192
2192
|
e.position.y = -3;
|
|
2193
|
-
let t =
|
|
2193
|
+
let t = ue("西");
|
|
2194
2194
|
t.position.set(-19, 0, 0), e.add(t);
|
|
2195
|
-
let n =
|
|
2195
|
+
let n = ue("东");
|
|
2196
2196
|
n.position.set(19, 0, 0), e.add(n);
|
|
2197
|
-
let r =
|
|
2197
|
+
let r = ue("北");
|
|
2198
2198
|
r.position.set(0, 0, -19), e.add(r);
|
|
2199
|
-
let i =
|
|
2199
|
+
let i = ue("南");
|
|
2200
2200
|
i.position.set(0, 0, 19), e.add(i), this.updateByCamera(), this.scene.add(e, this.box, this.faces), this.scene.rotation.y = this.config.fixedLongitude;
|
|
2201
2201
|
}
|
|
2202
2202
|
initDom() {
|
|
@@ -2205,12 +2205,12 @@ var V = (e) => {
|
|
|
2205
2205
|
bindEvents() {
|
|
2206
2206
|
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 = () => this.orient({
|
|
2207
2207
|
longitude: 0,
|
|
2208
|
-
latitude:
|
|
2208
|
+
latitude: B
|
|
2209
2209
|
}), this.arrowLeft.onclick = () => this.orient({
|
|
2210
|
-
longitude: -
|
|
2210
|
+
longitude: -B,
|
|
2211
2211
|
latitude: 0
|
|
2212
2212
|
}), this.arrowRight.onclick = () => this.orient({
|
|
2213
|
-
longitude:
|
|
2213
|
+
longitude: B,
|
|
2214
2214
|
latitude: 0
|
|
2215
2215
|
}), this.arrowFront.onclick = () => this.orient({
|
|
2216
2216
|
longitude: 0,
|
|
@@ -2224,7 +2224,7 @@ var V = (e) => {
|
|
|
2224
2224
|
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;
|
|
2225
2225
|
}
|
|
2226
2226
|
updateByCamera() {
|
|
2227
|
-
let e =
|
|
2227
|
+
let e = z(.2, 1, this.camera.pose.latitude / Math.PI * 2, (e) => e * e), t = z(11, 13, this.camera.pose.latitude / Math.PI * 2, (e) => e * e), n = z(12, 15, this.camera.pose.latitude / Math.PI * 2, (e) => e * e), r = z(13, 19, this.camera.pose.latitude / Math.PI * 2, (e) => e * e), a = z(-.2, .5, this.camera.pose.latitude / Math.PI * 2, (e) => e * e);
|
|
2228
2228
|
this.cylinder.geometry = new i.CylinderGeometry(t, n, .01, 50, 1, !0), this.cylinder.material.uniforms.radiusTop.value = t, this.cylinder.material.uniforms.radiusBottom.value = n, this.cylinder.material.needsUpdate = !0, this.cylinder.children.forEach((t) => {
|
|
2229
2229
|
t.position.normalize().multiplyScalar(r), t.scale.set(e, e, e);
|
|
2230
2230
|
let n = t.children[0];
|
|
@@ -2232,24 +2232,24 @@ var V = (e) => {
|
|
|
2232
2232
|
}), this.css3drenderer.markDirty();
|
|
2233
2233
|
}
|
|
2234
2234
|
updateArrows({ longitude: e, latitude: t }) {
|
|
2235
|
-
let n =
|
|
2235
|
+
let n = B - t < .02;
|
|
2236
2236
|
this.setState({ arrowsVisible: n });
|
|
2237
2237
|
}
|
|
2238
2238
|
handleArrowsVisible(e) {
|
|
2239
2239
|
if (this.state.enabled) if (this.cylinder.material.uniforms.opacity.value = e ? .4 : 1, this.cylinder.material.needsUpdate = !0, e) {
|
|
2240
2240
|
let { longitude: e, latitude: t } = this.five.getCurrentState();
|
|
2241
|
-
if (
|
|
2241
|
+
if (B - t < .03) 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(${(e - this.config.fixedLongitude) / Math.PI * 180}deg)`) : (this.arrows.innerHTML = "", this.faces.getObjectByName("上").element.className = "");
|
|
2242
2242
|
else {
|
|
2243
2243
|
switch (this.arrows.innerHTML = "", this.arrows.appendChild(this.arrowTop), this.config.orthoView && this.five.ready().then(() => {
|
|
2244
2244
|
this.five.controller.cameraType = "orthographic", this.five.ready().then(() => this.five.controller.cameraMotion.ended = !1);
|
|
2245
2245
|
}), !0) {
|
|
2246
|
-
case
|
|
2246
|
+
case R(0, e - this.config.fixedLongitude):
|
|
2247
2247
|
this.arrows.appendChild(this.arrowLeft), this.arrows.appendChild(this.arrowRight), this.arrows.appendChild(this.arrowBottom), this.faces.getObjectByName("前").element.className = "active";
|
|
2248
2248
|
break;
|
|
2249
|
-
case
|
|
2249
|
+
case R(B, e - this.config.fixedLongitude):
|
|
2250
2250
|
this.arrows.appendChild(this.arrowFront), this.arrows.appendChild(this.arrowBack), this.arrows.appendChild(this.arrowBottom), this.faces.getObjectByName("右").element.className = "active";
|
|
2251
2251
|
break;
|
|
2252
|
-
case
|
|
2252
|
+
case R(Math.PI, e - this.config.fixedLongitude):
|
|
2253
2253
|
this.arrows.appendChild(this.arrowRight), this.arrows.appendChild(this.arrowLeft), this.arrows.appendChild(this.arrowBottom), this.faces.getObjectByName("后").element.className = "active";
|
|
2254
2254
|
break;
|
|
2255
2255
|
default:
|
|
@@ -2274,7 +2274,7 @@ var V = (e) => {
|
|
|
2274
2274
|
this.directionalLight.target = this.box, this.scene.add(this.ambientLight, this.directionalLight);
|
|
2275
2275
|
}
|
|
2276
2276
|
initFaces() {
|
|
2277
|
-
let e =
|
|
2277
|
+
let e = V(7, 7, .5), t = new i.ShapeGeometry(e);
|
|
2278
2278
|
t.translate(-3.5, -3.5, 0);
|
|
2279
2279
|
let n = new i.Mesh(t, new i.MeshBasicMaterial({
|
|
2280
2280
|
transparent: !0,
|
|
@@ -2284,13 +2284,13 @@ var V = (e) => {
|
|
|
2284
2284
|
n.userData = {
|
|
2285
2285
|
longitude: 0,
|
|
2286
2286
|
latitude: 0
|
|
2287
|
-
}, n.position.z = 4.1, n.add(
|
|
2287
|
+
}, n.position.z = 4.1, n.add(H("前"));
|
|
2288
2288
|
let r = new i.Mesh(t, new i.MeshBasicMaterial({
|
|
2289
2289
|
transparent: !0,
|
|
2290
2290
|
color: 3370495,
|
|
2291
2291
|
opacity: 0
|
|
2292
2292
|
}));
|
|
2293
|
-
r.rotateY(Math.PI), r.position.z = -4.1, r.add(
|
|
2293
|
+
r.rotateY(Math.PI), r.position.z = -4.1, r.add(H("后")), r.userData = {
|
|
2294
2294
|
longitude: Math.PI,
|
|
2295
2295
|
latitude: 0
|
|
2296
2296
|
};
|
|
@@ -2299,8 +2299,8 @@ var V = (e) => {
|
|
|
2299
2299
|
color: 3370495,
|
|
2300
2300
|
opacity: 0
|
|
2301
2301
|
}));
|
|
2302
|
-
a.rotateY(
|
|
2303
|
-
longitude:
|
|
2302
|
+
a.rotateY(B), a.position.x = 4.1, a.add(H("右")), a.userData = {
|
|
2303
|
+
longitude: B,
|
|
2304
2304
|
latitude: 0
|
|
2305
2305
|
};
|
|
2306
2306
|
let o = new i.Mesh(t, new i.MeshBasicMaterial({
|
|
@@ -2308,8 +2308,8 @@ var V = (e) => {
|
|
|
2308
2308
|
color: 3370495,
|
|
2309
2309
|
opacity: 0
|
|
2310
2310
|
}));
|
|
2311
|
-
o.rotateY(-
|
|
2312
|
-
longitude: -
|
|
2311
|
+
o.rotateY(-B), o.position.x = -4.1, o.add(H("左")), o.userData = {
|
|
2312
|
+
longitude: -B,
|
|
2313
2313
|
latitude: 0
|
|
2314
2314
|
};
|
|
2315
2315
|
let s = new i.Mesh(t, new i.MeshBasicMaterial({
|
|
@@ -2317,14 +2317,14 @@ var V = (e) => {
|
|
|
2317
2317
|
color: 3370495,
|
|
2318
2318
|
opacity: 0
|
|
2319
2319
|
}));
|
|
2320
|
-
s.rotateX(-
|
|
2320
|
+
s.rotateX(-B), s.position.y = 4.1, s.add(H("上")), s.userData = {
|
|
2321
2321
|
longitude: 0,
|
|
2322
|
-
latitude:
|
|
2322
|
+
latitude: B
|
|
2323
2323
|
}, this.faces.add(n, r, o, a, s);
|
|
2324
2324
|
}
|
|
2325
2325
|
initControls() {
|
|
2326
2326
|
let e = this.controls = new A(this.camera, this.renderer.domElement);
|
|
2327
|
-
e.enableZoom = !1, e.enableDamping = !0, e.enablePan = !1, e.maxPolarAngle =
|
|
2327
|
+
e.enableZoom = !1, e.enableDamping = !0, e.enablePan = !1, e.maxPolarAngle = B, e.dampingFactor = .15, e.rotateSpeed = .25;
|
|
2328
2328
|
}
|
|
2329
2329
|
load(e) {
|
|
2330
2330
|
return v(this, void 0, void 0, function* () {});
|
|
@@ -2353,7 +2353,7 @@ var V = (e) => {
|
|
|
2353
2353
|
let n = (t = e == null ? void 0 : e.userAction) == null ? !0 : t;
|
|
2354
2354
|
this.updateState({ enabled: !1 }, n), this._disable({ userAction: n }), document.head.removeChild(this.style);
|
|
2355
2355
|
}
|
|
2356
|
-
},
|
|
2356
|
+
}, fe = (e, t) => new de(e, t), U = class extends m.Controller {
|
|
2357
2357
|
constructor(e, t) {
|
|
2358
2358
|
super(e), this.data = {}, this.pluginName = "BackgroundPlugin", this._onFiveCameraUpdate = (e) => {
|
|
2359
2359
|
let t = (Math.PI / 2 - Math.max(e.latitude, 0)) / (Math.PI / 2), n = Math.max(.2 - t, 0) * 10;
|
|
@@ -2377,7 +2377,7 @@ var V = (e) => {
|
|
|
2377
2377
|
this._removeEventListener(), this.hooks.emit("disable", { userAction: !0 }), this.state.enabled = !1;
|
|
2378
2378
|
}, this.state = { enabled: !1 }, !(typeof document > "u") && (this.gradientBg = document.createElement("div"), this.groundBg = document.createElement("div"), this.style = document.createElement("style"), this.gradientBg.className = "BackgroundPluginBg", this.groundBg.className = "BackgroundPluginGroundBg", this.style.innerHTML = "\n .BackgroundPluginBg {\n position: absolute;\n top: 0;\n right: 0;\n left: 0;\n height: 200%;\n background: linear-gradient(#0A0B0D, #2E3033);\n z-index: -1;\n pointerEvents: none;\n }\n .BackgroundPluginGroundBg {\n position: absolute;\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n background-image: radial-gradient(circle, #2E303350 0, transparent 0);\n z-index: -1;\n pointerEvents: none;\n }\n ", this.enable());
|
|
2379
2379
|
}
|
|
2380
|
-
},
|
|
2380
|
+
}, pe = (e, t) => new U(e, t);
|
|
2381
2381
|
//#endregion
|
|
2382
2382
|
//#region build/plugins/TrajectoryPlugin/Controller.js
|
|
2383
2383
|
new i.Matrix4().fromArray([
|
|
@@ -2398,7 +2398,7 @@ new i.Matrix4().fromArray([
|
|
|
2398
2398
|
0,
|
|
2399
2399
|
1
|
|
2400
2400
|
]);
|
|
2401
|
-
var
|
|
2401
|
+
var me = class {
|
|
2402
2402
|
constructor(e, t, n, r, i) {
|
|
2403
2403
|
this.R = e, this.Q = t, this.A = n, this.B = r, this.C = i, this.cov = NaN, this.x = NaN;
|
|
2404
2404
|
}
|
|
@@ -2410,7 +2410,7 @@ var he = class {
|
|
|
2410
2410
|
}
|
|
2411
2411
|
return this.x;
|
|
2412
2412
|
}
|
|
2413
|
-
},
|
|
2413
|
+
}, he = class extends _.Controller {
|
|
2414
2414
|
get config() {
|
|
2415
2415
|
return Object.assign({}, this._config);
|
|
2416
2416
|
}
|
|
@@ -2445,7 +2445,7 @@ var he = class {
|
|
|
2445
2445
|
}
|
|
2446
2446
|
loadTrajectory(e) {
|
|
2447
2447
|
this.trajectory = e, this.cancelAnimation && this.cancelAnimation(), this.playingState.keyframeIndex = null, this.playingState.progress = null;
|
|
2448
|
-
let t = .01, n = .1, r = new
|
|
2448
|
+
let t = .01, n = .1, r = new me(t, n, 1, 0, 1), a = new me(t, n, 1, 0, 1), o = new me(t, n, 1, 0, 1);
|
|
2449
2449
|
if (this.trajectory && this.trajectory.content.loadState === "READY") {
|
|
2450
2450
|
let t = this.trajectory.content.data.positionArray;
|
|
2451
2451
|
this.timeArray = this.trajectory.content.data.timeArray;
|
|
@@ -2651,15 +2651,15 @@ var he = class {
|
|
|
2651
2651
|
let n = (t = e == null ? void 0 : e.userAction) == null ? !0 : t;
|
|
2652
2652
|
this.updateState({ enabled: !1 }, n), this._disable({ userAction: n });
|
|
2653
2653
|
}
|
|
2654
|
-
},
|
|
2654
|
+
}, ge = (e, t) => new he(e, t);
|
|
2655
2655
|
//#endregion
|
|
2656
2656
|
//#region build/plugins/utils/clamp.js
|
|
2657
|
-
function
|
|
2657
|
+
function _e(e, t, n) {
|
|
2658
2658
|
return e < t ? t : e > n ? n : e;
|
|
2659
2659
|
}
|
|
2660
2660
|
//#endregion
|
|
2661
2661
|
//#region build/plugins/PanoAnimePlugin/Controller.js
|
|
2662
|
-
var
|
|
2662
|
+
var ve = "\nvarying vec2 vUv;\nvarying vec3 vPosition;\nvoid main() {\n vUv = uv;\n vPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n", ye = "\nvarying vec2 vUv;\nuniform sampler2D map;\nuniform float progress;\nuniform float opacity;\nvarying vec3 vPosition;\n\nvoid main() {\n vec3 white = vec3(1.0, 1.0, 1.0);\n vec4 image = texture2D(map, vUv);\n if (vUv.y > progress) {\n discard;\n }\n gl_FragColor = vec4(white, 0.7 * (progress - vPosition.y));\n if (progress == 1.0) {\n gl_FragColor = gl_FragColor + vec4(image.rgb, image.a * (1.0 - vPosition.y));\n }\n gl_FragColor.a = gl_FragColor.a * opacity;\n}\n", be = [
|
|
2663
2663
|
1,
|
|
2664
2664
|
5,
|
|
2665
2665
|
2,
|
|
@@ -2676,7 +2676,7 @@ var ye = "\nvarying vec2 vUv;\nvarying vec3 vPosition;\nvoid main() {\n vUv = u
|
|
|
2676
2676
|
15,
|
|
2677
2677
|
12,
|
|
2678
2678
|
16
|
|
2679
|
-
],
|
|
2679
|
+
], xe = 512, Se = 512, Ce = 128, we = class extends m.Controller {
|
|
2680
2680
|
get config() {
|
|
2681
2681
|
return Object.assign({}, this._config);
|
|
2682
2682
|
}
|
|
@@ -2702,8 +2702,8 @@ var ye = "\nvarying vec2 vUv;\nvarying vec3 vPosition;\nvoid main() {\n vUv = u
|
|
|
2702
2702
|
let e = new i.CylinderGeometry(.12, .12, 1, 32, 1, !0);
|
|
2703
2703
|
e.translate(0, .5, 0);
|
|
2704
2704
|
let t = new i.ShaderMaterial({
|
|
2705
|
-
vertexShader:
|
|
2706
|
-
fragmentShader:
|
|
2705
|
+
vertexShader: ve,
|
|
2706
|
+
fragmentShader: ye,
|
|
2707
2707
|
uniforms: {
|
|
2708
2708
|
map: { value: new i.Texture() },
|
|
2709
2709
|
progress: { value: 0 },
|
|
@@ -2717,21 +2717,21 @@ var ye = "\nvarying vec2 vUv;\nvarying vec3 vPosition;\nvoid main() {\n vUv = u
|
|
|
2717
2717
|
if (!this.ctx) return;
|
|
2718
2718
|
let n = (() => {
|
|
2719
2719
|
var t;
|
|
2720
|
-
return (
|
|
2721
|
-
})(), r = (1 - (t + e * 150) % 1200 / 1200) * (
|
|
2722
|
-
i.addColorStop(0, "rgba(255,255,255,0)"), i.addColorStop(.5, "rgba(255,255,255,1)"), i.addColorStop(1, "rgba(255,255,255,0)"), this.ctx.fillStyle = i, this.ctx.fillRect(n, r -
|
|
2720
|
+
return (xe / 16 | 0) * ((t = be[e]) == null ? 0 : t);
|
|
2721
|
+
})(), r = (1 - (t + e * 150) % 1200 / 1200) * (Se + Ce), i = this.ctx.createLinearGradient(0, r - Ce, 0, r);
|
|
2722
|
+
i.addColorStop(0, "rgba(255,255,255,0)"), i.addColorStop(.5, "rgba(255,255,255,1)"), i.addColorStop(1, "rgba(255,255,255,0)"), this.ctx.fillStyle = i, this.ctx.fillRect(n, r - Ce, 3, Ce);
|
|
2723
2723
|
}, this.anime = (e) => {
|
|
2724
2724
|
if (!this.ctx || !this.startTime) return;
|
|
2725
|
-
this.ctx.clearRect(0, 0,
|
|
2725
|
+
this.ctx.clearRect(0, 0, xe, Se);
|
|
2726
2726
|
for (let t = 0; t < 16; t++) this.drawLine(t, e - this.startTime);
|
|
2727
|
-
let t =
|
|
2727
|
+
let t = _e((e - this.startTime) / 1e3, 0, 1), n = _e((e - this.startTime) / 300, 0, this.config.maxOpacity);
|
|
2728
2728
|
this.panoMesh.setOpacity(n), this.mesh.material.uniforms.progress.value = t, this.mesh.material.uniforms.opacity.value = n, this.mesh.material.uniforms.map.value.needsUpdate = !0, this.five.needsRender = !0;
|
|
2729
2729
|
}, this.dispose = () => {
|
|
2730
2730
|
this.disable();
|
|
2731
2731
|
}, this.five = e, this.state = Object.assign({
|
|
2732
2732
|
enabled: !1,
|
|
2733
2733
|
visible: !0
|
|
2734
|
-
}, t == null ? void 0 : t.initialState), this._config = Object.assign(Object.assign({}, t == null ? void 0 : t.config), { maxOpacity: 1 }), !(typeof document > "u") && (this.canvas = document.createElement("canvas"), this.ctx = this.canvas.getContext("2d"), this.canvas.width =
|
|
2734
|
+
}, t == null ? void 0 : t.initialState), this._config = Object.assign(Object.assign({}, t == null ? void 0 : t.config), { maxOpacity: 1 }), !(typeof document > "u") && (this.canvas = document.createElement("canvas"), this.ctx = this.canvas.getContext("2d"), this.canvas.width = xe, this.canvas.height = Se, this.ctx.shadowColor = "rgba(255,255,255,0.5)", this.ctx.shadowBlur = 6, this.ctx.shadowOffsetX = 0, this.ctx.shadowOffsetY = 0, this.mesh.material.uniforms.map.value = new i.CanvasTexture(this.canvas), this.group.add(this.mesh), this.panoMesh.setProgress(1), this.panoMesh.setOpacity(0), this.group.add(this.panoMesh), this.state.enabled && this._enable({ userAction: !1 }));
|
|
2735
2735
|
}
|
|
2736
2736
|
load(e) {
|
|
2737
2737
|
return v(this, void 0, void 0, function* () {});
|
|
@@ -2765,7 +2765,7 @@ var ye = "\nvarying vec2 vUv;\nvarying vec3 vPosition;\nvoid main() {\n vUv = u
|
|
|
2765
2765
|
e.enabled ? this._enable(t) : this._disable(t);
|
|
2766
2766
|
}
|
|
2767
2767
|
}
|
|
2768
|
-
},
|
|
2768
|
+
}, Te = (e, t) => new we(e, t), Ee = class extends i.InstancedBufferGeometry {
|
|
2769
2769
|
constructor() {
|
|
2770
2770
|
super(), this.type = "LineSegmentsGeometry", this.setIndex([
|
|
2771
2771
|
0,
|
|
@@ -2884,10 +2884,10 @@ var ye = "\nvarying vec2 vUv;\nvarying vec3 vPosition;\nvoid main() {\n vUv = u
|
|
|
2884
2884
|
}
|
|
2885
2885
|
toJSON() {}
|
|
2886
2886
|
};
|
|
2887
|
-
Object.assign(
|
|
2887
|
+
Object.assign(Ee.prototype, { isLineSegmentsGeometry: !0 });
|
|
2888
2888
|
//#endregion
|
|
2889
2889
|
//#region build/plugins/DynamicPathLinePlugin/line2/LineMaterial.js
|
|
2890
|
-
var
|
|
2890
|
+
var De = {
|
|
2891
2891
|
uniforms: i.UniformsUtils.merge([
|
|
2892
2892
|
i.UniformsLib.common,
|
|
2893
2893
|
i.UniformsLib.fog,
|
|
@@ -2911,12 +2911,12 @@ var Oe = {
|
|
|
2911
2911
|
]),
|
|
2912
2912
|
vertexShader: "\n #include <common>\n #include <color_pars_vertex>\n #include <fog_pars_vertex>\n #include <logdepthbuf_pars_vertex>\n #include <clipping_planes_pars_vertex>\n\n uniform float linewidth;\n uniform vec2 resolution;\n uniform float totalLength;\n uniform float time;\n uniform float waveAmp;\n uniform float waveFreq;\n uniform float waveDir;\n uniform float startOffset;\n uniform float endOffset; // 新增\n\n attribute vec3 instanceStart;\n attribute vec3 instanceEnd;\n attribute float distanceProgress;\n attribute vec3 instanceColorStart;\n attribute vec3 instanceColorEnd;\n attribute float instanceDistanceStart;\n attribute float instanceDistanceEnd;\n\n varying vec2 vUv;\n varying float vDistanceProgress;\n\n #ifdef USE_DASH\n uniform float dashScale;\n varying float vLineDistance;\n #endif\n\n void trimSegment(const in vec4 start, inout vec4 end) {\n float a = projectionMatrix[2][2];\n float b = projectionMatrix[3][2];\n float nearEstimate = -0.5 * b / a;\n float alpha = (nearEstimate - start.z) / (end.z - start.z);\n end.xyz = mix(start.xyz, end.xyz, alpha);\n }\n\n void main() {\n #ifdef USE_COLOR\n vColor.xyz = (position.y < 0.5) ? instanceColorStart : instanceColorEnd;\n #endif\n\n #ifdef USE_DASH\n vLineDistance = (position.y < 0.5) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n #endif\n\n float aspect = resolution.x / resolution.y;\n vUv = uv;\n\n // camera space\n vec4 start = modelViewMatrix * vec4(instanceStart, 1.0);\n vec4 end = modelViewMatrix * vec4(instanceEnd, 1.0);\n\n // ===== 波浪偏移逻辑 =====\n if (waveDir > 0.5) { // 0 表示不波动\n float adjustedDistanceStart = max(0.0, instanceDistanceStart - startOffset);\n float adjustedDistanceEnd = max(0.0, instanceDistanceEnd - startOffset);\n float adjustedTotalLength = totalLength - startOffset - endOffset;\n adjustedTotalLength = max(0.01, adjustedTotalLength);\n float phaseStart = adjustedDistanceStart / adjustedTotalLength;\n float phaseEnd = adjustedDistanceEnd / adjustedTotalLength;\n float waveStart = sin(phaseStart * waveFreq - time * 2.0) * waveAmp;\n float waveEnd = sin(phaseEnd * waveFreq - time * 2.0) * waveAmp;\n\n if (abs(waveDir - 1.0) < 0.1) { // X 方向\n start.x += waveStart;\n end.x += waveEnd;\n } else if (abs(waveDir - 2.0) < 0.1) { // Y 方向\n start.y += waveStart;\n end.y += waveEnd;\n } else if (abs(waveDir - 3.0) < 0.1) { // Z 方向\n start.z += waveStart;\n end.z += waveEnd;\n }\n }\n // ======================\n\n bool perspective = (projectionMatrix[2][3] == -1.0);\n if (perspective) {\n if (start.z < 0.0 && end.z >= 0.0) {\n trimSegment(start, end);\n } else if (end.z < 0.0 && start.z >= 0.0) {\n trimSegment(end, start);\n }\n }\n\n vec4 clipStart = projectionMatrix * start;\n vec4 clipEnd = projectionMatrix * end;\n\n vec2 ndcStart = clipStart.xy / clipStart.w;\n vec2 ndcEnd = clipEnd.xy / clipEnd.w;\n\n vec2 dir = ndcEnd - ndcStart;\n dir.x *= aspect;\n dir = normalize(dir);\n\n vec2 offset = vec2(dir.y, -dir.x);\n dir.x /= aspect;\n offset.x /= aspect;\n\n if (position.x < 0.0) offset *= -1.0;\n if (position.y < 0.0) {\n offset += -dir;\n } else if (position.y > 1.0) {\n offset += dir;\n }\n\n offset *= linewidth;\n offset /= resolution.y;\n\n vec4 clip = (position.y < 0.5) ? clipStart : clipEnd;\n offset *= clip.w;\n clip.xy += offset;\n \n gl_Position = clip;\n\n float adjustedDistanceEnd = max(0.0, instanceDistanceEnd - startOffset);\n float adjustedTotalLength = totalLength - startOffset - endOffset;\n adjustedTotalLength = max(0.01, adjustedTotalLength);\n vDistanceProgress = adjustedDistanceEnd / adjustedTotalLength;\n\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <fog_vertex>\n }\n ",
|
|
2913
2913
|
fragmentShader: "\n uniform vec3 diffuse;\n uniform float opacity;\n uniform float animationProgress;\n uniform float range;\n uniform float totalLength;\n varying float vDistanceProgress;\n\n #ifdef USE_DASH\n uniform float dashSize;\n uniform float gapSize;\n #endif\n\n varying float vLineDistance;\n #include <common>\n #include <color_pars_fragment>\n #include <fog_pars_fragment>\n #include <logdepthbuf_pars_fragment>\n #include <clipping_planes_pars_fragment>\n varying vec2 vUv;\n\n void main() {\n #include <clipping_planes_fragment>\n\n #ifdef USE_DASH\n if (vUv.y < -1.0 || vUv.y > 1.0) discard;\n if (mod(vLineDistance, dashSize + gapSize) > dashSize) discard;\n #endif\n\n if (abs(vUv.y) > 1.0) {\n float a = vUv.x;\n float b = (vUv.y > 0.0) ? vUv.y - 1.0 : vUv.y + 1.0;\n float len2 = a * a + b * b;\n if (len2 > 1.0) discard;\n }\n\n vec4 diffuseColor = vec4(diffuse, 1.0);\n #include <logdepthbuf_fragment>\n #include <color_fragment>\n\n gl_FragColor = vec4(diffuseColor.rgb, diffuseColor.a);\n\n float alpha = 0.0;\n float diff = (1.0 - 2.0 * range) * vDistanceProgress + range - animationProgress;\n // 使用绝对值计算,在animationProgress前后range范围内过渡\n if (abs(diff) < range) {\n alpha = 1.0 - abs(diff) / range;\n } else {\n alpha = 0.0;\n }\n\n alpha = clamp(alpha, 0.0, 1.0);\n gl_FragColor.a = alpha;\n\n // 增加开头和结尾的渐变alpha遮罩,固定物理距离为 1 米\n float startFadeLength = 1.0 / totalLength;\n if (vDistanceProgress < startFadeLength) {\n gl_FragColor.a *= vDistanceProgress / startFadeLength;\n }\n float endFadeStart = 1.0 - startFadeLength;\n if (vDistanceProgress > endFadeStart) {\n gl_FragColor.a *= (1.0 - vDistanceProgress) / startFadeLength;\n }\n gl_FragColor.a *= opacity;\n #include <tonemapping_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n }\n "
|
|
2914
|
-
},
|
|
2914
|
+
}, Oe = class extends i.ShaderMaterial {
|
|
2915
2915
|
constructor(e) {
|
|
2916
2916
|
super({
|
|
2917
|
-
uniforms: i.UniformsUtils.clone(
|
|
2918
|
-
vertexShader:
|
|
2919
|
-
fragmentShader:
|
|
2917
|
+
uniforms: i.UniformsUtils.clone(De.uniforms),
|
|
2918
|
+
vertexShader: De.vertexShader,
|
|
2919
|
+
fragmentShader: De.fragmentShader,
|
|
2920
2920
|
clipping: !0
|
|
2921
2921
|
}), this.type = "LineMaterial", this.dashed = !1, Object.defineProperties(this, {
|
|
2922
2922
|
color: {
|
|
@@ -3057,12 +3057,12 @@ var Oe = {
|
|
|
3057
3057
|
}), this.setValues(e);
|
|
3058
3058
|
}
|
|
3059
3059
|
};
|
|
3060
|
-
Object.assign(
|
|
3060
|
+
Object.assign(Oe.prototype, { isLineMaterial: !0 });
|
|
3061
3061
|
//#endregion
|
|
3062
3062
|
//#region build/plugins/DynamicPathLinePlugin/line2/LineSegments2.js
|
|
3063
|
-
var
|
|
3063
|
+
var ke = class extends i.Mesh {
|
|
3064
3064
|
constructor(e, t) {
|
|
3065
|
-
super(), this.type = "LineSegments2", this.geometry = e === void 0 ? new
|
|
3065
|
+
super(), this.type = "LineSegments2", this.geometry = e === void 0 ? new Ee() : e, this.material = t === void 0 ? new Oe({ color: Math.random() * 16777215 }) : t;
|
|
3066
3066
|
}
|
|
3067
3067
|
computeLineDistances() {
|
|
3068
3068
|
let e = this.geometry, t = e.attributes.instanceStart, n = e.attributes.instanceEnd, r = new Float32Array(2 * t.count), a = new i.Vector3(), o = new i.Vector3(), s = 0;
|
|
@@ -3105,18 +3105,18 @@ var Ae = class extends i.Mesh {
|
|
|
3105
3105
|
}
|
|
3106
3106
|
}
|
|
3107
3107
|
};
|
|
3108
|
-
Object.assign(
|
|
3108
|
+
Object.assign(ke.prototype, { isLineSegments2: !0 });
|
|
3109
3109
|
//#endregion
|
|
3110
3110
|
//#region build/plugins/DynamicPathLinePlugin/line2/Line2.js
|
|
3111
|
-
var
|
|
3111
|
+
var Ae = class extends ke {
|
|
3112
3112
|
constructor(e, t) {
|
|
3113
3113
|
super(e, t), this.type = "Line2";
|
|
3114
3114
|
}
|
|
3115
3115
|
};
|
|
3116
|
-
Object.assign(
|
|
3116
|
+
Object.assign(Ae.prototype, { isLine2: !0 });
|
|
3117
3117
|
//#endregion
|
|
3118
3118
|
//#region build/plugins/DynamicPathLinePlugin/line2/LineGeometry.js
|
|
3119
|
-
var
|
|
3119
|
+
var je = class extends Ee {
|
|
3120
3120
|
constructor() {
|
|
3121
3121
|
super(), this.type = "LineGeometry";
|
|
3122
3122
|
}
|
|
@@ -3142,10 +3142,10 @@ var Me = class extends De {
|
|
|
3142
3142
|
return this;
|
|
3143
3143
|
}
|
|
3144
3144
|
};
|
|
3145
|
-
Object.assign(
|
|
3145
|
+
Object.assign(je.prototype, { isLineGeometry: !0 });
|
|
3146
3146
|
//#endregion
|
|
3147
3147
|
//#region build/plugins/DynamicPathLinePlugin/Controller.js
|
|
3148
|
-
var
|
|
3148
|
+
var Me = class extends m.Controller {
|
|
3149
3149
|
get config() {
|
|
3150
3150
|
return Object.assign({}, this._config);
|
|
3151
3151
|
}
|
|
@@ -3319,9 +3319,9 @@ var Ne = class extends m.Controller {
|
|
|
3319
3319
|
let r = (n - (c - 1) / 2) * l, a = e.points.map((a, o) => {
|
|
3320
3320
|
let s = o / (e.points.length - 1), c = t.getTangent(s).normalize(), l = new i.Vector3().crossVectors(this.up, c).normalize(), u = r * Math.abs((o - e.points.length / 2) / e.points.length - .5) * -1;
|
|
3321
3321
|
return a.clone().addScaledVector(l, r + u).add(new i.Vector3(0, f + .02 * (n % 2 == 0 ? 1 : 0), 0));
|
|
3322
|
-
}), g = new i.CatmullRomCurve3(a), { positions: _ } = this.getPositions(g, s), v = new
|
|
3322
|
+
}), g = new i.CatmullRomCurve3(a), { positions: _ } = this.getPositions(g, s), v = new je();
|
|
3323
3323
|
v.setPositions(_);
|
|
3324
|
-
let y = new
|
|
3324
|
+
let y = new Oe({
|
|
3325
3325
|
color: m,
|
|
3326
3326
|
linewidth: p * (n % 2 == 0 ? 1 : .5),
|
|
3327
3327
|
transparent: !0,
|
|
@@ -3333,7 +3333,7 @@ var Ne = class extends m.Controller {
|
|
|
3333
3333
|
startOffset: { value: 0 },
|
|
3334
3334
|
range: { value: h }
|
|
3335
3335
|
});
|
|
3336
|
-
let b = new
|
|
3336
|
+
let b = new Ae(v, y);
|
|
3337
3337
|
b.computeLineDistances(), o.push(b), this.five.scene.add(b);
|
|
3338
3338
|
}
|
|
3339
3339
|
return o;
|
|
@@ -3649,14 +3649,14 @@ var Ne = class extends m.Controller {
|
|
|
3649
3649
|
dispose() {
|
|
3650
3650
|
this.pause(), this.clearAllPaths(), this.hooks.emit("dispose");
|
|
3651
3651
|
}
|
|
3652
|
-
},
|
|
3652
|
+
}, Ne = (e, t) => new Me(e, t), Pe = "#five-CSS3DPlugin {\n position: absolute;\n pointer-events: none;\n user-select: none;\n transform-origin: left top;\n}\n\n.five-CSS3DPlugin-X {\n --timeout: 300ms;\n transition: opacity ease-in-out var(--timeout);\n}\n\n.five-CSS3DPlugin-hidden {\n opacity: 0;\n}\n\n#five-CSS3DPlugin .five-CSS3DPlugin-hidden * {\n pointer-events: none;\n}";
|
|
3653
3653
|
//#endregion
|
|
3654
3654
|
//#region build/plugins/utils/uuid.js
|
|
3655
|
-
function
|
|
3655
|
+
function Fe() {
|
|
3656
3656
|
return ((1 + Math.random()) * parseInt("10000", 36) | 0).toString(36).substring(1);
|
|
3657
3657
|
}
|
|
3658
|
-
function
|
|
3659
|
-
let e =
|
|
3658
|
+
function Ie() {
|
|
3659
|
+
let e = Fe() + Fe().substr(0, 2) + Date.now().toString(36), t = e.length, n = "", r = Math.floor(Math.random() * Math.pow(2, t));
|
|
3660
3660
|
for (let i = 0; i < t; i++) {
|
|
3661
3661
|
let t = e[i];
|
|
3662
3662
|
t >= "a" && t <= "z" && r >> i & 1 && (t = t.toUpperCase()), n += t;
|
|
@@ -3665,7 +3665,7 @@ function Le() {
|
|
|
3665
3665
|
}
|
|
3666
3666
|
//#endregion
|
|
3667
3667
|
//#region build/plugins/CSS3DPlugin/Controller.js
|
|
3668
|
-
var
|
|
3668
|
+
var Le = class extends _.Controller {
|
|
3669
3669
|
updateState(e, t) {
|
|
3670
3670
|
let n = this.state;
|
|
3671
3671
|
this.state = Object.assign(Object.assign({}, this.state), e), this.hooks.emit("stateChange", {
|
|
@@ -3675,7 +3675,7 @@ var Re = class extends _.Controller {
|
|
|
3675
3675
|
});
|
|
3676
3676
|
}
|
|
3677
3677
|
constructor(e, t) {
|
|
3678
|
-
super(e), this.scene = new i.Scene(), this.styleSheet = new CSSStyleSheet(), this.camera = new i.PerspectiveCamera(), this.cacheMap = /* @__PURE__ */ new WeakMap(), this.createCSS3DObject = ({ id: e =
|
|
3678
|
+
super(e), this.scene = new i.Scene(), this.styleSheet = new CSSStyleSheet(), this.camera = new i.PerspectiveCamera(), this.cacheMap = /* @__PURE__ */ new WeakMap(), this.createCSS3DObject = ({ id: e = Ie(), name: t, innerHTML: n, sprite: r, normal: a, position: o, scalar: s = .00216, visible: c = !0, timeout: l }) => {
|
|
3679
3679
|
let u = document.createElement("div");
|
|
3680
3680
|
u.className = "five-CSS3DPlugin-X", c || u.classList.add("five-CSS3DPlugin-hidden"), l && u.style.setProperty("--timeout", l + "ms"), u.innerHTML = n;
|
|
3681
3681
|
let d = r ? new M(u) : new le(u);
|
|
@@ -3701,7 +3701,7 @@ var Re = class extends _.Controller {
|
|
|
3701
3701
|
}
|
|
3702
3702
|
return o && d.position.copy(o), s && d.scale.setScalar(s), t && (d.name = t), d;
|
|
3703
3703
|
}, this.render = () => {
|
|
3704
|
-
this.camera.fov = this.five.camera.fov, this.camera.position.copy(this.five.camera.position), this.camera.rotation.copy(this.five.camera.rotation), this.camera.updateProjectionMatrix(), this.renderer.render(this.scene, this.camera);
|
|
3704
|
+
this.camera.fov = this.five.camera.fov, this.camera.aspect = this.five.camera.aspect, this.camera.position.copy(this.five.camera.position), this.camera.rotation.copy(this.five.camera.rotation), this.camera.updateProjectionMatrix(), this.renderer.render(this.scene, this.camera);
|
|
3705
3705
|
}, this.forceRender = () => {
|
|
3706
3706
|
this.renderer.markDirty(), this.render();
|
|
3707
3707
|
}, this._addEventListener = () => {
|
|
@@ -3711,7 +3711,7 @@ var Re = class extends _.Controller {
|
|
|
3711
3711
|
this.five.off("render.prepare", this.render), (e = this.resizeObserver) == null || e.disconnect(), this.resizeObserver = void 0;
|
|
3712
3712
|
}, this.dispose = () => {
|
|
3713
3713
|
this.removeAll(), this._disable({ userAction: !1 });
|
|
3714
|
-
}, this.five = e, this.renderer = new F(), this.renderer.domElement.id = "five-CSS3DPlugin", this.styleSheet.replaceSync(
|
|
3714
|
+
}, this.five = e, this.renderer = new F(), this.renderer.domElement.id = "five-CSS3DPlugin", this.styleSheet.replaceSync(Pe), /Chrome/.test(navigator.userAgent) && !/Edge|Edg|OPR/.test(navigator.userAgent) && this.styleSheet.insertRule("#five-CSS3DPlugin * { transform-style: preserve-3d; }"), document && document.adoptedStyleSheets.push(this.styleSheet), this.state = Object.assign({
|
|
3715
3715
|
enabled: !0,
|
|
3716
3716
|
visible: !0
|
|
3717
3717
|
}, t == null ? void 0 : t.initialState), this.state.enabled ? this._enable({ userAction: !1 }) : this.styleSheet.disabled = !0;
|
|
@@ -3777,10 +3777,174 @@ var Re = class extends _.Controller {
|
|
|
3777
3777
|
hide(e) {
|
|
3778
3778
|
this.renderer.domElement.style.display = "none", this.updateState({ visible: !1 }, !0);
|
|
3779
3779
|
}
|
|
3780
|
-
},
|
|
3780
|
+
}, Re = (e, t) => new Le(e, t), ze = class extends c {
|
|
3781
|
+
constructor(e = document.createElement("div")) {
|
|
3782
|
+
super(), this.isCSS2DObject = !0, this.element = e, this.element.style.position = "absolute", this.element.style.userSelect = "none", this.element.setAttribute("draggable", !1), this.center = new f(.5, .5), this.addEventListener("removed", function() {
|
|
3783
|
+
this.traverse(function(e) {
|
|
3784
|
+
e.element && e.element instanceof Element && e.element.parentNode !== null && e.element.remove();
|
|
3785
|
+
});
|
|
3786
|
+
});
|
|
3787
|
+
}
|
|
3788
|
+
copy(e, t) {
|
|
3789
|
+
return super.copy(e, t), this.element = e.element.cloneNode(!0), this.center = e.center.clone(), this;
|
|
3790
|
+
}
|
|
3791
|
+
}, Be = new p(), Ve = new s(), He = new s(), Ue = new p(), We = new p(), Ge = class {
|
|
3792
|
+
constructor(e = {}) {
|
|
3793
|
+
let t = this, n, r, i, a, o = { objects: /* @__PURE__ */ new WeakMap() }, s = e.element === void 0 ? document.createElement("div") : e.element;
|
|
3794
|
+
s.style.overflow = "hidden", this.domElement = s, this.sortObjects = !0, this.getSize = function() {
|
|
3795
|
+
return {
|
|
3796
|
+
width: n,
|
|
3797
|
+
height: r
|
|
3798
|
+
};
|
|
3799
|
+
}, this.render = function(e, n) {
|
|
3800
|
+
e.autoUpdate === !0 && e.updateMatrixWorld(), n.parent === null && n.updateMatrixWorld(), Ve.copy(n.matrixWorldInverse), He.multiplyMatrices(n.projectionMatrix, Ve), l(e, e, n), t.sortObjects && f(e);
|
|
3801
|
+
}, this.setSize = function(e, t) {
|
|
3802
|
+
n = e, r = t, i = n / 2, a = r / 2, s.style.width = e + "px", s.style.height = t + "px";
|
|
3803
|
+
};
|
|
3804
|
+
function c(e) {
|
|
3805
|
+
e.isCSS2DObject && (e.element.style.display = "none");
|
|
3806
|
+
for (let t = 0, n = e.children.length; t < n; t++) c(e.children[t]);
|
|
3807
|
+
}
|
|
3808
|
+
function l(e, n, r) {
|
|
3809
|
+
if (e.visible === !1) {
|
|
3810
|
+
c(e);
|
|
3811
|
+
return;
|
|
3812
|
+
}
|
|
3813
|
+
if (e.isCSS2DObject) {
|
|
3814
|
+
Be.setFromMatrixPosition(e.matrixWorld), Be.applyMatrix4(He);
|
|
3815
|
+
let c = Be.z >= -1 && Be.z <= 1 && e.layers.test(r.layers) === !0, l = e.element;
|
|
3816
|
+
l.style.display = c === !0 ? "" : "none", c === !0 && (e.onBeforeRender(t, n, r), l.style.transform = "translate(" + -100 * e.center.x + "%," + -100 * e.center.y + "%)translate(" + (Be.x * i + i) + "px," + (-Be.y * a + a) + "px)", l.parentNode !== s && s.appendChild(l), e.onAfterRender(t, n, r));
|
|
3817
|
+
let d = { distanceToCameraSquared: u(r, e) };
|
|
3818
|
+
o.objects.set(e, d);
|
|
3819
|
+
}
|
|
3820
|
+
for (let t = 0, i = e.children.length; t < i; t++) l(e.children[t], n, r);
|
|
3821
|
+
}
|
|
3822
|
+
function u(e, t) {
|
|
3823
|
+
return Ue.setFromMatrixPosition(e.matrixWorld), We.setFromMatrixPosition(t.matrixWorld), Ue.distanceToSquared(We);
|
|
3824
|
+
}
|
|
3825
|
+
function d(e) {
|
|
3826
|
+
let t = [];
|
|
3827
|
+
return e.traverseVisible(function(e) {
|
|
3828
|
+
e.isCSS2DObject && t.push(e);
|
|
3829
|
+
}), t;
|
|
3830
|
+
}
|
|
3831
|
+
function f(e) {
|
|
3832
|
+
let t = d(e).sort(function(e, t) {
|
|
3833
|
+
return e.renderOrder === t.renderOrder ? o.objects.get(e).distanceToCameraSquared - o.objects.get(t).distanceToCameraSquared : t.renderOrder - e.renderOrder;
|
|
3834
|
+
}), n = t.length;
|
|
3835
|
+
for (let e = 0, r = t.length; e < r; e++) t[e].element.style.zIndex = n - e;
|
|
3836
|
+
}
|
|
3837
|
+
}
|
|
3838
|
+
}, Ke = "#five-CSS2DPlugin {\n position: absolute;\n pointer-events: none;\n user-select: none;\n top: 0;\n left: 0;\n}\n\n.five-CSS2DPlugin-X {\n --timeout: 300ms;\n transition: opacity ease-in-out var(--timeout);\n}\n\n.five-CSS2DPlugin-hidden {\n opacity: 0;\n}\n\n#five-CSS2DPlugin .five-CSS2DPlugin-hidden * {\n pointer-events: none;\n}\n", qe = class extends _.Controller {
|
|
3839
|
+
updateState(e, t) {
|
|
3840
|
+
let n = this.state;
|
|
3841
|
+
this.state = Object.assign(Object.assign({}, this.state), e), this.hooks.emit("stateChange", {
|
|
3842
|
+
state: this.state,
|
|
3843
|
+
prevState: n,
|
|
3844
|
+
userAction: t
|
|
3845
|
+
});
|
|
3846
|
+
}
|
|
3847
|
+
constructor(e, t) {
|
|
3848
|
+
super(e), this.scene = new i.Scene(), this.styleSheet = new CSSStyleSheet(), this.camera = new i.PerspectiveCamera(), this.createCSS2DObject = ({ id: e = Ie(), name: t, innerHTML: n, center: r, position: i, visible: a = !0, timeout: o }) => {
|
|
3849
|
+
let s = document.createElement("div");
|
|
3850
|
+
s.className = "five-CSS2DPlugin-X", a || s.classList.add("five-CSS2DPlugin-hidden"), o && s.style.setProperty("--timeout", o + "ms"), s.innerHTML = n;
|
|
3851
|
+
let c = new ze(s);
|
|
3852
|
+
return c.userData = {
|
|
3853
|
+
id: e,
|
|
3854
|
+
_visible: a,
|
|
3855
|
+
_timeout: o,
|
|
3856
|
+
get visible() {
|
|
3857
|
+
return this._visible;
|
|
3858
|
+
},
|
|
3859
|
+
set visible(e) {
|
|
3860
|
+
e ? s.classList.remove("five-CSS2DPlugin-hidden") : s.classList.add("five-CSS2DPlugin-hidden"), this._visible = e;
|
|
3861
|
+
},
|
|
3862
|
+
get timeout() {
|
|
3863
|
+
return this._timeout;
|
|
3864
|
+
},
|
|
3865
|
+
set timeout(e) {
|
|
3866
|
+
s.style.setProperty("--timeout", e + "ms"), this._timeout = e;
|
|
3867
|
+
}
|
|
3868
|
+
}, r && c.center.copy(r), i && c.position.copy(i), t && (c.name = t), c;
|
|
3869
|
+
}, this.render = () => {
|
|
3870
|
+
this.camera.fov = this.five.camera.fov, this.camera.aspect = this.five.camera.aspect, this.camera.position.copy(this.five.camera.position), this.camera.rotation.copy(this.five.camera.rotation), this.camera.updateProjectionMatrix(), this.renderer.render(this.scene, this.camera);
|
|
3871
|
+
}, this._addEventListener = () => {
|
|
3872
|
+
this.five.on("render.prepare", this.render), this.appendToFiveContainer();
|
|
3873
|
+
}, this._removeEventListener = () => {
|
|
3874
|
+
var e;
|
|
3875
|
+
this.five.off("render.prepare", this.render), (e = this.resizeObserver) == null || e.disconnect(), this.resizeObserver = void 0;
|
|
3876
|
+
}, this.dispose = () => {
|
|
3877
|
+
this.removeAll(), this._disable({ userAction: !1 });
|
|
3878
|
+
}, this.five = e, this.renderer = new Ge(), this.renderer.domElement.id = "five-CSS2DPlugin", this.styleSheet.replaceSync(Ke), document && document.adoptedStyleSheets.push(this.styleSheet), this.state = Object.assign({
|
|
3879
|
+
enabled: !0,
|
|
3880
|
+
visible: !0
|
|
3881
|
+
}, t == null ? void 0 : t.initialState), this.state.enabled ? this._enable({ userAction: !1 }) : this.styleSheet.disabled = !0;
|
|
3882
|
+
}
|
|
3883
|
+
load(e) {
|
|
3884
|
+
return v(this, void 0, void 0, function* () {});
|
|
3885
|
+
}
|
|
3886
|
+
appendToFiveContainer() {
|
|
3887
|
+
var e;
|
|
3888
|
+
if (!this.five.renderer) return;
|
|
3889
|
+
let t = this.five.getElement();
|
|
3890
|
+
if (!(t != null && t.parentElement)) return;
|
|
3891
|
+
let { x: n, y: r } = this.five.renderer.getSize(new i.Vector2());
|
|
3892
|
+
t.parentElement.appendChild(this.renderer.domElement), this.renderer.setSize(n, r), (e = this.resizeObserver) == null || e.disconnect(), this.resizeObserver = new ResizeObserver(() => {
|
|
3893
|
+
var e;
|
|
3894
|
+
if (!this.five.renderer) return;
|
|
3895
|
+
let t = (e = this.five.getElement()) == null ? void 0 : e.getBoundingClientRect();
|
|
3896
|
+
if (!t) return;
|
|
3897
|
+
let { x: n, y: r, width: i, height: a } = t;
|
|
3898
|
+
this.renderer.setSize(i, a), this.renderer.domElement.style.left = n + "px", this.renderer.domElement.style.top = r + "px", this.render();
|
|
3899
|
+
}), this.resizeObserver.observe(t);
|
|
3900
|
+
}
|
|
3901
|
+
add(...e) {
|
|
3902
|
+
this.scene.add(...e), this.render();
|
|
3903
|
+
}
|
|
3904
|
+
remove(e) {
|
|
3905
|
+
this.scene.remove(e), e.traverse((e) => {
|
|
3906
|
+
e instanceof ze && e.element.remove();
|
|
3907
|
+
}), this.render();
|
|
3908
|
+
}
|
|
3909
|
+
removeAll() {
|
|
3910
|
+
this.scene.remove(...this.scene.children), this.render();
|
|
3911
|
+
}
|
|
3912
|
+
fadeInObjects(...e) {
|
|
3913
|
+
for (let t of e) t.userData.visible = !0;
|
|
3914
|
+
this.render();
|
|
3915
|
+
}
|
|
3916
|
+
fadeOutObjects(...e) {
|
|
3917
|
+
for (let t of e) t.userData.visible = !1;
|
|
3918
|
+
this.render();
|
|
3919
|
+
}
|
|
3920
|
+
_enable(e) {
|
|
3921
|
+
this.styleSheet.disabled = !1, this.updateState({ enabled: !0 }, e.userAction), this._addEventListener(), this.render();
|
|
3922
|
+
}
|
|
3923
|
+
_disable(e) {
|
|
3924
|
+
this.styleSheet.disabled = !0, this.updateState({ enabled: !1 }, e.userAction), this._removeEventListener();
|
|
3925
|
+
}
|
|
3926
|
+
enable(e) {
|
|
3927
|
+
var t;
|
|
3928
|
+
if (this.state.enabled) return;
|
|
3929
|
+
let n = (t = e == null ? void 0 : e.userAction) == null ? !0 : t;
|
|
3930
|
+
this._enable({ userAction: n });
|
|
3931
|
+
}
|
|
3932
|
+
disable(e) {
|
|
3933
|
+
var t;
|
|
3934
|
+
if (this.state.enabled === !1) return;
|
|
3935
|
+
let n = (t = e == null ? void 0 : e.userAction) == null ? !0 : t;
|
|
3936
|
+
this._disable({ userAction: n });
|
|
3937
|
+
}
|
|
3938
|
+
show(e) {
|
|
3939
|
+
this.renderer.domElement.style.display = "block", this.updateState({ visible: !0 }, !0), this.render();
|
|
3940
|
+
}
|
|
3941
|
+
hide(e) {
|
|
3942
|
+
this.renderer.domElement.style.display = "none", this.updateState({ visible: !1 }, !0);
|
|
3943
|
+
}
|
|
3944
|
+
}, Je = (e, t) => new qe(e, t);
|
|
3781
3945
|
//#endregion
|
|
3782
3946
|
//#region build/plugins/Object3DHelperPlugin/utils/setObjectQuaternion.js
|
|
3783
|
-
function
|
|
3947
|
+
function Ye(e, t, n) {
|
|
3784
3948
|
if (n) {
|
|
3785
3949
|
let r = new i.Vector3().subVectors(e.position, n).applyQuaternion(e.quaternion.clone().inverse()).applyQuaternion(t).add(n);
|
|
3786
3950
|
e.position.copy(r);
|
|
@@ -3789,12 +3953,12 @@ function Be(e, t, n) {
|
|
|
3789
3953
|
}
|
|
3790
3954
|
//#endregion
|
|
3791
3955
|
//#region build/five/utils/isNil.js
|
|
3792
|
-
function
|
|
3956
|
+
function Xe(e) {
|
|
3793
3957
|
return e == null;
|
|
3794
3958
|
}
|
|
3795
3959
|
//#endregion
|
|
3796
3960
|
//#region build/plugins/Object3DHelperPlugin/Helper/BaseHelper.js
|
|
3797
|
-
var
|
|
3961
|
+
var Ze = class extends i.Object3D {
|
|
3798
3962
|
removeChildren() {
|
|
3799
3963
|
for (; this.children.length > 0;) this.remove(this.children[0]);
|
|
3800
3964
|
return this;
|
|
@@ -3865,7 +4029,7 @@ var He = class extends i.Object3D {
|
|
|
3865
4029
|
a,
|
|
3866
4030
|
o,
|
|
3867
4031
|
s
|
|
3868
|
-
].filter((e) => !
|
|
4032
|
+
].filter((e) => !Xe(e)).length >= 2) {
|
|
3869
4033
|
a || (a = new i.Vector3().crossVectors(o, s).normalize()), o || (o = new i.Vector3().crossVectors(a, s).normalize()), s || (s = new i.Vector3().crossVectors(a, o).normalize()), a.applyQuaternion(this.quaternion), o.applyQuaternion(this.quaternion), s.applyQuaternion(this.quaternion);
|
|
3870
4034
|
let e = new i.Matrix4().makeBasis(a, o, s), t = new i.Quaternion().setFromRotationMatrix(e);
|
|
3871
4035
|
this.quaternion.copy(t);
|
|
@@ -3876,7 +4040,7 @@ var He = class extends i.Object3D {
|
|
|
3876
4040
|
this.scale.applyMatrix4(e);
|
|
3877
4041
|
}
|
|
3878
4042
|
setHelperQuaternion(e, t) {
|
|
3879
|
-
this.initQuaternion(), t ?
|
|
4043
|
+
this.initQuaternion(), t ? Ye(this, this.quaternion.clone().premultiply(e), t) : this.quaternion.premultiply(e);
|
|
3880
4044
|
}
|
|
3881
4045
|
applyHelperQuaternion(e, t) {
|
|
3882
4046
|
if (t) {
|
|
@@ -3888,31 +4052,31 @@ var He = class extends i.Object3D {
|
|
|
3888
4052
|
dispose() {
|
|
3889
4053
|
this.removeFromParent();
|
|
3890
4054
|
}
|
|
3891
|
-
},
|
|
4055
|
+
}, Qe = class extends Ze {}, $e = class extends Ze {}, et = class extends Ze {}, W = class extends i.Group {
|
|
3892
4056
|
constructor(e) {
|
|
3893
4057
|
super(), this.direction = e || "x";
|
|
3894
4058
|
}
|
|
3895
4059
|
};
|
|
3896
4060
|
i.Line;
|
|
3897
|
-
var
|
|
4061
|
+
var tt = class extends i.Mesh {
|
|
3898
4062
|
constructor(e, t, n) {
|
|
3899
4063
|
super(e, t), this.direction = n || "x";
|
|
3900
4064
|
}
|
|
3901
|
-
},
|
|
4065
|
+
}, nt = {
|
|
3902
4066
|
X: 16730698,
|
|
3903
4067
|
Y: 54927,
|
|
3904
4068
|
Z: 3368703
|
|
3905
|
-
},
|
|
4069
|
+
}, G = class {
|
|
3906
4070
|
static get X() {
|
|
3907
|
-
return new i.Color(
|
|
4071
|
+
return new i.Color(nt.X).convertSRGBToLinear().clone();
|
|
3908
4072
|
}
|
|
3909
4073
|
static get Y() {
|
|
3910
|
-
return new i.Color(
|
|
4074
|
+
return new i.Color(nt.Y).convertSRGBToLinear().clone();
|
|
3911
4075
|
}
|
|
3912
4076
|
static get Z() {
|
|
3913
|
-
return new i.Color(
|
|
4077
|
+
return new i.Color(nt.Z).convertSRGBToLinear().clone();
|
|
3914
4078
|
}
|
|
3915
|
-
},
|
|
4079
|
+
}, K = {
|
|
3916
4080
|
ROTATE_HELPER: 9992,
|
|
3917
4081
|
MOVE_HELPER: 9993,
|
|
3918
4082
|
SCALE_HELPER_LINE: 9994,
|
|
@@ -3921,7 +4085,7 @@ var qe = class extends i.Mesh {
|
|
|
3921
4085
|
MOVE_HELPER_CENTER: 10002,
|
|
3922
4086
|
DRAG_GUIDE_LINE: 10003,
|
|
3923
4087
|
DRAG_FACE_PATCH: 10004
|
|
3924
|
-
},
|
|
4088
|
+
}, rt = class extends W {
|
|
3925
4089
|
constructor(e) {
|
|
3926
4090
|
var t;
|
|
3927
4091
|
super(e.direction), this.lineHeight = .5, this.arrowHeight = .1, this.name = "ArrowGroup";
|
|
@@ -3932,15 +4096,15 @@ var qe = class extends i.Mesh {
|
|
|
3932
4096
|
depthTest: !1,
|
|
3933
4097
|
depthWrite: !1
|
|
3934
4098
|
});
|
|
3935
|
-
this.arrow = new
|
|
4099
|
+
this.arrow = new tt(new i.ConeGeometry(.04, this.arrowHeight, 32), r(), e.direction), this.arrow.name = `arrow-${e.direction}`, this.arrow.renderOrder = K.MOVE_HELPER_ARROW, this.arrowNeg = new tt(new i.ConeGeometry(.04, this.arrowHeight, 32), r(), e.direction), this.arrowNeg.name = `arrow-neg-${e.direction}`, this.arrowNeg.renderOrder = K.MOVE_HELPER_ARROW;
|
|
3936
4100
|
let a = .004;
|
|
3937
|
-
this.line = new
|
|
4101
|
+
this.line = new tt(new i.CylinderGeometry(a, a, this.lineHeight, 32), r(), e.direction), this.line.name = `line-${e.direction}`, this.line.renderOrder = K.MOVE_HELPER_ARROW, this.formatGeometries(), this.add(this.arrow, this.arrowNeg, this.line);
|
|
3938
4102
|
}
|
|
3939
4103
|
formatGeometries() {
|
|
3940
4104
|
let e = this.lineHeight, t = this.arrowHeight;
|
|
3941
4105
|
this.arrow.geometry.translate(0, e + t / 2, 0), this.arrowNeg.geometry.rotateZ(Math.PI), this.arrowNeg.geometry.translate(0, -(e + t / 2), 0), this.line.geometry.translate(0, e / 2, 0), this.direction === "x" ? (this.arrow.geometry.rotateX(Math.PI / 2), this.arrow.geometry.rotateY(Math.PI / 2), this.arrowNeg.geometry.rotateX(Math.PI / 2), this.arrowNeg.geometry.rotateY(Math.PI / 2), this.line.geometry.rotateX(Math.PI / 2), this.line.geometry.rotateY(Math.PI / 2)) : this.direction === "z" && (this.arrow.geometry.rotateX(Math.PI / 2), this.arrowNeg.geometry.rotateX(Math.PI / 2), this.line.geometry.rotateX(Math.PI / 2));
|
|
3942
4106
|
}
|
|
3943
|
-
},
|
|
4107
|
+
}, it = class extends W {
|
|
3944
4108
|
constructor(e) {
|
|
3945
4109
|
var t, n;
|
|
3946
4110
|
super("plane"), this.name = "CenterHandle", this.faceNormals = [
|
|
@@ -3961,7 +4125,7 @@ var qe = class extends i.Mesh {
|
|
|
3961
4125
|
side: i.FrontSide
|
|
3962
4126
|
}));
|
|
3963
4127
|
let o = new i.BoxGeometry(r, r, r), s = new i.Mesh(o, this.faceMaterials);
|
|
3964
|
-
s.direction = "plane", s.renderOrder =
|
|
4128
|
+
s.direction = "plane", s.renderOrder = K.MOVE_HELPER_CENTER, s.name = "center-plane-handle", this.cube = s, this.add(this.cube);
|
|
3965
4129
|
}
|
|
3966
4130
|
update(e) {
|
|
3967
4131
|
let t = new i.Vector3().subVectors(e.position, this.cube.getWorldPosition(new i.Vector3())).normalize(), n = this.cube.getWorldQuaternion(new i.Quaternion()), r = this.faceNormals.map((e, r) => {
|
|
@@ -3982,7 +4146,7 @@ var qe = class extends i.Mesh {
|
|
|
3982
4146
|
this.faceMaterials[e.index].color.copy(a[n]);
|
|
3983
4147
|
});
|
|
3984
4148
|
}
|
|
3985
|
-
},
|
|
4149
|
+
}, at = class extends W {
|
|
3986
4150
|
constructor(e) {
|
|
3987
4151
|
var t, n, r;
|
|
3988
4152
|
super(e.direction), this.name = "PlaneHandle";
|
|
@@ -3994,7 +4158,7 @@ var qe = class extends i.Mesh {
|
|
|
3994
4158
|
depthWrite: !1,
|
|
3995
4159
|
side: i.DoubleSide
|
|
3996
4160
|
});
|
|
3997
|
-
switch (this.handle = new i.Mesh(c, l), this.handle.direction = e.direction, this.handle.renderOrder =
|
|
4161
|
+
switch (this.handle = new i.Mesh(c, l), this.handle.direction = e.direction, this.handle.renderOrder = K.MOVE_HELPER_ARROW, this.handle.name = `plane-handle-${e.direction}`, e.direction) {
|
|
3998
4162
|
case "xy":
|
|
3999
4163
|
this.handle.position.set(o, o, 0);
|
|
4000
4164
|
break;
|
|
@@ -4010,32 +4174,32 @@ var qe = class extends i.Mesh {
|
|
|
4010
4174
|
};
|
|
4011
4175
|
//#endregion
|
|
4012
4176
|
//#region build/plugins/Object3DHelperPlugin/utils/calculateScaleByCamera.js
|
|
4013
|
-
function
|
|
4177
|
+
function q(e, t, n) {
|
|
4014
4178
|
let r = e.position.distanceTo(t), i = e.fov, a = e.distance || 3, o = r / 3, s = i / 90, c = a / 3, l = o * s * c, u = (n == null ? void 0 : n.min) || .6, d = n == null ? void 0 : n.max;
|
|
4015
4179
|
return u && l < u ? u : d && l > d ? d : l;
|
|
4016
4180
|
}
|
|
4017
4181
|
//#endregion
|
|
4018
4182
|
//#region build/plugins/Object3DHelperPlugin/utils/getOrthographicCameraDirection.js
|
|
4019
|
-
function
|
|
4183
|
+
function ot(e) {
|
|
4020
4184
|
let { latitude: t, longitude: n } = e, r = new i.Vector3();
|
|
4021
|
-
return
|
|
4185
|
+
return J - t < .03 ? r.set(0, 1, 0) : Y(0, n) ? r.set(0, 0, 1) : Y(Math.PI, n) ? r.set(0, 0, -1) : Y(J, n) ? r.set(1, 0, 0) : r.set(-1, 0, 0), r;
|
|
4022
4186
|
}
|
|
4023
|
-
var
|
|
4024
|
-
function
|
|
4187
|
+
var J = Number((Math.PI / 2).toFixed(5));
|
|
4188
|
+
function Y(e, t) {
|
|
4025
4189
|
return typeof e != "number" || typeof t != "number" ? !1 : Math.abs(e - t) < .001;
|
|
4026
4190
|
}
|
|
4027
4191
|
//#endregion
|
|
4028
4192
|
//#region build/plugins/Object3DHelperPlugin/utils/tipsDom.js
|
|
4029
|
-
function
|
|
4030
|
-
return
|
|
4193
|
+
function st(e, t) {
|
|
4194
|
+
return X(document.createElement(t == null ? "div" : t), e);
|
|
4031
4195
|
}
|
|
4032
|
-
function
|
|
4196
|
+
function X(e, t) {
|
|
4033
4197
|
if (!t) return e;
|
|
4034
4198
|
for (let n in t) n && t[n] && (e.style[n] = t[n]);
|
|
4035
4199
|
return e;
|
|
4036
4200
|
}
|
|
4037
|
-
function
|
|
4038
|
-
let t =
|
|
4201
|
+
function Z(e) {
|
|
4202
|
+
let t = st(Object.assign({
|
|
4039
4203
|
position: "absolute",
|
|
4040
4204
|
display: "block",
|
|
4041
4205
|
borderRadius: "4px",
|
|
@@ -4067,27 +4231,27 @@ function rt(e) {
|
|
|
4067
4231
|
}
|
|
4068
4232
|
//#endregion
|
|
4069
4233
|
//#region build/plugins/Object3DHelperPlugin/Helper/MoveHelper.js
|
|
4070
|
-
var
|
|
4234
|
+
var ct = class extends Qe {
|
|
4071
4235
|
constructor(e, t) {
|
|
4072
|
-
super(e, t), this.name = "MoveHelper", (t == null ? void 0 : t.xArrowEnable) !== !1 && (this.xArrow = new
|
|
4236
|
+
super(e, t), this.name = "MoveHelper", (t == null ? void 0 : t.xArrowEnable) !== !1 && (this.xArrow = new rt({
|
|
4073
4237
|
direction: "x",
|
|
4074
|
-
color:
|
|
4075
|
-
})), (t == null ? void 0 : t.yArrowEnable) !== !1 && (this.yArrow = new
|
|
4238
|
+
color: G.X
|
|
4239
|
+
})), (t == null ? void 0 : t.yArrowEnable) !== !1 && (this.yArrow = new rt({
|
|
4076
4240
|
direction: "y",
|
|
4077
|
-
color:
|
|
4078
|
-
})), (t == null ? void 0 : t.zArrowEnable) !== !1 && (this.zArrow = new
|
|
4241
|
+
color: G.Y
|
|
4242
|
+
})), (t == null ? void 0 : t.zArrowEnable) !== !1 && (this.zArrow = new rt({
|
|
4079
4243
|
direction: "z",
|
|
4080
|
-
color:
|
|
4081
|
-
})), (t == null ? void 0 : t.centerHandleEnable) !== !1 && (this.centerHandle = new
|
|
4244
|
+
color: G.Z
|
|
4245
|
+
})), (t == null ? void 0 : t.centerHandleEnable) !== !1 && (this.centerHandle = new it()), (t == null ? void 0 : t.xyPlaneEnable) !== !1 && (this.xyPlane = new at({
|
|
4082
4246
|
direction: "xy",
|
|
4083
|
-
color:
|
|
4084
|
-
})), (t == null ? void 0 : t.xzPlaneEnable) !== !1 && (this.xzPlane = new
|
|
4247
|
+
color: G.Z
|
|
4248
|
+
})), (t == null ? void 0 : t.xzPlaneEnable) !== !1 && (this.xzPlane = new at({
|
|
4085
4249
|
direction: "xz",
|
|
4086
|
-
color:
|
|
4087
|
-
})), (t == null ? void 0 : t.yzPlaneEnable) !== !1 && (this.yzPlane = new
|
|
4250
|
+
color: G.Y
|
|
4251
|
+
})), (t == null ? void 0 : t.yzPlaneEnable) !== !1 && (this.yzPlane = new at({
|
|
4088
4252
|
direction: "yz",
|
|
4089
|
-
color:
|
|
4090
|
-
})), t != null && t.container && (t == null ? void 0 : t.moveTipsEnable) !== !1 && (this.container = t.container, this.moveTips =
|
|
4253
|
+
color: G.X
|
|
4254
|
+
})), t != null && t.container && (t == null ? void 0 : t.moveTipsEnable) !== !1 && (this.container = t.container, this.moveTips = Z({ display: "none" }), this.container.appendChild(this.moveTips.element)), this.add(...[
|
|
4091
4255
|
this.xArrow,
|
|
4092
4256
|
this.yArrow,
|
|
4093
4257
|
this.zArrow,
|
|
@@ -4099,7 +4263,7 @@ var it = class extends Ue {
|
|
|
4099
4263
|
}
|
|
4100
4264
|
update(e) {
|
|
4101
4265
|
if (this.xArrow && (this.xArrow.visible = !0), this.yArrow && (this.yArrow.visible = !0), this.zArrow && (this.zArrow.visible = !0), this.centerHandle && this.centerHandle.update(e), e.type === "OrthographicCamera") {
|
|
4102
|
-
let t = new i.Vector3(1, 0, 0).applyQuaternion(this.quaternion), n = new i.Vector3(0, 1, 0).applyQuaternion(this.quaternion), r = new i.Vector3(0, 0, 1).applyQuaternion(this.quaternion), a = e.pose, o =
|
|
4266
|
+
let t = new i.Vector3(1, 0, 0).applyQuaternion(this.quaternion), n = new i.Vector3(0, 1, 0).applyQuaternion(this.quaternion), r = new i.Vector3(0, 0, 1).applyQuaternion(this.quaternion), a = e.pose, o = ot(a), s = .0872665;
|
|
4103
4267
|
Math.abs(t.angleTo(o) - 0) < s || Math.abs(t.angleTo(o) - Math.PI) < s ? this.xArrow && (this.xArrow.visible = !1) : Math.abs(n.angleTo(o) - 0) < s || Math.abs(n.angleTo(o) - Math.PI) < s ? this.yArrow && (this.yArrow.visible = !1) : (Math.abs(r.angleTo(o) - 0) < s || Math.abs(r.angleTo(o) - Math.PI) < s) && this.zArrow && (this.zArrow.visible = !1);
|
|
4104
4268
|
}
|
|
4105
4269
|
}
|
|
@@ -4108,7 +4272,7 @@ var it = class extends Ue {
|
|
|
4108
4272
|
super.show(), this.xArrow && this.add(this.xArrow), this.yArrow && this.add(this.yArrow), this.zArrow && this.add(this.zArrow), this.centerHandle && this.add(this.centerHandle), this.xyPlane && this.add(this.xyPlane), this.xzPlane && this.add(this.xzPlane), this.yzPlane && this.add(this.yzPlane), (e = this.moveTips) == null || e.hide();
|
|
4109
4273
|
}
|
|
4110
4274
|
setScaleByCamera(e) {
|
|
4111
|
-
this.scale.setScalar(
|
|
4275
|
+
this.scale.setScalar(q(e, this.position));
|
|
4112
4276
|
}
|
|
4113
4277
|
showDraggingHelper(e) {
|
|
4114
4278
|
this.xArrow && (e.includes("x") ? this.add(this.xArrow) : this.remove(this.xArrow)), this.yArrow && (e.includes("y") ? this.add(this.yArrow) : this.remove(this.yArrow)), this.zArrow && (e.includes("z") ? this.add(this.zArrow) : this.remove(this.zArrow)), this.centerHandle && (e.includes("plane") ? this.add(this.centerHandle) : this.remove(this.centerHandle)), this.xyPlane && (e.includes("xy") ? this.add(this.xyPlane) : this.remove(this.xyPlane)), this.xzPlane && (e.includes("xz") ? this.add(this.xzPlane) : this.remove(this.xzPlane)), this.yzPlane && (e.includes("yz") ? this.add(this.yzPlane) : this.remove(this.yzPlane));
|
|
@@ -4125,18 +4289,18 @@ var it = class extends Ue {
|
|
|
4125
4289
|
this.yzPlane
|
|
4126
4290
|
].filter(Boolean)), (t = (e = this.moveTips) == null ? void 0 : e.element) == null || t.remove(), super.dispose();
|
|
4127
4291
|
}
|
|
4128
|
-
},
|
|
4292
|
+
}, lt = class extends et {
|
|
4129
4293
|
constructor(e, t) {
|
|
4130
|
-
super(e, t), this.name = "RotateHelper", this.children = [], (t == null ? void 0 : t.yzCircleEnable) !== !1 && (this.xCircle = new
|
|
4294
|
+
super(e, t), this.name = "RotateHelper", this.children = [], (t == null ? void 0 : t.yzCircleEnable) !== !1 && (this.xCircle = new ut({
|
|
4131
4295
|
direction: "x",
|
|
4132
|
-
color:
|
|
4133
|
-
})), (t == null ? void 0 : t.xzCircleEnable) !== !1 && (this.yCircle = new
|
|
4296
|
+
color: G.X
|
|
4297
|
+
})), (t == null ? void 0 : t.xzCircleEnable) !== !1 && (this.yCircle = new ut({
|
|
4134
4298
|
direction: "y",
|
|
4135
|
-
color:
|
|
4136
|
-
})), (t == null ? void 0 : t.xyCircleEnable) !== !1 && (this.zCircle = new
|
|
4299
|
+
color: G.Y
|
|
4300
|
+
})), (t == null ? void 0 : t.xyCircleEnable) !== !1 && (this.zCircle = new ut({
|
|
4137
4301
|
direction: "z",
|
|
4138
|
-
color:
|
|
4139
|
-
})), t != null && t.container && (t == null ? void 0 : t.angleTipsEnable) !== !1 && (this.container = t == null ? void 0 : t.container, this.angleTips =
|
|
4302
|
+
color: G.Z
|
|
4303
|
+
})), t != null && t.container && (t == null ? void 0 : t.angleTipsEnable) !== !1 && (this.container = t == null ? void 0 : t.container, this.angleTips = Z({ display: "none" }), this.container.appendChild(this.angleTips.element)), this.add(...[
|
|
4140
4304
|
this.xCircle,
|
|
4141
4305
|
this.yCircle,
|
|
4142
4306
|
this.zCircle
|
|
@@ -4150,7 +4314,7 @@ var it = class extends Ue {
|
|
|
4150
4314
|
this.children.forEach((e) => e.showCircle()), (e = this.angleTips) == null || e.hide();
|
|
4151
4315
|
}
|
|
4152
4316
|
setScaleByCamera(e) {
|
|
4153
|
-
this.scale.setScalar(
|
|
4317
|
+
this.scale.setScalar(q(e, this.position));
|
|
4154
4318
|
}
|
|
4155
4319
|
update(e) {
|
|
4156
4320
|
if (e.type === "OrthographicCamera") return;
|
|
@@ -4178,9 +4342,9 @@ var it = class extends Ue {
|
|
|
4178
4342
|
var e, t;
|
|
4179
4343
|
this.removeFromParent(), (t = (e = this.angleTips) == null ? void 0 : e.element) == null || t.remove();
|
|
4180
4344
|
}
|
|
4181
|
-
},
|
|
4345
|
+
}, ut = class extends i.Group {
|
|
4182
4346
|
constructor(e) {
|
|
4183
|
-
super(), this.direction = e.direction, this.circle = new
|
|
4347
|
+
super(), this.direction = e.direction, this.circle = new Q(e), this.ring = new dt(e), this.angleSector = new ft(e), this.add(this.circle, this.ring, this.angleSector), this.direction === "y" ? this.rotation.x = Math.PI / 2 : this.direction === "x" && (this.rotation.y = -Math.PI / 2);
|
|
4184
4348
|
}
|
|
4185
4349
|
showCircle() {
|
|
4186
4350
|
this.add(this.circle), this.remove(this.ring, this.angleSector);
|
|
@@ -4191,7 +4355,7 @@ var it = class extends Ue {
|
|
|
4191
4355
|
hide() {
|
|
4192
4356
|
this.remove(this.ring, this.angleSector, this.circle);
|
|
4193
4357
|
}
|
|
4194
|
-
},
|
|
4358
|
+
}, Q = class extends i.Mesh {
|
|
4195
4359
|
constructor(e) {
|
|
4196
4360
|
var t;
|
|
4197
4361
|
super(), this.gapAngle = .02, this.geometry = new i.RingGeometry(.3, .35, 20, 8, this.gapAngle, Math.PI / 2 - this.gapAngle * 2), this.material = new i.MeshBasicMaterial({
|
|
@@ -4200,9 +4364,9 @@ var it = class extends Ue {
|
|
|
4200
4364
|
color: (t = e.color) == null ? 16777215 : t,
|
|
4201
4365
|
side: i.DoubleSide,
|
|
4202
4366
|
depthTest: !1
|
|
4203
|
-
}), this.direction = e.direction, this.renderOrder =
|
|
4367
|
+
}), this.direction = e.direction, this.renderOrder = K.ROTATE_HELPER, this.geometry.name = `RotateHelperCircleGeometry-${this.direction}`;
|
|
4204
4368
|
}
|
|
4205
|
-
},
|
|
4369
|
+
}, dt = class extends i.Group {
|
|
4206
4370
|
constructor(e) {
|
|
4207
4371
|
super(), this.direction = e.direction;
|
|
4208
4372
|
let t = .015, n = Array(8).fill(null).map((e, n) => {
|
|
@@ -4218,7 +4382,7 @@ var it = class extends Ue {
|
|
|
4218
4382
|
});
|
|
4219
4383
|
this.add(...n);
|
|
4220
4384
|
}
|
|
4221
|
-
},
|
|
4385
|
+
}, ft = class extends i.Mesh {
|
|
4222
4386
|
constructor(e) {
|
|
4223
4387
|
var t;
|
|
4224
4388
|
switch (super(), this.offsetAngle = (e) => e, e.direction) {
|
|
@@ -4256,7 +4420,7 @@ var it = class extends Ue {
|
|
|
4256
4420
|
getDirection() {
|
|
4257
4421
|
return this.angleDirection === -1 ? "clockwise" : "counterclockwise";
|
|
4258
4422
|
}
|
|
4259
|
-
},
|
|
4423
|
+
}, pt = class extends $e {
|
|
4260
4424
|
constructor(e) {
|
|
4261
4425
|
super(e), this.name = "BoundingBoxHelper", this.positionAttribute = new i.BufferAttribute(new Float32Array(24), 3), this.box = this.createBox(), this.outline = this.createOutline(), this.add(this.box, this.outline), this.update();
|
|
4262
4426
|
}
|
|
@@ -4264,7 +4428,7 @@ var it = class extends Ue {
|
|
|
4264
4428
|
this.quaternion.copy(this.originObject3D.quaternion), this.scale.copy(this.originObject3D.scale);
|
|
4265
4429
|
}
|
|
4266
4430
|
setHelperQuaternion(e, t) {
|
|
4267
|
-
|
|
4431
|
+
Ye(this, e, t);
|
|
4268
4432
|
}
|
|
4269
4433
|
raycasterIntersectObject(e, t) {
|
|
4270
4434
|
return e.intersectObject(this, !1, t);
|
|
@@ -4377,27 +4541,27 @@ var it = class extends Ue {
|
|
|
4377
4541
|
});
|
|
4378
4542
|
return new i.Mesh(t, n);
|
|
4379
4543
|
}
|
|
4380
|
-
},
|
|
4381
|
-
function
|
|
4382
|
-
if (
|
|
4544
|
+
}, mt = /* @__PURE__ */ new Map();
|
|
4545
|
+
function ht(e) {
|
|
4546
|
+
if (mt.has(e)) return mt.get(e).hooks;
|
|
4383
4547
|
let t = new r(), n = null, i, a = () => {
|
|
4384
4548
|
n = requestAnimationFrame(a);
|
|
4385
4549
|
let r = e.projectionMatrix.toArray().join(",") + e.matrixWorld.toArray().join(",");
|
|
4386
4550
|
r !== i && (i = r, t.emit("cameraUpdate"));
|
|
4387
4551
|
};
|
|
4388
|
-
return a(),
|
|
4552
|
+
return a(), mt.set(e, {
|
|
4389
4553
|
hooks: t,
|
|
4390
4554
|
dispose: () => {
|
|
4391
|
-
|
|
4555
|
+
mt.delete(e), cancelAnimationFrame(n);
|
|
4392
4556
|
}
|
|
4393
4557
|
}), t;
|
|
4394
4558
|
}
|
|
4395
4559
|
//#endregion
|
|
4396
4560
|
//#region build/plugins/Object3DHelperPlugin/Controllers/BaseController.js
|
|
4397
|
-
function
|
|
4561
|
+
function gt(e) {
|
|
4398
4562
|
return arguments.length === 0 ? [] : Array.isArray(e) ? e : [e];
|
|
4399
4563
|
}
|
|
4400
|
-
var
|
|
4564
|
+
var _t = class {
|
|
4401
4565
|
updateOtherControllers(e) {
|
|
4402
4566
|
this.otherControllers = e;
|
|
4403
4567
|
}
|
|
@@ -4410,7 +4574,7 @@ var ct = class {
|
|
|
4410
4574
|
if (this.getIntersectObject(e)) return !1;
|
|
4411
4575
|
}, this.updateHelperScale = () => {
|
|
4412
4576
|
"update" in this.helperObject3D && typeof this.helperObject3D.update == "function" && this.helperObject3D.update(this.camera), this.helperObject3D.setScaleByCamera(this.camera);
|
|
4413
|
-
}, this.getBox = () => (this.boundingBox || (this.boundingBox = new i.Box3().expandByObject(this.originObject3D)), this.boundingBox), this.hooks = (n = e.sharedHooks) == null ? new r() : n, this.internalHooks = (a = e.sharedInternalHooks) == null ? new r() : a, this.camera = e.camera, this.model = e.model, this.originObject3D = e.originObject3D, this.helperObject3D = e.helperObject3D, this.container = e.container, this.scene = e.scene, this.domEvents = e.domEvents, this.onRender = (o = e.onRender) == null ? (() => {}) : o, this.config = t == null ? {} : t, this.otherControllers = e.otherControllers, this.initialHelperPosition(), this.initialHelperQuaternion(), this.updateHelperScale(), this.cameraHooks =
|
|
4577
|
+
}, this.getBox = () => (this.boundingBox || (this.boundingBox = new i.Box3().expandByObject(this.originObject3D)), this.boundingBox), this.hooks = (n = e.sharedHooks) == null ? new r() : n, this.internalHooks = (a = e.sharedInternalHooks) == null ? new r() : a, this.camera = e.camera, this.model = e.model, this.originObject3D = e.originObject3D, this.helperObject3D = e.helperObject3D, this.container = e.container, this.scene = e.scene, this.domEvents = e.domEvents, this.onRender = (o = e.onRender) == null ? (() => {}) : o, this.config = t == null ? {} : t, this.otherControllers = e.otherControllers, this.initialHelperPosition(), this.initialHelperQuaternion(), this.updateHelperScale(), this.cameraHooks = ht(this.camera), this.enable();
|
|
4414
4578
|
let s = this.onSetOriginObjectScale.bind(this), c = this.onSetOriginObjectRotate.bind(this), l = this.onSetOriginObjectPosition.bind(this), u = this.onApplyOriginObjectScale.bind(this), d = this.onApplyOriginObjectRotate.bind(this), f = this.onApplyOriginObjectPosition.bind(this), p = this.initialHelperPosition.bind(this);
|
|
4415
4579
|
this.cameraHooks.on("cameraUpdate", this.updateHelperScale), this.internalHooks.on("initialHelperPosition", p), this.internalHooks.on("setObjectScale", s), this.internalHooks.on("setObjectRotate", c), this.internalHooks.on("setObjectPosition", l), this.internalHooks.on("applyObjectPosition", f), this.internalHooks.on("applyObjectRotate", d), this.internalHooks.on("applyObjectScale", u), this.hooks.on("moveEnd", this.updateHelperScale), this.internalHooks.on("setObjectPosition", this.updateHelperScale), this.internalHooks.on("initialHelperPosition", this.updateHelperScale), this.disposers.push(() => {
|
|
4416
4580
|
this.cameraHooks.off("cameraUpdate", this.updateHelperScale), this.internalHooks.off("initialHelperPosition", p), this.internalHooks.off("setObjectScale", s), this.internalHooks.off("setObjectRotate", c), this.internalHooks.off("setObjectPosition", l), this.internalHooks.off("applyObjectPosition", f), this.internalHooks.off("applyObjectRotate", d), this.internalHooks.off("applyObjectScale", u), this.hooks.off("moveEnd", this.updateHelperScale), this.internalHooks.off("setObjectPosition", this.updateHelperScale), this.internalHooks.off("initialHelperPosition", this.updateHelperScale);
|
|
@@ -4484,7 +4648,7 @@ var ct = class {
|
|
|
4484
4648
|
}
|
|
4485
4649
|
}
|
|
4486
4650
|
hoverListener(e, t = 16777215, n = 1) {
|
|
4487
|
-
let r =
|
|
4651
|
+
let r = gt(e).filter((e) => !Xe(e)), a = [];
|
|
4488
4652
|
for (let e of r) if (e.material || e instanceof i.Group) {
|
|
4489
4653
|
let r = e instanceof i.Group ? e.children.filter((e) => e instanceof i.Mesh) : [e];
|
|
4490
4654
|
r.forEach((e) => {
|
|
@@ -4570,7 +4734,7 @@ var ct = class {
|
|
|
4570
4734
|
};
|
|
4571
4735
|
//#endregion
|
|
4572
4736
|
//#region build/plugins/Object3DHelperPlugin/utils/solidGuide.js
|
|
4573
|
-
function
|
|
4737
|
+
function vt(e, t) {
|
|
4574
4738
|
let n = 10, r = 10, i = e.isPerspectiveCamera, a = e.isOrthographicCamera;
|
|
4575
4739
|
if (i) {
|
|
4576
4740
|
let i = e, a = i.position.distanceTo(t), o = i.fov * Math.PI / 180;
|
|
@@ -4582,14 +4746,14 @@ function lt(e, t) {
|
|
|
4582
4746
|
let o = Math.sqrt(n * n + r * r), s = o * .8, c = Math.min(n, r) * .25, l = o * 1.2;
|
|
4583
4747
|
return Math.max(c, Math.min(s, l));
|
|
4584
4748
|
}
|
|
4585
|
-
var
|
|
4749
|
+
var yt = class {
|
|
4586
4750
|
constructor(e, t, n) {
|
|
4587
4751
|
this.camera = e, this.container = t, this.defaults = Object.assign({}, n || {});
|
|
4588
4752
|
}
|
|
4589
4753
|
createSolidLine(e, t, n) {
|
|
4590
4754
|
let r = Object.assign(Object.assign({
|
|
4591
4755
|
color: 16777215,
|
|
4592
|
-
renderOrder:
|
|
4756
|
+
renderOrder: K.DRAG_GUIDE_LINE
|
|
4593
4757
|
}, this.defaults), n || {}), a = t.clone().normalize(), o = this.computeInfiniteLineLength(e), s = e.clone().add(a.clone().multiplyScalar(-o)), c = e.clone().add(a.clone().multiplyScalar(o)), l = new Float32Array([
|
|
4594
4758
|
s.x,
|
|
4595
4759
|
s.y,
|
|
@@ -4620,7 +4784,7 @@ var ut = class {
|
|
|
4620
4784
|
d && d.itemSize === 3 && d.array.length === l.length ? (d.array.set(l), d.needsUpdate = !0) : u.setAttribute("position", new i.BufferAttribute(l, 3)), (r == null ? void 0 : r.color) !== void 0 && e.material.color.setHex(r.color);
|
|
4621
4785
|
}
|
|
4622
4786
|
computeInfiniteLineLength(e) {
|
|
4623
|
-
return
|
|
4787
|
+
return vt(this.camera, e) * 10;
|
|
4624
4788
|
}
|
|
4625
4789
|
dispose(e) {
|
|
4626
4790
|
if (!e) return;
|
|
@@ -4634,16 +4798,16 @@ var ut = class {
|
|
|
4634
4798
|
};
|
|
4635
4799
|
//#endregion
|
|
4636
4800
|
//#region build/plugins/Object3DHelperPlugin/utils/getMouseRaycaster.js
|
|
4637
|
-
function
|
|
4801
|
+
function bt(e, t, n) {
|
|
4638
4802
|
if (!t || !n || !e) return;
|
|
4639
|
-
let r =
|
|
4803
|
+
let r = I(t, n);
|
|
4640
4804
|
if (Math.abs(r.x) === 1 || Math.abs(r.y) === 1) return;
|
|
4641
4805
|
let a = new i.Raycaster();
|
|
4642
4806
|
return a.setFromCamera(r, e), a.params.Points && (a.params.Points.threshold = .1), a;
|
|
4643
4807
|
}
|
|
4644
4808
|
//#endregion
|
|
4645
4809
|
//#region build/plugins/Object3DHelperPlugin/Controllers/MoveController.js
|
|
4646
|
-
function
|
|
4810
|
+
function xt(e) {
|
|
4647
4811
|
let { raycaster: t, line: n, clampToLine: r = !0 } = e, a = new i.Plane().setFromNormalAndCoplanarPoint(t.ray.direction.clone().normalize(), new i.Vector3()), o = a.projectPoint(n.start, new i.Vector3()), s = a.projectPoint(n.end, new i.Vector3()), c = new i.Line3(o, s), l = c.closestPointToPoint(t.ray.origin, r, new i.Vector3()), u = l.distanceTo(s), d = l.distanceTo(o), f = c.distance();
|
|
4648
4812
|
if (u > d && u > f) {
|
|
4649
4813
|
let e = -l.distanceTo(o) / f, t = n.start.clone().sub(n.end).normalize();
|
|
@@ -4653,13 +4817,13 @@ function dt(e) {
|
|
|
4653
4817
|
return new i.Vector3().lerpVectors(n.start, n.end, e);
|
|
4654
4818
|
}
|
|
4655
4819
|
}
|
|
4656
|
-
var
|
|
4820
|
+
var St = class extends _t {
|
|
4657
4821
|
get moveByMouseEnable() {
|
|
4658
4822
|
return this._moveByMouse.enabled;
|
|
4659
4823
|
}
|
|
4660
4824
|
constructor(...e) {
|
|
4661
4825
|
var t, n, r, a, o;
|
|
4662
|
-
super(...e), this.name = "MoveController", this.solidGuide = new
|
|
4826
|
+
super(...e), this.name = "MoveController", this.solidGuide = new yt(this.camera, this.container, (n = (t = this.config) == null ? void 0 : t.solidGuide) == null ? {} : n), this._moveByMouse = { enabled: !1 }, this.dragStart = (e) => {
|
|
4663
4827
|
if (this.moveByMouseEnable || this.isDragging) return;
|
|
4664
4828
|
let t = e == null ? void 0 : e.intersect;
|
|
4665
4829
|
if (!t) return this.dragEnd();
|
|
@@ -4708,7 +4872,7 @@ var ft = class extends ct {
|
|
|
4708
4872
|
try {
|
|
4709
4873
|
let e = s.clone().normalize(), t = this.helperObject3D.getWorldPosition(new i.Vector3()), n = this.solidGuide.createSolidLine(t, e, {
|
|
4710
4874
|
color: 16777215,
|
|
4711
|
-
renderOrder:
|
|
4875
|
+
renderOrder: K.DRAG_GUIDE_LINE
|
|
4712
4876
|
});
|
|
4713
4877
|
this.scene.add(n), this.dragGuideLine = n;
|
|
4714
4878
|
} catch (e) {}
|
|
@@ -4737,7 +4901,7 @@ var ft = class extends ct {
|
|
|
4737
4901
|
this.helperObject3D.showDraggingHelper(l), this.hooks.emit("moveStart", n), this.isDragging = !0, this.setTipsText(this.originObject3D.position), this.setTipsPosition(c);
|
|
4738
4902
|
}, this.dragging = (e) => {
|
|
4739
4903
|
if (!this.isDragging || !this.startInfo) return;
|
|
4740
|
-
let t = "touches" in e ? e.touches[0].clientX : e.x, n = "touches" in e ? e.touches[0].clientY : e.y, r =
|
|
4904
|
+
let t = "touches" in e ? e.touches[0].clientX : e.x, n = "touches" in e ? e.touches[0].clientY : e.y, r = bt(this.camera, {
|
|
4741
4905
|
x: t,
|
|
4742
4906
|
y: n
|
|
4743
4907
|
}, this.container);
|
|
@@ -4760,7 +4924,7 @@ var ft = class extends ct {
|
|
|
4760
4924
|
(r = s.xyPlane) == null ? void 0 : r.handle,
|
|
4761
4925
|
(a = s.xzPlane) == null ? void 0 : a.handle,
|
|
4762
4926
|
(o = s.yzPlane) == null ? void 0 : o.handle
|
|
4763
|
-
]), s.centerHandle && s.centerHandle instanceof
|
|
4927
|
+
]), s.centerHandle && s.centerHandle instanceof it) {
|
|
4764
4928
|
let e = s.centerHandle, t = e.cube;
|
|
4765
4929
|
this.domEvents.addEventListener(t, "mouseover", () => {
|
|
4766
4930
|
this.isDragging || (Array.isArray(t.material) && t.material.forEach((e) => {
|
|
@@ -4846,7 +5010,7 @@ var ft = class extends ct {
|
|
|
4846
5010
|
let a = -(t.normal.dot(e.ray.origin) + t.constant) / r;
|
|
4847
5011
|
if (a < 0) return;
|
|
4848
5012
|
n.copy(e.ray.origin.clone().add(e.ray.direction.clone().multiplyScalar(a))), o = n;
|
|
4849
|
-
} else o =
|
|
5013
|
+
} else o = xt({
|
|
4850
5014
|
raycaster: e,
|
|
4851
5015
|
line: t,
|
|
4852
5016
|
clampToLine: !1
|
|
@@ -4900,7 +5064,7 @@ var ft = class extends ct {
|
|
|
4900
5064
|
let o = this.container.getBoundingClientRect(), s = (n + 1) / 2 * o.width, c = (-r + 1) / 2 * o.height;
|
|
4901
5065
|
t.setLeftTop(s + "px", c + "px");
|
|
4902
5066
|
}
|
|
4903
|
-
},
|
|
5067
|
+
}, Ct = class {
|
|
4904
5068
|
constructor(e, t, n, r, i, a, o, s, c) {
|
|
4905
5069
|
this.onFiveWantsTapGesture = (e) => {
|
|
4906
5070
|
if (!this.helperController) return;
|
|
@@ -4934,13 +5098,13 @@ var ft = class extends ct {
|
|
|
4934
5098
|
var e;
|
|
4935
5099
|
this.five.off("wantsTapGesture", this.onFiveWantsTapGesture), this.five.off("wantsGesture", this.onFiveWantsGesture), this.five.off("intersectionOnModelUpdate", this.onFiveIntersectionOnModelUpdate), (e = this.helperController) == null || e.dispose();
|
|
4936
5100
|
}
|
|
4937
|
-
},
|
|
5101
|
+
}, wt = new i.Quaternion(), Tt = class extends _t {
|
|
4938
5102
|
get rotateCenter() {
|
|
4939
5103
|
return this.helperObject3D.position.clone();
|
|
4940
5104
|
}
|
|
4941
5105
|
constructor(...e) {
|
|
4942
5106
|
var t, n, r;
|
|
4943
|
-
super(...e), this.name = "RotateController", this.solidGuide = new
|
|
5107
|
+
super(...e), this.name = "RotateController", this.solidGuide = new yt(this.camera, this.container), this.snapGuideLines = [];
|
|
4944
5108
|
let i = this.helperObject3D;
|
|
4945
5109
|
this.hoverListener([
|
|
4946
5110
|
(t = i.xCircle) == null ? void 0 : t.circle,
|
|
@@ -4960,7 +5124,7 @@ var ft = class extends ct {
|
|
|
4960
5124
|
let { x: t = 0, y: n = 0, z: r = 0 } = e, a = new i.Euler(i.MathUtils.degToRad(t), i.MathUtils.degToRad(n), i.MathUtils.degToRad(r)), o = new i.Quaternion().setFromEuler(a);
|
|
4961
5125
|
if (this.hooks.emit("wantToRotate", o)) return;
|
|
4962
5126
|
let { originObject3D: s, rotateCenter: c } = this;
|
|
4963
|
-
|
|
5127
|
+
Ye(s, o, c), this.internalHooks.emit("setObjectRotate", o, c), this.hooks.emit("rotate", o), this.render();
|
|
4964
5128
|
}
|
|
4965
5129
|
getEulerAngle(e, t) {
|
|
4966
5130
|
let { originObject3D: n } = this, r = new i.Euler().setFromQuaternion(n.quaternion), a = {
|
|
@@ -5001,7 +5165,7 @@ var ft = class extends ct {
|
|
|
5001
5165
|
angle: 0,
|
|
5002
5166
|
helperQuaternion: o.clone(),
|
|
5003
5167
|
startQuaternion: this.originObject3D.quaternion.clone()
|
|
5004
|
-
},
|
|
5168
|
+
}, wt = new i.Quaternion(), this.helperObject3D.showDraggingHelper([n]), this.hooks.emit("rotateStart", n), this.isDragging = !0;
|
|
5005
5169
|
}
|
|
5006
5170
|
getMatrix() {
|
|
5007
5171
|
var e, t;
|
|
@@ -5030,7 +5194,7 @@ var ft = class extends ct {
|
|
|
5030
5194
|
}
|
|
5031
5195
|
dragging(e) {
|
|
5032
5196
|
if (!this.isDragging) return;
|
|
5033
|
-
let t = "touches" in e ? e.touches[0].clientX : e.x, n = "touches" in e ? e.touches[0].clientY : e.y, r =
|
|
5197
|
+
let t = "touches" in e ? e.touches[0].clientX : e.x, n = "touches" in e ? e.touches[0].clientY : e.y, r = bt(this.camera, {
|
|
5034
5198
|
x: t,
|
|
5035
5199
|
y: n
|
|
5036
5200
|
}, this.container);
|
|
@@ -5058,7 +5222,7 @@ var ft = class extends ct {
|
|
|
5058
5222
|
let e = new i.Vector3().subVectors(s.position, l).applyQuaternion(O).add(l);
|
|
5059
5223
|
s.position.copy(e);
|
|
5060
5224
|
}
|
|
5061
|
-
s.applyQuaternion(O),
|
|
5225
|
+
s.applyQuaternion(O), wt.premultiply(O), this.internalHooks.emit("applyObjectRotate", {
|
|
5062
5226
|
quaternion: O,
|
|
5063
5227
|
origin: l
|
|
5064
5228
|
}), this.hooks.emit("rotate", s.quaternion), E || (this.startInfo.startVector = u);
|
|
@@ -5131,7 +5295,7 @@ var ft = class extends ct {
|
|
|
5131
5295
|
for (let e of n) {
|
|
5132
5296
|
let n = this.solidGuide.createSolidLine(t, e, {
|
|
5133
5297
|
color: 16777215,
|
|
5134
|
-
renderOrder:
|
|
5298
|
+
renderOrder: K.DRAG_GUIDE_LINE
|
|
5135
5299
|
});
|
|
5136
5300
|
this.scene.add(n), this.snapGuideLines.push(n);
|
|
5137
5301
|
}
|
|
@@ -5141,7 +5305,7 @@ var ft = class extends ct {
|
|
|
5141
5305
|
for (let e of this.snapGuideLines) this.scene.remove(e), this.solidGuide.dispose(e);
|
|
5142
5306
|
this.snapGuideLines = [];
|
|
5143
5307
|
}
|
|
5144
|
-
},
|
|
5308
|
+
}, Et = class extends _t {
|
|
5145
5309
|
constructor(...e) {
|
|
5146
5310
|
super(...e), this.name = "BoundingBoxController";
|
|
5147
5311
|
let t = () => {
|
|
@@ -5357,13 +5521,13 @@ $.prototype.destroy = function() {
|
|
|
5357
5521
|
};
|
|
5358
5522
|
//#endregion
|
|
5359
5523
|
//#region build/plugins/Object3DHelperPlugin/Controller.js
|
|
5360
|
-
var
|
|
5361
|
-
console.error(`${
|
|
5362
|
-
},
|
|
5363
|
-
console.warn(`${
|
|
5364
|
-
},
|
|
5365
|
-
console.error(`${
|
|
5366
|
-
},
|
|
5524
|
+
var Dt = "Object3DHelperPlugin", Ot = Dt, kt = () => {
|
|
5525
|
+
console.error(`${Ot} is disposed`);
|
|
5526
|
+
}, At = () => {
|
|
5527
|
+
console.warn(`${Ot} is disabled`);
|
|
5528
|
+
}, jt = () => {
|
|
5529
|
+
console.error(`${Ot} is disabled`);
|
|
5530
|
+
}, Mt = class {
|
|
5367
5531
|
constructor(e) {
|
|
5368
5532
|
this.controllers = {}, this.state = {
|
|
5369
5533
|
visible: !0,
|
|
@@ -5418,9 +5582,9 @@ var _t = "Object3DHelperPlugin", vt = _t, yt = () => {
|
|
|
5418
5582
|
t && e(t);
|
|
5419
5583
|
});
|
|
5420
5584
|
}
|
|
5421
|
-
},
|
|
5585
|
+
}, Nt = class extends _.Controller {
|
|
5422
5586
|
constructor(e) {
|
|
5423
|
-
super(e), this.name =
|
|
5587
|
+
super(e), this.name = Dt, this.state = {
|
|
5424
5588
|
visible: !0,
|
|
5425
5589
|
enabled: !0,
|
|
5426
5590
|
disposed: !1
|
|
@@ -5450,8 +5614,8 @@ var _t = "Object3DHelperPlugin", vt = _t, yt = () => {
|
|
|
5450
5614
|
}
|
|
5451
5615
|
setState(e, t) {
|
|
5452
5616
|
var n;
|
|
5453
|
-
if (this.state.disposed) return
|
|
5454
|
-
if (!this.state.enabled && e.enabled !== !0 && e.disposed !== !0) return
|
|
5617
|
+
if (this.state.disposed) return kt();
|
|
5618
|
+
if (!this.state.enabled && e.enabled !== !0 && e.disposed !== !0) return jt();
|
|
5455
5619
|
let r = Object.assign({}, this.state);
|
|
5456
5620
|
this.state = Object.assign(Object.assign({}, this.state), e), e.disposed !== void 0 && e.disposed !== r.disposed && e.disposed && this.handleDispose(), e.visible !== void 0 && e.visible !== r.visible && this.handleVisible(e.visible), e.enabled !== void 0 && e.enabled !== r.enabled && this.handleEnable(e.enabled), this.hooks.emit("stateChange", {
|
|
5457
5621
|
state: this.state,
|
|
@@ -5472,7 +5636,7 @@ var _t = "Object3DHelperPlugin", vt = _t, yt = () => {
|
|
|
5472
5636
|
console.warn(`Object3DHelperPlugin: object3D ${e.name} already has helper`);
|
|
5473
5637
|
return;
|
|
5474
5638
|
}
|
|
5475
|
-
let o = new
|
|
5639
|
+
let o = new Mt(), s = [], c = (n = this.five.getElement()) == null ? void 0 : n.parentElement;
|
|
5476
5640
|
this.five.camera;
|
|
5477
5641
|
let l = Object.assign(Object.assign({}, {
|
|
5478
5642
|
moveHelper: !0,
|
|
@@ -5486,18 +5650,18 @@ var _t = "Object3DHelperPlugin", vt = _t, yt = () => {
|
|
|
5486
5650
|
if (e) return typeof e == "boolean" ? e : e.enable;
|
|
5487
5651
|
}, v = {};
|
|
5488
5652
|
if (_(u)) {
|
|
5489
|
-
let t = Object.assign(Object.assign({}, this.getConfig(l.moveHelper)), l), n = new
|
|
5653
|
+
let t = Object.assign(Object.assign({}, this.getConfig(l.moveHelper)), l), n = new ct(e, Object.assign({
|
|
5490
5654
|
container: c == null ? void 0 : c,
|
|
5491
5655
|
moveTipsEnable: (a = l.moveHelperTips) == null ? !1 : a
|
|
5492
|
-
}, t)), r = new
|
|
5656
|
+
}, t)), r = new Ct(this.five, g, St, e, n, t, m, h, p);
|
|
5493
5657
|
v.moveController = r.helperController, s.push(() => r.dispose());
|
|
5494
5658
|
}
|
|
5495
5659
|
if (_(d)) {
|
|
5496
|
-
let t = Object.assign(Object.assign({}, this.getConfig(l.rotateHelper)), l), n = new
|
|
5660
|
+
let t = Object.assign(Object.assign({}, this.getConfig(l.rotateHelper)), l), n = new lt(e, Object.assign({ container: c == null ? void 0 : c }, t)), r = new Ct(this.five, g, Tt, e, n, t, m, h, p);
|
|
5497
5661
|
v.rotateController = r.helperController, s.push(() => r.dispose());
|
|
5498
5662
|
}
|
|
5499
5663
|
if (_(f)) {
|
|
5500
|
-
let t = new
|
|
5664
|
+
let t = new pt(e), n = new Ct(this.five, g, Et, e, t, void 0, m, h, p);
|
|
5501
5665
|
v.boundingBoxController = n.helperController, s.push(() => n.dispose());
|
|
5502
5666
|
}
|
|
5503
5667
|
return Object.values(v).forEach((e) => {
|
|
@@ -5531,12 +5695,12 @@ var _t = "Object3DHelperPlugin", vt = _t, yt = () => {
|
|
|
5531
5695
|
}
|
|
5532
5696
|
actionIfStateIsEnabled(e, t) {
|
|
5533
5697
|
if (this.state.enabled) return e();
|
|
5534
|
-
t != null && t.warnLog &&
|
|
5698
|
+
t != null && t.warnLog && At();
|
|
5535
5699
|
}
|
|
5536
5700
|
getConfig(e) {
|
|
5537
5701
|
if (e && typeof e != "boolean" && e.enable) return e;
|
|
5538
5702
|
}
|
|
5539
|
-
},
|
|
5703
|
+
}, Pt = (e) => new Nt(e), Ft = class {
|
|
5540
5704
|
constructor(e, t, n, r, i) {
|
|
5541
5705
|
this.R = e, this.Q = t, this.A = n, this.B = r, this.C = i, this.cov = NaN, this.x = NaN;
|
|
5542
5706
|
}
|
|
@@ -5548,7 +5712,7 @@ var _t = "Object3DHelperPlugin", vt = _t, yt = () => {
|
|
|
5548
5712
|
}
|
|
5549
5713
|
return this.x;
|
|
5550
5714
|
}
|
|
5551
|
-
},
|
|
5715
|
+
}, It = class extends _.Controller {
|
|
5552
5716
|
updateState(e, t) {
|
|
5553
5717
|
let n = this.state;
|
|
5554
5718
|
this.state = Object.assign(Object.assign({}, this.state), e), this.hooks.emit("stateChange", {
|
|
@@ -5592,7 +5756,7 @@ var _t = "Object3DHelperPlugin", vt = _t, yt = () => {
|
|
|
5592
5756
|
extractKeyframes(e) {
|
|
5593
5757
|
let t = [];
|
|
5594
5758
|
if (!e.content.data) throw Error("轨迹数据未加载");
|
|
5595
|
-
let n = e.content.data.positionArray, r = n.length / 3, a = .01, o = .1, s = new
|
|
5759
|
+
let n = e.content.data.positionArray, r = n.length / 3, a = .01, o = .1, s = new Ft(a, o, 1, 0, 1), c = new Ft(a, o, 1, 0, 1), l = new Ft(a, o, 1, 0, 1), u = new Float32Array(r);
|
|
5596
5760
|
for (let e = 0; e < r; e++) if (e === 0) u[e] = 0;
|
|
5597
5761
|
else {
|
|
5598
5762
|
let t = new i.Vector3(n[(e - 1) * 3], n[(e - 1) * 3 + 1], n[(e - 1) * 3 + 2]);
|
|
@@ -5696,6 +5860,6 @@ var _t = "Object3DHelperPlugin", vt = _t, yt = () => {
|
|
|
5696
5860
|
});
|
|
5697
5861
|
});
|
|
5698
5862
|
}
|
|
5699
|
-
},
|
|
5863
|
+
}, Lt = (e, t) => new It(e, t);
|
|
5700
5864
|
//#endregion
|
|
5701
|
-
export {
|
|
5865
|
+
export { pe as BackgroundPlugin, _ as BasePlugin, ze as CSS2DObject, Je as CSS2DPlugin, Ge as CSS2DRenderer, le as CSS3DObject, Re as CSS3DPlugin, F as CSS3DRenderer, M as CSS3DSprite, Ne as DynamicPathLinePlugin, Lt as GaussianSplattingEntranceAnimationPlugin, ae as ItemMaskPlugin, Nt as Object3DHelperController, Pt as Object3DHelperPlugin, A as OrbitControls, fe as OrientationPlugin, Te as PanoAnimePlugin, L as RoundedBoxGeometry, ge as TrajectoryPlugin };
|