@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.
Files changed (477) hide show
  1. package/README.md +6 -90
  2. package/dist/dnalogel.es.js +37145 -0
  3. package/dist/dnalogel.umd.js +2 -0
  4. package/dist/style.css +1 -0
  5. package/{plugins → libs}/CSS3DRenderPlugin/index.d.ts +1 -1
  6. package/libs/CSS3DRenderPlugin/index.js +181 -0
  7. package/libs/CSS3DRenderPlugin/utils/createResizeObserver.d.ts +7 -0
  8. package/libs/CSS3DRenderPlugin/utils/createResizeObserver.js +18 -0
  9. package/{plugins → libs}/CameraMovementPlugin/index.d.ts +0 -0
  10. package/libs/CameraMovementPlugin/index.js +159 -0
  11. package/{plugins → libs}/CameraMovementPlugin/typing.d.ts +0 -0
  12. package/libs/CameraMovementPlugin/typing.js +17 -0
  13. package/{plugins → libs}/ModelChassisCompassPlugin/index.d.ts +1 -1
  14. package/libs/ModelChassisCompassPlugin/index.js +75 -0
  15. package/{plugins → libs}/ModelEntryDoorGuidePlugin/index.d.ts +6 -2
  16. package/libs/ModelEntryDoorGuidePlugin/index.js +136 -0
  17. package/libs/ModelRoomLabelPlugin/Assets/roomLabelBg.d.ts +1 -0
  18. package/libs/ModelRoomLabelPlugin/Assets/roomLabelBg.js +1 -0
  19. package/{plugins → libs}/ModelRoomLabelPlugin/Controller.d.ts +3 -2
  20. package/libs/ModelRoomLabelPlugin/Controller.js +100 -0
  21. package/libs/ModelRoomLabelPlugin/RoomLabelItem.svelte +63 -0
  22. package/libs/ModelRoomLabelPlugin/RoomLabelItem.svelte.map +1 -0
  23. package/libs/ModelRoomLabelPlugin/RoomLabelItems.svelte +80 -0
  24. package/libs/ModelRoomLabelPlugin/RoomLabelItems.svelte.map +1 -0
  25. package/libs/ModelRoomLabelPlugin/index.d.ts +12 -0
  26. package/libs/ModelRoomLabelPlugin/index.js +9 -0
  27. package/{plugins → libs}/ModelRoomLabelPlugin/typings.d.ts +2 -2
  28. package/libs/ModelRoomLabelPlugin/typings.js +1 -0
  29. package/{plugins → libs}/ModelRoomLabelPlugin/utils/parseData.d.ts +0 -0
  30. package/libs/ModelRoomLabelPlugin/utils/parseData.js +14 -0
  31. package/{plugins → libs}/ModelViewPlugin/index.d.ts +0 -0
  32. package/libs/ModelViewPlugin/index.js +160 -0
  33. package/{plugins → libs}/PanoCursorRaycasterPlugin/index.d.ts +2 -3
  34. package/libs/PanoCursorRaycasterPlugin/index.js +74 -0
  35. package/libs/floorplan/Assets/camera.d.ts +1 -0
  36. package/libs/floorplan/Assets/camera.js +1 -0
  37. package/libs/floorplan/Assets/floorplanExtraObject.d.ts +1 -0
  38. package/libs/floorplan/Assets/floorplanExtraObject.js +1 -0
  39. package/libs/floorplan/Components/BaseImage.svelte +25 -0
  40. package/libs/floorplan/Components/BaseImage.svelte.map +1 -0
  41. package/libs/floorplan/Components/Normalmage.svelte +11 -0
  42. package/libs/floorplan/Components/Normalmage.svelte.map +1 -0
  43. package/libs/floorplan/Components/RoomHighlight/Room.svelte +21 -0
  44. package/libs/floorplan/Components/RoomHighlight/Room.svelte.map +1 -0
  45. package/libs/floorplan/Components/RoomHighlight/RoomHighlight.svelte +60 -0
  46. package/libs/floorplan/Components/RoomHighlight/RoomHighlight.svelte.map +1 -0
  47. package/libs/floorplan/Components/RoomMaterials/RoomMaterial.svelte +35 -0
  48. package/libs/floorplan/Components/RoomMaterials/RoomMaterial.svelte.map +1 -0
  49. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.svelte +7 -0
  50. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.svelte.map +1 -0
  51. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.svelte +16 -0
  52. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.svelte.map +1 -0
  53. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.svelte +17 -0
  54. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.svelte.map +1 -0
  55. package/libs/floorplan/Components/SvgImage.svelte +25 -0
  56. package/libs/floorplan/Components/SvgImage.svelte.map +1 -0
  57. package/libs/floorplan/ModelFloorplanPlugin/Assets/compass.d.ts +1 -0
  58. package/libs/floorplan/ModelFloorplanPlugin/Assets/compass.js +1 -0
  59. package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.svelte +46 -0
  60. package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.svelte.map +1 -0
  61. package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.svelte +48 -0
  62. package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.svelte.map +1 -0
  63. package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.svelte +37 -0
  64. package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.svelte.map +1 -0
  65. package/libs/floorplan/ModelFloorplanPlugin/Components/Main.svelte +50 -0
  66. package/libs/floorplan/ModelFloorplanPlugin/Components/Main.svelte.map +1 -0
  67. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.svelte +41 -0
  68. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.svelte.map +1 -0
  69. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.svelte +25 -0
  70. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.svelte.map +1 -0
  71. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.svelte +148 -0
  72. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.svelte.map +1 -0
  73. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.svelte +15 -0
  74. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.svelte.map +1 -0
  75. package/{plugins → libs}/floorplan/ModelFloorplanPlugin/Controller.d.ts +16 -14
  76. package/libs/floorplan/ModelFloorplanPlugin/Controller.js +357 -0
  77. package/{plugins → libs}/floorplan/ModelFloorplanPlugin/index.d.ts +1 -1
  78. package/libs/floorplan/ModelFloorplanPlugin/index.js +5 -0
  79. package/{plugins → libs}/floorplan/ModelFloorplanPlugin/typings/events.type.d.ts +0 -0
  80. package/libs/floorplan/ModelFloorplanPlugin/typings/events.type.js +1 -0
  81. package/{plugins → libs}/floorplan/ModelFloorplanPlugin/utils/constant.d.ts +1 -1
  82. package/libs/floorplan/ModelFloorplanPlugin/utils/constant.js +16 -0
  83. package/{plugins → libs}/floorplan/ModelFloorplanPlugin/utils/correctFiveState.d.ts +0 -0
  84. package/libs/floorplan/ModelFloorplanPlugin/utils/correctFiveState.js +46 -0
  85. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.svelte +84 -0
  86. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.svelte.map +1 -0
  87. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.svelte +18 -0
  88. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.svelte.map +1 -0
  89. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.svelte +40 -0
  90. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.svelte.map +1 -0
  91. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.svelte +61 -0
  92. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.svelte.map +1 -0
  93. package/{plugins → libs}/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +6 -11
  94. package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +88 -0
  95. package/{plugins → libs}/floorplan/PanoFloorplanRadarPlugin/index.d.ts +0 -0
  96. package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +5 -0
  97. package/{plugins → libs}/floorplan/TopviewFloorplanPlugin/Controller.d.ts +15 -11
  98. package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +189 -0
  99. package/{plugins → libs}/floorplan/TopviewFloorplanPlugin/index.d.ts +0 -0
  100. package/libs/floorplan/TopviewFloorplanPlugin/index.js +5 -0
  101. package/{plugins → libs}/floorplan/TopviewFloorplanPlugin/style.d.ts +0 -0
  102. package/libs/floorplan/TopviewFloorplanPlugin/style.js +8 -0
  103. package/{plugins → libs}/floorplan/typings/floorplanData.d.ts +6 -0
  104. package/libs/floorplan/typings/floorplanData.js +6 -0
  105. package/{plugins → libs}/floorplan/typings/floorplanServerData.d.ts +4 -2
  106. package/libs/floorplan/typings/floorplanServerData.js +101 -0
  107. package/libs/floorplan/typings/utility.d.ts +2 -0
  108. package/libs/floorplan/typings/utility.js +1 -0
  109. package/{plugins → libs}/floorplan/utils/formatData.d.ts +3 -3
  110. package/libs/floorplan/utils/formatData.js +94 -0
  111. package/{plugins → libs}/floorplan/utils/formatPosition.d.ts +3 -4
  112. package/libs/floorplan/utils/formatPosition.js +50 -0
  113. package/libs/index.d.ts +17 -0
  114. package/libs/index.js +10 -0
  115. package/{shared-utils → libs/shared-utils}/Preloader.d.ts +0 -0
  116. package/libs/shared-utils/Preloader.js +38 -0
  117. package/{shared-utils → libs/shared-utils}/Subscribe.d.ts +3 -3
  118. package/libs/shared-utils/Subscribe.js +101 -0
  119. package/{shared-utils → libs/shared-utils}/animationFrame/BetterTween.d.ts +0 -0
  120. package/libs/shared-utils/animationFrame/BetterTween.js +30 -0
  121. package/{shared-utils → libs/shared-utils}/animationFrame/calculateProgress.d.ts +0 -0
  122. package/libs/shared-utils/animationFrame/calculateProgress.js +23 -0
  123. package/{shared-utils → libs/shared-utils}/animationFrame/formatRad.d.ts +0 -0
  124. package/libs/shared-utils/animationFrame/formatRad.js +20 -0
  125. package/{shared-utils → libs/shared-utils}/animationFrame/index.d.ts +0 -0
  126. package/libs/shared-utils/animationFrame/index.js +48 -0
  127. package/{shared-utils → libs/shared-utils}/animationFrame/tween.d.ts +0 -0
  128. package/libs/shared-utils/animationFrame/tween.js +44 -0
  129. package/libs/shared-utils/changeModelCanvasOpacity.d.ts +2 -0
  130. package/libs/shared-utils/changeModelCanvasOpacity.js +15 -0
  131. package/{shared-utils → libs/shared-utils}/createCanvasTextTexture.d.ts +0 -0
  132. package/libs/shared-utils/createCanvasTextTexture.js +19 -0
  133. package/{shared-utils → libs/shared-utils}/createLine/index.d.ts +1 -1
  134. package/libs/shared-utils/createLine/index.js +8 -0
  135. package/{shared-utils → libs/shared-utils}/debounce.d.ts +1 -1
  136. package/libs/shared-utils/debounce.js +14 -0
  137. package/{shared-utils → libs/shared-utils}/equal.d.ts +0 -0
  138. package/libs/shared-utils/equal.js +84 -0
  139. package/{shared-utils → libs/shared-utils}/filter.d.ts +0 -0
  140. package/libs/shared-utils/filter.js +53 -0
  141. package/{shared-utils → libs/shared-utils}/five/changeMode.d.ts +0 -0
  142. package/libs/shared-utils/five/changeMode.js +15 -0
  143. package/{shared-utils → libs/shared-utils}/five/useFivePlugin.d.ts +0 -0
  144. package/libs/shared-utils/five/useFivePlugin.js +8 -0
  145. package/{shared-utils → libs/shared-utils}/formatRad.d.ts +0 -0
  146. package/libs/shared-utils/formatRad.js +10 -0
  147. package/{shared-utils → libs/shared-utils}/getPxmm.d.ts +0 -0
  148. package/libs/shared-utils/getPxmm.js +20 -0
  149. package/{shared-utils → libs/shared-utils}/getRandomColor.d.ts +0 -0
  150. package/libs/shared-utils/getRandomColor.js +10 -0
  151. package/{shared-utils → libs/shared-utils}/isNil.d.ts +0 -0
  152. package/libs/shared-utils/isNil.js +14 -0
  153. package/{shared-utils → libs/shared-utils}/isTruelyObject.d.ts +0 -0
  154. package/libs/shared-utils/isTruelyObject.js +20 -0
  155. package/libs/shared-utils/math/evenNumber.d.ts +3 -0
  156. package/libs/shared-utils/math/evenNumber.js +4 -0
  157. package/{shared-utils → libs/shared-utils}/math/planimetry.d.ts +4 -4
  158. package/libs/shared-utils/math/planimetry.js +288 -0
  159. package/{shared-utils → libs/shared-utils}/math/rad2Deg.d.ts +0 -0
  160. package/libs/shared-utils/math/rad2Deg.js +3 -0
  161. package/{shared-utils → libs/shared-utils}/nearlyEqual.d.ts +0 -0
  162. package/libs/shared-utils/nearlyEqual.js +9 -0
  163. package/{shared-utils → libs/shared-utils}/nextFrame.d.ts +0 -0
  164. package/libs/shared-utils/nextFrame.js +6 -0
  165. package/{shared-utils → libs/shared-utils}/noop.d.ts +0 -0
  166. package/libs/shared-utils/noop.js +7 -0
  167. package/{shared-utils → libs/shared-utils}/object3d2LocalMatrix.d.ts +0 -0
  168. package/libs/shared-utils/object3d2LocalMatrix.js +29 -0
  169. package/{shared-utils → libs/shared-utils}/px2rem.d.ts +0 -0
  170. package/libs/shared-utils/px2rem.js +4 -0
  171. package/libs/shared-utils/removeArrayItem.d.ts +7 -0
  172. package/libs/shared-utils/removeArrayItem.js +12 -0
  173. package/{shared-utils → libs/shared-utils}/tap.d.ts +0 -0
  174. package/{shared-utils → libs/shared-utils}/tap.js +4 -13
  175. package/{shared-utils → libs/shared-utils}/three/centerPoint.d.ts +0 -0
  176. package/libs/shared-utils/three/centerPoint.js +4 -0
  177. package/{shared-utils → libs/shared-utils}/three/getExtraModelLoader.d.ts +0 -0
  178. package/libs/shared-utils/three/getExtraModelLoader.js +18 -0
  179. package/{shared-utils → libs/shared-utils}/three/getNormal.d.ts +0 -0
  180. package/libs/shared-utils/three/getNormal.js +6 -0
  181. package/{shared-utils → libs/shared-utils}/three/getTextureLoader.d.ts +0 -0
  182. package/libs/shared-utils/three/getTextureLoader.js +17 -0
  183. package/{shared-utils → libs/shared-utils}/three/loadFbxObj.d.ts +0 -0
  184. package/libs/shared-utils/three/loadFbxObj.js +13 -0
  185. package/libs/shared-utils/three/loadTexture.d.ts +2 -0
  186. package/libs/shared-utils/three/loadTexture.js +10 -0
  187. package/{shared-utils → libs/shared-utils}/three/transformPositionToVector3.d.ts +0 -0
  188. package/libs/shared-utils/three/transformPositionToVector3.js +3 -0
  189. package/{shared-utils → libs/shared-utils}/three/transfromToMeshBasicMaterial.d.ts +0 -0
  190. package/libs/shared-utils/three/transfromToMeshBasicMaterial.js +14 -0
  191. package/{shared-utils → libs/shared-utils}/throttle.d.ts +1 -1
  192. package/libs/shared-utils/throttle.js +18 -0
  193. package/{shared-utils → libs/shared-utils}/to.d.ts +0 -0
  194. package/libs/shared-utils/to.js +18 -0
  195. package/{shared-utils → libs/shared-utils}/useDebounce.d.ts +0 -0
  196. package/libs/shared-utils/useDebounce.js +22 -0
  197. package/{shared-utils → libs/shared-utils}/useThrottle.d.ts +0 -0
  198. package/libs/shared-utils/useThrottle.js +25 -0
  199. package/libs/{gltf-viewer → shared-utils}/uuid.d.ts +0 -0
  200. package/libs/shared-utils/uuid.js +11 -0
  201. package/{shared-utils → libs/shared-utils}/vectorTocoordinates.d.ts +0 -0
  202. package/libs/shared-utils/vectorTocoordinates.js +9 -0
  203. package/{typings → libs/typings}/math.type.d.ts +0 -0
  204. package/libs/typings/math.type.js +1 -0
  205. package/{typings → libs/typings}/utils.type.d.ts +0 -0
  206. package/libs/typings/utils.type.js +1 -0
  207. package/package.json +45 -17
  208. package/TERMS.txt +0 -56
  209. package/components/ARVideoFigure/ARVideoFigureMesh.d.ts +0 -44
  210. package/components/ARVideoFigure/ARVideoFigureMesh.js +0 -371
  211. package/components/ARVideoFigure/ARVideoFigureScene.d.ts +0 -11
  212. package/components/ARVideoFigure/ARVideoFigureScene.js +0 -85
  213. package/components/ARVideoFigure/ImgBgTransparent.d.ts +0 -16
  214. package/components/ARVideoFigure/ImgBgTransparent.js +0 -65
  215. package/components/ARVideoFigure/ImgBgTransparentMesh.d.ts +0 -30
  216. package/components/ARVideoFigure/ImgBgTransparentMesh.js +0 -183
  217. package/components/ARVideoFigure/fragmentShader.d.ts +0 -5
  218. package/components/ARVideoFigure/fragmentShader.js +0 -18
  219. package/components/ARVideoFigure/index.d.ts +0 -15
  220. package/components/ARVideoFigure/index.js +0 -80
  221. package/components/ARVideoFigure/vertexShader.d.ts +0 -1
  222. package/components/ARVideoFigure/vertexShader.js +0 -10
  223. package/components/GLTFView/index.d.ts +0 -72
  224. package/components/GLTFView/index.js +0 -149
  225. package/components/GlassFilters/index.d.ts +0 -32
  226. package/components/GlassFilters/index.js +0 -78
  227. package/components/ModelView/ModelViewController.d.ts +0 -18
  228. package/components/ModelView/ModelViewController.js +0 -157
  229. package/components/ModelView/index.d.ts +0 -10
  230. package/components/ModelView/index.js +0 -24
  231. package/components/PaintBrush/index.d.ts +0 -16
  232. package/components/PaintBrush/index.js +0 -47
  233. package/components/PanoTag/index.d.ts +0 -4
  234. package/components/PanoTag/index.js +0 -13
  235. package/custom.d.js +0 -3
  236. package/data/1aGKl9JmrlXMXx8d.d.ts +0 -104
  237. package/data/1aGKl9JmrlXMXx8d.js +0 -537
  238. package/data/54djM0oR6ky3Ey8e.d.ts +0 -55
  239. package/data/54djM0oR6ky3Ey8e.js +0 -350
  240. package/data/6gyq3v1verxD7JO1.d.ts +0 -104
  241. package/data/6gyq3v1verxD7JO1.js +0 -462
  242. package/data/8054djM0oR6ky3Ey8e.d.ts +0 -55
  243. package/data/8054djM0oR6ky3Ey8e.js +0 -350
  244. package/data/KpokNd82rwjhackhQTBEoYKHg8zGbPXe.d.ts +0 -84
  245. package/data/KpokNd82rwjhackhQTBEoYKHg8zGbPXe.js +0 -600
  246. package/data/PrXel3aqGbp34JQn.d.ts +0 -389
  247. package/data/PrXel3aqGbp34JQn.js +0 -4649
  248. package/data/XJ6NMLWnkAY3Rdx8.d.ts +0 -843
  249. package/data/XJ6NMLWnkAY3Rdx8.js +0 -7989
  250. package/data/YdoNP9K4rwQDwjJr.d.ts +0 -83
  251. package/data/YdoNP9K4rwQDwjJr.js +0 -1453
  252. package/data/ZLvK29zj4L29Jowd.d.ts +0 -55
  253. package/data/ZLvK29zj4L29Jowd.js +0 -372
  254. package/data/auto3d-njL5J99VwCmnjtQElOmXQr.d.ts +0 -86
  255. package/data/auto3d-njL5J99VwCmnjtQElOmXQr.js +0 -711
  256. package/data/extrude-walls/ZLvK29zj4L29Jowd.d.ts +0 -5
  257. package/data/extrude-walls/ZLvK29zj4L29Jowd.js +0 -14
  258. package/data/extrude-walls/lo024DEgzanMj5BE.d.ts +0 -5
  259. package/data/extrude-walls/lo024DEgzanMj5BE.js +0 -14
  260. package/data/jd6oMOzPxnQ3BvxY_B7yw51J9rXlhYhjhGTOgRVqu6WeEqjNX.d.ts +0 -85
  261. package/data/jd6oMOzPxnQ3BvxY_B7yw51J9rXlhYhjhGTOgRVqu6WeEqjNX.js +0 -511
  262. package/data/lo024DEgzanMj5BE.d.ts +0 -55
  263. package/data/lo024DEgzanMj5BE.js +0 -966
  264. package/data/oPzy3ApbjjpD8YdR.d.ts +0 -83
  265. package/data/oPzy3ApbjjpD8YdR.js +0 -283
  266. package/data/qjAxMG4XbPn96wKG.d.ts +0 -104
  267. package/data/qjAxMG4XbPn96wKG.js +0 -637
  268. package/data/rXel3aPQRRBD4JQn.d.ts +0 -86
  269. package/data/rXel3aPQRRBD4JQn.js +0 -622
  270. package/data/vLykj3NWrllMrG06.d.ts +0 -91
  271. package/data/vLykj3NWrllMrG06.js +0 -2729
  272. package/data/wz0QV9KA4ugyo9ME.d.ts +0 -39
  273. package/data/wz0QV9KA4ugyo9ME.js +0 -136
  274. package/data/zxMawr9raSg8LYjG.d.ts +0 -53
  275. package/data/zxMawr9raSg8LYjG.js +0 -590
  276. package/examples/FiveStateController/index.js +0 -134
  277. package/examples/VRHouse/Mobile.js +0 -36
  278. package/examples/VRHouse/PC.js +0 -36
  279. package/examples/VRHouse/index.js +0 -36
  280. package/index.d.ts +0 -15
  281. package/index.js +0 -45
  282. package/libs/gltf-viewer/Subscribe.d.ts +0 -76
  283. package/libs/gltf-viewer/Subscribe.js +0 -231
  284. package/libs/gltf-viewer/coordsMoveByOffset.d.ts +0 -13
  285. package/libs/gltf-viewer/coordsMoveByOffset.js +0 -22
  286. package/libs/gltf-viewer/coordsToDirection.d.ts +0 -5
  287. package/libs/gltf-viewer/coordsToDirection.js +0 -41
  288. package/libs/gltf-viewer/formatRad.d.ts +0 -1
  289. package/libs/gltf-viewer/formatRad.js +0 -13
  290. package/libs/gltf-viewer/getFrameTime.d.ts +0 -1
  291. package/libs/gltf-viewer/getFrameTime.js +0 -28
  292. package/libs/gltf-viewer/index.d.ts +0 -55
  293. package/libs/gltf-viewer/index.js +0 -650
  294. package/libs/gltf-viewer/mouseWheel.d.ts +0 -2
  295. package/libs/gltf-viewer/mouseWheel.js +0 -59
  296. package/libs/gltf-viewer/requestAnimationFrame.d.ts +0 -1
  297. package/libs/gltf-viewer/requestAnimationFrame.js +0 -18
  298. package/libs/gltf-viewer/requestAnimationFrameInterval.d.ts +0 -1
  299. package/libs/gltf-viewer/requestAnimationFrameInterval.js +0 -31
  300. package/libs/gltf-viewer/uuid.js +0 -28
  301. package/plugins/AutoPreloadPlugin/index.d.ts +0 -23
  302. package/plugins/AutoPreloadPlugin/index.js +0 -111
  303. package/plugins/CSS3DRenderPlugin/components/Marker/index.d.ts +0 -12
  304. package/plugins/CSS3DRenderPlugin/components/Marker/index.js +0 -121
  305. package/plugins/CSS3DRenderPlugin/index.js +0 -298
  306. package/plugins/CameraMovementPlugin/index.js +0 -362
  307. package/plugins/CameraMovementPlugin/typing.js +0 -37
  308. package/plugins/ModelChassisCompassPlugin/index.js +0 -157
  309. package/plugins/ModelEntryDoorGuidePlugin/index.js +0 -247
  310. package/plugins/ModelExtrudeWallsPlugin/index.d.ts +0 -16
  311. package/plugins/ModelExtrudeWallsPlugin/index.js +0 -252
  312. package/plugins/ModelRoomLabelPlugin/Controller.js +0 -153
  313. package/plugins/ModelRoomLabelPlugin/RoomLabelItem.d.ts +0 -8
  314. package/plugins/ModelRoomLabelPlugin/RoomLabelItem.js +0 -66
  315. package/plugins/ModelRoomLabelPlugin/RoomLabelItems.d.ts +0 -7
  316. package/plugins/ModelRoomLabelPlugin/RoomLabelItems.js +0 -159
  317. package/plugins/ModelRoomLabelPlugin/index.d.ts +0 -8
  318. package/plugins/ModelRoomLabelPlugin/index.js +0 -18
  319. package/plugins/ModelRoomLabelPlugin/typings.js +0 -7
  320. package/plugins/ModelRoomLabelPlugin/utils/parseData.js +0 -35
  321. package/plugins/ModelTVVideoPlugin/index.d.ts +0 -21
  322. package/plugins/ModelTVVideoPlugin/index.js +0 -397
  323. package/plugins/ModelViewPlugin/index.js +0 -223
  324. package/plugins/PanoCursorRaycasterPlugin/PanoCursorRaycasterPluginUsage.d.ts +0 -48
  325. package/plugins/PanoCursorRaycasterPlugin/components/MovePointTowardsCamera.d.ts +0 -9
  326. package/plugins/PanoCursorRaycasterPlugin/components/MovePointTowardsCamera.js +0 -117
  327. package/plugins/PanoCursorRaycasterPlugin/components/PointAxesHelper.d.ts +0 -11
  328. package/plugins/PanoCursorRaycasterPlugin/components/PointAxesHelper.js +0 -39
  329. package/plugins/PanoCursorRaycasterPlugin/index.js +0 -126
  330. package/plugins/PanoCursorRaycasterPlugin/utils/addLineToFive.d.ts +0 -5
  331. package/plugins/PanoCursorRaycasterPlugin/utils/addLineToFive.js +0 -27
  332. package/plugins/PanoCursorRaycasterPlugin/utils/createLine.d.ts +0 -3
  333. package/plugins/PanoCursorRaycasterPlugin/utils/createLine.js +0 -48
  334. package/plugins/PanoDoorLabelPlugin/index.d.ts +0 -4
  335. package/plugins/PanoDoorLabelPlugin/index.js +0 -14
  336. package/plugins/PanoIRobotPlugin/index.d.ts +0 -10
  337. package/plugins/PanoIRobotPlugin/index.js +0 -18
  338. package/plugins/PanoMaskSelectorPlugin/compare.d.ts +0 -1
  339. package/plugins/PanoMaskSelectorPlugin/compare.js +0 -17
  340. package/plugins/PanoMaskSelectorPlugin/createBox.d.ts +0 -7
  341. package/plugins/PanoMaskSelectorPlugin/createBox.js +0 -79
  342. package/plugins/PanoMaskSelectorPlugin/createTextures.d.ts +0 -3
  343. package/plugins/PanoMaskSelectorPlugin/createTextures.js +0 -45
  344. package/plugins/PanoMaskSelectorPlugin/fragmentShader.d.ts +0 -1
  345. package/plugins/PanoMaskSelectorPlugin/fragmentShader.js +0 -10
  346. package/plugins/PanoMaskSelectorPlugin/index.d.ts +0 -49
  347. package/plugins/PanoMaskSelectorPlugin/index.js +0 -348
  348. package/plugins/PanoMaskSelectorPlugin/vertexShader.d.ts +0 -1
  349. package/plugins/PanoMaskSelectorPlugin/vertexShader.js +0 -10
  350. package/plugins/PanoRulerPlugin/data/roomInfo.d.ts +0 -3
  351. package/plugins/PanoRulerPlugin/data/roomInfo.js +0 -51
  352. package/plugins/PanoRulerPlugin/data/roomRules.d.ts +0 -3
  353. package/plugins/PanoRulerPlugin/data/roomRules.js +0 -235
  354. package/plugins/PanoRulerPlugin/index.d.ts +0 -27
  355. package/plugins/PanoRulerPlugin/index.js +0 -637
  356. package/plugins/PanoRulerPlugin/typings.d.ts +0 -21
  357. package/plugins/PanoRulerPlugin/typings.js +0 -7
  358. package/plugins/PanoTVVideoPlugin/index.d.ts +0 -26
  359. package/plugins/PanoTVVideoPlugin/index.js +0 -433
  360. package/plugins/TreasurePlugin/Controller.d.ts +0 -73
  361. package/plugins/TreasurePlugin/Controller.js +0 -250
  362. package/plugins/TreasurePlugin/TreasureFaceAnime.d.ts +0 -25
  363. package/plugins/TreasurePlugin/TreasureFaceAnime.js +0 -143
  364. package/plugins/TreasurePlugin/TreasureObject.d.ts +0 -53
  365. package/plugins/TreasurePlugin/TreasureObject.js +0 -406
  366. package/plugins/TreasurePlugin/TreasureOpenAnime.d.ts +0 -25
  367. package/plugins/TreasurePlugin/TreasureOpenAnime.js +0 -127
  368. package/plugins/TreasurePlugin/constants.d.ts +0 -33
  369. package/plugins/TreasurePlugin/constants.js +0 -67
  370. package/plugins/TreasurePlugin/index.d.ts +0 -11
  371. package/plugins/TreasurePlugin/index.js +0 -26
  372. package/plugins/TreasurePlugin/typings.d.ts +0 -2
  373. package/plugins/TreasurePlugin/typings.js +0 -7
  374. package/plugins/floorplan/Assets/floorplanExtraObject.d.ts +0 -1
  375. package/plugins/floorplan/Assets/floorplanExtraObject.js +0 -10
  376. package/plugins/floorplan/ModelFloorplanPlugin/Controller.js +0 -626
  377. package/plugins/floorplan/ModelFloorplanPlugin/components/Camera.d.ts +0 -13
  378. package/plugins/floorplan/ModelFloorplanPlugin/components/Camera.js +0 -78
  379. package/plugins/floorplan/ModelFloorplanPlugin/components/Compass.d.ts +0 -5
  380. package/plugins/floorplan/ModelFloorplanPlugin/components/Compass.js +0 -84
  381. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomHighlight.d.ts +0 -10
  382. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomHighlight.js +0 -129
  383. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomLabels.d.ts +0 -13
  384. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomLabels.js +0 -118
  385. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/index.d.ts +0 -13
  386. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/index.js +0 -62
  387. package/plugins/floorplan/ModelFloorplanPlugin/components/index.d.ts +0 -20
  388. package/plugins/floorplan/ModelFloorplanPlugin/components/index.js +0 -88
  389. package/plugins/floorplan/ModelFloorplanPlugin/controller.style.d.ts +0 -1
  390. package/plugins/floorplan/ModelFloorplanPlugin/controller.style.js +0 -16
  391. package/plugins/floorplan/ModelFloorplanPlugin/index.js +0 -20
  392. package/plugins/floorplan/ModelFloorplanPlugin/typings/events.type.js +0 -7
  393. package/plugins/floorplan/ModelFloorplanPlugin/utils/constant.js +0 -33
  394. package/plugins/floorplan/ModelFloorplanPlugin/utils/correctFiveState.js +0 -154
  395. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.d.ts +0 -13
  396. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.js +0 -113
  397. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.style.d.ts +0 -3
  398. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.style.js +0 -39
  399. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/ExtraObjects.d.ts +0 -5
  400. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/ExtraObjects.js +0 -66
  401. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/RoomHighlight.d.ts +0 -9
  402. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/RoomHighlight.js +0 -126
  403. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/index.d.ts +0 -11
  404. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/index.js +0 -58
  405. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.d.ts +0 -17
  406. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.js +0 -85
  407. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.style.d.ts +0 -2
  408. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.style.js +0 -15
  409. package/plugins/floorplan/PanoFloorplanRadarPlugin/Controller.js +0 -211
  410. package/plugins/floorplan/PanoFloorplanRadarPlugin/index.js +0 -20
  411. package/plugins/floorplan/TopviewFloorplanPlugin/Controller.js +0 -262
  412. package/plugins/floorplan/TopviewFloorplanPlugin/index.js +0 -18
  413. package/plugins/floorplan/TopviewFloorplanPlugin/style.js +0 -16
  414. package/plugins/floorplan/components/FloorplanImage.d.ts +0 -7
  415. package/plugins/floorplan/components/FloorplanImage.js +0 -90
  416. package/plugins/floorplan/typings/floorplanData.js +0 -7
  417. package/plugins/floorplan/typings/floorplanServerData.js +0 -382
  418. package/plugins/floorplan/utils/formatData.js +0 -217
  419. package/plugins/floorplan/utils/formatPosition.js +0 -89
  420. package/shared-utils/Preloader.js +0 -57
  421. package/shared-utils/Subscribe.js +0 -230
  422. package/shared-utils/animationFrame/BetterTween.js +0 -103
  423. package/shared-utils/animationFrame/calculateProgress.js +0 -40
  424. package/shared-utils/animationFrame/formatRad.js +0 -36
  425. package/shared-utils/animationFrame/index.js +0 -81
  426. package/shared-utils/animationFrame/tween.js +0 -92
  427. package/shared-utils/changeModelCanvansOpacity.d.ts +0 -2
  428. package/shared-utils/changeModelCanvansOpacity.js +0 -38
  429. package/shared-utils/createCanvasTextTexture.js +0 -31
  430. package/shared-utils/createFiveContainer.d.ts +0 -10
  431. package/shared-utils/createFiveContainer.js +0 -171
  432. package/shared-utils/createLine/index.js +0 -43
  433. package/shared-utils/debounce.js +0 -30
  434. package/shared-utils/equal.js +0 -107
  435. package/shared-utils/filter.js +0 -127
  436. package/shared-utils/five/changeMode.js +0 -82
  437. package/shared-utils/five/useFivePlugin.js +0 -17
  438. package/shared-utils/formatRad.js +0 -18
  439. package/shared-utils/getPxmm.js +0 -51
  440. package/shared-utils/getRandomColor.js +0 -23
  441. package/shared-utils/isNil.js +0 -26
  442. package/shared-utils/isTruelyObject.js +0 -31
  443. package/shared-utils/math/evenNumber.d.ts +0 -1
  444. package/shared-utils/math/evenNumber.js +0 -13
  445. package/shared-utils/math/planimetry.js +0 -352
  446. package/shared-utils/math/rad2Deg.js +0 -12
  447. package/shared-utils/nearlyEqual.js +0 -19
  448. package/shared-utils/nextFrame.js +0 -15
  449. package/shared-utils/noop.js +0 -19
  450. package/shared-utils/object3d2LocalMatrix.js +0 -79
  451. package/shared-utils/px2rem.js +0 -22
  452. package/shared-utils/three/centerPoint.js +0 -14
  453. package/shared-utils/three/getExtraModelLoader.js +0 -45
  454. package/shared-utils/three/getNormal.js +0 -17
  455. package/shared-utils/three/getTextureLoader.js +0 -50
  456. package/shared-utils/three/loadFbxObj.js +0 -54
  457. package/shared-utils/three/loadTexture.d.ts +0 -2
  458. package/shared-utils/three/loadTexture.js +0 -46
  459. package/shared-utils/three/transformPositionToVector3.js +0 -20
  460. package/shared-utils/three/transfromToMeshBasicMaterial.js +0 -33
  461. package/shared-utils/throttle.js +0 -29
  462. package/shared-utils/to.js +0 -67
  463. package/shared-utils/useDebounce.js +0 -49
  464. package/shared-utils/useThrottle.js +0 -47
  465. package/shared-utils/uuid.d.ts +0 -4
  466. package/shared-utils/uuid.js +0 -28
  467. package/shared-utils/vectorTocoordinates.js +0 -18
  468. package/typedoc/components.d.ts +0 -6
  469. package/typedoc/components.js +0 -7
  470. package/typedoc/plugins.d.ts +0 -19
  471. package/typedoc/plugins.js +0 -165
  472. package/typedoc/shared-utils.d.ts +0 -3
  473. package/typedoc/shared-utils.js +0 -7
  474. package/typedoc/typings.d.ts +0 -3
  475. package/typedoc/typings.js +0 -7
  476. package/typings/math.type.js +0 -7
  477. 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
