@aibee/owlly 1.0.26 → 1.0.29

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 (359) hide show
  1. package/lib/external/lines/line-geometry.d.ts +9 -0
  2. package/lib/external/lines/line-geometry.js +51 -0
  3. package/lib/external/lines/line-material.d.ts +10 -0
  4. package/lib/external/lines/line-material.js +376 -0
  5. package/lib/external/lines/line-segments-2.d.ts +7 -0
  6. package/lib/external/lines/line-segments-2.js +143 -0
  7. package/lib/external/lines/line-segments-geometry.d.ts +15 -0
  8. package/lib/external/lines/line-segments-geometry.js +140 -0
  9. package/lib/external/loaders/gltf-loader.d.ts +77 -0
  10. package/lib/external/loaders/gltf-loader.js +2318 -0
  11. package/lib/external/orbit-controls.d.ts +44 -0
  12. package/lib/external/orbit-controls.js +745 -0
  13. package/lib/external/renderers/css-2d-renderer.d.ts +16 -0
  14. package/lib/external/renderers/css-2d-renderer.js +121 -0
  15. package/lib/external/renderers/css-3d-renderer.d.ts +18 -0
  16. package/lib/external/renderers/css-3d-renderer.js +138 -0
  17. package/lib/external/transform-controls.d.ts +106 -0
  18. package/lib/external/transform-controls.js +1112 -0
  19. package/lib/owlly/controller/aerial-element-controller.d.ts +65 -0
  20. package/lib/owlly/controller/aerial-element-controller.js +235 -0
  21. package/lib/owlly/controller/basic-controller.d.ts +324 -0
  22. package/lib/owlly/controller/basic-controller.js +1238 -0
  23. package/lib/owlly/controller/camera-controller.d.ts +37 -0
  24. package/lib/owlly/controller/camera-controller.js +137 -0
  25. package/lib/owlly/controller/controller.d.ts +61 -0
  26. package/lib/owlly/controller/controller.js +23 -0
  27. package/lib/owlly/controller/index.d.ts +2 -0
  28. package/lib/owlly/controller/index.js +13 -0
  29. package/lib/owlly/controller/mouse-indicator-controller.d.ts +34 -0
  30. package/lib/owlly/controller/mouse-indicator-controller.js +118 -0
  31. package/lib/owlly/controller/orbit-control.d.ts +147 -0
  32. package/lib/owlly/controller/orbit-control.js +264 -0
  33. package/lib/owlly/controller/panorama-adjust-controller.d.ts +45 -0
  34. package/lib/owlly/controller/panorama-adjust-controller.js +157 -0
  35. package/lib/owlly/controller/panorama-controller.d.ts +441 -0
  36. package/lib/owlly/controller/panorama-controller.js +1943 -0
  37. package/lib/owlly/controller/panorama-transform-controller.d.ts +66 -0
  38. package/lib/owlly/controller/panorama-transform-controller.js +136 -0
  39. package/lib/owlly/controller/plane-controller.d.ts +43 -0
  40. package/lib/owlly/controller/plane-controller.js +173 -0
  41. package/lib/owlly/controller/texture-controller.d.ts +181 -0
  42. package/lib/owlly/controller/texture-controller.js +875 -0
  43. package/lib/owlly/controller/tile-panorama-controller.d.ts +308 -0
  44. package/lib/owlly/controller/tile-panorama-controller.js +1353 -0
  45. package/lib/owlly/controller/transform-controller.d.ts +106 -0
  46. package/lib/owlly/controller/transform-controller.js +545 -0
  47. package/lib/owlly/element/bottom-nav-element.d.ts +65 -0
  48. package/lib/owlly/element/bottom-nav-element.js +257 -0
  49. package/lib/owlly/element/camera.d.ts +82 -0
  50. package/lib/owlly/element/camera.js +283 -0
  51. package/lib/owlly/element/dom-2d-element.d.ts +35 -0
  52. package/lib/owlly/element/dom-2d-element.js +48 -0
  53. package/lib/owlly/element/dom-3d-element.d.ts +27 -0
  54. package/lib/owlly/element/dom-3d-element.js +33 -0
  55. package/lib/owlly/element/dom-label-2d.d.ts +116 -0
  56. package/lib/owlly/element/dom-label-2d.js +382 -0
  57. package/lib/owlly/element/element.d.ts +53 -0
  58. package/lib/owlly/element/element.js +75 -0
  59. package/lib/owlly/element/floor-model.d.ts +83 -0
  60. package/lib/owlly/element/floor-model.js +227 -0
  61. package/lib/owlly/element/gif-kit/Gif.d.ts +96 -0
  62. package/lib/owlly/element/gif-kit/Gif.js +432 -0
  63. package/lib/owlly/element/gif-kit/GifColor.d.ts +21 -0
  64. package/lib/owlly/element/gif-kit/GifColor.js +37 -0
  65. package/lib/owlly/element/gif-kit/GifCompressedCodesToByteArrayConverter.d.ts +20 -0
  66. package/lib/owlly/element/gif-kit/GifCompressedCodesToByteArrayConverter.js +50 -0
  67. package/lib/owlly/element/gif-kit/GifFrame.d.ts +31 -0
  68. package/lib/owlly/element/gif-kit/GifFrame.js +96 -0
  69. package/lib/owlly/element/gif-kit/GifImage.d.ts +23 -0
  70. package/lib/owlly/element/gif-kit/GifImage.js +7 -0
  71. package/lib/owlly/element/gif-kit/GifParser.d.ts +17 -0
  72. package/lib/owlly/element/gif-kit/GifParser.js +196 -0
  73. package/lib/owlly/element/gif-kit/GifPresenter.d.ts +20 -0
  74. package/lib/owlly/element/gif-kit/GifPresenter.js +43 -0
  75. package/lib/owlly/element/gif-kit/GifVersion.d.ts +10 -0
  76. package/lib/owlly/element/gif-kit/GifVersion.js +12 -0
  77. package/lib/owlly/element/gltf-mesh-element.d.ts +31 -0
  78. package/lib/owlly/element/gltf-mesh-element.js +136 -0
  79. package/lib/owlly/element/index.d.ts +20 -0
  80. package/lib/owlly/element/index.js +24 -0
  81. package/lib/owlly/element/map-kit/shape.d.ts +131 -0
  82. package/lib/owlly/element/map-kit/shape.js +189 -0
  83. package/lib/owlly/element/mesh-element.d.ts +22 -0
  84. package/lib/owlly/element/mesh-element.js +63 -0
  85. package/lib/owlly/element/mesh-line-2d.d.ts +82 -0
  86. package/lib/owlly/element/mesh-line-2d.js +887 -0
  87. package/lib/owlly/element/meshline-o.d.ts +64 -0
  88. package/lib/owlly/element/meshline-o.js +678 -0
  89. package/lib/owlly/element/panorama-group.d.ts +241 -0
  90. package/lib/owlly/element/panorama-group.js +966 -0
  91. package/lib/owlly/element/panorama.d.ts +132 -0
  92. package/lib/owlly/element/panorama.js +812 -0
  93. package/lib/owlly/element/path-group.d.ts +69 -0
  94. package/lib/owlly/element/path-group.js +171 -0
  95. package/lib/owlly/element/path.d.ts +99 -0
  96. package/lib/owlly/element/path.js +531 -0
  97. package/lib/owlly/element/placeable-2d.d.ts +158 -0
  98. package/lib/owlly/element/placeable-2d.js +470 -0
  99. package/lib/owlly/element/polygon-mesh.d.ts +107 -0
  100. package/lib/owlly/element/polygon-mesh.js +307 -0
  101. package/lib/owlly/element/ring-element.d.ts +79 -0
  102. package/lib/owlly/element/ring-element.js +383 -0
  103. package/lib/owlly/element/sphere-mesh.d.ts +28 -0
  104. package/lib/owlly/element/sphere-mesh.js +69 -0
  105. package/lib/owlly/element/svg-floor-model.d.ts +22 -0
  106. package/lib/owlly/element/svg-floor-model.js +184 -0
  107. package/lib/owlly/element/svg-floors.d.ts +27 -0
  108. package/lib/owlly/element/svg-floors.js +109 -0
  109. package/lib/owlly/element/tile-panorama-group.d.ts +335 -0
  110. package/lib/owlly/element/tile-panorama-group.js +1006 -0
  111. package/lib/owlly/element/tile-panorama.d.ts +161 -0
  112. package/lib/owlly/element/tile-panorama.js +509 -0
  113. package/lib/owlly/element/tile-plane.d.ts +105 -0
  114. package/lib/owlly/element/tile-plane.js +360 -0
  115. package/lib/owlly/element/video-element.d.ts +33 -0
  116. package/lib/owlly/element/video-element.js +159 -0
  117. package/lib/owlly/geometries/ExtrudeGeometry2.d.ts +15 -0
  118. package/lib/owlly/geometries/ExtrudeGeometry2.js +210 -0
  119. package/lib/owlly/index.d.ts +13 -0
  120. package/lib/owlly/index.js +16 -0
  121. package/lib/owlly/overlay/canvas-overlay.d.ts +96 -0
  122. package/lib/owlly/overlay/canvas-overlay.js +510 -0
  123. package/lib/owlly/overlay/css-2d-overlay.d.ts +14 -0
  124. package/lib/owlly/overlay/css-2d-overlay.js +35 -0
  125. package/lib/owlly/overlay/css-3d-overlay.d.ts +16 -0
  126. package/lib/owlly/overlay/css-3d-overlay.js +36 -0
  127. package/lib/owlly/overlay/index.d.ts +6 -0
  128. package/lib/owlly/overlay/index.js +11 -0
  129. package/lib/owlly/overlay/label-overlay.d.ts +62 -0
  130. package/lib/owlly/overlay/label-overlay.js +328 -0
  131. package/lib/owlly/overlay/overlay.d.ts +14 -0
  132. package/lib/owlly/overlay/overlay.js +4 -0
  133. package/lib/owlly/overlay/path-overlay.d.ts +39 -0
  134. package/lib/owlly/overlay/path-overlay.js +124 -0
  135. package/lib/owlly/overlay/path-overlay2.d.ts +35 -0
  136. package/lib/owlly/overlay/path-overlay2.js +118 -0
  137. package/lib/owlly/overlay/poi-overlay-3d.d.ts +278 -0
  138. package/lib/owlly/overlay/poi-overlay-3d.js +1432 -0
  139. package/lib/owlly/overlay/poi-overlay.d.ts +277 -0
  140. package/lib/owlly/overlay/poi-overlay.js +1411 -0
  141. package/lib/owlly/owlly-2d/index.d.ts +28 -0
  142. package/lib/owlly/owlly-2d/index.js +92 -0
  143. package/lib/owlly/screen/index.d.ts +1 -0
  144. package/lib/owlly/screen/index.js +1 -0
  145. package/lib/owlly/screen/screen.d.ts +73 -0
  146. package/lib/owlly/screen/screen.js +236 -0
  147. package/lib/owlly/stage/externals.d.ts +19 -0
  148. package/lib/owlly/stage/externals.js +24 -0
  149. package/lib/owlly/stage/index.d.ts +4 -0
  150. package/lib/owlly/stage/index.js +6 -0
  151. package/lib/owlly/stage/owlly.d.ts +38 -0
  152. package/lib/owlly/stage/owlly.js +168 -0
  153. package/lib/owlly/stage/stage.d.ts +108 -0
  154. package/lib/owlly/stage/stage.js +234 -0
  155. package/lib/owlly/utils/alignment-utils.d.ts +20 -0
  156. package/lib/owlly/utils/alignment-utils.js +63 -0
  157. package/lib/owlly/utils/basic-calc.d.ts +18 -0
  158. package/lib/owlly/utils/basic-calc.js +129 -0
  159. package/lib/owlly/utils/basic-tools.d.ts +71 -0
  160. package/lib/owlly/utils/basic-tools.js +235 -0
  161. package/lib/owlly/utils/bvh-tree.d.ts +105 -0
  162. package/lib/owlly/utils/bvh-tree.js +539 -0
  163. package/lib/owlly/utils/camera.d.ts +37 -0
  164. package/lib/owlly/utils/camera.js +50 -0
  165. package/lib/owlly/utils/cube-texture-cache.d.ts +25 -0
  166. package/lib/owlly/utils/cube-texture-cache.js +143 -0
  167. package/lib/owlly/utils/device-utils.d.ts +18 -0
  168. package/lib/owlly/utils/device-utils.js +41 -0
  169. package/lib/owlly/utils/environment-utils.d.ts +37 -0
  170. package/lib/owlly/utils/environment-utils.js +73 -0
  171. package/lib/owlly/utils/event-hub.d.ts +50 -0
  172. package/lib/owlly/utils/event-hub.js +106 -0
  173. package/lib/owlly/utils/events.d.ts +219 -0
  174. package/lib/owlly/utils/events.js +219 -0
  175. package/lib/owlly/utils/geometry-utils.d.ts +119 -0
  176. package/lib/owlly/utils/geometry-utils.js +622 -0
  177. package/lib/owlly/utils/helper.d.ts +6 -0
  178. package/lib/owlly/utils/helper.js +24 -0
  179. package/lib/owlly/utils/index.d.ts +14 -0
  180. package/lib/owlly/utils/index.js +17 -0
  181. package/lib/owlly/utils/lru-cache.d.ts +26 -0
  182. package/lib/owlly/utils/lru-cache.js +109 -0
  183. package/lib/owlly/utils/map-utils.d.ts +7 -0
  184. package/lib/owlly/utils/map-utils.js +52 -0
  185. package/lib/owlly/utils/number-utils.d.ts +8 -0
  186. package/lib/owlly/utils/number-utils.js +72 -0
  187. package/lib/owlly/utils/panorama-model-util.d.ts +46 -0
  188. package/lib/owlly/utils/panorama-model-util.js +245 -0
  189. package/lib/owlly/utils/path-utils.d.ts +80 -0
  190. package/lib/owlly/utils/path-utils.js +728 -0
  191. package/lib/owlly/utils/svgutils.d.ts +138 -0
  192. package/lib/owlly/utils/svgutils.js +561 -0
  193. package/lib/owlly/utils/texture-cache.d.ts +29 -0
  194. package/lib/owlly/utils/texture-cache.js +115 -0
  195. package/lib/owlly/utils/tile-util.d.ts +187 -0
  196. package/lib/owlly/utils/tile-util.js +456 -0
  197. package/lib/owlly/utils/time-profiler.d.ts +21 -0
  198. package/lib/owlly/utils/time-profiler.js +48 -0
  199. package/lib/owlly/view/camera-view.d.ts +35 -0
  200. package/lib/owlly/view/camera-view.js +101 -0
  201. package/lib/owlly/view/index.d.ts +3 -0
  202. package/lib/owlly/view/index.js +5 -0
  203. package/lib/owlly/view/orthographic-view.d.ts +40 -0
  204. package/lib/owlly/view/orthographic-view.js +94 -0
  205. package/lib/owlly/view/perspective-view.d.ts +40 -0
  206. package/lib/owlly/view/perspective-view.js +95 -0
  207. package/lib/owlly/view/svg-map-view.d.ts +46 -0
  208. package/lib/owlly/view/svg-map-view.js +144 -0
  209. package/lib/owlly/view/view.d.ts +146 -0
  210. package/lib/owlly/view/view.js +317 -0
  211. package/lib/prod/owlly.esm.js +93462 -0
  212. package/lib/prod/owlly.esm.js.map +1 -0
  213. package/lib/prod/owlly.esm.min.js +54 -0
  214. package/lib/prod/owlly.iife.js +93560 -0
  215. package/lib/prod/owlly.iife.js.map +1 -0
  216. package/lib/prod/owlly.iife.min.js +69 -0
  217. package/lib/prod/owlly.miniapp.js +73845 -0
  218. package/lib/prod/owlly.miniapp.js.map +1 -0
  219. package/lib/prod/owlly.miniapp.min.js +63 -0
  220. package/lib/prod/src/external/lines/line-geometry.d.ts +9 -0
  221. package/lib/prod/src/external/lines/line-material.d.ts +10 -0
  222. package/lib/prod/src/external/lines/line-segments-2.d.ts +7 -0
  223. package/lib/prod/src/external/lines/line-segments-geometry.d.ts +15 -0
  224. package/lib/prod/src/external/loaders/gltf-loader.d.ts +77 -0
  225. package/lib/prod/src/external/orbit-controls.d.ts +44 -0
  226. package/lib/prod/src/external/renderers/css-2d-renderer.d.ts +16 -0
  227. package/lib/prod/src/external/renderers/css-3d-renderer.d.ts +18 -0
  228. package/lib/prod/src/external/transform-controls.d.ts +106 -0
  229. package/lib/prod/src/external/util/buffer-geometry-utils.d.ts +45 -0
  230. package/lib/prod/src/owlly/controller/aerial-element-controller.d.ts +65 -0
  231. package/lib/prod/src/owlly/controller/basic-controller.d.ts +324 -0
  232. package/lib/prod/src/owlly/controller/camera-controller.d.ts +37 -0
  233. package/lib/prod/src/owlly/controller/controller.d.ts +61 -0
  234. package/lib/prod/src/owlly/controller/index.d.ts +2 -0
  235. package/lib/prod/src/owlly/controller/mouse-indicator-controller.d.ts +34 -0
  236. package/lib/prod/src/owlly/controller/orbit-control.d.ts +147 -0
  237. package/lib/prod/src/owlly/controller/panorama-adjust-controller.d.ts +45 -0
  238. package/lib/prod/src/owlly/controller/panorama-controller.d.ts +441 -0
  239. package/lib/prod/src/owlly/controller/panorama-transform-controller.d.ts +66 -0
  240. package/lib/prod/src/owlly/controller/plane-controller.d.ts +43 -0
  241. package/lib/prod/src/owlly/controller/texture-controller.d.ts +183 -0
  242. package/lib/prod/src/owlly/controller/tile-panorama-controller.d.ts +308 -0
  243. package/lib/prod/src/owlly/controller/transform-controller.d.ts +106 -0
  244. package/lib/prod/src/owlly/element/bottom-nav-element.d.ts +65 -0
  245. package/lib/prod/src/owlly/element/camera.d.ts +82 -0
  246. package/lib/prod/src/owlly/element/dom-2d-element.d.ts +35 -0
  247. package/lib/prod/src/owlly/element/dom-3d-element.d.ts +27 -0
  248. package/lib/prod/src/owlly/element/dom-label-2d.d.ts +116 -0
  249. package/lib/prod/src/owlly/element/element.d.ts +53 -0
  250. package/lib/prod/src/owlly/element/floor-model.d.ts +83 -0
  251. package/lib/prod/src/owlly/element/gif-kit/Gif.d.ts +96 -0
  252. package/lib/prod/src/owlly/element/gif-kit/GifColor.d.ts +21 -0
  253. package/lib/prod/src/owlly/element/gif-kit/GifCompressedCodesToByteArrayConverter.d.ts +20 -0
  254. package/lib/prod/src/owlly/element/gif-kit/GifFrame.d.ts +31 -0
  255. package/lib/prod/src/owlly/element/gif-kit/GifImage.d.ts +23 -0
  256. package/lib/prod/src/owlly/element/gif-kit/GifParser.d.ts +17 -0
  257. package/lib/prod/src/owlly/element/gif-kit/GifPresenter.d.ts +20 -0
  258. package/lib/prod/src/owlly/element/gif-kit/GifVersion.d.ts +10 -0
  259. package/lib/prod/src/owlly/element/gltf-mesh-element.d.ts +31 -0
  260. package/lib/prod/src/owlly/element/index.d.ts +6 -0
  261. package/lib/prod/src/owlly/element/map-kit/area.d.ts +24 -0
  262. package/lib/prod/src/owlly/element/map-kit/block-set.d.ts +39 -0
  263. package/lib/prod/src/owlly/element/map-kit/block.d.ts +77 -0
  264. package/lib/prod/src/owlly/element/map-kit/index.d.ts +3 -0
  265. package/lib/prod/src/owlly/element/map-kit/shape.d.ts +131 -0
  266. package/lib/prod/src/owlly/element/mesh-element.d.ts +22 -0
  267. package/lib/prod/src/owlly/element/mesh-line-2d.d.ts +82 -0
  268. package/lib/prod/src/owlly/element/meshline-o.d.ts +64 -0
  269. package/lib/prod/src/owlly/element/panorama-group.d.ts +241 -0
  270. package/lib/prod/src/owlly/element/panorama.d.ts +132 -0
  271. package/lib/prod/src/owlly/element/path-group.d.ts +69 -0
  272. package/lib/prod/src/owlly/element/path.d.ts +99 -0
  273. package/lib/prod/src/owlly/element/placeable-2d.d.ts +158 -0
  274. package/lib/prod/src/owlly/element/polygon-mesh.d.ts +107 -0
  275. package/lib/prod/src/owlly/element/ring-element.d.ts +79 -0
  276. package/lib/prod/src/owlly/element/sphere-mesh.d.ts +28 -0
  277. package/lib/prod/src/owlly/element/svg-floor-model.d.ts +22 -0
  278. package/lib/prod/src/owlly/element/svg-floors.d.ts +27 -0
  279. package/lib/prod/src/owlly/element/tile-panorama-group.d.ts +335 -0
  280. package/lib/prod/src/owlly/element/tile-panorama.d.ts +162 -0
  281. package/lib/prod/src/owlly/element/tile-plane.d.ts +114 -0
  282. package/lib/prod/src/owlly/element/video-element.d.ts +33 -0
  283. package/lib/prod/src/owlly/geometries/ExtrudeGeometry2.d.ts +15 -0
  284. package/lib/prod/src/owlly/index.d.ts +13 -0
  285. package/lib/prod/src/owlly/overlay/canvas-overlay.d.ts +96 -0
  286. package/lib/prod/src/owlly/overlay/css-2d-overlay.d.ts +14 -0
  287. package/lib/prod/src/owlly/overlay/css-3d-overlay.d.ts +16 -0
  288. package/lib/prod/src/owlly/overlay/index.d.ts +5 -0
  289. package/lib/prod/src/owlly/overlay/label-overlay.d.ts +62 -0
  290. package/lib/prod/src/owlly/overlay/overlay.d.ts +14 -0
  291. package/lib/prod/src/owlly/overlay/path-overlay.d.ts +39 -0
  292. package/lib/prod/src/owlly/overlay/path-overlay2.d.ts +35 -0
  293. package/lib/prod/src/owlly/overlay/poi-overlay-3d.d.ts +278 -0
  294. package/lib/prod/src/owlly/overlay/poi-overlay.d.ts +277 -0
  295. package/lib/prod/src/owlly/owlly-2d/index.d.ts +28 -0
  296. package/lib/prod/src/owlly/screen/index.d.ts +1 -0
  297. package/lib/prod/src/owlly/screen/screen.d.ts +73 -0
  298. package/lib/prod/src/owlly/stage/__test__/stage.spec.d.ts +1 -0
  299. package/lib/prod/src/owlly/stage/externals.d.ts +19 -0
  300. package/lib/prod/src/owlly/stage/index.d.ts +3 -0
  301. package/lib/prod/src/owlly/stage/owlly.d.ts +38 -0
  302. package/lib/prod/src/owlly/stage/stage.d.ts +108 -0
  303. package/lib/prod/src/owlly/utils/alignment-utils.d.ts +20 -0
  304. package/lib/prod/src/owlly/utils/basic-calc.d.ts +18 -0
  305. package/lib/prod/src/owlly/utils/basic-tools.d.ts +71 -0
  306. package/lib/prod/src/owlly/utils/bvh-tree.d.ts +105 -0
  307. package/lib/prod/src/owlly/utils/camera.d.ts +37 -0
  308. package/lib/prod/src/owlly/utils/cube-texture-cache.d.ts +25 -0
  309. package/lib/prod/src/owlly/utils/device-utils.d.ts +18 -0
  310. package/lib/prod/src/owlly/utils/environment-utils.d.ts +37 -0
  311. package/lib/prod/src/owlly/utils/event-hub.d.ts +50 -0
  312. package/lib/prod/src/owlly/utils/events.d.ts +219 -0
  313. package/lib/prod/src/owlly/utils/geometry-utils.d.ts +119 -0
  314. package/lib/prod/src/owlly/utils/helper.d.ts +6 -0
  315. package/lib/prod/src/owlly/utils/index.d.ts +13 -0
  316. package/lib/prod/src/owlly/utils/lru-cache.d.ts +26 -0
  317. package/lib/prod/src/owlly/utils/map-utils.d.ts +7 -0
  318. package/lib/prod/src/owlly/utils/number-utils.d.ts +8 -0
  319. package/lib/prod/src/owlly/utils/panorama-model-util.d.ts +46 -0
  320. package/lib/prod/src/owlly/utils/path-utils.d.ts +80 -0
  321. package/lib/prod/src/owlly/utils/svgutils.d.ts +138 -0
  322. package/lib/prod/src/owlly/utils/texture-cache.d.ts +29 -0
  323. package/lib/prod/src/owlly/utils/tile-util.d.ts +187 -0
  324. package/lib/prod/src/owlly/utils/time-profiler.d.ts +21 -0
  325. package/lib/prod/src/owlly/view/__test__/perspective-view.spec.d.ts +0 -0
  326. package/lib/prod/src/owlly/view/camera-view.d.ts +35 -0
  327. package/lib/prod/src/owlly/view/index.d.ts +3 -0
  328. package/lib/prod/src/owlly/view/orthographic-view.d.ts +40 -0
  329. package/lib/prod/src/owlly/view/perspective-view.d.ts +40 -0
  330. package/lib/prod/src/owlly/view/svg-map-view.d.ts +46 -0
  331. package/lib/prod/src/owlly/view/view.d.ts +146 -0
  332. package/lib/src/owlly/controller/texture-controller.d.ts +3 -1
  333. package/lib/src/owlly/controller/texture-controller.js +16 -1
  334. package/lib/src/owlly/controller/texture-controller.js.map +1 -1
  335. package/lib/src/owlly/controller/tile-panorama-controller.js +4 -0
  336. package/lib/src/owlly/controller/tile-panorama-controller.js.map +1 -1
  337. package/lib/src/owlly/element/tile-panorama.d.ts +1 -0
  338. package/lib/src/owlly/element/tile-panorama.js +16 -3
  339. package/lib/src/owlly/element/tile-panorama.js.map +1 -1
  340. package/lib/src/owlly/element/tile-plane.d.ts +9 -0
  341. package/lib/src/owlly/element/tile-plane.js +27 -0
  342. package/lib/src/owlly/element/tile-plane.js.map +1 -1
  343. package/lib/src/owlly/overlay/poi-overlay-3d.js.map +1 -1
  344. package/lib/src/owlly/overlay/poi-overlay.js.map +1 -1
  345. package/lib/src/owlly/stage/owlly.js +7 -1
  346. package/lib/src/owlly/stage/owlly.js.map +1 -1
  347. package/lib/src/owlly/stage/stage.js +2 -0
  348. package/lib/src/owlly/stage/stage.js.map +1 -1
  349. package/lib/src/web/main.rpeng.mes.plane.js.map +1 -1
  350. package/package.json +16 -7
  351. package/src/owlly/controller/texture-controller.ts +18 -1
  352. package/src/owlly/controller/tile-panorama-controller.ts +3 -1
  353. package/src/owlly/element/tile-panorama.ts +14 -0
  354. package/src/owlly/element/tile-plane.ts +26 -0
  355. package/src/owlly/overlay/poi-overlay-3d.ts +0 -4
  356. package/src/owlly/overlay/poi-overlay.ts +0 -4
  357. package/src/owlly/stage/owlly.ts +6 -1
  358. package/src/owlly/stage/stage.ts +2 -0
  359. package/src/web/main.rpeng.mes.plane.ts +0 -6
