@realsee/dnalogel 2.0.0-alpha.2 → 2.0.0-alpha.22

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 (430) hide show
  1. package/CHANGELOG.md +78 -0
  2. package/README.md +93 -4
  3. package/TERMS.txt +56 -0
  4. package/dist/CSS3DRenderPlugin/index.d.ts +49 -0
  5. package/dist/CSS3DRenderPlugin/index.js +234 -0
  6. package/dist/CSS3DRenderPlugin/utils/createResizeObserver.d.ts +7 -0
  7. package/dist/CameraMovementPlugin/index.d.ts +7 -0
  8. package/dist/CameraMovementPlugin/index.js +302 -0
  9. package/dist/CameraMovementPlugin/typing.d.ts +68 -0
  10. package/dist/ModelChassisCompassPlugin/index.d.ts +19 -0
  11. package/dist/ModelChassisCompassPlugin/index.js +143 -0
  12. package/dist/ModelEntryDoorGuidePlugin/index.d.ts +26 -0
  13. package/dist/ModelEntryDoorGuidePlugin/index.js +201 -0
  14. package/dist/ModelItemLabelPlugin/events.type.d.ts +9 -0
  15. package/dist/ModelItemLabelPlugin/index.d.ts +4 -0
  16. package/dist/ModelItemLabelPlugin/index.js +668 -0
  17. package/dist/ModelItemLabelPlugin/typings.d.ts +56 -0
  18. package/dist/ModelItemLabelPlugin/utils/parseData.d.ts +3 -0
  19. package/dist/ModelRoomLabelPlugin/Assets/roomLabelBg.d.ts +1 -0
  20. package/dist/ModelRoomLabelPlugin/Controller.d.ts +36 -0
  21. package/dist/ModelRoomLabelPlugin/index.d.ts +12 -0
  22. package/dist/ModelRoomLabelPlugin/index.js +505 -0
  23. package/dist/ModelRoomLabelPlugin/typings.d.ts +35 -0
  24. package/dist/ModelRoomLabelPlugin/utils/parseData.d.ts +3 -0
  25. package/dist/ModelTVVideoPlugin/index.d.ts +4 -0
  26. package/dist/ModelTVVideoPlugin/index.js +301 -0
  27. package/dist/ModelTVVideoPlugin/typings.d.ts +25 -0
  28. package/dist/ModelTVVideoPlugin/utils/parseData.d.ts +2 -0
  29. package/dist/ModelViewPlugin/index.d.ts +17 -0
  30. package/dist/ModelViewPlugin/index.js +187 -0
  31. package/dist/PanoCompassPlugin/Assets/roomInfoIcon.d.ts +1 -0
  32. package/dist/PanoCompassPlugin/getRoomInfoInstance.d.ts +8 -0
  33. package/dist/PanoCompassPlugin/index.d.ts +51 -0
  34. package/dist/PanoCompassPlugin/index.js +635 -0
  35. package/dist/PanoCursorRaycasterPlugin/index.d.ts +48 -0
  36. package/dist/PanoCursorRaycasterPlugin/index.js +90 -0
  37. package/dist/PanoMeasurePlugin/Controller/BaseController.d.ts +36 -0
  38. package/dist/PanoMeasurePlugin/Controller/EditController.d.ts +52 -0
  39. package/dist/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +12 -0
  40. package/dist/PanoMeasurePlugin/Controller/WatchController.d.ts +25 -0
  41. package/dist/PanoMeasurePlugin/Controller/index.d.ts +61 -0
  42. package/dist/PanoMeasurePlugin/Model/index.d.ts +38 -0
  43. package/dist/PanoMeasurePlugin/Model/line.d.ts +30 -0
  44. package/dist/PanoMeasurePlugin/Model/point.d.ts +16 -0
  45. package/dist/PanoMeasurePlugin/Model/polyline.d.ts +16 -0
  46. package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.d.ts +2 -0
  47. package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.d.ts +2 -0
  48. package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.d.ts +2 -0
  49. package/dist/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +22 -0
  50. package/dist/PanoMeasurePlugin/Modules/FiveHelper.d.ts +11 -0
  51. package/dist/PanoMeasurePlugin/Modules/GuideController.d.ts +18 -0
  52. package/dist/PanoMeasurePlugin/Modules/Magnifier.d.ts +24 -0
  53. package/dist/PanoMeasurePlugin/Modules/UIController/HTML.d.ts +6 -0
  54. package/dist/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +18 -0
  55. package/dist/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +13 -0
  56. package/dist/PanoMeasurePlugin/Modules/UIController/index.d.ts +16 -0
  57. package/dist/PanoMeasurePlugin/Modules/UIController/style.d.ts +17 -0
  58. package/dist/PanoMeasurePlugin/index.d.ts +7 -0
  59. package/dist/PanoMeasurePlugin/index.js +5531 -0
  60. package/dist/PanoMeasurePlugin/typings/data.d.ts +28 -0
  61. package/dist/PanoMeasurePlugin/typings/event.type.d.ts +28 -0
  62. package/dist/PanoMeasurePlugin/typings/utils.type.d.ts +1 -0
  63. package/dist/PanoMeasurePlugin/utils/clearGroup.d.ts +2 -0
  64. package/dist/PanoMeasurePlugin/utils/constants.d.ts +4 -0
  65. package/dist/PanoMeasurePlugin/utils/distanceDom.d.ts +28 -0
  66. package/dist/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +2 -0
  67. package/dist/PanoMeasurePlugin/utils/findClosestPoint.d.ts +10 -0
  68. package/dist/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +4 -0
  69. package/dist/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +10 -0
  70. package/dist/PanoMeasurePlugin/utils/ironbox.d.ts +1 -0
  71. package/dist/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +2 -0
  72. package/dist/PanoMeasurePlugin/utils/line.d.ts +17 -0
  73. package/dist/PanoMeasurePlugin/utils/math.d.ts +17 -0
  74. package/dist/PanoMeasurePlugin/utils/mouseGroup.d.ts +2 -0
  75. package/dist/PanoMeasurePlugin/utils/ndc2Screen.d.ts +5 -0
  76. package/dist/PanoRulerPlugin/index.d.ts +31 -0
  77. package/dist/PanoRulerPlugin/index.js +612 -0
  78. package/dist/PanoRulerPlugin/style.d.ts +2 -0
  79. package/dist/PanoRulerPlugin/typings.d.ts +21 -0
  80. package/dist/PanoSpatialTagPlugin/index.d.ts +33 -0
  81. package/dist/PanoSpatialTagPlugin/index.js +1294 -0
  82. package/dist/PanoSpatialTagPlugin/store.d.ts +1 -0
  83. package/dist/PanoSpatialTagPlugin/style.d.ts +1 -0
  84. package/dist/PanoSpatialTagPlugin/typings.d.ts +40 -0
  85. package/dist/floorplan/Assets/camera.d.ts +1 -0
  86. package/{libs/floorplan/ModelFloorplanPlugin → dist/floorplan}/Assets/compass.d.ts +0 -0
  87. package/dist/floorplan/Assets/floorplanExtraObject.d.ts +1 -0
  88. package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +105 -0
  89. package/dist/floorplan/ModelFloorplanPlugin/index.d.ts +9 -0
  90. package/dist/floorplan/ModelFloorplanPlugin/index.js +4034 -0
  91. package/dist/floorplan/ModelFloorplanPlugin/typings/events.type.d.ts +23 -0
  92. package/dist/floorplan/ModelFloorplanPlugin/utils/constant.d.ts +15 -0
  93. package/dist/floorplan/ModelFloorplanPlugin/utils/correctFiveState.d.ts +14 -0
  94. package/dist/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +28 -0
  95. package/dist/floorplan/PanoFloorplanRadarPlugin/index.d.ts +8 -0
  96. package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +1642 -0
  97. package/dist/floorplan/TopviewFloorplanPlugin/Controller.d.ts +75 -0
  98. package/dist/floorplan/TopviewFloorplanPlugin/index.d.ts +5 -0
  99. package/dist/floorplan/TopviewFloorplanPlugin/index.js +3646 -0
  100. package/dist/floorplan/TopviewFloorplanPlugin/style.d.ts +1 -0
  101. package/dist/floorplan/constant.d.ts +5 -0
  102. package/dist/floorplan/typings/floorplanData.d.ts +137 -0
  103. package/dist/floorplan/typings/floorplanServerData.d.ts +131 -0
  104. package/dist/floorplan/typings/utility.d.ts +2 -0
  105. package/dist/floorplan/utils/formatData.d.ts +5 -0
  106. package/dist/floorplan/utils/formatPosition.d.ts +36 -0
  107. package/dist/index.d.ts +30 -0
  108. package/dist/index.es.js +15138 -0
  109. package/dist/index.js +15180 -0
  110. package/dist/index.umd.js +15173 -0
  111. package/dist/shared-utils/Preloader.d.ts +6 -0
  112. package/dist/shared-utils/Subscribe.d.ts +45 -0
  113. package/dist/shared-utils/animationFrame/BetterTween.d.ts +11 -0
  114. package/dist/shared-utils/animationFrame/calculateProgress.d.ts +8 -0
  115. package/dist/shared-utils/animationFrame/formatRad.d.ts +15 -0
  116. package/dist/shared-utils/animationFrame/index.d.ts +15 -0
  117. package/dist/shared-utils/animationFrame/tween.d.ts +75 -0
  118. package/dist/shared-utils/changeModelCanvasOpacity.d.ts +2 -0
  119. package/dist/shared-utils/createCanvasTextTexture.d.ts +8 -0
  120. package/dist/shared-utils/createLine/index.d.ts +3 -0
  121. package/dist/shared-utils/debounce.d.ts +6 -0
  122. package/dist/shared-utils/equal.d.ts +11 -0
  123. package/dist/shared-utils/filter.d.ts +27 -0
  124. package/dist/shared-utils/five/changeMode.d.ts +2 -0
  125. package/dist/shared-utils/five/useFivePlugin.d.ts +1 -0
  126. package/dist/shared-utils/formatRad.d.ts +7 -0
  127. package/dist/shared-utils/getPxmm.d.ts +11 -0
  128. package/dist/shared-utils/getRandomColor.d.ts +1 -0
  129. package/dist/shared-utils/isNil.d.ts +10 -0
  130. package/dist/shared-utils/isTruelyObject.d.ts +18 -0
  131. package/dist/shared-utils/math/evenNumber.d.ts +3 -0
  132. package/dist/shared-utils/math/planimetry.d.ts +116 -0
  133. package/dist/shared-utils/math/rad2Deg.d.ts +1 -0
  134. package/dist/shared-utils/nearlyEqual.d.ts +7 -0
  135. package/dist/shared-utils/nextFrame.d.ts +1 -0
  136. package/dist/shared-utils/noop.d.ts +5 -0
  137. package/dist/shared-utils/object3d2LocalMatrix.d.ts +12 -0
  138. package/dist/shared-utils/px2rem.d.ts +1 -0
  139. package/dist/shared-utils/removeArrayItem.d.ts +7 -0
  140. package/dist/shared-utils/tap.d.ts +8 -0
  141. package/dist/shared-utils/three/centerPoint.d.ts +2 -0
  142. package/dist/shared-utils/three/getExtraModelLoader.d.ts +6 -0
  143. package/dist/shared-utils/three/getNormal.d.ts +2 -0
  144. package/dist/shared-utils/three/getTextureLoader.d.ts +6 -0
  145. package/dist/shared-utils/three/loadFbxObj.d.ts +2 -0
  146. package/dist/shared-utils/three/loadTexture.d.ts +2 -0
  147. package/dist/shared-utils/three/transformPositionToVector3.d.ts +7 -0
  148. package/dist/shared-utils/three/transfromToMeshBasicMaterial.d.ts +2 -0
  149. package/dist/shared-utils/throttle.d.ts +7 -0
  150. package/dist/shared-utils/tinyEJSrender.d.ts +5 -0
  151. package/dist/shared-utils/to.d.ts +8 -0
  152. package/dist/shared-utils/useDebounce.d.ts +8 -0
  153. package/dist/shared-utils/useThrottle.d.ts +8 -0
  154. package/dist/shared-utils/uuid.d.ts +4 -0
  155. package/dist/shared-utils/vectorTocoordinates.d.ts +7 -0
  156. package/dist/typings/math.type.d.ts +44 -0
  157. package/dist/typings/utils.type.d.ts +2 -0
  158. package/docs/.nojekyll +1 -0
  159. package/docs/assets/highlight.css +78 -0
  160. package/docs/assets/icons.css +1043 -0
  161. package/docs/assets/icons.png +0 -0
  162. package/docs/assets/icons@2x.png +0 -0
  163. package/docs/assets/main.js +52 -0
  164. package/docs/assets/search.js +1 -0
  165. package/docs/assets/style.css +1413 -0
  166. package/docs/assets/widgets.png +0 -0
  167. package/docs/assets/widgets@2x.png +0 -0
  168. package/docs/classes/ModelRoomLabelController.html +20 -0
  169. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -0
  170. package/docs/enums/ModelFloorplanErrorType.html +1 -0
  171. package/docs/index.html +88 -0
  172. package/docs/interfaces/LineJson.html +1 -0
  173. package/docs/interfaces/ModelChassisCompassPluginData.html +1 -0
  174. package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -0
  175. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -0
  176. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -0
  177. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -0
  178. package/docs/interfaces/ModelFloorplanParameterType.html +1 -0
  179. package/docs/interfaces/ModelFloorplanViewEvent.html +5 -0
  180. package/docs/interfaces/ModelItemLabelPluginData.html +1 -0
  181. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -0
  182. package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -0
  183. package/docs/interfaces/ModelRoomLabelPluginData.html +1 -0
  184. package/docs/interfaces/ModelTVVideoPluginData.html +1 -0
  185. package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -0
  186. package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -0
  187. package/docs/interfaces/PanoCompassPluginData.html +1 -0
  188. package/docs/interfaces/PanoCompassPluginParameterType.html +1 -0
  189. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +11 -0
  190. package/docs/interfaces/PanoRulerPluginExportType.html +1 -0
  191. package/docs/interfaces/PanoRulerPluginOptions.html +1 -0
  192. package/docs/interfaces/PanoRulerPluginParameterType.html +1 -0
  193. package/docs/interfaces/PanoSpatialTagPluginData.html +1 -0
  194. package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -0
  195. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -0
  196. package/docs/interfaces/PointJson.html +1 -0
  197. package/docs/interfaces/RoomLabel.html +13 -0
  198. package/docs/interfaces/TopviewFloorplanPluginParameterType.html +19 -0
  199. package/docs/modules.html +28 -0
  200. package/libs/CSS3DRenderPlugin/index.d.ts +2 -2
  201. package/libs/CSS3DRenderPlugin/index.js +27 -26
  202. package/libs/CameraMovementPlugin/typing.d.ts +1 -1
  203. package/libs/ModelChassisCompassPlugin/index.js +2 -2
  204. package/libs/ModelEntryDoorGuidePlugin/index.d.ts +1 -1
  205. package/libs/ModelEntryDoorGuidePlugin/index.js +13 -9
  206. package/libs/ModelItemLabelPlugin/ItemLabelComponent.js +409 -0
  207. package/libs/ModelItemLabelPlugin/ItemLabelItem.js +133 -0
  208. package/libs/ModelItemLabelPlugin/events.type.d.ts +9 -0
  209. package/libs/ModelItemLabelPlugin/events.type.js +1 -0
  210. package/libs/ModelItemLabelPlugin/index.d.ts +4 -0
  211. package/libs/ModelItemLabelPlugin/index.js +120 -0
  212. package/libs/ModelItemLabelPlugin/typings.d.ts +56 -0
  213. package/libs/ModelItemLabelPlugin/typings.js +7 -0
  214. package/libs/ModelItemLabelPlugin/utils/parseData.d.ts +3 -0
  215. package/libs/ModelItemLabelPlugin/utils/parseData.js +4 -0
  216. package/libs/ModelRoomLabelPlugin/Controller.js +67 -25
  217. package/libs/ModelRoomLabelPlugin/RoomLabelItem.js +121 -0
  218. package/libs/ModelRoomLabelPlugin/RoomLabelItems.js +255 -0
  219. package/libs/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
  220. package/libs/ModelTVVideoPlugin/index.d.ts +4 -0
  221. package/libs/ModelTVVideoPlugin/index.js +254 -0
  222. package/libs/ModelTVVideoPlugin/typings.d.ts +25 -0
  223. package/libs/ModelTVVideoPlugin/typings.js +8 -0
  224. package/libs/ModelTVVideoPlugin/utils/parseData.d.ts +2 -0
  225. package/libs/ModelTVVideoPlugin/utils/parseData.js +13 -0
  226. package/libs/ModelViewPlugin/index.js +6 -6
  227. package/libs/PanoCompassPlugin/Assets/roomInfoIcon.d.ts +1 -0
  228. package/libs/PanoCompassPlugin/Assets/roomInfoIcon.js +1 -0
  229. package/libs/PanoCompassPlugin/getRoomInfoInstance.d.ts +8 -0
  230. package/libs/PanoCompassPlugin/getRoomInfoInstance.js +48 -0
  231. package/libs/PanoCompassPlugin/index.d.ts +51 -0
  232. package/libs/PanoCompassPlugin/index.js +253 -0
  233. package/libs/PanoCursorRaycasterPlugin/index.d.ts +1 -1
  234. package/libs/PanoCursorRaycasterPlugin/index.js +5 -3
  235. package/libs/PanoMeasurePlugin/Controller/BaseController.d.ts +36 -0
  236. package/libs/PanoMeasurePlugin/Controller/BaseController.js +124 -0
  237. package/libs/PanoMeasurePlugin/Controller/EditController.d.ts +52 -0
  238. package/libs/PanoMeasurePlugin/Controller/EditController.js +329 -0
  239. package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +12 -0
  240. package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.js +64 -0
  241. package/libs/PanoMeasurePlugin/Controller/WatchController.d.ts +25 -0
  242. package/libs/PanoMeasurePlugin/Controller/WatchController.js +305 -0
  243. package/libs/PanoMeasurePlugin/Controller/index.d.ts +61 -0
  244. package/libs/PanoMeasurePlugin/Controller/index.js +265 -0
  245. package/libs/PanoMeasurePlugin/Model/index.d.ts +38 -0
  246. package/libs/PanoMeasurePlugin/Model/index.js +139 -0
  247. package/libs/PanoMeasurePlugin/Model/line.d.ts +30 -0
  248. package/libs/PanoMeasurePlugin/Model/line.js +114 -0
  249. package/libs/PanoMeasurePlugin/Model/point.d.ts +16 -0
  250. package/libs/PanoMeasurePlugin/Model/point.js +48 -0
  251. package/libs/PanoMeasurePlugin/Model/polyline.d.ts +16 -0
  252. package/libs/PanoMeasurePlugin/Model/polyline.js +65 -0
  253. package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.d.ts +2 -0
  254. package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.js +15 -0
  255. package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.d.ts +2 -0
  256. package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.js +2 -0
  257. package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.d.ts +2 -0
  258. package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.js +2 -0
  259. package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +22 -0
  260. package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.js +153 -0
  261. package/libs/PanoMeasurePlugin/Modules/FiveHelper.d.ts +11 -0
  262. package/libs/PanoMeasurePlugin/Modules/FiveHelper.js +48 -0
  263. package/libs/PanoMeasurePlugin/Modules/GuideController.d.ts +18 -0
  264. package/libs/PanoMeasurePlugin/Modules/GuideController.js +110 -0
  265. package/libs/PanoMeasurePlugin/Modules/Magnifier.d.ts +24 -0
  266. package/libs/PanoMeasurePlugin/Modules/Magnifier.js +153 -0
  267. package/libs/PanoMeasurePlugin/Modules/UIController/HTML.d.ts +6 -0
  268. package/libs/PanoMeasurePlugin/Modules/UIController/HTML.js +117 -0
  269. package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +18 -0
  270. package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +148 -0
  271. package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +13 -0
  272. package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.js +70 -0
  273. package/libs/PanoMeasurePlugin/Modules/UIController/index.d.ts +16 -0
  274. package/libs/PanoMeasurePlugin/Modules/UIController/index.js +102 -0
  275. package/libs/PanoMeasurePlugin/Modules/UIController/style.d.ts +17 -0
  276. package/libs/PanoMeasurePlugin/Modules/UIController/style.js +79 -0
  277. package/libs/PanoMeasurePlugin/index.d.ts +7 -0
  278. package/libs/PanoMeasurePlugin/index.js +5 -0
  279. package/libs/PanoMeasurePlugin/typings/data.d.ts +28 -0
  280. package/libs/PanoMeasurePlugin/typings/data.js +1 -0
  281. package/libs/PanoMeasurePlugin/typings/event.type.d.ts +28 -0
  282. package/libs/PanoMeasurePlugin/typings/event.type.js +1 -0
  283. package/libs/PanoMeasurePlugin/typings/utils.type.d.ts +1 -0
  284. package/libs/PanoMeasurePlugin/typings/utils.type.js +1 -0
  285. package/libs/PanoMeasurePlugin/utils/clearGroup.d.ts +2 -0
  286. package/libs/PanoMeasurePlugin/utils/clearGroup.js +3 -0
  287. package/libs/PanoMeasurePlugin/utils/constants.d.ts +4 -0
  288. package/libs/PanoMeasurePlugin/utils/constants.js +31 -0
  289. package/libs/PanoMeasurePlugin/utils/distanceDom.d.ts +28 -0
  290. package/libs/PanoMeasurePlugin/utils/distanceDom.js +115 -0
  291. package/libs/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +2 -0
  292. package/libs/PanoMeasurePlugin/utils/findAssociatedLines.js +21 -0
  293. package/libs/PanoMeasurePlugin/utils/findClosestPoint.d.ts +10 -0
  294. package/libs/PanoMeasurePlugin/utils/findClosestPoint.js +27 -0
  295. package/libs/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +4 -0
  296. package/libs/PanoMeasurePlugin/utils/getIntersectionFromEvent.js +9 -0
  297. package/libs/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +10 -0
  298. package/libs/PanoMeasurePlugin/utils/getPointFromHammerEvent.js +14 -0
  299. package/libs/PanoMeasurePlugin/utils/ironbox.d.ts +1 -0
  300. package/libs/PanoMeasurePlugin/utils/ironbox.js +1 -0
  301. package/libs/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +2 -0
  302. package/libs/PanoMeasurePlugin/utils/isNDCPointInScreen.js +6 -0
  303. package/libs/PanoMeasurePlugin/utils/line.d.ts +17 -0
  304. package/libs/PanoMeasurePlugin/utils/line.js +33 -0
  305. package/libs/PanoMeasurePlugin/utils/math.d.ts +17 -0
  306. package/libs/PanoMeasurePlugin/utils/math.js +44 -0
  307. package/libs/PanoMeasurePlugin/utils/mouseGroup.d.ts +2 -0
  308. package/libs/PanoMeasurePlugin/utils/mouseGroup.js +22 -0
  309. package/libs/PanoMeasurePlugin/utils/ndc2Screen.d.ts +5 -0
  310. package/libs/PanoMeasurePlugin/utils/ndc2Screen.js +6 -0
  311. package/libs/PanoRulerPlugin/index.d.ts +31 -0
  312. package/libs/PanoRulerPlugin/index.js +400 -0
  313. package/libs/PanoRulerPlugin/style.d.ts +2 -0
  314. package/libs/PanoRulerPlugin/style.js +88 -0
  315. package/libs/PanoRulerPlugin/typings.d.ts +21 -0
  316. package/libs/PanoRulerPlugin/typings.js +1 -0
  317. package/libs/PanoSpatialTagPlugin/Components/origins.js +168 -0
  318. package/libs/PanoSpatialTagPlugin/Components/tag.js +302 -0
  319. package/libs/PanoSpatialTagPlugin/index.d.ts +33 -0
  320. package/libs/PanoSpatialTagPlugin/index.js +413 -0
  321. package/libs/PanoSpatialTagPlugin/store.d.ts +1 -0
  322. package/libs/PanoSpatialTagPlugin/store.js +2 -0
  323. package/libs/PanoSpatialTagPlugin/style.d.ts +1 -0
  324. package/libs/PanoSpatialTagPlugin/style.js +8 -0
  325. package/libs/PanoSpatialTagPlugin/typings.d.ts +40 -0
  326. package/libs/PanoSpatialTagPlugin/typings.js +1 -0
  327. package/libs/floorplan/Assets/compass.d.ts +1 -0
  328. package/libs/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.js +0 -0
  329. package/libs/floorplan/Components/BaseImage.js +222 -0
  330. package/libs/floorplan/Components/Camera.js +120 -0
  331. package/libs/floorplan/Components/Compass.js +119 -0
  332. package/libs/floorplan/Components/CurrentFloor.js +456 -0
  333. package/libs/floorplan/Components/Main.js +464 -0
  334. package/libs/floorplan/Components/Normalmage.js +63 -0
  335. package/libs/floorplan/Components/RoomHighlight/Room.js +68 -0
  336. package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +199 -0
  337. package/libs/floorplan/Components/RoomLabels/RoomLabel.js +173 -0
  338. package/libs/floorplan/Components/RoomLabels/RoomLabels.js +265 -0
  339. package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +331 -0
  340. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.js +64 -0
  341. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.js +103 -0
  342. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.js +140 -0
  343. package/libs/floorplan/Components/RuleLabels/RuleItem.js +284 -0
  344. package/libs/floorplan/Components/RuleLabels/RuleLabels.js +269 -0
  345. package/libs/floorplan/Components/SvgImage.js +83 -0
  346. package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +4 -1
  347. package/libs/floorplan/ModelFloorplanPlugin/Controller.js +455 -279
  348. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.js +152 -0
  349. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.js +250 -0
  350. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.js +154 -0
  351. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.js +312 -0
  352. package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +89 -37
  353. package/libs/floorplan/TopviewFloorplanPlugin/Controller.d.ts +30 -14
  354. package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +269 -118
  355. package/libs/floorplan/TopviewFloorplanPlugin/index.d.ts +1 -1
  356. package/libs/floorplan/TopviewFloorplanPlugin/style.js +0 -1
  357. package/libs/floorplan/constant.d.ts +5 -0
  358. package/libs/floorplan/constant.js +6 -0
  359. package/libs/floorplan/typings/floorplanServerData.d.ts +4 -0
  360. package/libs/floorplan/utils/formatPosition.d.ts +1 -1
  361. package/libs/floorplan/utils/formatPosition.js +3 -3
  362. package/libs/index.d.ts +22 -9
  363. package/libs/index.js +11 -3
  364. package/libs/shared-utils/Subscribe.js +8 -1
  365. package/libs/shared-utils/animationFrame/BetterTween.js +47 -18
  366. package/libs/shared-utils/createCanvasTextTexture.js +6 -5
  367. package/libs/shared-utils/getPxmm.d.ts +6 -1
  368. package/libs/shared-utils/getPxmm.js +26 -12
  369. package/libs/shared-utils/math/evenNumber.js +1 -1
  370. package/libs/shared-utils/three/getExtraModelLoader.d.ts +1 -1
  371. package/libs/shared-utils/three/getNormal.d.ts +1 -1
  372. package/libs/shared-utils/three/getTextureLoader.d.ts +1 -1
  373. package/libs/shared-utils/three/loadFbxObj.d.ts +1 -1
  374. package/libs/shared-utils/three/transfromToMeshBasicMaterial.js +2 -1
  375. package/libs/shared-utils/tinyEJSrender.d.ts +5 -0
  376. package/libs/shared-utils/tinyEJSrender.js +210 -0
  377. package/libs/shared-utils/useDebounce.js +1 -1
  378. package/libs/shared-utils/useThrottle.js +2 -1
  379. package/libs/shared-utils/vectorTocoordinates.d.ts +1 -1
  380. package/package.json +26 -13
  381. package/dist/dnalogel.cjs.js +0 -2
  382. package/dist/dnalogel.es.js +0 -37145
  383. package/dist/dnalogel.umd.js +0 -2
  384. package/dist/style.css +0 -1
  385. package/libs/ModelRoomLabelPlugin/RoomLabelItem.svelte +0 -63
  386. package/libs/ModelRoomLabelPlugin/RoomLabelItem.svelte.map +0 -1
  387. package/libs/ModelRoomLabelPlugin/RoomLabelItems.svelte +0 -80
  388. package/libs/ModelRoomLabelPlugin/RoomLabelItems.svelte.map +0 -1
  389. package/libs/floorplan/Components/BaseImage.svelte +0 -25
  390. package/libs/floorplan/Components/BaseImage.svelte.map +0 -1
  391. package/libs/floorplan/Components/Normalmage.svelte +0 -11
  392. package/libs/floorplan/Components/Normalmage.svelte.map +0 -1
  393. package/libs/floorplan/Components/RoomHighlight/Room.svelte +0 -21
  394. package/libs/floorplan/Components/RoomHighlight/Room.svelte.map +0 -1
  395. package/libs/floorplan/Components/RoomHighlight/RoomHighlight.svelte +0 -60
  396. package/libs/floorplan/Components/RoomHighlight/RoomHighlight.svelte.map +0 -1
  397. package/libs/floorplan/Components/RoomMaterials/RoomMaterial.svelte +0 -35
  398. package/libs/floorplan/Components/RoomMaterials/RoomMaterial.svelte.map +0 -1
  399. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.svelte +0 -7
  400. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.svelte.map +0 -1
  401. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.svelte +0 -16
  402. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.svelte.map +0 -1
  403. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.svelte +0 -17
  404. package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.svelte.map +0 -1
  405. package/libs/floorplan/Components/SvgImage.svelte +0 -25
  406. package/libs/floorplan/Components/SvgImage.svelte.map +0 -1
  407. package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.svelte +0 -46
  408. package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.svelte.map +0 -1
  409. package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.svelte +0 -48
  410. package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.svelte.map +0 -1
  411. package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.svelte +0 -37
  412. package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.svelte.map +0 -1
  413. package/libs/floorplan/ModelFloorplanPlugin/Components/Main.svelte +0 -50
  414. package/libs/floorplan/ModelFloorplanPlugin/Components/Main.svelte.map +0 -1
  415. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.svelte +0 -41
  416. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.svelte.map +0 -1
  417. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.svelte +0 -25
  418. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.svelte.map +0 -1
  419. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.svelte +0 -148
  420. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.svelte.map +0 -1
  421. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.svelte +0 -15
  422. package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.svelte.map +0 -1
  423. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.svelte +0 -84
  424. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.svelte.map +0 -1
  425. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.svelte +0 -18
  426. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.svelte.map +0 -1
  427. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.svelte +0 -40
  428. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.svelte.map +0 -1
  429. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.svelte +0 -61
  430. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.svelte.map +0 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,78 @@
