@realsee/dnalogel 3.48.7 → 3.49.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/CHANGELOG.md +12 -3
- package/dist/Sculpt/Meshes/Line.d.ts +2 -1
- package/dist/Sculpt/Meshes/Prism.d.ts +1 -0
- package/dist/index.cjs.js +3008 -87
- package/dist/index.js +39484 -20079
- package/dist/index.umd.js +3001 -80
- package/dist/shared-utils/Object3DHelper/Controller/RotateController.d.ts +0 -1
- package/dist/shared-utils/Object3DHelper/Controller/ScaleController.d.ts +1 -1
- package/dist/shared-utils/three/PointSelector/index.d.ts +2 -1
- package/dist/shared-utils/three/generatePolygonGeometry.d.ts +1 -1
- package/dist/shared-utils/three/index.d.ts +1 -1
- package/libs/AreaMakerPlugin/Controller.js +7 -4
- package/libs/AreaMakerPlugin/index.js +7 -4
- package/libs/AreaMakerPlugin/utils/Item.js +7 -4
- package/libs/CSS3DRenderPlugin/Controller.js +12 -9
- package/libs/CSS3DRenderPlugin/index.js +9 -6
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DObject.js +21 -18
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DRender.js +6 -3
- package/libs/CruisePlugin/BaseController.js +12 -9
- package/libs/CruisePlugin/Move.js +7 -4
- package/libs/CruisePlugin/Work.js +7 -4
- package/libs/CruisePlugin/index.js +11 -8
- package/libs/CurrentPanoImagePlugin/Controller.js +6 -3
- package/libs/CurrentPanoImagePlugin/index.js +7 -4
- package/libs/GuideLinePlugin/Controller.js +9 -6
- package/libs/GuideLinePlugin/GuideLineItem.js +7 -4
- package/libs/GuideLinePlugin/GuideLineModeItem/index.js +4 -3
- package/libs/GuideLinePlugin/GuideLineModeItem.js +7 -4
- package/libs/GuideLinePlugin/index.js +11 -8
- package/libs/ModelMakerPlugin/Controller.js +7 -4
- package/libs/ModelMakerPlugin/index.js +7 -4
- package/libs/ModelMakerPlugin/item/baseItem.js +2 -2
- package/libs/ModelMakerPlugin/item/boxItem.js +2 -2
- package/libs/ModelMakerPlugin/item/polygonItem.js +2 -2
- package/libs/ModelMakerPlugin/item/prismItem.js +2 -2
- package/libs/ModelMakerPlugin/utils/getFiveDomEvent.js +1 -1
- package/libs/ModelTVVideoPlugin/Plugin.js +7 -4
- package/libs/ModelTVVideoPlugin/index.js +6 -3
- package/libs/Object3DHelperPlugin/Controller.js +6 -3
- package/libs/Object3DHelperPlugin/index.js +9 -6
- package/libs/PanoCompassPlugin/Controller.js +6 -3
- package/libs/PanoCompassPlugin/index.js +7 -4
- package/libs/PanoDoorLabelPlugin/BaseController.js +16 -13
- package/libs/PanoDoorLabelPlugin/Controller.js +58 -55
- package/libs/PanoDoorLabelPlugin/index.js +7 -4
- package/libs/PanoMeasurePlugin/Components/Controller0.js +6 -3
- package/libs/PanoMeasurePlugin/Components/Controller1.js +6 -3
- package/libs/PanoMeasurePlugin/Controller/EditController.js +6 -3
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +6 -3
- package/libs/PanoMeasurePlugin/Controller/index.js +6 -3
- package/libs/PanoMeasurePlugin/Model/area.js +6 -3
- package/libs/PanoMeasurePlugin/Modules/Magnifier.js +4 -1
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +6 -3
- package/libs/PanoMeasurePlugin/index.js +17 -14
- package/libs/PanoMeasurePlugin/utils/dom/areaDom.js +16 -13
- package/libs/PanoSpatialTagPlugin/Plugin.js +7 -4
- package/libs/PanoSpatialTagPlugin/index.js +4 -1
- package/libs/PanoTagPlugin/Components/Common/TagPoint.js +24 -21
- package/libs/PanoTagPlugin/Components/Tag/MarketingTag.js +6 -3
- package/libs/PanoTagPlugin/Components/Tag/index.js +6 -3
- package/libs/PanoTagPlugin/Components/TagContainer.js +6 -3
- package/libs/PanoTagPlugin/Components/TagItem.js +6 -3
- package/libs/PanoTagPlugin/controller/Tag/BaseTag.js +11 -5
- package/libs/PanoTagPlugin/controller/Tag/ModelTag.js +14 -11
- package/libs/PanoTagPlugin/controller/Tag/PlaneTag.js +12 -9
- package/libs/PanoTagPlugin/controller/Tag/PointTag.js +10 -7
- package/libs/PanoTagPlugin/controller/TagRender.js +7 -4
- package/libs/PanoTagPlugin/controller/TagUtil.js +7 -4
- package/libs/PanoTagPlugin/controller/index.js +10 -7
- package/libs/PanoTagPlugin/index.js +16 -13
- package/libs/PanoTagPlugin/utils/tag/calculateTagConfig.js +25 -22
- package/libs/PanoVideoPlugin/Controller.js +9 -6
- package/libs/PanoVideoPlugin/VideoMeshController.js +6 -3
- package/libs/PanoVideoPlugin/index.js +9 -6
- package/libs/PipelinePlugin/Controller.js +13 -10
- package/libs/PipelinePlugin/index.js +7 -4
- package/libs/PipelinePlugin/utils/Objects/FlowPipe.js +6 -3
- package/libs/PipelinePlugin/utils/Objects/HighlightPipe.js +16 -13
- package/libs/PipelinePlugin/utils/Objects/Pipe.js +20 -17
- package/libs/Sculpt/Meshes/Box.js +7 -6
- package/libs/Sculpt/Meshes/Cylinder.js +4 -3
- package/libs/Sculpt/Meshes/Line.d.ts +2 -1
- package/libs/Sculpt/Meshes/Line.js +11 -10
- package/libs/Sculpt/Meshes/LineWithDots.js +1 -1
- package/libs/Sculpt/Meshes/Point.js +11 -10
- package/libs/Sculpt/Meshes/PolygonWithEdge.js +1 -1
- package/libs/Sculpt/Meshes/Polyline.js +31 -31
- package/libs/Sculpt/Meshes/Prism.d.ts +1 -0
- package/libs/Sculpt/Meshes/Prism.js +48 -38
- package/libs/Sculpt/Meshes/Rectangle.js +5 -4
- package/libs/Sculpt/Objects/Line/Editor.js +4 -3
- package/libs/Sculpt/index.js +4 -3
- package/libs/Sculpt/utils/Modules/Global.js +1 -1
- package/libs/Sculpt/utils/three/ColoredMesh.js +5 -4
- package/libs/base/BasePlugin.js +5 -4
- package/libs/floorplan/MapviewFloorplanPlugin/Controller.js +6 -3
- package/libs/floorplan/MapviewFloorplanPlugin/index.js +7 -4
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +6 -3
- package/libs/floorplan/ModelFloorplanPlugin/index.js +7 -4
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +6 -3
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +7 -4
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +6 -3
- package/libs/floorplan/TopviewFloorplanPlugin/index.js +7 -4
- package/libs/floorplan/index.js +2 -1
- package/libs/index.js +131 -128
- package/libs/shared-utils/Object3DHelper/Controller/MoveController.js +57 -57
- package/libs/shared-utils/Object3DHelper/Controller/RotateController.d.ts +0 -1
- package/libs/shared-utils/Object3DHelper/Controller/RotateController.js +91 -97
- package/libs/shared-utils/Object3DHelper/Controller/ScaleController.d.ts +1 -1
- package/libs/shared-utils/Object3DHelper/Controller/ScaleController.js +34 -31
- package/libs/shared-utils/Object3DHelper/Helper/CSS3DScaleHelper.js +1 -1
- package/libs/shared-utils/Object3DHelper/Helper/MoveHelper.js +1 -1
- package/libs/shared-utils/Object3DHelper/Helper/index.js +1 -1
- package/libs/shared-utils/five/FiveDomEvents.js +1 -1
- package/libs/shared-utils/five/FiveLine.js +6 -18
- package/libs/shared-utils/five/index.js +4 -3
- package/libs/shared-utils/five/lookObject.js +18 -17
- package/libs/shared-utils/index.js +1 -1
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/three/PointSelector/index.d.ts +2 -1
- package/libs/shared-utils/three/PointSelector/index.js +24 -22
- package/libs/shared-utils/three/PointSelector/utils/PointSelectorHelper.js +1 -1
- package/libs/shared-utils/three/boundingBox.js +1 -1
- package/libs/shared-utils/three/generatePolygonGeometry.d.ts +1 -1
- package/libs/shared-utils/three/generatePolygonGeometry.js +8 -10
- package/libs/shared-utils/three/index.d.ts +1 -1
- package/libs/shared-utils/three/index.js +2 -1
- package/libs/vendor/three/build/three.module.js +19336 -0
- package/libs/vendor/three/examples/jsm/lines/LineGeometry.js +28 -0
- package/libs/vendor/three/examples/jsm/lines/LineSegmentsGeometry.js +69 -0
- package/package.json +1 -1
- /package/dist/shared-utils/three/{objects → core}/LineSegments.d.ts +0 -0
- /package/dist/shared-utils/three/{THREERaycaster.d.ts → core/Raycaster.d.ts} +0 -0
- /package/dist/shared-utils/three/{THREESphere.d.ts → core/Sphere.d.ts} +0 -0
- /package/libs/shared-utils/three/{objects → core}/LineSegments.d.ts +0 -0
- /package/libs/shared-utils/three/{objects → core}/LineSegments.js +0 -0
- /package/libs/shared-utils/three/{THREERaycaster.d.ts → core/Raycaster.d.ts} +0 -0
- /package/libs/shared-utils/three/{THREERaycaster.js → core/Raycaster.js} +0 -0
- /package/libs/shared-utils/three/{THREESphere.d.ts → core/Sphere.d.ts} +0 -0
- /package/libs/shared-utils/three/{THREESphere.js → core/Sphere.js} +0 -0
|
@@ -1,155 +1,149 @@
|
|
|
1
|
-
var
|
|
2
|
-
var w = (
|
|
3
|
-
var d = (
|
|
4
|
-
import { BaseController as
|
|
5
|
-
import * as
|
|
6
|
-
import { getMouseRaycaster as
|
|
7
|
-
import { setObjectQuaternion as
|
|
8
|
-
import { rad2Deg as
|
|
1
|
+
var j = Object.defineProperty;
|
|
2
|
+
var w = (g, h, t) => h in g ? j(g, h, { enumerable: !0, configurable: !0, writable: !0, value: t }) : g[h] = t;
|
|
3
|
+
var d = (g, h, t) => (w(g, typeof h != "symbol" ? h + "" : h, t), t);
|
|
4
|
+
import { BaseController as D } from "../Base/BaseController.js";
|
|
5
|
+
import * as c from "three";
|
|
6
|
+
import { getMouseRaycaster as O } from "../utils/getMouseRaycaster.js";
|
|
7
|
+
import { setObjectQuaternion as C } from "../utils/setObjectQuaternion.js";
|
|
8
|
+
import { rad2Deg as L } from "../../math/rad2Deg.js";
|
|
9
9
|
import { deg2Rad as f } from "../../math/deg2Rad.js";
|
|
10
|
-
const y = new
|
|
11
|
-
class
|
|
12
|
-
constructor(...
|
|
13
|
-
var l,
|
|
14
|
-
super(...
|
|
10
|
+
const y = new c.Quaternion();
|
|
11
|
+
class x extends D {
|
|
12
|
+
constructor(...t) {
|
|
13
|
+
var l, a, m;
|
|
14
|
+
super(...t);
|
|
15
15
|
d(this, "name", "RotateController");
|
|
16
16
|
d(this, "startInfo");
|
|
17
17
|
d(this, "removeListener");
|
|
18
|
-
const
|
|
19
|
-
this.hoverListener([(l =
|
|
20
|
-
const
|
|
21
|
-
this.domEvents.addEventListener(this.helperObject3D, "mousedown",
|
|
22
|
-
this.domEvents.removeEventListener(this.helperObject3D, "mousedown",
|
|
23
|
-
};
|
|
18
|
+
const n = this.helperObject3D;
|
|
19
|
+
this.hoverListener([(l = n.xCircle) == null ? void 0 : l.circle, (a = n.yCircle) == null ? void 0 : a.circle, (m = n.zCircle) == null ? void 0 : m.circle].filter(Boolean));
|
|
20
|
+
const e = this.dragStart.bind(this), o = this.dragging.bind(this), s = this.dragEnd.bind(this), i = this.show.bind(this), r = this.hide.bind(this);
|
|
21
|
+
this.domEvents.addEventListener(this.helperObject3D, "mousedown", e), document.addEventListener("mousemove", o), document.addEventListener("mouseup", s), this.domEvents.addEventListener(this.helperObject3D, "touchstart", e), document.addEventListener("touchmove", o), document.addEventListener("touchend", s), this.hooks.on("moveStart", r), this.hooks.on("moveEnd", i), this.hooks.on("scaleStart", r), this.hooks.on("scaleEnd", i), this.hooks.on("moveByMouseEnable", r), this.hooks.on("moveByMouseDisable", i), this.disposers.push(() => {
|
|
22
|
+
this.domEvents.removeEventListener(this.helperObject3D, "mousedown", e), document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", s), this.domEvents.removeEventListener(this.helperObject3D, "touchstart", e), document.removeEventListener("touchmove", o), document.removeEventListener("touchend", s), this.hooks.off("moveStart", r), this.hooks.off("moveEnd", i), this.hooks.off("scaleStart", r), this.hooks.off("scaleEnd", i), this.hooks.off("moveByMouseEnable", r), this.hooks.off("moveByMouseDisable", i);
|
|
23
|
+
});
|
|
24
24
|
}
|
|
25
25
|
get rotateCenter() {
|
|
26
26
|
return this.helperObject3D.position.clone();
|
|
27
27
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
setRotateAngle(n) {
|
|
32
|
-
const { x: e = 0, y: t = 0, z: i = 0 } = n, s = new a.Euler(f(e), f(t), f(i)), r = new a.Quaternion().setFromEuler(s);
|
|
33
|
-
if (this.hooks.emit("wantToRotate", r))
|
|
28
|
+
setRotateAngle(t) {
|
|
29
|
+
const { x: n = 0, y: e = 0, z: o = 0 } = t, s = new c.Euler(f(n), f(e), f(o)), i = new c.Quaternion().setFromEuler(s);
|
|
30
|
+
if (this.hooks.emit("wantToRotate", i))
|
|
34
31
|
return;
|
|
35
|
-
const { originObject3D: l, rotateCenter:
|
|
36
|
-
|
|
32
|
+
const { originObject3D: l, rotateCenter: a } = this;
|
|
33
|
+
C(l, i, a), this.internalHooks.emit("setObjectRotate", i, a), this.hooks.emit("rotate", i), this.render();
|
|
37
34
|
}
|
|
38
|
-
|
|
39
|
-
this.
|
|
35
|
+
onApplyOriginObjectRotate(t) {
|
|
36
|
+
this.isDragging || super.onApplyOriginObjectRotate(t);
|
|
40
37
|
}
|
|
41
|
-
|
|
42
|
-
this.isDragging || super.onApplyOriginObjectRotate(n);
|
|
43
|
-
}
|
|
44
|
-
onApplyOriginObjectScale(n) {
|
|
38
|
+
onApplyOriginObjectScale(t) {
|
|
45
39
|
}
|
|
46
40
|
/**
|
|
47
41
|
* @description: 拖动开始,找出拖的Direction
|
|
48
42
|
*/
|
|
49
|
-
dragStart(
|
|
43
|
+
dragStart(t) {
|
|
50
44
|
if (this.isDragging)
|
|
51
45
|
return;
|
|
52
|
-
const
|
|
53
|
-
if (!
|
|
46
|
+
const n = t == null ? void 0 : t.intersect;
|
|
47
|
+
if (!n)
|
|
54
48
|
return this.dragEnd();
|
|
55
|
-
const
|
|
56
|
-
if (!
|
|
49
|
+
const e = (n == null ? void 0 : n.object).direction;
|
|
50
|
+
if (!e)
|
|
57
51
|
return this.dragEnd();
|
|
58
|
-
const
|
|
52
|
+
const o = n.point, s = this.getAngleHelper(e);
|
|
59
53
|
this.setTipsAngle(0);
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
if (
|
|
64
|
-
return new
|
|
65
|
-
if (
|
|
66
|
-
return new
|
|
67
|
-
if (
|
|
68
|
-
return new
|
|
69
|
-
})(),
|
|
70
|
-
this.setAngleHelperStart(
|
|
54
|
+
const i = o.clone();
|
|
55
|
+
i.y += 0.2, this.setTipsPosition(i);
|
|
56
|
+
const r = this.helperObject3D.quaternion.clone(), l = (() => {
|
|
57
|
+
if (e === "x")
|
|
58
|
+
return new c.Vector3(1, 0, 0).applyQuaternion(r);
|
|
59
|
+
if (e === "y")
|
|
60
|
+
return new c.Vector3(0, 1, 0).applyQuaternion(r);
|
|
61
|
+
if (e === "z")
|
|
62
|
+
return new c.Vector3(0, 0, 1).applyQuaternion(r);
|
|
63
|
+
})(), a = new c.Plane().setFromNormalAndCoplanarPoint(l, o), p = a.projectPoint(o.clone(), new c.Vector3()).clone().sub(this.rotateCenter), u = p.angleTo(s.baseAxes.clone().applyQuaternion(r));
|
|
64
|
+
this.setAngleHelperStart(e, u), this.setAngleHelperLength(e, 0), this.startInfo = { direction: e, startVector: p, plane: a, angleHelper: s, angle: 0, helperQuaternion: r.clone() }, y.copy(r), this.helperObject3D.showDraggingHelper([e]), this.hooks.emit("rotateStart"), this.isDragging = !0;
|
|
71
65
|
}
|
|
72
|
-
dragging(
|
|
66
|
+
dragging(t) {
|
|
73
67
|
if (!this.isDragging)
|
|
74
68
|
return;
|
|
75
|
-
const e =
|
|
76
|
-
return
|
|
69
|
+
const n = "touches" in t ? t.touches[0].clientX : t.x, e = "touches" in t ? t.touches[0].clientY : t.y, o = O(this.camera, { x: n, y: e }, this.container);
|
|
70
|
+
return o ? (this.rotate(o), !1) : this.dragEnd();
|
|
77
71
|
}
|
|
78
|
-
rotate(
|
|
72
|
+
rotate(t) {
|
|
79
73
|
if (!this.startInfo)
|
|
80
74
|
return this.dragEnd();
|
|
81
|
-
const { startVector:
|
|
75
|
+
const { startVector: n, plane: e, angleHelper: o, direction: s, helperQuaternion: i } = this.startInfo, { originObject3D: r } = this, l = t.ray.intersectPlane(e, new c.Vector3());
|
|
82
76
|
if (!l)
|
|
83
77
|
return;
|
|
84
|
-
const
|
|
85
|
-
if (
|
|
78
|
+
const a = this.rotateCenter.clone(), p = e.projectPoint(l.clone(), new c.Vector3()).clone().sub(a);
|
|
79
|
+
if (n.angleTo(p) === 0)
|
|
86
80
|
return;
|
|
87
|
-
const
|
|
88
|
-
if (this.hooks.emit("wantToRotate",
|
|
81
|
+
const u = new c.Quaternion().setFromUnitVectors(n.clone().normalize(), p.clone().normalize()), v = r.quaternion.clone().premultiply(u);
|
|
82
|
+
if (this.hooks.emit("wantToRotate", v))
|
|
89
83
|
return;
|
|
90
|
-
const E = new
|
|
91
|
-
new
|
|
92
|
-
|
|
93
|
-
p.clone().normalize().applyQuaternion(
|
|
84
|
+
const E = new c.Euler().setFromQuaternion(
|
|
85
|
+
new c.Quaternion().setFromUnitVectors(
|
|
86
|
+
n.clone().normalize().applyQuaternion(i.clone().inverse()),
|
|
87
|
+
p.clone().normalize().applyQuaternion(i.clone().inverse())
|
|
94
88
|
),
|
|
95
89
|
`${s.toUpperCase()}${"XZY".replace(s.toUpperCase(), "")}`
|
|
96
|
-
)[s] *
|
|
97
|
-
if (this.startInfo.angle += E, this.setAngleHelperLength(s, this.startInfo.angle), this.setTipsAngle(
|
|
98
|
-
const
|
|
99
|
-
|
|
90
|
+
)[s] * o.angleDirection;
|
|
91
|
+
if (this.startInfo.angle += E, this.setAngleHelperLength(s, this.startInfo.angle), this.setTipsAngle(L(this.startInfo.angle)), a) {
|
|
92
|
+
const b = new c.Vector3().subVectors(r.position, a).applyQuaternion(u).add(a);
|
|
93
|
+
r.position.copy(b);
|
|
100
94
|
}
|
|
101
|
-
|
|
95
|
+
r.applyQuaternion(u), y.premultiply(u), this.internalHooks.emit("applyObjectRotate", { quaternion: u, origin: a }), this.hooks.emit("rotate", r.quaternion), this.startInfo.startVector = p;
|
|
102
96
|
}
|
|
103
97
|
dragEnd() {
|
|
104
98
|
this.isDragging && (this.internalHooks.emit("setObjectRotate", y, this.rotateCenter), this.startInfo = void 0, this.isDragging = !1, this.helperObject3D.show(), this.hooks.emit("rotateEnd"));
|
|
105
99
|
}
|
|
106
|
-
getAngleHelper(
|
|
107
|
-
var
|
|
108
|
-
switch (
|
|
100
|
+
getAngleHelper(t) {
|
|
101
|
+
var n, e, o;
|
|
102
|
+
switch (t) {
|
|
109
103
|
case "x":
|
|
110
|
-
return (
|
|
104
|
+
return (n = this.helperObject3D.xCircle) == null ? void 0 : n.angleSector;
|
|
111
105
|
case "y":
|
|
112
|
-
return (
|
|
106
|
+
return (e = this.helperObject3D.yCircle) == null ? void 0 : e.angleSector;
|
|
113
107
|
case "z":
|
|
114
|
-
return (
|
|
108
|
+
return (o = this.helperObject3D.zCircle) == null ? void 0 : o.angleSector;
|
|
115
109
|
}
|
|
116
110
|
}
|
|
117
|
-
setAngleHelperStart(
|
|
118
|
-
const
|
|
119
|
-
if (!
|
|
111
|
+
setAngleHelperStart(t, n) {
|
|
112
|
+
const e = this.getAngleHelper(t);
|
|
113
|
+
if (!e) {
|
|
120
114
|
console.warn("angleHelper is undefined");
|
|
121
115
|
return;
|
|
122
116
|
}
|
|
123
|
-
if (
|
|
124
|
-
const { radius:
|
|
125
|
-
|
|
117
|
+
if (e instanceof c.Mesh && e.geometry instanceof c.CircleGeometry) {
|
|
118
|
+
const { radius: o, segments: s, thetaLength: i } = e.geometry.parameters;
|
|
119
|
+
e.geometry = new c.CircleGeometry(o, s, n, i);
|
|
126
120
|
} else
|
|
127
121
|
console.warn("only support THREE.CircleGeometry");
|
|
128
122
|
}
|
|
129
|
-
setAngleHelperLength(
|
|
130
|
-
const
|
|
131
|
-
if (s instanceof
|
|
132
|
-
const { radius:
|
|
133
|
-
s.geometry = new
|
|
123
|
+
setAngleHelperLength(t, n) {
|
|
124
|
+
const o = n >= 0 ? Math.max(n, 1e-3) : Math.min(n, -1e-3), s = this.getAngleHelper(t);
|
|
125
|
+
if (s instanceof c.Mesh && s.geometry instanceof c.CircleGeometry) {
|
|
126
|
+
const { radius: i, thetaStart: r } = s.geometry.parameters, l = Math.ceil(Math.abs(o) * (40 / (2 * Math.PI)));
|
|
127
|
+
s.geometry = new c.CircleGeometry(i, l, r, o);
|
|
134
128
|
} else
|
|
135
129
|
console.warn("only support THREE.CircleGeometry");
|
|
136
130
|
}
|
|
137
|
-
setTipsAngle(
|
|
138
|
-
var
|
|
139
|
-
const
|
|
140
|
-
|
|
131
|
+
setTipsAngle(t) {
|
|
132
|
+
var e;
|
|
133
|
+
const n = (e = this.helperObject3D.angleTips) == null ? void 0 : e.element;
|
|
134
|
+
n && (n.innerText = `${t.toFixed(0)}°`);
|
|
141
135
|
}
|
|
142
|
-
setTipsPosition(
|
|
143
|
-
const
|
|
144
|
-
if (!
|
|
136
|
+
setTipsPosition(t) {
|
|
137
|
+
const n = this.helperObject3D.angleTips;
|
|
138
|
+
if (!n)
|
|
145
139
|
return;
|
|
146
|
-
const
|
|
147
|
-
if (
|
|
140
|
+
const e = t.project(this.camera), { x: o, y: s, z: i } = e;
|
|
141
|
+
if (i > 1)
|
|
148
142
|
return;
|
|
149
|
-
const
|
|
150
|
-
|
|
143
|
+
const r = (o + 1) / 2 * 100 + "%", l = (-s + 1) / 2 * 100 + "%";
|
|
144
|
+
n.setLeftTop(r, l);
|
|
151
145
|
}
|
|
152
146
|
}
|
|
153
147
|
export {
|
|
154
|
-
|
|
148
|
+
x as RotateController
|
|
155
149
|
};
|
|
@@ -1,45 +1,48 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { BaseController as
|
|
5
|
-
import * as
|
|
6
|
-
import { getMouseRaycaster as
|
|
7
|
-
import { rayOnLine as
|
|
8
|
-
class
|
|
1
|
+
var f = Object.defineProperty;
|
|
2
|
+
var v = (d, a, t) => a in d ? f(d, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : d[a] = t;
|
|
3
|
+
var c = (d, a, t) => (v(d, typeof a != "symbol" ? a + "" : a, t), t);
|
|
4
|
+
import { BaseController as p } from "../Base/BaseController.js";
|
|
5
|
+
import * as m from "three";
|
|
6
|
+
import { getMouseRaycaster as E } from "../utils/getMouseRaycaster.js";
|
|
7
|
+
import { rayOnLine as g } from "../../../Sculpt/utils/three/rayOnLine.js";
|
|
8
|
+
class S extends p {
|
|
9
9
|
constructor(...t) {
|
|
10
10
|
super(...t);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
c(this, "name", "ScaleController");
|
|
12
|
+
c(this, "startInfo");
|
|
13
|
+
c(this, "dragStart", (t) => {
|
|
14
14
|
if (this.isDragging)
|
|
15
15
|
return;
|
|
16
16
|
this.isDragging = !0;
|
|
17
|
-
const { intersect: e } = t,
|
|
17
|
+
const { intersect: e } = t, o = this.camera.position, s = e.object, i = s.scalePosition.basePosition.clone(), r = s.scalePosition.handlePosition.clone().clone().sub(i).clone(), n = new m.Line3(i, i.clone().add(r.normalize().multiplyScalar(5)));
|
|
18
18
|
n.applyMatrix4(this.helperObject3D.matrixWorld);
|
|
19
|
-
const
|
|
20
|
-
this.startInfo = { line: n, scaleStartPoint:
|
|
19
|
+
const h = new m.Raycaster(o, e.point.clone().sub(o)), u = g({ raycaster: h, line: n });
|
|
20
|
+
this.startInfo = { line: n, scaleStartPoint: u, draggingObject: s }, this.hooks.emit("scaleStart");
|
|
21
21
|
});
|
|
22
|
-
|
|
22
|
+
c(this, "dragging", (t) => {
|
|
23
23
|
if (!this.isDragging || !this.startInfo)
|
|
24
24
|
return;
|
|
25
|
-
const e =
|
|
26
|
-
return
|
|
25
|
+
const e = "touches" in t ? t.touches[0].clientX : t.x, o = "touches" in t ? t.touches[0].clientY : t.y, s = E(this.camera, { x: e, y: o }, this.container);
|
|
26
|
+
return s ? (this.scale(s), !1) : this.dragEnd();
|
|
27
27
|
});
|
|
28
|
-
|
|
29
|
-
var n,
|
|
28
|
+
c(this, "scale", (t) => {
|
|
29
|
+
var n, h;
|
|
30
30
|
if (!this.startInfo)
|
|
31
31
|
return;
|
|
32
|
-
const { line: e, scaleStartPoint:
|
|
33
|
-
|
|
34
|
-
ratio:
|
|
35
|
-
intersectPoint:
|
|
32
|
+
const { line: e, scaleStartPoint: o, draggingObject: s } = this.startInfo, { scalePosition: i } = s, { basePosition: l } = i, r = g({ raycaster: t, line: e });
|
|
33
|
+
r.applyMatrix4(new m.Matrix4().getInverse(this.helperObject3D.matrixWorld.clone())), (h = (n = this.config) == null ? void 0 : n.scaleCallback) == null || h.call(n, {
|
|
34
|
+
ratio: r.distanceTo(l) / o.distanceTo(l),
|
|
35
|
+
intersectPoint: r,
|
|
36
36
|
scalePosition: i
|
|
37
|
-
}),
|
|
37
|
+
}), s.position.copy(r.clone());
|
|
38
38
|
});
|
|
39
|
-
|
|
39
|
+
c(this, "dragEnd", () => {
|
|
40
40
|
this.isDragging && (this.startInfo = void 0, this.isDragging = !1, this.internalHooks.emit("initialHelperPosition"), this.hooks.emit("scaleEnd"));
|
|
41
41
|
});
|
|
42
|
-
this.
|
|
42
|
+
const e = this.show.bind(this), o = this.hide.bind(this);
|
|
43
|
+
this.domEvents.addEventListener(this.helperObject3D, "mousedown", this.dragStart), document.addEventListener("mousemove", this.dragging), document.addEventListener("mouseup", this.dragEnd), this.domEvents.addEventListener(this.helperObject3D, "touchstart", this.dragStart), document.addEventListener("touchmove", this.dragging), document.addEventListener("touchend", this.dragEnd), this.hooks.on("rotateStart", o), this.hooks.on("rotateEnd", e), this.hooks.on("moveStart", o), this.hooks.on("moveEnd", e), this.hooks.on("moveByMouseEnable", o), this.hooks.on("moveByMouseDisable", e), this.disposers.push(() => {
|
|
44
|
+
this.domEvents.removeEventListener(this.helperObject3D, "mousedown", this.dragStart), document.removeEventListener("mousemove", this.dragging), document.removeEventListener("mouseup", this.dragEnd), this.domEvents.removeEventListener(this.helperObject3D, "touchstart", this.dragStart), document.removeEventListener("touchmove", this.dragging), document.removeEventListener("touchend", this.dragEnd), this.hooks.off("rotateStart", o), this.hooks.off("rotateEnd", e), this.hooks.off("moveStart", o), this.hooks.off("moveEnd", e), this.hooks.off("moveByMouseEnable", o), this.hooks.off("moveByMouseDisable", e);
|
|
45
|
+
});
|
|
43
46
|
}
|
|
44
47
|
initialHelperQuaternion() {
|
|
45
48
|
this.helperObject3D.initQuaternion();
|
|
@@ -50,13 +53,13 @@ class H extends b {
|
|
|
50
53
|
t.offHoverListener && t.offHoverListener(), t.offHoverListener = this.hoverListener(this.helperObject3D.scaleMeshes);
|
|
51
54
|
}
|
|
52
55
|
setScale(t) {
|
|
53
|
-
var
|
|
54
|
-
let e = 1,
|
|
55
|
-
typeof t == "number" ? (e = t,
|
|
56
|
-
const i = new
|
|
56
|
+
var r, n, h;
|
|
57
|
+
let e = 1, o = 1, s = 1;
|
|
58
|
+
typeof t == "number" ? (e = t, o = t, s = t) : typeof t == "object" && (e = (r = t.x) != null ? r : 1, o = (n = t.y) != null ? n : 1, s = (h = t.z) != null ? h : 1);
|
|
59
|
+
const i = new m.Vector3(e, o, s);
|
|
57
60
|
this.hooks.emit("wantToScale", i) || (this.originObject3D.scale.copy(i), this.internalHooks.emit("setObjectScale", i), this.hooks.emit("scale", i), this.render());
|
|
58
61
|
}
|
|
59
62
|
}
|
|
60
63
|
export {
|
|
61
|
-
|
|
64
|
+
S as ScaleController
|
|
62
65
|
};
|
|
@@ -5,7 +5,7 @@ import { CSS3DRender as f } from "../../../CSS3DRenderPlugin/utils/three/CSS3DRe
|
|
|
5
5
|
import * as p from "three";
|
|
6
6
|
import { RectangleScaleHelperAbstract as u } from "../Base/BaseHelper.js";
|
|
7
7
|
import { rectangleScaleDom as y } from "./HTML/rectangleScaleDom.js";
|
|
8
|
-
import "../../three/
|
|
8
|
+
import "../../three/core/Sphere.js";
|
|
9
9
|
class v extends u {
|
|
10
10
|
// eslint-disable-next-line max-params
|
|
11
11
|
constructor(e, t, s, l) {
|
|
@@ -7,7 +7,7 @@ import { AXES_THREE_COLOR as w } from "../Constants/color.js";
|
|
|
7
7
|
import { calculateScaleByCamera as a } from "../utils/calculateScaleByCamera.js";
|
|
8
8
|
import "three";
|
|
9
9
|
import "../../../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
|
|
10
|
-
import "../../three/
|
|
10
|
+
import "../../three/core/Sphere.js";
|
|
11
11
|
class z extends h {
|
|
12
12
|
constructor(r, s) {
|
|
13
13
|
super(r, s);
|
|
@@ -13,7 +13,7 @@ var o = (u, e, t) => (M(u, typeof e != "symbol" ? e + "" : e, t), t);
|
|
|
13
13
|
import { getObjectVisible as $ } from "../three/getObjectVisible.js";
|
|
14
14
|
import { calculateThreeMouse as W } from "./calculateThreeMouse.js";
|
|
15
15
|
import { getFiveModel as j } from "./getFiveModel.js";
|
|
16
|
-
import { THREERaycaster as L } from "../three/
|
|
16
|
+
import { THREERaycaster as L } from "../three/core/Raycaster.js";
|
|
17
17
|
class B {
|
|
18
18
|
// 事件由five触发时,用来补充 originEvent 属性
|
|
19
19
|
constructor(e, t) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Line as r,
|
|
2
|
-
class
|
|
1
|
+
import { Line as r, THREE_Line2 as i, LineMaterial as s } from "@realsee/five/line";
|
|
2
|
+
class o extends r {
|
|
3
3
|
constructor(...e) {
|
|
4
4
|
super(...e);
|
|
5
5
|
}
|
|
@@ -10,7 +10,7 @@ class a extends r {
|
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
class
|
|
13
|
+
class a extends i {
|
|
14
14
|
constructor(...e) {
|
|
15
15
|
super(...e);
|
|
16
16
|
}
|
|
@@ -21,18 +21,7 @@ class u extends s {
|
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
class
|
|
25
|
-
constructor(...e) {
|
|
26
|
-
super(...e);
|
|
27
|
-
}
|
|
28
|
-
toJSON() {
|
|
29
|
-
return {
|
|
30
|
-
type: "FiveLineGeometry",
|
|
31
|
-
attributes: this.attributes
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
class c extends n {
|
|
24
|
+
class c extends s {
|
|
36
25
|
constructor(...e) {
|
|
37
26
|
super(...e);
|
|
38
27
|
}
|
|
@@ -44,8 +33,7 @@ class c extends n {
|
|
|
44
33
|
}
|
|
45
34
|
}
|
|
46
35
|
export {
|
|
47
|
-
|
|
48
|
-
L as LineGeometry,
|
|
36
|
+
o as FiveLine,
|
|
49
37
|
c as LineMaterial,
|
|
50
|
-
|
|
38
|
+
a as THREE_Line2
|
|
51
39
|
};
|
|
@@ -3,12 +3,13 @@ import "hammerjs";
|
|
|
3
3
|
import "three/examples/jsm/renderers/CSS3DRenderer";
|
|
4
4
|
import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
5
5
|
import "@realsee/five/line";
|
|
6
|
+
import "../../vendor/three/examples/jsm/lines/LineGeometry.js";
|
|
6
7
|
import "../tag.js";
|
|
7
|
-
import "../three/
|
|
8
|
+
import "../three/core/Sphere.js";
|
|
8
9
|
import "animejs";
|
|
9
|
-
function
|
|
10
|
+
function u(e) {
|
|
10
11
|
return e.model ? e.work ? e.model.loaded ? e.model.name !== e.work.model.file ? { result: !1, msg: "five.model.name 与 five.work.model.file 不一致" } : { result: !0, msg: "" } : { result: !1, msg: "five.model 未加载完成" } : { result: !1, msg: "five 数据未加载" } : { result: !1, msg: "five.model 不存在" };
|
|
11
12
|
}
|
|
12
13
|
export {
|
|
13
|
-
|
|
14
|
+
u as checkFiveModelLoaded
|
|
14
15
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
var B = Object.defineProperty;
|
|
2
2
|
var U = Object.getOwnPropertySymbols;
|
|
3
3
|
var F = Object.prototype.hasOwnProperty, H = Object.prototype.propertyIsEnumerable;
|
|
4
|
-
var V = (
|
|
5
|
-
for (var t in
|
|
6
|
-
F.call(
|
|
4
|
+
var V = (o, e, t) => e in o ? B(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, T = (o, e) => {
|
|
5
|
+
for (var t in e || (e = {}))
|
|
6
|
+
F.call(e, t) && V(o, t, e[t]);
|
|
7
7
|
if (U)
|
|
8
|
-
for (var t of U(
|
|
9
|
-
H.call(
|
|
10
|
-
return
|
|
8
|
+
for (var t of U(e))
|
|
9
|
+
H.call(e, t) && V(o, t, e[t]);
|
|
10
|
+
return o;
|
|
11
11
|
};
|
|
12
|
-
var g = (
|
|
12
|
+
var g = (o, e, t) => new Promise((r, m) => {
|
|
13
13
|
var u = (a) => {
|
|
14
14
|
try {
|
|
15
15
|
l(t.next(a));
|
|
@@ -23,7 +23,7 @@ var g = (e, o, t) => new Promise((r, m) => {
|
|
|
23
23
|
m(d);
|
|
24
24
|
}
|
|
25
25
|
}, l = (a) => a.done ? r(a.value) : Promise.resolve(a.value).then(u, s);
|
|
26
|
-
l((t = t.apply(
|
|
26
|
+
l((t = t.apply(o, e)).next());
|
|
27
27
|
});
|
|
28
28
|
import * as n from "three";
|
|
29
29
|
import "hammerjs";
|
|
@@ -33,18 +33,19 @@ import { FiveUtil as O } from "../Utils/FiveUtil.js";
|
|
|
33
33
|
import { notNil as Y } from "../isNil.js";
|
|
34
34
|
import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
35
35
|
import "@realsee/five/line";
|
|
36
|
+
import "../../vendor/three/examples/jsm/lines/LineGeometry.js";
|
|
36
37
|
import "../tag.js";
|
|
37
38
|
import { worldBoundingSphere as j } from "../three/boundingBox.js";
|
|
38
39
|
import "animejs";
|
|
39
|
-
function
|
|
40
|
+
function ot(o, e, t) {
|
|
40
41
|
return g(this, null, function* () {
|
|
41
42
|
var P, x, z;
|
|
42
|
-
if (!
|
|
43
|
+
if (!e)
|
|
43
44
|
return;
|
|
44
|
-
const r = j(
|
|
45
|
+
const r = j(e);
|
|
45
46
|
if (!r)
|
|
46
47
|
return;
|
|
47
|
-
const m = new O(
|
|
48
|
+
const m = new O(o), u = (P = t == null ? void 0 : t.scale) != null ? P : 1.4, s = r.center, l = o.camera.position.clone().sub(s).setY(0).normalize(), a = o.state.mode === "Mapview" ? o.state.fov : 60, C = Math.max(1.5, r.radius * u), k = C * (1 / Math.tan(n.MathUtils.degToRad(a / 2)));
|
|
48
49
|
let p = 0;
|
|
49
50
|
const w = [], M = (c) => {
|
|
50
51
|
const i = n.MathUtils.degToRad(c);
|
|
@@ -63,21 +64,21 @@ function tt(e, o, t) {
|
|
|
63
64
|
p += 30;
|
|
64
65
|
}
|
|
65
66
|
const R = M((z = (x = w[2]) != null ? x : w[1]) != null ? z : 0), v = R.distanceTo(s), b = N(s.clone().sub(R).normalize());
|
|
66
|
-
if (
|
|
67
|
-
return
|
|
67
|
+
if (o.state.mode === "Mapview")
|
|
68
|
+
return o.updateCamera(
|
|
68
69
|
T({
|
|
69
70
|
offset: s,
|
|
70
71
|
distance: v
|
|
71
72
|
}, b),
|
|
72
73
|
800
|
|
73
74
|
);
|
|
74
|
-
|
|
75
|
+
o.setState(T({
|
|
75
76
|
mode: "Mapview",
|
|
76
77
|
offset: s,
|
|
77
78
|
distance: v
|
|
78
|
-
}, b)), yield
|
|
79
|
+
}, b)), yield o.ready();
|
|
79
80
|
});
|
|
80
81
|
}
|
|
81
82
|
export {
|
|
82
|
-
|
|
83
|
+
ot as lookObject
|
|
83
84
|
};
|
|
@@ -8,7 +8,7 @@ import { getCoordsFromClient as n, getCoordsFromElement as l } from "./three/get
|
|
|
8
8
|
import { PointHelper as p } from "./three/PointSelector/utils/PointHelper.js";
|
|
9
9
|
import { PointSelectorHelper as f } from "./three/PointSelector/utils/PointSelectorHelper.js";
|
|
10
10
|
import { Object3D as a } from "./three/core/Object3D.js";
|
|
11
|
-
import { LineSegments as d } from "./three/
|
|
11
|
+
import { LineSegments as d } from "./three/core/LineSegments.js";
|
|
12
12
|
import { bounding as g, boundingBox as u, boundingSphere as s, boxVertex as b, boxVertexes as x, worldBounding as c, worldBoundingBox as k, worldBoundingSphere as F } from "./three/boundingBox.js";
|
|
13
13
|
import { animeMap as P, blink as w, reblink as B } from "./three/blink.js";
|
|
14
14
|
import { isNil as S, notNil as v } from "./isNil.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function A() {
|
|
2
2
|
console.debug(
|
|
3
|
-
"%c %c@realsee/dnalogel %cv3.
|
|
3
|
+
"%c %c@realsee/dnalogel %cv3.49.1",
|
|
4
4
|
[
|
|
5
5
|
"background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAMCAMAAACHgmeRAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABLFBMVEUAAAAapPoap/oaqvkbrfkbr/gZnfwZoPsaqfnD4v/E4/8Ylv0clPm93/+/4P/B4f8Yj/683/8Wif+33P8Uhv+x2f8ShP+s1v8Pgf+n0/8Nf/+h0f8Lff8Lff8Nf/9dl/+czv8KfP8KfP+Lxf+Uyv+Xy/+Hwv+Jw/+Mxf+Oxv+RyP8aovsapfoap/oZmfwZm/wZnvsYnPsYkf4YlP0NePsDYfgYcfi43f+63v8Xiv8Xjf4EWfwCV/sWZ/qz2v+02/8Vh/8WiP8EUf8CTf4WXv2u1/+v2P8Thf8Thv8ETf8CR/8VV/+o1f+q1f8Qgv8Rg/8DSv8BRf8UVP+j0v+k0v8OgP8Pgf8DR/8DQv9Nhf+dzv+fz/+Kv/+Vyv+Xy/+azf+Oxv+Qx/+SyP////8MUhLdAAAAK3RSTlMACEWQ2bd98uQECPXxqO7c+Pb49vj2+Pb49vj23Oul8fMHA+TwerXXjEIG2P+bHgAAAAFiS0dEY1y+LaoAAAB+SURBVAjXY2BgZGJmYWVgYGBgY9fW0eVg4ORi4NbTNzDk4eXjZxAwMjYxNTO3EGQQsrSytrG1sxdmEHFwdHJ2cXUTZRBz9/D08vbxFWeQ8PMPCAwKDpFkkAoNC4+IjIqWZpCRlZOPiY2LV2BQVGJQTkhMUlEFWaOmrqGpxQAAyg0S9Dq+VPYAAAAASUVORK5CYII=')",
|
|
6
6
|
"background-repeat: no-repeat",
|
|
@@ -6,12 +6,13 @@ import { Subscribe } from '../../Subscribe';
|
|
|
6
6
|
import type { LiteralString } from '../../../typings/utils.type';
|
|
7
7
|
export type { PointIntersection };
|
|
8
8
|
export type ActionIfNoModelUnderMouse = LiteralString<'virtualPoint' | 'lastPoint' | 'disable'>;
|
|
9
|
+
type PointerSelectorMode = 'fixed' | 'cursor';
|
|
9
10
|
interface Config {
|
|
10
11
|
/**
|
|
11
12
|
* @description: 选点的两种模式, 'fixed' 为固定选点为屏幕中心点,拖动five画布来更新点,'cursor' 为跟随鼠标移动来更新点, 'auto' 则根据设备类型自动选择
|
|
12
13
|
* @default: 'auto'
|
|
13
14
|
*/
|
|
14
|
-
mode:
|
|
15
|
+
mode: PointerSelectorMode | 'auto';
|
|
15
16
|
/**
|
|
16
17
|
* @description 当鼠标位置没有模型时的行为
|
|
17
18
|
* ```markdown
|