@realsee/dnalogel 0.1.7 → 2.0.0-alpha.3
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 +6 -89
- package/dist/dnalogel.cjs.js +2 -0
- package/dist/dnalogel.es.js +37288 -0
- package/dist/dnalogel.umd.js +2 -0
- package/dist/style.css +1 -0
- package/{plugins → libs}/CSS3DRenderPlugin/index.d.ts +1 -1
- package/libs/CSS3DRenderPlugin/index.js +181 -0
- package/libs/CSS3DRenderPlugin/utils/createResizeObserver.d.ts +7 -0
- package/libs/CSS3DRenderPlugin/utils/createResizeObserver.js +18 -0
- package/{plugins → libs}/CameraMovementPlugin/index.d.ts +0 -0
- package/libs/CameraMovementPlugin/index.js +159 -0
- package/{plugins → libs}/CameraMovementPlugin/typing.d.ts +0 -0
- package/libs/CameraMovementPlugin/typing.js +17 -0
- package/{plugins → libs}/ModelChassisCompassPlugin/index.d.ts +1 -1
- package/libs/ModelChassisCompassPlugin/index.js +75 -0
- package/{plugins → libs}/ModelEntryDoorGuidePlugin/index.d.ts +6 -2
- package/libs/ModelEntryDoorGuidePlugin/index.js +136 -0
- package/libs/ModelRoomLabelPlugin/Assets/roomLabelBg.d.ts +1 -0
- package/libs/ModelRoomLabelPlugin/Assets/roomLabelBg.js +1 -0
- package/{plugins → libs}/ModelRoomLabelPlugin/Controller.d.ts +3 -2
- package/libs/ModelRoomLabelPlugin/Controller.js +100 -0
- package/libs/ModelRoomLabelPlugin/RoomLabelItem.svelte +63 -0
- package/libs/ModelRoomLabelPlugin/RoomLabelItem.svelte.map +1 -0
- package/libs/ModelRoomLabelPlugin/RoomLabelItems.svelte +80 -0
- package/libs/ModelRoomLabelPlugin/RoomLabelItems.svelte.map +1 -0
- package/libs/ModelRoomLabelPlugin/index.d.ts +12 -0
- package/libs/ModelRoomLabelPlugin/index.js +9 -0
- package/{plugins → libs}/ModelRoomLabelPlugin/typings.d.ts +2 -2
- package/libs/ModelRoomLabelPlugin/typings.js +1 -0
- package/{plugins → libs}/ModelRoomLabelPlugin/utils/parseData.d.ts +0 -0
- package/libs/ModelRoomLabelPlugin/utils/parseData.js +14 -0
- package/{plugins → libs}/ModelViewPlugin/index.d.ts +0 -0
- package/libs/ModelViewPlugin/index.js +160 -0
- package/libs/PanoCompassPlugin/index.d.ts +25 -0
- package/libs/PanoCompassPlugin/index.js +89 -0
- package/{plugins → libs}/PanoCursorRaycasterPlugin/index.d.ts +2 -3
- package/libs/PanoCursorRaycasterPlugin/index.js +74 -0
- package/libs/floorplan/Assets/camera.d.ts +1 -0
- package/libs/floorplan/Assets/camera.js +1 -0
- package/libs/floorplan/Assets/floorplanExtraObject.d.ts +1 -0
- package/libs/floorplan/Assets/floorplanExtraObject.js +1 -0
- package/libs/floorplan/Components/BaseImage.svelte +25 -0
- package/libs/floorplan/Components/BaseImage.svelte.map +1 -0
- package/libs/floorplan/Components/Normalmage.svelte +11 -0
- package/libs/floorplan/Components/Normalmage.svelte.map +1 -0
- package/libs/floorplan/Components/RoomHighlight/Room.svelte +21 -0
- package/libs/floorplan/Components/RoomHighlight/Room.svelte.map +1 -0
- package/libs/floorplan/Components/RoomHighlight/RoomHighlight.svelte +60 -0
- package/libs/floorplan/Components/RoomHighlight/RoomHighlight.svelte.map +1 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial.svelte +35 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial.svelte.map +1 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.svelte +7 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.svelte.map +1 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.svelte +16 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.svelte.map +1 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.svelte +17 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.svelte.map +1 -0
- package/libs/floorplan/Components/SvgImage.svelte +25 -0
- package/libs/floorplan/Components/SvgImage.svelte.map +1 -0
- package/libs/floorplan/ModelFloorplanPlugin/Assets/compass.d.ts +1 -0
- package/libs/floorplan/ModelFloorplanPlugin/Assets/compass.js +1 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.svelte +46 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.svelte.map +1 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.svelte +48 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.svelte.map +1 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.svelte +37 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.svelte.map +1 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/Main.svelte +50 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/Main.svelte.map +1 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.svelte +41 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.svelte.map +1 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.svelte +25 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.svelte.map +1 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.svelte +148 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.svelte.map +1 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.svelte +15 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.svelte.map +1 -0
- package/{plugins → libs}/floorplan/ModelFloorplanPlugin/Controller.d.ts +16 -14
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +357 -0
- package/{plugins → libs}/floorplan/ModelFloorplanPlugin/index.d.ts +1 -1
- package/libs/floorplan/ModelFloorplanPlugin/index.js +5 -0
- package/{plugins → libs}/floorplan/ModelFloorplanPlugin/typings/events.type.d.ts +0 -0
- package/libs/floorplan/ModelFloorplanPlugin/typings/events.type.js +1 -0
- package/{plugins → libs}/floorplan/ModelFloorplanPlugin/utils/constant.d.ts +1 -1
- package/libs/floorplan/ModelFloorplanPlugin/utils/constant.js +16 -0
- package/{plugins → libs}/floorplan/ModelFloorplanPlugin/utils/correctFiveState.d.ts +0 -0
- package/libs/floorplan/ModelFloorplanPlugin/utils/correctFiveState.js +46 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.svelte +84 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.svelte.map +1 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.svelte +18 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.svelte.map +1 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.svelte +40 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.svelte.map +1 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.svelte +61 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.svelte.map +1 -0
- package/{plugins → libs}/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +6 -11
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +88 -0
- package/{plugins → libs}/floorplan/PanoFloorplanRadarPlugin/index.d.ts +0 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +5 -0
- package/{plugins → libs}/floorplan/TopviewFloorplanPlugin/Controller.d.ts +15 -11
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +189 -0
- package/{plugins → libs}/floorplan/TopviewFloorplanPlugin/index.d.ts +0 -0
- package/libs/floorplan/TopviewFloorplanPlugin/index.js +5 -0
- package/{plugins → libs}/floorplan/TopviewFloorplanPlugin/style.d.ts +0 -0
- package/libs/floorplan/TopviewFloorplanPlugin/style.js +8 -0
- package/{plugins → libs}/floorplan/typings/floorplanData.d.ts +6 -0
- package/libs/floorplan/typings/floorplanData.js +6 -0
- package/{plugins → libs}/floorplan/typings/floorplanServerData.d.ts +4 -2
- package/libs/floorplan/typings/floorplanServerData.js +101 -0
- package/libs/floorplan/typings/utility.d.ts +2 -0
- package/libs/floorplan/typings/utility.js +1 -0
- package/{plugins → libs}/floorplan/utils/formatData.d.ts +3 -3
- package/libs/floorplan/utils/formatData.js +94 -0
- package/{plugins → libs}/floorplan/utils/formatPosition.d.ts +3 -4
- package/libs/floorplan/utils/formatPosition.js +50 -0
- package/libs/index.d.ts +19 -0
- package/libs/index.js +11 -0
- package/{shared-utils → libs/shared-utils}/Preloader.d.ts +0 -0
- package/libs/shared-utils/Preloader.js +38 -0
- package/{shared-utils → libs/shared-utils}/Subscribe.d.ts +3 -3
- package/libs/shared-utils/Subscribe.js +101 -0
- package/{shared-utils → libs/shared-utils}/animationFrame/BetterTween.d.ts +0 -0
- package/libs/shared-utils/animationFrame/BetterTween.js +30 -0
- package/{shared-utils → libs/shared-utils}/animationFrame/calculateProgress.d.ts +0 -0
- package/libs/shared-utils/animationFrame/calculateProgress.js +23 -0
- package/{shared-utils → libs/shared-utils}/animationFrame/formatRad.d.ts +0 -0
- package/libs/shared-utils/animationFrame/formatRad.js +20 -0
- package/{shared-utils → libs/shared-utils}/animationFrame/index.d.ts +0 -0
- package/libs/shared-utils/animationFrame/index.js +48 -0
- package/{shared-utils → libs/shared-utils}/animationFrame/tween.d.ts +0 -0
- package/libs/shared-utils/animationFrame/tween.js +44 -0
- package/libs/shared-utils/changeModelCanvasOpacity.d.ts +2 -0
- package/libs/shared-utils/changeModelCanvasOpacity.js +15 -0
- package/{shared-utils → libs/shared-utils}/createCanvasTextTexture.d.ts +0 -0
- package/libs/shared-utils/createCanvasTextTexture.js +19 -0
- package/{shared-utils → libs/shared-utils}/createLine/index.d.ts +1 -1
- package/libs/shared-utils/createLine/index.js +8 -0
- package/{shared-utils → libs/shared-utils}/debounce.d.ts +1 -1
- package/libs/shared-utils/debounce.js +14 -0
- package/{shared-utils → libs/shared-utils}/equal.d.ts +0 -0
- package/libs/shared-utils/equal.js +84 -0
- package/{shared-utils → libs/shared-utils}/filter.d.ts +0 -0
- package/libs/shared-utils/filter.js +53 -0
- package/{shared-utils → libs/shared-utils}/five/changeMode.d.ts +0 -0
- package/libs/shared-utils/five/changeMode.js +15 -0
- package/{shared-utils → libs/shared-utils}/five/useFivePlugin.d.ts +0 -0
- package/libs/shared-utils/five/useFivePlugin.js +8 -0
- package/{shared-utils → libs/shared-utils}/formatRad.d.ts +0 -0
- package/libs/shared-utils/formatRad.js +10 -0
- package/{shared-utils → libs/shared-utils}/getPxmm.d.ts +0 -0
- package/libs/shared-utils/getPxmm.js +20 -0
- package/{shared-utils → libs/shared-utils}/getRandomColor.d.ts +0 -0
- package/libs/shared-utils/getRandomColor.js +10 -0
- package/{shared-utils → libs/shared-utils}/isNil.d.ts +0 -0
- package/libs/shared-utils/isNil.js +14 -0
- package/{shared-utils → libs/shared-utils}/isTruelyObject.d.ts +0 -0
- package/libs/shared-utils/isTruelyObject.js +20 -0
- package/libs/shared-utils/math/evenNumber.d.ts +3 -0
- package/libs/shared-utils/math/evenNumber.js +4 -0
- package/{shared-utils → libs/shared-utils}/math/planimetry.d.ts +4 -4
- package/libs/shared-utils/math/planimetry.js +288 -0
- package/{shared-utils → libs/shared-utils}/math/rad2Deg.d.ts +0 -0
- package/libs/shared-utils/math/rad2Deg.js +3 -0
- package/{shared-utils → libs/shared-utils}/nearlyEqual.d.ts +0 -0
- package/libs/shared-utils/nearlyEqual.js +9 -0
- package/{shared-utils → libs/shared-utils}/nextFrame.d.ts +0 -0
- package/libs/shared-utils/nextFrame.js +6 -0
- package/{shared-utils → libs/shared-utils}/noop.d.ts +0 -0
- package/libs/shared-utils/noop.js +7 -0
- package/{shared-utils → libs/shared-utils}/object3d2LocalMatrix.d.ts +0 -0
- package/libs/shared-utils/object3d2LocalMatrix.js +29 -0
- package/{shared-utils → libs/shared-utils}/px2rem.d.ts +0 -0
- package/libs/shared-utils/px2rem.js +4 -0
- package/libs/shared-utils/removeArrayItem.d.ts +7 -0
- package/libs/shared-utils/removeArrayItem.js +12 -0
- package/{shared-utils → libs/shared-utils}/tap.d.ts +0 -0
- package/{shared-utils → libs/shared-utils}/tap.js +4 -13
- package/{shared-utils → libs/shared-utils}/three/centerPoint.d.ts +0 -0
- package/libs/shared-utils/three/centerPoint.js +4 -0
- package/{shared-utils → libs/shared-utils}/three/getExtraModelLoader.d.ts +0 -0
- package/libs/shared-utils/three/getExtraModelLoader.js +18 -0
- package/{shared-utils → libs/shared-utils}/three/getNormal.d.ts +0 -0
- package/libs/shared-utils/three/getNormal.js +6 -0
- package/{shared-utils → libs/shared-utils}/three/getTextureLoader.d.ts +0 -0
- package/libs/shared-utils/three/getTextureLoader.js +17 -0
- package/{shared-utils → libs/shared-utils}/three/loadFbxObj.d.ts +0 -0
- package/libs/shared-utils/three/loadFbxObj.js +13 -0
- package/libs/shared-utils/three/loadTexture.d.ts +2 -0
- package/libs/shared-utils/three/loadTexture.js +10 -0
- package/{shared-utils → libs/shared-utils}/three/transformPositionToVector3.d.ts +0 -0
- package/libs/shared-utils/three/transformPositionToVector3.js +3 -0
- package/{shared-utils → libs/shared-utils}/three/transfromToMeshBasicMaterial.d.ts +0 -0
- package/libs/shared-utils/three/transfromToMeshBasicMaterial.js +14 -0
- package/{shared-utils → libs/shared-utils}/throttle.d.ts +1 -1
- package/libs/shared-utils/throttle.js +18 -0
- package/{shared-utils → libs/shared-utils}/to.d.ts +0 -0
- package/libs/shared-utils/to.js +18 -0
- package/{shared-utils → libs/shared-utils}/useDebounce.d.ts +0 -0
- package/libs/shared-utils/useDebounce.js +22 -0
- package/{shared-utils → libs/shared-utils}/useThrottle.d.ts +0 -0
- package/libs/shared-utils/useThrottle.js +25 -0
- package/libs/{gltf-viewer → shared-utils}/uuid.d.ts +0 -0
- package/libs/shared-utils/uuid.js +11 -0
- package/{shared-utils → libs/shared-utils}/vectorTocoordinates.d.ts +0 -0
- package/libs/shared-utils/vectorTocoordinates.js +9 -0
- package/{typings → libs/typings}/math.type.d.ts +0 -0
- package/libs/typings/math.type.js +1 -0
- package/{typings → libs/typings}/utils.type.d.ts +0 -0
- package/libs/typings/utils.type.js +1 -0
- package/package.json +45 -17
- package/TERMS.txt +0 -56
- package/components/ARVideoFigure/ARVideoFigureMesh.d.ts +0 -44
- package/components/ARVideoFigure/ARVideoFigureMesh.js +0 -371
- package/components/ARVideoFigure/ARVideoFigureScene.d.ts +0 -11
- package/components/ARVideoFigure/ARVideoFigureScene.js +0 -85
- package/components/ARVideoFigure/ImgBgTransparent.d.ts +0 -16
- package/components/ARVideoFigure/ImgBgTransparent.js +0 -65
- package/components/ARVideoFigure/ImgBgTransparentMesh.d.ts +0 -30
- package/components/ARVideoFigure/ImgBgTransparentMesh.js +0 -183
- package/components/ARVideoFigure/fragmentShader.d.ts +0 -5
- package/components/ARVideoFigure/fragmentShader.js +0 -18
- package/components/ARVideoFigure/index.d.ts +0 -15
- package/components/ARVideoFigure/index.js +0 -80
- package/components/ARVideoFigure/vertexShader.d.ts +0 -1
- package/components/ARVideoFigure/vertexShader.js +0 -10
- package/components/GLTFView/index.d.ts +0 -72
- package/components/GLTFView/index.js +0 -149
- package/components/GlassFilters/index.d.ts +0 -32
- package/components/GlassFilters/index.js +0 -78
- package/components/ModelView/ModelViewController.d.ts +0 -18
- package/components/ModelView/ModelViewController.js +0 -157
- package/components/ModelView/index.d.ts +0 -10
- package/components/ModelView/index.js +0 -24
- package/components/PaintBrush/index.d.ts +0 -16
- package/components/PaintBrush/index.js +0 -47
- package/components/PanoTag/index.d.ts +0 -4
- package/components/PanoTag/index.js +0 -13
- package/custom.d.js +0 -3
- package/data/1aGKl9JmrlXMXx8d.d.ts +0 -104
- package/data/1aGKl9JmrlXMXx8d.js +0 -537
- package/data/54djM0oR6ky3Ey8e.d.ts +0 -55
- package/data/54djM0oR6ky3Ey8e.js +0 -350
- package/data/6gyq3v1verxD7JO1.d.ts +0 -104
- package/data/6gyq3v1verxD7JO1.js +0 -462
- package/data/8054djM0oR6ky3Ey8e.d.ts +0 -55
- package/data/8054djM0oR6ky3Ey8e.js +0 -350
- package/data/KpokNd82rwjhackhQTBEoYKHg8zGbPXe.d.ts +0 -84
- package/data/KpokNd82rwjhackhQTBEoYKHg8zGbPXe.js +0 -600
- package/data/PrXel3aqGbp34JQn.d.ts +0 -389
- package/data/PrXel3aqGbp34JQn.js +0 -4649
- package/data/XJ6NMLWnkAY3Rdx8.d.ts +0 -843
- package/data/XJ6NMLWnkAY3Rdx8.js +0 -7989
- package/data/YdoNP9K4rwQDwjJr.d.ts +0 -83
- package/data/YdoNP9K4rwQDwjJr.js +0 -1453
- package/data/ZLvK29zj4L29Jowd.d.ts +0 -55
- package/data/ZLvK29zj4L29Jowd.js +0 -372
- package/data/auto3d-njL5J99VwCmnjtQElOmXQr.d.ts +0 -86
- package/data/auto3d-njL5J99VwCmnjtQElOmXQr.js +0 -711
- package/data/extrude-walls/ZLvK29zj4L29Jowd.d.ts +0 -5
- package/data/extrude-walls/ZLvK29zj4L29Jowd.js +0 -14
- package/data/extrude-walls/lo024DEgzanMj5BE.d.ts +0 -5
- package/data/extrude-walls/lo024DEgzanMj5BE.js +0 -14
- package/data/jd6oMOzPxnQ3BvxY_B7yw51J9rXlhYhjhGTOgRVqu6WeEqjNX.d.ts +0 -85
- package/data/jd6oMOzPxnQ3BvxY_B7yw51J9rXlhYhjhGTOgRVqu6WeEqjNX.js +0 -511
- package/data/lo024DEgzanMj5BE.d.ts +0 -55
- package/data/lo024DEgzanMj5BE.js +0 -966
- package/data/oPzy3ApbjjpD8YdR.d.ts +0 -83
- package/data/oPzy3ApbjjpD8YdR.js +0 -283
- package/data/qjAxMG4XbPn96wKG.d.ts +0 -104
- package/data/qjAxMG4XbPn96wKG.js +0 -637
- package/data/rXel3aPQRRBD4JQn.d.ts +0 -86
- package/data/rXel3aPQRRBD4JQn.js +0 -622
- package/data/vLykj3NWrllMrG06.d.ts +0 -91
- package/data/vLykj3NWrllMrG06.js +0 -2729
- package/data/wz0QV9KA4ugyo9ME.d.ts +0 -39
- package/data/wz0QV9KA4ugyo9ME.js +0 -136
- package/data/zxMawr9raSg8LYjG.d.ts +0 -53
- package/data/zxMawr9raSg8LYjG.js +0 -590
- package/examples/FiveStateController/index.js +0 -134
- package/examples/VRHouse/Mobile.js +0 -36
- package/examples/VRHouse/PC.js +0 -36
- package/examples/VRHouse/index.js +0 -36
- package/index.d.ts +0 -15
- package/index.js +0 -45
- package/libs/gltf-viewer/Subscribe.d.ts +0 -76
- package/libs/gltf-viewer/Subscribe.js +0 -231
- package/libs/gltf-viewer/coordsMoveByOffset.d.ts +0 -13
- package/libs/gltf-viewer/coordsMoveByOffset.js +0 -22
- package/libs/gltf-viewer/coordsToDirection.d.ts +0 -5
- package/libs/gltf-viewer/coordsToDirection.js +0 -41
- package/libs/gltf-viewer/formatRad.d.ts +0 -1
- package/libs/gltf-viewer/formatRad.js +0 -13
- package/libs/gltf-viewer/getFrameTime.d.ts +0 -1
- package/libs/gltf-viewer/getFrameTime.js +0 -28
- package/libs/gltf-viewer/index.d.ts +0 -55
- package/libs/gltf-viewer/index.js +0 -650
- package/libs/gltf-viewer/mouseWheel.d.ts +0 -2
- package/libs/gltf-viewer/mouseWheel.js +0 -59
- package/libs/gltf-viewer/requestAnimationFrame.d.ts +0 -1
- package/libs/gltf-viewer/requestAnimationFrame.js +0 -18
- package/libs/gltf-viewer/requestAnimationFrameInterval.d.ts +0 -1
- package/libs/gltf-viewer/requestAnimationFrameInterval.js +0 -31
- package/libs/gltf-viewer/uuid.js +0 -28
- package/plugins/AutoPreloadPlugin/index.d.ts +0 -23
- package/plugins/AutoPreloadPlugin/index.js +0 -111
- package/plugins/CSS3DRenderPlugin/components/Marker/index.d.ts +0 -12
- package/plugins/CSS3DRenderPlugin/components/Marker/index.js +0 -121
- package/plugins/CSS3DRenderPlugin/index.js +0 -298
- package/plugins/CameraMovementPlugin/index.js +0 -362
- package/plugins/CameraMovementPlugin/typing.js +0 -37
- package/plugins/ModelChassisCompassPlugin/index.js +0 -157
- package/plugins/ModelEntryDoorGuidePlugin/index.js +0 -247
- package/plugins/ModelExtrudeWallsPlugin/index.d.ts +0 -16
- package/plugins/ModelExtrudeWallsPlugin/index.js +0 -252
- package/plugins/ModelRoomLabelPlugin/Controller.js +0 -153
- package/plugins/ModelRoomLabelPlugin/RoomLabelItem.d.ts +0 -8
- package/plugins/ModelRoomLabelPlugin/RoomLabelItem.js +0 -66
- package/plugins/ModelRoomLabelPlugin/RoomLabelItems.d.ts +0 -7
- package/plugins/ModelRoomLabelPlugin/RoomLabelItems.js +0 -159
- package/plugins/ModelRoomLabelPlugin/index.d.ts +0 -8
- package/plugins/ModelRoomLabelPlugin/index.js +0 -18
- package/plugins/ModelRoomLabelPlugin/typings.js +0 -7
- package/plugins/ModelRoomLabelPlugin/utils/parseData.js +0 -35
- package/plugins/ModelTVVideoPlugin/index.d.ts +0 -21
- package/plugins/ModelTVVideoPlugin/index.js +0 -397
- package/plugins/ModelViewPlugin/index.js +0 -223
- package/plugins/PanoCursorRaycasterPlugin/PanoCursorRaycasterPluginUsage.d.ts +0 -48
- package/plugins/PanoCursorRaycasterPlugin/components/MovePointTowardsCamera.d.ts +0 -9
- package/plugins/PanoCursorRaycasterPlugin/components/MovePointTowardsCamera.js +0 -117
- package/plugins/PanoCursorRaycasterPlugin/components/PointAxesHelper.d.ts +0 -11
- package/plugins/PanoCursorRaycasterPlugin/components/PointAxesHelper.js +0 -39
- package/plugins/PanoCursorRaycasterPlugin/index.js +0 -126
- package/plugins/PanoCursorRaycasterPlugin/utils/addLineToFive.d.ts +0 -5
- package/plugins/PanoCursorRaycasterPlugin/utils/addLineToFive.js +0 -27
- package/plugins/PanoCursorRaycasterPlugin/utils/createLine.d.ts +0 -3
- package/plugins/PanoCursorRaycasterPlugin/utils/createLine.js +0 -48
- package/plugins/PanoDoorLabelPlugin/index.d.ts +0 -4
- package/plugins/PanoDoorLabelPlugin/index.js +0 -14
- package/plugins/PanoIRobotPlugin/index.d.ts +0 -10
- package/plugins/PanoIRobotPlugin/index.js +0 -18
- package/plugins/PanoMaskSelectorPlugin/compare.d.ts +0 -1
- package/plugins/PanoMaskSelectorPlugin/compare.js +0 -17
- package/plugins/PanoMaskSelectorPlugin/createBox.d.ts +0 -7
- package/plugins/PanoMaskSelectorPlugin/createBox.js +0 -79
- package/plugins/PanoMaskSelectorPlugin/createTextures.d.ts +0 -3
- package/plugins/PanoMaskSelectorPlugin/createTextures.js +0 -45
- package/plugins/PanoMaskSelectorPlugin/fragmentShader.d.ts +0 -1
- package/plugins/PanoMaskSelectorPlugin/fragmentShader.js +0 -10
- package/plugins/PanoMaskSelectorPlugin/index.d.ts +0 -49
- package/plugins/PanoMaskSelectorPlugin/index.js +0 -348
- package/plugins/PanoMaskSelectorPlugin/vertexShader.d.ts +0 -1
- package/plugins/PanoMaskSelectorPlugin/vertexShader.js +0 -10
- package/plugins/PanoRulerPlugin/data/roomInfo.d.ts +0 -3
- package/plugins/PanoRulerPlugin/data/roomInfo.js +0 -51
- package/plugins/PanoRulerPlugin/data/roomRules.d.ts +0 -3
- package/plugins/PanoRulerPlugin/data/roomRules.js +0 -235
- package/plugins/PanoRulerPlugin/index.d.ts +0 -27
- package/plugins/PanoRulerPlugin/index.js +0 -637
- package/plugins/PanoRulerPlugin/typings.d.ts +0 -21
- package/plugins/PanoRulerPlugin/typings.js +0 -7
- package/plugins/PanoTVVideoPlugin/index.d.ts +0 -26
- package/plugins/PanoTVVideoPlugin/index.js +0 -433
- package/plugins/TreasurePlugin/Controller.d.ts +0 -73
- package/plugins/TreasurePlugin/Controller.js +0 -250
- package/plugins/TreasurePlugin/TreasureFaceAnime.d.ts +0 -25
- package/plugins/TreasurePlugin/TreasureFaceAnime.js +0 -143
- package/plugins/TreasurePlugin/TreasureObject.d.ts +0 -53
- package/plugins/TreasurePlugin/TreasureObject.js +0 -406
- package/plugins/TreasurePlugin/TreasureOpenAnime.d.ts +0 -25
- package/plugins/TreasurePlugin/TreasureOpenAnime.js +0 -127
- package/plugins/TreasurePlugin/constants.d.ts +0 -33
- package/plugins/TreasurePlugin/constants.js +0 -67
- package/plugins/TreasurePlugin/index.d.ts +0 -11
- package/plugins/TreasurePlugin/index.js +0 -26
- package/plugins/TreasurePlugin/typings.d.ts +0 -2
- package/plugins/TreasurePlugin/typings.js +0 -7
- package/plugins/floorplan/Assets/floorplanExtraObject.d.ts +0 -1
- package/plugins/floorplan/Assets/floorplanExtraObject.js +0 -10
- package/plugins/floorplan/ModelFloorplanPlugin/Controller.js +0 -626
- package/plugins/floorplan/ModelFloorplanPlugin/components/Camera.d.ts +0 -13
- package/plugins/floorplan/ModelFloorplanPlugin/components/Camera.js +0 -78
- package/plugins/floorplan/ModelFloorplanPlugin/components/Compass.d.ts +0 -5
- package/plugins/floorplan/ModelFloorplanPlugin/components/Compass.js +0 -84
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomHighlight.d.ts +0 -10
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomHighlight.js +0 -129
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomLabels.d.ts +0 -13
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomLabels.js +0 -118
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/index.d.ts +0 -13
- package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/index.js +0 -62
- package/plugins/floorplan/ModelFloorplanPlugin/components/index.d.ts +0 -20
- package/plugins/floorplan/ModelFloorplanPlugin/components/index.js +0 -88
- package/plugins/floorplan/ModelFloorplanPlugin/controller.style.d.ts +0 -1
- package/plugins/floorplan/ModelFloorplanPlugin/controller.style.js +0 -16
- package/plugins/floorplan/ModelFloorplanPlugin/index.js +0 -20
- package/plugins/floorplan/ModelFloorplanPlugin/typings/events.type.js +0 -7
- package/plugins/floorplan/ModelFloorplanPlugin/utils/constant.js +0 -33
- package/plugins/floorplan/ModelFloorplanPlugin/utils/correctFiveState.js +0 -154
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.d.ts +0 -13
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.js +0 -113
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.style.d.ts +0 -3
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.style.js +0 -39
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/ExtraObjects.d.ts +0 -5
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/ExtraObjects.js +0 -66
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/RoomHighlight.d.ts +0 -9
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/RoomHighlight.js +0 -126
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/index.d.ts +0 -11
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/index.js +0 -58
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.d.ts +0 -17
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.js +0 -85
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.style.d.ts +0 -2
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.style.js +0 -15
- package/plugins/floorplan/PanoFloorplanRadarPlugin/Controller.js +0 -211
- package/plugins/floorplan/PanoFloorplanRadarPlugin/index.js +0 -20
- package/plugins/floorplan/TopviewFloorplanPlugin/Controller.js +0 -262
- package/plugins/floorplan/TopviewFloorplanPlugin/index.js +0 -18
- package/plugins/floorplan/TopviewFloorplanPlugin/style.js +0 -16
- package/plugins/floorplan/components/FloorplanImage.d.ts +0 -7
- package/plugins/floorplan/components/FloorplanImage.js +0 -90
- package/plugins/floorplan/typings/floorplanData.js +0 -7
- package/plugins/floorplan/typings/floorplanServerData.js +0 -382
- package/plugins/floorplan/utils/formatData.js +0 -217
- package/plugins/floorplan/utils/formatPosition.js +0 -89
- package/shared-utils/Preloader.js +0 -57
- package/shared-utils/Subscribe.js +0 -230
- package/shared-utils/animationFrame/BetterTween.js +0 -103
- package/shared-utils/animationFrame/calculateProgress.js +0 -40
- package/shared-utils/animationFrame/formatRad.js +0 -36
- package/shared-utils/animationFrame/index.js +0 -81
- package/shared-utils/animationFrame/tween.js +0 -92
- package/shared-utils/changeModelCanvansOpacity.d.ts +0 -2
- package/shared-utils/changeModelCanvansOpacity.js +0 -38
- package/shared-utils/createCanvasTextTexture.js +0 -31
- package/shared-utils/createFiveContainer.d.ts +0 -10
- package/shared-utils/createFiveContainer.js +0 -171
- package/shared-utils/createLine/index.js +0 -43
- package/shared-utils/debounce.js +0 -30
- package/shared-utils/equal.js +0 -107
- package/shared-utils/filter.js +0 -127
- package/shared-utils/five/changeMode.js +0 -82
- package/shared-utils/five/useFivePlugin.js +0 -17
- package/shared-utils/formatRad.js +0 -18
- package/shared-utils/getPxmm.js +0 -51
- package/shared-utils/getRandomColor.js +0 -23
- package/shared-utils/isNil.js +0 -26
- package/shared-utils/isTruelyObject.js +0 -31
- package/shared-utils/math/evenNumber.d.ts +0 -1
- package/shared-utils/math/evenNumber.js +0 -13
- package/shared-utils/math/planimetry.js +0 -352
- package/shared-utils/math/rad2Deg.js +0 -12
- package/shared-utils/nearlyEqual.js +0 -19
- package/shared-utils/nextFrame.js +0 -15
- package/shared-utils/noop.js +0 -19
- package/shared-utils/object3d2LocalMatrix.js +0 -79
- package/shared-utils/px2rem.js +0 -22
- package/shared-utils/three/centerPoint.js +0 -14
- package/shared-utils/three/getExtraModelLoader.js +0 -45
- package/shared-utils/three/getNormal.js +0 -17
- package/shared-utils/three/getTextureLoader.js +0 -50
- package/shared-utils/three/loadFbxObj.js +0 -54
- package/shared-utils/three/loadTexture.d.ts +0 -2
- package/shared-utils/three/loadTexture.js +0 -46
- package/shared-utils/three/transformPositionToVector3.js +0 -20
- package/shared-utils/three/transfromToMeshBasicMaterial.js +0 -33
- package/shared-utils/throttle.js +0 -29
- package/shared-utils/to.js +0 -67
- package/shared-utils/useDebounce.js +0 -49
- package/shared-utils/useThrottle.js +0 -47
- package/shared-utils/uuid.d.ts +0 -4
- package/shared-utils/uuid.js +0 -28
- package/shared-utils/vectorTocoordinates.js +0 -18
- package/typedoc/components.d.ts +0 -6
- package/typedoc/components.js +0 -7
- package/typedoc/plugins.d.ts +0 -19
- package/typedoc/plugins.js +0 -165
- package/typedoc/shared-utils.d.ts +0 -3
- package/typedoc/shared-utils.js +0 -7
- package/typedoc/typings.d.ts +0 -3
- package/typedoc/typings.js +0 -7
- package/typings/math.type.js +0 -7
- package/typings/utils.type.js +0 -7
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
2
|
+
import isTruelyObject from './isTruelyObject';
|
|
3
|
+
function baseIsEqual(value, other) {
|
|
4
|
+
if (value === other)
|
|
5
|
+
return true;
|
|
6
|
+
if (typeof value !== typeof other)
|
|
7
|
+
return false;
|
|
8
|
+
if (Number.isNaN(value) && Number.isNaN(other))
|
|
9
|
+
return true;
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
function objEqualShallow(value, other) {
|
|
13
|
+
const valueProps = Object.getOwnPropertyNames(value);
|
|
14
|
+
const otherProps = Object.getOwnPropertyNames(other);
|
|
15
|
+
if (valueProps.length !== otherProps.length)
|
|
16
|
+
return false;
|
|
17
|
+
for (let i = 0, len = valueProps.length; i < len; i++) {
|
|
18
|
+
const propName = valueProps[i];
|
|
19
|
+
if (!baseIsEqual(value[propName], other[propName]))
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
function arrayEqualShallow(value, other) {
|
|
25
|
+
if (value.length !== other.length)
|
|
26
|
+
return false;
|
|
27
|
+
for (let i = 0, len = value.length; i < len; i++) {
|
|
28
|
+
if (!baseIsEqual(value[i], other[i]))
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
function isShallowEqual(value, other) {
|
|
34
|
+
if (baseIsEqual(value, other))
|
|
35
|
+
return true;
|
|
36
|
+
if (isTruelyObject(value) && isTruelyObject(other))
|
|
37
|
+
return objEqualShallow(value, other);
|
|
38
|
+
if (Array.isArray(value) && Array.isArray(other))
|
|
39
|
+
return arrayEqualShallow(value, other);
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
function isDeepEqual(value, other) {
|
|
43
|
+
if (baseIsEqual(value, other))
|
|
44
|
+
return true;
|
|
45
|
+
if (isTruelyObject(value) && isTruelyObject(other))
|
|
46
|
+
return objEqualDeep(value, other);
|
|
47
|
+
if (Array.isArray(value) && Array.isArray(other))
|
|
48
|
+
return arrayEqualDeep(value, other);
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
function arrayEqualDeep(value, other) {
|
|
52
|
+
if (value.length !== other.length)
|
|
53
|
+
return false;
|
|
54
|
+
for (let i = 0, len = value.length; i < len; i++) {
|
|
55
|
+
if (!isDeepEqual(value[i], other[i]))
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
function objEqualDeep(value, other) {
|
|
61
|
+
const valueProps = Object.getOwnPropertyNames(value);
|
|
62
|
+
const otherProps = Object.getOwnPropertyNames(other);
|
|
63
|
+
if (valueProps.length !== otherProps.length)
|
|
64
|
+
return false;
|
|
65
|
+
for (let i = 0, len = valueProps.length; i < len; i++) {
|
|
66
|
+
const propName = valueProps[i];
|
|
67
|
+
if (!isDeepEqual(value[propName], other[propName]))
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* 对象比较
|
|
74
|
+
* @param {*} value 第一个比较的值
|
|
75
|
+
* @param {*} other 第二个比较的值
|
|
76
|
+
* @param {Object} options 可选参数,可选项包括:<br />
|
|
77
|
+
* deep {Boolean} 是否深比较<br />
|
|
78
|
+
* @returns {boolean} 是否相等
|
|
79
|
+
*/
|
|
80
|
+
export default function equal(value, other, opt = { deep: false }) {
|
|
81
|
+
if (!opt.deep)
|
|
82
|
+
return isShallowEqual(value, other);
|
|
83
|
+
return isDeepEqual(value, other);
|
|
84
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import tap from './tap';
|
|
2
|
+
/**
|
|
3
|
+
* 对象属性筛选函数。
|
|
4
|
+
* 基于已有对象生成一个满足条件(属性)新的对象。
|
|
5
|
+
* @param {object} object
|
|
6
|
+
* @param {Function} check
|
|
7
|
+
*/
|
|
8
|
+
export function filter(object, check) {
|
|
9
|
+
return tap({}, (result) => {
|
|
10
|
+
Object.keys(object).forEach((key) => {
|
|
11
|
+
const _key = key;
|
|
12
|
+
if (check(_key, object[_key])) {
|
|
13
|
+
result[_key] = object[_key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* 对象镜子函数。
|
|
20
|
+
* 生成一个"镜子"对象:对象的属性名与其值相同。
|
|
21
|
+
* @param {string[]} strings 对象属性
|
|
22
|
+
*/
|
|
23
|
+
export function mirror(strings) {
|
|
24
|
+
return tap({}, (result) => {
|
|
25
|
+
for (const string of strings)
|
|
26
|
+
result[string] = string;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* 过滤掉不需要的对象字段函数:实现从一个对象中排除某些指定属性后生成的新对象。
|
|
31
|
+
* @param object
|
|
32
|
+
* @param props 排除的属性
|
|
33
|
+
* @return
|
|
34
|
+
*/
|
|
35
|
+
export function omit(object, props) {
|
|
36
|
+
return tap({}, (result) => {
|
|
37
|
+
for (const name in object) {
|
|
38
|
+
if (props.indexOf(name) !== -1)
|
|
39
|
+
continue;
|
|
40
|
+
result[name] = object[name];
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* 筛选需要的对象字段:实现从一个对象中选择某些指定属性生成新的对象(与`omit()`功能相反)。
|
|
46
|
+
* @param {object} object
|
|
47
|
+
* @param {string[]} props
|
|
48
|
+
* @return {object}
|
|
49
|
+
*/
|
|
50
|
+
export function pick(object, props) {
|
|
51
|
+
// eslint-disable-next-line no-return-assign
|
|
52
|
+
return tap({}, (result) => props.forEach((prop) => (result[prop] = object[prop])));
|
|
53
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import to from '../to';
|
|
2
|
+
export default async function changeMode(five, ...changeModeParams) {
|
|
3
|
+
const [changeModeError] = await to(five.changeMode(...changeModeParams));
|
|
4
|
+
if (changeModeError)
|
|
5
|
+
throw changeModeError;
|
|
6
|
+
await new Promise((reslove, reject) => {
|
|
7
|
+
five.once('initAnimationEnded', reslove);
|
|
8
|
+
const handleModeChange = (mode) => {
|
|
9
|
+
if (mode !== changeModeParams[0])
|
|
10
|
+
reject('changeMode 被中断');
|
|
11
|
+
five.off('modeChange', handleModeChange);
|
|
12
|
+
};
|
|
13
|
+
five.on('modeChange', handleModeChange);
|
|
14
|
+
});
|
|
15
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { unsafe__useFiveInstance } from '@realsee/five/react';
|
|
2
|
+
export function useFivePlugin(name) {
|
|
3
|
+
const five = unsafe__useFiveInstance();
|
|
4
|
+
const plugin = five.plugins[name];
|
|
5
|
+
if (!plugin)
|
|
6
|
+
throw new Error(`can not find plugin "${name}"`);
|
|
7
|
+
return plugin;
|
|
8
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
/**
|
|
3
|
+
* 获取「在俯视图」状态下,模型 mm 与屏幕像素 px 的对应关系,即每 mm 对应多少 px
|
|
4
|
+
* @param five five
|
|
5
|
+
*/
|
|
6
|
+
export default function getPxmm(five, container) {
|
|
7
|
+
const boundingCenter = new THREE.Vector3(0, 0, 0);
|
|
8
|
+
five.model.bounding.getCenter(boundingCenter);
|
|
9
|
+
const { y: boundingCenterY } = boundingCenter;
|
|
10
|
+
const { longitude } = five.getCurrentState();
|
|
11
|
+
// 因为模型可能经过旋转,所以屏幕水平方向上的 1m 对应 X 轴距离需要转换
|
|
12
|
+
const X = 1 / Math.abs(Math.cos(longitude));
|
|
13
|
+
// 模型绕 (boundingCenterX, boundingCenterY, boundingCenterZ) 旋转
|
|
14
|
+
const originPosition = new THREE.Vector3(0, boundingCenterY, 0);
|
|
15
|
+
const originPositionXUnit = new THREE.Vector3(X, boundingCenterY, 0);
|
|
16
|
+
const mouse = originPosition.project(five.camera);
|
|
17
|
+
const xUnitMouse = originPositionXUnit.project(five.camera);
|
|
18
|
+
const pxmm = Math.abs((xUnitMouse.x - mouse.x) / 1000) * (container.getBoundingClientRect().width / 2);
|
|
19
|
+
return pxmm;
|
|
20
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 判断对象是否为`null`或`undefined`。
|
|
3
|
+
* @param
|
|
4
|
+
* @return
|
|
5
|
+
*/
|
|
6
|
+
export function isNil(value) {
|
|
7
|
+
return !notNil(value);
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* 判断对象不为`null`或`undefined`。
|
|
11
|
+
*/
|
|
12
|
+
export function notNil(value) {
|
|
13
|
+
return value !== null && value !== undefined;
|
|
14
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,20 @@
|
|
|
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) {
|
|
19
|
+
return Object.prototype.toString.call(value) === '[object Object]';
|
|
20
|
+
}
|
|
@@ -44,8 +44,8 @@ export declare function getK(point1: Point, point2: Point): number;
|
|
|
44
44
|
* @return {point}
|
|
45
45
|
*/
|
|
46
46
|
export declare function closestPointOnLine(point: Point, linePoints: Point[]): {
|
|
47
|
-
x:
|
|
48
|
-
y:
|
|
47
|
+
x: any;
|
|
48
|
+
y: any;
|
|
49
49
|
};
|
|
50
50
|
/**
|
|
51
51
|
* 点到线段的距离,
|
|
@@ -62,8 +62,8 @@ export declare function pointDistanceFromLine(point: Point, linePoints: Point[])
|
|
|
62
62
|
* @return {[linePoints, linePoints]}
|
|
63
63
|
*/
|
|
64
64
|
export declare function linesWithDistanceOfLine(distanceOfLine: number, linePoints: Point[]): {
|
|
65
|
-
x:
|
|
66
|
-
y:
|
|
65
|
+
x: any;
|
|
66
|
+
y: any;
|
|
67
67
|
}[][];
|
|
68
68
|
/**
|
|
69
69
|
* 做线段的距离一定值的平行线段 (如果线段是弧形的)
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 平面几何相关数学函数
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* 检查两个点是否位置相同
|
|
6
|
+
* @param point1
|
|
7
|
+
* @param point2
|
|
8
|
+
* @return
|
|
9
|
+
*/
|
|
10
|
+
export function samePointAt(point1, point2) {
|
|
11
|
+
return point1.x === point2.x && point1.y === point2.y;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* 计算两个点之间的位置
|
|
15
|
+
* @param {point} point1
|
|
16
|
+
* @param {point} point2
|
|
17
|
+
* @return {number}
|
|
18
|
+
*/
|
|
19
|
+
export function distance(point1, point2) {
|
|
20
|
+
return Math.sqrt(Math.pow(point2.x - point1.x, 2) + Math.pow(point2.y - point1.y, 2));
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* 两个计算的斜率是否相同
|
|
24
|
+
* @param {number} k1
|
|
25
|
+
* @param {number} k2
|
|
26
|
+
* @return
|
|
27
|
+
*/
|
|
28
|
+
export function sameK(k1, k2) {
|
|
29
|
+
if (Math.abs(k1) === Infinity && Math.abs(k2) === Infinity)
|
|
30
|
+
return true;
|
|
31
|
+
return Math.abs(k1 - k2) < 0.001;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* 获取两点之间的斜率
|
|
35
|
+
* @param {point} point1
|
|
36
|
+
* @param {point} point2
|
|
37
|
+
* @return {number}
|
|
38
|
+
*/
|
|
39
|
+
export function getK(point1, point2) {
|
|
40
|
+
return (point2.y - point1.y) / (point2.x - point1.x);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* 获取一点对于线段上最近的一点,
|
|
44
|
+
* 如果可以是过直线垂线的垂足,不行的话取线段的两端
|
|
45
|
+
* @param {point} point1
|
|
46
|
+
* @param {linePoints} linePoints
|
|
47
|
+
* @return {point}
|
|
48
|
+
*/
|
|
49
|
+
export function closestPointOnLine(point, linePoints) {
|
|
50
|
+
const tA = point.x - linePoints[0].x;
|
|
51
|
+
const tB = point.y - linePoints[0].y;
|
|
52
|
+
const tC = linePoints[1].x - linePoints[0].x;
|
|
53
|
+
const tD = linePoints[1].y - linePoints[0].y;
|
|
54
|
+
const tDot = tA * tC + tB * tD;
|
|
55
|
+
const tLenSq = tC * tC + tD * tD;
|
|
56
|
+
const tParam = tDot / tLenSq;
|
|
57
|
+
let tXx, tYy;
|
|
58
|
+
if (tParam < 0 || samePointAt(linePoints[0], linePoints[1])) {
|
|
59
|
+
tXx = linePoints[0].x;
|
|
60
|
+
tYy = linePoints[0].y;
|
|
61
|
+
}
|
|
62
|
+
else if (tParam > 1) {
|
|
63
|
+
tXx = linePoints[1].x;
|
|
64
|
+
tYy = linePoints[1].y;
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
tXx = linePoints[0].x + tParam * tC;
|
|
68
|
+
tYy = linePoints[0].y + tParam * tD;
|
|
69
|
+
}
|
|
70
|
+
return { x: tXx, y: tYy };
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* 点到线段的距离,
|
|
74
|
+
* 如果可以是过直线垂线的垂足的距离,不行的话取线段的两端的距离
|
|
75
|
+
* @param {point} point1
|
|
76
|
+
* @param {linePoints} linePoints
|
|
77
|
+
* @return {number}
|
|
78
|
+
*/
|
|
79
|
+
export function pointDistanceFromLine(point, linePoints) {
|
|
80
|
+
const closestPoint = closestPointOnLine(point, linePoints);
|
|
81
|
+
return distance(point, closestPoint);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* 做线段的距离一定值的平行线段
|
|
85
|
+
* @param {number} distanceOfLine
|
|
86
|
+
* @param {linePoints} linePoints
|
|
87
|
+
* @return {[linePoints, linePoints]}
|
|
88
|
+
*/
|
|
89
|
+
export function linesWithDistanceOfLine(distanceOfLine, linePoints) {
|
|
90
|
+
const k = getK(linePoints[1], linePoints[0]);
|
|
91
|
+
let dx, dy;
|
|
92
|
+
if (Math.abs(k) === Infinity) {
|
|
93
|
+
dy = 0;
|
|
94
|
+
dx = distanceOfLine;
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
dy = Math.sqrt((distanceOfLine * distanceOfLine) / (k * k + 1));
|
|
98
|
+
dx = dy / -(1 / k);
|
|
99
|
+
}
|
|
100
|
+
const result = [
|
|
101
|
+
[
|
|
102
|
+
{ x: linePoints[0].x - dx, y: linePoints[0].y - dy },
|
|
103
|
+
{ x: linePoints[1].x - dx, y: linePoints[1].y - dy },
|
|
104
|
+
],
|
|
105
|
+
[
|
|
106
|
+
{ x: linePoints[0].x + dx, y: linePoints[0].y + dy },
|
|
107
|
+
{ x: linePoints[1].x + dx, y: linePoints[1].y + dy },
|
|
108
|
+
],
|
|
109
|
+
];
|
|
110
|
+
if (linePoints[1].x - linePoints[0].x < 0) {
|
|
111
|
+
return result;
|
|
112
|
+
}
|
|
113
|
+
else if (linePoints[1].x - linePoints[0].x > 0) {
|
|
114
|
+
return result.reverse();
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
if (linePoints[1].y - linePoints[0].y < 0) {
|
|
118
|
+
return result.reverse();
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
return result;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* 做线段的距离一定值的平行线段 (如果线段是弧形的)
|
|
127
|
+
* @param {number} distanceOfLine
|
|
128
|
+
* @param {linePoints} linePoints
|
|
129
|
+
* @param {number} 弧形定点到线段的距离
|
|
130
|
+
* @return {[linePoints, linePoints]}
|
|
131
|
+
*/
|
|
132
|
+
export function linesWithDistanceOfLineWithCurve(distanceOfLine, linePoints, curve) {
|
|
133
|
+
const centerPoint = getCenterPointOfPoints(linePoints);
|
|
134
|
+
const pHelfDistance = distance(linePoints[0], centerPoint);
|
|
135
|
+
const cDistance = Math.sqrt(curve * curve - pHelfDistance * pHelfDistance);
|
|
136
|
+
const cpoint = isNaN(cDistance)
|
|
137
|
+
? centerPoint
|
|
138
|
+
: linesWithDistanceOfLine(cDistance, [centerPoint, linePoints[0]])[curve > 0 ? 0 : 1][0];
|
|
139
|
+
const dx1 = ((linePoints[0].x - cpoint.x) / curve) * distanceOfLine;
|
|
140
|
+
const dy1 = ((linePoints[0].y - cpoint.y) / curve) * distanceOfLine;
|
|
141
|
+
const dx2 = ((linePoints[1].x - cpoint.x) / curve) * distanceOfLine;
|
|
142
|
+
const dy2 = ((linePoints[1].y - cpoint.y) / curve) * distanceOfLine;
|
|
143
|
+
return [
|
|
144
|
+
[
|
|
145
|
+
{ x: linePoints[0].x - dx1, y: linePoints[0].y - dy1 },
|
|
146
|
+
{ x: linePoints[1].x - dx2, y: linePoints[1].y - dy2 },
|
|
147
|
+
],
|
|
148
|
+
[
|
|
149
|
+
{ x: linePoints[0].x + dx1, y: linePoints[0].y + dy1 },
|
|
150
|
+
{ x: linePoints[1].x + dx2, y: linePoints[1].y + dy2 },
|
|
151
|
+
],
|
|
152
|
+
];
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* 两条线段(包括延长线)的交点点
|
|
156
|
+
* @param {linePoints} linePoints1
|
|
157
|
+
* @param {linePoints} linePoints2
|
|
158
|
+
* @param needIntersectionInLine 是否是延长线的相交
|
|
159
|
+
* @return {point || false}
|
|
160
|
+
*/
|
|
161
|
+
export function intersectionOfLine(linePoints1, linePoints2, needIntersectionInLine) {
|
|
162
|
+
const k1 = getK(linePoints1[1], linePoints1[0]);
|
|
163
|
+
const k2 = getK(linePoints2[1], linePoints2[0]);
|
|
164
|
+
if (isNaN(k1) || isNaN(k2))
|
|
165
|
+
return false;
|
|
166
|
+
if (sameK(k1, k2))
|
|
167
|
+
return false;
|
|
168
|
+
if (pointOnLine(linePoints1[0], linePoints2))
|
|
169
|
+
return linePoints1[0];
|
|
170
|
+
if (pointOnLine(linePoints1[1], linePoints2))
|
|
171
|
+
return linePoints1[1];
|
|
172
|
+
if (pointOnLine(linePoints2[0], linePoints1))
|
|
173
|
+
return linePoints2[0];
|
|
174
|
+
if (pointOnLine(linePoints2[1], linePoints1))
|
|
175
|
+
return linePoints2[1];
|
|
176
|
+
//needIntersectionInLine 是否焦点在线段内
|
|
177
|
+
if (needIntersectionInLine && !isIntersect(linePoints1, linePoints2))
|
|
178
|
+
return false;
|
|
179
|
+
const p1 = linePoints1[0];
|
|
180
|
+
const p2 = linePoints2[0];
|
|
181
|
+
if (Math.abs(k1) === Infinity) {
|
|
182
|
+
return { x: p1.x, y: linePoints2[1].y - (linePoints2[1].x - p1.x) * k2 };
|
|
183
|
+
}
|
|
184
|
+
if (Math.abs(k2) === Infinity) {
|
|
185
|
+
return { x: p2.x, y: linePoints1[1].y - (linePoints1[1].x - p2.x) * k1 };
|
|
186
|
+
}
|
|
187
|
+
const x = (p2.y - p1.y + k1 * p1.x - k2 * p2.x) / (k1 - k2);
|
|
188
|
+
const y = k1 * x - k1 * p1.x + p1.y;
|
|
189
|
+
return { x, y };
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* 是否点在线段上
|
|
193
|
+
* @param {point} point
|
|
194
|
+
* @param {linePoints} linePoints
|
|
195
|
+
* @return
|
|
196
|
+
*/
|
|
197
|
+
export function pointOnLine(point, linePoints) {
|
|
198
|
+
if (samePointAt(point, linePoints[0]))
|
|
199
|
+
return true;
|
|
200
|
+
if (samePointAt(point, linePoints[1]))
|
|
201
|
+
return true;
|
|
202
|
+
return (true &&
|
|
203
|
+
(linePoints[0].x - point.x) * (point.x - linePoints[1].x) >= 0 &&
|
|
204
|
+
(linePoints[0].y - point.y) * (point.y - linePoints[1].y) >= 0 &&
|
|
205
|
+
sameK(getK(linePoints[0], point), getK(point, linePoints[1])));
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* 让点按照另一个点为圆心,一定弧度的情况下转动得到下一个点
|
|
209
|
+
* @param {point} point
|
|
210
|
+
* @param {point} centerPoint
|
|
211
|
+
* @param {number} rad
|
|
212
|
+
* @return {point}
|
|
213
|
+
*/
|
|
214
|
+
export function pointRotateByCenterPoint(point, centerPoint, rad) {
|
|
215
|
+
const r = distance(point, centerPoint);
|
|
216
|
+
let nextRad = Math.atan2(point.y - centerPoint.y, point.x - centerPoint.x);
|
|
217
|
+
nextRad -= rad;
|
|
218
|
+
return {
|
|
219
|
+
x: centerPoint.x + Math.cos(nextRad) * r,
|
|
220
|
+
y: centerPoint.y + Math.sin(nextRad) * r,
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* 获取一些点的中心点
|
|
225
|
+
* @param {points} point
|
|
226
|
+
* @return {point}
|
|
227
|
+
*/
|
|
228
|
+
export function getCenterPointOfPoints(points) {
|
|
229
|
+
let minX = Infinity, maxX = 0, minY = Infinity, maxY = 0;
|
|
230
|
+
points.forEach((point) => {
|
|
231
|
+
minX = Math.min(minX, point.x);
|
|
232
|
+
maxX = Math.max(maxX, point.x);
|
|
233
|
+
minY = Math.min(minY, point.y);
|
|
234
|
+
maxY = Math.max(maxY, point.y);
|
|
235
|
+
});
|
|
236
|
+
return { x: (minX + maxX) / 2, y: (minY + maxY) / 2 };
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* 判断两条线段是否相交
|
|
240
|
+
*/
|
|
241
|
+
function multi(p1, p2, p0) {
|
|
242
|
+
return (p1.x - p0.x) * (p2.y - p0.y) - (p2.x - p0.x) * (p1.y - p0.y);
|
|
243
|
+
}
|
|
244
|
+
export function isIntersect(linePoints1, linePoints2) {
|
|
245
|
+
if (Math.max(linePoints1[0].x, linePoints1[1].x) >= Math.min(linePoints2[0].x, linePoints2[1].x) &&
|
|
246
|
+
Math.max(linePoints2[0].x, linePoints2[1].x) >= Math.min(linePoints1[0].x, linePoints1[1].x) &&
|
|
247
|
+
Math.max(linePoints1[0].y, linePoints1[1].y) >= Math.min(linePoints2[0].y, linePoints2[1].y) &&
|
|
248
|
+
multi(linePoints2[0], linePoints1[1], linePoints1[0]) * multi(linePoints1[1], linePoints2[1], linePoints1[0]) > 0 &&
|
|
249
|
+
multi(linePoints1[0], linePoints2[1], linePoints2[0]) * multi(linePoints2[1], linePoints1[1], linePoints2[0]) > 0)
|
|
250
|
+
return 1;
|
|
251
|
+
return 0;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* 计算点按序围成区域的面就
|
|
255
|
+
* @param {[point]} points
|
|
256
|
+
* @return {number}
|
|
257
|
+
*/
|
|
258
|
+
function cross(p1, p2) {
|
|
259
|
+
// 向量叉积
|
|
260
|
+
return p1.x * p2.y - p1.y * p2.x;
|
|
261
|
+
}
|
|
262
|
+
export function getAreaSize(points) {
|
|
263
|
+
let ret = 0;
|
|
264
|
+
return ((cross(points.reduce((pf, pn) => {
|
|
265
|
+
ret += cross(pf, pn);
|
|
266
|
+
return pn;
|
|
267
|
+
}), points[0]) +
|
|
268
|
+
ret) /
|
|
269
|
+
2);
|
|
270
|
+
}
|
|
271
|
+
export function getAreaSizeWithoutLine(points) {
|
|
272
|
+
let ret = 0;
|
|
273
|
+
const r = (cross(points.reduce((pf, pn) => {
|
|
274
|
+
ret += cross(pf, pn);
|
|
275
|
+
return pn;
|
|
276
|
+
}), points[0]) +
|
|
277
|
+
ret) /
|
|
278
|
+
2;
|
|
279
|
+
let wall = 0;
|
|
280
|
+
const wr = (distance(points.reduce((pf, pn) => {
|
|
281
|
+
wall += distance(pf, pn) * 250;
|
|
282
|
+
return pn;
|
|
283
|
+
}), points[0]) *
|
|
284
|
+
250 +
|
|
285
|
+
wall) /
|
|
286
|
+
2;
|
|
287
|
+
return r - (wr - 250 * 1000) * (r > 0 ? 1 : -1);
|
|
288
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 比较两个数字近似相等
|
|
3
|
+
* @param num1 数字1
|
|
4
|
+
* @param num2 数字2
|
|
5
|
+
* @param accuracy 精度:精确到小数点后几位,默认精确到 小数点后四位
|
|
6
|
+
*/
|
|
7
|
+
export default function nearlyEqual(num1, num2, accuracy = 4) {
|
|
8
|
+
return Math.floor(num1 * Math.pow(10, accuracy)) === Math.floor(num2 * Math.pow(10, accuracy));
|
|
9
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
export const genRotationMatrix = (x, y, z) => {
|
|
3
|
+
const matrix = new THREE.Matrix4();
|
|
4
|
+
const euler = new THREE.Euler(x, y, z, 'YXZ');
|
|
5
|
+
matrix.makeRotationFromEuler(euler);
|
|
6
|
+
return matrix;
|
|
7
|
+
};
|
|
8
|
+
const bject3d2LocalMatrix = (mesh, { scale, rotation, position, }) => {
|
|
9
|
+
if (scale) {
|
|
10
|
+
mesh.scale.set(scale, scale, scale);
|
|
11
|
+
}
|
|
12
|
+
if (rotation) {
|
|
13
|
+
const [x, y, z] = rotation;
|
|
14
|
+
if (x) {
|
|
15
|
+
mesh.applyMatrix4(genRotationMatrix(x, 0, 0));
|
|
16
|
+
}
|
|
17
|
+
if (y) {
|
|
18
|
+
mesh.applyMatrix4(genRotationMatrix(0, y, 0));
|
|
19
|
+
}
|
|
20
|
+
if (z) {
|
|
21
|
+
mesh.applyMatrix4(genRotationMatrix(0, 0, z));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
if (position) {
|
|
25
|
+
mesh.position.set(position.x, position.y, position.z);
|
|
26
|
+
}
|
|
27
|
+
return mesh;
|
|
28
|
+
};
|
|
29
|
+
export default bject3d2LocalMatrix;
|
|
File without changes
|