1
+ # CHANGELOG
2
+
3
+ ## 2.0.0-alpha.22
4
+ - 1.fix: 修复 PanoMeasurePlugin disable 状态下仍有背景色占位问题。
5
+
6
+ ## 2.0.0-alpha.21
7
+ - 1.fix: 修复 PanoMeasurePlugin 仅初始化 UI 面板仍占位为题。
8
+
9
+ ## 2.0.0-alpha.20
10
+ - 1.fix: 修复 PanoMeasurePlugin hide 时 UI 面板仍占位为题。
11
+
12
+ ## 2.0.0-alpha.19
13
+ - 1.fix: 修复在模型中切换全部楼层,切换回户型图,展示的是上一次展示时的楼层;
14
+ - 2.fix: 修复户型图界面切换楼层时,图片与SVG渲染有时间差导致闪烁的问题;
15
+ - 3.feat: TopviewFloorplanPlugin 插件支持放大缩小;
16
+ - 4.feat: ModelFloorplanPlugin 插件,autoShowEnable 和 hoverEnable 能同时支持;
17
+ - 5.chore: 设置 tsconfig.json importsNotUsedAsValues 为 error,在引用类型时,必须显示写为 import type。
18
+
19
+ ## 2.0.0-alpha.18
20
+ - 1.fix: 修复 PanoMeasurePlugin 使用时 hammerjs 报错问题。
21
+
22
+ ## 2.0.0-alpha.17
23
+ - 1.fix: 修复构建输出 px2rem 失效问题。
24
+
25
+ ## 2.0.0-alpha.16
26
+ - 1.fix: 修复 z-index 问题;
27
+ - 2.fix: 修复 ModelItemLabelPlugin 事件监听问题。
28
+
29
+ ## 2.0.0-alpha.15
30
+ - 1.refactor: 优化 ModelItemLabelPlugin 在调用 five.setState() 时的动画显示。
31
+
32
+ ## 2.0.0-alpha.14
33
+ - 1.feat: 新增 ModelTVVideoPlugin 插件;
34
+ - 2.fix: 修复 ModelItemLabelPlugin disable & enable 方法逻辑;
35
+ - 3.refactor: 增加 ModelItemLabelPlugin 类型导出。
36
+
37
+ ## 2.0.0-alpha.13
38
+ - 1.chore: 修改 tsconfig.json target 配置项为 es6。
39
+
40
+ ## 2.0.0-alpha.12
41
+ - 1.feat: 新增 ModelItemLabelPlugin
42
+
43
+ ## 2.0.0-alpha.11
44
+ - 1.fix: 修复 ModelRoomLabelPlugin 未监听多楼层切换 rerender 问题。
45
+ - 2.feat: ModelFloorplanPlugin & TopviewFloorplanPlugin 新增 `northDesc?: string` 配置项,支持用户修改指北针名称。
46
+
47
+ ## 2.0.0-alpha.10
48
+ - 1.feat: 新增空间三维标签插件 PanoSpatialTagPlugin
49
+ - 2.feat: 新增轻量 ejs 渲染模板函数 shared-utils/tinyEJSrender.js
50
+
51
+ ## 2.0.0-alpha.9
52
+ - 1.refactor: 增加插件独立 js 输出及对 svelte 的编译。
53
+
54
+ ## 2.0.0-alpha.8
55
+ - 1.fix: 修复 ModelViewPlugin 实景 VR 模型不居中问题;
56
+ - 2.fix: 修复 ModelRoomLabelPlugin fov 更新未 rerender 问题;
57
+ - 2.fix: 修复 ModelRoomLabelPlugin enable 判断问题;
58
+ - 4.fix: 修改 ModelFloorplanPlugin 在全景态满足户型图的俯仰角时会自动切换户型图问题。
59
+
60
+ ## 2.0.0-alpha.7
61
+ - 1.fix: PanoCompassPlugin 向下兼容;
62
+ - 2.feat: 新增 PC 全景测量插件:PanoMeasurePlugin;
63
+ - 3.docs: 修改 README.md;
64
+
65
+ ## 2.0.0-alpha.6
66
+ - 1.fix: 标尺插件 PanoRulerPlugin 所有标尺仅展示一次问题;
67
+ - 2.fix: TopviewFloorplanPlugin && ModelFloorplanPlugin 插件小雷达位置显示不正确问题;
68
+ - 3.feat: 为 TopviewFloorplanPlugin && ModelFloorplanPlugin 插件新增线框图吸附位置配置选项。
69
+ - 可选地板、天花板、模型中心,默认吸附选项为模型中心。
70
+
71
+ ## 2.0.0-alpha.5
72
+ 1.修复全景指南针插件 PanoCompassPlugin 默认导出 name
73
+
74
+ ## 2.0.0-alpha.4
75
+ 1.新增全景标尺插件 PanoRulerPlugin
76
+
77
+ ## 2.0.0-alpha.3
78
+ 1.新增全景指南针插件 PanoCompassPlugin
package/README.md CHANGED
@@ -1,11 +1,100 @@
1
- # 注意
1
+ <p align="center">
2
+ <a href="https://realsee.js.org/"><img src="https://vrlab-public.ljcdn.com/common/file/web/ea031fa5-ad82-46b3-86c8-7b20ec1e635a.jpg" width="60" /></a>
3
+ </p>
2
4
 
