@realsee/dnalogel 2.0.0-alpha.16 → 2.0.0-alpha.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/CSS3DRenderPlugin/index.d.ts +2 -2
- package/dist/CameraMovementPlugin/index.js +15 -40
- package/dist/CameraMovementPlugin/typing.d.ts +1 -1
- package/dist/ModelChassisCompassPlugin/index.js +3 -28
- package/dist/ModelEntryDoorGuidePlugin/index.d.ts +1 -1
- package/dist/ModelEntryDoorGuidePlugin/index.js +8 -33
- package/dist/ModelItemLabelPlugin/events.type.d.ts +2 -2
- package/dist/ModelItemLabelPlugin/index.js +8 -8
- package/dist/ModelItemLabelPlugin/typings.d.ts +2 -2
- package/dist/ModelItemLabelPlugin/utils/parseData.d.ts +1 -1
- package/dist/ModelRoomLabelPlugin/index.js +6 -6
- package/dist/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
- package/dist/ModelTVVideoPlugin/index.d.ts +1 -1
- package/dist/ModelTVVideoPlugin/index.js +3 -28
- package/dist/PanoCompassPlugin/index.js +53 -86
- package/dist/PanoCursorRaycasterPlugin/index.d.ts +1 -1
- package/dist/PanoMeasurePlugin/Controller/BaseController.d.ts +8 -8
- package/dist/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
- package/dist/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +2 -2
- package/dist/PanoMeasurePlugin/Controller/WatchController.d.ts +1 -1
- package/dist/PanoMeasurePlugin/Controller/index.d.ts +3 -3
- package/dist/PanoMeasurePlugin/Model/index.d.ts +2 -2
- package/dist/PanoMeasurePlugin/Model/line.d.ts +5 -5
- package/dist/PanoMeasurePlugin/Model/point.d.ts +2 -2
- package/dist/PanoMeasurePlugin/Model/polyline.d.ts +3 -3
- package/dist/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +2 -2
- package/dist/PanoMeasurePlugin/Modules/FiveHelper.d.ts +1 -1
- package/dist/PanoMeasurePlugin/Modules/GuideController.d.ts +1 -1
- package/dist/PanoMeasurePlugin/Modules/Magnifier.d.ts +1 -1
- package/dist/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +1 -1
- package/dist/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +2 -1
- package/dist/PanoMeasurePlugin/Modules/UIController/index.d.ts +1 -1
- package/dist/PanoMeasurePlugin/index.d.ts +1 -1
- package/dist/PanoMeasurePlugin/index.js +1 -21
- package/dist/PanoMeasurePlugin/typings/event.type.d.ts +4 -4
- package/dist/PanoMeasurePlugin/utils/clearGroup.d.ts +1 -1
- package/dist/PanoMeasurePlugin/utils/constants.d.ts +1 -1
- package/dist/PanoMeasurePlugin/utils/distanceDom.d.ts +3 -3
- package/dist/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +1 -1
- package/dist/PanoMeasurePlugin/utils/findClosestPoint.d.ts +3 -3
- package/dist/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +2 -2
- package/dist/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +1 -1
- package/dist/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +1 -1
- package/dist/PanoMeasurePlugin/utils/line.d.ts +1 -1
- package/dist/PanoRulerPlugin/index.d.ts +1 -1
- package/dist/PanoRulerPlugin/index.js +3 -28
- package/dist/PanoSpatialTagPlugin/index.js +11 -11
- package/dist/PanoSpatialTagPlugin/typings.d.ts +1 -1
- package/dist/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.d.ts +0 -0
- package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +2 -2
- package/dist/floorplan/ModelFloorplanPlugin/index.js +1266 -1298
- package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +81 -204
- package/dist/floorplan/TopviewFloorplanPlugin/Controller.d.ts +28 -15
- package/dist/floorplan/TopviewFloorplanPlugin/index.d.ts +1 -1
- package/dist/floorplan/TopviewFloorplanPlugin/index.js +1257 -1250
- package/dist/floorplan/utils/formatPosition.d.ts +1 -1
- package/dist/index.es.js +1480 -1507
- package/dist/index.js +1477 -1504
- package/dist/index.umd.js +1477 -1504
- package/dist/shared-utils/three/getExtraModelLoader.d.ts +1 -1
- package/dist/shared-utils/three/getNormal.d.ts +1 -1
- package/dist/shared-utils/three/getTextureLoader.d.ts +1 -1
- package/dist/shared-utils/three/loadFbxObj.d.ts +1 -1
- package/dist/shared-utils/vectorTocoordinates.d.ts +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/ModelRoomLabelController.html +6 -6
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
- package/docs/enums/ModelFloorplanErrorType.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/ModelFloorplanParameterType.html +1 -1
- package/docs/interfaces/ModelFloorplanViewEvent.html +2 -2
- 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/PanoCompassPluginData.html +1 -1
- package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
- package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
- package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
- package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
- package/docs/interfaces/PointJson.html +1 -1
- package/docs/interfaces/RoomLabel.html +7 -7
- package/docs/interfaces/TopviewFloorplanPluginParameterType.html +19 -1
- package/docs/modules.html +12 -12
- package/libs/CSS3DRenderPlugin/index.d.ts +2 -2
- package/libs/CameraMovementPlugin/index.js +15 -24
- package/libs/CameraMovementPlugin/typing.d.ts +1 -1
- package/libs/ModelChassisCompassPlugin/index.js +3 -12
- package/libs/ModelEntryDoorGuidePlugin/index.d.ts +1 -1
- package/libs/ModelEntryDoorGuidePlugin/index.js +8 -17
- package/libs/ModelItemLabelPlugin/events.type.d.ts +2 -2
- package/libs/ModelItemLabelPlugin/typings.d.ts +2 -2
- package/libs/ModelItemLabelPlugin/utils/parseData.d.ts +1 -1
- package/libs/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
- package/libs/ModelTVVideoPlugin/index.d.ts +1 -1
- package/libs/ModelTVVideoPlugin/index.js +3 -12
- package/libs/ModelTVVideoPlugin/typings.js +1 -0
- package/libs/PanoCompassPlugin/index.js +49 -64
- package/libs/PanoCursorRaycasterPlugin/index.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Controller/BaseController.d.ts +8 -8
- package/libs/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Controller/EditController.js +1 -1
- package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +2 -2
- package/libs/PanoMeasurePlugin/Controller/WatchController.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Controller/index.d.ts +3 -3
- package/libs/PanoMeasurePlugin/Model/index.d.ts +2 -2
- package/libs/PanoMeasurePlugin/Model/line.d.ts +5 -5
- package/libs/PanoMeasurePlugin/Model/line.js +1 -1
- package/libs/PanoMeasurePlugin/Model/point.d.ts +2 -2
- package/libs/PanoMeasurePlugin/Model/polyline.d.ts +3 -3
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +2 -2
- package/libs/PanoMeasurePlugin/Modules/FiveHelper.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/GuideController.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/Magnifier.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +2 -1
- package/libs/PanoMeasurePlugin/Modules/UIController/index.d.ts +1 -1
- package/libs/PanoMeasurePlugin/index.d.ts +1 -1
- package/libs/PanoMeasurePlugin/typings/event.type.d.ts +4 -4
- package/libs/PanoMeasurePlugin/utils/clearGroup.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/constants.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/distanceDom.d.ts +3 -3
- package/libs/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/findClosestPoint.d.ts +3 -3
- package/libs/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +2 -2
- package/libs/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/line.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/mouseGroup.js +1 -0
- package/libs/PanoRulerPlugin/index.d.ts +1 -1
- package/libs/PanoRulerPlugin/index.js +3 -12
- package/libs/PanoSpatialTagPlugin/typings.d.ts +1 -1
- package/libs/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.d.ts +0 -0
- package/libs/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.js +0 -0
- package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/Camera.js +2 -2
- package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/Compass.js +0 -0
- package/libs/floorplan/{ModelFloorplanPlugin/Components/CurrentFloor → Components}/CurrentFloor.js +73 -80
- package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/Main.js +186 -105
- package/libs/floorplan/Components/RoomHighlight/Room.js +5 -7
- package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +24 -116
- package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/RoomLabels/RoomLabel.js +0 -0
- package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/RoomLabels/RoomLabels.js +2 -2
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +26 -22
- package/libs/floorplan/Components/RuleLabels/RuleItem.js +284 -0
- package/libs/floorplan/{ModelFloorplanPlugin/Components → Components}/RuleLabels/RuleLabels.js +82 -32
- package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +2 -2
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +34 -43
- package/libs/floorplan/ModelFloorplanPlugin/utils/correctFiveState.js +22 -33
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +3 -12
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.d.ts +28 -15
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +80 -54
- package/libs/floorplan/TopviewFloorplanPlugin/index.d.ts +1 -1
- package/libs/floorplan/TopviewFloorplanPlugin/style.js +0 -1
- package/libs/floorplan/utils/formatData.js +28 -43
- package/libs/floorplan/utils/formatPosition.d.ts +1 -1
- package/libs/floorplan/utils/formatPosition.js +2 -2
- package/libs/shared-utils/five/changeMode.js +12 -23
- package/libs/shared-utils/three/getExtraModelLoader.d.ts +1 -1
- package/libs/shared-utils/three/getNormal.d.ts +1 -1
- package/libs/shared-utils/three/getTextureLoader.d.ts +1 -1
- package/libs/shared-utils/three/loadFbxObj.d.ts +1 -1
- package/libs/shared-utils/three/loadFbxObj.js +9 -20
- package/libs/shared-utils/three/loadTexture.js +6 -17
- package/libs/shared-utils/to.js +10 -21
- package/libs/shared-utils/vectorTocoordinates.d.ts +1 -1
- package/package.json +3 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.js +0 -301
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
1
|
import { Five } from '@realsee/five';
|
|
11
2
|
import * as TWEEN from '@tweenjs/tween.js';
|
|
12
3
|
import { tweenProgress } from '../shared-utils/animationFrame/tween';
|
|
@@ -38,21 +29,21 @@ const getLongitudeParams = (from, to, rotation) => {
|
|
|
38
29
|
*/
|
|
39
30
|
export const CameraMovementPlugin = (five) => {
|
|
40
31
|
const state = {};
|
|
41
|
-
const move = (args, duration, opts = { preload: true }) =>
|
|
32
|
+
const move = async (args, duration, opts = { preload: true }) => {
|
|
42
33
|
if (state.interruptCallback) {
|
|
43
34
|
state.interruptCallback(false);
|
|
44
35
|
}
|
|
45
36
|
if (opts.asyncStartCallback) {
|
|
46
|
-
|
|
37
|
+
await opts.asyncStartCallback();
|
|
47
38
|
}
|
|
48
39
|
if (args.mode && args.mode !== five.currentMode) {
|
|
49
|
-
|
|
40
|
+
await five.changeMode(args.mode);
|
|
50
41
|
}
|
|
51
42
|
if (opts.preload && args.panoIndex !== undefined && args.panoIndex !== five.panoIndex) {
|
|
52
|
-
|
|
43
|
+
await five.preloadPano(args.panoIndex);
|
|
53
44
|
}
|
|
54
45
|
if (opts.asyncEndCallback) {
|
|
55
|
-
|
|
46
|
+
await opts.asyncEndCallback();
|
|
56
47
|
}
|
|
57
48
|
if (args.panoIndex === undefined &&
|
|
58
49
|
args.fov === undefined &&
|
|
@@ -60,7 +51,7 @@ export const CameraMovementPlugin = (five) => {
|
|
|
60
51
|
args.longitude === undefined) {
|
|
61
52
|
return true;
|
|
62
53
|
}
|
|
63
|
-
return
|
|
54
|
+
return await new Promise((resolve, reject) => {
|
|
64
55
|
const panoIndex = args.panoIndex !== undefined ? args.panoIndex : five.panoIndex;
|
|
65
56
|
if (panoIndex !== undefined) {
|
|
66
57
|
five.moveToPano(panoIndex, Object.assign({
|
|
@@ -73,7 +64,7 @@ export const CameraMovementPlugin = (five) => {
|
|
|
73
64
|
reject(false);
|
|
74
65
|
}
|
|
75
66
|
});
|
|
76
|
-
}
|
|
67
|
+
};
|
|
77
68
|
const getAnimeParams = (args) => {
|
|
78
69
|
const currentFiveState = five.state;
|
|
79
70
|
// latitude
|
|
@@ -89,20 +80,20 @@ export const CameraMovementPlugin = (five) => {
|
|
|
89
80
|
to: { latitude: toLatitude, longitude: toLongitude, fov: toFov },
|
|
90
81
|
};
|
|
91
82
|
};
|
|
92
|
-
const rotate = (args, duration, opts = {}) =>
|
|
83
|
+
const rotate = async (args, duration, opts = {}) => {
|
|
93
84
|
if (state.interruptCallback) {
|
|
94
85
|
state.interruptCallback(false);
|
|
95
86
|
}
|
|
96
87
|
if (opts.asyncStartCallback) {
|
|
97
|
-
|
|
88
|
+
await opts.asyncStartCallback();
|
|
98
89
|
}
|
|
99
90
|
if (five.currentMode !== Five.Mode.Panorama) {
|
|
100
|
-
|
|
91
|
+
await five.changeMode(Five.Mode.Panorama);
|
|
101
92
|
}
|
|
102
93
|
if (args.panoIndex !== undefined && args.panoIndex !== five.panoIndex) {
|
|
103
94
|
if (opts.preload)
|
|
104
|
-
|
|
105
|
-
|
|
95
|
+
await five.preloadPano(args.panoIndex);
|
|
96
|
+
await new Promise((resolve, reject) => {
|
|
106
97
|
if (!args.panoIndex) {
|
|
107
98
|
resolve(true);
|
|
108
99
|
return;
|
|
@@ -114,10 +105,10 @@ export const CameraMovementPlugin = (five) => {
|
|
|
114
105
|
});
|
|
115
106
|
}
|
|
116
107
|
if (opts.asyncEndCallback) {
|
|
117
|
-
|
|
108
|
+
await opts.asyncEndCallback();
|
|
118
109
|
}
|
|
119
110
|
const { from, to } = getAnimeParams(args);
|
|
120
|
-
return
|
|
111
|
+
return await new Promise((resolve) => {
|
|
121
112
|
const onUpdate = ({ progress }) => {
|
|
122
113
|
const state = {};
|
|
123
114
|
state.longitude = progressNumber(from.longitude, to.longitude, progress);
|
|
@@ -159,7 +150,7 @@ export const CameraMovementPlugin = (five) => {
|
|
|
159
150
|
state.interruptCallback(true);
|
|
160
151
|
}, duration);
|
|
161
152
|
});
|
|
162
|
-
}
|
|
153
|
+
};
|
|
163
154
|
return {
|
|
164
155
|
move,
|
|
165
156
|
rotate,
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
1
|
import * as THREE from 'three';
|
|
11
2
|
import { FBXLoader } from 'three/examples/jsm/loaders/FBXLoader';
|
|
12
3
|
import object3d2LocalMatrix from '../shared-utils/object3d2LocalMatrix';
|
|
@@ -19,7 +10,7 @@ export const ModelChassisCompassPlugin = (five, params) => {
|
|
|
19
10
|
const defaultNorthRad = params.north_rad || undefined;
|
|
20
11
|
// 局部状态
|
|
21
12
|
const state = {};
|
|
22
|
-
const load = (data) =>
|
|
13
|
+
const load = async (data) => {
|
|
23
14
|
const fbxUrl = (data === null || data === void 0 ? void 0 : data.fbx_url) || defaultFbxUrl;
|
|
24
15
|
const northRad = (data === null || data === void 0 ? void 0 : data.north_rad) || defaultNorthRad;
|
|
25
16
|
if (!northRad) {
|
|
@@ -30,7 +21,7 @@ export const ModelChassisCompassPlugin = (five, params) => {
|
|
|
30
21
|
const zOffset = bounding.max.z - bounding.min.z;
|
|
31
22
|
const maxOffset = Math.max(xOffset, zOffset);
|
|
32
23
|
const fbxLoader = new FBXLoader();
|
|
33
|
-
const object =
|
|
24
|
+
const object = await fbxLoader.loadAsync(fbxUrl);
|
|
34
25
|
transfromToMeshBasicMaterial(object, {
|
|
35
26
|
transparent: true,
|
|
36
27
|
side: THREE.DoubleSide,
|
|
@@ -44,7 +35,7 @@ export const ModelChassisCompassPlugin = (five, params) => {
|
|
|
44
35
|
object3d2LocalMatrix(object, { position, rotation, scale });
|
|
45
36
|
state.object = object;
|
|
46
37
|
return true;
|
|
47
|
-
}
|
|
38
|
+
};
|
|
48
39
|
const onCameraUpdate = ({ latitude }) => {
|
|
49
40
|
if (!state.object)
|
|
50
41
|
return;
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
1
|
import { AnimationMixer, MeshBasicMaterial } from 'three';
|
|
11
2
|
import * as THREE from 'three';
|
|
12
3
|
import { FBXLoader } from 'three/examples/jsm/loaders/FBXLoader';
|
|
@@ -25,25 +16,25 @@ export const ModelEntryDoorGuidePlugin = (five, params) => {
|
|
|
25
16
|
const defaultRad = (_c = params.rad) !== null && _c !== void 0 ? _c : undefined;
|
|
26
17
|
const defaultFbxUrl = params.fbx_url || '//vrlab-image4.ljcdn.com/release/web/entryDoorMini/Anim_Door1.fbx';
|
|
27
18
|
const mixers = [];
|
|
28
|
-
const load = (data) =>
|
|
29
|
-
var
|
|
30
|
-
const position = (
|
|
19
|
+
const load = async (data) => {
|
|
20
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
21
|
+
const position = (_a = data === null || data === void 0 ? void 0 : data.position) !== null && _a !== void 0 ? _a : defaultModelPosition;
|
|
31
22
|
if (!position)
|
|
32
23
|
return Promise.reject(`ModelEntryDoorGuidePlugin.load(): position is undefined`);
|
|
33
24
|
const modelPosition = transformPositionToVector3(position);
|
|
34
|
-
const rad = (
|
|
35
|
-
const fbxUrl = (
|
|
25
|
+
const rad = (_b = data === null || data === void 0 ? void 0 : data.rad) !== null && _b !== void 0 ? _b : defaultRad;
|
|
26
|
+
const fbxUrl = (_c = data === null || data === void 0 ? void 0 : data.fbx_url) !== null && _c !== void 0 ? _c : defaultFbxUrl;
|
|
36
27
|
state.rad = rad;
|
|
37
28
|
if (rad === undefined)
|
|
38
29
|
return Promise.reject(`ModelEntryDoorGuidePlugin.load(): rad is ${rad}`);
|
|
39
30
|
// 加载模型
|
|
40
|
-
const object =
|
|
31
|
+
const object = await new FBXLoader().loadAsync(fbxUrl);
|
|
41
32
|
// 设置位置
|
|
42
33
|
object.position.copy(modelPosition);
|
|
43
34
|
object.rotation.z = rad;
|
|
44
35
|
object.scale.set(0.8, 0.8, 0.8);
|
|
45
36
|
transfromToMeshBasicMaterial(object, { transparent: true, side: THREE.DoubleSide });
|
|
46
|
-
const textMesh = (
|
|
37
|
+
const textMesh = (_g = (_f = (_e = (_d = object.children) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.children) === null || _f === void 0 ? void 0 : _f[3]) === null || _g === void 0 ? void 0 : _g.clone();
|
|
47
38
|
if (!textMesh)
|
|
48
39
|
return Promise.reject(`ModelEntryDoorGuidePlugin.load(): textMesh is ${textMesh}`);
|
|
49
40
|
textMesh.material = new MeshBasicMaterial({ transparent: true, map: createCanvasTextTexture('入户门') });
|
|
@@ -51,7 +42,7 @@ export const ModelEntryDoorGuidePlugin = (five, params) => {
|
|
|
51
42
|
object.children[0].add(textMesh);
|
|
52
43
|
state.object = object;
|
|
53
44
|
return true;
|
|
54
|
-
}
|
|
45
|
+
};
|
|
55
46
|
const initAnimation = () => {
|
|
56
47
|
if (state.animation)
|
|
57
48
|
return;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SubscribeEventMap } from '@realsee/five';
|
|
2
|
-
import { ItemLabel } from "./typings";
|
|
1
|
+
import type { SubscribeEventMap } from '@realsee/five';
|
|
2
|
+
import type { ItemLabel } from "./typings";
|
|
3
3
|
export interface ItemLabelEvent extends SubscribeEventMap {
|
|
4
4
|
/**
|
|
5
5
|
* 点击标签
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import ItemLabelComponent from './ItemLabelComponent';
|
|
2
1
|
import type { Subscribe } from "@realsee/five";
|
|
3
|
-
import { PluginEvent } from "./events.type";
|
|
2
|
+
import type { PluginEvent } from "./events.type";
|
|
3
|
+
import type ItemLabelComponent from './ItemLabelComponent';
|
|
4
4
|
export declare enum DISPLAY_STRATEGY_TYPE {
|
|
5
5
|
SMALL = "small",
|
|
6
6
|
MIDLLE = "middle",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { FivePlugin } from '@realsee/five';
|
|
2
|
-
import { ModelTVVideoPluginExportType, ModelTVVideoPluginParameterType } from "./typings";
|
|
2
|
+
import type { ModelTVVideoPluginExportType, ModelTVVideoPluginParameterType } from "./typings";
|
|
3
3
|
export declare const ModelTVVideoPlugin: FivePlugin<ModelTVVideoPluginParameterType, ModelTVVideoPluginExportType>;
|
|
4
4
|
export default ModelTVVideoPlugin;
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
1
|
import * as THREE from 'three';
|
|
11
2
|
import { parseModelTVVideoPoints } from "./utils/parseData";
|
|
12
3
|
export const ModelTVVideoPlugin = (five, { videoElement }) => {
|
|
@@ -161,7 +152,7 @@ export const ModelTVVideoPlugin = (five, { videoElement }) => {
|
|
|
161
152
|
xhr.send();
|
|
162
153
|
});
|
|
163
154
|
};
|
|
164
|
-
const load = (data, videoElement) =>
|
|
155
|
+
const load = async (data, videoElement) => {
|
|
165
156
|
const { video_src, video_poster_src, points } = data;
|
|
166
157
|
state.videoSource = video_src;
|
|
167
158
|
// TODO 存疑,先处理多一次遍历 o(2n)
|
|
@@ -171,11 +162,11 @@ export const ModelTVVideoPlugin = (five, { videoElement }) => {
|
|
|
171
162
|
if (videoElement) {
|
|
172
163
|
state.videoElement = videoElement;
|
|
173
164
|
}
|
|
174
|
-
state.videoTexture =
|
|
165
|
+
state.videoTexture = await getVideoTexture(state.videoSource, state.videoElement);
|
|
175
166
|
state.enabled = !!data.enable;
|
|
176
167
|
if (state.enabled)
|
|
177
168
|
enable();
|
|
178
|
-
}
|
|
169
|
+
};
|
|
179
170
|
const dispose = () => {
|
|
180
171
|
disable();
|
|
181
172
|
state.videoTexture = undefined;
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
1
|
import * as THREE from 'three';
|
|
11
2
|
import { getRoomInfoInstance } from './getRoomInfoInstance';
|
|
12
3
|
import { loadTexture } from '../shared-utils/three/loadTexture';
|
|
@@ -195,65 +186,59 @@ class PanoCompassController {
|
|
|
195
186
|
if (this.modelLoaded)
|
|
196
187
|
this.init();
|
|
197
188
|
}
|
|
198
|
-
init() {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
this.five.needsRender = true;
|
|
220
|
-
});
|
|
189
|
+
async init() {
|
|
190
|
+
if (!this.data || !this.modelLoaded)
|
|
191
|
+
return;
|
|
192
|
+
const northRad = this.data.north_rad;
|
|
193
|
+
if (northRad != null) {
|
|
194
|
+
this.compassMesh = await this.loadCompassMesh();
|
|
195
|
+
this.compassMesh.rotateX(-Math.PI / 2);
|
|
196
|
+
this.compassMesh.rotateZ(northRad - Math.PI / 2);
|
|
197
|
+
this.group.add(this.compassMesh);
|
|
198
|
+
}
|
|
199
|
+
if (this.data.entrance != null) {
|
|
200
|
+
this.entryDoorMesh = await this.loadEntryDoorMesh();
|
|
201
|
+
this.roomInfoWrapperInstance = this.loadRoomInfo();
|
|
202
|
+
this.roomInfoInstance = getRoomInfoInstance();
|
|
203
|
+
this.entryDoorMesh.rotateX(-Math.PI / 2);
|
|
204
|
+
if (this.roomInfoWrapperInstance)
|
|
205
|
+
this.roomInfoInstance.appendTo(this.roomInfoWrapperInstance.container);
|
|
206
|
+
this.group.add(this.entryDoorMesh);
|
|
207
|
+
}
|
|
208
|
+
this.onFivePanoArrived(this.five.panoIndex || 0);
|
|
209
|
+
this.five.needsRender = true;
|
|
221
210
|
}
|
|
222
|
-
loadCompassMesh() {
|
|
211
|
+
async loadCompassMesh() {
|
|
223
212
|
var _a;
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
return compassMesh;
|
|
238
|
-
});
|
|
213
|
+
const compassImageUrl = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.compassImageUrl) ||
|
|
214
|
+
'//vrlab-image4.ljcdn.com/release/web/v3/north-point-circle.96498e69.png';
|
|
215
|
+
const compassTexture = await loadTexture(compassImageUrl);
|
|
216
|
+
const compassGeometry = new THREE.CircleGeometry(0.7, 32);
|
|
217
|
+
const compassMaterial = new THREE.MeshBasicMaterial({
|
|
218
|
+
map: compassTexture,
|
|
219
|
+
transparent: true,
|
|
220
|
+
opacity: 0,
|
|
221
|
+
depthTest: false,
|
|
222
|
+
});
|
|
223
|
+
const compassMesh = new THREE.Mesh(compassGeometry, compassMaterial);
|
|
224
|
+
compassMesh.name = 'pano-compass-mesh';
|
|
225
|
+
return compassMesh;
|
|
239
226
|
}
|
|
240
|
-
loadEntryDoorMesh() {
|
|
227
|
+
async loadEntryDoorMesh() {
|
|
241
228
|
var _a;
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
return entryDoorMesh;
|
|
256
|
-
});
|
|
229
|
+
const entryDoorImageUrl = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.entryDoorImageUrl) ||
|
|
230
|
+
'//vrlab-image4.ljcdn.com/release/web/enterDoor.831b8208.png';
|
|
231
|
+
const entryDoorTexture = await loadTexture(entryDoorImageUrl);
|
|
232
|
+
const entryDoorGeometry = new THREE.PlaneGeometry(0.2, 0.16);
|
|
233
|
+
const entryDoorMaterial = new THREE.MeshBasicMaterial({
|
|
234
|
+
map: entryDoorTexture,
|
|
235
|
+
transparent: true,
|
|
236
|
+
opacity: 0.8,
|
|
237
|
+
depthTest: false,
|
|
238
|
+
});
|
|
239
|
+
const entryDoorMesh = new THREE.Mesh(entryDoorGeometry, entryDoorMaterial);
|
|
240
|
+
entryDoorMesh.name = 'pano-compass-entry-door';
|
|
241
|
+
return entryDoorMesh;
|
|
257
242
|
}
|
|
258
243
|
loadRoomInfo() {
|
|
259
244
|
const points = [
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import Line from '../Model/line';
|
|
2
|
-
import Magnifier from '../Modules/Magnifier';
|
|
3
|
-
import FiveHelper from '../Modules/FiveHelper';
|
|
4
|
-
import { Group } from 'three';
|
|
5
|
-
import { Model } from '../Model';
|
|
6
|
-
import { PluginEvent } from '../typings/event.type';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
import type Line from '../Model/line';
|
|
2
|
+
import type Magnifier from '../Modules/Magnifier';
|
|
3
|
+
import type FiveHelper from '../Modules/FiveHelper';
|
|
4
|
+
import type { Group } from 'three';
|
|
5
|
+
import type { Model } from '../Model';
|
|
6
|
+
import type { PluginEvent } from '../typings/event.type';
|
|
7
|
+
import type { UserDistanceItem } from '../utils/distanceDom';
|
|
8
|
+
import type { Five, Intersection, IntersectMeshInterface, Subscribe } from '@realsee/five';
|
|
9
9
|
export interface IControllerParams {
|
|
10
10
|
five: Five;
|
|
11
11
|
group: Group;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { LineJson } from '../typings/data';
|
|
1
2
|
import { Model } from '../Model';
|
|
2
3
|
import Line from '../Model/line';
|
|
3
|
-
import { LineJson } from '../typings/data';
|
|
4
4
|
import BaseController, { IControllerParams } from './BaseController';
|
|
5
5
|
export interface EditEvent {
|
|
6
6
|
editedLineChange: (lines: LineJson[]) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { PluginData } from '../typings/data';
|
|
1
|
+
import type { PluginData } from '../typings/data';
|
|
2
|
+
import type { PluginEvent } from '../typings/event.type';
|
|
3
|
+
import type { UserDistanceItem } from '../utils/distanceDom';
|
|
2
4
|
import { Five, Subscribe } from '@realsee/five';
|
|
3
|
-
import { PluginEvent } from '../typings/event.type';
|
|
4
|
-
import { UserDistanceItem } from '../utils/distanceDom';
|
|
5
5
|
export declare type Mode = 'Watch' | 'Edit';
|
|
6
6
|
export interface MeasurePluginParameter {
|
|
7
7
|
useUIController?: boolean;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import type { PluginData } from '../typings/data';
|
|
2
|
+
import type { UserDistanceItem } from '../utils/distanceDom';
|
|
1
3
|
import Line from './line';
|
|
2
4
|
import Point from './point';
|
|
3
5
|
import { Subscribe, SubscribeEventMap } from '@realsee/five';
|
|
4
|
-
import { PluginData } from '../typings/data';
|
|
5
6
|
import { Polyline } from './polyline';
|
|
6
|
-
import { UserDistanceItem } from '../utils/distanceDom';
|
|
7
7
|
interface IModelEvent extends SubscribeEventMap {
|
|
8
8
|
/** 新增线条
|
|
9
9
|
* @param line 被创建的线条
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Model } from '.';
|
|
2
|
-
import Point from './point';
|
|
3
|
-
import { LineJson } from '..';
|
|
1
|
+
import type { Model } from '.';
|
|
2
|
+
import type Point from './point';
|
|
3
|
+
import type { LineJson } from '..';
|
|
4
|
+
import type { LineCompletelyJson } from '../typings/data';
|
|
5
|
+
import type { Line as FiveLine } from '@realsee/five/line';
|
|
4
6
|
import { Polyline } from './polyline';
|
|
5
|
-
import { LineCompletelyJson } from '../typings/data';
|
|
6
|
-
import { Line as FiveLine } from '@realsee/five/line';
|
|
7
7
|
import { Subscribe, SubscribeEventMap } from '@realsee/five';
|
|
8
8
|
import { DistanceItem } from '../utils/distanceDom';
|
|
9
9
|
export interface ILineHook extends SubscribeEventMap {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Polyline } from './polyline';
|
|
2
1
|
import uuid from '../../shared-utils/uuid';
|
|
2
|
+
import { Polyline } from './polyline';
|
|
3
3
|
import { creatLineMesh } from '../utils/line';
|
|
4
4
|
import { Subscribe } from '@realsee/five';
|
|
5
5
|
import { creatDistanceItem } from '../utils/distanceDom';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import Line from './line';
|
|
1
|
+
import type Line from './line';
|
|
2
|
+
import type { PluginData } from '../typings/data';
|
|
2
3
|
import { Vector3 } from 'three';
|
|
3
|
-
import { PluginData } from '../typings/data';
|
|
4
4
|
declare type IPointData = PluginData['points'][0];
|
|
5
5
|
export default class Point {
|
|
6
6
|
id: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import Line from './line';
|
|
2
|
-
import Point from './point';
|
|
3
|
-
import { PolylineJson, PolylineCompletelyJson } from '../typings/data';
|
|
1
|
+
import type Line from './line';
|
|
2
|
+
import type Point from './point';
|
|
3
|
+
import type { PolylineJson, PolylineCompletelyJson } from '../typings/data';
|
|
4
4
|
export declare class Polyline {
|
|
5
5
|
readonly id: string;
|
|
6
6
|
points: Point[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FivePlugin } from '@realsee/five';
|
|
1
|
+
import type { FivePlugin } from '@realsee/five';
|
|
2
2
|
import MeasureController, { MeasurePluginParameter } from './Controller';
|
|
3
3
|
declare const PanoMeasurePlugin: FivePlugin<MeasurePluginParameter, PluginReturns>;
|
|
4
4
|
export default PanoMeasurePlugin;
|