@realsee/dnalogel 0.1.3 → 0.1.7-alpha.10

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 (301) hide show
  1. package/components/ARVideoFigure/ARVideoFigureMesh.js +56 -32
  2. package/components/ARVideoFigure/ARVideoFigureScene.js +30 -19
  3. package/components/ARVideoFigure/ImgBgTransparent.js +22 -6
  4. package/components/ARVideoFigure/ImgBgTransparentMesh.js +40 -30
  5. package/components/ARVideoFigure/fragmentShader.js +2 -0
  6. package/components/ARVideoFigure/index.js +22 -6
  7. package/components/ARVideoFigure/vertexShader.js +2 -0
  8. package/components/GLTFView/index.d.ts +123 -0
  9. package/components/GLTFView/index.js +204 -0
  10. package/components/GlassFilters/index.js +25 -1
  11. package/components/ModelView/ModelViewController.js +39 -29
  12. package/components/ModelView/index.js +4 -2
  13. package/components/PaintBrush/index.js +15 -1
  14. package/components/PanoTag/index.js +2 -0
  15. package/data/1aGKl9JmrlXMXx8d.js +2 -0
  16. package/data/54djM0oR6ky3Ey8e.d.ts +55 -0
  17. package/data/54djM0oR6ky3Ey8e.js +350 -0
  18. package/data/6gyq3v1verxD7JO1.js +2 -0
  19. package/data/8054djM0oR6ky3Ey8e.d.ts +55 -0
  20. package/data/8054djM0oR6ky3Ey8e.js +350 -0
  21. package/data/81zxMaeVKLQU93OZMG.d.ts +49 -0
  22. package/data/81zxMaeVKLQU93OZMG.js +633 -0
  23. package/data/KpokNd82rwjhackhQTBEoYKHg8zGbPXe.js +2 -0
  24. package/data/PrXel3aqGbp34JQn.js +141 -1
  25. package/data/XJ6NMLWnkAY3Rdx8.js +2 -0
  26. package/data/YdoNP9K4rwQDwjJr.js +2 -0
  27. package/data/ZLvK29zj4L29Jowd.d.ts +55 -0
  28. package/data/ZLvK29zj4L29Jowd.js +372 -0
  29. package/data/_vLykj3NWrllMrG06.d.ts +95 -0
  30. package/data/_vLykj3NWrllMrG06.js +1 -0
  31. package/data/auto3d-njL5J99VwCmnjtQElOmXQr.js +2 -0
  32. package/data/extrude-walls/ZLvK29zj4L29Jowd.d.ts +5 -0
  33. package/data/extrude-walls/ZLvK29zj4L29Jowd.js +14 -0
  34. package/data/extrude-walls/lo024DEgzanMj5BE.d.ts +5 -0
  35. package/data/extrude-walls/lo024DEgzanMj5BE.js +14 -0
  36. package/data/jd6oMOzPxnQ3BvxY_B7yw51J9rXlhYhjhGTOgRVqu6WeEqjNX.js +2 -0
  37. package/data/lo024DEgzanMj5BE.d.ts +55 -0
  38. package/data/lo024DEgzanMj5BE.js +966 -0
  39. package/data/oPzy3ApbjjpD8YdR.js +2 -0
  40. package/data/qjAxMG4XbPn96wKG.js +2 -0
  41. package/data/rXel3aPQRRBD4JQn.js +2 -0
  42. package/data/vLykj3NWrllMrG06.js +337 -71
  43. package/data/wz0QV9KA4ugyo9ME.js +2 -0
  44. package/data/zxMawr9raSg8LYjG.js +2 -0
  45. package/examples/FiveStateController/index.js +9 -15
  46. package/examples/VRHouse/Mobile.js +15 -1
  47. package/examples/VRHouse/PC.js +15 -1
  48. package/examples/VRHouse/index.js +15 -1
  49. package/index.js +4 -2
  50. package/libs/gltf-viewer/Subscribe.d.ts +76 -0
  51. package/libs/gltf-viewer/Subscribe.js +231 -0
  52. package/libs/gltf-viewer/coordsMoveByOffset.d.ts +13 -0
  53. package/libs/gltf-viewer/coordsMoveByOffset.js +22 -0
  54. package/libs/gltf-viewer/coordsToDirection.d.ts +5 -0
  55. package/{components/PBRView/index.js → libs/gltf-viewer/coordsToDirection.js} +29 -19
  56. package/libs/gltf-viewer/formatRad.d.ts +1 -0
  57. package/libs/gltf-viewer/formatRad.js +13 -0
  58. package/libs/gltf-viewer/getFrameTime.d.ts +1 -0
  59. package/libs/gltf-viewer/getFrameTime.js +28 -0
  60. package/libs/gltf-viewer/index.d.ts +79 -0
  61. package/libs/gltf-viewer/index.js +765 -0
  62. package/libs/gltf-viewer/mouseWheel.d.ts +2 -0
  63. package/libs/gltf-viewer/mouseWheel.js +59 -0
  64. package/libs/gltf-viewer/requestAnimationFrame.d.ts +1 -0
  65. package/libs/gltf-viewer/requestAnimationFrame.js +18 -0
  66. package/libs/gltf-viewer/requestAnimationFrameInterval.d.ts +1 -0
  67. package/libs/gltf-viewer/requestAnimationFrameInterval.js +31 -0
  68. package/libs/gltf-viewer/uuid.d.ts +4 -0
  69. package/libs/gltf-viewer/uuid.js +28 -0
  70. package/package.json +8 -4
  71. package/plugins/AutoPreloadPlugin/index.js +26 -0
  72. package/plugins/CSS3DRenderPlugin/components/Marker/index.js +24 -16
  73. package/plugins/CSS3DRenderPlugin/index.js +45 -12
  74. package/plugins/CSS3DRenderPlugin/utils/createResizeObserver.d.ts +7 -0
  75. package/plugins/CSS3DRenderPlugin/utils/createResizeObserver.js +34 -0
  76. package/plugins/CameraMovementPlugin/index.js +33 -9
  77. package/plugins/CameraMovementPlugin/typing.js +2 -0
  78. package/plugins/ModelChassisCompassPlugin/index.d.ts +1 -1
  79. package/plugins/ModelChassisCompassPlugin/index.js +25 -10
  80. package/plugins/ModelEntryDoorGuidePlugin/index.d.ts +6 -2
  81. package/plugins/ModelEntryDoorGuidePlugin/index.js +55 -28
  82. package/plugins/ModelExtrudeWallsPlugin/index.d.ts +16 -0
  83. package/plugins/ModelExtrudeWallsPlugin/index.js +252 -0
  84. package/plugins/ModelRoomLabelPlugin/Controller.js +30 -23
  85. package/plugins/ModelRoomLabelPlugin/RoomLabelItem.js +26 -8
  86. package/plugins/ModelRoomLabelPlugin/RoomLabelItems.js +35 -25
  87. package/plugins/ModelRoomLabelPlugin/index.d.ts +4 -0
  88. package/plugins/ModelRoomLabelPlugin/index.js +9 -2
  89. package/plugins/ModelRoomLabelPlugin/typings.js +2 -0
  90. package/plugins/ModelRoomLabelPlugin/utils/parseData.js +6 -0
  91. package/plugins/ModelTVVideoPlugin/index.js +100 -16
  92. package/plugins/ModelViewPlugin/index.js +25 -1
  93. package/plugins/PanoCursorRaycasterPlugin/components/MovePointTowardsCamera.js +29 -25
  94. package/plugins/PanoCursorRaycasterPlugin/components/PointAxesHelper.js +15 -1
  95. package/plugins/PanoCursorRaycasterPlugin/index.js +13 -6
  96. package/plugins/PanoCursorRaycasterPlugin/utils/addLineToFive.js +4 -2
  97. package/plugins/PanoCursorRaycasterPlugin/utils/createLine.js +15 -1
  98. package/plugins/PanoDoorLabelPlugin/index.js +2 -0
  99. package/plugins/PanoIRobotPlugin/index.js +2 -0
  100. package/plugins/PanoMaskSelectorPlugin/compare.js +2 -0
  101. package/plugins/PanoMaskSelectorPlugin/createBox.js +22 -1
  102. package/plugins/PanoMaskSelectorPlugin/createTextures.js +17 -1
  103. package/plugins/PanoMaskSelectorPlugin/fragmentShader.js +2 -0
  104. package/plugins/PanoMaskSelectorPlugin/index.js +106 -18
  105. package/plugins/PanoMaskSelectorPlugin/vertexShader.js +2 -0
  106. package/plugins/PanoMeasurePlugin/Controller/BaseController.d.ts +36 -0
  107. package/plugins/PanoMeasurePlugin/Controller/BaseController.js +103 -0
  108. package/plugins/PanoMeasurePlugin/Controller/EditController.d.ts +52 -0
  109. package/plugins/PanoMeasurePlugin/Controller/EditController.js +341 -0
  110. package/plugins/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +12 -0
  111. package/plugins/PanoMeasurePlugin/Controller/ShortcutKeyController.js +69 -0
  112. package/plugins/PanoMeasurePlugin/Controller/WatchController.d.ts +25 -0
  113. package/plugins/PanoMeasurePlugin/Controller/WatchController.js +371 -0
  114. package/plugins/PanoMeasurePlugin/Controller/index.d.ts +61 -0
  115. package/plugins/PanoMeasurePlugin/Controller/index.js +230 -0
  116. package/plugins/PanoMeasurePlugin/Model/index.d.ts +38 -0
  117. package/plugins/PanoMeasurePlugin/Model/index.js +235 -0
  118. package/plugins/PanoMeasurePlugin/Model/line.d.ts +30 -0
  119. package/plugins/PanoMeasurePlugin/Model/line.js +121 -0
  120. package/plugins/PanoMeasurePlugin/Model/point.d.ts +16 -0
  121. package/plugins/PanoMeasurePlugin/Model/point.js +68 -0
  122. package/plugins/PanoMeasurePlugin/Model/polyline.d.ts +16 -0
  123. package/plugins/PanoMeasurePlugin/Model/polyline.js +109 -0
  124. package/plugins/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.d.ts +2 -0
  125. package/plugins/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.js +11 -0
  126. package/plugins/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.d.ts +2 -0
  127. package/plugins/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.js +11 -0
  128. package/plugins/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.d.ts +2 -0
  129. package/plugins/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.js +11 -0
  130. package/plugins/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +22 -0
  131. package/plugins/PanoMeasurePlugin/Modules/DeleteDom/index.js +182 -0
  132. package/plugins/PanoMeasurePlugin/Modules/FiveHelper.d.ts +11 -0
  133. package/plugins/PanoMeasurePlugin/Modules/FiveHelper.js +66 -0
  134. package/plugins/PanoMeasurePlugin/Modules/GuideController.d.ts +18 -0
  135. package/plugins/PanoMeasurePlugin/Modules/GuideController.js +107 -0
  136. package/plugins/PanoMeasurePlugin/Modules/Magnifier.d.ts +24 -0
  137. package/plugins/PanoMeasurePlugin/Modules/Magnifier.js +139 -0
  138. package/plugins/PanoMeasurePlugin/Modules/UIController/HTML.d.ts +6 -0
  139. package/plugins/PanoMeasurePlugin/Modules/UIController/HTML.js +26 -0
  140. package/plugins/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +18 -0
  141. package/plugins/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +169 -0
  142. package/plugins/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +12 -0
  143. package/plugins/PanoMeasurePlugin/Modules/UIController/Revoke/index.js +59 -0
  144. package/plugins/PanoMeasurePlugin/Modules/UIController/index.d.ts +16 -0
  145. package/plugins/PanoMeasurePlugin/Modules/UIController/index.js +123 -0
  146. package/plugins/PanoMeasurePlugin/Modules/UIController/style.d.ts +17 -0
  147. package/plugins/PanoMeasurePlugin/Modules/UIController/style.js +103 -0
  148. package/plugins/PanoMeasurePlugin/index.d.ts +7 -0
  149. package/plugins/PanoMeasurePlugin/index.js +20 -0
  150. package/plugins/PanoMeasurePlugin/typings/data.d.ts +28 -0
  151. package/plugins/PanoMeasurePlugin/typings/data.js +7 -0
  152. package/plugins/PanoMeasurePlugin/typings/event.type.d.ts +28 -0
  153. package/plugins/PanoMeasurePlugin/typings/event.type.js +7 -0
  154. package/plugins/PanoMeasurePlugin/typings/utils.type.d.ts +1 -0
  155. package/plugins/PanoMeasurePlugin/typings/utils.type.js +7 -0
  156. package/plugins/PanoMeasurePlugin/utils/clearGroup.d.ts +2 -0
  157. package/plugins/PanoMeasurePlugin/utils/clearGroup.js +16 -0
  158. package/plugins/PanoMeasurePlugin/utils/constants.d.ts +4 -0
  159. package/plugins/PanoMeasurePlugin/utils/constants.js +47 -0
  160. package/plugins/PanoMeasurePlugin/utils/distanceDom.d.ts +28 -0
  161. package/plugins/PanoMeasurePlugin/utils/distanceDom.js +147 -0
  162. package/plugins/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +2 -0
  163. package/plugins/PanoMeasurePlugin/utils/findAssociatedLines.js +37 -0
  164. package/plugins/PanoMeasurePlugin/utils/findClosestPoint.d.ts +10 -0
  165. package/plugins/PanoMeasurePlugin/utils/findClosestPoint.js +49 -0
  166. package/plugins/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +4 -0
  167. package/plugins/PanoMeasurePlugin/utils/getIntersectionFromEvent.js +20 -0
  168. package/plugins/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +10 -0
  169. package/plugins/PanoMeasurePlugin/utils/getPointFromHammerEvent.js +33 -0
  170. package/plugins/PanoMeasurePlugin/utils/ironbox.d.ts +1 -0
  171. package/plugins/PanoMeasurePlugin/utils/ironbox.js +14 -0
  172. package/plugins/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +2 -0
  173. package/plugins/PanoMeasurePlugin/utils/isNDCPointInScreen.js +16 -0
  174. package/plugins/PanoMeasurePlugin/utils/line.d.ts +17 -0
  175. package/plugins/PanoMeasurePlugin/utils/line.js +61 -0
  176. package/plugins/PanoMeasurePlugin/utils/math.d.ts +17 -0
  177. package/plugins/PanoMeasurePlugin/utils/math.js +57 -0
  178. package/plugins/PanoMeasurePlugin/utils/mouseGroup.d.ts +2 -0
  179. package/plugins/PanoMeasurePlugin/utils/mouseGroup.js +42 -0
  180. package/plugins/PanoMeasurePlugin/utils/ndc2Screen.d.ts +5 -0
  181. package/plugins/PanoMeasurePlugin/utils/ndc2Screen.js +16 -0
  182. package/plugins/PanoRulerPlugin/data/roomInfo.js +2 -0
  183. package/plugins/PanoRulerPlugin/data/roomRules.js +2 -0
  184. package/plugins/PanoRulerPlugin/index.d.ts +4 -0
  185. package/plugins/PanoRulerPlugin/index.js +74 -21
  186. package/plugins/PanoRulerPlugin/typings.js +2 -0
  187. package/plugins/PanoTVVideoPlugin/index.d.ts +2 -0
  188. package/plugins/PanoTVVideoPlugin/index.js +108 -26
  189. package/plugins/TreasurePlugin/Controller.js +58 -52
  190. package/plugins/TreasurePlugin/TreasureFaceAnime.js +36 -21
  191. package/plugins/TreasurePlugin/TreasureObject.js +60 -56
  192. package/plugins/TreasurePlugin/TreasureOpenAnime.js +38 -19
  193. package/plugins/TreasurePlugin/constants.js +2 -0
  194. package/plugins/TreasurePlugin/index.js +2 -0
  195. package/plugins/TreasurePlugin/typings.js +2 -0
  196. package/plugins/floorplan/Assets/floorplanExtraObject.d.ts +1 -1
  197. package/plugins/floorplan/Assets/floorplanExtraObject.js +5 -3
  198. package/plugins/floorplan/ModelFloorplanPlugin/Controller.d.ts +5 -2
  199. package/plugins/floorplan/ModelFloorplanPlugin/Controller.js +93 -99
  200. package/plugins/floorplan/ModelFloorplanPlugin/components/Camera.js +25 -7
  201. package/plugins/floorplan/ModelFloorplanPlugin/components/Compass.js +22 -8
  202. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomHighlight.js +28 -4
  203. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomLabels.js +25 -5
  204. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomMaterial.d.ts +11 -0
  205. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomMaterial.js +174 -0
  206. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RuleLabels.d.ts +8 -0
  207. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RuleLabels.js +178 -0
  208. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/index.d.ts +2 -0
  209. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/index.js +32 -6
  210. package/plugins/floorplan/ModelFloorplanPlugin/components/index.d.ts +3 -0
  211. package/plugins/floorplan/ModelFloorplanPlugin/components/index.js +30 -8
  212. package/plugins/floorplan/ModelFloorplanPlugin/controller.style.js +2 -0
  213. package/plugins/floorplan/ModelFloorplanPlugin/index.js +4 -2
  214. package/plugins/floorplan/ModelFloorplanPlugin/typings/events.type.js +2 -0
  215. package/plugins/floorplan/ModelFloorplanPlugin/typings/utility.d.ts +2 -0
  216. package/plugins/floorplan/ModelFloorplanPlugin/typings/utility.js +7 -0
  217. package/plugins/floorplan/ModelFloorplanPlugin/utils/constant.d.ts +1 -1
  218. package/plugins/floorplan/ModelFloorplanPlugin/utils/constant.js +3 -1
  219. package/plugins/floorplan/ModelFloorplanPlugin/utils/correctFiveState.js +14 -22
  220. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.js +26 -3
  221. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.style.js +10 -6
  222. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/ExtraObjects.js +21 -5
  223. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/RoomHighlight.js +28 -4
  224. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/index.js +22 -6
  225. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.js +29 -19
  226. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.style.js +2 -0
  227. package/plugins/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +1 -1
  228. package/plugins/floorplan/PanoFloorplanRadarPlugin/Controller.js +47 -50
  229. package/plugins/floorplan/PanoFloorplanRadarPlugin/index.js +4 -2
  230. package/plugins/floorplan/TopviewFloorplanPlugin/Controller.d.ts +3 -0
  231. package/plugins/floorplan/TopviewFloorplanPlugin/Controller.js +66 -61
  232. package/plugins/floorplan/TopviewFloorplanPlugin/index.js +2 -0
  233. package/plugins/floorplan/TopviewFloorplanPlugin/style.js +2 -0
  234. package/plugins/floorplan/components/FloorplanImage.js +15 -1
  235. package/plugins/floorplan/index.d.ts +4 -0
  236. package/plugins/floorplan/index.js +13 -0
  237. package/plugins/floorplan/typings/floorplanData.d.ts +2 -0
  238. package/plugins/floorplan/typings/floorplanData.js +2 -0
  239. package/plugins/floorplan/typings/floorplanServerData.d.ts +3 -1
  240. package/plugins/floorplan/typings/floorplanServerData.js +5 -3
  241. package/plugins/floorplan/utils/formatData.js +31 -12
  242. package/plugins/floorplan/utils/formatPosition.js +10 -8
  243. package/shared-utils/Preloader.js +6 -0
  244. package/shared-utils/Subscribe.js +36 -16
  245. package/shared-utils/animationFrame/BetterTween.js +28 -27
  246. package/shared-utils/animationFrame/calculateProgress.js +2 -0
  247. package/shared-utils/animationFrame/formatRad.js +2 -0
  248. package/shared-utils/animationFrame/index.js +12 -0
  249. package/shared-utils/animationFrame/tween.js +17 -1
  250. package/shared-utils/changeModelCanvasOpacity.d.ts +2 -0
  251. package/shared-utils/{changeModelCanvansOpacity.js → changeModelCanvasOpacity.js} +16 -2
  252. package/shared-utils/createCanvasTextTexture.js +2 -0
  253. package/shared-utils/createFiveContainer.js +23 -17
  254. package/shared-utils/createLine/index.js +15 -1
  255. package/shared-utils/debounce.js +4 -0
  256. package/shared-utils/equal.js +15 -4
  257. package/shared-utils/filter.js +36 -2
  258. package/shared-utils/five/changeMode.js +13 -17
  259. package/shared-utils/five/useFivePlugin.js +2 -0
  260. package/shared-utils/formatRad.js +2 -0
  261. package/shared-utils/getPxmm.js +15 -1
  262. package/shared-utils/getRandomColor.js +10 -0
  263. package/shared-utils/isNil.js +2 -0
  264. package/shared-utils/isTruelyObject.js +4 -0
  265. package/shared-utils/math/evenNumber.d.ts +3 -1
  266. package/shared-utils/math/evenNumber.js +6 -2
  267. package/shared-utils/math/planimetry.js +10 -0
  268. package/shared-utils/math/rad2Deg.js +2 -0
  269. package/shared-utils/nearlyEqual.js +2 -0
  270. package/shared-utils/nextFrame.js +2 -0
  271. package/shared-utils/noop.js +2 -0
  272. package/shared-utils/object3d2LocalMatrix.js +20 -14
  273. package/shared-utils/px2rem.js +10 -0
  274. package/shared-utils/removeArrayItem.d.ts +7 -0
  275. package/shared-utils/removeArrayItem.js +22 -0
  276. package/shared-utils/tap.js +2 -0
  277. package/shared-utils/three/centerPoint.js +2 -0
  278. package/shared-utils/three/getExtraModelLoader.js +14 -0
  279. package/shared-utils/three/getNormal.js +4 -0
  280. package/shared-utils/three/getTextureLoader.js +16 -0
  281. package/shared-utils/three/loadFbxObj.js +13 -5
  282. package/shared-utils/three/loadTexture.d.ts +2 -2
  283. package/shared-utils/three/loadTexture.js +33 -6
  284. package/shared-utils/three/transformPositionToVector3.js +2 -0
  285. package/shared-utils/three/transfromToMeshBasicMaterial.js +6 -0
  286. package/shared-utils/throttle.js +4 -0
  287. package/shared-utils/to.js +8 -4
  288. package/shared-utils/useDebounce.js +6 -0
  289. package/shared-utils/useThrottle.js +6 -0
  290. package/shared-utils/uuid.js +8 -0
  291. package/shared-utils/vectorTocoordinates.js +2 -0
  292. package/typedoc/components.js +2 -0
  293. package/typedoc/libs.d.ts +1 -0
  294. package/typedoc/libs.js +7 -0
  295. package/typedoc/plugins.js +2 -0
  296. package/typedoc/shared-utils.js +2 -0
  297. package/typedoc/typings.js +2 -0
  298. package/typings/math.type.js +2 -0
  299. package/typings/utils.type.js +2 -0
  300. package/components/PBRView/index.d.ts +0 -14
  301. package/shared-utils/changeModelCanvansOpacity.d.ts +0 -2
