@realsee/dnalogel 0.1.7 → 2.0.0-alpha.1
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 -90
- package/dist/dnalogel.es.js +37145 -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/{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 +17 -0
- package/libs/index.js +10 -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,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
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 从数组中删除
|
|
3
|
+
* @param item
|
|
4
|
+
* @param array
|
|
5
|
+
* @return 如果删除返回 item
|
|
6
|
+
*/
|
|
7
|
+
export default function removeArrayItem(item, array) {
|
|
8
|
+
for (let index = 0, len = array.length; index < len; index++) {
|
|
9
|
+
if (item === array[index])
|
|
10
|
+
return array.splice(index, 1)[0];
|
|
11
|
+
}
|
|
12
|
+
}
|
|
File without changes
|
|
@@ -1,12 +1,3 @@
|
|
|
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"] = tap;
|
|
9
|
-
|
|
10
1
|
/**
|
|
11
2
|
* 把第一个参数传入第二个参数(函数)中并执行
|
|
12
3
|
* 一般用于执行函数后返回变量。
|
|
@@ -15,7 +6,7 @@ exports["default"] = tap;
|
|
|
15
6
|
* @return {any}
|
|
16
7
|
*/
|
|
17
8
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
18
|
-
function tap(something, callback) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
9
|
+
export default function tap(something, callback) {
|
|
10
|
+
callback(something);
|
|
11
|
+
return something;
|
|
12
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { loadFbxObj } from './loadFbxObj';
|
|
2
|
+
/** 模型资源加载器,用于满足资源共用 */
|
|
3
|
+
export function getExtraModelLoader() {
|
|
4
|
+
const cache = new Map();
|
|
5
|
+
const load = function (url, type = 'FBX') {
|
|
6
|
+
if (type !== 'FBX')
|
|
7
|
+
return Promise.reject(new Error('不支持的类型'));
|
|
8
|
+
if (cache.has(url))
|
|
9
|
+
return cache.get(url);
|
|
10
|
+
const groupPromise = loadFbxObj(url);
|
|
11
|
+
cache.set(url, groupPromise);
|
|
12
|
+
return groupPromise;
|
|
13
|
+
};
|
|
14
|
+
const dispose = function () {
|
|
15
|
+
cache.clear();
|
|
16
|
+
};
|
|
17
|
+
return { load, dispose };
|
|
18
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { loadTexture } from './loadTexture';
|
|
2
|
+
/** 贴图加载器,用于满足资源共用 */
|
|
3
|
+
export function getTextureLoader() {
|
|
4
|
+
const cache = new Map();
|
|
5
|
+
const load = function (url) {
|
|
6
|
+
if (cache.has(url))
|
|
7
|
+
return cache.get(url);
|
|
8
|
+
const texturePromise = loadTexture(url);
|
|
9
|
+
cache.set(url, texturePromise);
|
|
10
|
+
return texturePromise;
|
|
11
|
+
};
|
|
12
|
+
const dispose = function () {
|
|
13
|
+
cache.forEach((texturePromise) => texturePromise.then((texture) => texture.dispose()));
|
|
14
|
+
cache.clear();
|
|
15
|
+
};
|
|
16
|
+
return { load, dispose };
|
|
17
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FBXLoader } from 'three/examples/jsm/loaders/FBXLoader';
|
|
2
|
+
const loader = new FBXLoader();
|
|
3
|
+
export async function loadFbxObj(url) {
|
|
4
|
+
return new Promise((resolve, reject) => {
|
|
5
|
+
function onLoad(object) {
|
|
6
|
+
resolve(object);
|
|
7
|
+
}
|
|
8
|
+
function onError(error) {
|
|
9
|
+
reject(error);
|
|
10
|
+
}
|
|
11
|
+
loader.load(url, onLoad, undefined, onError);
|
|
12
|
+
});
|
|
13
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
const textureLoader = new THREE.TextureLoader();
|
|
3
|
+
export async function loadTexture(url) {
|
|
4
|
+
return new Promise((resolve, reject) => {
|
|
5
|
+
textureLoader.load(url, resolve, undefined, reject);
|
|
6
|
+
}).then((texture) => {
|
|
7
|
+
texture.encoding = THREE.sRGBEncoding;
|
|
8
|
+
return texture;
|
|
9
|
+
});
|
|
10
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MeshBasicMaterial } from 'three';
|
|
2
|
+
export default function transfromToMeshBasicMaterial(object, options) {
|
|
3
|
+
object.traverse((ele) => {
|
|
4
|
+
if (ele.type === 'Mesh') {
|
|
5
|
+
const mesh = ele;
|
|
6
|
+
const materialConf = Object.assign({ map: mesh.material.map || {} }, options);
|
|
7
|
+
mesh.material = new MeshBasicMaterial(materialConf);
|
|
8
|
+
mesh.renderOrder = 1;
|
|
9
|
+
if (ele.parent?.type === 'Mesh') {
|
|
10
|
+
ele.renderOrder = ele.parent.renderOrder + 1;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
}
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @param func - 要防抖动的函数
|
|
5
5
|
* @param wait - 需要延迟的毫秒数
|
|
6
6
|
*/
|
|
7
|
-
export default function throttle<T extends (...args: any) => any>(func: T, wait?: number): (...args: Parameters<T>) => void;
|
|
7
|
+
export default function throttle<T extends (...args: any[]) => any>(func: T, wait?: number): (...args: Parameters<T>) => void;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 创建一个防抖动函数,该函数在高频调用时会每隔 wait 毫秒后调用 func 方法
|
|
3
|
+
* `throttle` 会在第一次调用时立刻调用一次
|
|
4
|
+
* @param func - 要防抖动的函数
|
|
5
|
+
* @param wait - 需要延迟的毫秒数
|
|
6
|
+
*/
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8
|
+
export default function throttle(func, wait = 200) {
|
|
9
|
+
let last;
|
|
10
|
+
return function (...args) {
|
|
11
|
+
if (last)
|
|
12
|
+
return;
|
|
13
|
+
func(...args);
|
|
14
|
+
last = setTimeout(function () {
|
|
15
|
+
last = null;
|
|
16
|
+
}, wait);
|
|
17
|
+
};
|
|
18
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 传入一个 Promise
|
|
3
|
+
* 无异常,返回 [null, data]
|
|
4
|
+
* 有异常,则返回 [Error, undefined]
|
|
5
|
+
* 用于替代 try&catch 处理 await 异常的方案
|
|
6
|
+
*/
|
|
7
|
+
export async function to(promise) {
|
|
8
|
+
try {
|
|
9
|
+
const data = await promise;
|
|
10
|
+
return [null, data];
|
|
11
|
+
}
|
|
12
|
+
catch (error) {
|
|
13
|
+
if (error instanceof Error)
|
|
14
|
+
return [error, null];
|
|
15
|
+
return [new Error(''), null];
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export default to;
|
|
File without changes
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useRef, useEffect, useCallback } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* 函数防抖:指触发事件后,在 `n` 秒内函数只能执行一次,如果触发事件后在 `n` 秒内又触发了事件,则会重新计算函数延执行时间。
|
|
4
|
+
* @param callback 回调函数
|
|
5
|
+
* @param waitFor 等待时间
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export const useDebounce = (callback, waitFor = 200) => {
|
|
9
|
+
const timer = useRef();
|
|
10
|
+
const savedFunc = useRef(callback);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
savedFunc.current = callback;
|
|
13
|
+
}, [waitFor]);
|
|
14
|
+
return useCallback((...args) => {
|
|
15
|
+
if (timer.current) {
|
|
16
|
+
clearTimeout(timer.current);
|
|
17
|
+
timer.current = null;
|
|
18
|
+
}
|
|
19
|
+
timer.current = setTimeout(() => savedFunc.current?.(...args), waitFor);
|
|
20
|
+
}, []);
|
|
21
|
+
};
|
|
22
|
+
export default useDebounce;
|
|
File without changes
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useRef, useEffect, useCallback } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* 函数节流:控制频率,限制在 `n` 秒时间。
|
|
4
|
+
* @param callback 回调函数
|
|
5
|
+
* @param waitFor 等待时间
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export const useThrottle = (callback, waitFor) => {
|
|
9
|
+
const timer = useRef();
|
|
10
|
+
const savedFunc = useRef(callback);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
savedFunc.current = callback;
|
|
13
|
+
}, [waitFor]);
|
|
14
|
+
return useCallback((...args) => {
|
|
15
|
+
if (timer.current)
|
|
16
|
+
return;
|
|
17
|
+
savedFunc.current?.(...args);
|
|
18
|
+
timer.current = setTimeout(() => {
|
|
19
|
+
if (timer.current)
|
|
20
|
+
clearTimeout(timer.current);
|
|
21
|
+
timer.current = null;
|
|
22
|
+
}, waitFor);
|
|
23
|
+
}, []);
|
|
24
|
+
};
|
|
25
|
+
export default useThrottle;
|
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// uuid
|
|
2
|
+
function S4() {
|
|
3
|
+
return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* 随机生成一个uuid值
|
|
7
|
+
*/
|
|
8
|
+
export default function uuid() {
|
|
9
|
+
// then to call it, plus stitch in '4' in the third group
|
|
10
|
+
return (S4() + S4() + '-' + S4() + '-4' + S4().substr(0, 3) + '-' + S4() + '-' + S4() + S4() + S4()).toLowerCase();
|
|
11
|
+
}
|
|
File without changes
|