@realsee/dnalogel 2.0.0-alpha.53 → 2.0.0-alpha.54
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/CSS3DRenderPlugin/CruisePlugin/index.d.ts +2 -2
- package/dist/CSS3DRenderPlugin/CruisePlugin/typing.d.ts +11 -1
- package/dist/CSS3DRenderPlugin/CruisePlugin/utils/sleep.d.ts +1 -0
- package/dist/CSS3DRenderPlugin/GuideLinePlugin/index.d.ts +1 -1
- package/dist/CSS3DRenderPlugin/GuideLinePlugin/utils/getArrowMaterial.d.ts +1 -1
- package/dist/CSS3DRenderPlugin/GuideLinePlugin/utils/getLineGeometry.d.ts +1 -1
- package/dist/CameraMovementPlugin/CruisePlugin/index.d.ts +2 -2
- package/dist/CameraMovementPlugin/CruisePlugin/typing.d.ts +11 -1
- package/dist/CameraMovementPlugin/CruisePlugin/utils/sleep.d.ts +1 -0
- package/dist/CameraMovementPlugin/GuideLinePlugin/index.d.ts +1 -1
- package/dist/CameraMovementPlugin/GuideLinePlugin/utils/getArrowMaterial.d.ts +1 -1
- package/dist/CameraMovementPlugin/GuideLinePlugin/utils/getLineGeometry.d.ts +1 -1
- package/dist/CruisePlugin/CruisePlugin/index.d.ts +2 -2
- package/dist/CruisePlugin/CruisePlugin/typing.d.ts +11 -1
- package/dist/CruisePlugin/CruisePlugin/utils/sleep.d.ts +1 -0
- package/dist/CruisePlugin/GuideLinePlugin/index.d.ts +1 -1
- package/dist/CruisePlugin/GuideLinePlugin/utils/getArrowMaterial.d.ts +1 -1
- package/dist/CruisePlugin/GuideLinePlugin/utils/getLineGeometry.d.ts +1 -1
- package/dist/CruisePlugin/index.d.ts +2 -2
- package/dist/CruisePlugin/index.js +77 -36
- package/dist/CruisePlugin/typing.d.ts +11 -1
- package/dist/CruisePlugin/utils/sleep.d.ts +1 -0
- package/dist/GuideLinePlugin/CruisePlugin/index.d.ts +2 -2
- package/dist/GuideLinePlugin/CruisePlugin/typing.d.ts +11 -1
- package/dist/GuideLinePlugin/CruisePlugin/utils/sleep.d.ts +1 -0
- package/dist/GuideLinePlugin/GuideLinePlugin/index.d.ts +1 -1
- package/dist/GuideLinePlugin/GuideLinePlugin/utils/getArrowMaterial.d.ts +1 -1
- package/dist/GuideLinePlugin/GuideLinePlugin/utils/getLineGeometry.d.ts +1 -1
- package/dist/GuideLinePlugin/index.d.ts +1 -1
- package/dist/GuideLinePlugin/index.js +13 -8
- package/dist/GuideLinePlugin/utils/getArrowMaterial.d.ts +1 -1
- package/dist/GuideLinePlugin/utils/getLineGeometry.d.ts +1 -1
- package/dist/ItemLabelPlugin/CruisePlugin/index.d.ts +2 -2
- package/dist/ItemLabelPlugin/CruisePlugin/typing.d.ts +11 -1
- package/dist/ItemLabelPlugin/CruisePlugin/utils/sleep.d.ts +1 -0
- package/dist/ItemLabelPlugin/GuideLinePlugin/index.d.ts +1 -1
- package/dist/ItemLabelPlugin/GuideLinePlugin/utils/getArrowMaterial.d.ts +1 -1
- package/dist/ItemLabelPlugin/GuideLinePlugin/utils/getLineGeometry.d.ts +1 -1
- package/dist/ModelChassisCompassPlugin/CruisePlugin/index.d.ts +2 -2
- package/dist/ModelChassisCompassPlugin/CruisePlugin/typing.d.ts +11 -1
- package/dist/ModelChassisCompassPlugin/CruisePlugin/utils/sleep.d.ts +1 -0
- package/dist/ModelChassisCompassPlugin/GuideLinePlugin/index.d.ts +1 -1
- package/dist/ModelChassisCompassPlugin/GuideLinePlugin/utils/getArrowMaterial.d.ts +1 -1
- package/dist/ModelChassisCompassPlugin/GuideLinePlugin/utils/getLineGeometry.d.ts +1 -1
- package/dist/ModelEntryDoorGuidePlugin/CruisePlugin/index.d.ts +2 -2
- package/dist/ModelEntryDoorGuidePlugin/CruisePlugin/typing.d.ts +11 -1
- package/dist/ModelEntryDoorGuidePlugin/CruisePlugin/utils/sleep.d.ts +1 -0
- package/dist/ModelEntryDoorGuidePlugin/GuideLinePlugin/index.d.ts +1 -1
- package/dist/ModelEntryDoorGuidePlugin/GuideLinePlugin/utils/getArrowMaterial.d.ts +1 -1
- package/dist/ModelEntryDoorGuidePlugin/GuideLinePlugin/utils/getLineGeometry.d.ts +1 -1
- package/dist/ModelItemLabelPlugin/CruisePlugin/index.d.ts +2 -2
- package/dist/ModelItemLabelPlugin/CruisePlugin/typing.d.ts +11 -1
- package/dist/ModelItemLabelPlugin/CruisePlugin/utils/sleep.d.ts +1 -0
- package/dist/ModelItemLabelPlugin/GuideLinePlugin/index.d.ts +1 -1
- package/dist/ModelItemLabelPlugin/GuideLinePlugin/utils/getArrowMaterial.d.ts +1 -1
- package/dist/ModelItemLabelPlugin/GuideLinePlugin/utils/getLineGeometry.d.ts +1 -1
- package/dist/ModelRoomLabelPlugin/CruisePlugin/index.d.ts +2 -2
- package/dist/ModelRoomLabelPlugin/CruisePlugin/typing.d.ts +11 -1
- package/dist/ModelRoomLabelPlugin/CruisePlugin/utils/sleep.d.ts +1 -0
- package/dist/ModelRoomLabelPlugin/GuideLinePlugin/index.d.ts +1 -1
- package/dist/ModelRoomLabelPlugin/GuideLinePlugin/utils/getArrowMaterial.d.ts +1 -1
- package/dist/ModelRoomLabelPlugin/GuideLinePlugin/utils/getLineGeometry.d.ts +1 -1
- package/dist/ModelTVVideoPlugin/CruisePlugin/index.d.ts +2 -2
- package/dist/ModelTVVideoPlugin/CruisePlugin/typing.d.ts +11 -1
- package/dist/ModelTVVideoPlugin/CruisePlugin/utils/sleep.d.ts +1 -0
- package/dist/ModelTVVideoPlugin/GuideLinePlugin/index.d.ts +1 -1
- package/dist/ModelTVVideoPlugin/GuideLinePlugin/utils/getArrowMaterial.d.ts +1 -1
- package/dist/ModelTVVideoPlugin/GuideLinePlugin/utils/getLineGeometry.d.ts +1 -1
- package/dist/ModelViewPlugin/CruisePlugin/index.d.ts +2 -2
- package/dist/ModelViewPlugin/CruisePlugin/typing.d.ts +11 -1
- package/dist/ModelViewPlugin/CruisePlugin/utils/sleep.d.ts +1 -0
- package/dist/ModelViewPlugin/GuideLinePlugin/index.d.ts +1 -1
- package/dist/ModelViewPlugin/GuideLinePlugin/utils/getArrowMaterial.d.ts +1 -1
- package/dist/ModelViewPlugin/GuideLinePlugin/utils/getLineGeometry.d.ts +1 -1
- package/dist/PanoCompassPlugin/CruisePlugin/index.d.ts +2 -2
- package/dist/PanoCompassPlugin/CruisePlugin/typing.d.ts +11 -1
- package/dist/PanoCompassPlugin/CruisePlugin/utils/sleep.d.ts +1 -0
- package/dist/PanoCompassPlugin/GuideLinePlugin/index.d.ts +1 -1
- package/dist/PanoCompassPlugin/GuideLinePlugin/utils/getArrowMaterial.d.ts +1 -1
- package/dist/PanoCompassPlugin/GuideLinePlugin/utils/getLineGeometry.d.ts +1 -1
- package/dist/PanoCursorRaycasterPlugin/CruisePlugin/index.d.ts +2 -2
- package/dist/PanoCursorRaycasterPlugin/CruisePlugin/typing.d.ts +11 -1
- package/dist/PanoCursorRaycasterPlugin/CruisePlugin/utils/sleep.d.ts +1 -0
- package/dist/PanoCursorRaycasterPlugin/GuideLinePlugin/index.d.ts +1 -1
- package/dist/PanoCursorRaycasterPlugin/GuideLinePlugin/utils/getArrowMaterial.d.ts +1 -1
- package/dist/PanoCursorRaycasterPlugin/GuideLinePlugin/utils/getLineGeometry.d.ts +1 -1
- package/dist/PanoDoorLabelPlugin/CruisePlugin/index.d.ts +2 -2
- package/dist/PanoDoorLabelPlugin/CruisePlugin/typing.d.ts +11 -1
- package/dist/PanoDoorLabelPlugin/CruisePlugin/utils/sleep.d.ts +1 -0
- package/dist/PanoDoorLabelPlugin/GuideLinePlugin/index.d.ts +1 -1
- package/dist/PanoDoorLabelPlugin/GuideLinePlugin/utils/getArrowMaterial.d.ts +1 -1
- package/dist/PanoDoorLabelPlugin/GuideLinePlugin/utils/getLineGeometry.d.ts +1 -1
- package/dist/PanoMeasurePlugin/CruisePlugin/index.d.ts +2 -2
- package/dist/PanoMeasurePlugin/CruisePlugin/typing.d.ts +11 -1
- package/dist/PanoMeasurePlugin/CruisePlugin/utils/sleep.d.ts +1 -0
- package/dist/PanoMeasurePlugin/GuideLinePlugin/index.d.ts +1 -1
- package/dist/PanoMeasurePlugin/GuideLinePlugin/utils/getArrowMaterial.d.ts +1 -1
- package/dist/PanoMeasurePlugin/GuideLinePlugin/utils/getLineGeometry.d.ts +1 -1
- package/dist/PanoRulerPlugin/CruisePlugin/index.d.ts +2 -2
- package/dist/PanoRulerPlugin/CruisePlugin/typing.d.ts +11 -1
- package/dist/PanoRulerPlugin/CruisePlugin/utils/sleep.d.ts +1 -0
- package/dist/PanoRulerPlugin/GuideLinePlugin/index.d.ts +1 -1
- package/dist/PanoRulerPlugin/GuideLinePlugin/utils/getArrowMaterial.d.ts +1 -1
- package/dist/PanoRulerPlugin/GuideLinePlugin/utils/getLineGeometry.d.ts +1 -1
- package/dist/PanoRulerProPlugin/CruisePlugin/index.d.ts +2 -2
- package/dist/PanoRulerProPlugin/CruisePlugin/typing.d.ts +11 -1
- package/dist/PanoRulerProPlugin/CruisePlugin/utils/sleep.d.ts +1 -0
- package/dist/PanoRulerProPlugin/GuideLinePlugin/index.d.ts +1 -1
- package/dist/PanoRulerProPlugin/GuideLinePlugin/utils/getArrowMaterial.d.ts +1 -1
- package/dist/PanoRulerProPlugin/GuideLinePlugin/utils/getLineGeometry.d.ts +1 -1
- package/dist/PanoSpatialTagPlugin/CruisePlugin/index.d.ts +2 -2
- package/dist/PanoSpatialTagPlugin/CruisePlugin/typing.d.ts +11 -1
- package/dist/PanoSpatialTagPlugin/CruisePlugin/utils/sleep.d.ts +1 -0
- package/dist/PanoSpatialTagPlugin/GuideLinePlugin/index.d.ts +1 -1
- package/dist/PanoSpatialTagPlugin/GuideLinePlugin/utils/getArrowMaterial.d.ts +1 -1
- package/dist/PanoSpatialTagPlugin/GuideLinePlugin/utils/getLineGeometry.d.ts +1 -1
- package/dist/floorplan/MapviewFloorplanPlugin/CruisePlugin/index.d.ts +2 -2
- package/dist/floorplan/MapviewFloorplanPlugin/CruisePlugin/typing.d.ts +11 -1
- package/dist/floorplan/MapviewFloorplanPlugin/CruisePlugin/utils/sleep.d.ts +1 -0
- package/dist/floorplan/MapviewFloorplanPlugin/GuideLinePlugin/index.d.ts +1 -1
- package/dist/floorplan/MapviewFloorplanPlugin/GuideLinePlugin/utils/getArrowMaterial.d.ts +1 -1
- package/dist/floorplan/MapviewFloorplanPlugin/GuideLinePlugin/utils/getLineGeometry.d.ts +1 -1
- package/dist/floorplan/ModelFloorplanPlugin/CruisePlugin/index.d.ts +2 -2
- package/dist/floorplan/ModelFloorplanPlugin/CruisePlugin/typing.d.ts +11 -1
- package/dist/floorplan/ModelFloorplanPlugin/CruisePlugin/utils/sleep.d.ts +1 -0
- package/dist/floorplan/ModelFloorplanPlugin/GuideLinePlugin/index.d.ts +1 -1
- package/dist/floorplan/ModelFloorplanPlugin/GuideLinePlugin/utils/getArrowMaterial.d.ts +1 -1
- package/dist/floorplan/ModelFloorplanPlugin/GuideLinePlugin/utils/getLineGeometry.d.ts +1 -1
- package/dist/floorplan/PanoFloorplanRadarPlugin/CruisePlugin/index.d.ts +2 -2
- package/dist/floorplan/PanoFloorplanRadarPlugin/CruisePlugin/typing.d.ts +11 -1
- package/dist/floorplan/PanoFloorplanRadarPlugin/CruisePlugin/utils/sleep.d.ts +1 -0
- package/dist/floorplan/PanoFloorplanRadarPlugin/GuideLinePlugin/index.d.ts +1 -1
- package/dist/floorplan/PanoFloorplanRadarPlugin/GuideLinePlugin/utils/getArrowMaterial.d.ts +1 -1
- package/dist/floorplan/PanoFloorplanRadarPlugin/GuideLinePlugin/utils/getLineGeometry.d.ts +1 -1
- package/dist/floorplan/TopviewFloorplanPlugin/CruisePlugin/index.d.ts +2 -2
- package/dist/floorplan/TopviewFloorplanPlugin/CruisePlugin/typing.d.ts +11 -1
- package/dist/floorplan/TopviewFloorplanPlugin/CruisePlugin/utils/sleep.d.ts +1 -0
- package/dist/floorplan/TopviewFloorplanPlugin/GuideLinePlugin/index.d.ts +1 -1
- package/dist/floorplan/TopviewFloorplanPlugin/GuideLinePlugin/utils/getArrowMaterial.d.ts +1 -1
- package/dist/floorplan/TopviewFloorplanPlugin/GuideLinePlugin/utils/getLineGeometry.d.ts +1 -1
- package/dist/index.es.js +77 -36
- package/dist/index.js +77 -36
- package/dist/index.umd.js +77 -36
- package/docs/assets/search.js +1 -1
- package/docs/classes/CruisePluginController.html +14 -14
- package/docs/classes/Magnifier.html +4 -4
- package/docs/classes/ModelRoomLabelController.html +4 -4
- package/docs/enums/CameraMovementEffect.html +2 -2
- package/docs/enums/DIRECTION.html +1 -1
- package/docs/enums/DISPLAY_STRATEGY_TYPE.html +1 -1
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
- package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +1 -1
- package/docs/enums/Rotation.html +2 -2
- package/docs/index.html +2 -2
- package/docs/interfaces/CSS3DRenderPluginExportType.html +2 -2
- package/docs/interfaces/CameraMovementPluginExportType.html +2 -2
- package/docs/interfaces/EventMap.html +15 -0
- package/docs/interfaces/FloorplanBounding.html +4 -4
- package/docs/interfaces/FloorplanData.html +2 -2
- package/docs/interfaces/FloorplanEntrance.html +7 -7
- package/docs/interfaces/FloorplanExtraObject.html +3 -3
- package/docs/interfaces/FloorplanExtraObject3D.html +2 -2
- package/docs/interfaces/FloorplanFloorData.html +2 -2
- package/docs/interfaces/FloorplanImagePosition.html +2 -2
- package/docs/interfaces/FloorplanObserver.html +2 -2
- package/docs/interfaces/FloorplanOutlineItem.html +2 -2
- package/docs/interfaces/FloorplanPosition.html +2 -2
- package/docs/interfaces/FloorplanRoomItem.html +6 -6
- package/docs/interfaces/FloorplanRoomLabelItem.html +3 -3
- package/docs/interfaces/FloorplanServerBounding.html +4 -4
- package/docs/interfaces/FloorplanServerComputedData.html +1 -1
- package/docs/interfaces/FloorplanServerData.html +2 -2
- package/docs/interfaces/FloorplanServerDoorItem.html +1 -1
- package/docs/interfaces/FloorplanServerDoorPosition.html +1 -1
- package/docs/interfaces/FloorplanServerEntrance.html +7 -7
- package/docs/interfaces/FloorplanServerFloorData.html +2 -2
- package/docs/interfaces/FloorplanServerImagePosition.html +2 -2
- package/docs/interfaces/FloorplanServerObserver.html +2 -2
- package/docs/interfaces/FloorplanServerOutlineItem.html +2 -2
- package/docs/interfaces/FloorplanServerPosition.html +2 -2
- package/docs/interfaces/FloorplanServerRoomItem.html +7 -7
- package/docs/interfaces/FloorplanServerRoomLabelItem.html +3 -3
- package/docs/interfaces/ItemLabelPluginData.html +1 -1
- package/docs/interfaces/ItemLabelPluginExportReturnsType.html +1 -1
- package/docs/interfaces/ItemLabelPluginParametersType.html +1 -1
- package/docs/interfaces/LineJson.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
- package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
- package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
- package/docs/interfaces/ModelItemLabelPluginData.html +1 -1
- package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -1
- package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -1
- package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginData.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -1
- package/docs/interfaces/ModelViewPluginExportType.html +1 -1
- package/docs/interfaces/OpenParameter.html +2 -2
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
- package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +1 -1
- package/docs/interfaces/PanoMeasureParameterType.html +1 -1
- package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
- package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
- package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
- package/docs/interfaces/PanoRulerProPluginExportType.html +1 -1
- package/docs/interfaces/PanoRulerProPluginOptions.html +1 -1
- package/docs/interfaces/PanoRulerProPluginParameterType.html +1 -1
- package/docs/interfaces/PanoRulerProPluginState.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginDataElement.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginPointElement.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginTagElement.html +1 -1
- package/docs/interfaces/PluginData.html +1 -0
- package/docs/interfaces/PluginServerData.html +3 -0
- package/docs/interfaces/PluginState.html +5 -0
- package/docs/interfaces/Point.html +1 -1
- package/docs/interfaces/PointJson.html +1 -1
- package/docs/interfaces/Room.html +1 -1
- package/docs/interfaces/RoomInfo.html +1 -1
- package/docs/interfaces/RoomLabel.html +7 -7
- package/docs/interfaces/RoomRules.html +1 -1
- package/docs/interfaces/Rooms.html +1 -1
- package/docs/interfaces/Route.html +1 -0
- package/docs/modules.html +18 -18
- package/libs/CruisePlugin/Controller.js +57 -28
- package/libs/CruisePlugin/index.d.ts +2 -2
- package/libs/CruisePlugin/index.js +1 -2
- package/libs/CruisePlugin/typing.d.ts +11 -1
- package/libs/CruisePlugin/utils/sleep.d.ts +1 -0
- package/libs/CruisePlugin/utils/sleep.js +7 -0
- package/libs/GuideLinePlugin/Controller.js +3 -3
- package/libs/GuideLinePlugin/index.d.ts +1 -1
- package/libs/GuideLinePlugin/index.js +1 -0
- package/libs/GuideLinePlugin/utils/getArrowMaterial.d.ts +1 -1
- package/libs/GuideLinePlugin/utils/getArrowMaterial.js +6 -1
- package/libs/GuideLinePlugin/utils/getLineGeometry.d.ts +1 -1
- package/libs/GuideLinePlugin/utils/getLineGeometry.js +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -18308,10 +18308,10 @@ const AXIS_NUMBER_OF_VERTEX = 3; // 每个顶点有三个轴坐标
|
|
|
18308
18308
|
const UV_NUMBER_OF_VERTEX = 2; // 每个顶点有两个 UV 轴坐标
|
|
18309
18309
|
function getLineGeometry(positionList) {
|
|
18310
18310
|
if (positionList.length < 2)
|
|
18311
|
-
return;
|
|
18312
|
-
const lineWidth =
|
|
18313
|
-
const halfLineWidth =
|
|
18314
|
-
const aspect =
|
|
18311
|
+
return console.warn('positionList length must be greater than 1');
|
|
18312
|
+
const lineWidth = 0.6;
|
|
18313
|
+
const halfLineWidth = lineWidth / 2;
|
|
18314
|
+
const aspect = 0.67; // 纵横比 width / height
|
|
18315
18315
|
// 点位向量数组
|
|
18316
18316
|
const keyPoints = positionList;
|
|
18317
18317
|
// 点位组成的平滑曲线
|
|
@@ -18366,7 +18366,12 @@ function getLineGeometry(positionList) {
|
|
|
18366
18366
|
|
|
18367
18367
|
function getArrowMaterial(params) {
|
|
18368
18368
|
var _a;
|
|
18369
|
-
const texture = new
|
|
18369
|
+
// const texture = new THREE.TextureLoader().load(params?.textureUrl ?? '//vrlab-static.ljcdn.com/release/web/arrow.c5d028e4.png')
|
|
18370
|
+
// const texture = new THREE.TextureLoader().load(params?.textureUrl ?? '//vrlab-static.ljcdn.com/release/web/arrow2.aa1762e4.png')
|
|
18371
|
+
// const texture = new THREE.TextureLoader().load(params?.textureUrl ?? '//vrlab-static.ljcdn.com/release/web/arrow3.06c5b657.png')
|
|
18372
|
+
// const texture = new THREE.TextureLoader().load(params?.textureUrl ?? '//vrlab-static.ljcdn.com/release/web/arrow4.b1427685.png')
|
|
18373
|
+
// const texture = new THREE.TextureLoader().load(params?.textureUrl ?? '//vrlab-static.ljcdn.com/release/web/arrow5.ae49f3c8.png')
|
|
18374
|
+
const texture = new THREE__namespace.TextureLoader().load((_a = params === null || params === void 0 ? void 0 : params.textureUrl) !== null && _a !== void 0 ? _a : '//vrlab-static.ljcdn.com/release/web/arrow6.b6ce0c62.png');
|
|
18370
18375
|
texture.wrapS = texture.wrapT = THREE__namespace.RepeatWrapping;
|
|
18371
18376
|
texture.encoding = THREE__namespace.sRGBEncoding;
|
|
18372
18377
|
const arrowMaterial = new THREE__namespace.MeshBasicMaterial({
|
|
@@ -18449,7 +18454,7 @@ class Controller extends Controller$6 {
|
|
|
18449
18454
|
this.five.scene.remove(this.linesGroup);
|
|
18450
18455
|
const linesGroup = this.getLinesGroup(data.routes);
|
|
18451
18456
|
if (!linesGroup)
|
|
18452
|
-
return
|
|
18457
|
+
return;
|
|
18453
18458
|
this.linesGroup = linesGroup;
|
|
18454
18459
|
this.five.scene.add(linesGroup);
|
|
18455
18460
|
this.handleVisible(this.state.visible);
|
|
@@ -18553,10 +18558,10 @@ class Controller extends Controller$6 {
|
|
|
18553
18558
|
const geometry = getLineGeometry(positions);
|
|
18554
18559
|
if (!geometry)
|
|
18555
18560
|
return;
|
|
18556
|
-
const material = getArrowMaterial({
|
|
18561
|
+
const material = getArrowMaterial({ textureUrl: data.arrowTextureUrl });
|
|
18557
18562
|
const mesh = new THREE__namespace.Mesh(geometry, material);
|
|
18558
18563
|
mesh.name = pluginFlag('route-line-mesh');
|
|
18559
|
-
mesh.renderOrder = 3
|
|
18564
|
+
// mesh.renderOrder = 3
|
|
18560
18565
|
return mesh;
|
|
18561
18566
|
}
|
|
18562
18567
|
}
|
|
@@ -18624,7 +18629,15 @@ function linerValue(x0, v0, t1, t) {
|
|
|
18624
18629
|
return a * t + d;
|
|
18625
18630
|
}
|
|
18626
18631
|
|
|
18627
|
-
|
|
18632
|
+
function sleep(duration) {
|
|
18633
|
+
return new Promise((resolve) => {
|
|
18634
|
+
setTimeout(() => {
|
|
18635
|
+
resolve();
|
|
18636
|
+
}, duration);
|
|
18637
|
+
});
|
|
18638
|
+
}
|
|
18639
|
+
|
|
18640
|
+
const VERSION = 'v1.0.6';
|
|
18628
18641
|
const PLUGIN_NAME = 'CruisePlugin';
|
|
18629
18642
|
const PLUGIN = `${PLUGIN_NAME}@${VERSION}`;
|
|
18630
18643
|
const disposedErrorLog = () => {
|
|
@@ -18654,7 +18667,7 @@ class CruisePluginController extends Controller$6 {
|
|
|
18654
18667
|
speedConfig: {
|
|
18655
18668
|
rotateSpeed: 0.001,
|
|
18656
18669
|
rotateSpeedUnit: 'rad/ms',
|
|
18657
|
-
moveSpeed: 0.
|
|
18670
|
+
moveSpeed: 0.002,
|
|
18658
18671
|
moveSpeedUnit: 'm/ms',
|
|
18659
18672
|
},
|
|
18660
18673
|
},
|
|
@@ -18870,12 +18883,24 @@ class CruisePluginController extends Controller$6 {
|
|
|
18870
18883
|
if (data.keyframes) {
|
|
18871
18884
|
return {
|
|
18872
18885
|
keyframesId: uuid(),
|
|
18873
|
-
keyframes: data.keyframes.map((keyframe, index) => {
|
|
18886
|
+
keyframes: data.keyframes.map((keyframe, index) => {
|
|
18887
|
+
var _a;
|
|
18888
|
+
const nextKeyframe = data.keyframes[index + 1];
|
|
18889
|
+
const stay = (() => {
|
|
18890
|
+
if (!nextKeyframe)
|
|
18891
|
+
return 0;
|
|
18892
|
+
if (nextKeyframe.start === undefined || keyframe.end === undefined)
|
|
18893
|
+
return 0;
|
|
18894
|
+
return nextKeyframe.start - keyframe.end;
|
|
18895
|
+
})();
|
|
18896
|
+
return Object.assign({ id: (_a = keyframe.uuid) !== null && _a !== void 0 ? _a : uuid(), moveIndex: index, stay, index }, keyframe);
|
|
18897
|
+
}),
|
|
18874
18898
|
};
|
|
18875
18899
|
}
|
|
18876
18900
|
else if (data.panoIndexList) {
|
|
18877
18901
|
let keyframes = [];
|
|
18878
|
-
const moveEffect = data
|
|
18902
|
+
const { moveEffect, moveToFirstPanoEffect } = data;
|
|
18903
|
+
this.privateState.moveToFirstPanoEffect = moveToFirstPanoEffect;
|
|
18879
18904
|
data.panoIndexList
|
|
18880
18905
|
.filter((panoIndex, index) => panoIndex !== data.panoIndexList[index - 1])
|
|
18881
18906
|
.forEach((panoIndex, index) => {
|
|
@@ -18896,13 +18921,17 @@ class CruisePluginController extends Controller$6 {
|
|
|
18896
18921
|
})();
|
|
18897
18922
|
if (data.moveType === undefined || data.moveType === 'justMove') {
|
|
18898
18923
|
// move to panoIndex, latitude, longitude
|
|
18899
|
-
keyframes.push({
|
|
18924
|
+
keyframes.push({
|
|
18925
|
+
moveIndex: index,
|
|
18926
|
+
stay: data.stay,
|
|
18927
|
+
data: Object.assign({ effect: 'Move', panoIndex, moveEffect }, (lookatNextPanoIndex !== null && lookatNextPanoIndex !== void 0 ? lookatNextPanoIndex : {})),
|
|
18928
|
+
});
|
|
18900
18929
|
}
|
|
18901
18930
|
else if (data.moveType === 'moveAndRotate') {
|
|
18902
18931
|
// move to panoIndex, then rotate to latitude and longitude
|
|
18903
|
-
keyframes.push({ data: { effect: 'Move', panoIndex, moveEffect } });
|
|
18932
|
+
keyframes.push({ moveIndex: index, stay: data.stay, data: { effect: 'Move', panoIndex, moveEffect } });
|
|
18904
18933
|
if (lookatNextPanoIndex)
|
|
18905
|
-
keyframes.push({ data: Object.assign({ effect: 'Rotate', panoIndex }, lookatNextPanoIndex) });
|
|
18934
|
+
keyframes.push({ moveIndex: index, stay: data.stay, data: Object.assign({ effect: 'Rotate', panoIndex }, lookatNextPanoIndex) });
|
|
18906
18935
|
}
|
|
18907
18936
|
});
|
|
18908
18937
|
return { keyframesId: uuid(), keyframes: keyframes.map((keyframe, index) => (Object.assign({ id: uuid(), index }, keyframe))) };
|
|
@@ -18967,6 +18996,7 @@ class CruisePluginController extends Controller$6 {
|
|
|
18967
18996
|
if ((options === null || options === void 0 ? void 0 : options.notEmitEvent) !== true) {
|
|
18968
18997
|
hooks.emit('play', { userAction: (_a = options === null || options === void 0 ? void 0 : options.userAction) !== null && _a !== void 0 ? _a : true });
|
|
18969
18998
|
}
|
|
18999
|
+
let playedFirstKeyframe = false;
|
|
18970
19000
|
const getPlayFromIndex = async () => {
|
|
18971
19001
|
var _a, _b;
|
|
18972
19002
|
// play from index
|
|
@@ -18980,13 +19010,14 @@ class CruisePluginController extends Controller$6 {
|
|
|
18980
19010
|
const pausedKeyframe = (_b = this.data) === null || _b === void 0 ? void 0 : _b.keyframes.find((keyframe) => keyframe.id === pauseData.keyframeId);
|
|
18981
19011
|
// restore paused state
|
|
18982
19012
|
if (pauseData === null || pauseData === void 0 ? void 0 : pauseData.fiveState)
|
|
18983
|
-
await this.move(pauseData.fiveState);
|
|
19013
|
+
await this.move(pauseData.fiveState, { moveEffect: privateState.moveToFirstPanoEffect });
|
|
18984
19014
|
if (pausedKeyframe) {
|
|
18985
19015
|
if (pausedKeyframe.data.effect === 'Move')
|
|
18986
19016
|
return pausedKeyframe.index;
|
|
18987
19017
|
else if (pausedKeyframe.data.effect === 'Rotate') {
|
|
18988
19018
|
const duration = pauseData.duration !== undefined ? pauseData.duration * (1 - pauseData.playedProgress) : undefined;
|
|
18989
|
-
await this.playKeyframe(pausedKeyframe, duration);
|
|
19019
|
+
await this.playKeyframe(pausedKeyframe, { duration });
|
|
19020
|
+
playedFirstKeyframe = true;
|
|
18990
19021
|
// playFromIndex += 1 cause played last part of paused keyframe
|
|
18991
19022
|
return pausedKeyframe.index + 1;
|
|
18992
19023
|
}
|
|
@@ -19008,11 +19039,19 @@ class CruisePluginController extends Controller$6 {
|
|
|
19008
19039
|
try {
|
|
19009
19040
|
console.log('playIndexChange', keyframe.index);
|
|
19010
19041
|
hooks.emit('playIndexChange', keyframe.index, keyframe);
|
|
19011
|
-
|
|
19042
|
+
console.log({ playFromIndex });
|
|
19043
|
+
await this.playKeyframe(keyframe, {
|
|
19044
|
+
moveEffect: playedFirstKeyframe === false ? privateState.moveToFirstPanoEffect : undefined,
|
|
19045
|
+
duration: 800,
|
|
19046
|
+
});
|
|
19047
|
+
if (keyframe.stay)
|
|
19048
|
+
await sleep(keyframe.stay);
|
|
19049
|
+
if (playedFirstKeyframe === false)
|
|
19050
|
+
playedFirstKeyframe = true;
|
|
19012
19051
|
}
|
|
19013
19052
|
catch (error) {
|
|
19014
19053
|
return Promise.resolve('broke');
|
|
19015
|
-
// if think play be interupted by five gesture is an error, return Promise.reject(error)
|
|
19054
|
+
// if think the play be interupted by five gesture is an error, return Promise.reject(error)
|
|
19016
19055
|
// return Promise.reject(error)
|
|
19017
19056
|
}
|
|
19018
19057
|
}
|
|
@@ -19044,12 +19083,12 @@ class CruisePluginController extends Controller$6 {
|
|
|
19044
19083
|
/**
|
|
19045
19084
|
* @description Play single keyframe
|
|
19046
19085
|
*/
|
|
19047
|
-
async playKeyframe(keyframe,
|
|
19086
|
+
async playKeyframe(keyframe, params) {
|
|
19048
19087
|
var _a;
|
|
19049
19088
|
const { privateState } = this;
|
|
19050
19089
|
if (((_a = this.privateState.currentPlayKeyframe) === null || _a === void 0 ? void 0 : _a.keyframe.id) !== keyframe.id)
|
|
19051
19090
|
this.privateState.currentPlayKeyframe = { keyframe };
|
|
19052
|
-
privateState.currentPlayQueue.push(this.getPlayPromise(keyframe,
|
|
19091
|
+
privateState.currentPlayQueue.push(this.getPlayPromise(keyframe, params));
|
|
19053
19092
|
return this.actionPromiseQueue();
|
|
19054
19093
|
}
|
|
19055
19094
|
/**
|
|
@@ -19066,9 +19105,10 @@ class CruisePluginController extends Controller$6 {
|
|
|
19066
19105
|
/**
|
|
19067
19106
|
* @description: getPlayPromise
|
|
19068
19107
|
*/
|
|
19069
|
-
async getPlayPromise(keyframe,
|
|
19108
|
+
async getPlayPromise(keyframe, params) {
|
|
19109
|
+
var _a;
|
|
19070
19110
|
const data = keyframe.data;
|
|
19071
|
-
|
|
19111
|
+
(_a = params === null || params === void 0 ? void 0 : params.duration) !== null && _a !== void 0 ? _a : (keyframe.start !== undefined && keyframe.end !== undefined ? keyframe.end - keyframe.start : undefined);
|
|
19072
19112
|
if (!data)
|
|
19073
19113
|
return;
|
|
19074
19114
|
return new Promise((resolve, reject) => {
|
|
@@ -19092,13 +19132,13 @@ class CruisePluginController extends Controller$6 {
|
|
|
19092
19132
|
};
|
|
19093
19133
|
switch (data.effect) {
|
|
19094
19134
|
case 'Move':
|
|
19095
|
-
this.move(data,
|
|
19135
|
+
this.move(data, params).then(res);
|
|
19096
19136
|
break;
|
|
19097
19137
|
case 'Rotate':
|
|
19098
|
-
this.rotate(data,
|
|
19138
|
+
this.rotate(data, params).then(res);
|
|
19099
19139
|
break;
|
|
19100
19140
|
default:
|
|
19101
|
-
this.rotate(data,
|
|
19141
|
+
this.rotate(data, params).then(res);
|
|
19102
19142
|
}
|
|
19103
19143
|
}
|
|
19104
19144
|
catch (e) { }
|
|
@@ -19129,13 +19169,13 @@ class CruisePluginController extends Controller$6 {
|
|
|
19129
19169
|
/**
|
|
19130
19170
|
* @description Action move keyframe
|
|
19131
19171
|
*/
|
|
19132
|
-
async move(data,
|
|
19172
|
+
async move(data, params) {
|
|
19133
19173
|
console.log('--move--', data.panoIndex);
|
|
19134
19174
|
if (data.mode && data.mode !== this.five.currentMode) {
|
|
19135
19175
|
await this.changeMode(data);
|
|
19136
19176
|
}
|
|
19137
19177
|
else if (data.panoIndex !== this.five.panoIndex) {
|
|
19138
|
-
await this.changePano(data,
|
|
19178
|
+
await this.changePano(data, params);
|
|
19139
19179
|
}
|
|
19140
19180
|
else {
|
|
19141
19181
|
return Promise.resolve();
|
|
@@ -19145,15 +19185,15 @@ class CruisePluginController extends Controller$6 {
|
|
|
19145
19185
|
/**
|
|
19146
19186
|
* @description Action rotate keyframe
|
|
19147
19187
|
*/
|
|
19148
|
-
async rotate(data,
|
|
19188
|
+
async rotate(data, params) {
|
|
19149
19189
|
console.log('--rotate--', data);
|
|
19150
19190
|
if (data.mode && data.mode !== this.five.currentMode) {
|
|
19151
19191
|
await this.changeMode({ mode: data.mode, panoIndex: data.panoIndex });
|
|
19152
19192
|
}
|
|
19153
19193
|
else if (data.panoIndex && data.panoIndex !== this.five.panoIndex) {
|
|
19154
|
-
return await this.changePano(data,
|
|
19194
|
+
return await this.changePano(data, params);
|
|
19155
19195
|
}
|
|
19156
|
-
await this.updateCamera(data, duration);
|
|
19196
|
+
await this.updateCamera(data, params === null || params === void 0 ? void 0 : params.duration);
|
|
19157
19197
|
}
|
|
19158
19198
|
/**
|
|
19159
19199
|
* @description Update five camera
|
|
@@ -19188,13 +19228,14 @@ class CruisePluginController extends Controller$6 {
|
|
|
19188
19228
|
/**
|
|
19189
19229
|
* @description: Change five pano
|
|
19190
19230
|
*/
|
|
19191
|
-
async changePano(data,
|
|
19231
|
+
async changePano(data, params) {
|
|
19232
|
+
var _a;
|
|
19192
19233
|
const { five, privateState, state } = this;
|
|
19193
19234
|
if (typeof data.panoIndex !== 'number')
|
|
19194
19235
|
return;
|
|
19195
19236
|
if (data.panoIndex === five.panoIndex)
|
|
19196
19237
|
return;
|
|
19197
|
-
let originDuration =
|
|
19238
|
+
let originDuration = (_a = params === null || params === void 0 ? void 0 : params.duration) !== null && _a !== void 0 ? _a : 800;
|
|
19198
19239
|
const speed = (() => {
|
|
19199
19240
|
var _a, _b;
|
|
19200
19241
|
const speedConfig = (_a = state.config) === null || _a === void 0 ? void 0 : _a.speedConfig;
|
|
@@ -19215,13 +19256,13 @@ class CruisePluginController extends Controller$6 {
|
|
|
19215
19256
|
privateState.currentPlayKeyframe.originDuration = originDuration;
|
|
19216
19257
|
const duration = this.getSpeededDuration(originDuration);
|
|
19217
19258
|
return new Promise((resolve) => {
|
|
19218
|
-
var _a, _b;
|
|
19259
|
+
var _a, _b, _c;
|
|
19219
19260
|
five.moveToPano(data.panoIndex, {
|
|
19220
19261
|
latitude: data.latitude,
|
|
19221
19262
|
longitude: data.longitude,
|
|
19222
19263
|
fov: data.fov,
|
|
19223
19264
|
duration,
|
|
19224
|
-
effect: (
|
|
19265
|
+
effect: (_c = (_a = params === null || params === void 0 ? void 0 : params.moveEffect) !== null && _a !== void 0 ? _a : (_b = this.state.config) === null || _b === void 0 ? void 0 : _b.moveEffect) !== null && _c !== void 0 ? _c : data.moveEffect,
|
|
19225
19266
|
moveCancelCallback: () => resolve(),
|
|
19226
19267
|
moveEndCallback: () => resolve(),
|
|
19227
19268
|
});
|
|
@@ -19238,7 +19279,7 @@ class CruisePluginController extends Controller$6 {
|
|
|
19238
19279
|
try {
|
|
19239
19280
|
const duration = currentPlayKeyframe.originDuration !== undefined ? currentPlayKeyframe.originDuration * (1 - this.getProgress()) : undefined;
|
|
19240
19281
|
console.log('--speedChange--', speed, { duration });
|
|
19241
|
-
const promise = this.playKeyframe(currentPlayKeyframe.keyframe, duration);
|
|
19282
|
+
const promise = this.playKeyframe(currentPlayKeyframe.keyframe, { duration });
|
|
19242
19283
|
privateState.currentPlayQueue.push(promise);
|
|
19243
19284
|
}
|
|
19244
19285
|
catch (e) { }
|
package/dist/index.umd.js
CHANGED
|
@@ -18296,10 +18296,10 @@ void main() {
|
|
|
18296
18296
|
const UV_NUMBER_OF_VERTEX = 2; // 每个顶点有两个 UV 轴坐标
|
|
18297
18297
|
function getLineGeometry(positionList) {
|
|
18298
18298
|
if (positionList.length < 2)
|
|
18299
|
-
return;
|
|
18300
|
-
const lineWidth =
|
|
18301
|
-
const halfLineWidth =
|
|
18302
|
-
const aspect =
|
|
18299
|
+
return console.warn('positionList length must be greater than 1');
|
|
18300
|
+
const lineWidth = 0.6;
|
|
18301
|
+
const halfLineWidth = lineWidth / 2;
|
|
18302
|
+
const aspect = 0.67; // 纵横比 width / height
|
|
18303
18303
|
// 点位向量数组
|
|
18304
18304
|
const keyPoints = positionList;
|
|
18305
18305
|
// 点位组成的平滑曲线
|
|
@@ -18354,7 +18354,12 @@ void main() {
|
|
|
18354
18354
|
|
|
18355
18355
|
function getArrowMaterial(params) {
|
|
18356
18356
|
var _a;
|
|
18357
|
-
const texture = new
|
|
18357
|
+
// const texture = new THREE.TextureLoader().load(params?.textureUrl ?? '//vrlab-static.ljcdn.com/release/web/arrow.c5d028e4.png')
|
|
18358
|
+
// const texture = new THREE.TextureLoader().load(params?.textureUrl ?? '//vrlab-static.ljcdn.com/release/web/arrow2.aa1762e4.png')
|
|
18359
|
+
// const texture = new THREE.TextureLoader().load(params?.textureUrl ?? '//vrlab-static.ljcdn.com/release/web/arrow3.06c5b657.png')
|
|
18360
|
+
// const texture = new THREE.TextureLoader().load(params?.textureUrl ?? '//vrlab-static.ljcdn.com/release/web/arrow4.b1427685.png')
|
|
18361
|
+
// const texture = new THREE.TextureLoader().load(params?.textureUrl ?? '//vrlab-static.ljcdn.com/release/web/arrow5.ae49f3c8.png')
|
|
18362
|
+
const texture = new THREE__namespace.TextureLoader().load((_a = params === null || params === void 0 ? void 0 : params.textureUrl) !== null && _a !== void 0 ? _a : '//vrlab-static.ljcdn.com/release/web/arrow6.b6ce0c62.png');
|
|
18358
18363
|
texture.wrapS = texture.wrapT = THREE__namespace.RepeatWrapping;
|
|
18359
18364
|
texture.encoding = THREE__namespace.sRGBEncoding;
|
|
18360
18365
|
const arrowMaterial = new THREE__namespace.MeshBasicMaterial({
|
|
@@ -18437,7 +18442,7 @@ void main() {
|
|
|
18437
18442
|
this.five.scene.remove(this.linesGroup);
|
|
18438
18443
|
const linesGroup = this.getLinesGroup(data.routes);
|
|
18439
18444
|
if (!linesGroup)
|
|
18440
|
-
return
|
|
18445
|
+
return;
|
|
18441
18446
|
this.linesGroup = linesGroup;
|
|
18442
18447
|
this.five.scene.add(linesGroup);
|
|
18443
18448
|
this.handleVisible(this.state.visible);
|
|
@@ -18541,10 +18546,10 @@ void main() {
|
|
|
18541
18546
|
const geometry = getLineGeometry(positions);
|
|
18542
18547
|
if (!geometry)
|
|
18543
18548
|
return;
|
|
18544
|
-
const material = getArrowMaterial({
|
|
18549
|
+
const material = getArrowMaterial({ textureUrl: data.arrowTextureUrl });
|
|
18545
18550
|
const mesh = new THREE__namespace.Mesh(geometry, material);
|
|
18546
18551
|
mesh.name = pluginFlag('route-line-mesh');
|
|
18547
|
-
mesh.renderOrder = 3
|
|
18552
|
+
// mesh.renderOrder = 3
|
|
18548
18553
|
return mesh;
|
|
18549
18554
|
}
|
|
18550
18555
|
}
|
|
@@ -18612,7 +18617,15 @@ void main() {
|
|
|
18612
18617
|
return a * t + d;
|
|
18613
18618
|
}
|
|
18614
18619
|
|
|
18615
|
-
|
|
18620
|
+
function sleep(duration) {
|
|
18621
|
+
return new Promise((resolve) => {
|
|
18622
|
+
setTimeout(() => {
|
|
18623
|
+
resolve();
|
|
18624
|
+
}, duration);
|
|
18625
|
+
});
|
|
18626
|
+
}
|
|
18627
|
+
|
|
18628
|
+
const VERSION = 'v1.0.6';
|
|
18616
18629
|
const PLUGIN_NAME = 'CruisePlugin';
|
|
18617
18630
|
const PLUGIN = `${PLUGIN_NAME}@${VERSION}`;
|
|
18618
18631
|
const disposedErrorLog = () => {
|
|
@@ -18642,7 +18655,7 @@ void main() {
|
|
|
18642
18655
|
speedConfig: {
|
|
18643
18656
|
rotateSpeed: 0.001,
|
|
18644
18657
|
rotateSpeedUnit: 'rad/ms',
|
|
18645
|
-
moveSpeed: 0.
|
|
18658
|
+
moveSpeed: 0.002,
|
|
18646
18659
|
moveSpeedUnit: 'm/ms',
|
|
18647
18660
|
},
|
|
18648
18661
|
},
|
|
@@ -18858,12 +18871,24 @@ void main() {
|
|
|
18858
18871
|
if (data.keyframes) {
|
|
18859
18872
|
return {
|
|
18860
18873
|
keyframesId: uuid(),
|
|
18861
|
-
keyframes: data.keyframes.map((keyframe, index) => {
|
|
18874
|
+
keyframes: data.keyframes.map((keyframe, index) => {
|
|
18875
|
+
var _a;
|
|
18876
|
+
const nextKeyframe = data.keyframes[index + 1];
|
|
18877
|
+
const stay = (() => {
|
|
18878
|
+
if (!nextKeyframe)
|
|
18879
|
+
return 0;
|
|
18880
|
+
if (nextKeyframe.start === undefined || keyframe.end === undefined)
|
|
18881
|
+
return 0;
|
|
18882
|
+
return nextKeyframe.start - keyframe.end;
|
|
18883
|
+
})();
|
|
18884
|
+
return Object.assign({ id: (_a = keyframe.uuid) !== null && _a !== void 0 ? _a : uuid(), moveIndex: index, stay, index }, keyframe);
|
|
18885
|
+
}),
|
|
18862
18886
|
};
|
|
18863
18887
|
}
|
|
18864
18888
|
else if (data.panoIndexList) {
|
|
18865
18889
|
let keyframes = [];
|
|
18866
|
-
const moveEffect = data
|
|
18890
|
+
const { moveEffect, moveToFirstPanoEffect } = data;
|
|
18891
|
+
this.privateState.moveToFirstPanoEffect = moveToFirstPanoEffect;
|
|
18867
18892
|
data.panoIndexList
|
|
18868
18893
|
.filter((panoIndex, index) => panoIndex !== data.panoIndexList[index - 1])
|
|
18869
18894
|
.forEach((panoIndex, index) => {
|
|
@@ -18884,13 +18909,17 @@ void main() {
|
|
|
18884
18909
|
})();
|
|
18885
18910
|
if (data.moveType === undefined || data.moveType === 'justMove') {
|
|
18886
18911
|
// move to panoIndex, latitude, longitude
|
|
18887
|
-
keyframes.push({
|
|
18912
|
+
keyframes.push({
|
|
18913
|
+
moveIndex: index,
|
|
18914
|
+
stay: data.stay,
|
|
18915
|
+
data: Object.assign({ effect: 'Move', panoIndex, moveEffect }, (lookatNextPanoIndex !== null && lookatNextPanoIndex !== void 0 ? lookatNextPanoIndex : {})),
|
|
18916
|
+
});
|
|
18888
18917
|
}
|
|
18889
18918
|
else if (data.moveType === 'moveAndRotate') {
|
|
18890
18919
|
// move to panoIndex, then rotate to latitude and longitude
|
|
18891
|
-
keyframes.push({ data: { effect: 'Move', panoIndex, moveEffect } });
|
|
18920
|
+
keyframes.push({ moveIndex: index, stay: data.stay, data: { effect: 'Move', panoIndex, moveEffect } });
|
|
18892
18921
|
if (lookatNextPanoIndex)
|
|
18893
|
-
keyframes.push({ data: Object.assign({ effect: 'Rotate', panoIndex }, lookatNextPanoIndex) });
|
|
18922
|
+
keyframes.push({ moveIndex: index, stay: data.stay, data: Object.assign({ effect: 'Rotate', panoIndex }, lookatNextPanoIndex) });
|
|
18894
18923
|
}
|
|
18895
18924
|
});
|
|
18896
18925
|
return { keyframesId: uuid(), keyframes: keyframes.map((keyframe, index) => (Object.assign({ id: uuid(), index }, keyframe))) };
|
|
@@ -18955,6 +18984,7 @@ void main() {
|
|
|
18955
18984
|
if ((options === null || options === void 0 ? void 0 : options.notEmitEvent) !== true) {
|
|
18956
18985
|
hooks.emit('play', { userAction: (_a = options === null || options === void 0 ? void 0 : options.userAction) !== null && _a !== void 0 ? _a : true });
|
|
18957
18986
|
}
|
|
18987
|
+
let playedFirstKeyframe = false;
|
|
18958
18988
|
const getPlayFromIndex = async () => {
|
|
18959
18989
|
var _a, _b;
|
|
18960
18990
|
// play from index
|
|
@@ -18968,13 +18998,14 @@ void main() {
|
|
|
18968
18998
|
const pausedKeyframe = (_b = this.data) === null || _b === void 0 ? void 0 : _b.keyframes.find((keyframe) => keyframe.id === pauseData.keyframeId);
|
|
18969
18999
|
// restore paused state
|
|
18970
19000
|
if (pauseData === null || pauseData === void 0 ? void 0 : pauseData.fiveState)
|
|
18971
|
-
await this.move(pauseData.fiveState);
|
|
19001
|
+
await this.move(pauseData.fiveState, { moveEffect: privateState.moveToFirstPanoEffect });
|
|
18972
19002
|
if (pausedKeyframe) {
|
|
18973
19003
|
if (pausedKeyframe.data.effect === 'Move')
|
|
18974
19004
|
return pausedKeyframe.index;
|
|
18975
19005
|
else if (pausedKeyframe.data.effect === 'Rotate') {
|
|
18976
19006
|
const duration = pauseData.duration !== undefined ? pauseData.duration * (1 - pauseData.playedProgress) : undefined;
|
|
18977
|
-
await this.playKeyframe(pausedKeyframe, duration);
|
|
19007
|
+
await this.playKeyframe(pausedKeyframe, { duration });
|
|
19008
|
+
playedFirstKeyframe = true;
|
|
18978
19009
|
// playFromIndex += 1 cause played last part of paused keyframe
|
|
18979
19010
|
return pausedKeyframe.index + 1;
|
|
18980
19011
|
}
|
|
@@ -18996,11 +19027,19 @@ void main() {
|
|
|
18996
19027
|
try {
|
|
18997
19028
|
console.log('playIndexChange', keyframe.index);
|
|
18998
19029
|
hooks.emit('playIndexChange', keyframe.index, keyframe);
|
|
18999
|
-
|
|
19030
|
+
console.log({ playFromIndex });
|
|
19031
|
+
await this.playKeyframe(keyframe, {
|
|
19032
|
+
moveEffect: playedFirstKeyframe === false ? privateState.moveToFirstPanoEffect : undefined,
|
|
19033
|
+
duration: 800,
|
|
19034
|
+
});
|
|
19035
|
+
if (keyframe.stay)
|
|
19036
|
+
await sleep(keyframe.stay);
|
|
19037
|
+
if (playedFirstKeyframe === false)
|
|
19038
|
+
playedFirstKeyframe = true;
|
|
19000
19039
|
}
|
|
19001
19040
|
catch (error) {
|
|
19002
19041
|
return Promise.resolve('broke');
|
|
19003
|
-
// if think play be interupted by five gesture is an error, return Promise.reject(error)
|
|
19042
|
+
// if think the play be interupted by five gesture is an error, return Promise.reject(error)
|
|
19004
19043
|
// return Promise.reject(error)
|
|
19005
19044
|
}
|
|
19006
19045
|
}
|
|
@@ -19032,12 +19071,12 @@ void main() {
|
|
|
19032
19071
|
/**
|
|
19033
19072
|
* @description Play single keyframe
|
|
19034
19073
|
*/
|
|
19035
|
-
async playKeyframe(keyframe,
|
|
19074
|
+
async playKeyframe(keyframe, params) {
|
|
19036
19075
|
var _a;
|
|
19037
19076
|
const { privateState } = this;
|
|
19038
19077
|
if (((_a = this.privateState.currentPlayKeyframe) === null || _a === void 0 ? void 0 : _a.keyframe.id) !== keyframe.id)
|
|
19039
19078
|
this.privateState.currentPlayKeyframe = { keyframe };
|
|
19040
|
-
privateState.currentPlayQueue.push(this.getPlayPromise(keyframe,
|
|
19079
|
+
privateState.currentPlayQueue.push(this.getPlayPromise(keyframe, params));
|
|
19041
19080
|
return this.actionPromiseQueue();
|
|
19042
19081
|
}
|
|
19043
19082
|
/**
|
|
@@ -19054,9 +19093,10 @@ void main() {
|
|
|
19054
19093
|
/**
|
|
19055
19094
|
* @description: getPlayPromise
|
|
19056
19095
|
*/
|
|
19057
|
-
async getPlayPromise(keyframe,
|
|
19096
|
+
async getPlayPromise(keyframe, params) {
|
|
19097
|
+
var _a;
|
|
19058
19098
|
const data = keyframe.data;
|
|
19059
|
-
|
|
19099
|
+
(_a = params === null || params === void 0 ? void 0 : params.duration) !== null && _a !== void 0 ? _a : (keyframe.start !== undefined && keyframe.end !== undefined ? keyframe.end - keyframe.start : undefined);
|
|
19060
19100
|
if (!data)
|
|
19061
19101
|
return;
|
|
19062
19102
|
return new Promise((resolve, reject) => {
|
|
@@ -19080,13 +19120,13 @@ void main() {
|
|
|
19080
19120
|
};
|
|
19081
19121
|
switch (data.effect) {
|
|
19082
19122
|
case 'Move':
|
|
19083
|
-
this.move(data,
|
|
19123
|
+
this.move(data, params).then(res);
|
|
19084
19124
|
break;
|
|
19085
19125
|
case 'Rotate':
|
|
19086
|
-
this.rotate(data,
|
|
19126
|
+
this.rotate(data, params).then(res);
|
|
19087
19127
|
break;
|
|
19088
19128
|
default:
|
|
19089
|
-
this.rotate(data,
|
|
19129
|
+
this.rotate(data, params).then(res);
|
|
19090
19130
|
}
|
|
19091
19131
|
}
|
|
19092
19132
|
catch (e) { }
|
|
@@ -19117,13 +19157,13 @@ void main() {
|
|
|
19117
19157
|
/**
|
|
19118
19158
|
* @description Action move keyframe
|
|
19119
19159
|
*/
|
|
19120
|
-
async move(data,
|
|
19160
|
+
async move(data, params) {
|
|
19121
19161
|
console.log('--move--', data.panoIndex);
|
|
19122
19162
|
if (data.mode && data.mode !== this.five.currentMode) {
|
|
19123
19163
|
await this.changeMode(data);
|
|
19124
19164
|
}
|
|
19125
19165
|
else if (data.panoIndex !== this.five.panoIndex) {
|
|
19126
|
-
await this.changePano(data,
|
|
19166
|
+
await this.changePano(data, params);
|
|
19127
19167
|
}
|
|
19128
19168
|
else {
|
|
19129
19169
|
return Promise.resolve();
|
|
@@ -19133,15 +19173,15 @@ void main() {
|
|
|
19133
19173
|
/**
|
|
19134
19174
|
* @description Action rotate keyframe
|
|
19135
19175
|
*/
|
|
19136
|
-
async rotate(data,
|
|
19176
|
+
async rotate(data, params) {
|
|
19137
19177
|
console.log('--rotate--', data);
|
|
19138
19178
|
if (data.mode && data.mode !== this.five.currentMode) {
|
|
19139
19179
|
await this.changeMode({ mode: data.mode, panoIndex: data.panoIndex });
|
|
19140
19180
|
}
|
|
19141
19181
|
else if (data.panoIndex && data.panoIndex !== this.five.panoIndex) {
|
|
19142
|
-
return await this.changePano(data,
|
|
19182
|
+
return await this.changePano(data, params);
|
|
19143
19183
|
}
|
|
19144
|
-
await this.updateCamera(data, duration);
|
|
19184
|
+
await this.updateCamera(data, params === null || params === void 0 ? void 0 : params.duration);
|
|
19145
19185
|
}
|
|
19146
19186
|
/**
|
|
19147
19187
|
* @description Update five camera
|
|
@@ -19176,13 +19216,14 @@ void main() {
|
|
|
19176
19216
|
/**
|
|
19177
19217
|
* @description: Change five pano
|
|
19178
19218
|
*/
|
|
19179
|
-
async changePano(data,
|
|
19219
|
+
async changePano(data, params) {
|
|
19220
|
+
var _a;
|
|
19180
19221
|
const { five, privateState, state } = this;
|
|
19181
19222
|
if (typeof data.panoIndex !== 'number')
|
|
19182
19223
|
return;
|
|
19183
19224
|
if (data.panoIndex === five.panoIndex)
|
|
19184
19225
|
return;
|
|
19185
|
-
let originDuration =
|
|
19226
|
+
let originDuration = (_a = params === null || params === void 0 ? void 0 : params.duration) !== null && _a !== void 0 ? _a : 800;
|
|
19186
19227
|
const speed = (() => {
|
|
19187
19228
|
var _a, _b;
|
|
19188
19229
|
const speedConfig = (_a = state.config) === null || _a === void 0 ? void 0 : _a.speedConfig;
|
|
@@ -19203,13 +19244,13 @@ void main() {
|
|
|
19203
19244
|
privateState.currentPlayKeyframe.originDuration = originDuration;
|
|
19204
19245
|
const duration = this.getSpeededDuration(originDuration);
|
|
19205
19246
|
return new Promise((resolve) => {
|
|
19206
|
-
var _a, _b;
|
|
19247
|
+
var _a, _b, _c;
|
|
19207
19248
|
five.moveToPano(data.panoIndex, {
|
|
19208
19249
|
latitude: data.latitude,
|
|
19209
19250
|
longitude: data.longitude,
|
|
19210
19251
|
fov: data.fov,
|
|
19211
19252
|
duration,
|
|
19212
|
-
effect: (
|
|
19253
|
+
effect: (_c = (_a = params === null || params === void 0 ? void 0 : params.moveEffect) !== null && _a !== void 0 ? _a : (_b = this.state.config) === null || _b === void 0 ? void 0 : _b.moveEffect) !== null && _c !== void 0 ? _c : data.moveEffect,
|
|
19213
19254
|
moveCancelCallback: () => resolve(),
|
|
19214
19255
|
moveEndCallback: () => resolve(),
|
|
19215
19256
|
});
|
|
@@ -19226,7 +19267,7 @@ void main() {
|
|
|
19226
19267
|
try {
|
|
19227
19268
|
const duration = currentPlayKeyframe.originDuration !== undefined ? currentPlayKeyframe.originDuration * (1 - this.getProgress()) : undefined;
|
|
19228
19269
|
console.log('--speedChange--', speed, { duration });
|
|
19229
|
-
const promise = this.playKeyframe(currentPlayKeyframe.keyframe, duration);
|
|
19270
|
+
const promise = this.playKeyframe(currentPlayKeyframe.keyframe, { duration });
|
|
19230
19271
|
privateState.currentPlayQueue.push(promise);
|
|
19231
19272
|
}
|
|
19232
19273
|
catch (e) { }
|