@realsee/dnalogel 0.1.7-alpha.8 → 2.0.0-alpha.2

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 (564) hide show
  1. package/README.md +6 -89
  2. package/dist/dnalogel.cjs.js +2 -0
  3. package/dist/dnalogel.es.js +37145 -0
  4. package/dist/dnalogel.umd.js +2 -0
  5. package/dist/style.css +1 -0
  6. package/{plugins → libs}/CSS3DRenderPlugin/index.d.ts +1 -1
  7. package/libs/CSS3DRenderPlugin/index.js +181 -0
  8. package/{plugins → libs}/CSS3DRenderPlugin/utils/createResizeObserver.d.ts +0 -0
  9. package/libs/CSS3DRenderPlugin/utils/createResizeObserver.js +18 -0
  10. package/{plugins → libs}/CameraMovementPlugin/index.d.ts +0 -0
  11. package/libs/CameraMovementPlugin/index.js +159 -0
  12. package/{plugins → libs}/CameraMovementPlugin/typing.d.ts +0 -0
  13. package/libs/CameraMovementPlugin/typing.js +17 -0
  14. package/{plugins → libs}/ModelChassisCompassPlugin/index.d.ts +0 -0
  15. package/libs/ModelChassisCompassPlugin/index.js +75 -0
  16. package/{plugins → libs}/ModelEntryDoorGuidePlugin/index.d.ts +2 -2
  17. package/libs/ModelEntryDoorGuidePlugin/index.js +136 -0
  18. package/libs/ModelRoomLabelPlugin/Assets/roomLabelBg.d.ts +1 -0
  19. package/libs/ModelRoomLabelPlugin/Assets/roomLabelBg.js +1 -0
  20. package/{plugins → libs}/ModelRoomLabelPlugin/Controller.d.ts +3 -2
  21. package/libs/ModelRoomLabelPlugin/Controller.js +100 -0
  22. package/libs/ModelRoomLabelPlugin/RoomLabelItem.svelte +63 -0
  23. package/libs/ModelRoomLabelPlugin/RoomLabelItem.svelte.map +1 -0
  24. package/libs/ModelRoomLabelPlugin/RoomLabelItems.svelte +80 -0
  25. package/libs/ModelRoomLabelPlugin/RoomLabelItems.svelte.map +1 -0
  26. package/{plugins → libs}/ModelRoomLabelPlugin/index.d.ts +4 -4
  27. package/libs/ModelRoomLabelPlugin/index.js +9 -0
  28. package/{plugins → libs}/ModelRoomLabelPlugin/typings.d.ts +2 -2
  29. package/libs/ModelRoomLabelPlugin/typings.js +1 -0
  30. package/{plugins → libs}/ModelRoomLabelPlugin/utils/parseData.d.ts +0 -0
  31. package/libs/ModelRoomLabelPlugin/utils/parseData.js +14 -0
  32. package/{plugins → libs}/ModelViewPlugin/index.d.ts +0 -0
  33. package/libs/ModelViewPlugin/index.js +160 -0
  34. package/{plugins → libs}/PanoCursorRaycasterPlugin/index.d.ts +2 -3
  35. package/libs/PanoCursorRaycasterPlugin/index.js +74 -0
  36. package/libs/floorplan/Assets/camera.d.ts +1 -0
  37. package/libs/floorplan/Assets/camera.js +1 -0
  38. package/{plugins → libs}/floorplan/Assets/floorplanExtraObject.d.ts +0 -0
  39. package/libs/floorplan/Assets/floorplanExtraObject.js +1 -0
  40. package/libs/floorplan/Components/BaseImage.svelte +25 -0
  41. package/libs/floorplan/Components/BaseImage.svelte.map +1 -0
  42. package/libs/floorplan/Components/Normalmage.svelte +11 -0
  43. package/libs/floorplan/Components/Normalmage.svelte.map +1 -0
  44. package/libs/floorplan/Components/RoomHighlight/Room.svelte +21 -0
  45. package/libs/floorplan/Components/RoomHighlight/Room.svelte.map +1 -0
  46. package/libs/floorplan/Components/RoomHighlight/RoomHighlight.svelte +60 -0
  47. package/libs/floorplan/Components/RoomHighlight/RoomHighlight.svelte.map +1 -0
  48. package/libs/floorplan/Components/RoomMaterials/RoomMaterial.svelte +35 -0
  49. package/libs/floorplan/Components/RoomMaterials/RoomMaterial.svelte.map +1 -0
  50. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.svelte +7 -0
  51. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.svelte.map +1 -0
  52. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.svelte +16 -0
  53. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.svelte.map +1 -0
  54. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.svelte +17 -0
  55. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.svelte.map +1 -0
  56. package/libs/floorplan/Components/SvgImage.svelte +25 -0
  57. package/libs/floorplan/Components/SvgImage.svelte.map +1 -0
  58. package/libs/floorplan/ModelFloorplanPlugin/Assets/compass.d.ts +1 -0
  59. package/libs/floorplan/ModelFloorplanPlugin/Assets/compass.js +1 -0
  60. package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.svelte +46 -0
  61. package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.svelte.map +1 -0
  62. package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.svelte +48 -0
  63. package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.svelte.map +1 -0
  64. package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.svelte +37 -0
  65. package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.svelte.map +1 -0
  66. package/libs/floorplan/ModelFloorplanPlugin/Components/Main.svelte +50 -0
  67. package/libs/floorplan/ModelFloorplanPlugin/Components/Main.svelte.map +1 -0
  68. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.svelte +41 -0
  69. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.svelte.map +1 -0
  70. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.svelte +25 -0
  71. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.svelte.map +1 -0
  72. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.svelte +148 -0
  73. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.svelte.map +1 -0
  74. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.svelte +15 -0
  75. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.svelte.map +1 -0
  76. package/{plugins → libs}/floorplan/ModelFloorplanPlugin/Controller.d.ts +11 -12
  77. package/libs/floorplan/ModelFloorplanPlugin/Controller.js +357 -0
  78. package/{plugins → libs}/floorplan/ModelFloorplanPlugin/index.d.ts +1 -1
  79. package/libs/floorplan/ModelFloorplanPlugin/index.js +5 -0
  80. package/{plugins → libs}/floorplan/ModelFloorplanPlugin/typings/events.type.d.ts +0 -0
  81. package/libs/floorplan/ModelFloorplanPlugin/typings/events.type.js +1 -0
  82. package/{plugins → libs}/floorplan/ModelFloorplanPlugin/utils/constant.d.ts +0 -0
  83. package/libs/floorplan/ModelFloorplanPlugin/utils/constant.js +16 -0
  84. package/{plugins → libs}/floorplan/ModelFloorplanPlugin/utils/correctFiveState.d.ts +0 -0
  85. package/libs/floorplan/ModelFloorplanPlugin/utils/correctFiveState.js +46 -0
  86. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.svelte +84 -0
  87. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.svelte.map +1 -0
  88. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.svelte +18 -0
  89. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.svelte.map +1 -0
  90. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.svelte +40 -0
  91. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.svelte.map +1 -0
  92. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.svelte +61 -0
  93. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.svelte.map +1 -0
  94. package/{plugins → libs}/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +5 -10
  95. package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +88 -0
  96. package/{plugins → libs}/floorplan/PanoFloorplanRadarPlugin/index.d.ts +0 -0
  97. package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +5 -0
  98. package/{plugins → libs}/floorplan/TopviewFloorplanPlugin/Controller.d.ts +13 -12
  99. package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +189 -0
  100. package/{plugins → libs}/floorplan/TopviewFloorplanPlugin/index.d.ts +0 -0
  101. package/libs/floorplan/TopviewFloorplanPlugin/index.js +5 -0
  102. package/{plugins → libs}/floorplan/TopviewFloorplanPlugin/style.d.ts +0 -0
  103. package/libs/floorplan/TopviewFloorplanPlugin/style.js +8 -0
  104. package/{plugins → libs}/floorplan/typings/floorplanData.d.ts +6 -2
  105. package/libs/floorplan/typings/floorplanData.js +6 -0
  106. package/{plugins → libs}/floorplan/typings/floorplanServerData.d.ts +1 -1
  107. package/libs/floorplan/typings/floorplanServerData.js +101 -0
  108. package/{plugins/floorplan/ModelFloorplanPlugin → libs/floorplan}/typings/utility.d.ts +0 -0
  109. package/libs/floorplan/typings/utility.js +1 -0
  110. package/{plugins → libs}/floorplan/utils/formatData.d.ts +3 -3
  111. package/libs/floorplan/utils/formatData.js +94 -0
  112. package/{plugins → libs}/floorplan/utils/formatPosition.d.ts +3 -4
  113. package/libs/floorplan/utils/formatPosition.js +50 -0
  114. package/libs/index.d.ts +17 -0
  115. package/libs/index.js +10 -0
  116. package/{shared-utils → libs/shared-utils}/Preloader.d.ts +0 -0
  117. package/libs/shared-utils/Preloader.js +38 -0
  118. package/{shared-utils → libs/shared-utils}/Subscribe.d.ts +3 -3
  119. package/libs/shared-utils/Subscribe.js +101 -0
  120. package/{shared-utils → libs/shared-utils}/animationFrame/BetterTween.d.ts +0 -0
  121. package/libs/shared-utils/animationFrame/BetterTween.js +30 -0
  122. package/{shared-utils → libs/shared-utils}/animationFrame/calculateProgress.d.ts +0 -0
  123. package/libs/shared-utils/animationFrame/calculateProgress.js +23 -0
  124. package/{shared-utils → libs/shared-utils}/animationFrame/formatRad.d.ts +0 -0
  125. package/libs/shared-utils/animationFrame/formatRad.js +20 -0
  126. package/{shared-utils → libs/shared-utils}/animationFrame/index.d.ts +0 -0
  127. package/libs/shared-utils/animationFrame/index.js +48 -0
  128. package/{shared-utils → libs/shared-utils}/animationFrame/tween.d.ts +0 -0
  129. package/libs/shared-utils/animationFrame/tween.js +44 -0
  130. package/{shared-utils → libs/shared-utils}/changeModelCanvasOpacity.d.ts +0 -0
  131. package/libs/shared-utils/changeModelCanvasOpacity.js +15 -0
  132. package/{shared-utils → libs/shared-utils}/createCanvasTextTexture.d.ts +0 -0
  133. package/libs/shared-utils/createCanvasTextTexture.js +19 -0
  134. package/{shared-utils → libs/shared-utils}/createLine/index.d.ts +1 -1
  135. package/libs/shared-utils/createLine/index.js +8 -0
  136. package/{shared-utils → libs/shared-utils}/debounce.d.ts +1 -1
  137. package/libs/shared-utils/debounce.js +14 -0
  138. package/{shared-utils → libs/shared-utils}/equal.d.ts +0 -0
  139. package/libs/shared-utils/equal.js +84 -0
  140. package/{shared-utils → libs/shared-utils}/filter.d.ts +0 -0
  141. package/libs/shared-utils/filter.js +53 -0
  142. package/{shared-utils → libs/shared-utils}/five/changeMode.d.ts +0 -0
  143. package/libs/shared-utils/five/changeMode.js +15 -0
  144. package/{shared-utils → libs/shared-utils}/five/useFivePlugin.d.ts +0 -0
  145. package/libs/shared-utils/five/useFivePlugin.js +8 -0
  146. package/{shared-utils → libs/shared-utils}/formatRad.d.ts +0 -0
  147. package/libs/shared-utils/formatRad.js +10 -0
  148. package/{shared-utils → libs/shared-utils}/getPxmm.d.ts +0 -0
  149. package/libs/shared-utils/getPxmm.js +20 -0
  150. package/{shared-utils → libs/shared-utils}/getRandomColor.d.ts +0 -0
  151. package/libs/shared-utils/getRandomColor.js +10 -0
  152. package/{shared-utils → libs/shared-utils}/isNil.d.ts +0 -0
  153. package/libs/shared-utils/isNil.js +14 -0
  154. package/{shared-utils → libs/shared-utils}/isTruelyObject.d.ts +0 -0
  155. package/libs/shared-utils/isTruelyObject.js +20 -0
  156. package/{shared-utils → libs/shared-utils}/math/evenNumber.d.ts +0 -0
  157. package/libs/shared-utils/math/evenNumber.js +4 -0
  158. package/{shared-utils → libs/shared-utils}/math/planimetry.d.ts +4 -4
  159. package/libs/shared-utils/math/planimetry.js +288 -0
  160. package/{shared-utils → libs/shared-utils}/math/rad2Deg.d.ts +0 -0
  161. package/libs/shared-utils/math/rad2Deg.js +3 -0
  162. package/{shared-utils → libs/shared-utils}/nearlyEqual.d.ts +0 -0
  163. package/libs/shared-utils/nearlyEqual.js +9 -0
  164. package/{shared-utils → libs/shared-utils}/nextFrame.d.ts +0 -0
  165. package/libs/shared-utils/nextFrame.js +6 -0
  166. package/{shared-utils → libs/shared-utils}/noop.d.ts +0 -0
  167. package/libs/shared-utils/noop.js +7 -0
  168. package/{shared-utils → libs/shared-utils}/object3d2LocalMatrix.d.ts +0 -0
  169. package/libs/shared-utils/object3d2LocalMatrix.js +29 -0
  170. package/{shared-utils → libs/shared-utils}/px2rem.d.ts +0 -0
  171. package/libs/shared-utils/px2rem.js +4 -0
  172. package/{shared-utils → libs/shared-utils}/removeArrayItem.d.ts +1 -1
  173. package/libs/shared-utils/removeArrayItem.js +12 -0
  174. package/{shared-utils → libs/shared-utils}/tap.d.ts +0 -0
  175. package/{shared-utils → libs/shared-utils}/tap.js +4 -13
  176. package/{shared-utils → libs/shared-utils}/three/centerPoint.d.ts +0 -0
  177. package/libs/shared-utils/three/centerPoint.js +4 -0
  178. package/{shared-utils → libs/shared-utils}/three/getExtraModelLoader.d.ts +0 -0
  179. package/libs/shared-utils/three/getExtraModelLoader.js +18 -0
  180. package/{shared-utils → libs/shared-utils}/three/getNormal.d.ts +0 -0
  181. package/libs/shared-utils/three/getNormal.js +6 -0
  182. package/{shared-utils → libs/shared-utils}/three/getTextureLoader.d.ts +0 -0
  183. package/libs/shared-utils/three/getTextureLoader.js +17 -0
  184. package/{shared-utils → libs/shared-utils}/three/loadFbxObj.d.ts +0 -0
  185. package/libs/shared-utils/three/loadFbxObj.js +13 -0
  186. package/{shared-utils → libs/shared-utils}/three/loadTexture.d.ts +0 -0
  187. package/libs/shared-utils/three/loadTexture.js +10 -0
  188. package/{shared-utils → libs/shared-utils}/three/transformPositionToVector3.d.ts +0 -0
  189. package/libs/shared-utils/three/transformPositionToVector3.js +3 -0
  190. package/{shared-utils → libs/shared-utils}/three/transfromToMeshBasicMaterial.d.ts +0 -0
  191. package/libs/shared-utils/three/transfromToMeshBasicMaterial.js +14 -0
  192. package/{shared-utils → libs/shared-utils}/throttle.d.ts +1 -1
  193. package/libs/shared-utils/throttle.js +18 -0
  194. package/{shared-utils → libs/shared-utils}/to.d.ts +0 -0
  195. package/libs/shared-utils/to.js +18 -0
  196. package/{shared-utils → libs/shared-utils}/useDebounce.d.ts +0 -0
  197. package/libs/shared-utils/useDebounce.js +22 -0
  198. package/{shared-utils → libs/shared-utils}/useThrottle.d.ts +0 -0
  199. package/libs/shared-utils/useThrottle.js +25 -0
  200. package/libs/{gltf-viewer → shared-utils}/uuid.d.ts +0 -0
  201. package/libs/shared-utils/uuid.js +11 -0
  202. package/{shared-utils → libs/shared-utils}/vectorTocoordinates.d.ts +0 -0
  203. package/libs/shared-utils/vectorTocoordinates.js +9 -0
  204. package/{typings → libs/typings}/math.type.d.ts +0 -0
  205. package/libs/typings/math.type.js +1 -0
  206. package/{typings → libs/typings}/utils.type.d.ts +0 -0
  207. package/libs/typings/utils.type.js +1 -0
  208. package/package.json +45 -17
  209. package/TERMS.txt +0 -56
  210. package/components/ARVideoFigure/ARVideoFigureMesh.d.ts +0 -44
  211. package/components/ARVideoFigure/ARVideoFigureMesh.js +0 -371
  212. package/components/ARVideoFigure/ARVideoFigureScene.d.ts +0 -11
  213. package/components/ARVideoFigure/ARVideoFigureScene.js +0 -85
  214. package/components/ARVideoFigure/ImgBgTransparent.d.ts +0 -16
  215. package/components/ARVideoFigure/ImgBgTransparent.js +0 -65
  216. package/components/ARVideoFigure/ImgBgTransparentMesh.d.ts +0 -30
  217. package/components/ARVideoFigure/ImgBgTransparentMesh.js +0 -183
  218. package/components/ARVideoFigure/fragmentShader.d.ts +0 -5
  219. package/components/ARVideoFigure/fragmentShader.js +0 -18
  220. package/components/ARVideoFigure/index.d.ts +0 -15
  221. package/components/ARVideoFigure/index.js +0 -80
  222. package/components/ARVideoFigure/vertexShader.d.ts +0 -1
  223. package/components/ARVideoFigure/vertexShader.js +0 -10
  224. package/components/GLTFView/index.d.ts +0 -110
  225. package/components/GLTFView/index.js +0 -187
  226. package/components/GlassFilters/index.d.ts +0 -32
  227. package/components/GlassFilters/index.js +0 -78
  228. package/components/ModelView/ModelViewController.d.ts +0 -18
  229. package/components/ModelView/ModelViewController.js +0 -157
  230. package/components/ModelView/index.d.ts +0 -10
  231. package/components/ModelView/index.js +0 -24
  232. package/components/PaintBrush/index.d.ts +0 -16
  233. package/components/PaintBrush/index.js +0 -47
  234. package/components/PanoTag/index.d.ts +0 -4
  235. package/components/PanoTag/index.js +0 -13
  236. package/custom.d.js +0 -3
  237. package/data/1aGKl9JmrlXMXx8d.d.ts +0 -104
  238. package/data/1aGKl9JmrlXMXx8d.js +0 -537
  239. package/data/54djM0oR6ky3Ey8e.d.ts +0 -55
  240. package/data/54djM0oR6ky3Ey8e.js +0 -350
  241. package/data/6gyq3v1verxD7JO1.d.ts +0 -104
  242. package/data/6gyq3v1verxD7JO1.js +0 -462
  243. package/data/8054djM0oR6ky3Ey8e.d.ts +0 -55
  244. package/data/8054djM0oR6ky3Ey8e.js +0 -350
  245. package/data/81zxMaeVKLQU93OZMG.d.ts +0 -49
  246. package/data/81zxMaeVKLQU93OZMG.js +0 -633
  247. package/data/KpokNd82rwjhackhQTBEoYKHg8zGbPXe.d.ts +0 -84
  248. package/data/KpokNd82rwjhackhQTBEoYKHg8zGbPXe.js +0 -600
  249. package/data/PrXel3aqGbp34JQn.d.ts +0 -389
  250. package/data/PrXel3aqGbp34JQn.js +0 -4787
  251. package/data/XJ6NMLWnkAY3Rdx8.d.ts +0 -843
  252. package/data/XJ6NMLWnkAY3Rdx8.js +0 -7989
  253. package/data/YdoNP9K4rwQDwjJr.d.ts +0 -83
  254. package/data/YdoNP9K4rwQDwjJr.js +0 -1453
  255. package/data/ZLvK29zj4L29Jowd.d.ts +0 -55
  256. package/data/ZLvK29zj4L29Jowd.js +0 -372
  257. package/data/_vLykj3NWrllMrG06.d.ts +0 -95
  258. package/data/_vLykj3NWrllMrG06.js +0 -1
  259. package/data/auto3d-njL5J99VwCmnjtQElOmXQr.d.ts +0 -86
  260. package/data/auto3d-njL5J99VwCmnjtQElOmXQr.js +0 -711
  261. package/data/extrude-walls/ZLvK29zj4L29Jowd.d.ts +0 -5
  262. package/data/extrude-walls/ZLvK29zj4L29Jowd.js +0 -14
  263. package/data/extrude-walls/lo024DEgzanMj5BE.d.ts +0 -5
  264. package/data/extrude-walls/lo024DEgzanMj5BE.js +0 -14
  265. package/data/jd6oMOzPxnQ3BvxY_B7yw51J9rXlhYhjhGTOgRVqu6WeEqjNX.d.ts +0 -85
  266. package/data/jd6oMOzPxnQ3BvxY_B7yw51J9rXlhYhjhGTOgRVqu6WeEqjNX.js +0 -511
  267. package/data/lo024DEgzanMj5BE.d.ts +0 -55
  268. package/data/lo024DEgzanMj5BE.js +0 -966
  269. package/data/oPzy3ApbjjpD8YdR.d.ts +0 -83
  270. package/data/oPzy3ApbjjpD8YdR.js +0 -283
  271. package/data/qjAxMG4XbPn96wKG.d.ts +0 -104
  272. package/data/qjAxMG4XbPn96wKG.js +0 -637
  273. package/data/rXel3aPQRRBD4JQn.d.ts +0 -86
  274. package/data/rXel3aPQRRBD4JQn.js +0 -622
  275. package/data/vLykj3NWrllMrG06.d.ts +0 -91
  276. package/data/vLykj3NWrllMrG06.js +0 -2993
  277. package/data/wz0QV9KA4ugyo9ME.d.ts +0 -39
  278. package/data/wz0QV9KA4ugyo9ME.js +0 -136
  279. package/data/zxMawr9raSg8LYjG.d.ts +0 -53
  280. package/data/zxMawr9raSg8LYjG.js +0 -590
  281. package/examples/FiveStateController/index.js +0 -134
  282. package/examples/VRHouse/Mobile.js +0 -36
  283. package/examples/VRHouse/PC.js +0 -36
  284. package/examples/VRHouse/index.js +0 -36
  285. package/index.d.ts +0 -15
  286. package/index.js +0 -45
  287. package/libs/gltf-viewer/Subscribe.d.ts +0 -76
  288. package/libs/gltf-viewer/Subscribe.js +0 -231
  289. package/libs/gltf-viewer/coordsMoveByOffset.d.ts +0 -13
  290. package/libs/gltf-viewer/coordsMoveByOffset.js +0 -22
  291. package/libs/gltf-viewer/coordsToDirection.d.ts +0 -5
  292. package/libs/gltf-viewer/coordsToDirection.js +0 -41
  293. package/libs/gltf-viewer/formatRad.d.ts +0 -1
  294. package/libs/gltf-viewer/formatRad.js +0 -13
  295. package/libs/gltf-viewer/getFrameTime.d.ts +0 -1
  296. package/libs/gltf-viewer/getFrameTime.js +0 -28
  297. package/libs/gltf-viewer/index.d.ts +0 -78
  298. package/libs/gltf-viewer/index.js +0 -763
  299. package/libs/gltf-viewer/mouseWheel.d.ts +0 -2
  300. package/libs/gltf-viewer/mouseWheel.js +0 -59
  301. package/libs/gltf-viewer/requestAnimationFrame.d.ts +0 -1
  302. package/libs/gltf-viewer/requestAnimationFrame.js +0 -18
  303. package/libs/gltf-viewer/requestAnimationFrameInterval.d.ts +0 -1
  304. package/libs/gltf-viewer/requestAnimationFrameInterval.js +0 -31
  305. package/libs/gltf-viewer/uuid.js +0 -28
  306. package/plugins/AutoPreloadPlugin/index.d.ts +0 -23
  307. package/plugins/AutoPreloadPlugin/index.js +0 -111
  308. package/plugins/CSS3DRenderPlugin/components/Marker/index.d.ts +0 -12
  309. package/plugins/CSS3DRenderPlugin/components/Marker/index.js +0 -121
  310. package/plugins/CSS3DRenderPlugin/index.js +0 -303
  311. package/plugins/CSS3DRenderPlugin/utils/createResizeObserver.js +0 -34
  312. package/plugins/CameraMovementPlugin/index.js +0 -362
  313. package/plugins/CameraMovementPlugin/typing.js +0 -37
  314. package/plugins/ModelChassisCompassPlugin/index.js +0 -158
  315. package/plugins/ModelEntryDoorGuidePlugin/index.js +0 -252
  316. package/plugins/ModelExtrudeWallsPlugin/index.d.ts +0 -16
  317. package/plugins/ModelExtrudeWallsPlugin/index.js +0 -252
  318. package/plugins/ModelRoomLabelPlugin/Controller.js +0 -154
  319. package/plugins/ModelRoomLabelPlugin/RoomLabelItem.d.ts +0 -8
  320. package/plugins/ModelRoomLabelPlugin/RoomLabelItem.js +0 -66
  321. package/plugins/ModelRoomLabelPlugin/RoomLabelItems.d.ts +0 -7
  322. package/plugins/ModelRoomLabelPlugin/RoomLabelItems.js +0 -159
  323. package/plugins/ModelRoomLabelPlugin/index.js +0 -23
  324. package/plugins/ModelRoomLabelPlugin/typings.js +0 -7
  325. package/plugins/ModelRoomLabelPlugin/utils/parseData.js +0 -35
  326. package/plugins/ModelTVVideoPlugin/index.d.ts +0 -21
  327. package/plugins/ModelTVVideoPlugin/index.js +0 -397
  328. package/plugins/ModelViewPlugin/index.js +0 -223
  329. package/plugins/PanoCursorRaycasterPlugin/PanoCursorRaycasterPluginUsage.d.ts +0 -48
  330. package/plugins/PanoCursorRaycasterPlugin/components/MovePointTowardsCamera.d.ts +0 -9
  331. package/plugins/PanoCursorRaycasterPlugin/components/MovePointTowardsCamera.js +0 -117
  332. package/plugins/PanoCursorRaycasterPlugin/components/PointAxesHelper.d.ts +0 -11
  333. package/plugins/PanoCursorRaycasterPlugin/components/PointAxesHelper.js +0 -39
  334. package/plugins/PanoCursorRaycasterPlugin/index.js +0 -126
  335. package/plugins/PanoCursorRaycasterPlugin/utils/addLineToFive.d.ts +0 -5
  336. package/plugins/PanoCursorRaycasterPlugin/utils/addLineToFive.js +0 -27
  337. package/plugins/PanoCursorRaycasterPlugin/utils/createLine.d.ts +0 -3
  338. package/plugins/PanoCursorRaycasterPlugin/utils/createLine.js +0 -48
  339. package/plugins/PanoDoorLabelPlugin/index.d.ts +0 -4
  340. package/plugins/PanoDoorLabelPlugin/index.js +0 -14
  341. package/plugins/PanoIRobotPlugin/index.d.ts +0 -10
  342. package/plugins/PanoIRobotPlugin/index.js +0 -18
  343. package/plugins/PanoMaskSelectorPlugin/compare.d.ts +0 -1
  344. package/plugins/PanoMaskSelectorPlugin/compare.js +0 -17
  345. package/plugins/PanoMaskSelectorPlugin/createBox.d.ts +0 -7
  346. package/plugins/PanoMaskSelectorPlugin/createBox.js +0 -82
  347. package/plugins/PanoMaskSelectorPlugin/createTextures.d.ts +0 -3
  348. package/plugins/PanoMaskSelectorPlugin/createTextures.js +0 -45
  349. package/plugins/PanoMaskSelectorPlugin/fragmentShader.d.ts +0 -1
  350. package/plugins/PanoMaskSelectorPlugin/fragmentShader.js +0 -10
  351. package/plugins/PanoMaskSelectorPlugin/index.d.ts +0 -49
  352. package/plugins/PanoMaskSelectorPlugin/index.js +0 -350
  353. package/plugins/PanoMaskSelectorPlugin/vertexShader.d.ts +0 -1
  354. package/plugins/PanoMaskSelectorPlugin/vertexShader.js +0 -10
  355. package/plugins/PanoMeasurePlugin/Controller/BaseController.d.ts +0 -36
  356. package/plugins/PanoMeasurePlugin/Controller/BaseController.js +0 -103
  357. package/plugins/PanoMeasurePlugin/Controller/EditController.d.ts +0 -52
  358. package/plugins/PanoMeasurePlugin/Controller/EditController.js +0 -341
  359. package/plugins/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +0 -12
  360. package/plugins/PanoMeasurePlugin/Controller/ShortcutKeyController.js +0 -69
  361. package/plugins/PanoMeasurePlugin/Controller/WatchController.d.ts +0 -25
  362. package/plugins/PanoMeasurePlugin/Controller/WatchController.js +0 -371
  363. package/plugins/PanoMeasurePlugin/Controller/index.d.ts +0 -61
  364. package/plugins/PanoMeasurePlugin/Controller/index.js +0 -230
  365. package/plugins/PanoMeasurePlugin/Model/index.d.ts +0 -38
  366. package/plugins/PanoMeasurePlugin/Model/index.js +0 -235
  367. package/plugins/PanoMeasurePlugin/Model/line.d.ts +0 -30
  368. package/plugins/PanoMeasurePlugin/Model/line.js +0 -121
  369. package/plugins/PanoMeasurePlugin/Model/point.d.ts +0 -16
  370. package/plugins/PanoMeasurePlugin/Model/point.js +0 -68
  371. package/plugins/PanoMeasurePlugin/Model/polyline.d.ts +0 -16
  372. package/plugins/PanoMeasurePlugin/Model/polyline.js +0 -109
  373. package/plugins/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.d.ts +0 -2
  374. package/plugins/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.js +0 -11
  375. package/plugins/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.d.ts +0 -2
  376. package/plugins/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.js +0 -11
  377. package/plugins/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.d.ts +0 -2
  378. package/plugins/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.js +0 -11
  379. package/plugins/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +0 -22
  380. package/plugins/PanoMeasurePlugin/Modules/DeleteDom/index.js +0 -182
  381. package/plugins/PanoMeasurePlugin/Modules/FiveHelper.d.ts +0 -11
  382. package/plugins/PanoMeasurePlugin/Modules/FiveHelper.js +0 -66
  383. package/plugins/PanoMeasurePlugin/Modules/GuideController.d.ts +0 -18
  384. package/plugins/PanoMeasurePlugin/Modules/GuideController.js +0 -107
  385. package/plugins/PanoMeasurePlugin/Modules/Magnifier.d.ts +0 -24
  386. package/plugins/PanoMeasurePlugin/Modules/Magnifier.js +0 -139
  387. package/plugins/PanoMeasurePlugin/Modules/UIController/HTML.d.ts +0 -6
  388. package/plugins/PanoMeasurePlugin/Modules/UIController/HTML.js +0 -26
  389. package/plugins/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +0 -18
  390. package/plugins/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +0 -169
  391. package/plugins/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +0 -12
  392. package/plugins/PanoMeasurePlugin/Modules/UIController/Revoke/index.js +0 -59
  393. package/plugins/PanoMeasurePlugin/Modules/UIController/index.d.ts +0 -16
  394. package/plugins/PanoMeasurePlugin/Modules/UIController/index.js +0 -123
  395. package/plugins/PanoMeasurePlugin/Modules/UIController/style.d.ts +0 -17
  396. package/plugins/PanoMeasurePlugin/Modules/UIController/style.js +0 -103
  397. package/plugins/PanoMeasurePlugin/index.d.ts +0 -7
  398. package/plugins/PanoMeasurePlugin/index.js +0 -20
  399. package/plugins/PanoMeasurePlugin/typings/data.d.ts +0 -28
  400. package/plugins/PanoMeasurePlugin/typings/data.js +0 -7
  401. package/plugins/PanoMeasurePlugin/typings/event.type.d.ts +0 -28
  402. package/plugins/PanoMeasurePlugin/typings/event.type.js +0 -7
  403. package/plugins/PanoMeasurePlugin/typings/utils.type.d.ts +0 -1
  404. package/plugins/PanoMeasurePlugin/typings/utils.type.js +0 -7
  405. package/plugins/PanoMeasurePlugin/utils/clearGroup.d.ts +0 -2
  406. package/plugins/PanoMeasurePlugin/utils/clearGroup.js +0 -16
  407. package/plugins/PanoMeasurePlugin/utils/constants.d.ts +0 -4
  408. package/plugins/PanoMeasurePlugin/utils/constants.js +0 -47
  409. package/plugins/PanoMeasurePlugin/utils/distanceDom.d.ts +0 -28
  410. package/plugins/PanoMeasurePlugin/utils/distanceDom.js +0 -147
  411. package/plugins/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +0 -2
  412. package/plugins/PanoMeasurePlugin/utils/findAssociatedLines.js +0 -37
  413. package/plugins/PanoMeasurePlugin/utils/findClosestPoint.d.ts +0 -10
  414. package/plugins/PanoMeasurePlugin/utils/findClosestPoint.js +0 -49
  415. package/plugins/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +0 -4
  416. package/plugins/PanoMeasurePlugin/utils/getIntersectionFromEvent.js +0 -20
  417. package/plugins/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +0 -10
  418. package/plugins/PanoMeasurePlugin/utils/getPointFromHammerEvent.js +0 -33
  419. package/plugins/PanoMeasurePlugin/utils/ironbox.d.ts +0 -1
  420. package/plugins/PanoMeasurePlugin/utils/ironbox.js +0 -14
  421. package/plugins/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +0 -2
  422. package/plugins/PanoMeasurePlugin/utils/isNDCPointInScreen.js +0 -16
  423. package/plugins/PanoMeasurePlugin/utils/line.d.ts +0 -17
  424. package/plugins/PanoMeasurePlugin/utils/line.js +0 -61
  425. package/plugins/PanoMeasurePlugin/utils/math.d.ts +0 -17
  426. package/plugins/PanoMeasurePlugin/utils/math.js +0 -57
  427. package/plugins/PanoMeasurePlugin/utils/mouseGroup.d.ts +0 -2
  428. package/plugins/PanoMeasurePlugin/utils/mouseGroup.js +0 -42
  429. package/plugins/PanoMeasurePlugin/utils/ndc2Screen.d.ts +0 -5
  430. package/plugins/PanoMeasurePlugin/utils/ndc2Screen.js +0 -16
  431. package/plugins/PanoRulerPlugin/data/roomInfo.d.ts +0 -3
  432. package/plugins/PanoRulerPlugin/data/roomInfo.js +0 -51
  433. package/plugins/PanoRulerPlugin/data/roomRules.d.ts +0 -3
  434. package/plugins/PanoRulerPlugin/data/roomRules.js +0 -235
  435. package/plugins/PanoRulerPlugin/index.d.ts +0 -31
  436. package/plugins/PanoRulerPlugin/index.js +0 -642
  437. package/plugins/PanoRulerPlugin/typings.d.ts +0 -21
  438. package/plugins/PanoRulerPlugin/typings.js +0 -7
  439. package/plugins/PanoTVVideoPlugin/index.d.ts +0 -26
  440. package/plugins/PanoTVVideoPlugin/index.js +0 -433
  441. package/plugins/TreasurePlugin/Controller.d.ts +0 -73
  442. package/plugins/TreasurePlugin/Controller.js +0 -250
  443. package/plugins/TreasurePlugin/TreasureFaceAnime.d.ts +0 -25
  444. package/plugins/TreasurePlugin/TreasureFaceAnime.js +0 -143
  445. package/plugins/TreasurePlugin/TreasureObject.d.ts +0 -53
  446. package/plugins/TreasurePlugin/TreasureObject.js +0 -406
  447. package/plugins/TreasurePlugin/TreasureOpenAnime.d.ts +0 -25
  448. package/plugins/TreasurePlugin/TreasureOpenAnime.js +0 -127
  449. package/plugins/TreasurePlugin/constants.d.ts +0 -33
  450. package/plugins/TreasurePlugin/constants.js +0 -67
  451. package/plugins/TreasurePlugin/index.d.ts +0 -11
  452. package/plugins/TreasurePlugin/index.js +0 -26
  453. package/plugins/TreasurePlugin/typings.d.ts +0 -2
  454. package/plugins/TreasurePlugin/typings.js +0 -7
  455. package/plugins/floorplan/Assets/floorplanExtraObject.js +0 -10
  456. package/plugins/floorplan/ModelFloorplanPlugin/Controller.js +0 -637
  457. package/plugins/floorplan/ModelFloorplanPlugin/components/Camera.d.ts +0 -13
  458. package/plugins/floorplan/ModelFloorplanPlugin/components/Camera.js +0 -78
  459. package/plugins/floorplan/ModelFloorplanPlugin/components/Compass.d.ts +0 -5
  460. package/plugins/floorplan/ModelFloorplanPlugin/components/Compass.js +0 -84
  461. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomHighlight.d.ts +0 -10
  462. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomHighlight.js +0 -129
  463. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomLabels.d.ts +0 -13
  464. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomLabels.js +0 -118
  465. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomMaterial.d.ts +0 -11
  466. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomMaterial.js +0 -174
  467. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RuleLabels.d.ts +0 -8
  468. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RuleLabels.js +0 -178
  469. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/index.d.ts +0 -15
  470. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/index.js +0 -74
  471. package/plugins/floorplan/ModelFloorplanPlugin/components/index.d.ts +0 -23
  472. package/plugins/floorplan/ModelFloorplanPlugin/components/index.js +0 -88
  473. package/plugins/floorplan/ModelFloorplanPlugin/controller.style.d.ts +0 -1
  474. package/plugins/floorplan/ModelFloorplanPlugin/controller.style.js +0 -16
  475. package/plugins/floorplan/ModelFloorplanPlugin/index.js +0 -20
  476. package/plugins/floorplan/ModelFloorplanPlugin/typings/events.type.js +0 -7
  477. package/plugins/floorplan/ModelFloorplanPlugin/typings/utility.js +0 -7
  478. package/plugins/floorplan/ModelFloorplanPlugin/utils/constant.js +0 -33
  479. package/plugins/floorplan/ModelFloorplanPlugin/utils/correctFiveState.js +0 -154
  480. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.d.ts +0 -13
  481. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.js +0 -114
  482. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.style.d.ts +0 -3
  483. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.style.js +0 -39
  484. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/ExtraObjects.d.ts +0 -5
  485. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/ExtraObjects.js +0 -66
  486. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/RoomHighlight.d.ts +0 -9
  487. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/RoomHighlight.js +0 -126
  488. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/index.d.ts +0 -11
  489. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/index.js +0 -58
  490. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.d.ts +0 -17
  491. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.js +0 -85
  492. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.style.d.ts +0 -2
  493. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.style.js +0 -15
  494. package/plugins/floorplan/PanoFloorplanRadarPlugin/Controller.js +0 -211
  495. package/plugins/floorplan/PanoFloorplanRadarPlugin/index.js +0 -20
  496. package/plugins/floorplan/TopviewFloorplanPlugin/Controller.js +0 -272
  497. package/plugins/floorplan/TopviewFloorplanPlugin/index.js +0 -18
  498. package/plugins/floorplan/TopviewFloorplanPlugin/style.js +0 -16
  499. package/plugins/floorplan/components/FloorplanImage.d.ts +0 -7
  500. package/plugins/floorplan/components/FloorplanImage.js +0 -90
  501. package/plugins/floorplan/index.d.ts +0 -4
  502. package/plugins/floorplan/index.js +0 -13
  503. package/plugins/floorplan/typings/floorplanData.js +0 -7
  504. package/plugins/floorplan/typings/floorplanServerData.js +0 -382
  505. package/plugins/floorplan/utils/formatData.js +0 -218
  506. package/plugins/floorplan/utils/formatPosition.js +0 -89
  507. package/shared-utils/Preloader.js +0 -57
  508. package/shared-utils/Subscribe.js +0 -230
  509. package/shared-utils/animationFrame/BetterTween.js +0 -103
  510. package/shared-utils/animationFrame/calculateProgress.js +0 -40
  511. package/shared-utils/animationFrame/formatRad.js +0 -36
  512. package/shared-utils/animationFrame/index.js +0 -81
  513. package/shared-utils/animationFrame/tween.js +0 -92
  514. package/shared-utils/changeModelCanvasOpacity.js +0 -38
  515. package/shared-utils/createCanvasTextTexture.js +0 -31
  516. package/shared-utils/createFiveContainer.d.ts +0 -10
  517. package/shared-utils/createFiveContainer.js +0 -171
  518. package/shared-utils/createLine/index.js +0 -43
  519. package/shared-utils/debounce.js +0 -30
  520. package/shared-utils/equal.js +0 -107
  521. package/shared-utils/filter.js +0 -127
  522. package/shared-utils/five/changeMode.js +0 -82
  523. package/shared-utils/five/useFivePlugin.js +0 -17
  524. package/shared-utils/formatRad.js +0 -18
  525. package/shared-utils/getPxmm.js +0 -51
  526. package/shared-utils/getRandomColor.js +0 -23
  527. package/shared-utils/isNil.js +0 -26
  528. package/shared-utils/isTruelyObject.js +0 -31
  529. package/shared-utils/math/evenNumber.js +0 -15
  530. package/shared-utils/math/planimetry.js +0 -352
  531. package/shared-utils/math/rad2Deg.js +0 -12
  532. package/shared-utils/nearlyEqual.js +0 -19
  533. package/shared-utils/nextFrame.js +0 -15
  534. package/shared-utils/noop.js +0 -19
  535. package/shared-utils/object3d2LocalMatrix.js +0 -79
  536. package/shared-utils/px2rem.js +0 -22
  537. package/shared-utils/removeArrayItem.js +0 -22
  538. package/shared-utils/three/centerPoint.js +0 -14
  539. package/shared-utils/three/getExtraModelLoader.js +0 -45
  540. package/shared-utils/three/getNormal.js +0 -17
  541. package/shared-utils/three/getTextureLoader.js +0 -50
  542. package/shared-utils/three/loadFbxObj.js +0 -54
  543. package/shared-utils/three/loadTexture.js +0 -65
  544. package/shared-utils/three/transformPositionToVector3.js +0 -20
  545. package/shared-utils/three/transfromToMeshBasicMaterial.js +0 -33
  546. package/shared-utils/throttle.js +0 -29
  547. package/shared-utils/to.js +0 -67
  548. package/shared-utils/useDebounce.js +0 -49
  549. package/shared-utils/useThrottle.js +0 -47
  550. package/shared-utils/uuid.d.ts +0 -4
  551. package/shared-utils/uuid.js +0 -28
  552. package/shared-utils/vectorTocoordinates.js +0 -18
  553. package/typedoc/components.d.ts +0 -6
  554. package/typedoc/components.js +0 -7
  555. package/typedoc/libs.d.ts +0 -1
  556. package/typedoc/libs.js +0 -7
  557. package/typedoc/plugins.d.ts +0 -19
  558. package/typedoc/plugins.js +0 -165
  559. package/typedoc/shared-utils.d.ts +0 -3
  560. package/typedoc/shared-utils.js +0 -7
  561. package/typedoc/typings.d.ts +0 -3
  562. package/typedoc/typings.js +0 -7
  563. package/typings/math.type.js +0 -7
  564. package/typings/utils.type.js +0 -7
