@realsee/dnalogel 3.51.0 → 3.52.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 +15 -0
- package/dist/Object3DHelperPlugin/Controller.d.ts +9 -9
- package/dist/Object3DHelperPlugin/FiveControllerWrapper.d.ts +4 -2
- package/dist/PanoMeasurePlugin/Model/area.d.ts +1 -1
- package/dist/PanoMeasurePlugin/Model/polygon.d.ts +1 -1
- package/dist/PanoMeasurePlugin/typings/data.d.ts +1 -2
- package/dist/Sculpt/Editors/BoxMeshEditor.d.ts +5 -0
- package/dist/Sculpt/Editors/CircleMeshEditor.d.ts +5 -0
- package/dist/Sculpt/Editors/CylinderMeshEditor.d.ts +5 -0
- package/dist/Sculpt/Editors/PrismMeshEditor.d.ts +5 -0
- package/dist/Sculpt/Editors/RectangleMeshEditor.d.ts +5 -0
- package/dist/Sculpt/Meshes/Box.d.ts +6 -24
- package/dist/Sculpt/Meshes/Circle.d.ts +0 -4
- package/dist/Sculpt/Meshes/Cylinder.d.ts +0 -1
- package/dist/Sculpt/Meshes/Line.d.ts +9 -22
- package/dist/Sculpt/Meshes/Polygon.d.ts +1 -5
- package/dist/Sculpt/Meshes/PolygonWithEdge.d.ts +1 -1
- package/dist/Sculpt/Meshes/Prism.d.ts +29 -10
- package/dist/Sculpt/Meshes/Rectangle.d.ts +1 -5
- package/dist/Sculpt/Objects/Base/index.d.ts +3 -3
- package/dist/Sculpt/Objects/Box/index.d.ts +7 -2
- package/dist/Sculpt/Objects/Circle/index.d.ts +3 -0
- package/dist/Sculpt/Objects/Cylinder/index.d.ts +3 -0
- package/dist/Sculpt/Objects/Line/index.d.ts +3 -0
- package/dist/Sculpt/Objects/Point/index.d.ts +3 -0
- package/dist/Sculpt/Objects/Polygon/index.d.ts +3 -0
- package/dist/Sculpt/Objects/Polyline/index.d.ts +3 -0
- package/dist/Sculpt/Objects/Prism/index.d.ts +3 -0
- package/dist/Sculpt/Objects/Rectangle/index.d.ts +13 -2
- package/dist/Sculpt/index.d.ts +10 -19
- package/dist/Sculpt/typings/style.d.ts +6 -0
- package/dist/Sculpt/utils/export.d.ts +24 -18
- package/dist/Sculpt/utils/sortPositionsByCameraPosition.d.ts +5 -0
- package/dist/Sculpt/utils/three/ColoredMesh.d.ts +4 -0
- package/dist/index.cjs.js +88 -3009
- package/dist/index.d.ts +79 -1
- package/dist/index.js +35141 -54254
- package/dist/index.umd.js +81 -3002
- package/dist/shared-utils/Object3DHelper/Base/BaseController.d.ts +1 -0
- package/dist/shared-utils/Object3DHelper/Base/BaseHelper.d.ts +7 -3
- package/dist/shared-utils/Object3DHelper/Controller/ScaleController.d.ts +0 -1
- package/dist/shared-utils/Object3DHelper/Helper/BoundingBoxHelper.d.ts +3 -1
- package/dist/shared-utils/Object3DHelper/Helper/CSS3DScaleHelper.d.ts +2 -0
- package/dist/shared-utils/Object3DHelper/Helper/MoveHelper.d.ts +2 -1
- package/dist/shared-utils/Object3DHelper/Helper/RotateHelper.d.ts +2 -1
- package/dist/shared-utils/Object3DHelper/Helper/ScaleHelper.d.ts +4 -2
- package/dist/shared-utils/Object3DHelper/typings/index.d.ts +1 -1
- package/dist/shared-utils/Object3DHelper/utils/calculateScaleByCamera.d.ts +4 -1
- package/dist/shared-utils/five/FiveLine.d.ts +18 -14
- package/dist/shared-utils/index.d.ts +0 -1
- package/dist/shared-utils/math/planimetry.d.ts +1 -1
- package/dist/shared-utils/tag.d.ts +5 -7
- package/dist/shared-utils/three/boundingBox.d.ts +14 -20
- package/dist/shared-utils/three/core/LineGeometry.d.ts +13 -0
- package/dist/shared-utils/three/core/PrismGeometry.d.ts +14 -0
- package/dist/shared-utils/three/geometryUtil.d.ts +8 -0
- package/dist/shared-utils/three/getNormal.d.ts +5 -2
- package/libs/AreaMakerPlugin/Controller.js +47 -100
- package/libs/AreaMakerPlugin/index.js +12 -65
- package/libs/AreaMakerPlugin/utils/Item.js +102 -157
- package/libs/CSS3DRenderPlugin/Controller.js +45 -93
- package/libs/CSS3DRenderPlugin/index.js +15 -63
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DObject.js +51 -106
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DRender.js +79 -131
- package/libs/CruisePlugin/BaseController.js +90 -143
- package/libs/CruisePlugin/Move.js +39 -83
- package/libs/CruisePlugin/Work.js +52 -96
- package/libs/CruisePlugin/index.js +23 -67
- package/libs/CurrentPanoImagePlugin/Controller.js +88 -141
- package/libs/CurrentPanoImagePlugin/index.js +11 -64
- package/libs/GuideLinePlugin/Controller.js +13 -57
- package/libs/GuideLinePlugin/GuideLineItem.js +20 -64
- package/libs/GuideLinePlugin/GuideLineModeItem/index.js +3 -8
- package/libs/GuideLinePlugin/GuideLineModeItem.js +15 -59
- package/libs/GuideLinePlugin/index.js +23 -67
- package/libs/ModelMakerPlugin/Controller.js +125 -165
- package/libs/ModelMakerPlugin/index.js +23 -63
- package/libs/ModelMakerPlugin/item/baseItem.js +2 -3
- package/libs/ModelMakerPlugin/item/boxItem.js +2 -3
- package/libs/ModelMakerPlugin/item/polygonItem.js +6 -7
- package/libs/ModelMakerPlugin/item/prismItem.js +2 -3
- package/libs/ModelMakerPlugin/utils/getFiveDomEvent.js +2 -3
- package/libs/ModelTVVideoPlugin/Plugin.js +49 -97
- package/libs/ModelTVVideoPlugin/index.js +8 -56
- package/libs/Object3DHelperPlugin/Controller.d.ts +9 -9
- package/libs/Object3DHelperPlugin/Controller.js +105 -92
- package/libs/Object3DHelperPlugin/FiveControllerWrapper.d.ts +4 -2
- package/libs/Object3DHelperPlugin/FiveControllerWrapper.js +35 -30
- package/libs/Object3DHelperPlugin/index.js +15 -30
- package/libs/PanoCompassPlugin/Controller.js +46 -93
- package/libs/PanoCompassPlugin/index.js +17 -64
- package/libs/PanoCursorRaycasterPlugin/index.js +4 -3
- package/libs/PanoDoorLabelPlugin/BaseController.js +27 -80
- package/libs/PanoDoorLabelPlugin/Controller.js +80 -133
- package/libs/PanoDoorLabelPlugin/index.js +11 -64
- package/libs/PanoMeasurePlugin/Components/Controller0.js +79 -128
- package/libs/PanoMeasurePlugin/Components/Controller1.js +92 -141
- package/libs/PanoMeasurePlugin/Controller/BaseController.js +3 -2
- package/libs/PanoMeasurePlugin/Controller/EditController.js +73 -122
- package/libs/PanoMeasurePlugin/Controller/MixedController.js +3 -2
- package/libs/PanoMeasurePlugin/Controller/ViewController.js +3 -2
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +72 -121
- package/libs/PanoMeasurePlugin/Controller/index.js +89 -135
- package/libs/PanoMeasurePlugin/Model/area.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Model/area.js +25 -74
- package/libs/PanoMeasurePlugin/Model/index.js +3 -2
- package/libs/PanoMeasurePlugin/Model/line.js +1 -0
- package/libs/PanoMeasurePlugin/Model/polygon.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Model/polygon.js +7 -7
- package/libs/PanoMeasurePlugin/Model/polyline.js +3 -2
- package/libs/PanoMeasurePlugin/Modules/Magnifier.js +1 -56
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +17 -66
- package/libs/PanoMeasurePlugin/index.js +18 -64
- package/libs/PanoMeasurePlugin/typings/data.d.ts +1 -2
- package/libs/PanoMeasurePlugin/utils/dom/areaDom.js +5 -59
- package/libs/PanoMeasurePlugin/utils/line.js +3 -2
- package/libs/PanoRulerProPlugin/Controller.js +34 -89
- package/libs/PanoRulerProPlugin/RulerItems.js +92 -147
- package/libs/PanoRulerProPlugin/index.js +10 -65
- package/libs/PanoSpatialTagPlugin/Plugin.js +130 -178
- package/libs/PanoSpatialTagPlugin/index.js +6 -54
- package/libs/PanoTagPlugin/Components/Common/TagPoint.js +61 -116
- package/libs/PanoTagPlugin/Components/Tag/MarketingTag.js +138 -193
- package/libs/PanoTagPlugin/Components/Tag/index.js +140 -194
- package/libs/PanoTagPlugin/Components/TagContainer.js +58 -112
- package/libs/PanoTagPlugin/Components/TagItem.js +137 -191
- package/libs/PanoTagPlugin/controller/Tag/BaseTag.js +109 -164
- package/libs/PanoTagPlugin/controller/Tag/ModelTag.js +22 -76
- package/libs/PanoTagPlugin/controller/Tag/PlaneTag.js +33 -87
- package/libs/PanoTagPlugin/controller/Tag/PointTag.js +39 -94
- package/libs/PanoTagPlugin/controller/TagRender.js +18 -62
- package/libs/PanoTagPlugin/controller/TagUtil.js +80 -124
- package/libs/PanoTagPlugin/controller/index.js +37 -81
- package/libs/PanoTagPlugin/index.js +28 -72
- package/libs/PanoTagPlugin/utils/model/mediaPlane.js +14 -14
- package/libs/PanoTagPlugin/utils/tag/calculateTagConfig.js +22 -77
- package/libs/PanoVideoPlugin/Controller.js +43 -96
- package/libs/PanoVideoPlugin/VideoMeshController.js +64 -119
- package/libs/PanoVideoPlugin/index.js +14 -67
- package/libs/PipelinePlugin/Controller.js +123 -176
- package/libs/PipelinePlugin/index.js +11 -64
- package/libs/PipelinePlugin/utils/Objects/FlowPipe.js +15 -70
- package/libs/PipelinePlugin/utils/Objects/HighlightPipe.js +3 -58
- package/libs/PipelinePlugin/utils/Objects/Pipe.js +42 -97
- package/libs/Sculpt/Editors/BoxMeshEditor.d.ts +5 -0
- package/libs/Sculpt/Editors/BoxMeshEditor.js +98 -0
- package/libs/Sculpt/Editors/CircleMeshEditor.d.ts +5 -0
- package/libs/Sculpt/Editors/CircleMeshEditor.js +9 -0
- package/libs/Sculpt/Editors/CylinderMeshEditor.d.ts +5 -0
- package/libs/Sculpt/Editors/CylinderMeshEditor.js +41 -0
- package/libs/Sculpt/Editors/PrismMeshEditor.d.ts +5 -0
- package/libs/Sculpt/Editors/PrismMeshEditor.js +43 -0
- package/libs/Sculpt/Editors/RectangleMeshEditor.d.ts +5 -0
- package/libs/Sculpt/Editors/RectangleMeshEditor.js +70 -0
- package/libs/Sculpt/Meshes/Box.d.ts +6 -24
- package/libs/Sculpt/Meshes/Box.js +22 -93
- package/libs/Sculpt/Meshes/Circle.d.ts +0 -4
- package/libs/Sculpt/Meshes/Circle.js +18 -27
- package/libs/Sculpt/Meshes/Cylinder.d.ts +0 -1
- package/libs/Sculpt/Meshes/Cylinder.js +17 -24
- package/libs/Sculpt/Meshes/Line.d.ts +9 -22
- package/libs/Sculpt/Meshes/Line.js +85 -104
- package/libs/Sculpt/Meshes/LineWithDots.js +10 -14
- package/libs/Sculpt/Meshes/Point.js +29 -34
- package/libs/Sculpt/Meshes/Polygon.d.ts +1 -5
- package/libs/Sculpt/Meshes/Polygon.js +40 -53
- package/libs/Sculpt/Meshes/PolygonWithEdge.d.ts +1 -1
- package/libs/Sculpt/Meshes/Prism.d.ts +29 -10
- package/libs/Sculpt/Meshes/Prism.js +108 -84
- package/libs/Sculpt/Meshes/Rectangle.d.ts +1 -5
- package/libs/Sculpt/Meshes/Rectangle.js +12 -22
- package/libs/Sculpt/Meshes/RectangleWithEdge.js +17 -20
- package/libs/Sculpt/Objects/Base/index.d.ts +3 -3
- package/libs/Sculpt/Objects/Base/index.js +20 -25
- package/libs/Sculpt/Objects/Box/index.d.ts +7 -2
- package/libs/Sculpt/Objects/Box/index.js +72 -60
- package/libs/Sculpt/Objects/Circle/index.d.ts +3 -0
- package/libs/Sculpt/Objects/Circle/index.js +41 -37
- package/libs/Sculpt/Objects/Cylinder/index.d.ts +3 -0
- package/libs/Sculpt/Objects/Cylinder/index.js +66 -62
- package/libs/Sculpt/Objects/Line/Editor.js +8 -10
- package/libs/Sculpt/Objects/Line/index.d.ts +3 -0
- package/libs/Sculpt/Objects/Line/index.js +45 -41
- package/libs/Sculpt/Objects/Point/index.d.ts +3 -0
- package/libs/Sculpt/Objects/Point/index.js +33 -29
- package/libs/Sculpt/Objects/Polygon/index.d.ts +3 -0
- package/libs/Sculpt/Objects/Polygon/index.js +67 -63
- package/libs/Sculpt/Objects/Polyline/index.d.ts +3 -0
- package/libs/Sculpt/Objects/Polyline/index.js +46 -42
- package/libs/Sculpt/Objects/Prism/index.d.ts +3 -0
- package/libs/Sculpt/Objects/Prism/index.js +58 -53
- package/libs/Sculpt/Objects/Rectangle/index.d.ts +13 -2
- package/libs/Sculpt/Objects/Rectangle/index.js +143 -81
- package/libs/Sculpt/index.d.ts +10 -19
- package/libs/Sculpt/index.js +105 -107
- package/libs/Sculpt/typings/style.d.ts +6 -0
- package/libs/Sculpt/utils/export.d.ts +24 -18
- package/libs/Sculpt/utils/export.js +52 -19
- package/libs/Sculpt/utils/sortPositionsByCameraPosition.d.ts +5 -0
- package/libs/Sculpt/utils/sortPositionsByCameraPosition.js +9 -0
- package/libs/Sculpt/utils/three/ColoredMesh.d.ts +4 -0
- package/libs/Sculpt/utils/three/ColoredMesh.js +40 -37
- package/libs/base/BasePlugin.js +10 -15
- package/libs/floorplan/MapviewFloorplanPlugin/Controller.js +96 -147
- package/libs/floorplan/MapviewFloorplanPlugin/index.js +12 -63
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +53 -105
- package/libs/floorplan/ModelFloorplanPlugin/index.js +11 -63
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +65 -118
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +11 -64
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +54 -106
- package/libs/floorplan/TopviewFloorplanPlugin/index.js +11 -63
- package/libs/floorplan/index.js +0 -5
- package/libs/index.d.ts +79 -1
- package/libs/index.js +229 -215
- package/libs/shared-utils/Object3DHelper/Base/BaseController.d.ts +1 -0
- package/libs/shared-utils/Object3DHelper/Base/BaseController.js +112 -122
- package/libs/shared-utils/Object3DHelper/Base/BaseHelper.d.ts +7 -3
- package/libs/shared-utils/Object3DHelper/Base/BaseHelper.js +60 -39
- package/libs/shared-utils/Object3DHelper/Controller/RotateController.js +47 -47
- package/libs/shared-utils/Object3DHelper/Controller/ScaleController.d.ts +0 -1
- package/libs/shared-utils/Object3DHelper/Controller/ScaleController.js +28 -28
- package/libs/shared-utils/Object3DHelper/Helper/BoundingBoxHelper.d.ts +3 -1
- package/libs/shared-utils/Object3DHelper/Helper/BoundingBoxHelper.js +25 -18
- package/libs/shared-utils/Object3DHelper/Helper/CSS3DScaleHelper.d.ts +2 -0
- package/libs/shared-utils/Object3DHelper/Helper/CSS3DScaleHelper.js +18 -14
- package/libs/shared-utils/Object3DHelper/Helper/MoveHelper.d.ts +2 -1
- package/libs/shared-utils/Object3DHelper/Helper/MoveHelper.js +1 -0
- package/libs/shared-utils/Object3DHelper/Helper/RotateHelper.d.ts +2 -1
- package/libs/shared-utils/Object3DHelper/Helper/RotateHelper.js +2 -1
- package/libs/shared-utils/Object3DHelper/Helper/ScaleHelper.d.ts +4 -2
- package/libs/shared-utils/Object3DHelper/Helper/ScaleHelper.js +40 -28
- package/libs/shared-utils/Object3DHelper/typings/index.d.ts +1 -1
- package/libs/shared-utils/Object3DHelper/utils/calculateScaleByCamera.d.ts +4 -1
- package/libs/shared-utils/Object3DHelper/utils/calculateScaleByCamera.js +4 -4
- package/libs/shared-utils/five/FiveDomEvents.js +88 -88
- package/libs/shared-utils/five/FiveLine.d.ts +18 -14
- package/libs/shared-utils/five/FiveLine.js +31 -13
- package/libs/shared-utils/five/index.js +2 -7
- package/libs/shared-utils/five/lookObject.js +27 -32
- package/libs/shared-utils/index.d.ts +0 -1
- package/libs/shared-utils/index.js +31 -33
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/math/planimetry.d.ts +1 -1
- package/libs/shared-utils/tag.d.ts +5 -7
- package/libs/shared-utils/tag.js +1 -1
- package/libs/shared-utils/three/boundingBox.d.ts +14 -20
- package/libs/shared-utils/three/core/LineGeometry.d.ts +13 -0
- package/libs/shared-utils/three/core/LineGeometry.js +26 -0
- package/libs/shared-utils/three/core/PrismGeometry.d.ts +14 -0
- package/libs/shared-utils/three/core/PrismGeometry.js +42 -0
- package/libs/shared-utils/three/earcut3D.js +5 -5
- package/libs/shared-utils/three/geometryUtil.d.ts +8 -0
- package/libs/shared-utils/three/geometryUtil.js +3 -1
- package/libs/shared-utils/three/getNormal.d.ts +5 -2
- package/libs/shared-utils/three/getNormal.js +6 -5
- package/libs/shared-utils/three/index.js +0 -5
- package/package.json +1 -1
- package/dist/Sculpt/Objects/Box/Editor.d.ts +0 -5
- package/dist/Sculpt/Objects/Circle/Editor.d.ts +0 -5
- package/dist/Sculpt/Objects/Cylinder/Editor.d.ts +0 -5
- package/dist/Sculpt/Objects/Prism/Editor.d.ts +0 -5
- package/dist/Sculpt/Objects/Rectangle/Editor.d.ts +0 -5
- package/dist/Sculpt/utils/getBetterNormal.d.ts +0 -2
- package/libs/Sculpt/Objects/Box/Editor.d.ts +0 -5
- package/libs/Sculpt/Objects/Box/Editor.js +0 -44
- package/libs/Sculpt/Objects/Circle/Editor.d.ts +0 -5
- package/libs/Sculpt/Objects/Circle/Editor.js +0 -9
- package/libs/Sculpt/Objects/Cylinder/Editor.d.ts +0 -5
- package/libs/Sculpt/Objects/Cylinder/Editor.js +0 -41
- package/libs/Sculpt/Objects/Prism/Editor.d.ts +0 -5
- package/libs/Sculpt/Objects/Prism/Editor.js +0 -44
- package/libs/Sculpt/Objects/Rectangle/Editor.d.ts +0 -5
- package/libs/Sculpt/Objects/Rectangle/Editor.js +0 -9
- package/libs/Sculpt/utils/getBetterNormal.d.ts +0 -2
- package/libs/Sculpt/utils/getBetterNormal.js +0 -8
- package/libs/vendor/three/build/three.module.js +0 -19336
- package/libs/vendor/three/examples/jsm/lines/LineGeometry.js +0 -28
- package/libs/vendor/three/examples/jsm/lines/LineSegmentsGeometry.js +0 -69
|
@@ -2,35 +2,35 @@ var j = Object.defineProperty;
|
|
|
2
2
|
var w = (g, h, t) => h in g ? j(g, h, { enumerable: !0, configurable: !0, writable: !0, value: t }) : g[h] = t;
|
|
3
3
|
var d = (g, h, t) => (w(g, typeof h != "symbol" ? h + "" : h, t), t);
|
|
4
4
|
import { BaseController as D } from "../Base/BaseController.js";
|
|
5
|
-
import * as
|
|
5
|
+
import * as a from "three";
|
|
6
6
|
import { getMouseRaycaster as O } from "../utils/getMouseRaycaster.js";
|
|
7
7
|
import { setObjectQuaternion as C } from "../utils/setObjectQuaternion.js";
|
|
8
8
|
import { rad2Deg as L } from "../../math/rad2Deg.js";
|
|
9
9
|
import { deg2Rad as f } from "../../math/deg2Rad.js";
|
|
10
|
-
|
|
11
|
-
class
|
|
10
|
+
let y = new a.Quaternion();
|
|
11
|
+
class P extends D {
|
|
12
12
|
constructor(...t) {
|
|
13
|
-
var l,
|
|
13
|
+
var l, c, m;
|
|
14
14
|
super(...t);
|
|
15
15
|
d(this, "name", "RotateController");
|
|
16
16
|
d(this, "startInfo");
|
|
17
17
|
d(this, "removeListener");
|
|
18
18
|
const n = this.helperObject3D;
|
|
19
|
-
this.hoverListener([(l = n.xCircle) == null ? void 0 : l.circle, (
|
|
20
|
-
const e = this.dragStart.bind(this), o = this.dragging.bind(this),
|
|
21
|
-
this.domEvents.addEventListener(this.helperObject3D, "mousedown", e), document.addEventListener("mousemove", o), document.addEventListener("mouseup",
|
|
22
|
-
this.domEvents.removeEventListener(this.helperObject3D, "mousedown", e), document.removeEventListener("mousemove", o), document.removeEventListener("mouseup",
|
|
19
|
+
this.hoverListener([(l = n.xCircle) == null ? void 0 : l.circle, (c = n.yCircle) == null ? void 0 : c.circle, (m = n.zCircle) == null ? void 0 : m.circle].filter(Boolean));
|
|
20
|
+
const e = this.dragStart.bind(this), o = this.dragging.bind(this), r = this.dragEnd.bind(this), s = this.show.bind(this), i = this.hide.bind(this);
|
|
21
|
+
this.domEvents.addEventListener(this.helperObject3D, "mousedown", e), document.addEventListener("mousemove", o), document.addEventListener("mouseup", r), this.domEvents.addEventListener(this.helperObject3D, "touchstart", e), document.addEventListener("touchmove", o), document.addEventListener("touchend", r), this.hooks.on("moveStart", i), this.hooks.on("moveEnd", s), this.hooks.on("scaleStart", i), this.hooks.on("scaleEnd", s), this.hooks.on("moveByMouseEnable", i), this.hooks.on("moveByMouseDisable", s), this.disposers.push(() => {
|
|
22
|
+
this.domEvents.removeEventListener(this.helperObject3D, "mousedown", e), document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", r), this.domEvents.removeEventListener(this.helperObject3D, "touchstart", e), document.removeEventListener("touchmove", o), document.removeEventListener("touchend", r), this.hooks.off("moveStart", i), this.hooks.off("moveEnd", s), this.hooks.off("scaleStart", i), this.hooks.off("scaleEnd", s), this.hooks.off("moveByMouseEnable", i), this.hooks.off("moveByMouseDisable", s);
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
get rotateCenter() {
|
|
26
26
|
return this.helperObject3D.position.clone();
|
|
27
27
|
}
|
|
28
28
|
setRotateAngle(t) {
|
|
29
|
-
const { x: n = 0, y: e = 0, z: o = 0 } = t,
|
|
30
|
-
if (this.hooks.emit("wantToRotate",
|
|
29
|
+
const { x: n = 0, y: e = 0, z: o = 0 } = t, r = new a.Euler(f(n), f(e), f(o)), s = new a.Quaternion().setFromEuler(r);
|
|
30
|
+
if (this.hooks.emit("wantToRotate", s))
|
|
31
31
|
return;
|
|
32
|
-
const { originObject3D: l, rotateCenter:
|
|
33
|
-
C(l,
|
|
32
|
+
const { originObject3D: l, rotateCenter: c } = this;
|
|
33
|
+
C(l, s, c), this.internalHooks.emit("setObjectRotate", s, c), this.hooks.emit("rotate", s), this.render();
|
|
34
34
|
}
|
|
35
35
|
onApplyOriginObjectRotate(t) {
|
|
36
36
|
this.isDragging || super.onApplyOriginObjectRotate(t);
|
|
@@ -49,19 +49,19 @@ class x extends D {
|
|
|
49
49
|
const e = (n == null ? void 0 : n.object).direction;
|
|
50
50
|
if (!e)
|
|
51
51
|
return this.dragEnd();
|
|
52
|
-
const o = n.point,
|
|
52
|
+
const o = n.point, r = this.getAngleHelper(e);
|
|
53
53
|
this.setTipsAngle(0);
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
const
|
|
54
|
+
const s = o.clone();
|
|
55
|
+
s.y += 0.2, this.setTipsPosition(s);
|
|
56
|
+
const i = this.helperObject3D.quaternion.clone(), l = (() => {
|
|
57
57
|
if (e === "x")
|
|
58
|
-
return new
|
|
58
|
+
return new a.Vector3(1, 0, 0).applyQuaternion(i);
|
|
59
59
|
if (e === "y")
|
|
60
|
-
return new
|
|
60
|
+
return new a.Vector3(0, 1, 0).applyQuaternion(i);
|
|
61
61
|
if (e === "z")
|
|
62
|
-
return new
|
|
63
|
-
})(),
|
|
64
|
-
this.setAngleHelperStart(e, u), this.setAngleHelperLength(e, 0), this.startInfo = { direction: e, startVector: p, plane:
|
|
62
|
+
return new a.Vector3(0, 0, 1).applyQuaternion(i);
|
|
63
|
+
})(), c = new a.Plane().setFromNormalAndCoplanarPoint(l, o), p = c.projectPoint(o.clone(), new a.Vector3()).clone().sub(this.rotateCenter), u = p.angleTo(r.baseAxes.clone().applyQuaternion(i));
|
|
64
|
+
this.setAngleHelperStart(e, u), this.setAngleHelperLength(e, 0), this.startInfo = { direction: e, startVector: p, plane: c, angleHelper: r, angle: 0, helperQuaternion: i.clone() }, y = new a.Quaternion(), this.helperObject3D.showDraggingHelper([e]), this.hooks.emit("rotateStart"), this.isDragging = !0;
|
|
65
65
|
}
|
|
66
66
|
dragging(t) {
|
|
67
67
|
if (!this.isDragging)
|
|
@@ -72,30 +72,30 @@ class x extends D {
|
|
|
72
72
|
rotate(t) {
|
|
73
73
|
if (!this.startInfo)
|
|
74
74
|
return this.dragEnd();
|
|
75
|
-
const { startVector: n, plane: e, angleHelper: o, direction:
|
|
75
|
+
const { startVector: n, plane: e, angleHelper: o, direction: r, helperQuaternion: s } = this.startInfo, { originObject3D: i } = this, l = t.ray.intersectPlane(e, new a.Vector3());
|
|
76
76
|
if (!l)
|
|
77
77
|
return;
|
|
78
|
-
const
|
|
78
|
+
const c = this.rotateCenter.clone(), p = e.projectPoint(l.clone(), new a.Vector3()).clone().sub(c);
|
|
79
79
|
if (n.angleTo(p) === 0)
|
|
80
80
|
return;
|
|
81
|
-
const u = new
|
|
81
|
+
const u = new a.Quaternion().setFromUnitVectors(n.clone().normalize(), p.clone().normalize()), v = i.quaternion.clone().premultiply(u);
|
|
82
82
|
if (this.hooks.emit("wantToRotate", v))
|
|
83
83
|
return;
|
|
84
|
-
const E = new
|
|
85
|
-
new
|
|
86
|
-
n.clone().normalize().applyQuaternion(
|
|
87
|
-
p.clone().normalize().applyQuaternion(
|
|
84
|
+
const E = new a.Euler().setFromQuaternion(
|
|
85
|
+
new a.Quaternion().setFromUnitVectors(
|
|
86
|
+
n.clone().normalize().applyQuaternion(s.clone().inverse()),
|
|
87
|
+
p.clone().normalize().applyQuaternion(s.clone().inverse())
|
|
88
88
|
),
|
|
89
|
-
`${
|
|
90
|
-
)[
|
|
91
|
-
if (this.startInfo.angle += E, this.setAngleHelperLength(
|
|
92
|
-
const b = new
|
|
93
|
-
|
|
89
|
+
`${r.toUpperCase()}${"XZY".replace(r.toUpperCase(), "")}`
|
|
90
|
+
)[r] * o.angleDirection;
|
|
91
|
+
if (this.startInfo.angle += E, this.setAngleHelperLength(r, this.startInfo.angle), this.setTipsAngle(L(this.startInfo.angle)), c) {
|
|
92
|
+
const b = new a.Vector3().subVectors(i.position, c).applyQuaternion(u).add(c);
|
|
93
|
+
i.position.copy(b);
|
|
94
94
|
}
|
|
95
|
-
|
|
95
|
+
i.applyQuaternion(u), y.premultiply(u), this.internalHooks.emit("applyObjectRotate", { quaternion: u, origin: c }), this.hooks.emit("rotate", i.quaternion), this.startInfo.startVector = p;
|
|
96
96
|
}
|
|
97
97
|
dragEnd() {
|
|
98
|
-
this.isDragging && (this.
|
|
98
|
+
this.isDragging && (this.applyHelperQuaternion(y, this.rotateCenter), this.startInfo = void 0, this.isDragging = !1, this.helperObject3D.show(), this.hooks.emit("rotateEnd"));
|
|
99
99
|
}
|
|
100
100
|
getAngleHelper(t) {
|
|
101
101
|
var n, e, o;
|
|
@@ -114,17 +114,17 @@ class x extends D {
|
|
|
114
114
|
console.warn("angleHelper is undefined");
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
|
-
if (e instanceof
|
|
118
|
-
const { radius: o, segments:
|
|
119
|
-
e.geometry = new
|
|
117
|
+
if (e instanceof a.Mesh && e.geometry instanceof a.CircleGeometry) {
|
|
118
|
+
const { radius: o, segments: r, thetaLength: s } = e.geometry.parameters;
|
|
119
|
+
e.geometry = new a.CircleGeometry(o, r, n, s);
|
|
120
120
|
} else
|
|
121
121
|
console.warn("only support THREE.CircleGeometry");
|
|
122
122
|
}
|
|
123
123
|
setAngleHelperLength(t, n) {
|
|
124
|
-
const o = n >= 0 ? Math.max(n, 1e-3) : Math.min(n, -1e-3),
|
|
125
|
-
if (
|
|
126
|
-
const { radius:
|
|
127
|
-
|
|
124
|
+
const o = n >= 0 ? Math.max(n, 1e-3) : Math.min(n, -1e-3), r = this.getAngleHelper(t);
|
|
125
|
+
if (r instanceof a.Mesh && r.geometry instanceof a.CircleGeometry) {
|
|
126
|
+
const { radius: s, thetaStart: i } = r.geometry.parameters, l = Math.ceil(Math.abs(o) * (40 / (2 * Math.PI)));
|
|
127
|
+
r.geometry = new a.CircleGeometry(s, l, i, o);
|
|
128
128
|
} else
|
|
129
129
|
console.warn("only support THREE.CircleGeometry");
|
|
130
130
|
}
|
|
@@ -137,13 +137,13 @@ class x extends D {
|
|
|
137
137
|
const n = this.helperObject3D.angleTips;
|
|
138
138
|
if (!n)
|
|
139
139
|
return;
|
|
140
|
-
const e = t.project(this.camera), { x: o, y:
|
|
141
|
-
if (
|
|
140
|
+
const e = t.project(this.camera), { x: o, y: r, z: s } = e;
|
|
141
|
+
if (s > 1)
|
|
142
142
|
return;
|
|
143
|
-
const
|
|
144
|
-
n.setLeftTop(
|
|
143
|
+
const i = (o + 1) / 2 * 100 + "%", l = (-r + 1) / 2 * 100 + "%";
|
|
144
|
+
n.setLeftTop(i, l);
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
export {
|
|
148
|
-
|
|
148
|
+
P as RotateController
|
|
149
149
|
};
|
|
@@ -5,7 +5,6 @@ export declare class ScaleController<T extends ScaleHelperAbstract = ScaleHelper
|
|
|
5
5
|
protected name: string;
|
|
6
6
|
private startInfo?;
|
|
7
7
|
constructor(...params: ConstructorParameters<typeof BaseController<T>>);
|
|
8
|
-
initialHelperQuaternion(): void;
|
|
9
8
|
initialHelperPosition(): void;
|
|
10
9
|
dragStart: (params: {
|
|
11
10
|
intersect: THREE.Intersection;
|
|
@@ -1,42 +1,45 @@
|
|
|
1
1
|
var f = Object.defineProperty;
|
|
2
|
-
var v = (
|
|
3
|
-
var
|
|
4
|
-
import { BaseController as
|
|
2
|
+
var v = (c, a, t) => a in c ? f(c, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : c[a] = t;
|
|
3
|
+
var h = (c, a, t) => (v(c, typeof a != "symbol" ? a + "" : a, t), t);
|
|
4
|
+
import { BaseController as E } from "../Base/BaseController.js";
|
|
5
5
|
import * as m from "three";
|
|
6
|
-
import { getMouseRaycaster as
|
|
6
|
+
import { getMouseRaycaster as p } from "../utils/getMouseRaycaster.js";
|
|
7
7
|
import { rayOnLine as g } from "../../../Sculpt/utils/three/rayOnLine.js";
|
|
8
|
-
class S extends
|
|
8
|
+
class S extends E {
|
|
9
9
|
constructor(...t) {
|
|
10
10
|
super(...t);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
h(this, "name", "ScaleController");
|
|
12
|
+
h(this, "startInfo");
|
|
13
|
+
h(this, "dragStart", (t) => {
|
|
14
14
|
if (this.isDragging)
|
|
15
15
|
return;
|
|
16
16
|
this.isDragging = !0;
|
|
17
|
-
const { intersect: e } = t, o = this.camera.position
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
const { intersect: e } = t, o = this.camera.position;
|
|
18
|
+
let s = e.object;
|
|
19
|
+
s.scalePosition || (s = e.object.parent);
|
|
20
|
+
const i = s.scalePosition.basePosition.clone(), n = s.scalePosition.handlePosition.clone().clone().sub(i).clone(), r = new m.Line3(i, i.clone().add(n.normalize().multiplyScalar(5)));
|
|
21
|
+
r.applyMatrix4(this.helperObject3D.matrixWorld);
|
|
22
|
+
const l = new m.Raycaster(o, e.point.clone().sub(o)), u = g({ raycaster: l, line: r });
|
|
23
|
+
this.startInfo = { line: r, scaleStartPoint: u, draggingObject: s }, this.hooks.emit("scaleStart");
|
|
21
24
|
});
|
|
22
|
-
|
|
25
|
+
h(this, "dragging", (t) => {
|
|
23
26
|
if (!this.isDragging || !this.startInfo)
|
|
24
27
|
return;
|
|
25
|
-
const e = "touches" in t ? t.touches[0].clientX : t.x, o = "touches" in t ? t.touches[0].clientY : t.y, s =
|
|
28
|
+
const e = "touches" in t ? t.touches[0].clientX : t.x, o = "touches" in t ? t.touches[0].clientY : t.y, s = p(this.camera, { x: e, y: o }, this.container);
|
|
26
29
|
return s ? (this.scale(s), !1) : this.dragEnd();
|
|
27
30
|
});
|
|
28
|
-
|
|
29
|
-
var n,
|
|
31
|
+
h(this, "scale", (t) => {
|
|
32
|
+
var n, r;
|
|
30
33
|
if (!this.startInfo)
|
|
31
34
|
return;
|
|
32
|
-
const { line: e, scaleStartPoint: o, draggingObject: s } = this.startInfo, { scalePosition: i } = s,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}), s.position.copy(
|
|
35
|
+
const { line: e, scaleStartPoint: o, draggingObject: s } = this.startInfo, { scalePosition: i } = s, d = g({ raycaster: t, line: e });
|
|
36
|
+
d.applyMatrix4(new m.Matrix4().getInverse(this.helperObject3D.matrixWorld.clone())), (r = (n = this.config) == null ? void 0 : n.scaleCallback) == null || r.call(n, {
|
|
37
|
+
intersectPoint: d,
|
|
38
|
+
scalePosition: i,
|
|
39
|
+
offset: d.clone().sub(o)
|
|
40
|
+
}), s.position.copy(d.clone());
|
|
38
41
|
});
|
|
39
|
-
|
|
42
|
+
h(this, "dragEnd", () => {
|
|
40
43
|
this.isDragging && (this.startInfo = void 0, this.isDragging = !1, this.internalHooks.emit("initialHelperPosition"), this.hooks.emit("scaleEnd"));
|
|
41
44
|
});
|
|
42
45
|
const e = this.show.bind(this), o = this.hide.bind(this);
|
|
@@ -44,18 +47,15 @@ class S extends p {
|
|
|
44
47
|
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
48
|
});
|
|
46
49
|
}
|
|
47
|
-
initialHelperQuaternion() {
|
|
48
|
-
this.helperObject3D.initQuaternion();
|
|
49
|
-
}
|
|
50
50
|
initialHelperPosition() {
|
|
51
51
|
this.helperObject3D.initialPosition();
|
|
52
52
|
const t = this;
|
|
53
53
|
t.offHoverListener && t.offHoverListener(), t.offHoverListener = this.hoverListener(this.helperObject3D.scaleMeshes);
|
|
54
54
|
}
|
|
55
55
|
setScale(t) {
|
|
56
|
-
var
|
|
56
|
+
var n, r, l;
|
|
57
57
|
let e = 1, o = 1, s = 1;
|
|
58
|
-
typeof t == "number" ? (e = t, o = t, s = t) : typeof t == "object" && (e = (
|
|
58
|
+
typeof t == "number" ? (e = t, o = t, s = t) : typeof t == "object" && (e = (n = t.x) != null ? n : 1, o = (r = t.y) != null ? r : 1, s = (l = t.z) != null ? l : 1);
|
|
59
59
|
const i = new m.Vector3(e, o, s);
|
|
60
60
|
this.hooks.emit("wantToScale", i) || (this.originObject3D.scale.copy(i), this.internalHooks.emit("setObjectScale", i), this.hooks.emit("scale", i), this.render());
|
|
61
61
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
2
|
import { BoundingBoxHelperAbstract } from '../Base/BaseHelper';
|
|
3
3
|
export declare class BoundingBoxHelper<T extends THREE.Object3D = THREE.Object3D> extends BoundingBoxHelperAbstract<T> {
|
|
4
|
+
name: string;
|
|
4
5
|
box: THREE.Mesh<THREE.BufferGeometry, THREE.MeshBasicMaterial>;
|
|
5
6
|
outline: THREE.LineSegments<THREE.BufferGeometry, THREE.LineBasicMaterial>;
|
|
6
|
-
private originObject;
|
|
7
7
|
private positionAttribute;
|
|
8
8
|
constructor(originObject: T);
|
|
9
|
+
initQuaternion(): void;
|
|
10
|
+
setHelperQuaternion(quaternion: THREE.Quaternion, origin?: THREE.Vector3): void;
|
|
9
11
|
raycasterIntersectObject(raycaster: THREE.Raycaster, intersection: THREE.Intersection[]): THREE.Intersection[];
|
|
10
12
|
raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection[]): void;
|
|
11
13
|
private update;
|
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
var u = Object.defineProperty;
|
|
2
|
-
var c = (
|
|
3
|
-
var r = (
|
|
4
|
-
import * as
|
|
5
|
-
import { BoundingBoxHelperAbstract as
|
|
6
|
-
import { boundingBox as
|
|
7
|
-
|
|
2
|
+
var c = (s, n, e) => n in s ? u(s, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[n] = e;
|
|
3
|
+
var r = (s, n, e) => (c(s, typeof n != "symbol" ? n + "" : n, e), e);
|
|
4
|
+
import * as o from "three";
|
|
5
|
+
import { BoundingBoxHelperAbstract as p } from "../Base/BaseHelper.js";
|
|
6
|
+
import { boundingBox as b } from "../../three/boundingBox.js";
|
|
7
|
+
import { setObjectQuaternion as h } from "../utils/setObjectQuaternion.js";
|
|
8
|
+
class d extends p {
|
|
8
9
|
constructor(e) {
|
|
9
10
|
super(e);
|
|
11
|
+
r(this, "name", "BoundingBoxHelper");
|
|
10
12
|
r(this, "box");
|
|
11
13
|
r(this, "outline");
|
|
12
|
-
r(this, "originObject");
|
|
13
14
|
r(this, "positionAttribute");
|
|
14
|
-
this.
|
|
15
|
+
this.positionAttribute = new o.BufferAttribute(new Float32Array(8 * 3), 3), this.box = this.createBox(), this.outline = this.createOutline(), this.add(this.box, this.outline), this.update();
|
|
16
|
+
}
|
|
17
|
+
initQuaternion() {
|
|
18
|
+
this.quaternion.copy(this.originObject3D.quaternion);
|
|
19
|
+
}
|
|
20
|
+
setHelperQuaternion(e, t) {
|
|
21
|
+
h(this, e, t);
|
|
15
22
|
}
|
|
16
23
|
raycasterIntersectObject(e, t) {
|
|
17
24
|
return e.intersectObject(this, !1, t);
|
|
@@ -20,21 +27,21 @@ class A extends b {
|
|
|
20
27
|
this.box.raycast(e, t);
|
|
21
28
|
}
|
|
22
29
|
update() {
|
|
23
|
-
const e =
|
|
30
|
+
const e = b(this.originObject3D);
|
|
24
31
|
if (!e)
|
|
25
32
|
return;
|
|
26
33
|
const { min: t, max: i } = e;
|
|
27
34
|
this.positionAttribute.setXYZ(0, i.x, i.y, i.z), this.positionAttribute.setXYZ(1, t.x, i.y, i.z), this.positionAttribute.setXYZ(2, t.x, t.y, i.z), this.positionAttribute.setXYZ(3, i.x, t.y, i.z), this.positionAttribute.setXYZ(4, i.x, i.y, t.z), this.positionAttribute.setXYZ(5, t.x, i.y, t.z), this.positionAttribute.setXYZ(6, t.x, t.y, t.z), this.positionAttribute.setXYZ(7, i.x, t.y, t.z), this.positionAttribute.needsUpdate = !0;
|
|
28
35
|
}
|
|
29
36
|
createOutline() {
|
|
30
|
-
const e = new Uint16Array([0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7]), t = new
|
|
31
|
-
t.setIndex(new
|
|
32
|
-
const i = new
|
|
37
|
+
const e = new Uint16Array([0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7]), t = new o.BufferGeometry();
|
|
38
|
+
t.setIndex(new o.BufferAttribute(e, 1)), t.setAttribute("position", this.positionAttribute);
|
|
39
|
+
const i = new o.LineBasicMaterial({
|
|
33
40
|
color: 64767,
|
|
34
41
|
linewidth: 1,
|
|
35
42
|
opacity: 1,
|
|
36
43
|
toneMapped: !1
|
|
37
|
-
}), a = new
|
|
44
|
+
}), a = new o.LineSegments(t, i);
|
|
38
45
|
return a.matrixAutoUpdate = !1, a;
|
|
39
46
|
}
|
|
40
47
|
createBox() {
|
|
@@ -75,17 +82,17 @@ class A extends b {
|
|
|
75
82
|
6,
|
|
76
83
|
7,
|
|
77
84
|
3
|
|
78
|
-
]), t = new
|
|
79
|
-
t.setIndex(new
|
|
80
|
-
const i = new
|
|
85
|
+
]), t = new o.BufferGeometry();
|
|
86
|
+
t.setIndex(new o.BufferAttribute(e, 1)), t.setAttribute("position", this.positionAttribute);
|
|
87
|
+
const i = new o.MeshBasicMaterial({
|
|
81
88
|
color: 64767,
|
|
82
89
|
opacity: 0.1,
|
|
83
90
|
depthTest: !1,
|
|
84
91
|
transparent: !0
|
|
85
92
|
});
|
|
86
|
-
return new
|
|
93
|
+
return new o.Mesh(t, i);
|
|
87
94
|
}
|
|
88
95
|
}
|
|
89
96
|
export {
|
|
90
|
-
|
|
97
|
+
d as BoundingBoxHelper
|
|
91
98
|
};
|
|
@@ -5,6 +5,7 @@ import type { Vector3 } from 'three';
|
|
|
5
5
|
import type { CSS3DObjectPlus } from '../../../CSS3DRenderPlugin/utils/three/CSS3DObject';
|
|
6
6
|
type NonVoid<T> = T extends void ? never : T;
|
|
7
7
|
export declare class CSS3DScaleHelper<T extends CSS3DObjectPlus = CSS3DObjectPlus> extends RectangleScaleHelperAbstract<T, HTMLElement> {
|
|
8
|
+
name: string;
|
|
8
9
|
points: RectangleScaleHelperAbstract<THREE.Object3D, HTMLElement>['points'];
|
|
9
10
|
cornerPositions: Vector3[];
|
|
10
11
|
css3DInstance?: NonVoid<Create3DElementReturnType>;
|
|
@@ -16,6 +17,7 @@ export declare class CSS3DScaleHelper<T extends CSS3DObjectPlus = CSS3DObjectPlu
|
|
|
16
17
|
private container;
|
|
17
18
|
private enabled;
|
|
18
19
|
constructor(originObject3D: T, container: HTMLElement, camera: THREE.Camera, scene: THREE.Scene);
|
|
20
|
+
initQuaternion(): void;
|
|
19
21
|
applyMatrix4(matrix: THREE.Matrix4): void;
|
|
20
22
|
showDraggingHelper(): void;
|
|
21
23
|
applyHelperScaleMatrix4(matrix: THREE.Matrix4, origin?: Vector3): void;
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
var b = Object.defineProperty;
|
|
2
2
|
var D = (c, n, e) => n in c ? b(c, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : c[n] = e;
|
|
3
3
|
var i = (c, n, e) => (D(c, typeof n != "symbol" ? n + "" : n, e), e);
|
|
4
|
-
import { CSS3DRender as
|
|
4
|
+
import { CSS3DRender as u } from "../../../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
|
|
5
5
|
import * as p from "three";
|
|
6
|
-
import { RectangleScaleHelperAbstract as
|
|
6
|
+
import { RectangleScaleHelperAbstract as f } from "../Base/BaseHelper.js";
|
|
7
7
|
import { rectangleScaleDom as y } from "./HTML/rectangleScaleDom.js";
|
|
8
8
|
import "../../three/core/Sphere.js";
|
|
9
|
-
class
|
|
9
|
+
class g extends f {
|
|
10
10
|
// eslint-disable-next-line max-params
|
|
11
|
-
constructor(e, t, s,
|
|
11
|
+
constructor(e, t, s, o) {
|
|
12
12
|
super(e);
|
|
13
|
+
i(this, "name", "CSS3DScaleHelper");
|
|
13
14
|
i(this, "points", []);
|
|
14
15
|
i(this, "cornerPositions", []);
|
|
15
16
|
i(this, "css3DInstance");
|
|
16
17
|
i(this, "plane");
|
|
17
|
-
i(this, "css3DRenderer", new
|
|
18
|
+
i(this, "css3DRenderer", new u());
|
|
18
19
|
i(this, "camera");
|
|
19
20
|
i(this, "scene");
|
|
20
21
|
i(this, "container");
|
|
21
22
|
i(this, "enabled", !1);
|
|
22
|
-
this.camera = s, this.scene =
|
|
23
|
+
this.camera = s, this.scene = o, this.container = t, this.initRectangleScaleHelper();
|
|
23
24
|
}
|
|
24
25
|
get helperObject() {
|
|
25
26
|
var e;
|
|
@@ -27,6 +28,9 @@ class v extends u {
|
|
|
27
28
|
throw new Error("css3DInstance is not initialized");
|
|
28
29
|
return this.css3DInstance.css3DObject;
|
|
29
30
|
}
|
|
31
|
+
initQuaternion() {
|
|
32
|
+
this.quaternion.copy(this.originObject3D.quaternion);
|
|
33
|
+
}
|
|
30
34
|
applyMatrix4(e) {
|
|
31
35
|
var t;
|
|
32
36
|
super.applyMatrix4(e), this.helperObject.applyMatrix4(e), (t = this.plane) == null || t.applyMatrix4(e), this.cornerPositions.forEach((s) => s.applyMatrix4(e));
|
|
@@ -44,8 +48,8 @@ class v extends u {
|
|
|
44
48
|
});
|
|
45
49
|
}
|
|
46
50
|
applyHelperQuaternion(e, t) {
|
|
47
|
-
var
|
|
48
|
-
const s = (
|
|
51
|
+
var o;
|
|
52
|
+
const s = (o = this.css3DInstance) == null ? void 0 : o.css3DObject;
|
|
49
53
|
if (s) {
|
|
50
54
|
const a = new p.Vector3().subVectors(s.position, t).applyQuaternion(e).add(t);
|
|
51
55
|
s.position.copy(a), s.applyQuaternion(e);
|
|
@@ -55,8 +59,8 @@ class v extends u {
|
|
|
55
59
|
this.plane.position.copy(a), this.plane.applyQuaternion(e);
|
|
56
60
|
}
|
|
57
61
|
this.cornerPositions.forEach((a) => {
|
|
58
|
-
const
|
|
59
|
-
a.copy(
|
|
62
|
+
const l = new p.Vector3().subVectors(a, t).applyQuaternion(e).add(t);
|
|
63
|
+
a.copy(l);
|
|
60
64
|
});
|
|
61
65
|
}
|
|
62
66
|
enable() {
|
|
@@ -79,7 +83,7 @@ class v extends u {
|
|
|
79
83
|
this.disable(), this.css3DRenderer.dispose();
|
|
80
84
|
}
|
|
81
85
|
initRectangleScaleHelper() {
|
|
82
|
-
var
|
|
86
|
+
var l, r;
|
|
83
87
|
const e = this.getCornerPositions();
|
|
84
88
|
if (!e)
|
|
85
89
|
return;
|
|
@@ -88,12 +92,12 @@ class v extends u {
|
|
|
88
92
|
if (!t)
|
|
89
93
|
return;
|
|
90
94
|
this.css3DInstance = t, t.appendToElement(this.container);
|
|
91
|
-
const s = t.css3DObject.container, { container:
|
|
95
|
+
const s = t.css3DObject.container, { container: o, squares: a } = y();
|
|
92
96
|
this.points = a.map((h, d) => ({
|
|
93
97
|
direction: h.direction,
|
|
94
98
|
point: h.element,
|
|
95
99
|
position: this.calculatePointPosition(e)[d]
|
|
96
|
-
})), s.insertBefore(
|
|
100
|
+
})), s.insertBefore(o, (l = s.children[0]) != null ? l : null), this.helperObject.position.copy(this.originObject3D.position), (r = this.plane) == null || r.position.copy(this.originObject3D.position);
|
|
97
101
|
}
|
|
98
102
|
getCornerPositions() {
|
|
99
103
|
const { originObject3D: e } = this;
|
|
@@ -115,5 +119,5 @@ class v extends u {
|
|
|
115
119
|
}
|
|
116
120
|
}
|
|
117
121
|
export {
|
|
118
|
-
|
|
122
|
+
g as CSS3DScaleHelper
|
|
119
123
|
};
|
|
@@ -4,6 +4,7 @@ import { MoveHelperAbstract, type BaseHelperConfig } from '.';
|
|
|
4
4
|
import { ArrowGroup } from './Objects/ArrowGroup';
|
|
5
5
|
import type * as THREE from 'three';
|
|
6
6
|
export declare class MoveHelper extends MoveHelperAbstract {
|
|
7
|
+
name: string;
|
|
7
8
|
xArrow?: ArrowGroup;
|
|
8
9
|
yArrow?: ArrowGroup;
|
|
9
10
|
zArrow?: ArrowGroup;
|
|
@@ -13,7 +14,7 @@ export declare class MoveHelper extends MoveHelperAbstract {
|
|
|
13
14
|
zArrowEnable?: boolean;
|
|
14
15
|
} & BaseHelperConfig);
|
|
15
16
|
show(): void;
|
|
16
|
-
setScaleByCamera(camera: THREE.PerspectiveCamera): void;
|
|
17
|
+
setScaleByCamera(camera: THREE.PerspectiveCamera | THREE.OrthographicCamera): void;
|
|
17
18
|
showDraggingHelper(directions: Direction[]): void;
|
|
18
19
|
dispose(): void;
|
|
19
20
|
}
|
|
@@ -4,6 +4,7 @@ import { RotateHelperAbstract, type BaseHelperConfig } from '../Base/BaseHelper'
|
|
|
4
4
|
import type { Color, Direction } from '../typings';
|
|
5
5
|
import { tipsDom } from './HTML/tipsDom';
|
|
6
6
|
export declare class RotateHelper extends RotateHelperAbstract {
|
|
7
|
+
name: string;
|
|
7
8
|
xCircle?: RotateCircleGroup;
|
|
8
9
|
yCircle?: RotateCircleGroup;
|
|
9
10
|
zCircle?: RotateCircleGroup;
|
|
@@ -19,7 +20,7 @@ export declare class RotateHelper extends RotateHelperAbstract {
|
|
|
19
20
|
} & BaseHelperConfig);
|
|
20
21
|
hide(): void;
|
|
21
22
|
show(): void;
|
|
22
|
-
setScaleByCamera(camera: THREE.PerspectiveCamera): void;
|
|
23
|
+
setScaleByCamera(camera: THREE.PerspectiveCamera | THREE.OrthographicCamera): void;
|
|
23
24
|
showDraggingHelper(directions: Direction[]): void;
|
|
24
25
|
dispose(): void;
|
|
25
26
|
}
|
|
@@ -9,6 +9,7 @@ import { calculateScaleByCamera as C } from "../utils/calculateScaleByCamera.js"
|
|
|
9
9
|
class D extends u {
|
|
10
10
|
constructor(t, e) {
|
|
11
11
|
super(t, e);
|
|
12
|
+
i(this, "name", "RotateHelper");
|
|
12
13
|
i(this, "xCircle");
|
|
13
14
|
i(this, "yCircle");
|
|
14
15
|
i(this, "zCircle");
|
|
@@ -80,7 +81,7 @@ class b extends r.Group {
|
|
|
80
81
|
super();
|
|
81
82
|
i(this, "direction");
|
|
82
83
|
this.direction = t.direction;
|
|
83
|
-
const e = 0.015, h = new Array(8).fill(null).map((
|
|
84
|
+
const e = 0.015, h = new Array(8).fill(null).map((R, c) => {
|
|
84
85
|
const d = new r.RingGeometry(0.25, 0.3, 20, 8, Math.PI / 4 * c + e, Math.PI / 4 - e * 2), p = new r.MeshBasicMaterial({
|
|
85
86
|
opacity: 1,
|
|
86
87
|
color: 16777215,
|
|
@@ -2,13 +2,15 @@ import * as THREE from 'three';
|
|
|
2
2
|
import { ScaleHelperAbstract, type BaseHelperConfig } from '../Base/BaseHelper';
|
|
3
3
|
import type { ScalePosition } from '../typings';
|
|
4
4
|
export declare class ScaleHelper<T extends THREE.Object3D = THREE.Object3D> extends ScaleHelperAbstract<T> {
|
|
5
|
-
|
|
5
|
+
name: string;
|
|
6
|
+
scaleMeshes: Array<THREE.Object3D & {
|
|
6
7
|
scalePosition: ScalePosition;
|
|
7
8
|
}>;
|
|
8
9
|
private positions;
|
|
9
10
|
constructor(originObject3D: T, config?: {
|
|
10
11
|
positions?: Array<ScalePosition> | (() => Array<ScalePosition>);
|
|
11
12
|
} & BaseHelperConfig);
|
|
13
|
+
initQuaternion(): void;
|
|
12
14
|
initialPosition(offset?: THREE.Vector3): void;
|
|
13
|
-
setScaleByCamera(camera: THREE.PerspectiveCamera): void;
|
|
15
|
+
setScaleByCamera(camera: THREE.PerspectiveCamera | THREE.OrthographicCamera): void;
|
|
14
16
|
}
|