@@ -0,0 +1,456 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ import { NS_THREE, Externals } from '../stage/externals';
3
+ const TEXT_MAX = 16;
4
+ const TEXT_SEGMENT = 4;
5
+ // 默认配置值
6
+ const DEFAULT_TEXT_PIXEL = 512;
7
+ const DEFAULT_IMG_TEXT_PIXEL = 2048;
8
+ // 全局配置对象
9
+ let tileConfig = {};
10
+ // 获取配置的 TEXT_PIXEL 值
11
+ function getTextPixel() {
12
+ return tileConfig.textPixel || DEFAULT_TEXT_PIXEL;
13
+ }
14
+ // 获取配置的 IMG_TEXT_PIXEL 值
15
+ function getImgTextPixel() {
16
+ return tileConfig.imgTextPixel || DEFAULT_IMG_TEXT_PIXEL;
17
+ }
18
+ // 设置瓦片配置
19
+ function setTileConfig(config) {
20
+ tileConfig = Object.assign(Object.assign({}, tileConfig), config);
21
+ }
22
+ // 导出常量(使用函数获取当前配置值)
23
+ export const TEXT_PIXEL = getTextPixel();
24
+ export const IMG_TEXT_PIXEL = getImgTextPixel();
25
+ // const IMG_TEXT_PIXEL = 4096;
26
+ // const IMG_URL = './imgs/';
27
+ const USE_CANVAS = false;
28
+ // const USE_TEXTURE_INDEX = true;
29
+ const USE_TEXTURE_BLACK = false;
30
+ // const testSides = ['right', 'left', 'up', 'down', 'front', 'back'];
31
+ // const sides = ['r', 'l', 't', 'd', 'f', 'b'];
32
+ const VertexShader = `
33
+ attribute vec3 uvi;
34
+ varying vec3 vUv;
35
+ uniform bool flipX;
36
+ uniform bool flipY;
37
+
38
+ void main(){
39
+ vUv = uvi;
40
+ bool useCanvas = ${USE_CANVAS};
41
+ if(flipX){
42
+ vUv.x = 1.0-vUv.x;
43
+ }
44
+ if(flipY){
45
+ vUv.y = 1.0-vUv.y;
46
+ }
47
+ if(useCanvas){
48
+ vUv.y = 1.0-vUv.y;
49
+ }
50
+ gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
51
+ }
52
+ `;
53
+ const FragmentShader = `
54
+ uniform sampler2D mTexture0;
55
+ uniform sampler2D mTexture1;
56
+ uniform sampler2D mTexture2;
57
+ uniform sampler2D mTexture3;
58
+ uniform sampler2D mTexture4;
59
+ uniform sampler2D mTexture5;
60
+ uniform sampler2D mTexture6;
61
+ uniform sampler2D mTexture7;
62
+ uniform sampler2D mTexture8;
63
+ uniform sampler2D mTexture9;
64
+ uniform sampler2D mTexture10;
65
+ uniform sampler2D mTexture11;
66
+ uniform sampler2D mTexture12;
67
+ uniform sampler2D mTexture13;
68
+ uniform sampler2D mTexture14;
69
+ uniform sampler2D mTexture15;
70
+
71
+ uniform int uvMax;
72
+ varying vec3 vUv;
73
+ uniform bool black;
74
+
75
+ int modi(int x, int y) {
76
+ int result = x - ((x / y) * y);
77
+ return result < 0 ? result + y : result;
78
+ }
79
+
80
+ float modf(float x, float y){
81
+ float result = x - y * floor(x/y);
82
+ return result < 0.0 ? result + y : result;
83
+ }
84
+
85
+ int getInt(float value) {
86
+ // 添加边界检查
87
+ if (value < 0.0) return 0;
88
+ if (value > float(0x7FFFFFFF)) return 0x7FFFFFFF;
89
+
90
+ float m = modf(value, 1.0);
91
+ return m < 1.0 && m > 0.6 ? int(value) + 1 : int(value);
92
+ }
93
+
94
+ vec4 getSample(int index, vec2 uv) {
95
+ if (index == 0) return texture2D(mTexture0, uv);
96
+ if (index == 1) return texture2D(mTexture1, uv);
97
+ if (index == 2) return texture2D(mTexture2, uv);
98
+ if (index == 3) return texture2D(mTexture3, uv);
99
+ if (index == 4) return texture2D(mTexture4, uv);
100
+ if (index == 5) return texture2D(mTexture5, uv);
101
+ if (index == 6) return texture2D(mTexture6, uv);
102
+ if (index == 7) return texture2D(mTexture7, uv);
103
+ if (index == 8) return texture2D(mTexture8, uv);
104
+ if (index == 9) return texture2D(mTexture9, uv);
105
+ if (index == 10) return texture2D(mTexture10, uv);
106
+ if (index == 11) return texture2D(mTexture11, uv);
107
+ if (index == 12) return texture2D(mTexture12, uv);
108
+ if (index == 13) return texture2D(mTexture13, uv);
109
+ if (index == 14) return texture2D(mTexture14, uv);
110
+ if (index == 15) return texture2D(mTexture15, uv);
111
+ return vec4(0.0, 0.0, 0.0, 1.0); // 默认返回透明黑色
112
+ }
113
+
114
+ vec2 getUv(vec2 uvs, int pos){
115
+ // 严格的边界保护
116
+ float min2 = 1.0 / 4096.0;
117
+ float max2 = 1.0 - min2;
118
+ vec2 clampedUvs = clamp(uvs, vec2(min2), vec2(max2));
119
+
120
+ vec2 tuv = clampedUvs / 4.0;
121
+ int x = modi(pos, 4);
122
+ int y = pos / 4;
123
+
124
+ float segment = 1.0 / 4.0;
125
+ vec2 base = vec2(float(x) * segment, float(y) * segment);
126
+
127
+ // 添加额外的边界检查
128
+ return clamp(tuv + base, vec2(0.0), vec2(1.0));
129
+ }
130
+
131
+ void main(){
132
+ vec2 tuv = vUv.xy;
133
+ int indexPos = getInt(vUv.z);
134
+ int index = indexPos / 100;
135
+ int pos = modi(indexPos, 100);
136
+ tuv = getUv(tuv, pos);
137
+ gl_FragColor = getSample(index, tuv);
138
+ }`;
139
+ /**
140
+ * 获取瓦片信息id
141
+ * @ignore
142
+ * @param pid pid
143
+ * @param level 等级
144
+ * @param index 下标
145
+ * @returns id字符串
146
+ */
147
+ function getTileInfoId(pid, level, index) {
148
+ return `${pid}-${level}-${index}`;
149
+ }
150
+ /**
151
+ * 六面配置
152
+ */
153
+ const CubeFaceConfig = [
154
+ {
155
+ normal: new NS_THREE.Vector3(0, 0, 1),
156
+ trans: new NS_THREE.Vector3(0, 0, 0.5),
157
+ euler: new NS_THREE.Euler(0, Math.PI / 2, -Math.PI / 2),
158
+ face: 0,
159
+ flipX: false,
160
+ flipY: false,
161
+ revers: false,
162
+ },
163
+ {
164
+ normal: new NS_THREE.Vector3(0, 0, 1),
165
+ trans: new NS_THREE.Vector3(0, 0, 0.5),
166
+ euler: new NS_THREE.Euler(0, -Math.PI / 2, -Math.PI / 2),
167
+ face: 1,
168
+ flipX: true,
169
+ flipY: true,
170
+ revers: false,
171
+ },
172
+ {
173
+ normal: new NS_THREE.Vector3(0, 0, 1),
174
+ trans: new NS_THREE.Vector3(0, 0, 0.5),
175
+ face: 2,
176
+ flipX: false,
177
+ flipY: false,
178
+ revers: false,
179
+ },
180
+ {
181
+ normal: new NS_THREE.Vector3(0, 0, 1),
182
+ trans: new NS_THREE.Vector3(0, 0, -0.5),
183
+ face: 3,
184
+ flipX: false,
185
+ flipY: true,
186
+ revers: true,
187
+ },
188
+ {
189
+ normal: new NS_THREE.Vector3(0, 0, 1),
190
+ trans: new NS_THREE.Vector3(0, 0, -0.5),
191
+ euler: new NS_THREE.Euler(Math.PI / 2, 0, 0),
192
+ face: 4,
193
+ flipX: false,
194
+ flipY: true,
195
+ revers: true,
196
+ },
197
+ {
198
+ normal: new NS_THREE.Vector3(0, 0, 1),
199
+ trans: new NS_THREE.Vector3(0, 0, -0.5),
200
+ euler: new NS_THREE.Euler(-Math.PI / 2, 0, 0),
201
+ face: 5,
202
+ flipX: true,
203
+ flipY: false,
204
+ revers: true,
205
+ },
206
+ ];
207
+ /**
208
+ * 根据参数获取顶点数据
209
+ * @ignore
210
+ * @param level 等级
211
+ * @param index 下标
212
+ * @param revers 逆转
213
+ * @param flipX x翻转
214
+ * @param flipY y翻转
215
+ * @returns 顶点数组
216
+ */
217
+ function getVertices(level, index, revers, flipX, flipY) {
218
+ const { THREE } = Externals.getInstance();
219
+ const vertices = [];
220
+ const base = new THREE.Vector3(-0.5, -0.5, 0);
221
+ const segment = Math.pow(2, level);
222
+ const segmentSize = 1 / segment;
223
+ let j = index % segment;
224
+ let i = Math.floor(index / segment);
225
+ if (!revers) {
226
+ j = segment - 1 - j;
227
+ i = segment - 1 - i;
228
+ }
229
+ if (flipX) {
230
+ i = segment - 1 - i;
231
+ }
232
+ if (flipY) {
233
+ j = segment - 1 - j;
234
+ }
235
+ const x0 = base.x + j * segmentSize;
236
+ const y0 = base.y + i * segmentSize;
237
+ const x1 = x0;
238
+ const y1 = y0 + segmentSize;
239
+ const x2 = x0 + segmentSize;
240
+ const y2 = y0 + segmentSize;
241
+ const x3 = x0 + segmentSize;
242
+ const y3 = y0;
243
+ vertices.push(new THREE.Vector3(x0, y0, 0));
244
+ vertices.push(new THREE.Vector3(x1, y1, 0));
245
+ vertices.push(new THREE.Vector3(x2, y2, 0));
246
+ vertices.push(new THREE.Vector3(x3, y3, 0));
247
+ return vertices;
248
+ }
249
+ /**
250
+ * info说明 TileTextureInfo
251
+ * pid pid.index // pid为全景id, index为0-5的该场景的面小标
252
+ * textureIndex index*100 + pos // index 为textures的下标, 该纹理的区域位置,以2048*2048算的话现在为0-15
253
+ * level 当前的level等级
254
+ * index 该level等级下的平面所在区域
255
+ */
256
+ class TileTextureInfo {
257
+ /**
258
+ * 构造
259
+ * @ignore
260
+ * @param pfid 全景面id
261
+ * @param textureIndex 纹理下标
262
+ * @param level 等级
263
+ * @param index 下标
264
+ * @param rootUrl 根地址
265
+ */
266
+ constructor(pfid, textureIndex, level, index, rootUrl, offLineLevel, offLineRootUrl) {
267
+ /** @ignore */
268
+ this.offLineLevel = -1;
269
+ this.pfid = pfid;
270
+ this.textureIndex = textureIndex;
271
+ this.level = level;
272
+ this.index = index;
273
+ this.isInCamera = false;
274
+ this.rootUrl = rootUrl || '';
275
+ this.offLineLevel = offLineLevel == null ? -1 : offLineLevel;
276
+ this.offLineRootUrl = offLineRootUrl || '';
277
+ }
278
+ /** @ignore */
279
+ get id() {
280
+ return getTileInfoId(this.pfid, this.level, this.index);
281
+ }
282
+ /** @ignore */
283
+ get originVertices() {
284
+ let vertices = this._originVertices;
285
+ if (!vertices) {
286
+ const face = (this.pfid * 10) % 10 - 1;
287
+ const config = CubeFaceConfig[face];
288
+ const { revers, flipX, flipY } = config;
289
+ vertices = this._originVertices = getVertices(this.level, this.index, revers, flipX, flipY);
290
+ }
291
+ return vertices;
292
+ }
293
+ /**
294
+ * 判定是否在相机内
295
+ * @ignore
296
+ * @param matrix 矩阵
297
+ * @param camera 相机
298
+ * @returns bool
299
+ */
300
+ inCamera(matrix, camera) {
301
+ const { THREE } = Externals.getInstance();
302
+ const vertices = this.originVertices;
303
+ const center = new THREE.Vector3(0, 0, 0);
304
+ center.applyMatrix4(matrix);
305
+ center.project(camera);
306
+ this.centerDis = center.length();
307
+ for (let i = 0; i < vertices.length; i++) {
308
+ const vertex = vertices[i].clone();
309
+ vertex.applyMatrix4(matrix);
310
+ vertex.project(camera);
311
+ if (vertex.x > -1 && vertex.x < 1 && vertex.y > -1 && vertex.y < 1 && vertex.z > -1 && vertex.z < 1) {
312
+ return true;
313
+ }
314
+ }
315
+ return false;
316
+ }
317
+ /**
318
+ * @ignore
319
+ * 目标id
320
+ */
321
+ get targetTid() {
322
+ return Math.floor(this.pfid);
323
+ }
324
+ }
325
+ /**
326
+ * 瓦片工具类
327
+ */
328
+ class TileUtil {
329
+ /**
330
+ * 获取xy
331
+ * @ignore
332
+ * @param value 目标值
333
+ * @param segment 分段
334
+ * @returns {x,y}
335
+ */
336
+ static getXY(value, segment) {
337
+ const y = Math.floor(value / segment);
338
+ const x = value % segment;
339
+ return { x, y };
340
+ }
341
+ /**
342
+ * 根据level等级获取分段
343
+ * @ignore
344
+ * @param level 等级
345
+ * @returns 分段数
346
+ */
347
+ static getSegment(level) {
348
+ return Math.pow(2, level);
349
+ }
350
+ /**
351
+ * 根据level等级获取总数量
352
+ * @ignore
353
+ * @param level 等级
354
+ * @returns 总数量
355
+ */
356
+ static getCount(level) {
357
+ const segment = TileUtil.getSegment(level);
358
+ return segment * segment;
359
+ }
360
+ /**
361
+ * 获取图片信息
362
+ * @ignore
363
+ * @param pid 全景id
364
+ * @param index 下标
365
+ * @param level 等级
366
+ * @returns {url, id}
367
+ */
368
+ static getImageInfo2(pfid, index, level, rootUrl) {
369
+ // const tt = (pfid * 10) % 10 - 1;
370
+ // const type = testSides[tt];
371
+ const segment = TileUtil.getSegment(level);
372
+ const imgPx = getImgTextPixel() / segment;
373
+ let { x, y } = TileUtil.getXY(index, segment);
374
+ x = segment - 1 - x;
375
+ y = segment - 1 - y;
376
+ const crop = `/crop,x_${imgPx * x},y_${imgPx * y},w_${imgPx},h_${imgPx}`;
377
+ const resize = `/resize,m_lfit,w_${getTextPixel()},h_${getTextPixel()}`;
378
+ const url = `${rootUrl}?x-bce-process=image${crop}${resize}`;
379
+ // const url = `https://robot-vr-public.cdn.bcebos.com/image/panoramas/0/43_${sides[tt]}.jpg?x-bce-process=image${crop}${resize}`;
380
+ const id = `${pfid}-${level}-${x}-${y}`;
381
+ return { id, url };
382
+ }
383
+ /**
384
+ * 获取图片信息
385
+ * @param info
386
+ * @returns
387
+ */
388
+ static getImageInfo(info) {
389
+ const { pfid, index, level, rootUrl, offLineLevel, offLineRootUrl, } = info;
390
+ const segment = TileUtil.getSegment(level);
391
+ const imgPx = getImgTextPixel() / segment;
392
+ let { x, y } = TileUtil.getXY(index, segment);
393
+ x = segment - 1 - x;
394
+ y = segment - 1 - y;
395
+ let url = '';
396
+ if (level <= offLineLevel) {
397
+ url = `${offLineRootUrl}_${level}_${index}.jpg`;
398
+ }
399
+ else {
400
+ const crop = `/crop,x_${imgPx * x},y_${imgPx * y},w_${imgPx},h_${imgPx}`;
401
+ const resize = `/resize,m_lfit,w_${getTextPixel()},h_${getTextPixel()}`;
402
+ const fistR = TileUtil.resizeFirst ? `/resize,m_lfit,w_${getImgTextPixel()},h_${getImgTextPixel()}` : '';
403
+ url = `${rootUrl}?x-bce-process=image${fistR}${crop}${resize}`;
404
+ // const url = `https://robot-vr-public.cdn.bcebos.com/image/panoramas/0/43_${sides[tt]}.jpg?x-bce-process=image${crop}${resize}`;
405
+ }
406
+ const id = `${pfid}-${level}-${x}-${y}`;
407
+ return { id, url };
408
+ }
409
+ /**
410
+ * 防抖
411
+ * @param cb
412
+ * @param time
413
+ * @returns
414
+ */
415
+ static antiShake(cb, time) {
416
+ let timer;
417
+ return (...args) => {
418
+ if (timer) {
419
+ clearTimeout(timer);
420
+ }
421
+ timer = setTimeout(() => {
422
+ cb(...args);
423
+ timer = null;
424
+ }, time);
425
+ };
426
+ }
427
+ /**
428
+ * 节流
429
+ * @param cb
430
+ * @param time
431
+ * @returns
432
+ */
433
+ static throttle(cb, time) {
434
+ let timer;
435
+ return (...args) => {
436
+ if (timer) {
437
+ return;
438
+ }
439
+ timer = setTimeout(() => {
440
+ cb(...args);
441
+ timer = null;
442
+ }, time);
443
+ };
444
+ }
445
+ }
446
+ /** 美帧最大纹理更新个数 */
447
+ TileUtil.updateTextureMax = 1;
448
+ /** 等级最小限制 */
449
+ TileUtil.levelMin = 0;
450
+ /** 等级最大限制 */
451
+ TileUtil.levelMax = 2;
452
+ /** 优先重置大小 */
453
+ TileUtil.resizeFirst = false;
454
+ TileUtil.getTileInfoId = getTileInfoId;
455
+ TileUtil.getVertices = getVertices;
456
+ export { TileUtil, TileTextureInfo, TEXT_MAX, TEXT_SEGMENT, VertexShader, FragmentShader, CubeFaceConfig, USE_CANVAS, USE_TEXTURE_BLACK, getTextPixel, getImgTextPixel, setTileConfig, };
@@ -0,0 +1,21 @@
1
+ declare class TimeProfiler {
2
+ private frameTimeMillses;
3
+ private timingIntervalMills;
4
+ private fps;
5
+ /**
6
+ * 初始化FPS统计
7
+ * @param timingIntervalMills 统计FPS的时间区间间隔长度,单位毫秒
8
+ */
9
+ constructor(timingIntervalMills?: number);
10
+ reset(): void;
11
+ /**
12
+ * Tick一帧
13
+ * @param frameTimeMills 时间戳,是当前帧的相对时间,不是两帧之间的间隔。单位毫秒
14
+ */
15
+ tick(frameTimeMills: number): void;
16
+ /**
17
+ * 获得当前统计的FPS值
18
+ */
19
+ getFPS(): number | undefined;
20
+ }
21
+ export { TimeProfiler };
@@ -0,0 +1,48 @@
1
+ class TimeProfiler {
2
+ /**
3
+ * 初始化FPS统计
4
+ * @param timingIntervalMills 统计FPS的时间区间间隔长度,单位毫秒
5
+ */
6
+ constructor(timingIntervalMills = 1000) {
7
+ this.timingIntervalMills = timingIntervalMills;
8
+ this.frameTimeMillses = [];
9
+ }
10
+ reset() {
11
+ this.frameTimeMillses = [];
12
+ this.fps = undefined;
13
+ }
14
+ /**
15
+ * Tick一帧
16
+ * @param frameTimeMills 时间戳,是当前帧的相对时间,不是两帧之间的间隔。单位毫秒
17
+ */
18
+ tick(frameTimeMills) {
19
+ if (this.timingIntervalMills <= 0) {
20
+ if (this.frameTimeMillses.length === 0) {
21
+ this.frameTimeMillses.push(frameTimeMills, 0);
22
+ }
23
+ else {
24
+ this.frameTimeMillses[1] += 1;
25
+ this.fps = 1000 * this.frameTimeMillses[1] / (frameTimeMills - this.frameTimeMillses[0]);
26
+ }
27
+ }
28
+ else {
29
+ this.frameTimeMillses.push(frameTimeMills);
30
+ const frames = this.frameTimeMillses.length - 1;
31
+ if (frames > 0) {
32
+ let time = this.frameTimeMillses[this.frameTimeMillses.length - 1] - this.frameTimeMillses[0];
33
+ this.fps = 1000 * frames / time;
34
+ while (time > this.timingIntervalMills) {
35
+ this.frameTimeMillses.shift();
36
+ time = this.frameTimeMillses[this.frameTimeMillses.length - 1] - this.frameTimeMillses[0];
37
+ }
38
+ }
39
+ }
40
+ }
41
+ /**
42
+ * 获得当前统计的FPS值
43
+ */
44
+ getFPS() {
45
+ return this.fps;
46
+ }
47
+ }
48
+ export { TimeProfiler };
@@ -0,0 +1,35 @@
1
+ import { NS_THREE } from '../stage/externals';
2
+ import { View } from './view';
3
+ import { Camera } from '../element/camera';
4
+ /** 相机元素视图, 渲染相机元素所看到的图像, 用于虚拟部署, 需要在新版本中更新 */
5
+ declare class CameraView extends View {
6
+ container: HTMLElement;
7
+ renderer: NS_THREE.WebGL1Renderer;
8
+ private activeCamera;
9
+ private eventListeners;
10
+ /**
11
+ * @param container 目标容器
12
+ */
13
+ constructor(container: HTMLElement);
14
+ /** @ignore */
15
+ resize(): void;
16
+ /** @ignore */
17
+ render(scene: NS_THREE.Scene): void;
18
+ dispose(): void;
19
+ /**
20
+ * 绑定相机元素, 绑定后视图将显示传入相机元素所看到的图像
21
+ * @param camera 绑定的相机元素
22
+ */
23
+ bindCamera(camera: Camera): void;
24
+ /**
25
+ * 解绑相机元素
26
+ * 取消相机辅助线,并清空画布
27
+ * edited by kxiao
28
+ */
29
+ unbindCamera(): void;
30
+ /**
31
+ * 获取当前绑定的相机元素
32
+ */
33
+ getActiveCamera(): Camera | undefined | null;
34
+ }
35
+ export { CameraView };
@@ -0,0 +1,101 @@
1
+ import { Externals } from '../stage/externals';
2
+ import { View } from './view';
3
+ import { Camera } from '../element/camera';
4
+ import { EventHub } from '../utils/event-hub';
5
+ import { OwllyEvents } from '../utils/events';
6
+ /** 相机元素视图, 渲染相机元素所看到的图像, 用于虚拟部署, 需要在新版本中更新 */
7
+ class CameraView extends View {
8
+ /**
9
+ * @param container 目标容器
10
+ */
11
+ constructor(container) {
12
+ super();
13
+ // init renderer
14
+ const { THREE } = Externals.getInstance();
15
+ this.container = container;
16
+ this.renderer = new THREE.WebGL1Renderer();
17
+ this.renderer.setPixelRatio(window.devicePixelRatio);
18
+ this.renderer.setSize(container.clientWidth, container.clientHeight);
19
+ this.container.appendChild(this.renderer.domElement);
20
+ this.container.style.setProperty('display', 'flex');
21
+ this.container.style.setProperty('align-items', 'center');
22
+ this.container.style.setProperty('justify-content', 'center');
23
+ this.eventListeners = {
24
+ onCameraSelected: (camera) => {
25
+ if (!(camera instanceof Camera))
26
+ return;
27
+ this.bindCamera(camera);
28
+ },
29
+ };
30
+ EventHub.on(OwllyEvents.ELEMENT_SELECTED, this.eventListeners.onCameraSelected);
31
+ }
32
+ /** @ignore */
33
+ resize() {
34
+ if (!this.activeCamera)
35
+ return;
36
+ const { clientWidth, clientHeight } = this.container;
37
+ const containerAspect = clientWidth / clientHeight || 1;
38
+ const { resolution: { height, width }, } = this.activeCamera.getIntrinsic();
39
+ const cameraRatio = width / height;
40
+ if (containerAspect > cameraRatio) {
41
+ const targetHeight = clientHeight;
42
+ const targetWidth = clientHeight * cameraRatio;
43
+ super.resize(targetWidth, targetHeight);
44
+ this.renderer.setSize(targetWidth, targetHeight);
45
+ }
46
+ else {
47
+ const targetWidth = clientWidth;
48
+ const targetHeight = clientWidth / cameraRatio;
49
+ super.resize(targetWidth, targetHeight);
50
+ this.renderer.setSize(targetWidth, targetHeight);
51
+ }
52
+ }
53
+ /** @ignore */
54
+ render(scene) {
55
+ if (!this.enabled || !this.activeCamera)
56
+ return;
57
+ this.activeCamera.setCameraHelperVisible(false);
58
+ this.renderer.render(scene, this.activeCamera.getThreeCamera());
59
+ this.activeCamera.setCameraHelperVisible(true);
60
+ }
61
+ dispose() {
62
+ super.dispose();
63
+ this.unbindCamera();
64
+ EventHub.off(OwllyEvents.ELEMENT_SELECTED, this.eventListeners.onCameraSelected);
65
+ this.container.removeChild(this.renderer.domElement);
66
+ this.renderer.dispose();
67
+ }
68
+ /**
69
+ * 绑定相机元素, 绑定后视图将显示传入相机元素所看到的图像
70
+ * @param camera 绑定的相机元素
71
+ */
72
+ bindCamera(camera) {
73
+ if (this.activeCamera)
74
+ this.activeCamera.setCameraHelperVisible(false, true);
75
+ this.activeCamera = camera;
76
+ this.activeCamera.updateLookAt();
77
+ this.activeCamera.setCameraHelperVisible(true, true);
78
+ this.resize();
79
+ }
80
+ /**
81
+ * 解绑相机元素
82
+ * 取消相机辅助线,并清空画布
83
+ * edited by kxiao
84
+ */
85
+ unbindCamera() {
86
+ if (!this.activeCamera) {
87
+ return;
88
+ }
89
+ this.activeCamera.setCameraHelperVisible(false, false);
90
+ this.activeCamera.updateLookAt();
91
+ this.activeCamera = null;
92
+ this.renderer.clear();
93
+ }
94
+ /**
95
+ * 获取当前绑定的相机元素
96
+ */
97
+ getActiveCamera() {
98
+ return this.activeCamera;
99
+ }
100
+ }
101
+ export { CameraView };
@@ -0,0 +1,3 @@
1
+ export * from './view';
2
+ export * from './perspective-view';
3
+ export * from './orthographic-view';
@@ -0,0 +1,5 @@
1
+ export * from './view';
2
+ export * from './perspective-view';
3
+ export * from './orthographic-view';
4
+ // export * from './svg-map-view';
5
+ // export * from './camera-view';