@@ -3,6 +3,7 @@
3
3
  * 1. 数据的下划线到驼峰的转换
4
4
  * 2. svg url 到 svg content 的处理
5
5
  */
6
+ import type { RecordKeys, RecordValue } from './utility';
6
7
  /** 户型图坐标,坐标原点时户型图中心点,单位是户型图单位 */
7
8
  export interface FloorplanPosition {
8
9
  x: number;
@@ -77,13 +78,16 @@ export interface FloorplanRoomItem {
77
78
  /** 当前房间里的 observer 索引 */
78
79
  observerIndexs: number[];
79
80
  }
80
- export declare type FloorplanServerRuleLabels = Record<'top' | 'right' | 'bottom' | 'left', FloorplanPosition[][]>;
81
+ /** 户型图标尺 */
82
+ export declare type FloorplanRuleLabels = Record<'top' | 'right' | 'bottom' | 'left', FloorplanPosition[][]>;
83
+ export declare type RuleLabelsKey = RecordKeys<FloorplanRuleLabels>;
84
+ export declare type RuleLabelsValue = RecordValue<FloorplanRuleLabels>;
81
85
  /** 当前楼层的数据 */
82
86
  export interface FloorplanFloorData {
83
87
  floorName: string;
84
88
  floorIndex: number;
85
89
  rooms: FloorplanRoomItem[];
86
- rules: FloorplanServerRuleLabels;
90
+ rules: FloorplanRuleLabels;
87
91
  }
88
92
  /** 对 observer 做一些样式上的计算
89
93
  * @description 每一个 floorplanObserver 对应一个 observer
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @file 对输入到户型图相关插件内的数据做 format 之后的数据
3
+ * 1. 数据的下划线到驼峰的转换
4
+ * 2. svg url 到 svg content 的处理
5
+ */
6
+ export {};
@@ -36,7 +36,7 @@ export interface FloorplanServerImagePosition {
36
36
  export interface FloorplanServerOutlineItem {
37
37
  url: string;
38
38
  index: number;
39
- checksum: string;
39
+ checksum?: string;
40
40
  svg_url?: string;
41
41
  }
42
42
  /** 户型图入户门 */
@@ -0,0 +1,101 @@
1
+ /** 房屋数据映射表 */
2
+ export const ROOM_FETILE_TYPE_MAP = [
3
+ { type: 0, floorType: 1, roomType: '100900000012', name: '其他' },
4
+ { type: 1, floorType: 1, roomType: '100900000002', name: '客厅' },
5
+ { type: 2, floorType: 1, roomType: '100900000002', name: '餐厅' },
6
+ { type: 3, floorType: 0, roomType: '100900000001', name: '卧室' },
7
+ { type: 4, floorType: 0, roomType: '100900000001', name: '书房' },
8
+ { type: 5, floorType: 3, roomType: '100900000004', name: '卫生间' },
9
+ { type: 6, floorType: 3, roomType: '100900000004', name: '淋浴间' },
10
+ { type: 7, floorType: 3, roomType: '100900000004', name: '洗手间' },
11
+ { type: 8, floorType: 3, roomType: '100900000003', name: '厨房' },
12
+ {
13
+ type: 9,
14
+ floorType: 1,
15
+ roomType: '100900000003',
16
+ name: '开放厨房',
17
+ onlySubArea: true,
18
+ },
19
+ { type: 10, floorType: 0, roomType: '100900000001', name: '多功能间' },
20
+ { type: 11, floorType: 0, roomType: '100900000009', name: '保姆间' },
21
+ { type: 12, floorType: 4, roomType: '100900000005', name: '阳台' },
22
+ { type: 13, floorType: 4, roomType: '100900000006', name: '露台' },
23
+ { type: 14, floorType: 0, roomType: '100900000008', name: '储物间' },
24
+ { type: 15, floorType: 0, roomType: '100900000013', name: '衣帽间' },
25
+ { type: 16, floorType: 0, roomType: '100900000011', name: '阁楼' },
26
+ { type: 17, floorType: 2, roomType: '100900000007', name: '花园' },
27
+ { type: 18, floorType: 5, roomType: '100900000010', name: '车库' },
28
+ { type: 19, floorType: 1, roomType: '100900000012', name: '电梯' },
29
+ { type: 20, floorType: 1, roomType: '100900000012', name: '地下室' },
30
+ { type: 21, floorType: 1, roomType: '100900000012', name: '天井' },
31
+ { type: 22, floorType: 1, roomType: '100900000012', name: '阳光房' },
32
+ { type: 23, floorType: 1, roomType: '100900000012', name: '过道' },
33
+ { type: 24, floorType: 1, roomType: '100900000012', name: '楼梯间' },
34
+ { type: 25, floorType: 1, roomType: '100900000012', name: '门厅' },
35
+ { type: 26, floorType: 2, roomType: '100900000012', name: '入户花园' },
36
+ { type: 27, floorType: 1, roomType: '100900000012', name: '玄关' },
37
+ { type: 28, floorType: 1, roomType: '100900000012', name: '挑空' },
38
+ { type: 29, floorType: 4, roomType: '100900000012', name: '晾晒区' },
39
+ { type: 30, floorType: 4, roomType: '100900000012', name: '洗衣房' },
40
+ { type: 31, floorType: 0, roomType: '100900000012', name: '娱乐区' },
41
+ { type: 32, floorType: 0, roomType: '100900000012', name: '健身区' },
42
+ { type: 33, floorType: 0, roomType: '100900000012', name: '接待区' },
43
+ { type: 34, floorType: 0, roomType: '100900000012', name: '影音区' },
44
+ { type: 35, floorType: 1, roomType: '100900000012', name: '餐饮区' },
45
+ {
46
+ type: 36,
47
+ floorType: 1,
48
+ roomType: '100900000012',
49
+ name: '其他',
50
+ onlySubArea: true,
51
+ },
52
+ { type: 37, floorType: 1, roomType: '100900000002', name: '起居室' },
53
+ { type: 38, floorType: 0, roomType: '100900000001', name: '主卧' },
54
+ { type: 39, floorType: 0, roomType: '100900000001', name: '次卧' },
55
+ { type: 40, floorType: 0, roomType: '100900000001', name: '优化间' },
56
+ { type: 41, floorType: 0, roomType: '100900000001', name: '办公室' },
57
+ { type: 42, floorType: 0, roomType: '100900000001', name: '会议室' },
58
+ { type: 43, floorType: 0, roomType: '100900000001', name: '洽谈间' },
59
+ { type: 44, floorType: 1, roomType: '100900000002', name: '共享大厅' },
60
+ { type: 45, floorType: 1, roomType: '100900000012', name: '水吧' },
61
+ { type: 46, floorType: 0, roomType: '100900000015', name: '出入口' },
62
+ { type: 47, floorType: 0, roomType: '100900000015', name: '大厅' },
63
+ { type: 48, floorType: 0, roomType: '100900000015', name: '包厢' },
64
+ { type: 49, floorType: 0, roomType: '100900000015', name: '其他' },
65
+ { type: 50, floorType: 0, roomType: '100900000016', name: '出入口' },
66
+ { type: 51, floorType: 0, roomType: '100900000016', name: '办公区' },
67
+ { type: 52, floorType: 0, roomType: '100900000016', name: '老板间' },
68
+ { type: 53, floorType: 0, roomType: '100900000016', name: '会议室' },
69
+ { type: 54, floorType: 0, roomType: '100900000016', name: '休息区/水吧' },
70
+ { type: 55, floorType: 0, roomType: '100900000016', name: '其他' },
71
+ { type: 56, floorType: 2, roomType: '100900000012', name: '空中花园' },
72
+ { type: 57, floorType: 0, roomType: '100900000001', name: '洋室' },
73
+ { type: 58, floorType: 0, roomType: '100900000001', name: '和室' },
74
+ ];
75
+ /** 地板信息映射表 */
76
+ export const FLOOR_TYPE_MAP = [
77
+ { type: 0, description: '木质地板' },
78
+ { type: 1, description: '瓷砖地面' },
79
+ { type: 2, description: '户外地面' },
80
+ { type: 3, description: '卫生间地面' },
81
+ { type: 4, description: '阳台地面' },
82
+ { type: 5, description: '车库地面' },
83
+ ];
84
+ /** 房屋类型映射表 */
85
+ export const ROOM_TYPE_MAP = [
86
+ { roomType: '100900000001', description: '室' },
87
+ { roomType: '100900000002', description: '厅' },
88
+ { roomType: '100900000003', description: '厨' },
89
+ { roomType: '100900000004', description: '卫' },
90
+ { roomType: '100900000005', description: '阳台' },
91
+ { roomType: '100900000006', description: '露台' },
92
+ { roomType: '100900000007', description: '花园' },
93
+ { roomType: '100900000008', description: '储' },
94
+ { roomType: '100900000009', description: '保姆间' },
95
+ { roomType: '100900000010', description: '车库' },
96
+ { roomType: '100900000011', description: '阁楼' },
97
+ { roomType: '100900000012', description: '其他' },
98
+ { roomType: '100900000013', description: '衣' },
99
+ { roomType: '100900000015', description: '商铺' },
100
+ { roomType: '100900000016', description: '写字楼' },
101
+ ];
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,5 @@
1
- import { Five } from '@realsee/five';
2
- import { FloorplanData, FloorplanExtraObject, FloorplanExtraObject3D } from '../typings/floorplanData';
3
- import { FloorplanServerData } from '../typings/floorplanServerData';
1
+ import type { Five } from '@realsee/five';
2
+ import type { FloorplanData, FloorplanExtraObject, FloorplanExtraObject3D } from '../typings/floorplanData';
3
+ import type { FloorplanServerData } from '../typings/floorplanServerData';
4
4
  export default function formatData(data: FloorplanServerData): Promise<FloorplanData>;
5
5
  export declare function formatExtraObjects(data: FloorplanExtraObject3D[], five: Five, floorplanData: FloorplanData): FloorplanExtraObject[];
@@ -0,0 +1,94 @@
1
+ import { FLOORPLAN_EXTRA_OBJECT_IMAGE } from '../Assets/floorplanExtraObject';
2
+ import { floorplanPosition2ImagePosition, getFloorIndexFromModelPosition, modelPosition2FloorplanPosition, } from './formatPosition';
3
+ async function formatOutlines(outlines) {
4
+ const headers = new Headers({ 'Content-Type': 'text/plain' });
5
+ const getOutlineItem = async function (item) {
6
+ const outlineItem = {
7
+ index: item.index,
8
+ url: item.url,
9
+ svgUrl: item.svg_url,
10
+ };
11
+ if (item.svg_url) {
12
+ const svgContent = await fetch(item.svg_url, { headers }).then((res) => res.text());
13
+ outlineItem.svgContent = svgContent;
14
+ }
15
+ return outlineItem;
16
+ };
17
+ const svgOutlineItems = await Promise.all(outlines.map(getOutlineItem));
18
+ return svgOutlineItems;
19
+ }
20
+ function formatRoom(data) {
21
+ const floorplanRoomItem = {
22
+ id: data.id,
23
+ size: data.size,
24
+ name: data.name,
25
+ path: data.path,
26
+ roomType: data.room_type,
27
+ floorType: data.floor_type,
28
+ roomLabel: {
29
+ position: data.room_label.position,
30
+ positionInImage: data.room_label.position_in_image,
31
+ },
32
+ observerIndexs: data.observer_indexs,
33
+ };
34
+ return floorplanRoomItem;
35
+ }
36
+ function formatFloorData(_data) {
37
+ return {
38
+ floorName: _data.floor_name,
39
+ floorIndex: _data.floor_index,
40
+ rooms: _data.rooms.map(formatRoom),
41
+ rules: _data.rules,
42
+ };
43
+ }
44
+ function formateFloorplanObserver(data) {
45
+ const floorplanObserver = {
46
+ index: data.index,
47
+ floorIndex: data.floor_index,
48
+ position: data.position,
49
+ positionInImage: data.position_in_image,
50
+ };
51
+ return floorplanObserver;
52
+ }
53
+ function formatFloorplanEntrance(data) {
54
+ const floorplanEntrance = {
55
+ rad: data.rad,
56
+ position: data.position,
57
+ positionInImage: data.position_in_image,
58
+ northRad: data.north_rad,
59
+ roomId: data.room_id,
60
+ floorIndex: data.floor_index,
61
+ };
62
+ return floorplanEntrance;
63
+ }
64
+ export default async function formatData(data) {
65
+ const outlines = await formatOutlines(data.outlines);
66
+ const bounding = data.computed_data.bounding;
67
+ const floorDatas = data.computed_data.floor_datas.map(formatFloorData);
68
+ const entrance = data.computed_data.entrance ? formatFloorplanEntrance(data.computed_data.entrance) : null;
69
+ const floorplanData = {
70
+ outlines,
71
+ entrance,
72
+ bounding,
73
+ floorDatas,
74
+ observers: data.computed_data.observers.map(formateFloorplanObserver),
75
+ };
76
+ return floorplanData;
77
+ }
78
+ export function formatExtraObjects(data, five, floorplanData) {
79
+ const extraObjects = data.map((object) => {
80
+ const position = object.position;
81
+ const icon = object.icon
82
+ ? object.icon
83
+ : {
84
+ url: FLOORPLAN_EXTRA_OBJECT_IMAGE,
85
+ width: 45,
86
+ height: 48,
87
+ };
88
+ const floorIndex = getFloorIndexFromModelPosition(position, five);
89
+ const floorplanPosition = modelPosition2FloorplanPosition(position, floorplanData);
90
+ const floorplanImagePosition = floorplanPosition2ImagePosition(floorplanPosition, floorplanData);
91
+ return { floorIndex, icon, id: object.id, position: floorplanPosition, positionInImage: floorplanImagePosition };
92
+ });
93
+ return extraObjects;
94
+ }
@@ -1,7 +1,6 @@
1
- import { Five } from '@realsee/five';
2
- import { Vector2Position } from '../../../typings/math.type';
3
- import { FloorplanData } from '../typings/floorplanData';
4
- import { FloorplanBounding } from '../typings/floorplanData';
1
+ import type { Five } from '@realsee/five';
2
+ import type { Vector2Position } from '../../typings/math.type';
3
+ import type { FloorplanData, FloorplanBounding } from '../typings/floorplanData';
5
4
  export declare function pathD(points: Vector2Position[], options?: {
6
5
  needZ?: boolean;
7
6
  needA?: Record<number, string>;
@@ -0,0 +1,50 @@
1
+ export function pathD(points, options = {}) {
2
+ let d = '';
3
+ const { needZ, needA } = options;
4
+ const _points = needZ ? points.slice().concat(points[0]) : points.slice();
5
+ _points.forEach((_point, index) => {
6
+ const { x, y } = options.format ? options.format(_point) : _point;
7
+ const point = x + ',' + y;
8
+ if (index === 0) {
9
+ d += 'M' + point;
10
+ return d;
11
+ }
12
+ if (needA?.[index]) {
13
+ d += 'A' + needA[index] + ',' + point;
14
+ return d;
15
+ }
16
+ d += 'L' + point;
17
+ return d;
18
+ });
19
+ return d + (needZ ? 'Z' : '');
20
+ }
21
+ /** 把户型图上点点位转换到 SVG 上的点位 */
22
+ export default function formatFloorplanPoint({ x, y }, pxmm, bounding) {
23
+ const { max, min } = bounding;
24
+ return { x: (x - min.x) * pxmm, y: (max.y - y) * pxmm };
25
+ }
26
+ /** 模型坐标转户型图坐标 */
27
+ export function modelPosition2FloorplanPosition(position, floorplanData) {
28
+ const x = position.x * 1000 + floorplanData.bounding.origin.x;
29
+ const y = -position.z * 1000 + floorplanData.bounding.origin.y;
30
+ return { x, y };
31
+ }
32
+ /** 户型图点位转在图片上的相对坐标 */
33
+ export function floorplanPosition2ImagePosition(position, floorplanData) {
34
+ const bounding = floorplanData.bounding;
35
+ const boundingWidth = bounding.max.x - bounding.min.x;
36
+ const boundingHeight = bounding.max.y - bounding.min.y;
37
+ return {
38
+ x: (position.x - bounding.min.x) / boundingWidth,
39
+ y: (bounding.max.y - position.y) / boundingHeight,
40
+ };
41
+ }
42
+ /** 求三维坐标点所在的楼层 */
43
+ export function getFloorIndexFromModelPosition(position, five) {
44
+ const floorIndex = Math.max(...five.work.observers.map((observer) => {
45
+ if (position.z >= observer.standingPosition.z)
46
+ return observer.floorIndex;
47
+ return 0;
48
+ }));
49
+ return floorIndex;
50
+ }
@@ -0,0 +1,17 @@
1
+ export { default as ModelViewPlugin } from "./ModelViewPlugin";
2
+ export { default as CSS3DRenderPlugin } from "./CSS3DRenderPlugin";
3
+ export type { PanoCursorRaycasterPluginExportType } from './PanoCursorRaycasterPlugin';
4
+ export { default as PanoCursorRaycasterPlugin } from "./PanoCursorRaycasterPlugin";
5
+ export type { ModelRoomLabelController, ModelRoomLabelPluginData, RoomLabel, ModelRoomLabelPluginReturnType, ModelRoomLabelPluginParameters } from './ModelRoomLabelPlugin';
6
+ export { default as ModelRoomLabelPlugin } from './ModelRoomLabelPlugin';
7
+ export type { TopviewFloorplanPluginReturnType, TopviewFloorplanPluginParameterType } from './floorplan/TopviewFloorplanPlugin';
8
+ export { default as TopviewFloorplanPlugin } from './floorplan/TopviewFloorplanPlugin';
9
+ export type { PanoFloorplanRadarPluginReturnType, PanoFloorplanRadarPluginParameterType } from './floorplan/PanoFloorplanRadarPlugin';
10
+ export { default as PanoFloorplanRadarPlugin } from './floorplan/PanoFloorplanRadarPlugin';
11
+ export type { ModelFloorplanParameterType, ModelFloorplanPluginReturnType, ModelFloorplanErrorType, ModelFloorplanPluginsConfigs, ModelFloorplanEventHandlers, ModelFloorplanViewEvent } from './floorplan/ModelFloorplanPlugin';
12
+ export { default as ModelFloorplanPlugin } from './floorplan/ModelFloorplanPlugin';
13
+ export type { ModelChassisCompassPluginParameterType, ModelChassisCompassPluginData, ModelChassisCompassPluginExportType } from './ModelChassisCompassPlugin';
14
+ export { default as ModelChassisCompassPlugin } from './ModelChassisCompassPlugin';
15
+ export type { ModelEntryDoorGuidePluginParameterType, ModelEntryDoorGuidePluginData, ModelEntryDoorGuidePluginExportType } from './ModelEntryDoorGuidePlugin';
16
+ export { default as ModelEntryDoorGuidePlugin } from './ModelEntryDoorGuidePlugin';
17
+ export { default as CameraMovementPlugin } from './CameraMovementPlugin';
package/libs/index.js ADDED
@@ -0,0 +1,10 @@
1
+ export { default as ModelViewPlugin } from "./ModelViewPlugin";
2
+ export { default as CSS3DRenderPlugin } from "./CSS3DRenderPlugin";
3
+ export { default as PanoCursorRaycasterPlugin } from "./PanoCursorRaycasterPlugin";
4
+ export { default as ModelRoomLabelPlugin } from './ModelRoomLabelPlugin';
5
+ export { default as TopviewFloorplanPlugin } from './floorplan/TopviewFloorplanPlugin';
6
+ export { default as PanoFloorplanRadarPlugin } from './floorplan/PanoFloorplanRadarPlugin';
7
+ export { default as ModelFloorplanPlugin } from './floorplan/ModelFloorplanPlugin';
8
+ export { default as ModelChassisCompassPlugin } from './ModelChassisCompassPlugin';
9
+ export { default as ModelEntryDoorGuidePlugin } from './ModelEntryDoorGuidePlugin';
10
+ export { default as CameraMovementPlugin } from './CameraMovementPlugin';
@@ -0,0 +1,38 @@
1
+ /**
2
+ * 预载器
3
+ */
4
+ export const Preloader = {
5
+ blob: (url) => {
6
+ const noop = () => null;
7
+ return new Promise((resolve, reject) => {
8
+ const xhr = new XMLHttpRequest();
9
+ const clear = () => {
10
+ xhr.ontimeout = noop;
11
+ xhr.onreadystatechange = noop;
12
+ xhr.onprogress = noop;
13
+ xhr.onabort = noop;
14
+ };
15
+ xhr.ontimeout = () => {
16
+ reject(new Error('timeout'));
17
+ clear();
18
+ };
19
+ xhr.onreadystatechange = () => {
20
+ if (xhr.readyState !== 4)
21
+ return;
22
+ if (xhr.status === 0 && !xhr.response)
23
+ return;
24
+ if (xhr.status === 200 || xhr.status === 0) {
25
+ resolve(xhr.response);
26
+ clear();
27
+ }
28
+ else {
29
+ reject(new Error('status:' + xhr.status));
30
+ clear();
31
+ }
32
+ };
33
+ xhr.open('GET', url, true);
34
+ xhr.responseType = 'blob';
35
+ xhr.send(null);
36
+ });
37
+ },
38
+ };
@@ -18,14 +18,14 @@ export default class Subscribe {
18
18
  * @param {any} context 事件回调函数调用的上下文
19
19
  * @param {boolean} once 是否只执行一次
20
20
  */
21
- on(names: string | string[], callback: (...args: any[]) => void, context?: any, once?: boolean): () => this | undefined;
21
+ on(names: string | string[], callback: (...args: any[]) => void, context?: any, once?: boolean): () => this;
22
22
  /**
23
23
  * 注册事件(是否只执行一次)
24
24
  * @param {string|[string]} names 事件类型
25
25
  * @param {function} callback 事件回调函数
26
26
  * @param {any} context 事件回调函数调用的上下文
27
27
  */
28
- once(names: string | string[], callback: (...args: any[]) => void, context?: any): () => this | undefined;
28
+ once(names: string | string[], callback: (...args: any[]) => void, context?: any): () => this;
29
29
  /**
30
30
  * 解除事件
31
31
  * @param {string|[string]} names 事件类型
@@ -34,7 +34,7 @@ export default class Subscribe {
34
34
  * 如果 name 不传的话解除对应所有事件
35
35
  * 如果 name, callback 不传的话解除所有name的所有事件
36
36
  */
37
- off(names?: string | string[], callback?: (...args: any[]) => void): this | undefined;
37
+ off(names?: string | string[], callback?: (...args: any[]) => void): this;
38
38
  /**
39
39
  * 触发事件
40
40
  * @param {string|[string]} name 事件类型
@@ -0,0 +1,101 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ const __EVENT__ = '__events__';
3
+ /**
4
+ * 订阅类。
5
+ * 观察者模式(供前端使用),Node端推荐<a href="https://nodejs.org/api/events.html#events_class_eventemitter">EventEmitter</a>。
6
+ */
7
+ export default class Subscribe {
8
+ [__EVENT__];
9
+ constructor() {
10
+ this[__EVENT__] = {};
11
+ }
12
+ /**
13
+ * 判断是否注册时事件
14
+ * @param {string|[string]} name 事件类型
15
+ */
16
+ hasListener(name) {
17
+ const events = this[__EVENT__];
18
+ return events && events[name] && events[name].length;
19
+ }
20
+ /**
21
+ * 注册事件
22
+ * @param {string|[string]} names 事件类型
23
+ * @param {function} callback 事件回调函数
24
+ * @param {any} context 事件回调函数调用的上下文
25
+ * @param {boolean} once 是否只执行一次
26
+ */
27
+ on(names, callback, context, once = false) {
28
+ for (const name of [].concat(names)) {
29
+ if (!this[__EVENT__][name])
30
+ this[__EVENT__][name] = [];
31
+ this[__EVENT__][name].push([callback, context, once]);
32
+ }
33
+ return () => this.off(names, callback);
34
+ }
35
+ /**
36
+ * 注册事件(是否只执行一次)
37
+ * @param {string|[string]} names 事件类型
38
+ * @param {function} callback 事件回调函数
39
+ * @param {any} context 事件回调函数调用的上下文
40
+ */
41
+ once(names, callback, context) {
42
+ return this.on(names, callback, context, true);
43
+ }
44
+ /**
45
+ * 解除事件
46
+ * @param {string|[string]} names 事件类型
47
+ * @param {function} callback 事件回调函数
48
+ *
49
+ * 如果 name 不传的话解除对应所有事件
50
+ * 如果 name, callback 不传的话解除所有name的所有事件
51
+ */
52
+ off(names, callback) {
53
+ if (arguments.length === 0) {
54
+ this[__EVENT__] = {};
55
+ return;
56
+ }
57
+ const hasNames = (names) => names;
58
+ if (hasNames(names)) {
59
+ const events = this[__EVENT__];
60
+ for (const name of [].concat(names)) {
61
+ if (events[name] === undefined)
62
+ continue;
63
+ if (callback === undefined) {
64
+ events[name].length = 0;
65
+ continue;
66
+ }
67
+ events[name] = events[name].filter((one) => one[0] !== callback);
68
+ }
69
+ }
70
+ return this;
71
+ }
72
+ /**
73
+ * 触发事件
74
+ * @param {string|[string]} name 事件类型
75
+ * @param {...any} data 触发事件的数据
76
+ */
77
+ emit(name, ...data) {
78
+ let canceled = false;
79
+ const event = this[__EVENT__][name] || [];
80
+ if (event.length === 0) {
81
+ console.warn(` 💀 "${name}" ⟶ Unregistered event. `);
82
+ }
83
+ for (const one of event) {
84
+ try {
85
+ const [callback, context = this, once = false] = one;
86
+ const result = callback.apply(context, data);
87
+ if (once)
88
+ this.off(name, callback);
89
+ if (result === false) {
90
+ // 如果回调的返回结果是false,则中断后续的调用链
91
+ canceled = true;
92
+ return canceled;
93
+ }
94
+ }
95
+ catch (error) {
96
+ console.warn(error);
97
+ }
98
+ }
99
+ return canceled;
100
+ }
101
+ }
@@ -0,0 +1,30 @@
1
+ import TWEEN from '@tweenjs/tween.js';
2
+ import { requestAnimationFrameInterval } from './index';
3
+ export class BetterTween extends TWEEN.Tween {
4
+ disposeMethods = [];
5
+ animationFrameDisposer;
6
+ onDispose = (callback) => {
7
+ this.disposeMethods.push(callback);
8
+ return this;
9
+ };
10
+ play = () => {
11
+ this.start(0);
12
+ this.animationFrameDisposer = requestAnimationFrameInterval((time) => this.update(time));
13
+ return this;
14
+ };
15
+ dispose = () => {
16
+ this.stop();
17
+ this.animationFrameDisposer?.();
18
+ this.disposeMethods.forEach((fn) => fn());
19
+ this.disposeMethods = [];
20
+ TWEEN.remove(this);
21
+ };
22
+ }
23
+ export function tweenProgress(duration, easing = TWEEN.Easing.Linear.None) {
24
+ const tween = new BetterTween({ progress: 0 }).to({ progress: 1 });
25
+ if (duration !== undefined)
26
+ tween.duration(duration);
27
+ if (easing !== undefined)
28
+ tween.easing(easing);
29
+ return tween;
30
+ }
@@ -0,0 +1,23 @@
1
+ import { formatRad } from './formatRad';
2
+ const PI = Math.PI;
3
+ const PI_2 = PI * 2;
4
+ /**
5
+ * 线性过程插值
6
+ */
7
+ export function progressNumber(from, to, pst) {
8
+ return from + (to - from) * pst;
9
+ }
10
+ /**
11
+ * 弧度过程插值值,会取锐角进行插值
12
+ */
13
+ export function progressRad(from, to, pst) {
14
+ from = formatRad(from);
15
+ to = formatRad(to);
16
+ if (to - from > PI) {
17
+ return formatRad(progressNumber(from + PI_2, to, pst));
18
+ }
19
+ if (from - to > PI) {
20
+ return formatRad(progressNumber(from - PI_2, to, pst));
21
+ }
22
+ return progressNumber(from, to, pst);
23
+ }
@@ -0,0 +1,20 @@
1
+ const PI_2 = Math.PI * 2;
2
+ /**
3
+ * 把一个任意角度的弧度值转换为一个 [0, 2PI] 的弧度值
4
+ * @param rad 弧度值
5
+ */
6
+ export function formatLongitude(rad) {
7
+ return ((rad % PI_2) + PI_2) % PI_2;
8
+ }
9
+ /**
10
+ * 把一个任意角度的弧度值转换为一个 [-2PI, 2PI] 的弧度值
11
+ * @param rad 弧度值
12
+ */
13
+ export function formatLatitude(rad) {
14
+ return rad % PI_2;
15
+ }
16
+ /**
17
+ * 把一个任意角度的弧度值转换为一个 [0, 2PI] 的弧度值
18
+ * @param rad 弧度值
19
+ */
20
+ export const formatRad = formatLongitude;
@@ -0,0 +1,48 @@
1
+ const _requestAnimationFrame = window.requestAnimationFrame || ((fn) => setTimeout(fn, 16));
2
+ const _cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout;
3
+ export default _requestAnimationFrame;
4
+ export function nextFrame(fn, delay = 0) {
5
+ if (delay <= 0)
6
+ _requestAnimationFrame(fn);
7
+ else
8
+ _requestAnimationFrame(() => nextFrame(fn, delay - 1));
9
+ }
10
+ /**
11
+ * 在每个 AnimationFrame 中调用传入的函数
12
+ * @param callback 每次 AnimationFrame 中调用的函数
13
+ * @param frame 每秒运行多少次
14
+ * @returns 返回一个函数,调用可以停止 AnimationFrameLoop
15
+ */
16
+ export function requestAnimationFrameInterval(callback, frame = 60) {
17
+ let index = -1;
18
+ let oldTime = 0;
19
+ let startTime = -1;
20
+ const minDeltaTime = 1000 / frame;
21
+ function loop(time) {
22
+ startTime === -1 && (startTime = time);
23
+ index = _requestAnimationFrame(loop);
24
+ const deltaTime = time - oldTime;
25
+ if (deltaTime < minDeltaTime)
26
+ return;
27
+ oldTime = time;
28
+ callback && callback(time - startTime);
29
+ }
30
+ index = _requestAnimationFrame(loop);
31
+ return function stop() {
32
+ _cancelAnimationFrame(index);
33
+ };
34
+ }
35
+ /**
36
+ * 获取两个 AnimationFrame 间隔的时间
37
+ * @returns 返回一个 Promise,resolve 的结果是两个 AnimationFrame 间隔的时间
38
+ */
39
+ export function getFrameTime() {
40
+ const start = Date.now();
41
+ return new Promise((resolve) => {
42
+ _requestAnimationFrame(() => {
43
+ resolve(Date.now() - start);
44
+ });
45
+ });
46
+ }
47
+ // export { Easing } from './tween'
48
+ // export { default as tween } from './tween'