@@ -0,0 +1,765 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.reflect.construct.js");
4
+
5
+ require("core-js/modules/es.array.iterator.js");
6
+
7
+ require("core-js/modules/es.string.iterator.js");
8
+
9
+ require("core-js/modules/es.weak-map.js");
10
+
11
+ require("core-js/modules/web.dom-collections.iterator.js");
12
+
13
+ require("core-js/modules/es.object.define-property.js");
14
+
15
+ require("core-js/modules/es.object.get-own-property-descriptor.js");
16
+
17
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
18
+
19
+ var _typeof = require("@babel/runtime/helpers/typeof");
20
+
21
+ Object.defineProperty(exports, "__esModule", {
22
+ value: true
23
+ });
24
+ exports.GLTFViewer = void 0;
25
+
26
+ require("core-js/modules/es.object.assign.js");
27
+
28
+ require("core-js/modules/es.function.bind.js");
29
+
30
+ require("core-js/modules/web.timers.js");
31
+
32
+ require("core-js/modules/es.object.to-string.js");
33
+
34
+ require("core-js/modules/es.promise.js");
35
+
36
+ require("core-js/modules/es.date.to-string.js");
37
+
38
+ require("core-js/modules/es.regexp.to-string.js");
39
+
40
+ require("core-js/modules/es.number.constructor.js");
41
+
42
+ require("core-js/modules/es.array.concat.js");
43
+
44
+ var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
45
+
46
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
47
+
48
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
49
+
50
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
51
+
52
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
53
+
54
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
55
+
56
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
57
+
58
+ var THREE = _interopRequireWildcard(require("three"));
59
+
60
+ var _hammerjs = _interopRequireDefault(require("hammerjs"));
61
+
62
+ var _GLTFLoader = require("three/examples/jsm/loaders/GLTFLoader");
63
+
64
+ var _RGBELoader = require("three/examples/jsm/loaders/RGBELoader");
65
+
66
+ var _coordsMoveByOffset = require("./coordsMoveByOffset");
67
+
68
+ var _getFrameTime = require("./getFrameTime");
69
+
70
+ var _coordsToDirection = require("./coordsToDirection");
71
+
72
+ var _mouseWheel = require("./mouseWheel");
73
+
74
+ var _requestAnimationFrameInterval = require("./requestAnimationFrameInterval");
75
+
76
+ var _uuid = _interopRequireDefault(require("./uuid"));
77
+
78
+ var _Subscribe2 = require("./Subscribe");
79
+
80
+ var _formatRad = require("./formatRad");
81
+
82
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
83
+
84
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
85
+
86
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
87
+
88
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
89
+
90
+ var defaultPos = {
91
+ longitude: 0,
92
+ latitude: 0,
93
+ fov: 0
94
+ };
95
+ var ERROR_NO_CONTROLLER = 'GLTFViewer 实例丢失';
96
+ var loader = new _GLTFLoader.GLTFLoader();
97
+
98
+ var Controller = /*#__PURE__*/function () {
99
+ function Controller(config, callbacks) {
100
+ var _this = this;
101
+
102
+ (0, _classCallCheck2["default"])(this, Controller);
103
+ (0, _defineProperty2["default"])(this, "fov", 0);
104
+ (0, _defineProperty2["default"])(this, "longitude", 0);
105
+ (0, _defineProperty2["default"])(this, "latitude", 0);
106
+ (0, _defineProperty2["default"])(this, "needsRender", false);
107
+ this.config = Object.assign({
108
+ maxFov: 120,
109
+ minFov: 1,
110
+ logarithmicDepthBuffer: true
111
+ }, config); // 异步事件回调
112
+
113
+ this.callbacks = callbacks; // 默认状态参数
114
+
115
+ var initial = config.initial || {};
116
+
117
+ if (initial.fov !== undefined) {
118
+ this.fov = initial.fov;
119
+ }
120
+
121
+ if (initial.latitude !== undefined) {
122
+ this.latitude = initial.latitude;
123
+ }
124
+
125
+ if (initial.longitude !== undefined) {
126
+ this.longitude = initial.longitude;
127
+ } // 场景
128
+
129
+
130
+ this.scene = new THREE.Scene(); // 背景色值
131
+
132
+ if (config.backgroundColor) {
133
+ this.scene.background = config.backgroundColor;
134
+ } // 渲染器
135
+
136
+
137
+ this.renderer = new THREE.WebGLRenderer({
138
+ antialias: config.antialias,
139
+ alpha: true,
140
+ logarithmicDepthBuffer: config.logarithmicDepthBuffer
141
+ });
142
+ this.renderer.outputEncoding = THREE.sRGBEncoding;
143
+
144
+ if (config.toneMapping) {
145
+ var _config$toneMapping = config.toneMapping,
146
+ toneMapping = _config$toneMapping.toneMapping,
147
+ toneMappingExposure = _config$toneMapping.toneMappingExposure;
148
+ if (toneMapping) this.renderer.toneMapping = toneMapping;
149
+ if (toneMappingExposure !== undefined) this.renderer.toneMappingExposure = toneMappingExposure;
150
+ }
151
+
152
+ if (config.backgroundColor) {
153
+ this.renderer.setClearColor(config.backgroundColor, 0);
154
+ } // 像素比
155
+
156
+
157
+ if (config.pixelRatio) {
158
+ this.renderer.setPixelRatio(config.pixelRatio);
159
+ } // 相机
160
+
161
+
162
+ this.camera = new THREE.PerspectiveCamera(this.fov, 1, 0.1, 1500); // 光照
163
+
164
+ if (config.pointLight !== false) {
165
+ this.pointLight = config.pointLight || new THREE.PointLight(0xfffffff, 1, 1500);
166
+ this.scene.add(this.pointLight);
167
+ }
168
+
169
+ if (config.directionalLight !== false) {
170
+ this.directionLight = config.directionalLight || new THREE.DirectionalLight(0xfffffff, 0.1);
171
+ this.directionLight.position.setY(-1);
172
+ this.scene.add(this.directionLight);
173
+ }
174
+
175
+ if (config.ambientLight !== false) {
176
+ this.ambientLight = config.ambientLight || new THREE.AmbientLight(0xfffffff);
177
+ this.scene.add(this.ambientLight);
178
+ } // 背景 HDR
179
+
180
+
181
+ if (config.backgroundHDR) {
182
+ var pmremGenerator = new THREE.PMREMGenerator(this.renderer);
183
+ var rgbLoader = new _RGBELoader.RGBELoader();
184
+ rgbLoader.setDataType(THREE.UnsignedByteType);
185
+ rgbLoader.load(config.backgroundHDR, function (hdrEquirect) {
186
+ var hdrCubeRenderTarget = pmremGenerator.fromEquirectangular(hdrEquirect);
187
+ _this.scene.environment = hdrCubeRenderTarget.texture;
188
+
189
+ if (config.backgroundColor) {
190
+ _this.scene.background = hdrCubeRenderTarget.texture;
191
+ }
192
+
193
+ hdrEquirect.dispose();
194
+ pmremGenerator.dispose();
195
+ _this.needsRender = true;
196
+ });
197
+ pmremGenerator.compileEquirectangularShader();
198
+ }
199
+
200
+ this.__interiaMovement = false;
201
+ var hammerManager = new _hammerjs["default"].Manager(this.element);
202
+ hammerManager.add(new _hammerjs["default"].Pan({
203
+ threshold: 0,
204
+ pointers: 0
205
+ }));
206
+ hammerManager.add(new _hammerjs["default"].Pinch({
207
+ threshold: 0,
208
+ pointers: 2
209
+ }).recognizeWith(hammerManager.get('pan')));
210
+ hammerManager.on('panstart pan', this.__onPanGesture.bind(this));
211
+ hammerManager.on('pinchstart pinch pinchend', this.__onPinchGesture.bind(this));
212
+
213
+ var __onMouseWheel = this.__onMouseWheel.bind(this);
214
+
215
+ (0, _mouseWheel.addMouseWheel)(this.element, __onMouseWheel);
216
+
217
+ this.dispose = function () {
218
+ hammerManager.destroy();
219
+ (0, _mouseWheel.removeMouseWheel)(_this.element, __onMouseWheel);
220
+
221
+ _this.clear();
222
+
223
+ _this.renderer.dispose();
224
+ };
225
+
226
+ this.needsRender = true;
227
+ this.play();
228
+ }
229
+
230
+ (0, _createClass2["default"])(Controller, [{
231
+ key: "minFov",
232
+ get: function get() {
233
+ return this.config.minFov || 1;
234
+ }
235
+ }, {
236
+ key: "maxFov",
237
+ get: function get() {
238
+ return this.config.maxFov || 120;
239
+ }
240
+ }, {
241
+ key: "pause",
242
+ value: function pause() {// nothing todo
243
+ }
244
+ }, {
245
+ key: "clear",
246
+ value: function clear() {
247
+ if (this.target) {
248
+ this.scene.remove(this.target.scene);
249
+ this.update(defaultPos);
250
+ this.target = undefined;
251
+ }
252
+ }
253
+ }, {
254
+ key: "play",
255
+ value: function play() {
256
+ var _this2 = this;
257
+
258
+ this.pause();
259
+
260
+ var _render = function _render() {
261
+ if (_this2.needsRender !== false) _this2.render();
262
+ _this2.needsRender = false;
263
+ };
264
+
265
+ this.pause = (0, _requestAnimationFrameInterval.requestAnimationFrameInterval)(_render);
266
+
267
+ _render();
268
+ }
269
+ }, {
270
+ key: "setTarget",
271
+ value: function setTarget(object) {
272
+ var _this3 = this;
273
+
274
+ if (this.target) {
275
+ this.scene.remove(this.target.scene);
276
+ }
277
+
278
+ this.target = object;
279
+ this.target.scene.visible = false;
280
+ this.scene.add(this.target.scene);
281
+ setTimeout(function () {
282
+ if (object === _this3.target) {
283
+ _this3.target.scene.visible = true;
284
+
285
+ _this3.update({});
286
+
287
+ _this3.callbacks.loaded(object, _this3.scene, _this3.renderer);
288
+ }
289
+ }, 50);
290
+ }
291
+ }, {
292
+ key: "element",
293
+ get: function get() {
294
+ return this.renderer.domElement;
295
+ }
296
+ }, {
297
+ key: "appendTo",
298
+ value: function appendTo(container, size) {
299
+ container.appendChild(this.element);
300
+ this.refresh(size);
301
+ var positionType = window.getComputedStyle(container).position;
302
+
303
+ if (positionType !== 'relative' && positionType !== 'absolute' && positionType !== 'fixed' && positionType !== 'sticky') {
304
+ container.style.position = 'relative';
305
+ }
306
+ }
307
+ }, {
308
+ key: "refresh",
309
+ value: function refresh() {
310
+ var size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
311
+ var element = this.element;
312
+ var container = element.parentElement;
313
+ if (!container) return;
314
+
315
+ if (container && container.tagName && container.nodeName) {
316
+ var _size$width = size.width,
317
+ width = _size$width === void 0 ? container.offsetWidth : _size$width,
318
+ _size$height = size.height,
319
+ height = _size$height === void 0 ? container.offsetHeight : _size$height;
320
+ this.renderer.setSize(width, height); // 修改摄像机 aspect 比值
321
+
322
+ this.camera.aspect = width / height;
323
+ this.camera.updateProjectionMatrix();
324
+ }
325
+
326
+ this.needsRender = true;
327
+ }
328
+ }, {
329
+ key: "update",
330
+ value: function update(state) {
331
+ var fov = this.fov;
332
+ var longitude = this.longitude;
333
+ var latitude = this.latitude;
334
+
335
+ if (state.fov !== undefined) {
336
+ fov = state.fov;
337
+ }
338
+
339
+ if (state.longitude !== undefined) {
340
+ longitude = state.longitude;
341
+ }
342
+
343
+ if (state.latitude !== undefined) {
344
+ latitude = state.latitude;
345
+ }
346
+
347
+ if (!this.target || !this.target.scene) return;
348
+ var boxHelper = new THREE.BoxHelper(this.target.scene, 0x2bb8aa);
349
+
350
+ var _ref = boxHelper.geometry.boundingSphere || {},
351
+ center = _ref.center,
352
+ radius = _ref.radius;
353
+
354
+ if (!center || !radius) return;
355
+ var box = new THREE.Box3();
356
+ box.expandByObject(this.target.scene);
357
+ box.getCenter(center);
358
+ longitude = (0, _formatRad.formatRad)(longitude);
359
+ latitude = Math.max(-Math.PI / 2 + 0.01, Math.min(+Math.PI / 2, latitude)); // 距离
360
+
361
+ var distance = radius / Math.sin(Math.PI / 4) * 3;
362
+ {// debug
363
+ // const geometry = new THREE.SphereGeometry(radius, 32, 16)
364
+ // const material = new THREE.MeshBasicMaterial({ color: 0x0000aa, wireframe: true })
365
+ // const sphere = new THREE.Mesh(geometry, material)
366
+ // sphere.position.copy(center.clone())
367
+ // this.scene.add(sphere)
368
+ } // 朝向
369
+
370
+ var direction = (0, _coordsToDirection.coordsToDirection)({
371
+ longitude: longitude,
372
+ latitude: latitude
373
+ });
374
+ direction.setLength(distance);
375
+ this.camera.position.copy(center.clone().add(direction));
376
+ this.camera.lookAt(center);
377
+
378
+ if (this.pointLight) {
379
+ var lightDirection = (0, _coordsToDirection.coordsToDirection)({
380
+ longitude: longitude,
381
+ latitude: -Math.PI / 6
382
+ });
383
+ lightDirection.setLength(distance * 3);
384
+ this.pointLight.position.copy(center.clone().add(lightDirection));
385
+ }
386
+
387
+ var calcFov = function calcFov(distance, width, r) {
388
+ var vertical = r < 1 ? width / r : width;
389
+ var fov = Math.atan(vertical / distance / 2) * 2 * (180 / Math.PI);
390
+ return fov;
391
+ };
392
+
393
+ var d = this.camera.position.distanceTo(center);
394
+
395
+ if (fov === 0) {
396
+ fov = calcFov(d, radius * 2, this.renderer.domElement.offsetWidth / this.renderer.domElement.offsetHeight);
397
+ }
398
+
399
+ fov = Math.max(this.minFov, Math.min(this.maxFov, fov));
400
+
401
+ if (fov !== this.fov) {
402
+ this.camera.fov = fov;
403
+ this.camera.updateProjectionMatrix();
404
+ }
405
+
406
+ var needsRender = this.fov !== fov || this.longitude !== longitude || this.latitude !== latitude;
407
+ Object.assign(this, {
408
+ longitude: longitude,
409
+ latitude: latitude,
410
+ fov: fov
411
+ });
412
+ this.needsRender = true;
413
+
414
+ if (needsRender) {
415
+ this.callbacks.stateChange({
416
+ longitude: longitude,
417
+ latitude: latitude,
418
+ fov: fov
419
+ });
420
+ }
421
+ }
422
+ }, {
423
+ key: "__onPanGesture",
424
+ value: function __onPanGesture(event) {
425
+ var _this4 = this;
426
+
427
+ this.__interiaMovement = false;
428
+ var longitude = this.longitude,
429
+ latitude = this.latitude;
430
+ var center = event.center,
431
+ isFinal = event.isFinal,
432
+ velocityX = event.velocityX,
433
+ velocityY = event.velocityY,
434
+ pointers = event.pointers;
435
+
436
+ var offset = function () {
437
+ if (!(_this4.__lastPanPoint && _this4.__lastPanPoint.pointerLength === pointers.length)) {
438
+ return {
439
+ x: 0,
440
+ y: 0
441
+ };
442
+ }
443
+
444
+ return {
445
+ x: center.x - _this4.__lastPanPoint.x,
446
+ y: center.y - _this4.__lastPanPoint.y
447
+ };
448
+ }();
449
+
450
+ if (!isFinal) {
451
+ var layout = {
452
+ width: this.element.offsetWidth,
453
+ height: this.element.offsetHeight
454
+ };
455
+ this.update((0, _coordsMoveByOffset.coordsMoveByOffset)({
456
+ longitude: longitude,
457
+ latitude: latitude
458
+ }, offset, layout));
459
+ this.__lastPanPoint = {
460
+ pointerLength: pointers.length,
461
+ x: center.x,
462
+ y: center.y
463
+ };
464
+ } else {
465
+ delete this.__lastPanPoint;
466
+ (0, _getFrameTime.getFrameTime)(function (frameTime) {
467
+ _this4.__interiaMovement = true;
468
+ var x = velocityX * frameTime;
469
+ var y = velocityY * frameTime;
470
+ var distance = Math.sqrt(x * x + y * y);
471
+
472
+ if (distance > 100) {
473
+ x = x / distance * 100;
474
+ y = y / distance * 100;
475
+ } // 滑动小于上下15度, 忽略 y 值
476
+
477
+
478
+ if (Math.abs(y / x) < Math.tan(20 / 180 * Math.PI)) y = 0;
479
+
480
+ _this4.__requestInteriaMovement({
481
+ x: x,
482
+ y: y
483
+ });
484
+ });
485
+ }
486
+ }
487
+ }, {
488
+ key: "__onPinchGesture",
489
+ value: function __onPinchGesture(event) {
490
+ this.__interiaMovement = false;
491
+ var scale = event.scale,
492
+ type = event.type;
493
+
494
+ if (type === 'pinchstart') {
495
+ this.__pinchCurrentFov = this.fov;
496
+ return;
497
+ }
498
+
499
+ if (type === 'pinchend') {
500
+ this.__pinchCurrentFov = undefined;
501
+ return;
502
+ }
503
+
504
+ var fov = this.__pinchCurrentFov ? this.__pinchCurrentFov / scale : 1;
505
+ this.update({
506
+ fov: fov
507
+ });
508
+ }
509
+ }, {
510
+ key: "__requestInteriaMovement",
511
+ value: function __requestInteriaMovement(offset) {
512
+ var _this5 = this;
513
+
514
+ if (this.__interiaMovement === false) return;
515
+ var x = offset.x,
516
+ y = offset.y;
517
+ var longitude = this.longitude,
518
+ latitude = this.latitude;
519
+ var friction = 0.9;
520
+ var layout = {
521
+ width: this.element.offsetWidth,
522
+ height: this.element.offsetHeight
523
+ };
524
+ this.update((0, _coordsMoveByOffset.coordsMoveByOffset)({
525
+ longitude: longitude,
526
+ latitude: latitude
527
+ }, {
528
+ x: x,
529
+ y: y
530
+ }, layout));
531
+ var notFinal = Math.abs(x) > 1 || Math.abs(y) > 1;
532
+
533
+ if (notFinal) {
534
+ requestAnimationFrame(function () {
535
+ return _this5.__requestInteriaMovement({
536
+ x: x * friction,
537
+ y: y * friction * 0.7
538
+ });
539
+ });
540
+ } else {
541
+ this.__interiaMovement = false;
542
+ }
543
+ }
544
+ }, {
545
+ key: "__onMouseWheel",
546
+ value: function __onMouseWheel(event) {
547
+ this.__interiaMovement = false;
548
+ var fov = this.fov - event.delta;
549
+ this.update({
550
+ fov: fov <= 1 ? 1 : fov
551
+ });
552
+ }
553
+ }, {
554
+ key: "load",
555
+ value: function load(url) {
556
+ var _this6 = this;
557
+
558
+ return new Promise(function (resolve, reject) {
559
+ _this6.callbacks.willLoad();
560
+
561
+ loader.load(url, function (gltf) {
562
+ _this6.setTarget(gltf);
563
+
564
+ resolve(true);
565
+ }, function (xhr) {
566
+ _this6.callbacks.progressing(xhr.loaded / xhr.total * 100);
567
+ }, function (error) {
568
+ _this6.callbacks.loadError(error);
569
+
570
+ reject(error);
571
+ });
572
+ });
573
+ }
574
+ }, {
575
+ key: "render",
576
+ value: function render() {
577
+ this.renderer.render(this.scene, this.camera);
578
+ }
579
+ }]);
580
+ return Controller;
581
+ }();
582
+
583
+ var caches = {};
584
+
585
+ var GLTFViewer = /*#__PURE__*/function (_Subscribe) {
586
+ (0, _inherits2["default"])(GLTFViewer, _Subscribe);
587
+
588
+ var _super = _createSuper(GLTFViewer);
589
+
590
+ function GLTFViewer(config) {
591
+ var _this7;
592
+
593
+ (0, _classCallCheck2["default"])(this, GLTFViewer);
594
+ _this7 = _super.call(this);
595
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this7), "uuid", (0, _uuid["default"])());
596
+ var controller = new Controller(config, {
597
+ stateChange: function stateChange(state) {
598
+ return _this7.emit('stateChange', state);
599
+ },
600
+ progressing: function (_progressing) {
601
+ function progressing(_x) {
602
+ return _progressing.apply(this, arguments);
603
+ }
604
+
605
+ progressing.toString = function () {
606
+ return _progressing.toString();
607
+ };
608
+
609
+ return progressing;
610
+ }(function (progressing) {
611
+ return _this7.emit('progressing', progressing);
612
+ }),
613
+ willLoad: function willLoad() {
614
+ return _this7.emit('willLoad');
615
+ },
616
+ loaded: function loaded(gltf, scene, renderer) {
617
+ return _this7.emit('loaded', gltf, scene, renderer);
618
+ },
619
+ loadError: function loadError(error) {
620
+ return _this7.emit('loadError', error);
621
+ }
622
+ });
623
+ Object.assign(window, {
624
+ $controller: controller
625
+ });
626
+ caches[_this7.uuid] = controller;
627
+ return _this7;
628
+ }
629
+
630
+ (0, _createClass2["default"])(GLTFViewer, [{
631
+ key: "state",
632
+ get: function get() {
633
+ var controller = caches[this.uuid];
634
+ if (!controller) throw new Error(ERROR_NO_CONTROLLER);
635
+ var proxy = new Proxy({
636
+ fov: controller.fov,
637
+ latitude: controller.latitude,
638
+ longitude: controller.longitude
639
+ }, {
640
+ set: function set(obj, prop, value) {
641
+ if (prop === 'fov') {
642
+ if (Number(value) === NaN) {
643
+ throw new TypeError('The fov is not an number');
644
+ }
645
+
646
+ if (value > controller.maxFov || value < controller.minFov) {
647
+ throw new RangeError("The fov seems invalid~ fov: [".concat(controller.minFov, ", ").concat(controller.maxFov, "]"));
648
+ }
649
+ }
650
+
651
+ controller.update((0, _defineProperty2["default"])({}, prop, value));
652
+ return true;
653
+ },
654
+ get: function get(obj, prop) {
655
+ return controller[prop];
656
+ }
657
+ });
658
+ return proxy;
659
+ },
660
+ set: function set(_ref2) {
661
+ var fov = _ref2.fov,
662
+ latitude = _ref2.latitude,
663
+ longitude = _ref2.longitude;
664
+ var controller = caches[this.uuid];
665
+ if (!controller) throw new Error(ERROR_NO_CONTROLLER);
666
+ controller.update({
667
+ fov: fov === undefined ? controller.fov : fov,
668
+ latitude: latitude === undefined ? controller.latitude : latitude,
669
+ longitude: longitude === undefined ? controller.longitude : longitude
670
+ });
671
+ }
672
+ }, {
673
+ key: "minFov",
674
+ get: function get() {
675
+ var controller = caches[this.uuid];
676
+ if (!controller) throw new Error(ERROR_NO_CONTROLLER);
677
+ return controller.minFov;
678
+ },
679
+ set: function set(fov) {
680
+ var controller = caches[this.uuid];
681
+ if (!controller) throw new Error(ERROR_NO_CONTROLLER);
682
+ controller.config.minFov = fov;
683
+ controller.update({});
684
+ }
685
+ }, {
686
+ key: "maxFov",
687
+ get: function get() {
688
+ var controller = caches[this.uuid];
689
+ if (!controller) throw new Error(ERROR_NO_CONTROLLER);
690
+ return controller.maxFov;
691
+ }
692
+ /**
693
+ *
694
+ * @param url glTF 模型CDN地址
695
+ * @param options adaptive 是否开启自适应fov
696
+ */
697
+ ,
698
+ set: function set(fov) {
699
+ var controller = caches[this.uuid];
700
+ if (!controller) throw new Error(ERROR_NO_CONTROLLER);
701
+ controller.config.maxFov = fov;
702
+ controller.update({});
703
+ }
704
+ }, {
705
+ key: "load",
706
+ value: function load(url) {
707
+ var controller = caches[this.uuid];
708
+ if (!controller) throw new Error(ERROR_NO_CONTROLLER);
709
+ controller.load(url);
710
+ }
711
+ /**
712
+ * 挂载
713
+ * @param container
714
+ * @param size
715
+ */
716
+
717
+ }, {
718
+ key: "appendTo",
719
+ value: function appendTo(container, size) {
720
+ var controller = caches[this.uuid];
721
+ if (!controller) throw new Error(ERROR_NO_CONTROLLER);
722
+ controller.appendTo(container, size);
723
+ }
724
+ /**
725
+ * 刷新:如果传递宽高则以该宽高重新绘制;否则,以父容器的宽高重新绘制。
726
+ * @param size
727
+ */
728
+
729
+ }, {
730
+ key: "refresh",
731
+ value: function refresh(size) {
732
+ var controller = caches[this.uuid];
733
+ if (!controller) throw new Error(ERROR_NO_CONTROLLER);
734
+ controller.refresh(size);
735
+ }
736
+ /**
737
+ * 销毁
738
+ */
739
+
740
+ }, {
741
+ key: "dispose",
742
+ value: function dispose() {
743
+ var controller = caches[this.uuid];
744
+ if (!controller) throw new Error(ERROR_NO_CONTROLLER);
745
+ if (controller.dispose) controller.dispose();
746
+ delete caches[this.uuid];
747
+ }
748
+ /**
749
+ * 响应式fov
750
+ */
751
+
752
+ }, {
753
+ key: "fitFov",
754
+ value: function fitFov() {
755
+ var controller = caches[this.uuid];
756
+ if (!controller) throw new Error(ERROR_NO_CONTROLLER);
757
+ controller.update({
758
+ fov: 0
759
+ });
760
+ }
761
+ }]);
762
+ return GLTFViewer;
763
+ }(_Subscribe2.Subscribe);
764
+
765
+ exports.GLTFViewer = GLTFViewer;