@realsee/dnalogel 2.16.0-alpha.0 → 2.16.0-alpha.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/PanoTagPlugin/utils/model/mediaPlane.d.ts +3 -1
- package/dist/index.cjs.js +44 -44
- package/dist/index.js +1434 -1417
- package/dist/index.umd.js +36 -36
- package/dist/shared-utils/three/loadVideoTexture.d.ts +1 -1
- package/docs/classes/CSS3DRender.html +31 -31
- package/docs/classes/CruisePluginController.html +25 -25
- 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 +46 -46
- 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 +19 -19
- 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/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/PanoVideoPlugin.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/ImagePlaneGroup.html +6 -6
- 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 +14 -14
- 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/PanoVideoPluginType.LoadParams.html +6 -6
- package/docs/interfaces/PanoVideoPluginType.PanoVideoItem.html +8 -8
- package/docs/interfaces/PanoVideoPluginType.PluginData.html +6 -6
- package/docs/interfaces/PanoVideoPluginType.PluginEventMap.html +9 -9
- package/docs/interfaces/PanoVideoPluginType.PluginState.html +6 -6
- package/docs/interfaces/PanoVideoPluginType.VideoItem.html +8 -8
- package/docs/interfaces/PanoVideoPluginType.VideoMeshParams.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/TagCacheInterface.html +12 -12
- package/docs/interfaces/TagConfig.html +11 -11
- package/docs/interfaces/TagGLTFObjectGroup.html +6 -6
- package/docs/interfaces/TagIconUrl.html +11 -11
- package/docs/interfaces/TagObjectGroup.html +6 -6
- package/docs/interfaces/TagStyle.html +6 -6
- 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/PanoVideoPluginType.html +5 -5
- 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/ElementRenderer.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 +5 -5
- 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/PanoVideoPluginParameterType.html +5 -5
- package/docs/types/PanoVideoPluginReturnType.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/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/itemLabelPluginServerParams.html +5 -5
- package/docs/variables/modelItemLabelPluginServerParams.html +5 -5
- package/docs/variables/modelRoomLabelPluginServerParams.html +5 -5
- package/libs/PanoTagPlugin/controller/TagComputer.js +9 -2
- package/libs/PanoTagPlugin/controller/TagRender.js +113 -105
- package/libs/PanoTagPlugin/controller/TagUtil.js +60 -50
- package/libs/PanoTagPlugin/controller/index.js +7 -7
- package/libs/PanoTagPlugin/index.js +7 -7
- package/libs/PanoTagPlugin/utils/model/mediaPlane.d.ts +3 -1
- package/libs/PanoTagPlugin/utils/model/mediaPlane.js +62 -56
- package/libs/base/BasePlugin.js +1 -1
- package/libs/index.js +7 -7
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/three/loadVideoTexture.d.ts +1 -1
- package/libs/shared-utils/three/loadVideoTexture.js +9 -9
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
var T = Object.defineProperty;
|
|
2
2
|
var y = (c, u, e) => u in c ? T(c, u, { enumerable: !0, configurable: !0, writable: !0, value: e }) : c[u] = e;
|
|
3
|
-
var
|
|
3
|
+
var l = (c, u, e) => (y(c, typeof u != "symbol" ? u + "" : u, e), e);
|
|
4
4
|
import D from "object-assign-deep";
|
|
5
5
|
import * as C from "three";
|
|
6
|
-
import { DefaultConfig as
|
|
7
|
-
import { anyPositionToVector3 as
|
|
6
|
+
import { DefaultConfig as P } from "../tag.config.js";
|
|
7
|
+
import { anyPositionToVector3 as w, arrayPositionToVector3 as p } from "../../CSS3DRenderPlugin/utils/positionToVector3.js";
|
|
8
8
|
import { planeNormal as g } from "../utils/planeNormal.js";
|
|
9
|
-
import { tagPosition as
|
|
10
|
-
import { normalPositionToPositions as
|
|
9
|
+
import { tagPosition as E, getTagPosition as k } from "../utils/tagPosition.js";
|
|
10
|
+
import { normalPositionToPositions as M } from "../utils/normalPositionToPositions.js";
|
|
11
11
|
import { TagCache as b } from "./TagCache.js";
|
|
12
12
|
import { writable as I } from "../../vendor/svelte/store/index.js";
|
|
13
13
|
import { isIOSWX as A } from "../utils/device.js";
|
|
@@ -16,6 +16,7 @@ import "../../CSS3DRenderPlugin/utils/generateBehindFiveElement.js";
|
|
|
16
16
|
import "@realsee/five";
|
|
17
17
|
import { isMediaPlaneTag as x, isMediaModelTag as v, isPlaneTag as V } from "../utils/tag/tagCheck.js";
|
|
18
18
|
import { DomEvents as L } from "../../shared-utils/threex/domevents/index.js";
|
|
19
|
+
import { VideoPlane as S } from "../utils/model/mediaPlane.js";
|
|
19
20
|
import "@realsee/five/gltf-loader";
|
|
20
21
|
import "../../shared-utils/three/loadTexture.js";
|
|
21
22
|
import "../../shared-utils/three/centerPoint.js";
|
|
@@ -31,30 +32,40 @@ import "../../CSS3DRenderPlugin/utils/three/CSS3DObject.js";
|
|
|
31
32
|
import "../../CSS3DRenderPlugin/utils/three/OpacityMesh.js";
|
|
32
33
|
import "../../CSS3DRenderPlugin/utils/three/CSS3DScene.js";
|
|
33
34
|
import "../../CSS3DRenderPlugin/utils/three/CSS3DGroup.js";
|
|
34
|
-
|
|
35
|
+
import "../../shared-utils/three/Quadrangle.js";
|
|
36
|
+
import "../../shared-utils/math/pointIsRectangle.js";
|
|
37
|
+
import "../../shared-utils/three/loadVideoTexture.js";
|
|
38
|
+
import "../Assets/Icon.js";
|
|
39
|
+
import "../../shared-utils/three/getPositionsByObjectFit.js";
|
|
40
|
+
import "../../shared-utils/five/FiveDomEvents.js";
|
|
41
|
+
class ve extends b {
|
|
35
42
|
constructor(e) {
|
|
36
43
|
super(e);
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
44
|
+
l(this, "tags", []);
|
|
45
|
+
l(this, "config", P);
|
|
46
|
+
l(this, "mediaStore", I({
|
|
40
47
|
currentMediaElement: null
|
|
41
48
|
}));
|
|
42
|
-
|
|
43
|
-
|
|
49
|
+
l(this, "css3DRenderPlugin");
|
|
50
|
+
l(this, "store", {
|
|
44
51
|
disposers: [],
|
|
45
52
|
disposed: !1,
|
|
46
53
|
resizeObserverDisposerAdding: !1,
|
|
47
54
|
css3DRenderDisposer: /* @__PURE__ */ new Map()
|
|
48
55
|
});
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
56
|
+
l(this, "domEvents");
|
|
57
|
+
l(this, "mouseInfo");
|
|
58
|
+
l(this, "preventWhenMouseDown", () => {
|
|
52
59
|
var e;
|
|
53
60
|
if ((e = this.mouseInfo) != null && e.isDown)
|
|
54
61
|
return !1;
|
|
55
62
|
});
|
|
56
63
|
const i = this.five.getElement();
|
|
57
|
-
i && (this.domEvents = new L(this.five.camera, i)), this.five.on("wantsMoveToPano", this.preventWhenMouseDown), this.five.on("wantsTapGesture", this.preventWhenMouseDown), this.
|
|
64
|
+
i && (this.domEvents = new L(this.five.camera, i)), this.five.on("wantsMoveToPano", this.preventWhenMouseDown), this.five.on("wantsTapGesture", this.preventWhenMouseDown), this.mediaStore.subscribe(({ currentMediaElement: o }) => {
|
|
65
|
+
this.tags.forEach((t) => {
|
|
66
|
+
t.mediaPlane instanceof S && o !== t.mediaPlane.videoInstance && t.mediaPlane.pause();
|
|
67
|
+
});
|
|
68
|
+
}), this.store.disposers.push(() => {
|
|
58
69
|
this.five.off("wantsMoveToPano", this.preventWhenMouseDown), this.five.off("wantsTapGesture", this.preventWhenMouseDown);
|
|
59
70
|
});
|
|
60
71
|
}
|
|
@@ -77,8 +88,8 @@ class le extends b {
|
|
|
77
88
|
if (!e)
|
|
78
89
|
return (t = this.config.globalConfig) != null ? t : {};
|
|
79
90
|
const i = {};
|
|
80
|
-
this.config.contentTypeConfig && Object.keys(this.config.contentTypeConfig).forEach((
|
|
81
|
-
const r =
|
|
91
|
+
this.config.contentTypeConfig && Object.keys(this.config.contentTypeConfig).forEach((a) => {
|
|
92
|
+
const r = a;
|
|
82
93
|
if (i[r])
|
|
83
94
|
return;
|
|
84
95
|
const f = r.split("-");
|
|
@@ -91,10 +102,10 @@ class le extends b {
|
|
|
91
102
|
(e.stickType === s || s === "Any") && (e.contentType === n || n === "Any") && (i[r] = this.config.contentTypeConfig[r]);
|
|
92
103
|
}
|
|
93
104
|
if (f.length === 3) {
|
|
94
|
-
const [s = "Any", n,
|
|
105
|
+
const [s = "Any", n, h] = f;
|
|
95
106
|
if (n === "Audio" && e.contentType === "Audio") {
|
|
96
|
-
const
|
|
97
|
-
(
|
|
107
|
+
const m = e;
|
|
108
|
+
(m.stickType === s || s === "Any") && m.data.appearance === h && (i[r] = this.config.contentTypeConfig[r]);
|
|
98
109
|
}
|
|
99
110
|
}
|
|
100
111
|
});
|
|
@@ -129,26 +140,25 @@ class le extends b {
|
|
|
129
140
|
return !0;
|
|
130
141
|
}
|
|
131
142
|
getRenderType(e) {
|
|
132
|
-
const i =
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
if (
|
|
140
|
-
if (
|
|
141
|
-
if (
|
|
143
|
+
const i = (() => {
|
|
144
|
+
if (e.stickType === "3DPoint")
|
|
145
|
+
return "Dom";
|
|
146
|
+
const o = this.getTagConfig(e);
|
|
147
|
+
if (!o || typeof o != "object" || !o.renderType)
|
|
148
|
+
return;
|
|
149
|
+
const t = e.data.mediaData;
|
|
150
|
+
if (!(!t || t.length === 0) && o.renderType === "Mesh") {
|
|
151
|
+
if (x(e)) {
|
|
152
|
+
if (t.length === 1 && (t[0].type === "Image" || t[0].type === "Video"))
|
|
142
153
|
return "Mesh";
|
|
143
|
-
} else
|
|
144
|
-
return "
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
return "Dom";
|
|
154
|
+
} else if (v(e))
|
|
155
|
+
return t.length === 1 && t[0].type === "Image" ? "Mesh" : "BehindDom";
|
|
156
|
+
}
|
|
157
|
+
})();
|
|
158
|
+
return i != null ? i : "Dom";
|
|
149
159
|
}
|
|
150
160
|
getAngle(e, i) {
|
|
151
|
-
var d,
|
|
161
|
+
var d, a, r;
|
|
152
162
|
const o = (d = this.five.panoIndex) != null ? d : i;
|
|
153
163
|
if (o === void 0)
|
|
154
164
|
throw new Error(`getDistance(): fivePanoIndex is ${o}`);
|
|
@@ -156,21 +166,21 @@ class le extends b {
|
|
|
156
166
|
if (t.angle !== void 0)
|
|
157
167
|
return t.angle;
|
|
158
168
|
{
|
|
159
|
-
const f = (r = (
|
|
169
|
+
const f = (r = (a = this.five.work) == null ? void 0 : a.observers[o]) == null ? void 0 : r.position;
|
|
160
170
|
if (f === void 0)
|
|
161
171
|
throw new Error(`getAngleRange(): observerPosition is ${f}`);
|
|
162
|
-
const s = (() => e.stickType === "3DPoint" ?
|
|
172
|
+
const s = (() => e.stickType === "3DPoint" ? w(e.normal) : g(e.position))();
|
|
163
173
|
if (!s)
|
|
164
174
|
return;
|
|
165
|
-
const n =
|
|
175
|
+
const n = E(e.position);
|
|
166
176
|
if (!n)
|
|
167
177
|
return;
|
|
168
|
-
const
|
|
169
|
-
return t.angle =
|
|
178
|
+
const h = new C.Vector3().copy(f).sub(n), m = s.angleTo(h) * 180 / Math.PI;
|
|
179
|
+
return t.angle = m, t.angle;
|
|
170
180
|
}
|
|
171
181
|
}
|
|
172
182
|
getDistance(e, i) {
|
|
173
|
-
var d,
|
|
183
|
+
var d, a, r;
|
|
174
184
|
const o = (d = this.five.panoIndex) != null ? d : i;
|
|
175
185
|
if (o === void 0)
|
|
176
186
|
throw new Error(`getDistance(): fivePanoIndex is ${o}`);
|
|
@@ -178,10 +188,10 @@ class le extends b {
|
|
|
178
188
|
if (t.distance !== void 0)
|
|
179
189
|
return t.distance;
|
|
180
190
|
{
|
|
181
|
-
const f = (r = (
|
|
191
|
+
const f = (r = (a = this.five.work) == null ? void 0 : a.observers[o]) == null ? void 0 : r.position;
|
|
182
192
|
if (f === void 0)
|
|
183
193
|
throw new Error(`getDistance(): observerPosition is ${f}`);
|
|
184
|
-
const s =
|
|
194
|
+
const s = k(e);
|
|
185
195
|
if (!s)
|
|
186
196
|
return -1;
|
|
187
197
|
const n = f.distanceTo(s);
|
|
@@ -194,7 +204,7 @@ class le extends b {
|
|
|
194
204
|
if (v(e))
|
|
195
205
|
return e.data.mediaPosition;
|
|
196
206
|
const i = e;
|
|
197
|
-
return
|
|
207
|
+
return M(
|
|
198
208
|
this.five.camera.position,
|
|
199
209
|
p(i.position),
|
|
200
210
|
p(i.normal)
|
|
@@ -216,7 +226,7 @@ class le extends b {
|
|
|
216
226
|
isDown: !0,
|
|
217
227
|
mouseDownTimestamp: Date.now()
|
|
218
228
|
};
|
|
219
|
-
},
|
|
229
|
+
}, a = (s) => {
|
|
220
230
|
if (!t()) {
|
|
221
231
|
this.mouseInfo = void 0;
|
|
222
232
|
return;
|
|
@@ -243,8 +253,8 @@ class le extends b {
|
|
|
243
253
|
const n = s.origDomEvent;
|
|
244
254
|
!this.mouseInfo || (this.mouseInfo.isDown && this.mouseInfo.x === Math.floor(n.changedTouches[n.changedTouches.length - 1].clientX) && this.mouseInfo.y === Math.floor(n.changedTouches[n.changedTouches.length - 1].clientY) && Date.now() - this.mouseInfo.mouseDownTimestamp < 400 && o(n), this.mouseInfo = void 0);
|
|
245
255
|
};
|
|
246
|
-
return this.domEvents.addEventListener(i, "mousedown", d, !1), this.domEvents.addEventListener(i, "mouseup",
|
|
247
|
-
!this.domEvents || (this.mouseInfo = void 0, this.domEvents.removeEventListener(i, "mousedown", d), this.domEvents.removeEventListener(i, "mouseup",
|
|
256
|
+
return this.domEvents.addEventListener(i, "mousedown", d, !1), this.domEvents.addEventListener(i, "mouseup", a, !1), this.domEvents.addEventListener(i, "touchstart", r, !1), this.domEvents.addEventListener(i, "touchend", f, !1), () => {
|
|
257
|
+
!this.domEvents || (this.mouseInfo = void 0, this.domEvents.removeEventListener(i, "mousedown", d), this.domEvents.removeEventListener(i, "mouseup", a), this.domEvents.removeEventListener(i, "touchstart", r), this.domEvents.removeEventListener(i, "touchend", f));
|
|
248
258
|
};
|
|
249
259
|
}
|
|
250
260
|
getTagNormal(e) {
|
|
@@ -286,5 +296,5 @@ class le extends b {
|
|
|
286
296
|
}
|
|
287
297
|
}
|
|
288
298
|
export {
|
|
289
|
-
|
|
299
|
+
ve as TagUtil
|
|
290
300
|
};
|
|
@@ -73,6 +73,13 @@ import "../../base/BasePlugin.js";
|
|
|
73
73
|
import "../../vendor/svelte/store/index.js";
|
|
74
74
|
import "../../vendor/svelte/internal/index.js";
|
|
75
75
|
import "../utils/device.js";
|
|
76
|
+
import "../utils/model/mediaPlane.js";
|
|
77
|
+
import "../../shared-utils/three/Quadrangle.js";
|
|
78
|
+
import "../../shared-utils/math/pointIsRectangle.js";
|
|
79
|
+
import "../../shared-utils/three/loadVideoTexture.js";
|
|
80
|
+
import "../Assets/Icon.js";
|
|
81
|
+
import "../../shared-utils/three/getPositionsByObjectFit.js";
|
|
82
|
+
import "../../shared-utils/five/FiveDomEvents.js";
|
|
76
83
|
import "../Components/TagContainer.js";
|
|
77
84
|
import "../Components/TagItem.js";
|
|
78
85
|
import "../Components/Tag/index.js";
|
|
@@ -89,7 +96,6 @@ import "animejs";
|
|
|
89
96
|
import "../utils/search.js";
|
|
90
97
|
import "../utils/constants.js";
|
|
91
98
|
import "../Components/Common/Arrow.js";
|
|
92
|
-
import "../Assets/Icon.js";
|
|
93
99
|
import "../utils/doUtil.js";
|
|
94
100
|
import "../../shared-utils/svelte/resizeObserver.js";
|
|
95
101
|
import "../../vendor/resize-observer-polyfill/dist/ResizeObserver.es.js";
|
|
@@ -144,12 +150,6 @@ import "../utils/getImageInfo.js";
|
|
|
144
150
|
import "../Components/Tag/CustomTag.js";
|
|
145
151
|
import "classnames";
|
|
146
152
|
import "../Components/Common/TagPoint.js";
|
|
147
|
-
import "../utils/model/mediaPlane.js";
|
|
148
|
-
import "../../shared-utils/three/Quadrangle.js";
|
|
149
|
-
import "../../shared-utils/math/pointIsRectangle.js";
|
|
150
|
-
import "../../shared-utils/three/loadVideoTexture.js";
|
|
151
|
-
import "../../shared-utils/three/getPositionsByObjectFit.js";
|
|
152
|
-
import "../../shared-utils/five/FiveDomEvents.js";
|
|
153
153
|
import "../../CSS3DRenderPlugin/index.js";
|
|
154
154
|
import "../../CSS3DRenderPlugin/Controller.js";
|
|
155
155
|
import "../../CSS3DRenderPlugin/utils/waitFiveModelLoaded.js";
|
|
@@ -48,6 +48,13 @@ import "../base/BasePlugin.js";
|
|
|
48
48
|
import "../vendor/svelte/store/index.js";
|
|
49
49
|
import "../vendor/svelte/internal/index.js";
|
|
50
50
|
import "./utils/device.js";
|
|
51
|
+
import "./utils/model/mediaPlane.js";
|
|
52
|
+
import "../shared-utils/three/Quadrangle.js";
|
|
53
|
+
import "../shared-utils/math/pointIsRectangle.js";
|
|
54
|
+
import "../shared-utils/three/loadVideoTexture.js";
|
|
55
|
+
import "./Assets/Icon.js";
|
|
56
|
+
import "../shared-utils/three/getPositionsByObjectFit.js";
|
|
57
|
+
import "../shared-utils/five/FiveDomEvents.js";
|
|
51
58
|
import "./Components/TagContainer.js";
|
|
52
59
|
import "./Components/TagItem.js";
|
|
53
60
|
import "./Components/Tag/index.js";
|
|
@@ -64,7 +71,6 @@ import "animejs";
|
|
|
64
71
|
import "./utils/search.js";
|
|
65
72
|
import "./utils/constants.js";
|
|
66
73
|
import "./Components/Common/Arrow.js";
|
|
67
|
-
import "./Assets/Icon.js";
|
|
68
74
|
import "./utils/doUtil.js";
|
|
69
75
|
import "../shared-utils/svelte/resizeObserver.js";
|
|
70
76
|
import "../vendor/resize-observer-polyfill/dist/ResizeObserver.es.js";
|
|
@@ -119,12 +125,6 @@ import "./utils/getImageInfo.js";
|
|
|
119
125
|
import "./Components/Tag/CustomTag.js";
|
|
120
126
|
import "classnames";
|
|
121
127
|
import "./Components/Common/TagPoint.js";
|
|
122
|
-
import "./utils/model/mediaPlane.js";
|
|
123
|
-
import "../shared-utils/three/Quadrangle.js";
|
|
124
|
-
import "../shared-utils/math/pointIsRectangle.js";
|
|
125
|
-
import "../shared-utils/three/loadVideoTexture.js";
|
|
126
|
-
import "../shared-utils/three/getPositionsByObjectFit.js";
|
|
127
|
-
import "../shared-utils/five/FiveDomEvents.js";
|
|
128
128
|
import "../CSS3DRenderPlugin/index.js";
|
|
129
129
|
import "../CSS3DRenderPlugin/Controller.js";
|
|
130
130
|
import "../CSS3DRenderPlugin/utils/waitFiveModelLoaded.js";
|
|
@@ -20,20 +20,22 @@ declare class ImagePlane extends MediaPlane {
|
|
|
20
20
|
declare class VideoPlane extends MediaPlane {
|
|
21
21
|
readonly isVideoPlane = true;
|
|
22
22
|
name: string;
|
|
23
|
+
videoInstance: HTMLVideoElement;
|
|
23
24
|
private objectFit;
|
|
24
25
|
private buttonSrc;
|
|
26
|
+
private paused;
|
|
25
27
|
private videoCoverSrc?;
|
|
26
28
|
private domEvents?;
|
|
27
29
|
private disposers;
|
|
28
30
|
private domEventsListenerTemporaryList;
|
|
29
31
|
private cornerPoints;
|
|
30
|
-
private videoInstance?;
|
|
31
32
|
private videoMesh?;
|
|
32
33
|
private coverMesh?;
|
|
33
34
|
private buttonMesh?;
|
|
34
35
|
private videoTextureMap;
|
|
35
36
|
private ImageTextureMap;
|
|
36
37
|
constructor(videoSrc: string, cornerPoints: Vector3[], params?: {
|
|
38
|
+
videoInstance?: HTMLVideoElement;
|
|
37
39
|
playButton?: 'withText' | 'withoutText' | string;
|
|
38
40
|
videoCoverSrc?: string;
|
|
39
41
|
objectFit?: 'contain' | 'fill';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var S = Object.defineProperty;
|
|
2
|
-
var H = (
|
|
3
|
-
var
|
|
4
|
-
var u = (
|
|
5
|
-
var
|
|
2
|
+
var H = (v, c, e) => c in v ? S(v, c, { enumerable: !0, configurable: !0, writable: !0, value: e }) : v[c] = e;
|
|
3
|
+
var h = (v, c, e) => (H(v, typeof c != "symbol" ? c + "" : c, e), e);
|
|
4
|
+
var u = (v, c, e) => new Promise((t, s) => {
|
|
5
|
+
var a = (i) => {
|
|
6
6
|
try {
|
|
7
7
|
n(e.next(i));
|
|
8
8
|
} catch (o) {
|
|
@@ -14,12 +14,12 @@ var u = (p, d, e) => new Promise((t, s) => {
|
|
|
14
14
|
} catch (o) {
|
|
15
15
|
s(o);
|
|
16
16
|
}
|
|
17
|
-
}, n = (i) => i.done ? t(i.value) : Promise.resolve(i.value).then(
|
|
18
|
-
n((e = e.apply(
|
|
17
|
+
}, n = (i) => i.done ? t(i.value) : Promise.resolve(i.value).then(a, r);
|
|
18
|
+
n((e = e.apply(v, c)).next());
|
|
19
19
|
});
|
|
20
20
|
import * as m from "three";
|
|
21
21
|
import { Vector3 as f } from "three";
|
|
22
|
-
import { centerPoint as
|
|
22
|
+
import { centerPoint as g } from "../../../shared-utils/three/centerPoint.js";
|
|
23
23
|
import { loadTexture as w } from "../../../shared-utils/three/loadTexture.js";
|
|
24
24
|
import { QuadrangleGeometry as y } from "../../../shared-utils/three/Quadrangle.js";
|
|
25
25
|
import { loadVideoTexture as F } from "../../../shared-utils/three/loadVideoTexture.js";
|
|
@@ -32,31 +32,31 @@ import "../../../shared-utils/threex/domevents/index.js";
|
|
|
32
32
|
class V extends m.Mesh {
|
|
33
33
|
constructor() {
|
|
34
34
|
super(...arguments);
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
h(this, "name", "MediaPlane");
|
|
36
|
+
h(this, "src");
|
|
37
37
|
}
|
|
38
38
|
removeFromParent() {
|
|
39
39
|
const e = this.parent;
|
|
40
40
|
return e !== null && e.remove(this), this;
|
|
41
41
|
}
|
|
42
42
|
setMatrixByCornerPoints(e) {
|
|
43
|
-
const t = new f().subVectors(e[1], e[0]), s = new f().subVectors(e[3], e[0]),
|
|
43
|
+
const t = new f().subVectors(e[1], e[0]), s = new f().subVectors(e[3], e[0]), a = g(...e), r = new f().crossVectors(t, s).normalize();
|
|
44
44
|
this.lookAt(r);
|
|
45
45
|
const n = this.up.clone().applyQuaternion(this.quaternion), i = s.clone(), o = new f().crossVectors(n, i).normalize();
|
|
46
|
-
this.rotateOnWorldAxis(o, n.angleTo(i)), this.position.copy(
|
|
46
|
+
this.rotateOnWorldAxis(o, n.angleTo(i)), this.position.copy(a);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
class J extends V {
|
|
50
50
|
constructor(e, t) {
|
|
51
51
|
super();
|
|
52
|
-
|
|
52
|
+
h(this, "name", "PanoTagPluginImagePlane");
|
|
53
53
|
this.src = e, w(e).then((s) => {
|
|
54
|
-
const
|
|
54
|
+
const a = s.image.width, r = s.image.height, n = new m.MeshBasicMaterial({ map: s, transparent: !0 }), i = new m.PlaneGeometry(a, r);
|
|
55
55
|
this.geometry = i, this.material = n;
|
|
56
|
-
const o = t[0].distanceTo(t[1]),
|
|
57
|
-
this.scale.set(o /
|
|
58
|
-
const
|
|
59
|
-
|
|
56
|
+
const o = t[0].distanceTo(t[1]), d = t[1].distanceTo(t[2]);
|
|
57
|
+
this.scale.set(o / a, d / r, 1);
|
|
58
|
+
const l = a / r, M = o / d;
|
|
59
|
+
l > M ? this.scale.set(o / a, o / a, 1) : l < M ? this.scale.set(d / r, d / r, 1) : this.scale.set(o / a, d / r, 1);
|
|
60
60
|
}).catch((s) => {
|
|
61
61
|
console.error({ e: s });
|
|
62
62
|
}), this.setMatrixByCornerPoints(t);
|
|
@@ -64,49 +64,55 @@ class J extends V {
|
|
|
64
64
|
}
|
|
65
65
|
class K extends V {
|
|
66
66
|
constructor(e, t, s) {
|
|
67
|
-
const {
|
|
67
|
+
const {
|
|
68
|
+
videoCoverSrc: a,
|
|
69
|
+
objectFit: r = "contain",
|
|
70
|
+
playButton: n = "withText",
|
|
71
|
+
videoTextureMap: i,
|
|
72
|
+
ImageTextureMap: o,
|
|
73
|
+
videoInstance: d = document.createElement("video")
|
|
74
|
+
} = s != null ? s : {};
|
|
68
75
|
super();
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
76
|
+
h(this, "isVideoPlane", !0);
|
|
77
|
+
h(this, "name", "PanoTagPluginImagePlane");
|
|
78
|
+
h(this, "videoInstance");
|
|
79
|
+
h(this, "objectFit");
|
|
80
|
+
h(this, "buttonSrc");
|
|
81
|
+
h(this, "paused", !0);
|
|
82
|
+
h(this, "videoCoverSrc");
|
|
83
|
+
h(this, "domEvents");
|
|
84
|
+
h(this, "disposers", []);
|
|
85
|
+
h(this, "domEventsListenerTemporaryList", []);
|
|
86
|
+
h(this, "cornerPoints");
|
|
87
|
+
h(this, "videoMesh");
|
|
88
|
+
h(this, "coverMesh");
|
|
89
|
+
h(this, "buttonMesh");
|
|
90
|
+
h(this, "videoTextureMap");
|
|
91
|
+
h(this, "ImageTextureMap");
|
|
92
|
+
this.cornerPoints = t, this.src = e, this.buttonSrc = (() => n === "withText" ? R : n === "withoutText" ? P : typeof n == "string" ? n : P)(), this.videoInstance = d, this.videoCoverSrc = a, this.objectFit = r, this.videoTextureMap = i, this.ImageTextureMap = o, this.position.copy(g(...t)), this.videoCoverSrc ? this.addCoverMesh().then(() => this.addButtonMesh()) : this.addVideoMesh().then(() => this.addButtonMesh()), this.addEventListener("dispose", () => {
|
|
93
|
+
var l;
|
|
94
|
+
this.domEventsListenerTemporaryList = [], (l = this.disposers) == null || l.forEach((M) => M == null ? void 0 : M());
|
|
87
95
|
});
|
|
88
96
|
}
|
|
89
97
|
play() {
|
|
90
98
|
return u(this, null, function* () {
|
|
91
|
-
|
|
92
|
-
this.coverMesh && (this.coverMesh.visible = !1), this.remove(this.buttonMesh), yield this.addVideoMesh(), this.videoMesh && (this.videoMesh.visible = !0), (e = this.videoInstance) == null || e.play(), this.render();
|
|
99
|
+
!this.paused || (this.paused = !1, this.coverMesh && (this.coverMesh.visible = !1), this.remove(this.buttonMesh), this.videoMesh || (yield this.addVideoMesh()), this.videoMesh.visible = !0, this.videoInstance.play(), this.videoInstance.muted = !1, this.render());
|
|
93
100
|
});
|
|
94
101
|
}
|
|
95
102
|
pause() {
|
|
96
|
-
|
|
97
|
-
this.coverMesh && (this.coverMesh.visible = !0), this.videoMesh && (this.videoMesh.visible = !1), this.addButtonMesh(), (e = this.videoInstance) == null || e.pause(), this.render();
|
|
103
|
+
this.paused || (this.paused = !0, this.coverMesh && (this.coverMesh.visible = !0, this.videoMesh && (this.videoMesh.visible = !1)), this.addButtonMesh(), this.videoInstance.pause(), this.render());
|
|
98
104
|
}
|
|
99
105
|
initialDomEvents(e) {
|
|
100
106
|
this.domEvents || (this.domEvents = new D(e), this.domEventsListenerTemporaryList.forEach((t) => this.addDomEventListener(...t)), this.domEventsListenerTemporaryList = []);
|
|
101
107
|
}
|
|
102
108
|
initialRenderHooks(e) {
|
|
103
109
|
const t = () => {
|
|
104
|
-
this.videoMesh &&
|
|
110
|
+
this.videoMesh && (this.videoInstance.paused || (this.videoMesh.needsRender = !0));
|
|
105
111
|
};
|
|
106
112
|
e.on("renderFrame", t), this.disposers.push(() => e.off("renderFrame", t));
|
|
107
113
|
}
|
|
108
114
|
render() {
|
|
109
|
-
this.videoMesh && (this.videoMesh.needsRender = !0), this.coverMesh && (this.coverMesh.needsRender = !0), this.buttonMesh && (this.buttonMesh.needsRender = !0), this.
|
|
115
|
+
this.videoMesh && (this.videoMesh.needsRender = !0), this.coverMesh && (this.coverMesh.needsRender = !0), this.buttonMesh && (this.buttonMesh.needsRender = !0), this.videoMesh && (this.videoInstance.paused || (this.videoMesh.needsRender = !0));
|
|
110
116
|
}
|
|
111
117
|
addDomEventListener(...e) {
|
|
112
118
|
this.domEvents ? (this.domEvents.addEventListener(...e), this.disposers.push(() => {
|
|
@@ -145,17 +151,17 @@ class K extends V {
|
|
|
145
151
|
return u(this, null, function* () {
|
|
146
152
|
if (this.coverMesh)
|
|
147
153
|
return this.coverMesh;
|
|
148
|
-
const e = yield this.getCoverTexture(), t = new m.MeshBasicMaterial({ transparent: !0, map: e }), s = T(this.objectFit, this.cornerPoints, e.image.width / e.image.height),
|
|
149
|
-
return i.name = "videoCoverMesh", i.position.copy(
|
|
154
|
+
const e = yield this.getCoverTexture(), t = new m.MeshBasicMaterial({ transparent: !0, map: e }), s = T(this.objectFit, this.cornerPoints, e.image.width / e.image.height), a = g(...s), r = s.map((o) => o.clone().sub(a)), n = new y(r, 1), i = new m.Mesh(n, t);
|
|
155
|
+
return i.name = "videoCoverMesh", i.position.copy(a.clone().sub(this.position)), this.coverMesh = i, i;
|
|
150
156
|
});
|
|
151
157
|
}
|
|
152
158
|
getVideoMesh() {
|
|
153
159
|
return u(this, null, function* () {
|
|
154
160
|
if (this.videoMesh)
|
|
155
161
|
return this.videoMesh;
|
|
156
|
-
const e = yield this.getVideoTexture(), t = new m.MeshBasicMaterial({ transparent: !0, map: e }), s = T(this.objectFit, this.cornerPoints, e.image.videoWidth / e.image.videoHeight),
|
|
157
|
-
i.name = "videoMesh", i.position.copy(
|
|
158
|
-
|
|
162
|
+
const e = yield this.getVideoTexture(), t = new m.MeshBasicMaterial({ transparent: !0, map: e }), s = T(this.objectFit, this.cornerPoints, e.image.videoWidth / e.image.videoHeight), a = g(...s), r = s.map((d) => d.clone().sub(a)), n = new y(r, 1), i = new m.Mesh(n, t);
|
|
163
|
+
i.name = "videoMesh", i.position.copy(a.clone().sub(this.position)), this.addDomEventListener(i, "click", (d) => {
|
|
164
|
+
this.pause();
|
|
159
165
|
});
|
|
160
166
|
const o = e.image;
|
|
161
167
|
return this.videoMesh = i, this.videoInstance = o, i;
|
|
@@ -166,18 +172,18 @@ class K extends V {
|
|
|
166
172
|
var b, E, I, L;
|
|
167
173
|
if (this.buttonMesh)
|
|
168
174
|
return this.buttonMesh;
|
|
169
|
-
const e = (E = (b = this.videoMesh) == null ? void 0 : b.geometry.points[0].distanceTo(this.videoMesh.geometry.points[3])) != null ? E : 1 / 0, t = (L = (I = this.coverMesh) == null ? void 0 : I.geometry.points[0].distanceTo(this.coverMesh.geometry.points[3])) != null ? L : 1 / 0, s = this.cornerPoints[0].distanceTo(this.cornerPoints[3]), r = Math.min(e, t, s) / s * 0.3, n = yield this.getButtonTexture(), i = new m.MeshBasicMaterial({ transparent: !0, map: n }), o = T("contain", this.cornerPoints, n.image.width / n.image.height),
|
|
170
|
-
|
|
175
|
+
const e = (E = (b = this.videoMesh) == null ? void 0 : b.geometry.points[0].distanceTo(this.videoMesh.geometry.points[3])) != null ? E : 1 / 0, t = (L = (I = this.coverMesh) == null ? void 0 : I.geometry.points[0].distanceTo(this.coverMesh.geometry.points[3])) != null ? L : 1 / 0, s = this.cornerPoints[0].distanceTo(this.cornerPoints[3]), r = Math.min(e, t, s) / s * 0.3, n = yield this.getButtonTexture(), i = new m.MeshBasicMaterial({ transparent: !0, map: n }), o = T("contain", this.cornerPoints, n.image.width / n.image.height), d = g(...o), l = o.map((B) => B.clone().sub(d)), M = new y(l), p = new m.Mesh(M, i);
|
|
176
|
+
p.name = "buttonMesh", p.scale.set(r, r, r);
|
|
171
177
|
const x = () => {
|
|
172
|
-
|
|
178
|
+
this.play();
|
|
173
179
|
};
|
|
174
|
-
|
|
175
|
-
this.addDomEventListener(
|
|
176
|
-
}),
|
|
177
|
-
this.removeDomEventListener(
|
|
180
|
+
p.addEventListener("added", () => {
|
|
181
|
+
this.addDomEventListener(p, "click", x);
|
|
182
|
+
}), p.addEventListener("removed", () => {
|
|
183
|
+
this.removeDomEventListener(p, "click", x);
|
|
178
184
|
});
|
|
179
185
|
const C = new m.Vector3().crossVectors(new m.Vector3().subVectors(o[0], o[1]), new m.Vector3().subVectors(o[0], o[3])).normalize().multiplyScalar(1e-4);
|
|
180
|
-
return
|
|
186
|
+
return p.position.copy(C), this.buttonMesh = p, p;
|
|
181
187
|
});
|
|
182
188
|
}
|
|
183
189
|
getButtonTexture() {
|
|
@@ -203,7 +209,7 @@ class K extends V {
|
|
|
203
209
|
var t, s;
|
|
204
210
|
if ((t = this.videoTextureMap) != null && t.has(this.src))
|
|
205
211
|
return this.videoTextureMap.get(this.src);
|
|
206
|
-
const e = yield F(this.src);
|
|
212
|
+
const e = yield F(this.src, this.videoInstance);
|
|
207
213
|
return (s = this.videoTextureMap) == null || s.set(this.src, e), e;
|
|
208
214
|
});
|
|
209
215
|
}
|
package/libs/base/BasePlugin.js
CHANGED
|
@@ -4,7 +4,7 @@ var s = (e, r, t) => (a(e, typeof r != "symbol" ? r + "" : r, t), t);
|
|
|
4
4
|
import { Subscribe as c } from "../shared-utils/Subscribe.js";
|
|
5
5
|
class o {
|
|
6
6
|
constructor(r, t) {
|
|
7
|
-
s(this, "VERSION", "2.16.0-alpha.
|
|
7
|
+
s(this, "VERSION", "2.16.0-alpha.2");
|
|
8
8
|
s(this, "five");
|
|
9
9
|
s(this, "hooks", new c());
|
|
10
10
|
s(this, "staticPrefix", "//vrlab-static.ljcdn.com");
|
package/libs/index.js
CHANGED
|
@@ -243,6 +243,13 @@ import "./PanoTagPlugin/utils/planeNormal.js";
|
|
|
243
243
|
import "./PanoTagPlugin/utils/normalPositionToPositions.js";
|
|
244
244
|
import "./PanoTagPlugin/controller/TagCache.js";
|
|
245
245
|
import "./PanoTagPlugin/utils/device.js";
|
|
246
|
+
import "./PanoTagPlugin/utils/model/mediaPlane.js";
|
|
247
|
+
import "./shared-utils/three/Quadrangle.js";
|
|
248
|
+
import "./shared-utils/math/pointIsRectangle.js";
|
|
249
|
+
import "./shared-utils/three/loadVideoTexture.js";
|
|
250
|
+
import "./PanoTagPlugin/Assets/Icon.js";
|
|
251
|
+
import "./shared-utils/three/getPositionsByObjectFit.js";
|
|
252
|
+
import "./shared-utils/five/FiveDomEvents.js";
|
|
246
253
|
import "./PanoTagPlugin/Components/TagContainer.js";
|
|
247
254
|
import "./PanoTagPlugin/Components/TagItem.js";
|
|
248
255
|
import "./PanoTagPlugin/Components/Tag/index.js";
|
|
@@ -256,7 +263,6 @@ import "animejs";
|
|
|
256
263
|
import "./PanoTagPlugin/utils/search.js";
|
|
257
264
|
import "./PanoTagPlugin/utils/constants.js";
|
|
258
265
|
import "./PanoTagPlugin/Components/Common/Arrow.js";
|
|
259
|
-
import "./PanoTagPlugin/Assets/Icon.js";
|
|
260
266
|
import "./PanoTagPlugin/utils/doUtil.js";
|
|
261
267
|
import "./PanoTagPlugin/Components/Tag/TextTag/TextPlaneTag.js";
|
|
262
268
|
import "./PanoTagPlugin/Components/Common/Text/MText.js";
|
|
@@ -308,12 +314,6 @@ import "./PanoTagPlugin/Components/Common/Icon/Icon.js";
|
|
|
308
314
|
import "./PanoTagPlugin/utils/getImageInfo.js";
|
|
309
315
|
import "./PanoTagPlugin/Components/Tag/CustomTag.js";
|
|
310
316
|
import "./PanoTagPlugin/Components/Common/TagPoint.js";
|
|
311
|
-
import "./PanoTagPlugin/utils/model/mediaPlane.js";
|
|
312
|
-
import "./shared-utils/three/Quadrangle.js";
|
|
313
|
-
import "./shared-utils/math/pointIsRectangle.js";
|
|
314
|
-
import "./shared-utils/three/loadVideoTexture.js";
|
|
315
|
-
import "./shared-utils/three/getPositionsByObjectFit.js";
|
|
316
|
-
import "./shared-utils/five/FiveDomEvents.js";
|
|
317
317
|
import "./shared-utils/three/GLTFLoader.js";
|
|
318
318
|
import "./shared-utils/Object3DHelper/Helper/MoveHelper.js";
|
|
319
319
|
import "./shared-utils/Object3DHelper/Base/BaseHelper.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function A() {
|
|
2
2
|
console.info(
|
|
3
|
-
"%c %c@realsee/dnalogel %cv2.16.0-alpha.
|
|
3
|
+
"%c %c@realsee/dnalogel %cv2.16.0-alpha.2",
|
|
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",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
|
-
export default function loadVideoTexture(src: string): Promise<Omit<THREE.VideoTexture, 'image'> & {
|
|
2
|
+
export default function loadVideoTexture(src: string, videoElement?: HTMLVideoElement): Promise<Omit<THREE.VideoTexture, 'image'> & {
|
|
3
3
|
image: HTMLVideoElement;
|
|
4
4
|
}>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
function
|
|
3
|
-
return new Promise((
|
|
4
|
-
const e = document.createElement("video");
|
|
5
|
-
e.preload = "metadata", e.crossOrigin = "anonymous", e.muted = !0, e.loop = !0, e.playsInline = !0, e.autoplay = !0, e.src =
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import * as t from "three";
|
|
2
|
+
function u(a, o) {
|
|
3
|
+
return new Promise((n, i) => {
|
|
4
|
+
const e = o != null ? o : document.createElement("video");
|
|
5
|
+
e.preload = "metadata", e.crossOrigin = "anonymous", e.muted = !0, e.loop = !0, e.playsInline = !0, e.autoplay = !0, e.src = a;
|
|
6
|
+
const r = new t.VideoTexture(e);
|
|
7
|
+
r.minFilter = t.LinearFilter, r.magFilter = t.LinearFilter, r.encoding = t.sRGBEncoding, e.onloadedmetadata = () => {
|
|
8
|
+
n(r);
|
|
9
9
|
};
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
export {
|
|
13
|
-
|
|
13
|
+
u as loadVideoTexture
|
|
14
14
|
};
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"repository": "https://github.com/realsee-developer/dnalogel.git",
|
|
8
8
|
"description": "如视 VR 看房插件合集",
|
|
9
9
|
"private": false,
|
|
10
|
-
"version": "2.16.0-alpha.
|
|
10
|
+
"version": "2.16.0-alpha.2",
|
|
11
11
|
"license": "SEE LICENSE IN TERMS.txt",
|
|
12
12
|
"scripts": {
|
|
13
13
|
"clean": "rm -rf components dist docs libs types ./vite.config.js.timestamp*",
|