5
+ <p align="center">
6
+ <a href="https://www.npmjs.com/package/@realsee/dnalogel">
7
+ <img src="https://img.shields.io/npm/v/@realsee/dnalogel.svg" alt="npm version" >
8
+ </a>
9
+ <a href="https://packagephobia.now.sh/result?p=@realsee/dnalogel">
10
+ <img src="https://packagephobia.now.sh/badge?p=@realsee/dnalogel" alt="install size" >
11
+ </a>
12
+ <a href="https://github.com/realsee-developer/dnalogel/blob/main/plugins/TERMS.txt">
13
+ <img src="https://img.shields.io/npm/l/@realsee/dnalogel.svg" alt="license">
14
+ </a>
15
+ </p>
3
16
 
4
- 此版本为 **测试** 版本, 不推荐使用。
17
+ <h1 align="center">@realsee/dnalogel</h1>
5
18
 
6
- 如您有插件使用需求,请安装 1.x 版本。
19
+ # 👀 Overview
7
20
 
8
- 此版本依赖 `svelte`, 使用时请同时安装
21
+ @realsee/dnalogel 将 [如视(realsee.com)](https://realsee.com) **VR 看房** 常用能力沉淀,并以 `Five Plugins` 形式进行抽象。
22
+ 结合[如视 VR 看房 SDK Five](https://open-platform.realsee.com/developer/docs/front/3d-space/get-started/rendering-engine/)
23
+ 与 [如视开放 API](https://open-platform.realsee.com/developer/open/api/#/) ,可以制作出丰富多彩的三维空间应用。不论是经过线上环境千锤百炼的刚需功能,还是灵感一现的炫酷尝试,所有已经落地的功能我们均毫无保留的开源至github [realsee-developer/dnalogel](https://github.com/realsee-developer/dnalogel) 。
24
+
25
+ # 🔨 Usage
26
+
27
+ **1、安装**
28
+
29
+ ```bash
30
+ npm install @realsee/dnalogel
31
+ ```
32
+
33
+ ```bash
34
+ yarn add @realsee/dnalogel
35
+ ```
36
+
37
+ 2.x 版本依赖 `svelte`, 使用时请同时安装:
9
38
  ```bash
10
39
  npm install svelte
11
40
  ```
41
+
42
+ ```bash
43
+ yarn add svelte
44
+ ```
45
+
46
+ **2、插件注册**
47
+
48
+ ```js
49
+ import { Five } from '@realsee/five'
50
+ import { Plugin } from '@realsee/dnalogel'
51
+ const five = new Five({
52
+ plugins: [[Plugin, 'PluginName', initOptions]],
53
+ })
54
+ ```
55
+
56
+ **3、插件方法使用**
57
+
58
+ ```js
59
+ // 不同插件提供的方法可能存在差异,请参考各插件 API 文档
60
+ five.plugins.PluginName.load(data)
61
+ five.plugins.PluginName.enable()
62
+ five.plugins.PluginName.disable()
63
+ five.plugins.PluginName.dispose()
64
+ ```
65
+
66
+ **4、插件依赖数据获取**
67
+
68
+ 您可以通过 [open API](https://open-platform.realsee.com/developer/open/api#/) 查看数据获取方式及相关 open API 。
69
+
70
+ # 📖 Documents
71
+
72
+ - [说明文档](https://open-platform.realsee.com/developer/docs/front/3d-space/advanced/dnalogel/ModelViewPlugin/)
73
+ - [API 文档](https://unpkg.com/@realsee/dnalogel/docs/index.html)
74
+ - [demo 源码](https://github.com/realsee-developer/dnalogel/tree/main/examples/src)
75
+ - [数据依赖来源:open API](https://open-platform.realsee.com/developer/open/api/)
76
+ - [CHANGELOG](https://github.com/realsee-developer/dnalogel/blob/main/plugins/CHANGELOG.md)
77
+
78
+ # 💡 Preview
79
+
80
+ 我们为每个插件书写了简单的效果示例,您可点击预览:
81
+ [@realsee/dnalogel showcase](https://realsee.js.org/dnalogel/)
82
+
83
+
84
+ # 🧾 Lists
85
+
86
+ - 🔌 ModelViewPlugin:模型小窗插件
87
+ - 🔌 PanoFloorplanRadarPlugin:全景户型雷达图插件
88
+ - 🔌 ModelRoomLabelPlugin:模型态房屋标签插件
89
+ - 🔌 TopviewFloorplanPlugin:俯视模型户型图插件
90
+ - 🔌 ModelChassisCompassPlugin:模型底盘指南针插件
91
+ - 🔌 ModelEntryDoorGuidePlugin:模型入户门引导插件
92
+ - 🔌 CSS3DRenderPlugin:CSS3D渲染插件
93
+ - 🔌 CameraMovementPlugin:相机运镜插件
94
+ - 🔌 ModelFloorplanPlugin:模型户型图插件
95
+ - 🔌 PanoRulerPlugin:全景标尺插件
96
+ - 🔌 PanoCompassPlugin:全景指南针插件
97
+ - 其他插件持续更新中...
98
+
99
+ # License
100
+ [TERMS](https://github.com/realsee-developer/dnalogel/blob/main/plugins/TERMS.txt)
package/TERMS.txt ADDED
@@ -0,0 +1,56 @@
1
+ Realsee SDK License Agreement
2
+
3
+ Update: July 28, 2021
4
+
5
+ THIS LICENSE AGREEMENT BETWEEN YOU AND 【BEIKE REALSEE TECHNOLOGY (HK) LIMITED】(“Realsee”) FORMS A LEGALLY BINDING CONTRACT BETWEEN YOU AND REALSEE IN RELATION TO YOUR USE OF THE SDK. This License Agreement accompanies the Realsee Software Development Kit(s) for the software and related explanatory materials (the "SDK") and includes any upgrades, modified versions, updates, additions, and copies of the SDK licensed to You by Realsee.
6
+ BY DOWNLOADING, INSTALLING, OR OTHERWISE ACCESSING OR USING THE SDK, YOU AGREE THAT YOU HAVE READ, UNDERSTOOD, AND AGREE TO BE BOUND BY THIS AGREEMENT. YOU ARE AGREEING ON YOUR OWN BEHALF AND/OR ON BEHALF OF YOUR COMPANY OR ORGANIZATION TO THE TERMS AND CONDITIONS STATED BELOW.
7
+ This Agreement applies to Your use of the SDK in the country in which You legally install it (“Territory”) and is subject to the laws of such Territory and further subject to Section 12 below. Different terms, conditions, and limitations may apply to the use of the SDK in any additional countries.
8
+ 1. DEFINITIONS.
9
+ “Agreement” means this Realsee SDK License Agreement.
10
+ “Developer”, “You” and “Your” means the person(s) or entity acquiring or using the SDK or otherwise exercising rights under the terms of this Agreement.
11
+ “Documentation” means the technical or other specifications or documentation that Realsee may provide to You for use in connection with the SDK.
12
+ “Integrated Product” means any software, website, or on-line service developed by You based on or using the SDK (collectively, the “Integrated Product”).
13
+ “Intellectual Property” means any patents, patent rights, trademarks, service marks, registered and unregistered designs, applications for any of the foregoing, copyright, and any other similar protected rights in any country and to the extent recognised by any relevant jurisdiction as intellectual property, trade secrets, know-how and confidential information. Realsee reserves all rights not expressly granted to You.
14
+ “Realsee” means [Beike Realsee Technology (HK) Limited, a company incorporated and validly existing under the laws of Hong Kong].
15
+ “SDK” means the Realsee-proprietary Software Development Kits (SDK) provided hereunder, includes all development tools (including any compiler and debugger), application programming interfaces (“APIs”), libraries, binary utilities, header files, Documentation, content, data, code samples, and other materials provided to You in connection with this Agreement, whether delivered through a download, or any other media or form, and is licensed, not sold, to You by Realsee for use only under the terms of this Agreement. The terms of this Agreement will govern any updates provided by Realsee that replace and/or supplement the original SDK delivered to You, unless such update is accompanied by a separate license, in which case the terms of such license will govern.
16
+ 2. LICENSED USES AND RESTRICTIONS.
17
+ 2.1 Subject to the restrictions contained in this Section 2, Realsee grants to You during the term, a limited, non-exclusive, revocable, non-sublicensable, non-transferable license to install and use the SDK within the Territory only for the purpose of internal development.
18
+ 2.2 Restrictions. You acknowledge and agree that, You shall not, and shall ensure that Your affiliates, employees, agents, representatives, officers, representatives, and subcontractors do not (directly or indirectly):
19
+ 2.2.1 decompile, reverse engineer, disassemble or attempt to derive the source code of, those components of the SDK provided in object code form, or any part thereof;
20
+ 2.2.2 remove, alter, or obscure any copyright notice or other proprietary rights notice on any part of the SDK;
21
+ 2.2.3 sell, assign, pledge, rent, lease, lend, upload to or host on any website or server for use by any third party except You, redistribute, or sublicense the SDK (or any part thereof), or operate the SDK (or any part thereof) in the capacity of a service bureau or other hosted services provider, in whole or in part, nor may You enable others to do so;
22
+ 2.2.4 or alter, modify, customize or improve the SDK, or any part thereof;
23
+ 2.2.5 use the SDK (or any part thereof) for any illegal purpose, in any manner that is inconsistent with the terms of this Agreement, or to engage in any illegal activity;
24
+ 2.2.6 use the SDK (or any part thereof) in any manner that may damage the operation of Realsee’s products or services; or
25
+ 2.2.7 use the SDK or any information contained therein or otherwise provided by Realsee for the purpose of developing, or having developed, any product competitive with any Realsee product or service, as determined by Realsee in its sole discretion;
26
+ 2.2.8 include any portion of the SDK in Your Developer products.
27
+ 2.3 Realsee has the right to impose reasonable conditions such as a reasonable fee for use of the SDK in Integrated Product in the future.
28
+ 2.4 You may make a limited number of copies of the SDK to be used by Your employees or consultants as provided herein, and not for general business purposes, and such employees or consultants shall be subject to the obligations and restrictions in this Agreement.
29
+ 2.5 All licenses not expressly granted in this Agreement are reserved and no other licenses, immunity, or rights, express or implied, are granted by Realsee, by implication, estoppel, or otherwise.
30
+ 3. CONFIDENTIALITY.
31
+ The SDK and all source code, Documentation, specifications, engineering details, and related information pertaining to the SDK, whether in oral, written, graphic, or electronic form, are and shall remain the confidential and proprietary information of Realsee or its licensors (collectively, the “Confidential Information”). You shall (i) disclose Confidential Information to only those directors and employees (collectively, “Affiliates”) whose duties justify their need to know such information and who have been clearly informed of their obligation to maintain the confidential, proprietary, and/or trade secret status of such Confidential Information; and (ii) use Confidential Information solely in accordance with the license granted hereunder. In any event, You and Your Affiliates shall treat Confidential Information as strictly confidential and shall use the same care to prevent disclosure of such information as You use with respect to Your own similar confidential and/or proprietary information, which shall not be less than the care a reasonable person would use under similar circumstances. All Confidential Information, and any copies thereof, shall be returned promptly to Realsee upon request. You shall ensure that Your Affiliates comply with the provisions of this Section 3, and You shall be liable for any breach of this Section 3 resulting from the act or omission of any of Your Affiliates. You shall not disclose Confidential Information to any third party, including, without limitation, any of Your subcontractors.
32
+ 4. PROPRIETARY RIGHTS.
33
+ 4.1 As between You and Realsee, Realsee and/or its licensors retain ownership of all right, title, and interest in, to, and under the SDK, including, without limitation, all patents, copyrights, trade secrets, trademarks and other intellectual property and other proprietary rights therein, and reserve all rights not expressly granted to You.
34
+ 4.2 The items contained in the SDK are the intellectual property of Realsee and its licensors and are protected by PRC copyright and patent law, international treaty provisions and applicable laws of the country in which it is being used. You agree to protect all copyright and other ownership interests of Realsee and/or its licensors in all items in the SDK supplied under this License Agreement. You agree that all copies of the items in the SDK, reproduced for any reason by You, contain the same copyright notices, and other proprietary notices as appropriate, as appear on or in the original items delivered by Realsee in the SDK. Realsee and/or its licensors retain title and ownership of the items in the SDK, the media on which it is loaded, and all subsequent copies, regardless of the form or media in or on which the original and other copies may exist. Except as stated above, this Agreement does not grant You any rights to patents, copyrights, trade secrets, trademarks or any other rights in respect to the items in the SDK.
35
+ 5. TERM AND TERMINATION.
36
+ 5.1 This Agreement is effective until terminated. Realsee has the right to terminate this Agreement immediately, without judicial intervention, if You fail to comply with any term herein. Upon any such termination You must remove all full and partial copies of the items in the SDK from Your computer and discontinue the use of the items in the SDK.
37
+ 5.2 Realsee may at any time, terminate the Agreement with You if: (A) You have breached any provision of the Agreement; or (B) Realsee is required to do so by law; or (C) Realsee decides to no longer provide the SDK or certain parts of the SDK to users in the country in which You are resident or from which You use the service, or the provision of the SDK or certain SDK services to You by Realsee is, in Realsee's sole discretion, no longer legally or commercially viable.
38
+ 5.3 When the Agreement comes to an end, all of the legal rights, obligations and liabilities that You and Realsee have benefited from, been subject to (or which have accrued over time whilst the Agreement has been in force) or which are expressed to continue indefinitely, shall be unaffected by this cessation, and the provisions of Section 3, 4, 6, 7 and 8 shall continue to apply to such rights, obligations and liabilities indefinitely.
39
+ 6. DISCLAIMER OF WARRANTY.
40
+ YOU EXPRESSLY ACKNOWLEDGE AND AGREE THAT, TO THE EXTENT PERMITTED BY APPLICABLE LAW, USE OF THE SDK (OR ANY PART THEREOF) IS AT YOUR SOLE RISK AND THAT THE ENTIRE RISK AS TO SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH YOU. REALSEE LICENSES THE SDK TO YOU ONLY ON AN "AS-IS" BASIS. REALSEE MAKES NO REPRESENTATION WITH RESPECT TO THE ADEQUACY OF ANY ITEMS IN THE SDK, WHETHER OR NOT USED BY YOU IN THE DEVELOPMENT OF INTEGRATED PRODUCT, FOR ANY PARTICULAR PURPOSE OR WITH RESPECT TO THEIR ADEQUACY TO PRODUCE ANY PARTICULAR RESULT. REALSEE AND ITS LICENSORS SHALL NOT BE LIABLE FOR LOSS OR DAMAGE ARISING OUT OF THIS AGREEMENT OR FROM THE DISTRIBUTION OR USE OF INTEGRATED PRODUCT CONTAINING PORTIONS OF THE SDK. REALSEE AND ITS LICENSORS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED CONDITIONS OR WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT OF ANY THIRD PARTY RIGHT IN RESPECT OF THE ITEMS IN THE SDK OR ANY SERVICES RELATED TO THE SDK.
41
+ REALSEE IS UNDER NO OBLIGATION TO PROVIDE ANY SUPPORT UNDER THIS LICENSE AGREEMENT, INCLUDING UPGRADES OR FUTURE VERSIONS OF THE SDK OR ANY PORTIONS THEREOF, TO YOU, END USER OR TO ANY OTHER PARTY.
42
+ 7. LIMITATION OF LIABILITY.
43
+ TO THE EXTENT NOT PROHIBITED BY APPLICABLE LAW, IN NO EVENT WILL REALSEE OR ITS LICENSORS BE LIABLE FOR ANY DIRECT, INCIDENTAL, SPECIAL, INDIRECT, OR CONSEQUENTIAL DAMAGES, INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF USE, LOSS OF BUSINESS, REVENUE, OR PROFITS, LOSS OF OPPORTUNITY (WHETHER DIRECT OR INDIRECT), CORRUPTION OR LOSS OF DATA, LOSS OF REPUTATION OR SAVINGS, DOWNTIME, OR DAMAGE TO, LOSS OF OR REPLACEMENT OF DATA OR TRANSACTIONS, COST OF PROCUREMENT OF SUBSTITUTE SERVICES, BUSINESS INTERRUPTION, OR ANY OTHER COMMERCIAL DAMAGES OR LOSSES, ARISING OUT OF OR RELATED TO YOUR USE OR INABILITY TO USE THE SDK (OR ANY PART THEREOF), ANY INTEGRATED PRODUCT, OR ANY THIRD PARTY SOFTWARE, APPLICATIONS, OR SERVICES IN CONJUNCTION WITH THE SDK (OR ANY PART THEREOF), HOWEVER CAUSED, REGARDLESS OF THE THEORY OF LIABILITY (CONTRACT, TORT, OR OTHERWISE) AND EVEN IF REALSEE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. IN NO EVENT WILL REALSEE’S TOTAL LIABILITY TO YOU FOR ALL DAMAGES EXCEED ONE HUNDRED DOLLARS ($100.00). THE FOREGOING LIMITATIONS WILL APPLY EVEN IF THE ABOVE STATED REMEDY FAILS OF ITS ESSENTIAL PURPOSE. THE LIMITATIONS CONTAINED IN SECTIONS 6 AND THIS SECTION 7 ARE A FUNDAMENTAL PART OF THE BASIS OF REALSEE’S BARGAIN HEREUNDER, AND REALSEE WOULD NOT ENTER INTO THIS AGREEMENT OR PROVIDE YOU WITH ACCESS TO THE SDK ABSENT SUCH LIMITATIONS.
44
+ 8. INDEMNIFICATION.
45
+ To the extent permitted by applicable law, You agree to indemnify, defend and hold harmless Realsee, its affiliates and each of their directors, officers, employees, independent contractors, and agents (each a “Realsee Indemnified Party”) from any and all claims, losses, liabilities, damages, expenses, and costs (including without limitation attorneys’ fees and court costs) incurred by a Realsee Indemnified Party as a result of: (i) Your non-compliance with any terms of this Agreement; (ii) Your use of the SDK (or any part thereof); or (iii) Your use of any Integrated Product, including any claim that Integrated Product infringes the copyright, trademark, trade secret or other intellectual property right of a third party.
46
+ 9. ACKNOWLEDGEMENTS.
47
+ Portions of the SDK may utilize or include third party software and other copyrighted material. Acknowledgments, licensing terms, and disclaimers for such material are contained in Documentation for the SDK or may otherwise accompany such material, and Your use of such materials governed by their respective terms. In the event of conflict between the terms of this Agreement and an applicable open source or third party agreement, the open source or third party agreement will control solely with respect to the open source software or third party software. Moreover, You shall not subject any items (including not limited to source code, object code, and any software) included in the SDK to any open source license.
48
+ 10. NON-BLOCKING OF REALSEE DEVELOPMENT.
49
+ You acknowledge that Realsee is currently developing or may develop technologies and products in the future that have or may have design and/or functionality similar to Integrated Product that You may develop based on Your license herein. Nothing in this Agreement shall impair, limit or curtail Realsee's right to continue with its development, maintenance and/or distribution of Realsee's technology or products.
50
+ 11. GENERAL.
51
+ 11.1 Export Control. You may not use or otherwise export or re-export the SDK (or any part thereof) except as authorized by United States law and the laws of the jurisdiction(s) in which the SDK (or any part thereof) was obtained. In particular, but without limitation, the SDK may not be exported or re-exported (i) into any U.S. embargoed countries or (ii) to anyone on the U.S. Treasury Department's list of Specially Designated Nationals or the U.S. Department of Commerce Denied Person's List or Entity List. By using the SDK (or any part thereof), You represent and warrant that You are not located in any such country or on any such list.
52
+ 11.2 Governing Law. This Agreement and the rights of the parties hereunder shall be governed by and construed in accordance with the laws of People’s Republic of China (for purpose of this Agreement, excluding Hong Kong, Taiwan, and Macau), without reference to its conflict of laws principles. Any dispute, controversy or claim arising from or in connection with this Agreement, or the breach, termination or invalidity thereof, shall be submitted to China International Economic and Trade Arbitration Commission (“CIETAC”) for arbitration in Beijing which shall be conducted in accordance with the CIETAC's arbitration rules in effect at the time of applying for arbitration. The arbitral award is final and binding upon both parties.
53
+ 11.3 Severability. If any provision of this Agreement is held by a court of competent jurisdiction to be unenforceable for any reason, the remaining provisions hereof will be unaffected and remain in full force and effect.
54
+ 11.4. Modifications. Realsee reserves the right, from time to time, with or without notice to You, to make revisions to this Agreement in our sole and absolute discretion. The most current version of this Agreement will supersede all previous versions and shall be made available on the website where the SDK is made available, or by such other means as Realsee may determine in its discretion. Any modified versions of this Agreement hereto shall take effect from the time that it is made available. You shall be responsible for regularly checking for notice of any such modifications. You agree that Your continued use of the SDK constitutes Your agreement to the modified Agreement.
55
+ 11.5 Relationship of the Parties. This Agreement will not be construed as creating an agency, partnership, joint venture, fiduciary duty, or any other form of legal association between You and Realsee, and You will not represent to the contrary, whether expressly, by implication, appearance, or otherwise.
56
+ 11.6 Entire Agreement; Governing Language. This Agreement constitutes the entire agreement between You and Realsee with respect to the use of the SDK licensed hereunder and supersedes all prior understandings regarding such subject matter. No amendment to or modification of this Agreement will be binding unless in writing and signed by Realsee. You and Realsee hereto confirm that this Agreement and all related documents shall be drafted in English.
@@ -0,0 +1,49 @@
1
+ import type { FivePlugin } from '@realsee/five';
2
+ import type { Vector3Position } from '../typings/math.type';
3
+ import { Vector3 } from 'three';
4
+ import { CSS3DObject } from 'three/examples/jsm/renderers/CSS3DRenderer';
5
+ export declare type CSS3DRenderPluginParameterType = undefined;
6
+ export interface CSS3DRenderPluginExportType {
7
+ /**
8
+ * @description: 根据传入的四个点位创建一个3d dom容器,可以通过ReactDom.render()的方式将react组件放到容器中
9
+ * @param {Five} five
10
+ * @param {Vector3[] | Vector3Position[]} points: 矩形四个点坐标
11
+ * @param {number} config.ratio: 1px对应多少米,默认为 0.002,即1px对应2mm
12
+ * @param {number} config.dpr: dpr, 默认为1
13
+ * @param {HTMLElement} config.container: HTMLElement
14
+ * @param {number} config.autoRender: 默认为true,如果需要手动render则传false
15
+ * @param {'front' | 'behind'} config.mode: 两种模式
16
+ * @param {HTMLElement} config.behindFiveContainer: 如果config.mode为'behind',需要传入容器,并确保此容器位five下方,且中间没有其他dom元素遮挡
17
+ * @return {{ container: HTMLElement; dispose: () => void }}: container: dom容器, dispose: 清理函数
18
+ */
19
+ create3DDomContainer: (points: Vector3[] | Vector3Position[], config?: {
20
+ ratio?: number;
21
+ dpr?: number;
22
+ autoRender?: boolean;
23
+ container?: HTMLElement;
24
+ [key: string]: any;
25
+ } & ({
26
+ mode?: 'front';
27
+ } | {
28
+ mode: 'behind';
29
+ behindFiveContainer: HTMLElement;
30
+ })) => {
31
+ container: HTMLElement;
32
+ dispose: () => void;
33
+ css3DObject: CSS3DObject;
34
+ render?: () => void;
35
+ } | void;
36
+ /**
37
+ * @description: 销毁所有的渲染内容
38
+ * @return {void}
39
+ */
40
+ disposeAll: () => void;
41
+ }
42
+ /**
43
+ * **CSS3DRenderPlugin** 提供矩形区域(三维空间四个坐标点),你可以在此矩形区域中渲染 DOM 内容。
44
+ * 实现原理参考[CSS3DRenderer](https://threejs.org/docs/index.html?q=CSS3D#examples/en/renderers/CSS3DRenderer)。
45
+ *
46
+ * @returns
47
+ */
48
+ export declare const CSS3DRenderPlugin: FivePlugin<CSS3DRenderPluginParameterType, CSS3DRenderPluginExportType>;
49
+ export default CSS3DRenderPlugin;
@@ -0,0 +1,234 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var THREE = require('three');
6
+ var CSS3DRenderer = require('three/examples/jsm/renderers/CSS3DRenderer');
7
+
8
+ function _interopNamespace(e) {
9
+ if (e && e.__esModule) return e;
10
+ var n = Object.create(null);
11
+ if (e) {
12
+ Object.keys(e).forEach(function (k) {
13
+ if (k !== 'default') {
14
+ var d = Object.getOwnPropertyDescriptor(e, k);
15
+ Object.defineProperty(n, k, d.get ? d : {
16
+ enumerable: true,
17
+ get: function () { return e[k]; }
18
+ });
19
+ }
20
+ });
21
+ }
22
+ n["default"] = e;
23
+ return Object.freeze(n);
24
+ }
25
+
26
+ var THREE__namespace = /*#__PURE__*/_interopNamespace(THREE);
27
+
28
+ function evenNumber(num, config) {
29
+ const roundNum = Math.round(num);
30
+ return roundNum % 2 === 0 ? roundNum : roundNum + Number((config === null || config === void 0 ? void 0 : config.smaller) ? -1 : 1);
31
+ }
32
+
33
+ function centerPoint(point1, point2) {
34
+ return new THREE.Vector3((point1.x + point2.x) / 2, (point1.y + point2.y) / 2, (point1.z + point2.z) / 2);
35
+ }
36
+
37
+ const transformPositionToVector3 = ({ x, y, z }) => new THREE.Vector3(x, y, z);
38
+
39
+ /**
40
+ * @description: 究极简陋的 ResizeObserver polyfill
41
+ */
42
+ function createResizeObserver(func, element) {
43
+ if (!element || typeof ResizeObserver === 'undefined') {
44
+ return {
45
+ observe: () => window.addEventListener('resize', func),
46
+ unobserve: () => window.removeEventListener('resize', func),
47
+ };
48
+ }
49
+ else {
50
+ const observer = new ResizeObserver(func);
51
+ return {
52
+ observe: () => observer.observe(element),
53
+ unobserve: () => observer.unobserve(element),
54
+ };
55
+ }
56
+ }
57
+
58
+ /**
59
+ * **CSS3DRenderPlugin** 提供矩形区域(三维空间四个坐标点),你可以在此矩形区域中渲染 DOM 内容。
60
+ * 实现原理参考[CSS3DRenderer](https://threejs.org/docs/index.html?q=CSS3D#examples/en/renderers/CSS3DRenderer)。
61
+ *
62
+ * @returns
63
+ */
64
+ const CSS3DRenderPlugin = (five) => {
65
+ const state = { disposeCallbacks: [] };
66
+ const create3DDomContainer = (...params) => {
67
+ var _a, _b, _c;
68
+ const points = params[0].map((point) => (point instanceof THREE.Vector3 ? point : transformPositionToVector3(point)));
69
+ const config = params[1];
70
+ if ((points === null || points === void 0 ? void 0 : points.length) < 4)
71
+ return console.error('points must be equal or greater than than 4');
72
+ if (!((_a = five === null || five === void 0 ? void 0 : five.model) === null || _a === void 0 ? void 0 : _a.loaded))
73
+ return console.error('five.model.loaded is: ', (_b = five === null || five === void 0 ? void 0 : five.model) === null || _b === void 0 ? void 0 : _b.loaded);
74
+ const fiveElement = five.getElement();
75
+ if (!fiveElement)
76
+ return console.error('five.getElement() is ' + fiveElement);
77
+ const disposers = [];
78
+ const ratio = (config === null || config === void 0 ? void 0 : config.ratio) || 0.00216;
79
+ if (ratio <= 0.00215)
80
+ console.warn('if you need click css3DElement on safari, ratio must be greater than 0.00215');
81
+ const dpr = (config === null || config === void 0 ? void 0 : config.dpr) || 1;
82
+ const mode = (config === null || config === void 0 ? void 0 : config.mode) || 'front';
83
+ const autoRender = (_c = config === null || config === void 0 ? void 0 : config.autoRender) !== null && _c !== void 0 ? _c : true;
84
+ const behindFiveContainer = (config === null || config === void 0 ? void 0 : config.behindFiveContainer) || fiveElement.parentElement || document.body;
85
+ const container = (config === null || config === void 0 ? void 0 : config.container) || document.createElement('div');
86
+ container.classList.add('__Dnalogel-plugin--CSS3DRenderPlugin');
87
+ // 获取css3DObject, 如果mode为behind的话,一起获取mesh
88
+ const { css3DObject, mesh } = createObject(points, { ratio, dpr, container, mode });
89
+ // ======= INIT START =======
90
+ let resizeObserver;
91
+ const frontModeUnInited = mode === 'front' && !state.frontMode;
92
+ const behindModeUnInited = mode === 'behind' && !state.behindMode;
93
+ const inited = !(frontModeUnInited || behindModeUnInited);
94
+ if (behindModeUnInited) {
95
+ state.behindMode = { scene: new THREE.Scene(), css3DRenderer: new CSS3DRenderer.CSS3DRenderer() };
96
+ }
97
+ if (frontModeUnInited) {
98
+ state.frontMode = { scene: new THREE.Scene(), css3DRenderer: new CSS3DRenderer.CSS3DRenderer() };
99
+ }
100
+ const stateMode = mode === 'behind' ? state.behindMode : state.frontMode;
101
+ const { scene, css3DRenderer } = stateMode;
102
+ const render = (() => {
103
+ if (!inited) {
104
+ const css3DRendererSetSize = () => {
105
+ // 这里evenNumber策略是遇到奇数会加1,不知道为啥会触发滚动条显示,导致fiveElement变小,fiveElement变小又触发了这里的resize,宽高变小,滚动条消失,然后又触发resize。。。无限循环
106
+ // 为了规避上面这种情况,evenNumber设置了一个参数,遇到奇数可选择减一
107
+ const rendererWidth = evenNumber(fiveElement.clientWidth, { smaller: true });
108
+ const rendererHeight = evenNumber(fiveElement.clientHeight, { smaller: true });
109
+ css3DRenderer.setSize(rendererWidth, rendererHeight);
110
+ };
111
+ css3DRendererSetSize();
112
+ resizeObserver = createResizeObserver(css3DRendererSetSize, fiveElement);
113
+ css3DRenderer.domElement.style.position = 'absolute';
114
+ css3DRenderer.domElement.style.top = '0';
115
+ css3DRenderer.domElement.style.userSelect = 'none';
116
+ css3DRenderer.domElement.style.pointerEvents = 'none';
117
+ const renderEveryFrame = () => {
118
+ const requestAnimationFrameId = requestAnimationFrame(renderEveryFrame);
119
+ stateMode.requestAnimationFrameId = requestAnimationFrameId;
120
+ css3DRenderer.render(scene, five.camera);
121
+ };
122
+ return () => {
123
+ var _a;
124
+ scene.add(css3DObject);
125
+ (_a = resizeObserver === null || resizeObserver === void 0 ? void 0 : resizeObserver.observe) === null || _a === void 0 ? void 0 : _a.call(resizeObserver);
126
+ renderEveryFrame();
127
+ if (mode === 'behind' && mesh) {
128
+ five.scene.add(mesh);
129
+ disposers.push(() => mesh && five.scene.remove(mesh));
130
+ }
131
+ };
132
+ }
133
+ else {
134
+ return () => {
135
+ scene.add(css3DObject);
136
+ };
137
+ }
138
+ })();
139
+ if (frontModeUnInited) {
140
+ const wrapper = fiveElement.parentElement || document.body;
141
+ wrapper.appendChild(css3DRenderer.domElement);
142
+ }
143
+ if (behindModeUnInited) {
144
+ const wrapper = behindFiveContainer;
145
+ wrapper.appendChild(css3DRenderer.domElement);
146
+ }
147
+ // ======= INIT END =======
148
+ const dispose = () => {
149
+ var _a;
150
+ disposers.forEach((d) => d === null || d === void 0 ? void 0 : d());
151
+ scene.remove(css3DObject);
152
+ if (scene.children.length === 0) {
153
+ if (typeof stateMode.requestAnimationFrameId === 'number') {
154
+ cancelAnimationFrame(stateMode.requestAnimationFrameId);
155
+ }
156
+ css3DRenderer.domElement.remove();
157
+ if (mode === 'front')
158
+ state.frontMode = undefined;
159
+ if (mode === 'behind')
160
+ state.behindMode = undefined;
161
+ if (!state.behindMode && !state.frontMode) {
162
+ (_a = resizeObserver === null || resizeObserver === void 0 ? void 0 : resizeObserver.unobserve) === null || _a === void 0 ? void 0 : _a.call(resizeObserver);
163
+ }
164
+ }
165
+ return true;
166
+ };
167
+ const idx = state.disposeCallbacks.findIndex((item) => item === dispose);
168
+ if (idx !== -1) {
169
+ state.disposeCallbacks.splice(idx, 1);
170
+ }
171
+ else {
172
+ state.disposeCallbacks.push(dispose);
173
+ }
174
+ if (autoRender)
175
+ render();
176
+ return { container, dispose, css3DObject, render: autoRender ? undefined : render };
177
+ };
178
+ const createObject = (points, config) => {
179
+ const { ratio, dpr, container: element, mode } = config;
180
+ const planeWidth = points[0].distanceTo(points[1]);
181
+ const planeHeight = points[1].distanceTo(points[2]);
182
+ const domWidthPx = evenNumber((planeWidth / ratio) * dpr);
183
+ const domHeightPx = evenNumber((planeHeight / ratio) * dpr);
184
+ const css3DObject = new CSS3DRenderer.CSS3DObject(element);
185
+ css3DObject.scale.set(ratio, ratio, ratio);
186
+ element.style.width = domWidthPx + 'px';
187
+ element.style.height = domHeightPx + 'px';
188
+ element.style.pointerEvents = 'none';
189
+ const centerPosition = centerPoint(points[0], points[2]);
190
+ const vector01 = points[1].clone().sub(points[0]); // 点0 -> 点1 的向量
191
+ const vector12 = points[2].clone().sub(points[1]); // 点1 -> 点2 的向量
192
+ // 旋转
193
+ const rotateXAngle = new THREE.Vector3(0, 1, 0).angleTo(new THREE.Vector3(0, vector12.y, vector12.z));
194
+ const rotateYAngle = new THREE.Vector3(1, 0, 0).angleTo(new THREE.Vector3(vector01.x, 0, vector01.z));
195
+ const rotateZAngle = vector01.angleTo(new THREE.Vector3(vector01.x, 0, vector01.z));
196
+ /**
197
+ * [0,1,0] => [0,0,1] 为rotate Worldx正方向
198
+ * [0,0,1] => [0,1,0] 为rotate Worldy正方向
199
+ * [0,1,1] => [-1,0,0] 为rotate Worldz正方向
200
+ */
201
+ const rotateX = (vector12.z > 0 ? -1 : 1) * rotateXAngle;
202
+ const rotateY = (vector01.z < 0 ? 1 : -1) * rotateYAngle;
203
+ const rotateZ = ((vector01.x > 0 && vector01.y < 0) || (vector01.x < 0 && vector01.y > 0) ? -1 : 1) * rotateZAngle;
204
+ css3DObject.rotateOnWorldAxis(new THREE.Vector3(1, 0, 0), rotateX); // x
205
+ css3DObject.rotateOnWorldAxis(new THREE.Vector3(0, 1, 0), rotateY); // y
206
+ css3DObject.rotateOnWorldAxis(new THREE.Vector3(0, 0, 1), rotateZ); // z
207
+ css3DObject.position.set(centerPosition.x, centerPosition.y, centerPosition.z);
208
+ let mesh;
209
+ if (mode === 'behind') {
210
+ const material = new THREE__namespace.MeshBasicMaterial({
211
+ opacity: 0,
212
+ transparent: false,
213
+ side: THREE__namespace.DoubleSide,
214
+ });
215
+ const geometry = new THREE__namespace.PlaneGeometry(domWidthPx, domHeightPx);
216
+ mesh = new THREE__namespace.Mesh(geometry, material);
217
+ mesh.name = 'CSS3DRenderPlugin-mesh';
218
+ mesh.position.copy(css3DObject.position);
219
+ mesh.rotation.copy(css3DObject.rotation);
220
+ mesh.scale.copy(css3DObject.scale);
221
+ }
222
+ return { css3DObject, mesh };
223
+ };
224
+ return {
225
+ create3DDomContainer,
226
+ disposeAll: () => {
227
+ state.disposeCallbacks.forEach((d) => d === null || d === void 0 ? void 0 : d());
228
+ state.disposeCallbacks = [];
229
+ },
230
+ };
231
+ };
232
+
233
+ exports.CSS3DRenderPlugin = CSS3DRenderPlugin;
234
+ exports["default"] = CSS3DRenderPlugin;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @description: 究极简陋的 ResizeObserver polyfill
3
+ */
4
+ export default function createResizeObserver(func: () => any, element?: HTMLElement): {
5
+ observe: () => void;
6
+ unobserve: () => void;
7
+ };
@@ -0,0 +1,7 @@
1
+ import type { FivePlugin } from '@realsee/five';
2
+ import { CameraMovementPluginExportType, CameraMovementPluginParameterType } from './typing';
3
+ /**
4
+ * **运镜插件** 模拟类似于电影运镜效果。
5
+ */
6
+ export declare const CameraMovementPlugin: FivePlugin<CameraMovementPluginParameterType, CameraMovementPluginExportType>;
7
+ export default CameraMovementPlugin;