@realsee/dnalogel 2.7.0 → 2.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +25 -25
- package/dist/index.js +441 -448
- package/dist/index.umd.js +23 -23
- package/dist/shared-utils/Object3DHelper/Base/BaseController.d.ts +32 -4
- package/dist/shared-utils/Object3DHelper/Controller/MoveController.d.ts +1 -1
- package/dist/shared-utils/Object3DHelper/Controller/RectangleScaleController.d.ts +4 -1
- package/dist/shared-utils/Object3DHelper/Controller/RotateController.d.ts +1 -1
- package/dist/shared-utils/Object3DHelper/Helper/CSS3DScaleHelper.d.ts +0 -2
- package/dist/shared-utils/Object3DHelper/typings/Hooks.d.ts +2 -2
- package/docs/classes/CSS3DRender.html +31 -31
- package/docs/classes/CruisePluginController.html +24 -24
- package/docs/classes/Magnifier.html +20 -20
- package/docs/classes/ModelRoomLabelController.html +11 -11
- package/docs/classes/Object3DHelperController.html +24 -24
- package/docs/classes/PaintBrush.html +15 -15
- package/docs/classes/PanoMeasurePluginLine.html +23 -23
- package/docs/classes/PanoMeasurePluginModel.html +22 -22
- package/docs/classes/PanoMeasurePluginPoint.html +14 -14
- package/docs/classes/PanoMeasurePluginPolyline.html +26 -26
- package/docs/classes/PanoTagPluginController.html +47 -47
- package/docs/classes/Util.BetterTween.html +8 -8
- package/docs/classes/Util.FivePointSelector.html +12 -12
- package/docs/classes/Util.Interval.html +12 -12
- package/docs/classes/Util.Magnifier.html +17 -17
- package/docs/classes/Util.PointDomHelper.html +11 -11
- package/docs/classes/Util.PointHelper.html +11 -11
- package/docs/classes/Util.Rectangle.html +13 -13
- package/docs/enums/CameraMovementEffect.html +7 -7
- package/docs/enums/ContentType.html +18 -18
- package/docs/enums/DIRECTION.html +9 -9
- package/docs/enums/DISPLAY_STRATEGY_TYPE.html +9 -9
- package/docs/enums/DimensionType.html +7 -7
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +8 -8
- package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +9 -9
- package/docs/enums/PaintBrushTypeEnum.html +8 -8
- package/docs/enums/PointType.html +7 -7
- package/docs/enums/Rotation.html +8 -8
- package/docs/functions/CSS3DRenderPlugin.html +4 -4
- package/docs/functions/CameraMovementPlugin.html +4 -4
- package/docs/functions/CruisePlugin.html +4 -4
- package/docs/functions/GuideLinePlugin.html +5 -5
- package/docs/functions/ItemLabelPlugin.html +4 -4
- package/docs/functions/MapviewFloorplanPlugin.html +4 -4
- package/docs/functions/ModelChassisCompassPlugin.html +4 -4
- package/docs/functions/ModelEntryDoorGuidePlugin.html +4 -4
- package/docs/functions/ModelFloorplanPlugin.html +4 -4
- package/docs/functions/ModelItemLabelPlugin.html +4 -4
- package/docs/functions/ModelRoomLabelPlugin.html +4 -4
- package/docs/functions/ModelTVVideoPlugin.html +4 -4
- package/docs/functions/ModelViewPlugin.html +4 -4
- package/docs/functions/Object3DHelperPlugin.html +4 -4
- package/docs/functions/PanoCompassPlugin.html +4 -4
- package/docs/functions/PanoCursorRaycasterPlugin.html +4 -4
- package/docs/functions/PanoDoorLabelPlugin.html +4 -4
- package/docs/functions/PanoFloorplanRadarPlugin.html +4 -4
- package/docs/functions/PanoMeasurePlugin.html +4 -4
- package/docs/functions/PanoRulerPlugin.html +4 -4
- package/docs/functions/PanoRulerProPlugin.html +4 -4
- package/docs/functions/PanoSpatialTagPlugin.html +4 -4
- package/docs/functions/PanoTagPlugin.html +4 -4
- package/docs/functions/TopviewFloorplanPlugin.html +4 -4
- package/docs/functions/Util.getCoordsFromClient.html +5 -5
- package/docs/functions/Util.getCoordsFromElement.html +5 -5
- package/docs/functions/Util.getFrameTime.html +5 -5
- package/docs/functions/Util.getIntersectFromRelativePosition.html +5 -5
- package/docs/functions/Util.getRaycasterFromFivePointer.html +5 -5
- package/docs/functions/Util.isNil.html +5 -5
- package/docs/functions/Util.nextFrame.html +5 -5
- package/docs/functions/Util.notNil.html +5 -5
- package/docs/functions/Util.requestAnimationFrameInterval.html +5 -5
- package/docs/functions/Util.tweenProgress.html +5 -5
- package/docs/functions/pluginFlag.html +5 -5
- package/docs/index.html +4 -4
- package/docs/interfaces/AddTagConfig.html +6 -6
- package/docs/interfaces/CSS3DRenderPluginEventMap.html +11 -11
- package/docs/interfaces/CSS3DRenderPluginState.html +8 -8
- package/docs/interfaces/CameraMovementPluginExportType.html +7 -7
- package/docs/interfaces/EventMap.html +15 -15
- package/docs/interfaces/FloorplanBounding.html +8 -8
- package/docs/interfaces/FloorplanData.html +10 -10
- package/docs/interfaces/FloorplanEntrance.html +11 -11
- package/docs/interfaces/FloorplanExtraObject.html +10 -10
- package/docs/interfaces/FloorplanExtraObject3D.html +8 -8
- package/docs/interfaces/FloorplanFloorData.html +9 -9
- package/docs/interfaces/FloorplanImagePosition.html +7 -7
- package/docs/interfaces/FloorplanObserver.html +9 -9
- package/docs/interfaces/FloorplanOutlineItem.html +9 -9
- package/docs/interfaces/FloorplanPosition.html +7 -7
- package/docs/interfaces/FloorplanRoomItem.html +13 -13
- package/docs/interfaces/FloorplanRoomLabelItem.html +7 -7
- package/docs/interfaces/FloorplanServerBounding.html +8 -8
- package/docs/interfaces/FloorplanServerComputedData.html +10 -10
- package/docs/interfaces/FloorplanServerData.html +7 -7
- package/docs/interfaces/FloorplanServerDoorItem.html +10 -10
- package/docs/interfaces/FloorplanServerDoorPosition.html +8 -8
- package/docs/interfaces/FloorplanServerEntrance.html +11 -11
- package/docs/interfaces/FloorplanServerFloorData.html +9 -9
- package/docs/interfaces/FloorplanServerImagePosition.html +7 -7
- package/docs/interfaces/FloorplanServerObserver.html +9 -9
- package/docs/interfaces/FloorplanServerOutlineItem.html +9 -9
- package/docs/interfaces/FloorplanServerPosition.html +7 -7
- package/docs/interfaces/FloorplanServerRoomItem.html +14 -14
- package/docs/interfaces/FloorplanServerRoomLabelItem.html +7 -7
- package/docs/interfaces/HelperOffset.html +8 -8
- package/docs/interfaces/ItemLabelPluginData.html +6 -6
- package/docs/interfaces/ItemLabelPluginExportReturnsType.html +11 -11
- package/docs/interfaces/ItemLabelPluginParametersType.html +9 -9
- package/docs/interfaces/MinMax.html +7 -7
- package/docs/interfaces/ModelChassisCompassPluginData.html +7 -7
- package/docs/interfaces/ModelChassisCompassPluginExportType.html +8 -8
- package/docs/interfaces/ModelChassisCompassPluginParameterType.html +7 -7
- package/docs/interfaces/ModelEntryDoorGuidePluginData.html +8 -8
- package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +8 -8
- package/docs/interfaces/ModelItemLabelPluginData.html +6 -6
- package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +11 -11
- package/docs/interfaces/ModelItemLabelPluginParametersType.html +7 -7
- package/docs/interfaces/ModelRoomLabelPluginData.html +6 -6
- package/docs/interfaces/ModelTVVideoPluginData.html +9 -9
- package/docs/interfaces/ModelTVVideoPluginExportType.html +8 -8
- package/docs/interfaces/ModelTVVideoPluginParameterType.html +6 -6
- package/docs/interfaces/ModelViewPluginExportType.html +11 -11
- package/docs/interfaces/Object3DHelperState.html +8 -8
- package/docs/interfaces/ObjectHelperControllers.html +9 -9
- package/docs/interfaces/PaintBrushAction.html +12 -12
- package/docs/interfaces/PaintBrushConfigs.html +12 -12
- package/docs/interfaces/PaintBrushState.html +10 -10
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +10 -10
- package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +5 -5
- package/docs/interfaces/PanoMeasureParameterType.html +12 -12
- package/docs/interfaces/PanoMeasurePluginLineJson.html +8 -8
- package/docs/interfaces/PanoMeasurePluginOpenParameter.html +7 -7
- package/docs/interfaces/PanoMeasurePluginPointJson.html +7 -7
- package/docs/interfaces/PanoMeasurePluginPolylineJson.html +8 -8
- package/docs/interfaces/PanoRulerPluginExportType.html +10 -10
- package/docs/interfaces/PanoRulerPluginOptions.html +7 -7
- package/docs/interfaces/PanoRulerPluginParameterType.html +8 -8
- package/docs/interfaces/PanoRulerProPluginExportType.html +9 -9
- package/docs/interfaces/PanoRulerProPluginOptions.html +7 -7
- package/docs/interfaces/PanoRulerProPluginParameterType.html +7 -7
- package/docs/interfaces/PanoRulerProPluginState.html +8 -8
- package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +5 -5
- package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +5 -5
- package/docs/interfaces/PanoSpatialTagPluginData.html +11 -11
- package/docs/interfaces/PanoSpatialTagPluginDataElement.html +10 -10
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +13 -13
- package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +10 -10
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +13 -13
- package/docs/interfaces/PanoSpatialTagPluginPointElement.html +11 -11
- package/docs/interfaces/PanoSpatialTagPluginTagElement.html +10 -10
- package/docs/interfaces/Point.html +8 -8
- package/docs/interfaces/Room.html +9 -9
- package/docs/interfaces/RoomInfo.html +7 -7
- package/docs/interfaces/RoomLabel.html +14 -14
- package/docs/interfaces/RoomRules.html +5 -5
- package/docs/interfaces/Rooms.html +5 -5
- package/docs/interfaces/Scissor.html +9 -9
- package/docs/interfaces/State.html +8 -8
- package/docs/interfaces/TagCache.html +12 -12
- package/docs/interfaces/TagConfig.html +10 -10
- package/docs/interfaces/TagIconUrl.html +9 -9
- package/docs/interfaces/Tags.html +9 -9
- package/docs/interfaces/TemporaryState.html +6 -6
- package/docs/interfaces/Util.MagnifierParameter.html +11 -11
- package/docs/interfaces/Util.MouseGroupParameter.html +8 -8
- package/docs/modules/Util.html +5 -5
- package/docs/modules.html +4 -4
- package/docs/types/ArrayPosition.html +5 -5
- package/docs/types/AudioAppearance.html +5 -5
- package/docs/types/AudioTagTypeConfigKey.html +5 -5
- package/docs/types/CSS3DRenderExportType.html +5 -5
- package/docs/types/CSS3DRenderPluginExportType.html +5 -5
- package/docs/types/CSS3DRenderPluginParameterType.html +5 -5
- package/docs/types/ClassFunctionParameters.html +5 -5
- package/docs/types/Color.html +5 -5
- package/docs/types/ContentTypeConfigKey.html +5 -5
- package/docs/types/ContentTypeConfigKeySplit.html +5 -5
- package/docs/types/ContentTypeMap.html +5 -5
- package/docs/types/Create3DDomContainerReturnType.html +5 -5
- package/docs/types/Create3DElementReturnType.html +5 -5
- package/docs/types/CruisePluginExportType.html +5 -5
- package/docs/types/Direction-1.html +5 -5
- package/docs/types/Direction4.html +5 -5
- package/docs/types/FloorplanRuleLabels.html +5 -5
- package/docs/types/FloorplanServerRuleLabels.html +5 -5
- package/docs/types/GuideLinePluginExportType.html +5 -5
- package/docs/types/HelperEventMap.html +14 -14
- package/docs/types/LoadTagConfig.html +5 -5
- package/docs/types/MapviewFloorplanPluginParameterType.html +5 -5
- package/docs/types/MapviewFloorplanPluginReturnType.html +5 -5
- package/docs/types/MediaData.html +5 -5
- package/docs/types/MediaStore.html +5 -5
- package/docs/types/ModelElement.html +5 -5
- package/docs/types/ModelEntryDoorGuidePluginParameterType.html +5 -5
- package/docs/types/ModelFloorplanPluginParameterType.html +5 -5
- package/docs/types/ModelFloorplanPluginReturnType.html +5 -5
- package/docs/types/ModelRoomLabelPluginParameters.html +5 -5
- package/docs/types/ModelRoomLabelPluginReturnType.html +5 -5
- package/docs/types/MoveArgs.html +5 -5
- package/docs/types/MoveOpts.html +5 -5
- package/docs/types/Object3DHelperEventMap.html +5 -5
- package/docs/types/ObjectFit.html +5 -5
- package/docs/types/PaintBrushEventMap.html +5 -5
- package/docs/types/PanoCompassPluginData.html +5 -5
- package/docs/types/PanoCompassPluginExportType.html +5 -5
- package/docs/types/PanoCompassPluginParameterType.html +5 -5
- package/docs/types/PanoFloorplanRadarPluginParameterType.html +5 -5
- package/docs/types/PanoFloorplanRadarPluginReturnType.html +5 -5
- package/docs/types/PanoIndex.html +5 -5
- package/docs/types/PanoMeasurePluginEvent.html +5 -5
- package/docs/types/PanoMeasureReturnType.html +5 -5
- package/docs/types/PanoSpatialTagPluginId.html +5 -5
- package/docs/types/PanoTagPluginExportInterface.html +5 -5
- package/docs/types/PanoTagPluginParamsInterface.html +5 -5
- package/docs/types/PlaneTag.html +5 -5
- package/docs/types/PlaneTagElement.html +5 -5
- package/docs/types/Point2DElement.html +5 -5
- package/docs/types/Point2DTag.html +5 -5
- package/docs/types/Point3DElement.html +5 -5
- package/docs/types/Point3DTag.html +5 -5
- package/docs/types/PointTag.html +5 -5
- package/docs/types/PointTagElement.html +5 -5
- package/docs/types/Position.html +5 -5
- package/docs/types/RotateArgs.html +5 -5
- package/docs/types/RotateOpts.html +5 -5
- package/docs/types/RuleLabelsKey.html +5 -5
- package/docs/types/RuleLabelsValue.html +5 -5
- package/docs/types/StickType.html +5 -5
- package/docs/types/Tag.html +5 -5
- package/docs/types/Tag2D.html +5 -5
- package/docs/types/Tag3D.html +5 -5
- package/docs/types/TagContentType.html +5 -5
- package/docs/types/TagDimensionType.html +5 -5
- package/docs/types/TagElement.html +5 -5
- package/docs/types/TagEvents.html +5 -5
- package/docs/types/TagGLTFObject.html +5 -5
- package/docs/types/TagHooks.html +5 -5
- package/docs/types/TagIconSize.html +5 -5
- package/docs/types/TagId.html +5 -5
- package/docs/types/TagPointType.html +5 -5
- package/docs/types/TopviewFloorplanPluginParameterType.html +5 -5
- package/docs/types/TopviewFloorplanPluginReturnType.html +5 -5
- package/docs/types/WorkCode.html +5 -5
- package/docs/variables/FLOOR_TYPE_MAP.html +5 -5
- package/docs/variables/PLUGIN.html +5 -5
- package/docs/variables/ROOM_FETILE_TYPE_MAP.html +5 -5
- package/docs/variables/ROOM_TYPE_MAP.html +5 -5
- package/docs/variables/VERSION.html +5 -5
- package/docs/variables/itemLabelPluginServerParams.html +5 -5
- package/docs/variables/modelItemLabelPluginServerParams.html +5 -5
- package/docs/variables/modelRoomLabelPluginServerParams.html +5 -5
- package/libs/ModelItemLabelPlugin/ItemLabelItem.js +16 -16
- package/libs/PanoDoorLabelPlugin/DoorLabelItem.js +23 -25
- package/libs/PanoTagPlugin/controller/index.js +67 -67
- package/libs/shared-utils/Object3DHelper/Base/BaseController.d.ts +32 -4
- package/libs/shared-utils/Object3DHelper/Base/BaseController.js +2 -2
- package/libs/shared-utils/Object3DHelper/Controller/MoveController.d.ts +1 -1
- package/libs/shared-utils/Object3DHelper/Controller/MoveController.js +35 -35
- package/libs/shared-utils/Object3DHelper/Controller/RectangleScaleController.d.ts +4 -1
- package/libs/shared-utils/Object3DHelper/Controller/RectangleScaleController.js +56 -52
- package/libs/shared-utils/Object3DHelper/Controller/RotateController.d.ts +1 -1
- package/libs/shared-utils/Object3DHelper/Controller/RotateController.js +71 -72
- package/libs/shared-utils/Object3DHelper/Helper/CSS3DScaleHelper.d.ts +0 -2
- package/libs/shared-utils/Object3DHelper/Helper/CSS3DScaleHelper.js +22 -30
- package/libs/shared-utils/Object3DHelper/typings/Hooks.d.ts +2 -2
- package/package.json +1 -1
|
@@ -9,27 +9,27 @@ var P = (h, d, e) => d in h ? B(h, d, { enumerable: !0, configurable: !0, writab
|
|
|
9
9
|
for (var e of R(d))
|
|
10
10
|
W.call(d, e) && P(h, e, d[e]);
|
|
11
11
|
return h;
|
|
12
|
-
},
|
|
12
|
+
}, T = (h, d) => x(h, G(d));
|
|
13
13
|
var l = (h, d, e) => (P(h, typeof d != "symbol" ? d + "" : d, e), e);
|
|
14
14
|
var c = (h, d, e) => new Promise((t, i) => {
|
|
15
|
-
var s = (
|
|
15
|
+
var s = (n) => {
|
|
16
16
|
try {
|
|
17
|
-
|
|
17
|
+
r(e.next(n));
|
|
18
18
|
} catch (a) {
|
|
19
19
|
i(a);
|
|
20
20
|
}
|
|
21
|
-
}, o = (
|
|
21
|
+
}, o = (n) => {
|
|
22
22
|
try {
|
|
23
|
-
|
|
23
|
+
r(e.throw(n));
|
|
24
24
|
} catch (a) {
|
|
25
25
|
i(a);
|
|
26
26
|
}
|
|
27
|
-
},
|
|
28
|
-
|
|
27
|
+
}, r = (n) => n.done ? t(n.value) : Promise.resolve(n.value).then(s, o);
|
|
28
|
+
r((e = e.apply(h, d)).next());
|
|
29
29
|
});
|
|
30
30
|
import { Subscribe as z } from "@realsee/five";
|
|
31
31
|
import { Group as E, Vector3 as A, Matrix4 as S, Quaternion as _ } from "three";
|
|
32
|
-
import
|
|
32
|
+
import v from "object-assign-deep";
|
|
33
33
|
import { writable as $ } from "../../vendor/svelte/store/index.js";
|
|
34
34
|
import q from "../Components/TagContainer.js";
|
|
35
35
|
import H from "../Components/Tag/index.js";
|
|
@@ -37,7 +37,7 @@ import { arrayPositionToVector3 as C } from "../../CSS3DRenderPlugin/utils/posit
|
|
|
37
37
|
import { addDebugPoints as J } from "../utils/addDebugPoints.js";
|
|
38
38
|
import { planeNormal as k } from "../utils/planeNormal.js";
|
|
39
39
|
import "@realsee/five/gltf-loader";
|
|
40
|
-
import { isMediaModelTag as
|
|
40
|
+
import { isMediaModelTag as f } from "../utils/tag/tagCheck.js";
|
|
41
41
|
import { waitFiveModelLoaded as Q } from "../utils/actionAfterFiveModelLoad.js";
|
|
42
42
|
import { normalPositionToPositions as X } from "../utils/normalPositionToPositions.js";
|
|
43
43
|
import { debounce as j } from "../utils/debounce.js";
|
|
@@ -166,7 +166,7 @@ class pi extends Y {
|
|
|
166
166
|
});
|
|
167
167
|
l(this, "enabledModelTagSet", /* @__PURE__ */ new Set());
|
|
168
168
|
l(this, "changeTagModel", (e, t) => c(this, null, function* () {
|
|
169
|
-
e.data =
|
|
169
|
+
e.data = v({}, e.data, t), yield this.loadModel(e), this.updateRenderAllTags();
|
|
170
170
|
}));
|
|
171
171
|
l(this, "disposedErrorLog", () => {
|
|
172
172
|
console.error(`${M} is disposed`);
|
|
@@ -174,34 +174,34 @@ class pi extends Y {
|
|
|
174
174
|
l(this, "handleFiveInitAnimationEnded", () => {
|
|
175
175
|
const e = this.five.getCurrentState().mode;
|
|
176
176
|
this.tags.forEach((t) => {
|
|
177
|
-
|
|
177
|
+
f(t) && e === "Panorama" && this.changeTagMode(t, "front"), t.state.visible = this.getVisible(t);
|
|
178
178
|
}), this.updateRenderAllTags(), this.updateRenderAllTags();
|
|
179
179
|
});
|
|
180
180
|
l(this, "handleFiveModelShownFloorChange", () => {
|
|
181
181
|
this.tags.forEach((e) => {
|
|
182
|
-
!
|
|
182
|
+
!f(e) || (e.state.visible = this.getVisible(e));
|
|
183
183
|
}), this.updateRenderAllTags();
|
|
184
184
|
});
|
|
185
185
|
l(this, "loadModel", (e) => c(this, null, function* () {
|
|
186
|
-
var
|
|
186
|
+
var n;
|
|
187
187
|
const t = e.data.modelUrl;
|
|
188
188
|
if (!t)
|
|
189
189
|
return;
|
|
190
190
|
const i = te(t).then((a) => Object.assign(a.scene, { customID: e.id, isTagModel: !0 }));
|
|
191
191
|
e.model = { promise: i };
|
|
192
192
|
const s = yield i;
|
|
193
|
-
if (((
|
|
193
|
+
if (((n = e.model) == null ? void 0 : n.promise) !== i || (e.model.object = s, !this.tags.includes(e)))
|
|
194
194
|
return;
|
|
195
195
|
s.visible = e.state.visible, new S().fromArray(e.matrix).decompose(s.position, s.quaternion, s.scale), s.updateWorldMatrix(!0, !0), this.getVisibleByFloorIndex(e) || (s.visible = !1);
|
|
196
|
-
const
|
|
197
|
-
return
|
|
196
|
+
const r = this.gltfObjectGroup.children.find((a) => a.customID === e.id);
|
|
197
|
+
return r && this.gltfObjectGroup.remove(r), this.gltfObjectGroup.add(s), this.updateTagCss3DObjectMatrix(e, s), s;
|
|
198
198
|
}));
|
|
199
199
|
this.group.name = "PanoTagPluginModelGroup", this.gltfObjectGroup.name = "PanoTagPluginGLTFObjectGroup", this.group.add(this.gltfObjectGroup), this.params = p({ debug: !1, config: this.config }, t), this.debug = this.params.debug, this.config = this.params.config, U(1, { namespace: L.GetAudioDuration }), U(1, { namespace: L.PlayAudio }), Object.assign(window, { [`__PANOTAGPLUGIN_DEBUG_${Date.now()}__`]: this }), Object.assign(window, { __PANOTAGPLUGIN_DEBUG__: this }), this.state.enabled && this.five.scene.add(this.group);
|
|
200
200
|
}
|
|
201
201
|
load(e, t) {
|
|
202
202
|
return c(this, null, function* () {
|
|
203
203
|
var s, o;
|
|
204
|
-
this.clearTags(), console.info(M, " load:", { data: JSON.parse(JSON.stringify(e)) }), this.config =
|
|
204
|
+
this.clearTags(), console.info(M, " load:", { data: JSON.parse(JSON.stringify(e)) }), this.config = v({}, this.config, {
|
|
205
205
|
globalConfig: (s = e.globalConfig) != null ? s : {},
|
|
206
206
|
contentTypeConfig: (o = e.contentTypeConfig) != null ? o : {}
|
|
207
207
|
});
|
|
@@ -209,8 +209,8 @@ class pi extends Y {
|
|
|
209
209
|
if (this.debug)
|
|
210
210
|
try {
|
|
211
211
|
J(this.five, this.tags);
|
|
212
|
-
} catch (
|
|
213
|
-
console.error(
|
|
212
|
+
} catch (r) {
|
|
213
|
+
console.error(r);
|
|
214
214
|
}
|
|
215
215
|
return i;
|
|
216
216
|
});
|
|
@@ -218,25 +218,25 @@ class pi extends Y {
|
|
|
218
218
|
addTag(e, t) {
|
|
219
219
|
return c(this, null, function* () {
|
|
220
220
|
const s = (Array.isArray(e) ? e : [e]).map((o) => {
|
|
221
|
-
const
|
|
222
|
-
|
|
221
|
+
const r = this.getTagConfig(o);
|
|
222
|
+
return T(p({}, o), {
|
|
223
|
+
state: p({ visible: void 0, unfolded: ie }, r.initialState),
|
|
223
224
|
hooks: new z(),
|
|
224
|
-
clickable:
|
|
225
|
-
mergedConfig:
|
|
225
|
+
clickable: r.clickable,
|
|
226
|
+
mergedConfig: r
|
|
226
227
|
});
|
|
227
|
-
return m(o) && (r.temporaryState = { visible: !1 }), r;
|
|
228
228
|
}).filter((o) => o.position);
|
|
229
229
|
return s.forEach(ee), this.tags.push(...s), Q(this.five).then(() => {
|
|
230
|
-
var o,
|
|
231
|
-
return this.store.eventListenerDisposer && ((
|
|
230
|
+
var o, r, n;
|
|
231
|
+
return this.store.eventListenerDisposer && ((r = (o = this.store).eventListenerDisposer) == null || r.call(o)), this.state.enabled && (this.store.eventListenerDisposer = this.addEventListener()), this.addResizeListener(), this.checkPanelTag(), this.setVisibleAndUnfolded({ withAnimation: (n = t == null ? void 0 : t.withAnimation) != null ? n : !0 }).then(() => this.updateRenderAllTags()), this.updateRenderAllTags(), this.addMediaModelTag(s);
|
|
232
232
|
});
|
|
233
233
|
});
|
|
234
234
|
}
|
|
235
235
|
changeConfig(e, t = !0) {
|
|
236
|
-
t ? this.config =
|
|
236
|
+
t ? this.config = v({}, this.config, e) : this.config = e, this.updateTagConfig({ force: !0 }), this.updateRenderAllTags();
|
|
237
237
|
}
|
|
238
238
|
changeGlobalConfig(e, t = !0) {
|
|
239
|
-
t ? this.config.globalConfig =
|
|
239
|
+
t ? this.config.globalConfig = v({}, this.config.globalConfig, e) : this.config.globalConfig = e, this.updateTagConfig({ force: !0 }), this.updateRenderAllTags();
|
|
240
240
|
}
|
|
241
241
|
clearTags() {
|
|
242
242
|
this.tags = [], this.enabledModelTagSet.clear(), this.clearCache(), this.disposeAllCSS3DContainer(), this.updateRenderAllTags();
|
|
@@ -270,11 +270,11 @@ class pi extends Y {
|
|
|
270
270
|
this.setState({ enabled: !1 }, { userAction: t }), this.five.scene.remove(this.group), this.hooks.emit("disable", { userAction: t }), this.five.needsRender = !0;
|
|
271
271
|
}
|
|
272
272
|
dispose() {
|
|
273
|
-
var e, t, i, s, o,
|
|
274
|
-
this.pauseCurrentMedia(), this.disposeAllCSS3DContainer(), (e = this.TagContainerSvelte) == null || e.$destroy(), this.filter3DTag().forEach((
|
|
273
|
+
var e, t, i, s, o, r;
|
|
274
|
+
this.pauseCurrentMedia(), this.disposeAllCSS3DContainer(), (e = this.TagContainerSvelte) == null || e.$destroy(), this.filter3DTag().forEach((n) => {
|
|
275
275
|
var a;
|
|
276
|
-
return (a =
|
|
277
|
-
}), this.tags = [], (t = this.store.disposers) == null || t.forEach((
|
|
276
|
+
return (a = n.tag3DContentSvelte) == null ? void 0 : a.svelteApp.$destroy();
|
|
277
|
+
}), this.tags = [], (t = this.store.disposers) == null || t.forEach((n) => n == null ? void 0 : n()), this.store.disposers = [], this.store.disposed = !0, (s = (i = this.store).eventListenerDisposer) == null || s.call(i), this.store.eventListenerDisposer = void 0, (r = (o = this.store).resizeObserverDisposer) == null || r.call(o), this.store.resizeObserverDisposer = void 0, this.store.resizeObserverDisposerAdding = !1, this.five.scene.remove(this.group), this.group.remove(...this.group.children), this.gltfObjectGroup.remove(...this.gltfObjectGroup.children), this.clearCache(), this.five.needsRender = !0, this.hooks.emit("dispose");
|
|
278
278
|
}
|
|
279
279
|
setState(e, t) {
|
|
280
280
|
if (this.store.disposed)
|
|
@@ -297,14 +297,14 @@ class pi extends Y {
|
|
|
297
297
|
}
|
|
298
298
|
changeDataById(e, t, i = !0) {
|
|
299
299
|
const s = this.getTagById(e);
|
|
300
|
-
!s || (i ? s.data =
|
|
300
|
+
!s || (i ? s.data = v({}, s.data, t) : s.data = p(p({}, s.data), t), this.checkPanelTag(), this.updateRenderAllTags());
|
|
301
301
|
}
|
|
302
302
|
changeStickTypeById(e, t, i = !0) {
|
|
303
303
|
this.changeTagById(e, t, i);
|
|
304
304
|
}
|
|
305
305
|
changeTagById(e, t, i = !0) {
|
|
306
306
|
const s = this.getTagById(e);
|
|
307
|
-
!t || (i ?
|
|
307
|
+
!t || (i ? v(s, t) : Object.assign(s, t), (s == null ? void 0 : s.tag3DContentSvelte) && (t == null ? void 0 : t.normal) && (s.tag3DContentSvelte.currentNormal = C(t.normal)), this.updateRenderAllTags(), this.checkPanelTag());
|
|
308
308
|
}
|
|
309
309
|
destroyTagById(e) {
|
|
310
310
|
(Array.isArray(e) ? e : [e]).forEach((i) => {
|
|
@@ -320,21 +320,21 @@ class pi extends Y {
|
|
|
320
320
|
const i = (O = (w = (D = e.mergedConfig) == null ? void 0 : D.tag3DConfig) == null ? void 0 : w.ratio) != null ? O : 216e-5, s = (F = e.tag3DContentSvelte) == null ? void 0 : F.domContainer.css3DObject;
|
|
321
321
|
if (!s)
|
|
322
322
|
return;
|
|
323
|
-
const o =
|
|
323
|
+
const o = f(e) ? e.data.mediaPosition : e.position;
|
|
324
324
|
t.updateWorldMatrix(!1, !1);
|
|
325
|
-
const
|
|
326
|
-
|
|
325
|
+
const r = t.matrixWorld, n = new A().fromArray(o[0]), a = new A().fromArray(o[2]), m = new A().lerpVectors(n, a, 0.5).add(new A(0, 0, 5e-4)), g = new S().setPosition(m), y = new S().makeScale(i, i, i), b = new S().multiply(r).multiply(g).multiply(y);
|
|
326
|
+
b.decompose(s.position, s.quaternion, s.scale);
|
|
327
327
|
const u = s.opacityMesh;
|
|
328
|
-
!u ||
|
|
328
|
+
!u || b.decompose(u.position, u.quaternion, u.scale);
|
|
329
329
|
}
|
|
330
330
|
updateTagCss3DObjectVisible(e) {
|
|
331
|
-
var s, o,
|
|
331
|
+
var s, o, r, n, a;
|
|
332
332
|
const t = (s = e.tag3DContentSvelte) == null ? void 0 : s.domContainer.css3DObject;
|
|
333
333
|
if (!t)
|
|
334
334
|
return;
|
|
335
|
-
t.visible = (
|
|
335
|
+
t.visible = (r = (o = e.state) == null ? void 0 : o.visible) != null ? r : !0;
|
|
336
336
|
const i = t.opacityMesh;
|
|
337
|
-
!i || (i.visible = (a = (
|
|
337
|
+
!i || (i.visible = (a = (n = e.state) == null ? void 0 : n.visible) != null ? a : !0);
|
|
338
338
|
}
|
|
339
339
|
setVisibleAndUnfolded() {
|
|
340
340
|
return c(this, arguments, function* ({ withAnimation: e } = { withAnimation: !1 }) {
|
|
@@ -363,9 +363,9 @@ class pi extends Y {
|
|
|
363
363
|
});
|
|
364
364
|
}
|
|
365
365
|
addEventListener() {
|
|
366
|
-
const { five: e, hooks: t } = this, i = this.handleFiveWantsMoveToPano.bind(this), s = this.handleFiveModeChange.bind(this), o = this.handleFiveCameraUpdate.bind(this),
|
|
367
|
-
return this.handleFiveModeChange(g), this.handleFivePanoArrived(), e.on("wantsMoveToPano", i), e.on("modeChange", s), e.on("initAnimationEnded", this.handleFiveInitAnimationEnded), e.on("modelShownFloorChange", this.handleFiveModelShownFloorChange), e.on("cameraUpdate", o), e.on("cameraUpdate",
|
|
368
|
-
e.off("wantsMoveToPano", i), e.off("modeChange", s), e.off("initAnimationEnded", this.handleFiveInitAnimationEnded), e.off("modelShownFloorChange", this.handleFiveModelShownFloorChange), e.off("cameraUpdate", o), e.off("cameraUpdate",
|
|
366
|
+
const { five: e, hooks: t } = this, i = this.handleFiveWantsMoveToPano.bind(this), s = this.handleFiveModeChange.bind(this), o = this.handleFiveCameraUpdate.bind(this), r = this.handleFiveCameraUpdateDebounce(), n = this.handleFivePanoArrived.bind(this), a = this.loadVideoFirstFrame.bind(this), m = this.clickhandler.bind(this), g = this.five.currentMode;
|
|
367
|
+
return this.handleFiveModeChange(g), this.handleFivePanoArrived(), e.on("wantsMoveToPano", i), e.on("modeChange", s), e.on("initAnimationEnded", this.handleFiveInitAnimationEnded), e.on("modelShownFloorChange", this.handleFiveModelShownFloorChange), e.on("cameraUpdate", o), e.on("cameraUpdate", r), e.on("panoArrived", n), e.on("panoArrived", a), t.on("click", m), () => {
|
|
368
|
+
e.off("wantsMoveToPano", i), e.off("modeChange", s), e.off("initAnimationEnded", this.handleFiveInitAnimationEnded), e.off("modelShownFloorChange", this.handleFiveModelShownFloorChange), e.off("cameraUpdate", o), e.off("cameraUpdate", r), e.off("panoArrived", n), e.off("panoArrived", a), t.off("click", m), this.store.eventListenerDisposer = void 0;
|
|
369
369
|
};
|
|
370
370
|
}
|
|
371
371
|
loadVideoFirstFrame() {
|
|
@@ -391,23 +391,23 @@ class pi extends Y {
|
|
|
391
391
|
!this.store.resizeObserverDisposer || i();
|
|
392
392
|
}, 500),
|
|
393
393
|
e
|
|
394
|
-
), { observe:
|
|
394
|
+
), { observe: r, unobserve: n } = I(
|
|
395
395
|
j(() => t(), 400),
|
|
396
396
|
e
|
|
397
397
|
);
|
|
398
|
-
return s(),
|
|
399
|
-
o(),
|
|
398
|
+
return s(), r(), () => {
|
|
399
|
+
o(), n();
|
|
400
400
|
};
|
|
401
401
|
}
|
|
402
402
|
handleFiveModeChange(e) {
|
|
403
403
|
this.tags.forEach((t) => {
|
|
404
|
-
|
|
404
|
+
f(t) && e !== "Panorama" && this.changeTagMode(t, "behind"), t.state.visible = this.getVisible(t);
|
|
405
405
|
}), this.updateRenderAllTags(), this.updateRenderAllTags();
|
|
406
406
|
}
|
|
407
407
|
handleFiveWantsMoveToPano() {
|
|
408
408
|
this.tags.forEach((e) => {
|
|
409
409
|
const t = this.getTagConfig(e);
|
|
410
|
-
typeof t.visibleConfig == "object" && (t.visibleConfig.keep ? e.temporaryState =
|
|
410
|
+
typeof t.visibleConfig == "object" && (t.visibleConfig.keep ? e.temporaryState = T(p({}, e.temporaryState), { visible: t.visibleConfig.keep === "visible" }) : e.temporaryState = T(p({}, e.temporaryState), { visible: Boolean(t.visibleConfig.alwaysShowWhenMovePano) }));
|
|
411
411
|
}), this.updateTagContainerVisible();
|
|
412
412
|
}
|
|
413
413
|
temporaryShow({ withAnimation: e } = { withAnimation: !1 }) {
|
|
@@ -455,7 +455,7 @@ class pi extends Y {
|
|
|
455
455
|
handleFivePanoArrived() {
|
|
456
456
|
return c(this, null, function* () {
|
|
457
457
|
yield this.setVisibleAndUnfolded(), this.setModelMedialVisibleByPanoIndex(), this.tags.forEach((e) => {
|
|
458
|
-
e.temporaryState =
|
|
458
|
+
e.temporaryState = T(p({}, e.temporaryState), { visible: !0 });
|
|
459
459
|
}), this.store.visibleWithAnimation = !0, this.updateTagContainerVisible();
|
|
460
460
|
});
|
|
461
461
|
}
|
|
@@ -486,25 +486,25 @@ class pi extends Y {
|
|
|
486
486
|
}
|
|
487
487
|
updateRenderPlaneTag() {
|
|
488
488
|
this.sort([...this.filterPlaneTag(), ...this.filter3DPointTag(), ...this.filterModelTag()]).forEach((t) => {
|
|
489
|
-
var
|
|
490
|
-
if (t.tag3DContentSvelte) {
|
|
491
|
-
const { svelteApp: g, domContainer: y, initialNormal:
|
|
489
|
+
var n, a, m;
|
|
490
|
+
if (f(t) && ((n = t.model) == null ? void 0 : n.object) && this.updateTagCss3DObjectMatrix(t, (a = t.model) == null ? void 0 : a.object), t.tag3DContentSvelte) {
|
|
491
|
+
const { svelteApp: g, domContainer: y, initialNormal: b, currentNormal: u } = t.tag3DContentSvelte;
|
|
492
492
|
if (this.updateTagCss3DObjectVisible(t), g.$set({
|
|
493
493
|
tag: t,
|
|
494
494
|
hooks: this.hooks,
|
|
495
495
|
state: this.state,
|
|
496
496
|
temporaryState: this.temporaryState
|
|
497
|
-
}), !
|
|
498
|
-
const D = new _().setFromUnitVectors(
|
|
497
|
+
}), !b.equals(u)) {
|
|
498
|
+
const D = new _().setFromUnitVectors(b, u);
|
|
499
499
|
y.css3DObject.setRotationFromQuaternion(D);
|
|
500
500
|
}
|
|
501
501
|
return;
|
|
502
502
|
}
|
|
503
|
-
if (((
|
|
503
|
+
if (((m = t.state) == null ? void 0 : m.visible) === !1)
|
|
504
504
|
return;
|
|
505
505
|
if (this.css3DRenderPlugin || (this.css3DRenderPlugin = Z(this.five)), t.stickType === "3DPoint" && !t.normal)
|
|
506
506
|
return console.error("updateRenderPlaneTag: \u4E09\u7EF4\u70B9\u6807\u7B7E\u7F3A\u5C11\u6CD5\u5411\u91CF\uFF01");
|
|
507
|
-
const i = (() => t.stickType === "Plane" ? t.position :
|
|
507
|
+
const i = (() => t.stickType === "Plane" ? t.position : f(t) ? t.data.mediaPosition : X(
|
|
508
508
|
this.five.camera.position,
|
|
509
509
|
C(t.position),
|
|
510
510
|
C(t.normal)
|
|
@@ -521,27 +521,27 @@ class pi extends Y {
|
|
|
521
521
|
}();
|
|
522
522
|
if (!s)
|
|
523
523
|
return;
|
|
524
|
-
const o = this.getTagConfig(t).tag3DConfig,
|
|
525
|
-
!
|
|
524
|
+
const o = this.getTagConfig(t).tag3DConfig, r = this.css3DRenderPlugin.create3DDomContainer(i, o);
|
|
525
|
+
!r || (this.updateTagCss3DObjectVisible(t), this.store.css3DRenderDisposer.set(t.id, r.dispose), t.tag3DContentSvelte = {
|
|
526
526
|
svelteApp: new H({
|
|
527
|
-
target:
|
|
527
|
+
target: r.container,
|
|
528
528
|
props: {
|
|
529
529
|
tag: t,
|
|
530
530
|
hooks: this.hooks,
|
|
531
|
-
state:
|
|
531
|
+
state: this.state,
|
|
532
532
|
mediaStore: this.mediaStore,
|
|
533
533
|
temporaryState: this.temporaryState
|
|
534
534
|
}
|
|
535
535
|
}),
|
|
536
|
-
domContainer:
|
|
536
|
+
domContainer: r,
|
|
537
537
|
initialNormal: s,
|
|
538
538
|
currentNormal: s
|
|
539
|
-
}
|
|
539
|
+
});
|
|
540
540
|
}), this.checkPanelTag();
|
|
541
541
|
}
|
|
542
542
|
updateRenderModelTag() {
|
|
543
543
|
const e = (i) => !this.enabledModelTagSet.has(i.customID);
|
|
544
|
-
this.gltfObjectGroup.remove(...this.gltfObjectGroup.children.filter(e)), this.tags.filter(
|
|
544
|
+
this.gltfObjectGroup.remove(...this.gltfObjectGroup.children.filter(e)), this.tags.filter(f).forEach((i) => {
|
|
545
545
|
var s;
|
|
546
546
|
(s = i.model) == null || s.promise.then((o) => {
|
|
547
547
|
o.visible = i.state.visible;
|
|
@@ -565,13 +565,13 @@ class pi extends Y {
|
|
|
565
565
|
}
|
|
566
566
|
addMediaModelTag(e) {
|
|
567
567
|
return c(this, null, function* () {
|
|
568
|
-
const t = e.filter(
|
|
568
|
+
const t = e.filter(f).map(this.loadModel);
|
|
569
569
|
yield Promise.all(t), this.five.getCurrentState().mode === "Panorama" && this.setModelMedialVisibleByPanoIndex(), this.updateRenderAllTags();
|
|
570
570
|
});
|
|
571
571
|
}
|
|
572
572
|
changeTagMode(e, t) {
|
|
573
|
-
var i, s, o,
|
|
574
|
-
((o = (s = (i = e.tag3DContentSvelte) == null ? void 0 : i.domContainer) == null ? void 0 : s.css3DObject) == null ? void 0 : o.mode) !== t && ((
|
|
573
|
+
var i, s, o, r, n;
|
|
574
|
+
((o = (s = (i = e.tag3DContentSvelte) == null ? void 0 : i.domContainer) == null ? void 0 : s.css3DObject) == null ? void 0 : o.mode) !== t && ((r = e.config) != null && r.tag3DConfig ? e.config.tag3DConfig.mode = t : e.config ? e.config.tag3DConfig = { mode: t } : e.config = { tag3DConfig: { mode: t } }, (n = this.store.css3DRenderDisposer.get(e.id)) == null || n(), e.tag3DContentSvelte = void 0);
|
|
575
575
|
}
|
|
576
576
|
}
|
|
577
577
|
export {
|
|
@@ -41,9 +41,23 @@ export declare abstract class BaseController<T extends BaseHelper = BaseHelper,
|
|
|
41
41
|
show(): void;
|
|
42
42
|
hide(): void;
|
|
43
43
|
dispose(): void;
|
|
44
|
-
|
|
44
|
+
/**
|
|
45
|
+
* @description: applyHelperMatrix4
|
|
46
|
+
* @param {THREE.Matrix4} matrix position 偏移量
|
|
47
|
+
*/
|
|
48
|
+
applyHelperMatrix4(matrix: THREE.Matrix4): void;
|
|
49
|
+
/**
|
|
50
|
+
* @description: applyHelperQuaternion
|
|
51
|
+
* @param {THREE.Quaternion} quaternion 旋转四元数
|
|
52
|
+
* @param {THREE.Vector3} origin 旋转中心
|
|
53
|
+
*/
|
|
45
54
|
applyHelperQuaternion(quaternion: THREE.Quaternion, origin: THREE.Vector3): void;
|
|
46
|
-
|
|
55
|
+
/**
|
|
56
|
+
* @description: applyHelperScaleMatrix4
|
|
57
|
+
* @param {THREE.Matrix4} matrix 缩放矩阵
|
|
58
|
+
* @param {THREE.Vector3} origin 缩放中心
|
|
59
|
+
*/
|
|
60
|
+
applyHelperScaleMatrix4(matrix: THREE.Matrix4, origin?: THREE.Vector3): void;
|
|
47
61
|
onWantsTapGesture: (raycaster: THREE.Raycaster) => false | void;
|
|
48
62
|
onWantsGesture(type: 'press' | 'pan' | string, pointers: {
|
|
49
63
|
x: number;
|
|
@@ -52,16 +66,30 @@ export declare abstract class BaseController<T extends BaseHelper = BaseHelper,
|
|
|
52
66
|
onIntersectionOnModelUpdate(intersection: {
|
|
53
67
|
point: THREE.Vector3;
|
|
54
68
|
}): void;
|
|
69
|
+
/**
|
|
70
|
+
* @description: onApplyOriginObjectScale
|
|
71
|
+
* @param {THREE.Matrix4} params.matrix 缩放矩阵
|
|
72
|
+
* @param {THREE.Vector3} params.origin 缩放中心
|
|
73
|
+
*/
|
|
55
74
|
protected onApplyOriginObjectScale(params: {
|
|
56
|
-
|
|
75
|
+
matrix: THREE.Matrix4;
|
|
57
76
|
origin?: THREE.Vector3;
|
|
58
77
|
}): void;
|
|
78
|
+
/**
|
|
79
|
+
* @description: onApplyOriginObjectRotate
|
|
80
|
+
* @param {THREE.Quaternion} params.quaternion 旋转四元数
|
|
81
|
+
* @param {THREE.Vector3} params.origin 旋转中心
|
|
82
|
+
*/
|
|
59
83
|
protected onApplyOriginObjectRotate(params: {
|
|
60
84
|
quaternion: THREE.Quaternion;
|
|
61
85
|
origin: THREE.Vector3;
|
|
62
86
|
}): void;
|
|
87
|
+
/**
|
|
88
|
+
* @description: onApplyOriginObjectPosition
|
|
89
|
+
* @param {THREE.Matrix4} params.matrix position 偏移量
|
|
90
|
+
*/
|
|
63
91
|
protected onApplyOriginObjectPosition(params: {
|
|
64
|
-
|
|
92
|
+
matrix: THREE.Matrix4;
|
|
65
93
|
}): void;
|
|
66
94
|
protected onSetOriginObjectScale(scale: THREE.Vector3): void;
|
|
67
95
|
protected onSetOriginObjectRotate(quaternion: THREE.Quaternion, origin: THREE.Vector3): void;
|
|
@@ -73,13 +73,13 @@ class k {
|
|
|
73
73
|
onIntersectionOnModelUpdate(e) {
|
|
74
74
|
}
|
|
75
75
|
onApplyOriginObjectScale(e) {
|
|
76
|
-
this.applyHelperScaleMatrix4(e.
|
|
76
|
+
this.applyHelperScaleMatrix4(e.matrix, e.origin);
|
|
77
77
|
}
|
|
78
78
|
onApplyOriginObjectRotate(e) {
|
|
79
79
|
this.applyHelperQuaternion(e.quaternion, e.origin);
|
|
80
80
|
}
|
|
81
81
|
onApplyOriginObjectPosition(e) {
|
|
82
|
-
this.applyHelperMatrix4(e.
|
|
82
|
+
this.applyHelperMatrix4(e.matrix);
|
|
83
83
|
}
|
|
84
84
|
onSetOriginObjectScale(e) {
|
|
85
85
|
this.helperObject3D.scale.copy(e), this.updateOffsetByScale(e);
|
|
@@ -22,7 +22,7 @@ export declare class MoveController<T extends MoveHelperAbstract = MoveHelperAbs
|
|
|
22
22
|
point: THREE.Vector3;
|
|
23
23
|
}): void;
|
|
24
24
|
protected onApplyOriginObjectScale(params: {
|
|
25
|
-
|
|
25
|
+
matrix: THREE.Matrix4;
|
|
26
26
|
origin?: THREE.Vector3;
|
|
27
27
|
}): void;
|
|
28
28
|
private handleMouseDown;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var p = Object.defineProperty;
|
|
2
2
|
var v = (c, i, e) => i in c ? p(c, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : c[i] = e;
|
|
3
3
|
var u = (c, i, e) => (v(c, typeof i != "symbol" ? i + "" : i, e), e);
|
|
4
|
-
import { BaseController as
|
|
5
|
-
import * as
|
|
6
|
-
import { getMouseRaycaster as
|
|
7
|
-
class w extends
|
|
4
|
+
import { BaseController as f } from "../Base/BaseController.js";
|
|
5
|
+
import * as m from "three";
|
|
6
|
+
import { getMouseRaycaster as g } from "../utils/getMouseRaycaster.js";
|
|
7
|
+
class w extends f {
|
|
8
8
|
constructor(...e) {
|
|
9
9
|
super(...e);
|
|
10
10
|
u(this, "name", "MoveController");
|
|
@@ -12,11 +12,11 @@ class w extends g {
|
|
|
12
12
|
u(this, "_moveByMouseEnable", !1);
|
|
13
13
|
u(this, "mouseInfo");
|
|
14
14
|
u(this, "mousedownEventListenerDisposer");
|
|
15
|
-
const
|
|
16
|
-
this.hoverListener([
|
|
17
|
-
const
|
|
18
|
-
this.domEvents.addEventListener(this.helperObject3D, "mousedown",
|
|
19
|
-
this.domEvents.removeEventListener(this.helperObject3D, "mousedown",
|
|
15
|
+
const t = this.helperObject3D;
|
|
16
|
+
this.hoverListener([t.xArrow, t.yArrow, t.zArrow]);
|
|
17
|
+
const o = this.dragStart.bind(this), r = this.dragging.bind(this), h = this.dragEnd.bind(this), s = this.show.bind(this), n = this.hide.bind(this);
|
|
18
|
+
this.domEvents.addEventListener(this.helperObject3D, "mousedown", o), document.addEventListener("mousemove", r), document.addEventListener("mouseup", h), this.hooks.on("rotateStart", n), this.hooks.on("rotateEnd", s), this.hooks.on("moveByMouseEnable", n), this.hooks.on("moveByMouseDisable", s), this.disposers.push(() => {
|
|
19
|
+
this.domEvents.removeEventListener(this.helperObject3D, "mousedown", o), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", h), this.hooks.off("rotateStart", n), this.hooks.off("rotateEnd", s), this.hooks.off("moveByMouseEnable", n), this.hooks.off("moveByMouseDisable", s);
|
|
20
20
|
}), this.moveByMouseEnable && this.moveByMouse();
|
|
21
21
|
}
|
|
22
22
|
get moveByMouseEnable() {
|
|
@@ -24,15 +24,15 @@ class w extends g {
|
|
|
24
24
|
}
|
|
25
25
|
dispose() {
|
|
26
26
|
var e;
|
|
27
|
-
super.dispose(), (e = this.disposers) == null || e.forEach((
|
|
27
|
+
super.dispose(), (e = this.disposers) == null || e.forEach((t) => t == null ? void 0 : t());
|
|
28
28
|
}
|
|
29
29
|
moveByMouse() {
|
|
30
30
|
this._moveByMouseEnable = !0;
|
|
31
|
-
const e = this.handleMouseDown.bind(this),
|
|
31
|
+
const e = this.handleMouseDown.bind(this), t = this.handleMouseUp.bind(this);
|
|
32
32
|
this.hooks.emit("moveByMouseEnable"), setTimeout(() => {
|
|
33
|
-
this.container.addEventListener("mousedown", e), this.container.addEventListener("mouseup",
|
|
33
|
+
this.container.addEventListener("mousedown", e), this.container.addEventListener("mouseup", t);
|
|
34
34
|
}), this.mousedownEventListenerDisposer = () => {
|
|
35
|
-
this.container.removeEventListener("mousedown", e), this.container.removeEventListener("mouseup",
|
|
35
|
+
this.container.removeEventListener("mousedown", e), this.container.removeEventListener("mouseup", t);
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
38
|
disableMoveByMouse() {
|
|
@@ -45,63 +45,63 @@ class w extends g {
|
|
|
45
45
|
onApplyOriginObjectScale(e) {
|
|
46
46
|
}
|
|
47
47
|
handleMouseDown(e) {
|
|
48
|
-
const { x:
|
|
49
|
-
this.mouseInfo = { x:
|
|
48
|
+
const { x: t, y: o } = e;
|
|
49
|
+
this.mouseInfo = { x: t, y: o, mouseDownTimestamp: Date.now() };
|
|
50
50
|
}
|
|
51
51
|
handleMouseUp(e) {
|
|
52
52
|
if (!this.mouseInfo)
|
|
53
53
|
return;
|
|
54
|
-
const { x:
|
|
55
|
-
this.mouseInfo.x ===
|
|
54
|
+
const { x: t, y: o } = e;
|
|
55
|
+
this.mouseInfo.x === t && this.mouseInfo.y === o && Date.now() - this.mouseInfo.mouseDownTimestamp < 500 && (this.disableMoveByMouse(), this.mouseInfo = void 0);
|
|
56
56
|
}
|
|
57
57
|
dragStart(e) {
|
|
58
58
|
if (this._moveByMouseEnable || this.isDragging)
|
|
59
59
|
return;
|
|
60
|
-
const
|
|
61
|
-
if (!o)
|
|
62
|
-
return this.dragEnd();
|
|
63
|
-
const t = (o == null ? void 0 : o.object).direction;
|
|
60
|
+
const t = e == null ? void 0 : e.intersect;
|
|
64
61
|
if (!t)
|
|
65
62
|
return this.dragEnd();
|
|
66
|
-
const
|
|
67
|
-
|
|
63
|
+
const o = (t == null ? void 0 : t.object).direction;
|
|
64
|
+
if (!o)
|
|
65
|
+
return this.dragEnd();
|
|
66
|
+
const r = new m.Vector3(1, 0, 0).applyQuaternion(this.helperObject3D.quaternion), h = new m.Vector3(0, 1, 0).applyQuaternion(this.helperObject3D.quaternion), s = new m.Vector3(0, 0, 1).applyQuaternion(this.helperObject3D.quaternion), n = (() => {
|
|
67
|
+
switch (o) {
|
|
68
68
|
case "x":
|
|
69
69
|
return r;
|
|
70
70
|
case "y":
|
|
71
|
-
return
|
|
71
|
+
return h;
|
|
72
72
|
case "z":
|
|
73
73
|
return s;
|
|
74
74
|
}
|
|
75
75
|
})(), l = (() => {
|
|
76
|
-
switch (
|
|
76
|
+
switch (o) {
|
|
77
77
|
case "x":
|
|
78
78
|
case "y":
|
|
79
79
|
return s;
|
|
80
80
|
case "z":
|
|
81
81
|
return r;
|
|
82
82
|
}
|
|
83
|
-
})(),
|
|
84
|
-
|
|
83
|
+
})(), a = t.point.clone(), d = new m.Plane();
|
|
84
|
+
d.setFromNormalAndCoplanarPoint(l, a), this.startInfo = { startVectorProject: a.clone().projectOnVector(n), directionVector: n, plane: d }, this.helperObject3D.showDraggingHelper([o]), this.hooks.emit("moveStart"), this.isDragging = !0;
|
|
85
85
|
}
|
|
86
86
|
dragging(e) {
|
|
87
87
|
if (!this.isDragging || !this.startInfo)
|
|
88
88
|
return;
|
|
89
|
-
const
|
|
90
|
-
return
|
|
89
|
+
const t = g(this.camera, e, this.container);
|
|
90
|
+
return t ? (this.move(t), !1) : this.dragEnd();
|
|
91
91
|
}
|
|
92
92
|
move(e) {
|
|
93
93
|
if (!this.startInfo)
|
|
94
94
|
return this.dragEnd();
|
|
95
|
-
const { plane:
|
|
95
|
+
const { plane: t, directionVector: o, startVectorProject: r } = this.startInfo, h = this.originObject3D, s = e.ray.intersectPlane(t, new m.Vector3());
|
|
96
96
|
if (!s)
|
|
97
97
|
return;
|
|
98
|
-
const n = s.clone().projectOnVector(
|
|
99
|
-
|
|
100
|
-
const
|
|
101
|
-
this.hooks.emit("wantToMove",
|
|
98
|
+
const n = s.clone().projectOnVector(o), l = n.clone().sub(r), a = new m.Matrix4();
|
|
99
|
+
a.setPosition(l);
|
|
100
|
+
const d = h.position.clone().applyMatrix4(a);
|
|
101
|
+
this.hooks.emit("wantToMove", d) || (h.applyMatrix4(a), r.copy(n), this.hooks.emit("applyObjectPosition", { matrix: a }), this.hooks.emit("move", d));
|
|
102
102
|
}
|
|
103
103
|
dragEnd() {
|
|
104
|
-
!this.isDragging || (
|
|
104
|
+
!this.isDragging || (this.startInfo = void 0, this.isDragging = !1, this.helperObject3D.show(), this.hooks.emit("moveEnd"));
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
export {
|
|
@@ -20,8 +20,11 @@ export declare class RectangleScaleController<OriginObject3D extends THREE.Objec
|
|
|
20
20
|
disable(): void;
|
|
21
21
|
show(): void;
|
|
22
22
|
hide(): void;
|
|
23
|
+
protected onApplyOriginObjectPosition(params: {
|
|
24
|
+
matrix: THREE.Matrix4;
|
|
25
|
+
}): void;
|
|
23
26
|
protected onApplyOriginObjectScale(params: {
|
|
24
|
-
|
|
27
|
+
matrix: THREE.Matrix4;
|
|
25
28
|
origin?: THREE.Vector3;
|
|
26
29
|
}): void;
|
|
27
30
|
protected getDragPlane(): THREE.Plane;
|