+ }
@@ -0,0 +1,3 @@
1
+ export default function rad2Deg(rad) {
2
+ return (rad * 180) / Math.PI;
3
+ }
@@ -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
+ }
@@ -0,0 +1,6 @@
1
+ export function nextFrame(fn, delay = 0) {
2
+ if (delay <= 0)
3
+ requestAnimationFrame(fn);
4
+ else
5
+ requestAnimationFrame(() => nextFrame(fn, delay - 1));
6
+ }
File without changes
@@ -0,0 +1,7 @@
1
+ function noop() {
2
+ return void 0;
3
+ }
4
+ /**
5
+ * 空函数
6
+ */
7
+ export default noop;
@@ -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,4 @@
1
+ export default function px2rem(_px, precision = 16) {
2
+ const px = Number(typeof _px === 'string' ? _px.replace(/px/g, '') : _px);
3
+ return (px / precision).toFixed(5) + 'rem';
4
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 从数组中删除
3
+ * @param item
4
+ * @param array
5
+ * @return 如果删除返回 item
6
+ */
7
+ export default function removeArrayItem<T>(item: T, array: T[]): T;
@@ -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
- callback(something);
20
- return something;
21
- }
9
+ export default function tap(something, callback) {
10
+ callback(something);
11
+ return something;
12
+ }
@@ -0,0 +1,4 @@
1
+ import { Vector3 } from 'three';
2
+ export default function centerPoint(point1, point2) {
3
+ return new Vector3((point1.x + point2.x) / 2, (point1.y + point2.y) / 2, (point1.z + point2.z) / 2);
4
+ }
@@ -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
+ }
@@ -0,0 +1,6 @@
1
+ export default function getNormal(a, b, c) {
2
+ const ab = b.clone().sub(a);
3
+ const ac = c.clone().sub(a);
4
+ const normal = ab.clone().cross(ac);
5
+ return normal;
6
+ }
@@ -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
+ }
@@ -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,2 @@
1
+ import * as THREE from 'three';
2
+ export declare function loadTexture(url: string): Promise<THREE.Texture>;
@@ -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
+ }
@@ -0,0 +1,3 @@
1
+ import { Vector3 } from 'three';
2
+ const transformPositionToVector3 = ({ x, y, z }) => new Vector3(x, y, z);
3
+ export default transformPositionToVector3;
@@ -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;
@@ -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;
@@ -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
+ }