@realsee/dnalogel 0.1.0
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/README.md +94 -0
- package/TERMS.txt +56 -0
- package/components/ARVideoFigure/ARVideoFigureMesh.d.ts +44 -0
- package/components/ARVideoFigure/ARVideoFigureMesh.js +347 -0
- package/components/ARVideoFigure/ARVideoFigureScene.d.ts +11 -0
- package/components/ARVideoFigure/ARVideoFigureScene.js +74 -0
- package/components/ARVideoFigure/ImgBgTransparent.d.ts +16 -0
- package/components/ARVideoFigure/ImgBgTransparent.js +49 -0
- package/components/ARVideoFigure/ImgBgTransparentMesh.d.ts +30 -0
- package/components/ARVideoFigure/ImgBgTransparentMesh.js +173 -0
- package/components/ARVideoFigure/fragmentShader.d.ts +5 -0
- package/components/ARVideoFigure/fragmentShader.js +16 -0
- package/components/ARVideoFigure/index.d.ts +15 -0
- package/components/ARVideoFigure/index.js +64 -0
- package/components/ARVideoFigure/vertexShader.d.ts +1 -0
- package/components/ARVideoFigure/vertexShader.js +8 -0
- package/components/GlassFilters/index.d.ts +32 -0
- package/components/GlassFilters/index.js +54 -0
- package/components/ModelView/ModelViewController.d.ts +18 -0
- package/components/ModelView/ModelViewController.js +147 -0
- package/components/ModelView/index.d.ts +10 -0
- package/components/ModelView/index.js +22 -0
- package/components/PBRView/index.d.ts +14 -0
- package/components/PBRView/index.js +31 -0
- package/components/PaintBrush/index.d.ts +16 -0
- package/components/PaintBrush/index.js +33 -0
- package/components/PanoTag/index.d.ts +4 -0
- package/components/PanoTag/index.js +11 -0
- package/custom.d.js +3 -0
- package/data/1aGKl9JmrlXMXx8d.d.ts +104 -0
- package/data/1aGKl9JmrlXMXx8d.js +535 -0
- package/data/6gyq3v1verxD7JO1.d.ts +104 -0
- package/data/6gyq3v1verxD7JO1.js +460 -0
- package/data/KpokNd82rwjhackhQTBEoYKHg8zGbPXe.d.ts +84 -0
- package/data/KpokNd82rwjhackhQTBEoYKHg8zGbPXe.js +598 -0
- package/data/PrXel3aqGbp34JQn.d.ts +389 -0
- package/data/PrXel3aqGbp34JQn.js +4639 -0
- package/data/YdoNP9K4rwQDwjJr.d.ts +83 -0
- package/data/YdoNP9K4rwQDwjJr.js +1451 -0
- package/data/auto3d-njL5J99VwCmnjtQElOmXQr.d.ts +86 -0
- package/data/auto3d-njL5J99VwCmnjtQElOmXQr.js +709 -0
- package/data/oPzy3ApbjjpD8YdR.d.ts +83 -0
- package/data/oPzy3ApbjjpD8YdR.js +281 -0
- package/data/qjAxMG4XbPn96wKG.d.ts +104 -0
- package/data/qjAxMG4XbPn96wKG.js +635 -0
- package/data/rXel3aPQRRBD4JQn.d.ts +86 -0
- package/data/rXel3aPQRRBD4JQn.js +620 -0
- package/data/vLykj3NWrllMrG06.d.ts +89 -0
- package/data/vLykj3NWrllMrG06.js +2532 -0
- package/data/wYnRjQ4KZoV1yPoG.d.ts +114 -0
- package/data/wYnRjQ4KZoV1yPoG.js +512 -0
- package/data/wz0QV9KA4ugyo9ME.d.ts +39 -0
- package/data/wz0QV9KA4ugyo9ME.js +134 -0
- package/examples/FiveStateController/index.js +140 -0
- package/examples/VRHouse/Mobile.js +22 -0
- package/examples/VRHouse/PC.js +22 -0
- package/examples/VRHouse/index.js +22 -0
- package/index.d.ts +15 -0
- package/index.js +43 -0
- package/package.json +19 -0
- package/plugins/CSS3DRenderPlugin/components/Marker/index.d.ts +12 -0
- package/plugins/CSS3DRenderPlugin/components/Marker/index.js +113 -0
- package/plugins/CSS3DRenderPlugin/index.d.ts +49 -0
- package/plugins/CSS3DRenderPlugin/index.js +220 -0
- package/plugins/CameraMovementPlugin/index.d.ts +7 -0
- package/plugins/CameraMovementPlugin/index.js +338 -0
- package/plugins/CameraMovementPlugin/typing.d.ts +68 -0
- package/plugins/CameraMovementPlugin/typing.js +35 -0
- package/plugins/ModelChassisCompassPlugin/index.d.ts +15 -0
- package/plugins/ModelChassisCompassPlugin/index.js +156 -0
- package/plugins/ModelEntryDoorGuidePlugin/index.d.ts +10 -0
- package/plugins/ModelEntryDoorGuidePlugin/index.js +16 -0
- package/plugins/ModelTVVideoPlugin/index.d.ts +21 -0
- package/plugins/ModelTVVideoPlugin/index.js +313 -0
- package/plugins/ModelViewPlugin/index.d.ts +17 -0
- package/plugins/ModelViewPlugin/index.js +199 -0
- package/plugins/PanoCursorRaycasterPlugin/PanoCursorRaycasterPluginUsage.d.ts +48 -0
- package/plugins/PanoCursorRaycasterPlugin/components/MovePointTowardsCamera.d.ts +9 -0
- package/plugins/PanoCursorRaycasterPlugin/components/MovePointTowardsCamera.js +113 -0
- package/plugins/PanoCursorRaycasterPlugin/components/PointAxesHelper.d.ts +11 -0
- package/plugins/PanoCursorRaycasterPlugin/components/PointAxesHelper.js +25 -0
- package/plugins/PanoCursorRaycasterPlugin/index.d.ts +49 -0
- package/plugins/PanoCursorRaycasterPlugin/index.js +119 -0
- package/plugins/PanoCursorRaycasterPlugin/utils/addLineToFive.d.ts +5 -0
- package/plugins/PanoCursorRaycasterPlugin/utils/addLineToFive.js +25 -0
- package/plugins/PanoCursorRaycasterPlugin/utils/createLine.d.ts +3 -0
- package/plugins/PanoCursorRaycasterPlugin/utils/createLine.js +34 -0
- package/plugins/PanoCursorRaycasterPlugin/utils/vecror3.d.ts +7 -0
- package/plugins/PanoCursorRaycasterPlugin/utils/vecror3.js +18 -0
- package/plugins/PanoDoorLabelPlugin/index.d.ts +4 -0
- package/plugins/PanoDoorLabelPlugin/index.js +12 -0
- package/plugins/PanoIRobotPlugin/index.d.ts +10 -0
- package/plugins/PanoIRobotPlugin/index.js +16 -0
- package/plugins/PanoRulerPlugin/data/roomInfo.d.ts +3 -0
- package/plugins/PanoRulerPlugin/data/roomInfo.js +49 -0
- package/plugins/PanoRulerPlugin/data/roomRules.d.ts +3 -0
- package/plugins/PanoRulerPlugin/data/roomRules.js +233 -0
- package/plugins/PanoRulerPlugin/index.d.ts +27 -0
- package/plugins/PanoRulerPlugin/index.js +589 -0
- package/plugins/PanoRulerPlugin/typings.d.ts +21 -0
- package/plugins/PanoRulerPlugin/typings.js +5 -0
- package/plugins/PanoTVVideoPlugin/index.d.ts +24 -0
- package/plugins/PanoTVVideoPlugin/index.js +351 -0
- package/plugins/TreasurePlugin/Controller.d.ts +32 -0
- package/plugins/TreasurePlugin/Controller.js +175 -0
- package/plugins/TreasurePlugin/TreasureFaceAnime.d.ts +23 -0
- package/plugins/TreasurePlugin/TreasureFaceAnime.js +128 -0
- package/plugins/TreasurePlugin/TreasureObject.d.ts +35 -0
- package/plugins/TreasurePlugin/TreasureObject.js +186 -0
- package/plugins/TreasurePlugin/TreasureOpenAnime.d.ts +23 -0
- package/plugins/TreasurePlugin/TreasureOpenAnime.js +103 -0
- package/plugins/TreasurePlugin/constants.d.ts +12 -0
- package/plugins/TreasurePlugin/constants.js +30 -0
- package/plugins/TreasurePlugin/index.d.ts +11 -0
- package/plugins/TreasurePlugin/index.js +16 -0
- package/plugins/TreasurePlugin/treasureDataMap.d.ts +7 -0
- package/plugins/TreasurePlugin/treasureDataMap.js +20 -0
- package/plugins/TreasurePlugin/typings.d.ts +2 -0
- package/plugins/TreasurePlugin/typings.js +5 -0
- package/plugins/TreasurePlugin/utils/loadTreasureTextures.d.ts +7 -0
- package/plugins/TreasurePlugin/utils/loadTreasureTextures.js +115 -0
- package/plugins/floorplan/Assets/floorplanExtraObject.d.ts +1 -0
- package/plugins/floorplan/Assets/floorplanExtraObject.js +8 -0
- package/plugins/floorplan/ModelFloorplanPlugin/Controller.d.ts +100 -0
- package/plugins/floorplan/ModelFloorplanPlugin/Controller.js +643 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/Camera.d.ts +13 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/Camera.js +58 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/Compass.d.ts +5 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/Compass.js +69 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomHighlight.d.ts +10 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomHighlight.js +105 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomLabels.d.ts +13 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomLabels.js +95 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/index.d.ts +13 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/index.js +48 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/index.d.ts +20 -0
- package/plugins/floorplan/ModelFloorplanPlugin/components/index.js +66 -0
- package/plugins/floorplan/ModelFloorplanPlugin/controller.style.d.ts +1 -0
- package/plugins/floorplan/ModelFloorplanPlugin/controller.style.js +14 -0
- package/plugins/floorplan/ModelFloorplanPlugin/index.d.ts +9 -0
- package/plugins/floorplan/ModelFloorplanPlugin/index.js +18 -0
- package/plugins/floorplan/ModelFloorplanPlugin/typings/events.type.d.ts +23 -0
- package/plugins/floorplan/ModelFloorplanPlugin/typings/events.type.js +5 -0
- package/plugins/floorplan/ModelFloorplanPlugin/utils/constant.d.ts +15 -0
- package/plugins/floorplan/ModelFloorplanPlugin/utils/constant.js +31 -0
- package/plugins/floorplan/ModelFloorplanPlugin/utils/correctFiveState.d.ts +14 -0
- package/plugins/floorplan/ModelFloorplanPlugin/utils/correctFiveState.js +162 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.d.ts +13 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.js +91 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.style.d.ts +3 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.style.js +35 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/ExtraObjects.d.ts +5 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/ExtraObjects.js +50 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/RoomHighlight.d.ts +9 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/RoomHighlight.js +102 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/index.d.ts +11 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/index.js +42 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.d.ts +17 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.js +75 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.style.d.ts +2 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.style.js +13 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +33 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Controller.js +214 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/index.d.ts +8 -0
- package/plugins/floorplan/PanoFloorplanRadarPlugin/index.js +18 -0
- package/plugins/floorplan/TopviewFloorplanPlugin/Controller.d.ts +55 -0
- package/plugins/floorplan/TopviewFloorplanPlugin/Controller.js +267 -0
- package/plugins/floorplan/TopviewFloorplanPlugin/index.d.ts +5 -0
- package/plugins/floorplan/TopviewFloorplanPlugin/index.js +16 -0
- package/plugins/floorplan/TopviewFloorplanPlugin/style.d.ts +1 -0
- package/plugins/floorplan/TopviewFloorplanPlugin/style.js +14 -0
- package/plugins/floorplan/components/FloorplanImage.d.ts +7 -0
- package/plugins/floorplan/components/FloorplanImage.js +76 -0
- package/plugins/floorplan/typings/floorplanData.d.ts +127 -0
- package/plugins/floorplan/typings/floorplanData.js +5 -0
- package/plugins/floorplan/typings/floorplanServerData.d.ts +125 -0
- package/plugins/floorplan/typings/floorplanServerData.js +380 -0
- package/plugins/floorplan/utils/formatData.d.ts +5 -0
- package/plugins/floorplan/utils/formatData.js +220 -0
- package/plugins/floorplan/utils/formatPosition.d.ts +37 -0
- package/plugins/floorplan/utils/formatPosition.js +87 -0
- package/shared-utils/Preloader.d.ts +6 -0
- package/shared-utils/Preloader.js +51 -0
- package/shared-utils/Subscribe.d.ts +45 -0
- package/shared-utils/Subscribe.js +210 -0
- package/shared-utils/animationFrame/BetterTween.d.ts +11 -0
- package/shared-utils/animationFrame/BetterTween.js +102 -0
- package/shared-utils/animationFrame/calculateProgress.d.ts +8 -0
- package/shared-utils/animationFrame/calculateProgress.js +38 -0
- package/shared-utils/animationFrame/formatRad.d.ts +15 -0
- package/shared-utils/animationFrame/formatRad.js +34 -0
- package/shared-utils/animationFrame/index.d.ts +15 -0
- package/shared-utils/animationFrame/index.js +69 -0
- package/shared-utils/animationFrame/tween.d.ts +75 -0
- package/shared-utils/animationFrame/tween.js +76 -0
- package/shared-utils/changeModelCanvansOpacity.d.ts +2 -0
- package/shared-utils/changeModelCanvansOpacity.js +24 -0
- package/shared-utils/createFiveContainer.d.ts +10 -0
- package/shared-utils/createFiveContainer.js +165 -0
- package/shared-utils/createLine/index.d.ts +3 -0
- package/shared-utils/createLine/index.js +29 -0
- package/shared-utils/debounce.d.ts +6 -0
- package/shared-utils/debounce.js +26 -0
- package/shared-utils/equal.d.ts +11 -0
- package/shared-utils/equal.js +96 -0
- package/shared-utils/filter.d.ts +27 -0
- package/shared-utils/filter.js +93 -0
- package/shared-utils/five/changeMode.d.ts +2 -0
- package/shared-utils/five/changeMode.js +86 -0
- package/shared-utils/five/useFivePlugin.d.ts +1 -0
- package/shared-utils/five/useFivePlugin.js +15 -0
- package/shared-utils/formatRad.d.ts +7 -0
- package/shared-utils/formatRad.js +16 -0
- package/shared-utils/getPxmm.d.ts +6 -0
- package/shared-utils/getPxmm.js +37 -0
- package/shared-utils/getRandomColor.d.ts +1 -0
- package/shared-utils/getRandomColor.js +13 -0
- package/shared-utils/isTruelyObject.d.ts +18 -0
- package/shared-utils/isTruelyObject.js +27 -0
- package/shared-utils/math/evenNumber.d.ts +1 -0
- package/shared-utils/math/evenNumber.js +11 -0
- package/shared-utils/math/planimetry.d.ts +116 -0
- package/shared-utils/math/planimetry.js +342 -0
- package/shared-utils/math/rad2Deg.d.ts +1 -0
- package/shared-utils/math/rad2Deg.js +10 -0
- package/shared-utils/nearlyEqual.d.ts +7 -0
- package/shared-utils/nearlyEqual.js +17 -0
- package/shared-utils/nextFrame.d.ts +1 -0
- package/shared-utils/nextFrame.js +13 -0
- package/shared-utils/noop.d.ts +5 -0
- package/shared-utils/noop.js +17 -0
- package/shared-utils/object3d2LocalMatrix.d.ts +12 -0
- package/shared-utils/object3d2LocalMatrix.js +73 -0
- package/shared-utils/px2rem.d.ts +1 -0
- package/shared-utils/px2rem.js +12 -0
- package/shared-utils/tap.d.ts +8 -0
- package/shared-utils/tap.js +19 -0
- package/shared-utils/three/centerPoint.d.ts +2 -0
- package/shared-utils/three/centerPoint.js +12 -0
- package/shared-utils/three/getNormal.d.ts +2 -0
- package/shared-utils/three/getNormal.js +13 -0
- package/shared-utils/three/loadFbxObj.d.ts +3 -0
- package/shared-utils/three/loadFbxObj.js +42 -0
- package/shared-utils/three/loadTexture.d.ts +2 -0
- package/shared-utils/three/loadTexture.js +38 -0
- package/shared-utils/three/vecror3.d.ts +7 -0
- package/shared-utils/three/vecror3.js +18 -0
- package/shared-utils/throttle.d.ts +7 -0
- package/shared-utils/throttle.js +25 -0
- package/shared-utils/to.d.ts +9 -0
- package/shared-utils/to.js +25 -0
- package/shared-utils/useDebounce.d.ts +8 -0
- package/shared-utils/useDebounce.js +43 -0
- package/shared-utils/useThrottle.d.ts +8 -0
- package/shared-utils/useThrottle.js +41 -0
- package/shared-utils/uuid.d.ts +4 -0
- package/shared-utils/uuid.js +20 -0
- package/shared-utils/vectorTocoordinates.d.ts +7 -0
- package/shared-utils/vectorTocoordinates.js +16 -0
- package/typedoc/components.d.ts +6 -0
- package/typedoc/components.js +5 -0
- package/typedoc/plugins.d.ts +17 -0
- package/typedoc/plugins.js +113 -0
- package/typedoc/shared-utils.d.ts +3 -0
- package/typedoc/shared-utils.js +5 -0
- package/typedoc/typings.d.ts +3 -0
- package/typedoc/typings.js +5 -0
- package/typings/math.type.d.ts +44 -0
- package/typings/math.type.js +5 -0
- package/typings/utils.type.d.ts +2 -0
- package/typings/utils.type.js +5 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = createLine;
|
|
9
|
+
|
|
10
|
+
var THREE = _interopRequireWildcard(require("three"));
|
|
11
|
+
|
|
12
|
+
var _line = require("@realsee/five/line");
|
|
13
|
+
|
|
14
|
+
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); }
|
|
15
|
+
|
|
16
|
+
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; }
|
|
17
|
+
|
|
18
|
+
function createLine(point1, point2) {
|
|
19
|
+
var color = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new THREE.Vector3(1, 1, 1);
|
|
20
|
+
var dashed = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
21
|
+
var line = new _line.Line(point1, point2);
|
|
22
|
+
line.setMaterial({
|
|
23
|
+
dashed: dashed,
|
|
24
|
+
color: color,
|
|
25
|
+
linewidth: 1
|
|
26
|
+
});
|
|
27
|
+
line.remove(line.points);
|
|
28
|
+
return line;
|
|
29
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = debounce;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* 创建一个防抖动函数,该函数会在 wait 毫秒后调用 func 方法
|
|
10
|
+
* @param func - 要防抖动的函数
|
|
11
|
+
* @param [wait=0] - 需要延迟的毫秒数
|
|
12
|
+
*/
|
|
13
|
+
function debounce(func) {
|
|
14
|
+
var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
|
|
15
|
+
var last;
|
|
16
|
+
return function () {
|
|
17
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
18
|
+
args[_key] = arguments[_key];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
clearTimeout(last);
|
|
22
|
+
last = setTimeout(function () {
|
|
23
|
+
func.apply(void 0, args);
|
|
24
|
+
}, wait);
|
|
25
|
+
};
|
|
26
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 对象比较
|
|
3
|
+
* @param {*} value 第一个比较的值
|
|
4
|
+
* @param {*} other 第二个比较的值
|
|
5
|
+
* @param {Object} options 可选参数,可选项包括:<br />
|
|
6
|
+
* deep {Boolean} 是否深比较<br />
|
|
7
|
+
* @returns {boolean} 是否相等
|
|
8
|
+
*/
|
|
9
|
+
export default function equal(value: any, other: any, opt?: {
|
|
10
|
+
deep: boolean;
|
|
11
|
+
}): boolean;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = equal;
|
|
7
|
+
|
|
8
|
+
var _isTruelyObject = _interopRequireDefault(require("./isTruelyObject"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
+
|
|
12
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
13
|
+
|
|
14
|
+
function baseIsEqual(value, other) {
|
|
15
|
+
if (value === other) return true;
|
|
16
|
+
if (_typeof(value) !== _typeof(other)) return false;
|
|
17
|
+
if (Number.isNaN(value) && Number.isNaN(other)) return true;
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function objEqualShallow(value, other) {
|
|
22
|
+
var valueProps = Object.getOwnPropertyNames(value);
|
|
23
|
+
var otherProps = Object.getOwnPropertyNames(other);
|
|
24
|
+
if (valueProps.length !== otherProps.length) return false;
|
|
25
|
+
|
|
26
|
+
for (var i = 0, len = valueProps.length; i < len; i++) {
|
|
27
|
+
var propName = valueProps[i];
|
|
28
|
+
if (!baseIsEqual(value[propName], other[propName])) return false;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function arrayEqualShallow(value, other) {
|
|
35
|
+
if (value.length !== other.length) return false;
|
|
36
|
+
|
|
37
|
+
for (var i = 0, len = value.length; i < len; i++) {
|
|
38
|
+
if (!baseIsEqual(value[i], other[i])) return false;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function isShallowEqual(value, other) {
|
|
45
|
+
if (baseIsEqual(value, other)) return true;
|
|
46
|
+
if ((0, _isTruelyObject["default"])(value) && (0, _isTruelyObject["default"])(other)) return objEqualShallow(value, other);
|
|
47
|
+
if (Array.isArray(value) && Array.isArray(other)) return arrayEqualShallow(value, other);
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function isDeepEqual(value, other) {
|
|
52
|
+
if (baseIsEqual(value, other)) return true;
|
|
53
|
+
if ((0, _isTruelyObject["default"])(value) && (0, _isTruelyObject["default"])(other)) return objEqualDeep(value, other);
|
|
54
|
+
if (Array.isArray(value) && Array.isArray(other)) return arrayEqualDeep(value, other);
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function arrayEqualDeep(value, other) {
|
|
59
|
+
if (value.length !== other.length) return false;
|
|
60
|
+
|
|
61
|
+
for (var i = 0, len = value.length; i < len; i++) {
|
|
62
|
+
if (!isDeepEqual(value[i], other[i])) return false;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function objEqualDeep(value, other) {
|
|
69
|
+
var valueProps = Object.getOwnPropertyNames(value);
|
|
70
|
+
var otherProps = Object.getOwnPropertyNames(other);
|
|
71
|
+
if (valueProps.length !== otherProps.length) return false;
|
|
72
|
+
|
|
73
|
+
for (var i = 0, len = valueProps.length; i < len; i++) {
|
|
74
|
+
var propName = valueProps[i];
|
|
75
|
+
if (!isDeepEqual(value[propName], other[propName])) return false;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* 对象比较
|
|
82
|
+
* @param {*} value 第一个比较的值
|
|
83
|
+
* @param {*} other 第二个比较的值
|
|
84
|
+
* @param {Object} options 可选参数,可选项包括:<br />
|
|
85
|
+
* deep {Boolean} 是否深比较<br />
|
|
86
|
+
* @returns {boolean} 是否相等
|
|
87
|
+
*/
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
function equal(value, other) {
|
|
91
|
+
var opt = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
|
92
|
+
deep: false
|
|
93
|
+
};
|
|
94
|
+
if (!opt.deep) return isShallowEqual(value, other);
|
|
95
|
+
return isDeepEqual(value, other);
|
|
96
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 对象属性筛选函数。
|
|
3
|
+
* 基于已有对象生成一个满足条件(属性)新的对象。
|
|
4
|
+
* @param {object} object
|
|
5
|
+
* @param {Function} check
|
|
6
|
+
*/
|
|
7
|
+
export declare function filter<T, K extends keyof T>(object: T, check: (key: K, value: T[K]) => boolean): Record<K, T[K]>;
|
|
8
|
+
/**
|
|
9
|
+
* 对象镜子函数。
|
|
10
|
+
* 生成一个"镜子"对象:对象的属性名与其值相同。
|
|
11
|
+
* @param {string[]} strings 对象属性
|
|
12
|
+
*/
|
|
13
|
+
export declare function mirror(strings: string[]): Record<string, string>;
|
|
14
|
+
/**
|
|
15
|
+
* 过滤掉不需要的对象字段函数:实现从一个对象中排除某些指定属性后生成的新对象。
|
|
16
|
+
* @param object
|
|
17
|
+
* @param props 排除的属性
|
|
18
|
+
* @return
|
|
19
|
+
*/
|
|
20
|
+
export declare function omit<T, K extends keyof T>(object: T, props: Extract<K[], string[]>): Omit<T, K>;
|
|
21
|
+
/**
|
|
22
|
+
* 筛选需要的对象字段:实现从一个对象中选择某些指定属性生成新的对象(与`omit()`功能相反)。
|
|
23
|
+
* @param {object} object
|
|
24
|
+
* @param {string[]} props
|
|
25
|
+
* @return {object}
|
|
26
|
+
*/
|
|
27
|
+
export declare function pick<T, K extends keyof T>(object: T, props: K[]): Pick<T, K>;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.filter = filter;
|
|
7
|
+
exports.mirror = mirror;
|
|
8
|
+
exports.omit = omit;
|
|
9
|
+
exports.pick = pick;
|
|
10
|
+
|
|
11
|
+
var _tap = _interopRequireDefault(require("./tap"));
|
|
12
|
+
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
14
|
+
|
|
15
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
16
|
+
|
|
17
|
+
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); }
|
|
18
|
+
|
|
19
|
+
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; }
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 对象属性筛选函数。
|
|
23
|
+
* 基于已有对象生成一个满足条件(属性)新的对象。
|
|
24
|
+
* @param {object} object
|
|
25
|
+
* @param {Function} check
|
|
26
|
+
*/
|
|
27
|
+
function filter(object, check) {
|
|
28
|
+
return (0, _tap["default"])({}, function (result) {
|
|
29
|
+
Object.keys(object).forEach(function (key) {
|
|
30
|
+
var _key = key;
|
|
31
|
+
|
|
32
|
+
if (check(_key, object[_key])) {
|
|
33
|
+
result[_key] = object[_key];
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* 对象镜子函数。
|
|
40
|
+
* 生成一个"镜子"对象:对象的属性名与其值相同。
|
|
41
|
+
* @param {string[]} strings 对象属性
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
function mirror(strings) {
|
|
46
|
+
return (0, _tap["default"])({}, function (result) {
|
|
47
|
+
var _iterator = _createForOfIteratorHelper(strings),
|
|
48
|
+
_step;
|
|
49
|
+
|
|
50
|
+
try {
|
|
51
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
52
|
+
var string = _step.value;
|
|
53
|
+
result[string] = string;
|
|
54
|
+
}
|
|
55
|
+
} catch (err) {
|
|
56
|
+
_iterator.e(err);
|
|
57
|
+
} finally {
|
|
58
|
+
_iterator.f();
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* 过滤掉不需要的对象字段函数:实现从一个对象中排除某些指定属性后生成的新对象。
|
|
64
|
+
* @param object
|
|
65
|
+
* @param props 排除的属性
|
|
66
|
+
* @return
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
function omit(object, props) {
|
|
71
|
+
return (0, _tap["default"])({}, function (result) {
|
|
72
|
+
for (var name in object) {
|
|
73
|
+
if (props.indexOf(name) !== -1) continue;
|
|
74
|
+
result[name] = object[name];
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* 筛选需要的对象字段:实现从一个对象中选择某些指定属性生成新的对象(与`omit()`功能相反)。
|
|
80
|
+
* @param {object} object
|
|
81
|
+
* @param {string[]} props
|
|
82
|
+
* @return {object}
|
|
83
|
+
*/
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
function pick(object, props) {
|
|
87
|
+
// eslint-disable-next-line no-return-assign
|
|
88
|
+
return (0, _tap["default"])({}, function (result) {
|
|
89
|
+
return props.forEach(function (prop) {
|
|
90
|
+
return result[prop] = object[prop];
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = changeMode;
|
|
7
|
+
|
|
8
|
+
var _to = _interopRequireDefault(require("../to"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
+
|
|
12
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
13
|
+
|
|
14
|
+
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."); }
|
|
15
|
+
|
|
16
|
+
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); }
|
|
17
|
+
|
|
18
|
+
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; }
|
|
19
|
+
|
|
20
|
+
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; }
|
|
21
|
+
|
|
22
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
23
|
+
|
|
24
|
+
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); } }
|
|
25
|
+
|
|
26
|
+
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); }); }; }
|
|
27
|
+
|
|
28
|
+
function changeMode(_x) {
|
|
29
|
+
return _changeMode.apply(this, arguments);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function _changeMode() {
|
|
33
|
+
_changeMode = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(five) {
|
|
34
|
+
var _len,
|
|
35
|
+
changeModeParams,
|
|
36
|
+
_key,
|
|
37
|
+
_yield$to,
|
|
38
|
+
_yield$to2,
|
|
39
|
+
changeModeError,
|
|
40
|
+
_args = arguments;
|
|
41
|
+
|
|
42
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
43
|
+
while (1) {
|
|
44
|
+
switch (_context.prev = _context.next) {
|
|
45
|
+
case 0:
|
|
46
|
+
for (_len = _args.length, changeModeParams = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
47
|
+
changeModeParams[_key - 1] = _args[_key];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
_context.next = 3;
|
|
51
|
+
return (0, _to["default"])(five.changeMode.apply(five, changeModeParams));
|
|
52
|
+
|
|
53
|
+
case 3:
|
|
54
|
+
_yield$to = _context.sent;
|
|
55
|
+
_yield$to2 = _slicedToArray(_yield$to, 1);
|
|
56
|
+
changeModeError = _yield$to2[0];
|
|
57
|
+
|
|
58
|
+
if (!changeModeError) {
|
|
59
|
+
_context.next = 8;
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
throw changeModeError;
|
|
64
|
+
|
|
65
|
+
case 8:
|
|
66
|
+
_context.next = 10;
|
|
67
|
+
return new Promise(function (reslove, reject) {
|
|
68
|
+
five.once('initAnimationEnded', reslove);
|
|
69
|
+
|
|
70
|
+
var handleModeChange = function handleModeChange(mode) {
|
|
71
|
+
if (mode !== changeModeParams[0]) reject('changeMode 被中断');
|
|
72
|
+
five.off('modeChange', handleModeChange);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
five.on('modeChange', handleModeChange);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
case 10:
|
|
79
|
+
case "end":
|
|
80
|
+
return _context.stop();
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}, _callee);
|
|
84
|
+
}));
|
|
85
|
+
return _changeMode.apply(this, arguments);
|
|
86
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useFivePlugin<T extends (...args: any) => any>(name: string): ReturnType<T>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useFivePlugin = useFivePlugin;
|
|
7
|
+
|
|
8
|
+
var _react = require("@realsee/five/react");
|
|
9
|
+
|
|
10
|
+
function useFivePlugin(name) {
|
|
11
|
+
var five = (0, _react.unsafe__useFiveInstance)();
|
|
12
|
+
var plugin = five.plugins[name];
|
|
13
|
+
if (!plugin) throw new Error("can not find plugin \"".concat(name, "\""));
|
|
14
|
+
return plugin;
|
|
15
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.formatRad = formatRad;
|
|
7
|
+
var PI_2 = Math.PI * 2;
|
|
8
|
+
/**
|
|
9
|
+
* 将弧度转成 0 - 2PI 中的值
|
|
10
|
+
* @param rad - 任意弧度值
|
|
11
|
+
* @return 0 - 2PI 的数值
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
function formatRad(rad) {
|
|
15
|
+
return (rad % PI_2 + PI_2) % PI_2;
|
|
16
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = getPxmm;
|
|
9
|
+
|
|
10
|
+
var THREE = _interopRequireWildcard(require("three"));
|
|
11
|
+
|
|
12
|
+
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); }
|
|
13
|
+
|
|
14
|
+
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; }
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* 获取「在俯视图」状态下,模型 mm 与屏幕像素 px 的对应关系,即每 mm 对应多少 px
|
|
18
|
+
* @param five five
|
|
19
|
+
*/
|
|
20
|
+
function getPxmm(five, container) {
|
|
21
|
+
var boundingCenter = new THREE.Vector3(0, 0, 0);
|
|
22
|
+
five.model.bounding.getCenter(boundingCenter);
|
|
23
|
+
var boundingCenterY = boundingCenter.y;
|
|
24
|
+
|
|
25
|
+
var _five$getCurrentState = five.getCurrentState(),
|
|
26
|
+
longitude = _five$getCurrentState.longitude; // 因为模型可能经过旋转,所以屏幕水平方向上的 1m 对应 X 轴距离需要转换
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
var X = 1 / Math.abs(Math.cos(longitude)); // 模型绕 (boundingCenterX, boundingCenterY, boundingCenterZ) 旋转
|
|
30
|
+
|
|
31
|
+
var originPosition = new THREE.Vector3(0, boundingCenterY, 0);
|
|
32
|
+
var originPositionXUnit = new THREE.Vector3(X, boundingCenterY, 0);
|
|
33
|
+
var mouse = originPosition.project(five.camera);
|
|
34
|
+
var xUnitMouse = originPositionXUnit.project(five.camera);
|
|
35
|
+
var pxmm = Math.abs((xUnitMouse.x - mouse.x) / 1000) * (container.getBoundingClientRect().width / 2);
|
|
36
|
+
return pxmm;
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function getRandomColor(): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = getRandomColor;
|
|
7
|
+
|
|
8
|
+
function getRandomColor() {
|
|
9
|
+
var color = '#' + '0123456789abcdef'.split('').map(function (v, i, a) {
|
|
10
|
+
return i > 5 ? null : a[Math.floor(Math.random() * 16)];
|
|
11
|
+
}).join('');
|
|
12
|
+
return color;
|
|
13
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 检查一个值是否是狭义上的对象
|
|
3
|
+
* @param {any} value 要检查的值
|
|
4
|
+
*
|
|
5
|
+
* isTruelyObject({})
|
|
6
|
+
* // => true
|
|
7
|
+
*
|
|
8
|
+
* isObjectLike([1, 2, 3])
|
|
9
|
+
* // => false
|
|
10
|
+
*
|
|
11
|
+
* isObjectLike(Function)
|
|
12
|
+
* // => false
|
|
13
|
+
*
|
|
14
|
+
* isObjectLike(null)
|
|
15
|
+
* // => false
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
export default function isTruelyObject(value: any): boolean;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = isTruelyObject;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* 检查一个值是否是狭义上的对象
|
|
10
|
+
* @param {any} value 要检查的值
|
|
11
|
+
*
|
|
12
|
+
* isTruelyObject({})
|
|
13
|
+
* // => true
|
|
14
|
+
*
|
|
15
|
+
* isObjectLike([1, 2, 3])
|
|
16
|
+
* // => false
|
|
17
|
+
*
|
|
18
|
+
* isObjectLike(Function)
|
|
19
|
+
* // => false
|
|
20
|
+
*
|
|
21
|
+
* isObjectLike(null)
|
|
22
|
+
* // => false
|
|
23
|
+
*
|
|
24
|
+
*/
|
|
25
|
+
function isTruelyObject(value) {
|
|
26
|
+
return Object.prototype.toString.call(value) === '[object Object]';
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function evenNumber(num: number): number;
|