@realsee/dnalogel 2.0.0-alpha.51 → 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 -3
- package/dist/CSS3DRenderPlugin/CruisePlugin/typing.d.ts +11 -1
- package/dist/CSS3DRenderPlugin/CruisePlugin/utils/sleep.d.ts +1 -0
- 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 -3
- package/dist/CameraMovementPlugin/CruisePlugin/typing.d.ts +11 -1
- package/dist/CameraMovementPlugin/CruisePlugin/utils/sleep.d.ts +1 -0
- 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 -3
- package/dist/CruisePlugin/CruisePlugin/typing.d.ts +11 -1
- package/dist/CruisePlugin/CruisePlugin/utils/sleep.d.ts +1 -0
- 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 -3
- package/dist/CruisePlugin/index.js +265 -41
- 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 -3
- package/dist/GuideLinePlugin/CruisePlugin/typing.d.ts +11 -1
- package/dist/GuideLinePlugin/CruisePlugin/utils/sleep.d.ts +1 -0
- package/dist/GuideLinePlugin/GuideLinePlugin/utils/getArrowMaterial.d.ts +1 -1
- package/dist/GuideLinePlugin/GuideLinePlugin/utils/getLineGeometry.d.ts +1 -1
- package/dist/GuideLinePlugin/index.js +201 -13
- 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 -3
- package/dist/ItemLabelPlugin/CruisePlugin/typing.d.ts +11 -1
- package/dist/ItemLabelPlugin/CruisePlugin/utils/sleep.d.ts +1 -0
- 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 -3
- package/dist/ModelChassisCompassPlugin/CruisePlugin/typing.d.ts +11 -1
- package/dist/ModelChassisCompassPlugin/CruisePlugin/utils/sleep.d.ts +1 -0
- 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 -3
- package/dist/ModelEntryDoorGuidePlugin/CruisePlugin/typing.d.ts +11 -1
- package/dist/ModelEntryDoorGuidePlugin/CruisePlugin/utils/sleep.d.ts +1 -0
- 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 -3
- package/dist/ModelItemLabelPlugin/CruisePlugin/typing.d.ts +11 -1
- package/dist/ModelItemLabelPlugin/CruisePlugin/utils/sleep.d.ts +1 -0
- 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 -3
- package/dist/ModelRoomLabelPlugin/CruisePlugin/typing.d.ts +11 -1
- package/dist/ModelRoomLabelPlugin/CruisePlugin/utils/sleep.d.ts +1 -0
- 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 -3
- package/dist/ModelTVVideoPlugin/CruisePlugin/typing.d.ts +11 -1
- package/dist/ModelTVVideoPlugin/CruisePlugin/utils/sleep.d.ts +1 -0
- 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 -3
- package/dist/ModelViewPlugin/CruisePlugin/typing.d.ts +11 -1
- package/dist/ModelViewPlugin/CruisePlugin/utils/sleep.d.ts +1 -0
- 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 -3
- package/dist/PanoCompassPlugin/CruisePlugin/typing.d.ts +11 -1
- package/dist/PanoCompassPlugin/CruisePlugin/utils/sleep.d.ts +1 -0
- 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 -3
- package/dist/PanoCursorRaycasterPlugin/CruisePlugin/typing.d.ts +11 -1
- package/dist/PanoCursorRaycasterPlugin/CruisePlugin/utils/sleep.d.ts +1 -0
- 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 -3
- package/dist/PanoDoorLabelPlugin/CruisePlugin/typing.d.ts +11 -1
- package/dist/PanoDoorLabelPlugin/CruisePlugin/utils/sleep.d.ts +1 -0
- 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 -3
- package/dist/PanoMeasurePlugin/CruisePlugin/typing.d.ts +11 -1
- package/dist/PanoMeasurePlugin/CruisePlugin/utils/sleep.d.ts +1 -0
- 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 -3
- package/dist/PanoRulerPlugin/CruisePlugin/typing.d.ts +11 -1
- package/dist/PanoRulerPlugin/CruisePlugin/utils/sleep.d.ts +1 -0
- 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 -3
- package/dist/PanoRulerProPlugin/CruisePlugin/typing.d.ts +11 -1
- package/dist/PanoRulerProPlugin/CruisePlugin/utils/sleep.d.ts +1 -0
- 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 -3
- package/dist/PanoSpatialTagPlugin/CruisePlugin/typing.d.ts +11 -1
- package/dist/PanoSpatialTagPlugin/CruisePlugin/utils/sleep.d.ts +1 -0
- 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 -3
- 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/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 -3
- 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/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 -3
- 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/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 -3
- 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/utils/getArrowMaterial.d.ts +1 -1
- package/dist/floorplan/TopviewFloorplanPlugin/GuideLinePlugin/utils/getLineGeometry.d.ts +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.es.js +1308 -15
- package/dist/index.js +1310 -14
- package/dist/index.umd.js +1310 -14
- package/docs/assets/search.js +1 -1
- package/docs/classes/CruisePluginController.html +23 -0
- package/docs/classes/Magnifier.html +5 -5
- package/docs/classes/ModelRoomLabelController.html +5 -5
- 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 +3 -3
- package/docs/interfaces/CameraMovementPluginExportType.html +3 -3
- package/docs/interfaces/EventMap.html +15 -0
- package/docs/interfaces/FloorplanBounding.html +5 -5
- package/docs/interfaces/FloorplanData.html +2 -2
- package/docs/interfaces/FloorplanEntrance.html +8 -8
- package/docs/interfaces/FloorplanExtraObject.html +4 -4
- 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 +7 -7
- package/docs/interfaces/FloorplanRoomLabelItem.html +4 -4
- package/docs/interfaces/FloorplanServerBounding.html +5 -5
- 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 +8 -8
- 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 +8 -8
- package/docs/interfaces/FloorplanServerRoomLabelItem.html +4 -4
- 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 -3
- package/libs/CruisePlugin/index.js +1 -3
- 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/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/libs/index.d.ts +2 -0
- package/libs/index.js +4 -0
- package/package.json +2 -1
|
@@ -4,9 +4,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var five = require('@realsee/five');
|
|
6
6
|
var THREE = require('three');
|
|
7
|
-
var getNormals = require('polyline-normals');
|
|
8
|
-
|
|
9
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
7
|
|
|
11
8
|
function _interopNamespace(e) {
|
|
12
9
|
if (e && e.__esModule) return e;
|
|
@@ -27,7 +24,6 @@ function _interopNamespace(e) {
|
|
|
27
24
|
}
|
|
28
25
|
|
|
29
26
|
var THREE__namespace = /*#__PURE__*/_interopNamespace(THREE);
|
|
30
|
-
var getNormals__default = /*#__PURE__*/_interopDefaultLegacy(getNormals);
|
|
31
27
|
|
|
32
28
|
/**
|
|
33
29
|
* plugin 的基本控制器
|
|
@@ -62,6 +58,193 @@ class Controller$2 {
|
|
|
62
58
|
class Controller$1 extends Controller$2 {
|
|
63
59
|
}
|
|
64
60
|
|
|
61
|
+
var polylineMiterUtil = {};
|
|
62
|
+
|
|
63
|
+
var add_1 = add$1;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Adds two vec2's
|
|
67
|
+
*
|
|
68
|
+
* @param {vec2} out the receiving vector
|
|
69
|
+
* @param {vec2} a the first operand
|
|
70
|
+
* @param {vec2} b the second operand
|
|
71
|
+
* @returns {vec2} out
|
|
72
|
+
*/
|
|
73
|
+
function add$1(out, a, b) {
|
|
74
|
+
out[0] = a[0] + b[0];
|
|
75
|
+
out[1] = a[1] + b[1];
|
|
76
|
+
return out
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
var set_1 = set$1;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Set the components of a vec2 to the given values
|
|
83
|
+
*
|
|
84
|
+
* @param {vec2} out the receiving vector
|
|
85
|
+
* @param {Number} x X component
|
|
86
|
+
* @param {Number} y Y component
|
|
87
|
+
* @returns {vec2} out
|
|
88
|
+
*/
|
|
89
|
+
function set$1(out, x, y) {
|
|
90
|
+
out[0] = x;
|
|
91
|
+
out[1] = y;
|
|
92
|
+
return out
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
var normalize_1 = normalize$1;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Normalize a vec2
|
|
99
|
+
*
|
|
100
|
+
* @param {vec2} out the receiving vector
|
|
101
|
+
* @param {vec2} a vector to normalize
|
|
102
|
+
* @returns {vec2} out
|
|
103
|
+
*/
|
|
104
|
+
function normalize$1(out, a) {
|
|
105
|
+
var x = a[0],
|
|
106
|
+
y = a[1];
|
|
107
|
+
var len = x*x + y*y;
|
|
108
|
+
if (len > 0) {
|
|
109
|
+
//TODO: evaluate use of glm_invsqrt here?
|
|
110
|
+
len = 1 / Math.sqrt(len);
|
|
111
|
+
out[0] = a[0] * len;
|
|
112
|
+
out[1] = a[1] * len;
|
|
113
|
+
}
|
|
114
|
+
return out
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
var subtract_1 = subtract$1;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Subtracts vector b from vector a
|
|
121
|
+
*
|
|
122
|
+
* @param {vec2} out the receiving vector
|
|
123
|
+
* @param {vec2} a the first operand
|
|
124
|
+
* @param {vec2} b the second operand
|
|
125
|
+
* @returns {vec2} out
|
|
126
|
+
*/
|
|
127
|
+
function subtract$1(out, a, b) {
|
|
128
|
+
out[0] = a[0] - b[0];
|
|
129
|
+
out[1] = a[1] - b[1];
|
|
130
|
+
return out
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
var dot_1 = dot$1;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Calculates the dot product of two vec2's
|
|
137
|
+
*
|
|
138
|
+
* @param {vec2} a the first operand
|
|
139
|
+
* @param {vec2} b the second operand
|
|
140
|
+
* @returns {Number} dot product of a and b
|
|
141
|
+
*/
|
|
142
|
+
function dot$1(a, b) {
|
|
143
|
+
return a[0] * b[0] + a[1] * b[1]
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
var add = add_1;
|
|
147
|
+
var set = set_1;
|
|
148
|
+
var normalize = normalize_1;
|
|
149
|
+
var subtract = subtract_1;
|
|
150
|
+
var dot = dot_1;
|
|
151
|
+
|
|
152
|
+
var tmp = [0, 0];
|
|
153
|
+
|
|
154
|
+
polylineMiterUtil.computeMiter = function computeMiter(tangent, miter, lineA, lineB, halfThick) {
|
|
155
|
+
//get tangent line
|
|
156
|
+
add(tangent, lineA, lineB);
|
|
157
|
+
normalize(tangent, tangent);
|
|
158
|
+
|
|
159
|
+
//get miter as a unit vector
|
|
160
|
+
set(miter, -tangent[1], tangent[0]);
|
|
161
|
+
set(tmp, -lineA[1], lineA[0]);
|
|
162
|
+
|
|
163
|
+
//get the necessary length of our miter
|
|
164
|
+
return halfThick / dot(miter, tmp)
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
polylineMiterUtil.normal = function normal(out, dir) {
|
|
168
|
+
//get perpendicular
|
|
169
|
+
set(out, -dir[1], dir[0]);
|
|
170
|
+
return out
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
polylineMiterUtil.direction = function direction(out, a, b) {
|
|
174
|
+
//get unit dir of two lines
|
|
175
|
+
subtract(out, a, b);
|
|
176
|
+
normalize(out, out);
|
|
177
|
+
return out
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
var util = polylineMiterUtil;
|
|
181
|
+
|
|
182
|
+
var lineA = [0, 0];
|
|
183
|
+
var lineB = [0, 0];
|
|
184
|
+
var tangent = [0, 0];
|
|
185
|
+
var miter = [0, 0];
|
|
186
|
+
|
|
187
|
+
var polylineNormals = function(points, closed) {
|
|
188
|
+
var curNormal = null;
|
|
189
|
+
var out = [];
|
|
190
|
+
if (closed) {
|
|
191
|
+
points = points.slice();
|
|
192
|
+
points.push(points[0]);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
var total = points.length;
|
|
196
|
+
for (var i=1; i<total; i++) {
|
|
197
|
+
var last = points[i-1];
|
|
198
|
+
var cur = points[i];
|
|
199
|
+
var next = i<points.length-1 ? points[i+1] : null;
|
|
200
|
+
|
|
201
|
+
util.direction(lineA, cur, last);
|
|
202
|
+
if (!curNormal) {
|
|
203
|
+
curNormal = [0, 0];
|
|
204
|
+
util.normal(curNormal, lineA);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
if (i === 1) //add initial normals
|
|
208
|
+
addNext(out, curNormal, 1);
|
|
209
|
+
|
|
210
|
+
if (!next) { //no miter, simple segment
|
|
211
|
+
util.normal(curNormal, lineA); //reset normal
|
|
212
|
+
addNext(out, curNormal, 1);
|
|
213
|
+
} else { //miter with last
|
|
214
|
+
//get unit dir of next line
|
|
215
|
+
util.direction(lineB, next, cur);
|
|
216
|
+
|
|
217
|
+
//stores tangent & miter
|
|
218
|
+
var miterLen = util.computeMiter(tangent, miter, lineA, lineB, 1);
|
|
219
|
+
addNext(out, miter, miterLen);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
//if the polyline is a closed loop, clean up the last normal
|
|
224
|
+
if (points.length > 2 && closed) {
|
|
225
|
+
var last2 = points[total-2];
|
|
226
|
+
var cur2 = points[0];
|
|
227
|
+
var next2 = points[1];
|
|
228
|
+
|
|
229
|
+
util.direction(lineA, cur2, last2);
|
|
230
|
+
util.direction(lineB, next2, cur2);
|
|
231
|
+
util.normal(curNormal, lineA);
|
|
232
|
+
|
|
233
|
+
var miterLen2 = util.computeMiter(tangent, miter, lineA, lineB, 1);
|
|
234
|
+
out[0][0] = miter.slice();
|
|
235
|
+
out[total-1][0] = miter.slice();
|
|
236
|
+
out[0][1] = miterLen2;
|
|
237
|
+
out[total-1][1] = miterLen2;
|
|
238
|
+
out.pop();
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
return out
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
function addNext(out, normal, length) {
|
|
245
|
+
out.push([[normal[0], normal[1]], length]);
|
|
246
|
+
}
|
|
247
|
+
|
|
65
248
|
// 定义常量
|
|
66
249
|
const TRIANGLE_NUMBER_OF_RECTANGLE = 2; // 每个矩形有两个三角形
|
|
67
250
|
const VERTEX_NUMBER_OF_TRIANGLE = 3; // 每个三角形有三个顶点
|
|
@@ -69,10 +252,10 @@ const AXIS_NUMBER_OF_VERTEX = 3; // 每个顶点有三个轴坐标
|
|
|
69
252
|
const UV_NUMBER_OF_VERTEX = 2; // 每个顶点有两个 UV 轴坐标
|
|
70
253
|
function getLineGeometry(positionList) {
|
|
71
254
|
if (positionList.length < 2)
|
|
72
|
-
return;
|
|
73
|
-
const lineWidth =
|
|
74
|
-
const halfLineWidth =
|
|
75
|
-
const aspect =
|
|
255
|
+
return console.warn('positionList length must be greater than 1');
|
|
256
|
+
const lineWidth = 0.6;
|
|
257
|
+
const halfLineWidth = lineWidth / 2;
|
|
258
|
+
const aspect = 0.67; // 纵横比 width / height
|
|
76
259
|
// 点位向量数组
|
|
77
260
|
const keyPoints = positionList;
|
|
78
261
|
// 点位组成的平滑曲线
|
|
@@ -81,7 +264,7 @@ function getLineGeometry(positionList) {
|
|
|
81
264
|
const divisions = Math.ceil(curve.getLength()); // 曲线切片数
|
|
82
265
|
const curvePoints = curve.getPoints(divisions);
|
|
83
266
|
const curvePointsLength = curvePoints.length;
|
|
84
|
-
const normals =
|
|
267
|
+
const normals = polylineNormals(curvePoints.map((p) => [p.x, p.z])); // curvePoints:每个点切线的向量「二维」
|
|
85
268
|
const rectangleNumber = curvePoints.length - 1; // 曲线上 N 个点,构成了 N - 1 个矩形
|
|
86
269
|
const indexNumber = rectangleNumber * TRIANGLE_NUMBER_OF_RECTANGLE * VERTEX_NUMBER_OF_TRIANGLE;
|
|
87
270
|
const verticesNumber = 2 * curvePointsLength; // 顶点数量(包含公用):每个曲线点对应两个顶点,N 个 点有 2N 个顶点
|
|
@@ -127,7 +310,12 @@ function getLineGeometry(positionList) {
|
|
|
127
310
|
|
|
128
311
|
function getArrowMaterial(params) {
|
|
129
312
|
var _a;
|
|
130
|
-
const texture = new
|
|
313
|
+
// const texture = new THREE.TextureLoader().load(params?.textureUrl ?? '//vrlab-static.ljcdn.com/release/web/arrow.c5d028e4.png')
|
|
314
|
+
// const texture = new THREE.TextureLoader().load(params?.textureUrl ?? '//vrlab-static.ljcdn.com/release/web/arrow2.aa1762e4.png')
|
|
315
|
+
// const texture = new THREE.TextureLoader().load(params?.textureUrl ?? '//vrlab-static.ljcdn.com/release/web/arrow3.06c5b657.png')
|
|
316
|
+
// const texture = new THREE.TextureLoader().load(params?.textureUrl ?? '//vrlab-static.ljcdn.com/release/web/arrow4.b1427685.png')
|
|
317
|
+
// const texture = new THREE.TextureLoader().load(params?.textureUrl ?? '//vrlab-static.ljcdn.com/release/web/arrow5.ae49f3c8.png')
|
|
318
|
+
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');
|
|
131
319
|
texture.wrapS = texture.wrapT = THREE__namespace.RepeatWrapping;
|
|
132
320
|
texture.encoding = THREE__namespace.sRGBEncoding;
|
|
133
321
|
const arrowMaterial = new THREE__namespace.MeshBasicMaterial({
|
|
@@ -315,7 +503,7 @@ class Controller extends Controller$1 {
|
|
|
315
503
|
this.five.scene.remove(this.linesGroup);
|
|
316
504
|
const linesGroup = this.getLinesGroup(data.routes);
|
|
317
505
|
if (!linesGroup)
|
|
318
|
-
return
|
|
506
|
+
return;
|
|
319
507
|
this.linesGroup = linesGroup;
|
|
320
508
|
this.five.scene.add(linesGroup);
|
|
321
509
|
this.handleVisible(this.state.visible);
|
|
@@ -419,10 +607,10 @@ class Controller extends Controller$1 {
|
|
|
419
607
|
const geometry = getLineGeometry(positions);
|
|
420
608
|
if (!geometry)
|
|
421
609
|
return;
|
|
422
|
-
const material = getArrowMaterial({
|
|
610
|
+
const material = getArrowMaterial({ textureUrl: data.arrowTextureUrl });
|
|
423
611
|
const mesh = new THREE__namespace.Mesh(geometry, material);
|
|
424
612
|
mesh.name = pluginFlag('route-line-mesh');
|
|
425
|
-
mesh.renderOrder = 3
|
|
613
|
+
// mesh.renderOrder = 3
|
|
426
614
|
return mesh;
|
|
427
615
|
}
|
|
428
616
|
}
|
|
@@ -502,7 +690,15 @@ function linerValue(x0, v0, t1, t) {
|
|
|
502
690
|
return a * t + d;
|
|
503
691
|
}
|
|
504
692
|
|
|
505
|
-
|
|
693
|
+
function sleep(duration) {
|
|
694
|
+
return new Promise((resolve) => {
|
|
695
|
+
setTimeout(() => {
|
|
696
|
+
resolve();
|
|
697
|
+
}, duration);
|
|
698
|
+
});
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
const VERSION = 'v1.0.6';
|
|
506
702
|
const PLUGIN_NAME = 'CruisePlugin';
|
|
507
703
|
const PLUGIN = `${PLUGIN_NAME}@${VERSION}`;
|
|
508
704
|
const disposedErrorLog = () => {
|
|
@@ -532,7 +728,7 @@ class CruisePluginController extends Controller$1 {
|
|
|
532
728
|
speedConfig: {
|
|
533
729
|
rotateSpeed: 0.001,
|
|
534
730
|
rotateSpeedUnit: 'rad/ms',
|
|
535
|
-
moveSpeed: 0.
|
|
731
|
+
moveSpeed: 0.002,
|
|
536
732
|
moveSpeedUnit: 'm/ms',
|
|
537
733
|
},
|
|
538
734
|
},
|
|
@@ -748,12 +944,24 @@ class CruisePluginController extends Controller$1 {
|
|
|
748
944
|
if (data.keyframes) {
|
|
749
945
|
return {
|
|
750
946
|
keyframesId: uuid(),
|
|
751
|
-
keyframes: data.keyframes.map((keyframe, index) => {
|
|
947
|
+
keyframes: data.keyframes.map((keyframe, index) => {
|
|
948
|
+
var _a;
|
|
949
|
+
const nextKeyframe = data.keyframes[index + 1];
|
|
950
|
+
const stay = (() => {
|
|
951
|
+
if (!nextKeyframe)
|
|
952
|
+
return 0;
|
|
953
|
+
if (nextKeyframe.start === undefined || keyframe.end === undefined)
|
|
954
|
+
return 0;
|
|
955
|
+
return nextKeyframe.start - keyframe.end;
|
|
956
|
+
})();
|
|
957
|
+
return Object.assign({ id: (_a = keyframe.uuid) !== null && _a !== void 0 ? _a : uuid(), moveIndex: index, stay, index }, keyframe);
|
|
958
|
+
}),
|
|
752
959
|
};
|
|
753
960
|
}
|
|
754
961
|
else if (data.panoIndexList) {
|
|
755
962
|
let keyframes = [];
|
|
756
|
-
const moveEffect = data
|
|
963
|
+
const { moveEffect, moveToFirstPanoEffect } = data;
|
|
964
|
+
this.privateState.moveToFirstPanoEffect = moveToFirstPanoEffect;
|
|
757
965
|
data.panoIndexList
|
|
758
966
|
.filter((panoIndex, index) => panoIndex !== data.panoIndexList[index - 1])
|
|
759
967
|
.forEach((panoIndex, index) => {
|
|
@@ -774,13 +982,17 @@ class CruisePluginController extends Controller$1 {
|
|
|
774
982
|
})();
|
|
775
983
|
if (data.moveType === undefined || data.moveType === 'justMove') {
|
|
776
984
|
// move to panoIndex, latitude, longitude
|
|
777
|
-
keyframes.push({
|
|
985
|
+
keyframes.push({
|
|
986
|
+
moveIndex: index,
|
|
987
|
+
stay: data.stay,
|
|
988
|
+
data: Object.assign({ effect: 'Move', panoIndex, moveEffect }, (lookatNextPanoIndex !== null && lookatNextPanoIndex !== void 0 ? lookatNextPanoIndex : {})),
|
|
989
|
+
});
|
|
778
990
|
}
|
|
779
991
|
else if (data.moveType === 'moveAndRotate') {
|
|
780
992
|
// move to panoIndex, then rotate to latitude and longitude
|
|
781
|
-
keyframes.push({ data: { effect: 'Move', panoIndex, moveEffect } });
|
|
993
|
+
keyframes.push({ moveIndex: index, stay: data.stay, data: { effect: 'Move', panoIndex, moveEffect } });
|
|
782
994
|
if (lookatNextPanoIndex)
|
|
783
|
-
keyframes.push({ data: Object.assign({ effect: 'Rotate', panoIndex }, lookatNextPanoIndex) });
|
|
995
|
+
keyframes.push({ moveIndex: index, stay: data.stay, data: Object.assign({ effect: 'Rotate', panoIndex }, lookatNextPanoIndex) });
|
|
784
996
|
}
|
|
785
997
|
});
|
|
786
998
|
return { keyframesId: uuid(), keyframes: keyframes.map((keyframe, index) => (Object.assign({ id: uuid(), index }, keyframe))) };
|
|
@@ -845,6 +1057,7 @@ class CruisePluginController extends Controller$1 {
|
|
|
845
1057
|
if ((options === null || options === void 0 ? void 0 : options.notEmitEvent) !== true) {
|
|
846
1058
|
hooks.emit('play', { userAction: (_a = options === null || options === void 0 ? void 0 : options.userAction) !== null && _a !== void 0 ? _a : true });
|
|
847
1059
|
}
|
|
1060
|
+
let playedFirstKeyframe = false;
|
|
848
1061
|
const getPlayFromIndex = async () => {
|
|
849
1062
|
var _a, _b;
|
|
850
1063
|
// play from index
|
|
@@ -858,13 +1071,14 @@ class CruisePluginController extends Controller$1 {
|
|
|
858
1071
|
const pausedKeyframe = (_b = this.data) === null || _b === void 0 ? void 0 : _b.keyframes.find((keyframe) => keyframe.id === pauseData.keyframeId);
|
|
859
1072
|
// restore paused state
|
|
860
1073
|
if (pauseData === null || pauseData === void 0 ? void 0 : pauseData.fiveState)
|
|
861
|
-
await this.move(pauseData.fiveState);
|
|
1074
|
+
await this.move(pauseData.fiveState, { moveEffect: privateState.moveToFirstPanoEffect });
|
|
862
1075
|
if (pausedKeyframe) {
|
|
863
1076
|
if (pausedKeyframe.data.effect === 'Move')
|
|
864
1077
|
return pausedKeyframe.index;
|
|
865
1078
|
else if (pausedKeyframe.data.effect === 'Rotate') {
|
|
866
1079
|
const duration = pauseData.duration !== undefined ? pauseData.duration * (1 - pauseData.playedProgress) : undefined;
|
|
867
|
-
await this.playKeyframe(pausedKeyframe, duration);
|
|
1080
|
+
await this.playKeyframe(pausedKeyframe, { duration });
|
|
1081
|
+
playedFirstKeyframe = true;
|
|
868
1082
|
// playFromIndex += 1 cause played last part of paused keyframe
|
|
869
1083
|
return pausedKeyframe.index + 1;
|
|
870
1084
|
}
|
|
@@ -886,11 +1100,19 @@ class CruisePluginController extends Controller$1 {
|
|
|
886
1100
|
try {
|
|
887
1101
|
console.log('playIndexChange', keyframe.index);
|
|
888
1102
|
hooks.emit('playIndexChange', keyframe.index, keyframe);
|
|
889
|
-
|
|
1103
|
+
console.log({ playFromIndex });
|
|
1104
|
+
await this.playKeyframe(keyframe, {
|
|
1105
|
+
moveEffect: playedFirstKeyframe === false ? privateState.moveToFirstPanoEffect : undefined,
|
|
1106
|
+
duration: 800,
|
|
1107
|
+
});
|
|
1108
|
+
if (keyframe.stay)
|
|
1109
|
+
await sleep(keyframe.stay);
|
|
1110
|
+
if (playedFirstKeyframe === false)
|
|
1111
|
+
playedFirstKeyframe = true;
|
|
890
1112
|
}
|
|
891
1113
|
catch (error) {
|
|
892
1114
|
return Promise.resolve('broke');
|
|
893
|
-
// if think play be interupted by five gesture is an error, return Promise.reject(error)
|
|
1115
|
+
// if think the play be interupted by five gesture is an error, return Promise.reject(error)
|
|
894
1116
|
// return Promise.reject(error)
|
|
895
1117
|
}
|
|
896
1118
|
}
|
|
@@ -922,12 +1144,12 @@ class CruisePluginController extends Controller$1 {
|
|
|
922
1144
|
/**
|
|
923
1145
|
* @description Play single keyframe
|
|
924
1146
|
*/
|
|
925
|
-
async playKeyframe(keyframe,
|
|
1147
|
+
async playKeyframe(keyframe, params) {
|
|
926
1148
|
var _a;
|
|
927
1149
|
const { privateState } = this;
|
|
928
1150
|
if (((_a = this.privateState.currentPlayKeyframe) === null || _a === void 0 ? void 0 : _a.keyframe.id) !== keyframe.id)
|
|
929
1151
|
this.privateState.currentPlayKeyframe = { keyframe };
|
|
930
|
-
privateState.currentPlayQueue.push(this.getPlayPromise(keyframe,
|
|
1152
|
+
privateState.currentPlayQueue.push(this.getPlayPromise(keyframe, params));
|
|
931
1153
|
return this.actionPromiseQueue();
|
|
932
1154
|
}
|
|
933
1155
|
/**
|
|
@@ -944,9 +1166,10 @@ class CruisePluginController extends Controller$1 {
|
|
|
944
1166
|
/**
|
|
945
1167
|
* @description: getPlayPromise
|
|
946
1168
|
*/
|
|
947
|
-
async getPlayPromise(keyframe,
|
|
1169
|
+
async getPlayPromise(keyframe, params) {
|
|
1170
|
+
var _a;
|
|
948
1171
|
const data = keyframe.data;
|
|
949
|
-
|
|
1172
|
+
(_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);
|
|
950
1173
|
if (!data)
|
|
951
1174
|
return;
|
|
952
1175
|
return new Promise((resolve, reject) => {
|
|
@@ -970,13 +1193,13 @@ class CruisePluginController extends Controller$1 {
|
|
|
970
1193
|
};
|
|
971
1194
|
switch (data.effect) {
|
|
972
1195
|
case 'Move':
|
|
973
|
-
this.move(data,
|
|
1196
|
+
this.move(data, params).then(res);
|
|
974
1197
|
break;
|
|
975
1198
|
case 'Rotate':
|
|
976
|
-
this.rotate(data,
|
|
1199
|
+
this.rotate(data, params).then(res);
|
|
977
1200
|
break;
|
|
978
1201
|
default:
|
|
979
|
-
this.rotate(data,
|
|
1202
|
+
this.rotate(data, params).then(res);
|
|
980
1203
|
}
|
|
981
1204
|
}
|
|
982
1205
|
catch (e) { }
|
|
@@ -1007,13 +1230,13 @@ class CruisePluginController extends Controller$1 {
|
|
|
1007
1230
|
/**
|
|
1008
1231
|
* @description Action move keyframe
|
|
1009
1232
|
*/
|
|
1010
|
-
async move(data,
|
|
1233
|
+
async move(data, params) {
|
|
1011
1234
|
console.log('--move--', data.panoIndex);
|
|
1012
1235
|
if (data.mode && data.mode !== this.five.currentMode) {
|
|
1013
1236
|
await this.changeMode(data);
|
|
1014
1237
|
}
|
|
1015
1238
|
else if (data.panoIndex !== this.five.panoIndex) {
|
|
1016
|
-
await this.changePano(data,
|
|
1239
|
+
await this.changePano(data, params);
|
|
1017
1240
|
}
|
|
1018
1241
|
else {
|
|
1019
1242
|
return Promise.resolve();
|
|
@@ -1023,15 +1246,15 @@ class CruisePluginController extends Controller$1 {
|
|
|
1023
1246
|
/**
|
|
1024
1247
|
* @description Action rotate keyframe
|
|
1025
1248
|
*/
|
|
1026
|
-
async rotate(data,
|
|
1249
|
+
async rotate(data, params) {
|
|
1027
1250
|
console.log('--rotate--', data);
|
|
1028
1251
|
if (data.mode && data.mode !== this.five.currentMode) {
|
|
1029
1252
|
await this.changeMode({ mode: data.mode, panoIndex: data.panoIndex });
|
|
1030
1253
|
}
|
|
1031
1254
|
else if (data.panoIndex && data.panoIndex !== this.five.panoIndex) {
|
|
1032
|
-
return await this.changePano(data,
|
|
1255
|
+
return await this.changePano(data, params);
|
|
1033
1256
|
}
|
|
1034
|
-
await this.updateCamera(data, duration);
|
|
1257
|
+
await this.updateCamera(data, params === null || params === void 0 ? void 0 : params.duration);
|
|
1035
1258
|
}
|
|
1036
1259
|
/**
|
|
1037
1260
|
* @description Update five camera
|
|
@@ -1066,13 +1289,14 @@ class CruisePluginController extends Controller$1 {
|
|
|
1066
1289
|
/**
|
|
1067
1290
|
* @description: Change five pano
|
|
1068
1291
|
*/
|
|
1069
|
-
async changePano(data,
|
|
1292
|
+
async changePano(data, params) {
|
|
1293
|
+
var _a;
|
|
1070
1294
|
const { five, privateState, state } = this;
|
|
1071
1295
|
if (typeof data.panoIndex !== 'number')
|
|
1072
1296
|
return;
|
|
1073
1297
|
if (data.panoIndex === five.panoIndex)
|
|
1074
1298
|
return;
|
|
1075
|
-
let originDuration =
|
|
1299
|
+
let originDuration = (_a = params === null || params === void 0 ? void 0 : params.duration) !== null && _a !== void 0 ? _a : 800;
|
|
1076
1300
|
const speed = (() => {
|
|
1077
1301
|
var _a, _b;
|
|
1078
1302
|
const speedConfig = (_a = state.config) === null || _a === void 0 ? void 0 : _a.speedConfig;
|
|
@@ -1093,13 +1317,13 @@ class CruisePluginController extends Controller$1 {
|
|
|
1093
1317
|
privateState.currentPlayKeyframe.originDuration = originDuration;
|
|
1094
1318
|
const duration = this.getSpeededDuration(originDuration);
|
|
1095
1319
|
return new Promise((resolve) => {
|
|
1096
|
-
var _a, _b;
|
|
1320
|
+
var _a, _b, _c;
|
|
1097
1321
|
five.moveToPano(data.panoIndex, {
|
|
1098
1322
|
latitude: data.latitude,
|
|
1099
1323
|
longitude: data.longitude,
|
|
1100
1324
|
fov: data.fov,
|
|
1101
1325
|
duration,
|
|
1102
|
-
effect: (
|
|
1326
|
+
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,
|
|
1103
1327
|
moveCancelCallback: () => resolve(),
|
|
1104
1328
|
moveEndCallback: () => resolve(),
|
|
1105
1329
|
});
|
|
@@ -1116,7 +1340,7 @@ class CruisePluginController extends Controller$1 {
|
|
|
1116
1340
|
try {
|
|
1117
1341
|
const duration = currentPlayKeyframe.originDuration !== undefined ? currentPlayKeyframe.originDuration * (1 - this.getProgress()) : undefined;
|
|
1118
1342
|
console.log('--speedChange--', speed, { duration });
|
|
1119
|
-
const promise = this.playKeyframe(currentPlayKeyframe.keyframe, duration);
|
|
1343
|
+
const promise = this.playKeyframe(currentPlayKeyframe.keyframe, { duration });
|
|
1120
1344
|
privateState.currentPlayQueue.push(promise);
|
|
1121
1345
|
}
|
|
1122
1346
|
catch (e) { }
|
|
@@ -2,7 +2,7 @@ import type { MovePanoOptions, Pose, State } from '@realsee/five';
|
|
|
2
2
|
import type CruisePlugin from '.';
|
|
3
3
|
import type * as BasePluginWithData from '../base/BasePluginWithData';
|
|
4
4
|
declare type FivePoseAndState = Partial<Pose> & Partial<State>;
|
|
5
|
-
declare type MoveEffect = MovePanoOptions['effect'];
|
|
5
|
+
export declare type MoveEffect = MovePanoOptions['effect'];
|
|
6
6
|
export declare type CruiseData = {
|
|
7
7
|
/** 移动/旋转 */
|
|
8
8
|
effect: 'Move' | 'Rotate';
|
|
@@ -16,6 +16,8 @@ export declare type CruiseData = {
|
|
|
16
16
|
export interface CruiseKeyframe {
|
|
17
17
|
id: string;
|
|
18
18
|
index: number;
|
|
19
|
+
moveIndex: number;
|
|
20
|
+
stay?: number;
|
|
19
21
|
start?: number;
|
|
20
22
|
end?: number;
|
|
21
23
|
data: CruiseData;
|
|
@@ -39,13 +41,21 @@ export interface PluginServerData extends BasePluginWithData.ServerData {
|
|
|
39
41
|
moveEffect?: undefined;
|
|
40
42
|
/** for ts check, no care */
|
|
41
43
|
moveType?: undefined;
|
|
44
|
+
/** for ts check, no care */
|
|
45
|
+
moveToFirstPanoEffect?: undefined;
|
|
46
|
+
/** for ts check, no care */
|
|
47
|
+
stay?: undefined;
|
|
42
48
|
} | {
|
|
43
49
|
/** 点位列表 */
|
|
44
50
|
panoIndexList: number[];
|
|
45
51
|
/** five走点动画 */
|
|
46
52
|
moveEffect?: MoveEffect;
|
|
53
|
+
/** 到第一个点的走点动画 / 续播到暂停处的走点动画 */
|
|
54
|
+
moveToFirstPanoEffect?: MoveEffect;
|
|
47
55
|
/** 漫游方式:justMove 为移动到指定点位,且朝向为下一个点的朝向;moveAndRotate 为先移动到指定点位且朝向不变,然后旋转到下一个点的朝向 */
|
|
48
56
|
moveType?: 'justMove' | 'moveAndRotate';
|
|
57
|
+
/** 停留时长 */
|
|
58
|
+
stay?: number;
|
|
49
59
|
/** for ts check, no care */
|
|
50
60
|
keyframes?: undefined;
|
|
51
61
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function sleep(duration: number): Promise<void>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { FivePlugin } from '@realsee/five';
|
|
2
2
|
import CruisePluginController from './Controller';
|
|
3
|
-
export * from './typing';
|
|
4
3
|
export { CruisePluginController };
|
|
5
|
-
declare const CruisePlugin: FivePlugin<void, InstanceType<typeof CruisePluginController>>;
|
|
6
|
-
export {
|
|
4
|
+
export declare const CruisePlugin: FivePlugin<void, InstanceType<typeof CruisePluginController>>;
|
|
5
|
+
export type { CruisePluginExportType } from './typing';
|
|
7
6
|
export default CruisePlugin;
|
|
@@ -2,7 +2,7 @@ import type { MovePanoOptions, Pose, State } from '@realsee/five';
|
|
|
2
2
|
import type CruisePlugin from '.';
|
|
3
3
|
import type * as BasePluginWithData from '../base/BasePluginWithData';
|
|
4
4
|
declare type FivePoseAndState = Partial<Pose> & Partial<State>;
|
|
5
|
-
declare type MoveEffect = MovePanoOptions['effect'];
|
|
5
|
+
export declare type MoveEffect = MovePanoOptions['effect'];
|
|
6
6
|
export declare type CruiseData = {
|
|
7
7
|
/** 移动/旋转 */
|
|
8
8
|
effect: 'Move' | 'Rotate';
|
|
@@ -16,6 +16,8 @@ export declare type CruiseData = {
|
|
|
16
16
|
export interface CruiseKeyframe {
|
|
17
17
|
id: string;
|
|
18
18
|
index: number;
|
|
19
|
+
moveIndex: number;
|
|
20
|
+
stay?: number;
|
|
19
21
|
start?: number;
|
|
20
22
|
end?: number;
|
|
21
23
|
data: CruiseData;
|
|
@@ -39,13 +41,21 @@ export interface PluginServerData extends BasePluginWithData.ServerData {
|
|
|
39
41
|
moveEffect?: undefined;
|
|
40
42
|
/** for ts check, no care */
|
|
41
43
|
moveType?: undefined;
|
|
44
|
+
/** for ts check, no care */
|
|
45
|
+
moveToFirstPanoEffect?: undefined;
|
|
46
|
+
/** for ts check, no care */
|
|
47
|
+
stay?: undefined;
|
|
42
48
|
} | {
|
|
43
49
|
/** 点位列表 */
|
|
44
50
|
panoIndexList: number[];
|
|
45
51
|
/** five走点动画 */
|
|
46
52
|
moveEffect?: MoveEffect;
|
|
53
|
+
/** 到第一个点的走点动画 / 续播到暂停处的走点动画 */
|
|
54
|
+
moveToFirstPanoEffect?: MoveEffect;
|
|
47
55
|
/** 漫游方式:justMove 为移动到指定点位,且朝向为下一个点的朝向;moveAndRotate 为先移动到指定点位且朝向不变,然后旋转到下一个点的朝向 */
|
|
48
56
|
moveType?: 'justMove' | 'moveAndRotate';
|
|
57
|
+
/** 停留时长 */
|
|
58
|
+
stay?: number;
|
|
49
59
|
/** for ts check, no care */
|
|
50
60
|
keyframes?: undefined;
|
|
51
61
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function sleep(duration: number): Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
|
-
export default function getLineGeometry(positionList: THREE.Vector3[]): THREE.BufferGeometry;
|
|
2
|
+
export default function getLineGeometry(positionList: THREE.Vector3[]): void | THREE.BufferGeometry;
|