@realsee/dnalogel 0.1.2 → 0.1.7
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/components/ARVideoFigure/ARVideoFigureMesh.js +56 -32
- package/components/ARVideoFigure/ARVideoFigureScene.js +30 -19
- package/components/ARVideoFigure/ImgBgTransparent.js +22 -6
- package/components/ARVideoFigure/ImgBgTransparentMesh.js +40 -30
- package/components/ARVideoFigure/fragmentShader.js +2 -0
- package/components/ARVideoFigure/index.js +22 -6
- package/components/ARVideoFigure/vertexShader.js +2 -0
- package/components/GLTFView/index.d.ts +72 -0
- package/components/GLTFView/index.js +149 -0
- package/components/GlassFilters/index.js +25 -1
- package/components/ModelView/ModelViewController.js +39 -29
- package/components/ModelView/index.js +4 -2
- package/components/PaintBrush/index.js +15 -1
- package/components/PanoTag/index.js +2 -0
- package/data/1aGKl9JmrlXMXx8d.js +2 -0
- package/data/54djM0oR6ky3Ey8e.d.ts +55 -0
- package/data/54djM0oR6ky3Ey8e.js +350 -0
- package/data/6gyq3v1verxD7JO1.js +2 -0
- package/data/8054djM0oR6ky3Ey8e.d.ts +55 -0
- package/data/8054djM0oR6ky3Ey8e.js +350 -0
- package/data/KpokNd82rwjhackhQTBEoYKHg8zGbPXe.js +2 -0
- package/data/PrXel3aqGbp34JQn.js +2 -0
- package/data/XJ6NMLWnkAY3Rdx8.d.ts +843 -0
- package/data/XJ6NMLWnkAY3Rdx8.js +7989 -0
- package/data/YdoNP9K4rwQDwjJr.js +2 -0
- package/data/ZLvK29zj4L29Jowd.d.ts +55 -0
- package/data/ZLvK29zj4L29Jowd.js +372 -0
- package/data/auto3d-njL5J99VwCmnjtQElOmXQr.js +2 -0
- package/data/extrude-walls/ZLvK29zj4L29Jowd.d.ts +5 -0
- package/data/extrude-walls/ZLvK29zj4L29Jowd.js +14 -0
- package/data/extrude-walls/lo024DEgzanMj5BE.d.ts +5 -0
- package/data/extrude-walls/lo024DEgzanMj5BE.js +14 -0
- package/data/jd6oMOzPxnQ3BvxY_B7yw51J9rXlhYhjhGTOgRVqu6WeEqjNX.d.ts +85 -0
- package/data/jd6oMOzPxnQ3BvxY_B7yw51J9rXlhYhjhGTOgRVqu6WeEqjNX.js +511 -0
- package/data/lo024DEgzanMj5BE.d.ts +55 -0
- package/data/lo024DEgzanMj5BE.js +966 -0
- package/data/oPzy3ApbjjpD8YdR.js +2 -0
- package/data/qjAxMG4XbPn96wKG.js +2 -0
- package/data/rXel3aPQRRBD4JQn.js +2 -0
- package/data/vLykj3NWrllMrG06.d.ts +2 -0
- package/data/vLykj3NWrllMrG06.js +199 -2
- package/data/wz0QV9KA4ugyo9ME.js +2 -0
- package/data/zxMawr9raSg8LYjG.d.ts +53 -0
- package/data/zxMawr9raSg8LYjG.js +590 -0
- package/examples/FiveStateController/index.js +9 -15
- package/examples/VRHouse/Mobile.js +15 -1
- package/examples/VRHouse/PC.js +15 -1
- package/examples/VRHouse/index.js +15 -1
- package/index.js +4 -2
- package/libs/gltf-viewer/Subscribe.d.ts +76 -0
- package/libs/gltf-viewer/Subscribe.js +231 -0
- package/libs/gltf-viewer/coordsMoveByOffset.d.ts +13 -0
- package/libs/gltf-viewer/coordsMoveByOffset.js +22 -0
- package/libs/gltf-viewer/coordsToDirection.d.ts +5 -0
- package/{components/PBRView/index.js → libs/gltf-viewer/coordsToDirection.js} +29 -19
- package/libs/gltf-viewer/formatRad.d.ts +1 -0
- package/libs/gltf-viewer/formatRad.js +13 -0
- package/libs/gltf-viewer/getFrameTime.d.ts +1 -0
- package/libs/gltf-viewer/getFrameTime.js +28 -0
- package/libs/gltf-viewer/index.d.ts +55 -0
- package/libs/gltf-viewer/index.js +650 -0
- package/libs/gltf-viewer/mouseWheel.d.ts +2 -0
- package/libs/gltf-viewer/mouseWheel.js +59 -0
- package/libs/gltf-viewer/requestAnimationFrame.d.ts +1 -0
- package/libs/gltf-viewer/requestAnimationFrame.js +18 -0
- package/libs/gltf-viewer/requestAnimationFrameInterval.d.ts +1 -0
- package/libs/gltf-viewer/requestAnimationFrameInterval.js +31 -0
- package/libs/gltf-viewer/uuid.d.ts +4 -0
- package/libs/gltf-viewer/uuid.js +28 -0
- package/package.json +8 -4
- package/plugins/AutoPreloadPlugin/index.d.ts +23 -0
- package/plugins/AutoPreloadPlugin/index.js +111 -0
- package/plugins/CSS3DRenderPlugin/components/Marker/index.js +24 -16
- package/plugins/CSS3DRenderPlugin/index.d.ts +3 -2
- package/plugins/CSS3DRenderPlugin/index.js +79 -46
- package/plugins/CameraMovementPlugin/index.js +33 -9
- package/plugins/CameraMovementPlugin/typing.js +2 -0
- package/plugins/ModelChassisCompassPlugin/index.d.ts +7 -3
- package/plugins/ModelChassisCompassPlugin/index.js +34 -33
- package/plugins/ModelEntryDoorGuidePlugin/index.d.ts +13 -1
- package/plugins/ModelEntryDoorGuidePlugin/index.js +233 -2
- package/plugins/ModelExtrudeWallsPlugin/index.d.ts +16 -0
- package/plugins/ModelExtrudeWallsPlugin/index.js +252 -0
- package/plugins/ModelRoomLabelPlugin/Controller.d.ts +35 -0
- package/plugins/ModelRoomLabelPlugin/Controller.js +153 -0
- package/plugins/ModelRoomLabelPlugin/RoomLabelItem.d.ts +8 -0
- package/plugins/ModelRoomLabelPlugin/RoomLabelItem.js +66 -0
- package/plugins/ModelRoomLabelPlugin/RoomLabelItems.d.ts +7 -0
- package/plugins/ModelRoomLabelPlugin/RoomLabelItems.js +159 -0
- package/plugins/ModelRoomLabelPlugin/index.d.ts +8 -0
- package/plugins/ModelRoomLabelPlugin/index.js +18 -0
- package/plugins/ModelRoomLabelPlugin/typings.d.ts +35 -0
- package/plugins/ModelRoomLabelPlugin/typings.js +7 -0
- package/plugins/ModelRoomLabelPlugin/utils/parseData.d.ts +3 -0
- package/plugins/ModelRoomLabelPlugin/utils/parseData.js +35 -0
- package/plugins/ModelTVVideoPlugin/index.js +100 -16
- package/plugins/ModelViewPlugin/index.js +25 -1
- package/plugins/PanoCursorRaycasterPlugin/components/MovePointTowardsCamera.js +29 -25
- package/plugins/PanoCursorRaycasterPlugin/components/PointAxesHelper.js +15 -1
- package/plugins/PanoCursorRaycasterPlugin/index.js +13 -6
- package/plugins/PanoCursorRaycasterPlugin/utils/addLineToFive.js +4 -2
- package/plugins/PanoCursorRaycasterPlugin/utils/createLine.js +15 -1
- package/plugins/PanoDoorLabelPlugin/index.js +2 -0
- package/plugins/PanoIRobotPlugin/index.js +2 -0
- package/plugins/PanoMaskSelectorPlugin/compare.d.ts +1 -0
- package/plugins/PanoMaskSelectorPlugin/compare.js +17 -0
- package/plugins/PanoMaskSelectorPlugin/createBox.d.ts +7 -0
- package/plugins/PanoMaskSelectorPlugin/createBox.js +79 -0
- package/plugins/PanoMaskSelectorPlugin/createTextures.d.ts +3 -0
- package/plugins/PanoMaskSelectorPlugin/createTextures.js +45 -0
- package/plugins/PanoMaskSelectorPlugin/fragmentShader.d.ts +1 -0
- package/plugins/PanoMaskSelectorPlugin/fragmentShader.js +10 -0
- package/plugins/PanoMaskSelectorPlugin/index.d.ts +49 -0
- package/plugins/PanoMaskSelectorPlugin/index.js +348 -0
- package/plugins/PanoMaskSelectorPlugin/vertexShader.d.ts +1 -0
- package/plugins/PanoMaskSelectorPlugin/vertexShader.js +10 -0
- package/plugins/PanoRulerPlugin/data/roomInfo.js +2 -0
- package/plugins/PanoRulerPlugin/data/roomRules.js +2 -0
- package/plugins/PanoRulerPlugin/index.js +68 -20
- package/plugins/PanoRulerPlugin/typings.js +2 -0
- package/plugins/PanoTVVideoPlugin/index.d.ts +2 -0
- package/plugins/PanoTVVideoPlugin/index.js +108 -26
- package/plugins/TreasurePlugin/Controller.js +58 -52
- package/plugins/TreasurePlugin/TreasureFaceAnime.js +36 -21
- package/plugins/TreasurePlugin/TreasureObject.js +60 -56
- package/plugins/TreasurePlugin/TreasureOpenAnime.js +38 -19
- package/plugins/TreasurePlugin/constants.js +2 -0
- package/plugins/TreasurePlugin/index.js +2 -0
- package/plugins/TreasurePlugin/typings.js +2 -0
- package/plugins/floorplan/Assets/floorplanExtraObject.js +2 -0
- package/plugins/floorplan/ModelFloorplanPlugin/Controller.js +71 -88
- package/plugins/floorplan/ModelFloorplanPlugin/components/Camera.js +25 -5
- package/plugins/floorplan/ModelFloorplanPlugin/components/Compass.js +19 -4
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomHighlight.js +28 -4
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomLabels.js +28 -5
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/index.js +20 -6
- package/plugins/floorplan/ModelFloorplanPlugin/components/index.js +30 -8
- package/plugins/floorplan/ModelFloorplanPlugin/controller.style.js +2 -0
- package/plugins/floorplan/ModelFloorplanPlugin/index.js +4 -2
- package/plugins/floorplan/ModelFloorplanPlugin/typings/events.type.js +2 -0
- package/plugins/floorplan/ModelFloorplanPlugin/utils/constant.js +2 -0
- package/plugins/floorplan/ModelFloorplanPlugin/utils/correctFiveState.js +14 -22
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.js +25 -3
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.style.js +6 -2
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/ExtraObjects.js +19 -3
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/RoomHighlight.js +28 -4
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/index.js +22 -6
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.js +29 -19
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.style.js +2 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Controller.js +44 -47
- package/plugins/floorplan/PanoFloorplanRadarPlugin/index.js +4 -2
- package/plugins/floorplan/TopviewFloorplanPlugin/Controller.js +50 -55
- package/plugins/floorplan/TopviewFloorplanPlugin/index.js +2 -0
- package/plugins/floorplan/TopviewFloorplanPlugin/style.js +2 -0
- package/plugins/floorplan/components/FloorplanImage.js +15 -1
- package/plugins/floorplan/typings/floorplanData.js +2 -0
- package/plugins/floorplan/typings/floorplanServerData.js +2 -0
- package/plugins/floorplan/utils/formatData.js +28 -10
- package/plugins/floorplan/utils/formatPosition.js +10 -8
- package/shared-utils/Preloader.js +6 -0
- package/shared-utils/Subscribe.js +36 -16
- package/shared-utils/animationFrame/BetterTween.js +28 -27
- package/shared-utils/animationFrame/calculateProgress.js +2 -0
- package/shared-utils/animationFrame/formatRad.js +2 -0
- package/shared-utils/animationFrame/index.js +12 -0
- package/shared-utils/animationFrame/tween.js +17 -1
- package/shared-utils/changeModelCanvansOpacity.js +14 -0
- package/shared-utils/createCanvasTextTexture.d.ts +8 -0
- package/shared-utils/createCanvasTextTexture.js +31 -0
- package/shared-utils/createFiveContainer.js +23 -17
- package/shared-utils/createLine/index.js +15 -1
- package/shared-utils/debounce.js +4 -0
- package/shared-utils/equal.js +15 -4
- package/shared-utils/filter.js +36 -2
- package/shared-utils/five/changeMode.js +13 -17
- package/shared-utils/five/useFivePlugin.js +2 -0
- package/shared-utils/formatRad.js +2 -0
- package/shared-utils/getPxmm.js +15 -1
- package/shared-utils/getRandomColor.js +10 -0
- package/shared-utils/isNil.js +2 -0
- package/shared-utils/isTruelyObject.js +4 -0
- package/shared-utils/math/evenNumber.js +2 -0
- package/shared-utils/math/planimetry.js +10 -0
- package/shared-utils/math/rad2Deg.js +2 -0
- package/shared-utils/nearlyEqual.js +2 -0
- package/shared-utils/nextFrame.js +2 -0
- package/shared-utils/noop.js +2 -0
- package/shared-utils/object3d2LocalMatrix.js +20 -14
- package/shared-utils/px2rem.js +10 -0
- package/shared-utils/tap.js +2 -0
- package/shared-utils/three/centerPoint.js +2 -0
- package/shared-utils/three/getExtraModelLoader.js +14 -0
- package/shared-utils/three/getNormal.js +4 -0
- package/shared-utils/three/getTextureLoader.js +16 -0
- package/shared-utils/three/loadFbxObj.js +13 -5
- package/shared-utils/three/loadTexture.js +13 -5
- package/shared-utils/three/transformPositionToVector3.js +2 -0
- package/shared-utils/three/transfromToMeshBasicMaterial.d.ts +2 -0
- package/shared-utils/three/transfromToMeshBasicMaterial.js +33 -0
- package/shared-utils/throttle.js +4 -0
- package/shared-utils/to.js +8 -4
- package/shared-utils/useDebounce.js +6 -0
- package/shared-utils/useThrottle.js +6 -0
- package/shared-utils/uuid.js +8 -0
- package/shared-utils/vectorTocoordinates.js +2 -0
- package/typedoc/components.js +2 -0
- package/typedoc/plugins.d.ts +2 -0
- package/typedoc/plugins.js +41 -1
- package/typedoc/shared-utils.js +2 -0
- package/typedoc/typings.js +2 -0
- package/typings/math.type.js +2 -0
- package/typings/utils.type.js +2 -0
- package/components/PBRView/index.d.ts +0 -14
- package/data/wYnRjQ4KZoV1yPoG.d.ts +0 -114
- package/data/wYnRjQ4KZoV1yPoG.js +0 -512
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.requestAnimationFrame = void 0;
|
|
9
|
+
|
|
10
|
+
require("core-js/modules/web.timers.js");
|
|
11
|
+
|
|
12
|
+
var _window = window;
|
|
13
|
+
|
|
14
|
+
var requestAnimationFrame = window.requestAnimationFrame || _window.mozRequestAnimationFrame || _window.webkitRequestAnimationFrame || _window.msRequestAnimationFrame || function (fn) {
|
|
15
|
+
return setTimeout(fn, 16);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
exports.requestAnimationFrame = requestAnimationFrame;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function requestAnimationFrameInterval(fn: any, context?: any, args?: any[]): () => void;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.requestAnimationFrameInterval = requestAnimationFrameInterval;
|
|
11
|
+
|
|
12
|
+
require("core-js/modules/es.array.concat.js");
|
|
13
|
+
|
|
14
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
15
|
+
|
|
16
|
+
var _requestAnimationFrame = require("./requestAnimationFrame");
|
|
17
|
+
|
|
18
|
+
function requestAnimationFrameInterval(fn, context) {
|
|
19
|
+
var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
20
|
+
var stoped = false;
|
|
21
|
+
|
|
22
|
+
var _loop = function loop(time) {
|
|
23
|
+
if (fn) fn.call.apply(fn, [context, time].concat((0, _toConsumableArray2["default"])(args)));
|
|
24
|
+
if (!stoped && _loop) (0, _requestAnimationFrame.requestAnimationFrame)(_loop);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
(0, _requestAnimationFrame.requestAnimationFrame)(_loop);
|
|
28
|
+
return function () {
|
|
29
|
+
_loop = null, stoped = true;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = uuid;
|
|
9
|
+
|
|
10
|
+
require("core-js/modules/es.date.to-string.js");
|
|
11
|
+
|
|
12
|
+
require("core-js/modules/es.object.to-string.js");
|
|
13
|
+
|
|
14
|
+
require("core-js/modules/es.regexp.to-string.js");
|
|
15
|
+
|
|
16
|
+
// uuid
|
|
17
|
+
function S4() {
|
|
18
|
+
return ((1 + Math.random()) * 0x10000 | 0).toString(16).substring(1);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* 随机生成一个uuid值
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
function uuid() {
|
|
26
|
+
// then to call it, plus stitch in '4' in the third group
|
|
27
|
+
return (S4() + S4() + '-' + S4() + '-4' + S4().substr(0, 3) + '-' + S4() + '-' + S4() + S4() + S4()).toLowerCase();
|
|
28
|
+
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@realsee/dnalogel",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.7",
|
|
4
|
+
"description": "如视前端 Componets、Plugins 兼部分 SDKs \"Dnalogel\" 库。",
|
|
5
5
|
"author": "BEIKE REALSEE TECHNOLOGY (HK) LIMITED",
|
|
6
6
|
"peerDependencies": {
|
|
7
|
-
"@realsee/five": "^5.0.0-alpha.
|
|
7
|
+
"@realsee/five": "^5.0.0-alpha.52",
|
|
8
8
|
"@tweenjs/tween.js": "^18.6.4",
|
|
9
9
|
"@types/styled-jsx": "^2.2.9",
|
|
10
|
+
"hammerjs": "^2.0.8",
|
|
10
11
|
"react": "^16.14.0",
|
|
11
12
|
"styled-jsx": "^3.4.6",
|
|
12
13
|
"three": "0.117.1",
|
|
@@ -15,5 +16,8 @@
|
|
|
15
16
|
},
|
|
16
17
|
"main": "index.js",
|
|
17
18
|
"repository": "git@git.lianjia.com:vrlab_frontend/dnalogel.git",
|
|
18
|
-
"license": "SEE LICENSE IN TERMS.txt"
|
|
19
|
+
"license": "SEE LICENSE IN TERMS.txt",
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"core-js": "^3.20.0"
|
|
22
|
+
}
|
|
19
23
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { FivePlugin } from '@realsee/five';
|
|
2
|
+
export declare type AutoPreloadPluginParameterType = {
|
|
3
|
+
/** 预加载使用的图片质量 */
|
|
4
|
+
preloadImageSize?: number;
|
|
5
|
+
/** 走点时,预加载的点位个数 */
|
|
6
|
+
preloadPanoIndexNumber?: number;
|
|
7
|
+
/** 走点时,是否使用预加载功能 */
|
|
8
|
+
shouldPreloadAroundPanoImage?: (panoIndex: number) => boolean | void;
|
|
9
|
+
};
|
|
10
|
+
export interface AutoPreloadPluginReturnType {
|
|
11
|
+
dispose: () => void;
|
|
12
|
+
}
|
|
13
|
+
/** 优化首点位加载的逻辑
|
|
14
|
+
*
|
|
15
|
+
* 1.进入 VR 时,如果 Five 默认的配置图片像素超过了 1024,先用 1024 加载
|
|
16
|
+
* 第一个点位加载完成之后,再使用业务上配置的图片像素重复加载一遍当前点位
|
|
17
|
+
*
|
|
18
|
+
* 2.在走点时,会预载距离当前点位最近的 preloadPanoIndexNumber 个数的点
|
|
19
|
+
* @description
|
|
20
|
+
* 预载周围的点时,不会一次性全部预载。而是每隔1s,预载其中的一个点
|
|
21
|
+
*/
|
|
22
|
+
declare const AutoPreloadPlugin: FivePlugin<AutoPreloadPluginParameterType, AutoPreloadPluginReturnType>;
|
|
23
|
+
export default AutoPreloadPlugin;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
require("core-js/modules/web.timers.js");
|
|
11
|
+
|
|
12
|
+
require("core-js/modules/es.array.splice.js");
|
|
13
|
+
|
|
14
|
+
require("core-js/modules/es.array.from.js");
|
|
15
|
+
|
|
16
|
+
require("core-js/modules/es.string.iterator.js");
|
|
17
|
+
|
|
18
|
+
require("core-js/modules/es.array.iterator.js");
|
|
19
|
+
|
|
20
|
+
require("core-js/modules/es.object.to-string.js");
|
|
21
|
+
|
|
22
|
+
require("core-js/modules/es.set.js");
|
|
23
|
+
|
|
24
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
25
|
+
|
|
26
|
+
require("core-js/modules/es.array.map.js");
|
|
27
|
+
|
|
28
|
+
require("core-js/modules/es.array.slice.js");
|
|
29
|
+
|
|
30
|
+
require("core-js/modules/es.array.sort.js");
|
|
31
|
+
|
|
32
|
+
require("core-js/modules/es.array.filter.js");
|
|
33
|
+
|
|
34
|
+
var _nextFrame = require("../../shared-utils/nextFrame");
|
|
35
|
+
|
|
36
|
+
/** 优化首点位加载的逻辑
|
|
37
|
+
*
|
|
38
|
+
* 1.进入 VR 时,如果 Five 默认的配置图片像素超过了 1024,先用 1024 加载
|
|
39
|
+
* 第一个点位加载完成之后,再使用业务上配置的图片像素重复加载一遍当前点位
|
|
40
|
+
*
|
|
41
|
+
* 2.在走点时,会预载距离当前点位最近的 preloadPanoIndexNumber 个数的点
|
|
42
|
+
* @description
|
|
43
|
+
* 预载周围的点时,不会一次性全部预载。而是每隔1s,预载其中的一个点
|
|
44
|
+
*/
|
|
45
|
+
var AutoPreloadPlugin = function AutoPreloadPlugin(five, parameters) {
|
|
46
|
+
var _parameters$preloadIm, _parameters$preloadPa;
|
|
47
|
+
|
|
48
|
+
var preloadImageSize = (_parameters$preloadIm = parameters === null || parameters === void 0 ? void 0 : parameters.preloadImageSize) !== null && _parameters$preloadIm !== void 0 ? _parameters$preloadIm : 1024;
|
|
49
|
+
var preloadPanoIndexNumber = (_parameters$preloadPa = parameters === null || parameters === void 0 ? void 0 : parameters.preloadPanoIndexNumber) !== null && _parameters$preloadPa !== void 0 ? _parameters$preloadPa : 4;
|
|
50
|
+
var lastSize = five.imageOptions.size;
|
|
51
|
+
var timer = void 0;
|
|
52
|
+
|
|
53
|
+
var doPreload = function doPreload(quene) {
|
|
54
|
+
if (quene.length === 0) return;
|
|
55
|
+
five.preloadPano(quene[0]);
|
|
56
|
+
if (quene.length === 1) return;
|
|
57
|
+
timer = setTimeout(function () {
|
|
58
|
+
return doPreload(quene.splice(1));
|
|
59
|
+
}, 1000);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
var onPanoArrived = function onPanoArrived(panoIndex) {
|
|
63
|
+
if (parameters !== null && parameters !== void 0 && parameters.shouldPreloadAroundPanoImage) {
|
|
64
|
+
var shouldPreload = parameters.shouldPreloadAroundPanoImage(panoIndex);
|
|
65
|
+
if (!shouldPreload) return;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (timer) clearTimeout(timer);
|
|
69
|
+
var currentIndex = panoIndex;
|
|
70
|
+
var currentObserver = five.work.observers[currentIndex];
|
|
71
|
+
var preloadIndexArray = Array.from(new Set(five.work.observers.filter(function (observer) {
|
|
72
|
+
return observer.floorIndex === currentObserver.floorIndex;
|
|
73
|
+
}).map(function (observer) {
|
|
74
|
+
var distance = observer.standingPosition.clone().distanceTo(currentObserver.standingPosition);
|
|
75
|
+
return {
|
|
76
|
+
observer: observer,
|
|
77
|
+
distance: distance
|
|
78
|
+
};
|
|
79
|
+
}).sort(function (a, b) {
|
|
80
|
+
return a.distance - b.distance;
|
|
81
|
+
}).slice(0, preloadPanoIndexNumber).map(function (_ref) {
|
|
82
|
+
var observer = _ref.observer;
|
|
83
|
+
return observer.panoIndex;
|
|
84
|
+
})));
|
|
85
|
+
doPreload(preloadIndexArray);
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
var onFirstPanoArrived = function onFirstPanoArrived(panoIndex) {
|
|
89
|
+
// 在第一次点位加载之后再做周围点位的预载,防止第一个点位周围的点预载两次
|
|
90
|
+
// 同时也防止阻塞第一个点的低分辨率图快速加载
|
|
91
|
+
five.on('panoArrived', onPanoArrived);
|
|
92
|
+
var shouldPreloadFirstPanoImage = five.imageOptions.size !== lastSize;
|
|
93
|
+
if (!shouldPreloadFirstPanoImage) return;
|
|
94
|
+
(0, _nextFrame.nextFrame)(function () {
|
|
95
|
+
five.imageOptions.size = lastSize;
|
|
96
|
+
five.moveToPano(panoIndex);
|
|
97
|
+
}, 5);
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
five.imageOptions.size = lastSize && lastSize > preloadImageSize ? preloadImageSize : lastSize;
|
|
101
|
+
if (five.imageOptions.size !== lastSize) five.once('panoArrived', onFirstPanoArrived);
|
|
102
|
+
return {
|
|
103
|
+
dispose: function dispose() {
|
|
104
|
+
five.off('panoArrived', onFirstPanoArrived);
|
|
105
|
+
five.off('panoArrived', onPanoArrived);
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
var _default = AutoPreloadPlugin;
|
|
111
|
+
exports["default"] = _default;
|
|
@@ -1,12 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
require("core-js/modules/es.array.iterator.js");
|
|
4
|
+
|
|
5
|
+
require("core-js/modules/es.string.iterator.js");
|
|
6
|
+
|
|
7
|
+
require("core-js/modules/es.weak-map.js");
|
|
8
|
+
|
|
9
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
10
|
+
|
|
11
|
+
require("core-js/modules/es.object.define-property.js");
|
|
12
|
+
|
|
13
|
+
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
14
|
+
|
|
15
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
16
|
+
|
|
17
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
18
|
|
|
5
19
|
Object.defineProperty(exports, "__esModule", {
|
|
6
20
|
value: true
|
|
7
21
|
});
|
|
8
22
|
exports["default"] = Marker;
|
|
9
23
|
|
|
24
|
+
require("core-js/modules/es.date.to-string.js");
|
|
25
|
+
|
|
26
|
+
require("core-js/modules/es.object.to-string.js");
|
|
27
|
+
|
|
28
|
+
require("core-js/modules/es.regexp.to-string.js");
|
|
29
|
+
|
|
30
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
31
|
+
|
|
10
32
|
var _react = require("@realsee/five/react");
|
|
11
33
|
|
|
12
34
|
var React = _interopRequireWildcard(require("react"));
|
|
@@ -17,24 +39,10 @@ require("./index.css");
|
|
|
17
39
|
|
|
18
40
|
var _getRandomColor = _interopRequireDefault(require("../../../../shared-utils/getRandomColor"));
|
|
19
41
|
|
|
20
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
|
-
|
|
22
42
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
43
|
|
|
24
44
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
45
|
|
|
26
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
27
|
-
|
|
28
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
29
|
-
|
|
30
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
31
|
-
|
|
32
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
33
|
-
|
|
34
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
35
|
-
|
|
36
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
37
|
-
|
|
38
46
|
function Marker(props) {
|
|
39
47
|
var color = React.useRef(props.color || (0, _getRandomColor["default"])());
|
|
40
48
|
var intersectMeshRef = React.useRef(new THREE.Mesh(new THREE.RingGeometry(0.04, 0.08, 32), new THREE.MeshBasicMaterial({
|
|
@@ -56,7 +64,7 @@ function Marker(props) {
|
|
|
56
64
|
top: 0,
|
|
57
65
|
matrix: '[1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]'
|
|
58
66
|
}),
|
|
59
|
-
_React$useState2 =
|
|
67
|
+
_React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2),
|
|
60
68
|
state = _React$useState2[0],
|
|
61
69
|
setState = _React$useState2[1];
|
|
62
70
|
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { FivePlugin } from '@realsee/five';
|
|
2
2
|
import { Vector3 } from 'three';
|
|
3
3
|
import { CSS3DObject } from 'three/examples/jsm/renderers/CSS3DRenderer';
|
|
4
|
+
import { Vector3Position } from '../../typings/math.type';
|
|
4
5
|
export declare type CSS3DRenderPluginParameterType = undefined;
|
|
5
6
|
export interface CSS3DRenderPluginExportType {
|
|
6
7
|
/**
|
|
7
8
|
* @description: 根据传入的四个点位创建一个3d dom容器,可以通过ReactDom.render()的方式将react组件放到容器中
|
|
8
9
|
* @param {Five} five
|
|
9
|
-
* @param {Vector3[]} points: 矩形四个点坐标
|
|
10
|
+
* @param {Vector3[] | Vector3Position[]} points: 矩形四个点坐标
|
|
10
11
|
* @param {number} config.ratio: 1px对应多少米,默认为 0.002,即1px对应2mm
|
|
11
12
|
* @param {number} config.dpr: dpr, 默认为1
|
|
12
13
|
* @param {HTMLElement} config.container: HTMLElement
|
|
@@ -15,7 +16,7 @@ export interface CSS3DRenderPluginExportType {
|
|
|
15
16
|
* @param {HTMLElement} config.behindFiveContainer: 如果config.mode为'behind',需要传入容器,并确保此容器位five下方,且中间没有其他dom元素遮挡
|
|
16
17
|
* @return {{ container: HTMLElement; dispose: () => void }}: container: dom容器, dispose: 清理函数
|
|
17
18
|
*/
|
|
18
|
-
create3DDomContainer: (points: Vector3[], config?: {
|
|
19
|
+
create3DDomContainer: (points: Vector3[] | Vector3Position[], config?: {
|
|
19
20
|
ratio?: number;
|
|
20
21
|
dpr?: number;
|
|
21
22
|
autoRender?: boolean;
|
|
@@ -1,12 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
require("core-js/modules/es.array.iterator.js");
|
|
4
|
+
|
|
5
|
+
require("core-js/modules/es.object.to-string.js");
|
|
6
|
+
|
|
7
|
+
require("core-js/modules/es.string.iterator.js");
|
|
8
|
+
|
|
9
|
+
require("core-js/modules/es.weak-map.js");
|
|
10
|
+
|
|
11
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
12
|
+
|
|
13
|
+
require("core-js/modules/es.object.define-property.js");
|
|
14
|
+
|
|
15
|
+
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
16
|
+
|
|
17
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
18
|
+
|
|
19
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
20
|
|
|
5
21
|
Object.defineProperty(exports, "__esModule", {
|
|
6
22
|
value: true
|
|
7
23
|
});
|
|
8
24
|
exports["default"] = exports.CSS3DRenderPlugin = void 0;
|
|
9
25
|
|
|
26
|
+
require("core-js/modules/es.array.map.js");
|
|
27
|
+
|
|
28
|
+
require("core-js/modules/es.array.for-each.js");
|
|
29
|
+
|
|
30
|
+
require("core-js/modules/es.array.find-index.js");
|
|
31
|
+
|
|
32
|
+
require("core-js/modules/es.array.splice.js");
|
|
33
|
+
|
|
34
|
+
require("core-js/modules/es.string.sub.js");
|
|
35
|
+
|
|
36
|
+
require("core-js/modules/es.function.name.js");
|
|
37
|
+
|
|
38
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
39
|
+
|
|
10
40
|
var THREE = _interopRequireWildcard(require("three"));
|
|
11
41
|
|
|
12
42
|
var _CSS3DRenderer = require("three/examples/jsm/renderers/CSS3DRenderer");
|
|
@@ -15,7 +45,7 @@ var _evenNumber = _interopRequireDefault(require("../../shared-utils/math/evenNu
|
|
|
15
45
|
|
|
16
46
|
var _centerPoint = _interopRequireDefault(require("../../shared-utils/three/centerPoint"));
|
|
17
47
|
|
|
18
|
-
|
|
48
|
+
var _transformPositionToVector = _interopRequireDefault(require("../../shared-utils/three/transformPositionToVector3"));
|
|
19
49
|
|
|
20
50
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
51
|
|
|
@@ -39,8 +69,10 @@ var CSS3DRenderPlugin = function CSS3DRenderPlugin(five) {
|
|
|
39
69
|
params[_key] = arguments[_key];
|
|
40
70
|
}
|
|
41
71
|
|
|
42
|
-
var points = params[0]
|
|
43
|
-
|
|
72
|
+
var points = params[0].map(function (point) {
|
|
73
|
+
return point instanceof THREE.Vector3 ? point : (0, _transformPositionToVector["default"])(point);
|
|
74
|
+
});
|
|
75
|
+
var config = params[1];
|
|
44
76
|
if ((points === null || points === void 0 ? void 0 : points.length) < 4) return console.error('points must be equal or greater than than 4');
|
|
45
77
|
if (!(five !== null && five !== void 0 && (_five$model = five.model) !== null && _five$model !== void 0 && _five$model.loaded)) return console.error('five.model.loaded is: ', five === null || five === void 0 ? void 0 : (_five$model2 = five.model) === null || _five$model2 === void 0 ? void 0 : _five$model2.loaded);
|
|
46
78
|
var fiveElement = five.getElement();
|
|
@@ -52,7 +84,8 @@ var CSS3DRenderPlugin = function CSS3DRenderPlugin(five) {
|
|
|
52
84
|
var mode = (config === null || config === void 0 ? void 0 : config.mode) || 'front';
|
|
53
85
|
var autoRender = (_config$autoRender = config === null || config === void 0 ? void 0 : config.autoRender) !== null && _config$autoRender !== void 0 ? _config$autoRender : true;
|
|
54
86
|
var behindFiveContainer = (config === null || config === void 0 ? void 0 : config.behindFiveContainer) || fiveElement.parentElement || document.body;
|
|
55
|
-
var container = (config === null || config === void 0 ? void 0 : config.container) || document.createElement('div');
|
|
87
|
+
var container = (config === null || config === void 0 ? void 0 : config.container) || document.createElement('div');
|
|
88
|
+
container.classList.add('__Dnalogel-plugin--CSS3DRenderPlugin'); // 获取css3DObject, 如果mode为behind的话,一起获取mesh
|
|
56
89
|
|
|
57
90
|
var _createObject = createObject(points, {
|
|
58
91
|
ratio: ratio,
|
|
@@ -71,8 +104,6 @@ var CSS3DRenderPlugin = function CSS3DRenderPlugin(five) {
|
|
|
71
104
|
var stopRenderFlag = false;
|
|
72
105
|
var requestAnimationFrameId = null;
|
|
73
106
|
|
|
74
|
-
var render = function render() {};
|
|
75
|
-
|
|
76
107
|
if (behindModeUnInited) {
|
|
77
108
|
state.behindMode = {
|
|
78
109
|
scene: new THREE.Scene(),
|
|
@@ -91,45 +122,47 @@ var CSS3DRenderPlugin = function CSS3DRenderPlugin(five) {
|
|
|
91
122
|
scene = _ref.scene,
|
|
92
123
|
css3DRenderer = _ref.css3DRenderer;
|
|
93
124
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
var
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
125
|
+
var render = function () {
|
|
126
|
+
if (!inited) {
|
|
127
|
+
var css3DRendererSetSize = function css3DRendererSetSize() {
|
|
128
|
+
var rendererWidth = (0, _evenNumber["default"])(fiveElement.clientWidth);
|
|
129
|
+
var rendererHeight = (0, _evenNumber["default"])(fiveElement.clientHeight);
|
|
130
|
+
css3DRenderer.setSize(rendererWidth, rendererHeight);
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
css3DRendererSetSize();
|
|
134
|
+
resizeObserver = new ResizeObserver(css3DRendererSetSize);
|
|
135
|
+
css3DRenderer.domElement.style.position = 'absolute';
|
|
136
|
+
css3DRenderer.domElement.style.top = '0';
|
|
137
|
+
css3DRenderer.domElement.style.userSelect = 'none';
|
|
138
|
+
css3DRenderer.domElement.style.pointerEvents = 'none';
|
|
139
|
+
|
|
140
|
+
var renderEveryFrame = function renderEveryFrame() {
|
|
141
|
+
if (stopRenderFlag) return;
|
|
142
|
+
requestAnimationFrameId = requestAnimationFrame(renderEveryFrame);
|
|
143
|
+
css3DRenderer.render(scene, five.camera);
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
return function () {
|
|
147
|
+
var _resizeObserver;
|
|
148
|
+
|
|
149
|
+
scene.add(css3DObject);
|
|
150
|
+
(_resizeObserver = resizeObserver) === null || _resizeObserver === void 0 ? void 0 : _resizeObserver.observe(fiveElement);
|
|
151
|
+
renderEveryFrame();
|
|
152
|
+
|
|
153
|
+
if (mode === 'behind' && mesh) {
|
|
154
|
+
five.scene.add(mesh);
|
|
155
|
+
disposers.push(function () {
|
|
156
|
+
return mesh && five.scene.remove(mesh);
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
} else {
|
|
161
|
+
return function () {
|
|
162
|
+
scene.add(css3DObject);
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
}();
|
|
133
166
|
|
|
134
167
|
if (frontModeUnInited) {
|
|
135
168
|
var wrapper = fiveElement.parentElement || document.body;
|
|
@@ -1,12 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
require("core-js/modules/es.array.iterator.js");
|
|
4
|
+
|
|
5
|
+
require("core-js/modules/es.string.iterator.js");
|
|
6
|
+
|
|
7
|
+
require("core-js/modules/es.weak-map.js");
|
|
8
|
+
|
|
9
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
10
|
+
|
|
11
|
+
require("core-js/modules/es.object.define-property.js");
|
|
12
|
+
|
|
13
|
+
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
14
|
+
|
|
15
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
16
|
+
|
|
17
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
18
|
|
|
5
19
|
Object.defineProperty(exports, "__esModule", {
|
|
6
20
|
value: true
|
|
7
21
|
});
|
|
8
22
|
exports["default"] = exports.CameraMovementPlugin = void 0;
|
|
9
23
|
|
|
24
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
25
|
+
|
|
26
|
+
require("core-js/modules/es.object.to-string.js");
|
|
27
|
+
|
|
28
|
+
require("core-js/modules/es.promise.js");
|
|
29
|
+
|
|
30
|
+
require("core-js/modules/es.object.assign.js");
|
|
31
|
+
|
|
32
|
+
require("core-js/modules/es.string.repeat.js");
|
|
33
|
+
|
|
34
|
+
require("core-js/modules/web.timers.js");
|
|
35
|
+
|
|
36
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
37
|
+
|
|
10
38
|
var _five = require("@realsee/five");
|
|
11
39
|
|
|
12
40
|
var TWEEN = _interopRequireWildcard(require("@tweenjs/tween.js"));
|
|
@@ -23,10 +51,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
23
51
|
|
|
24
52
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
53
|
|
|
26
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
27
|
-
|
|
28
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
29
|
-
|
|
30
54
|
var getLongitudeParams = function getLongitudeParams(from, to, rotation) {
|
|
31
55
|
var PI = Math.PI;
|
|
32
56
|
var PI_2 = PI * 2;
|
|
@@ -55,10 +79,10 @@ var CameraMovementPlugin = function CameraMovementPlugin(five) {
|
|
|
55
79
|
var state = {};
|
|
56
80
|
|
|
57
81
|
var move = /*#__PURE__*/function () {
|
|
58
|
-
var _ref =
|
|
82
|
+
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(args, duration) {
|
|
59
83
|
var opts,
|
|
60
84
|
_args = arguments;
|
|
61
|
-
return
|
|
85
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
62
86
|
while (1) {
|
|
63
87
|
switch (_context.prev = _context.next) {
|
|
64
88
|
case 0:
|
|
@@ -180,14 +204,14 @@ var CameraMovementPlugin = function CameraMovementPlugin(five) {
|
|
|
180
204
|
};
|
|
181
205
|
|
|
182
206
|
var rotate = /*#__PURE__*/function () {
|
|
183
|
-
var _ref2 =
|
|
207
|
+
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(args, duration) {
|
|
184
208
|
var opts,
|
|
185
209
|
_getAnimeParams,
|
|
186
210
|
from,
|
|
187
211
|
to,
|
|
188
212
|
_args2 = arguments;
|
|
189
213
|
|
|
190
|
-
return
|
|
214
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
191
215
|
while (1) {
|
|
192
216
|
switch (_context2.prev = _context2.next) {
|
|
193
217
|
case 0:
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import type { FivePlugin } from '@realsee/five';
|
|
2
2
|
export interface ModelChassisCompassPluginParameterType {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
north_rad?: number;
|
|
4
|
+
fbx_url?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ModelChassisCompassPluginData {
|
|
7
|
+
north_rad?: number;
|
|
8
|
+
fbx_url?: string;
|
|
5
9
|
}
|
|
6
10
|
export interface ModelChassisCompassPluginExportType {
|
|
7
11
|
enable: () => void;
|
|
8
12
|
disable: () => void;
|
|
9
|
-
load: (
|
|
13
|
+
load: (data?: ModelChassisCompassPluginData) => Promise<boolean>;
|
|
10
14
|
}
|
|
11
15
|
/**
|
|
12
16
|
* 模型底盘指南针插件
|