@aibee/owlly 1.0.25

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 (500) hide show
  1. package/README.external.md +75 -0
  2. package/README.md +28 -0
  3. package/lib/src/external/lines/line-geometry.d.ts +9 -0
  4. package/lib/src/external/lines/line-geometry.js +52 -0
  5. package/lib/src/external/lines/line-geometry.js.map +1 -0
  6. package/lib/src/external/lines/line-material.d.ts +10 -0
  7. package/lib/src/external/lines/line-material.js +377 -0
  8. package/lib/src/external/lines/line-material.js.map +1 -0
  9. package/lib/src/external/lines/line-segments-2.d.ts +7 -0
  10. package/lib/src/external/lines/line-segments-2.js +144 -0
  11. package/lib/src/external/lines/line-segments-2.js.map +1 -0
  12. package/lib/src/external/lines/line-segments-geometry.d.ts +15 -0
  13. package/lib/src/external/lines/line-segments-geometry.js +141 -0
  14. package/lib/src/external/lines/line-segments-geometry.js.map +1 -0
  15. package/lib/src/external/loaders/gltf-loader.d.ts +77 -0
  16. package/lib/src/external/loaders/gltf-loader.js +2319 -0
  17. package/lib/src/external/loaders/gltf-loader.js.map +1 -0
  18. package/lib/src/external/orbit-controls.d.ts +44 -0
  19. package/lib/src/external/orbit-controls.js +746 -0
  20. package/lib/src/external/orbit-controls.js.map +1 -0
  21. package/lib/src/external/renderers/css-2d-renderer.d.ts +16 -0
  22. package/lib/src/external/renderers/css-2d-renderer.js +122 -0
  23. package/lib/src/external/renderers/css-2d-renderer.js.map +1 -0
  24. package/lib/src/external/renderers/css-3d-renderer.d.ts +18 -0
  25. package/lib/src/external/renderers/css-3d-renderer.js +139 -0
  26. package/lib/src/external/renderers/css-3d-renderer.js.map +1 -0
  27. package/lib/src/external/transform-controls.d.ts +106 -0
  28. package/lib/src/external/transform-controls.js +1113 -0
  29. package/lib/src/external/transform-controls.js.map +1 -0
  30. package/lib/src/external/util/buffer-geometry-utils.d.ts +45 -0
  31. package/lib/src/external/util/buffer-geometry-utils.js +569 -0
  32. package/lib/src/external/util/buffer-geometry-utils.js.map +1 -0
  33. package/lib/src/owlly/controller/aerial-element-controller.d.ts +65 -0
  34. package/lib/src/owlly/controller/aerial-element-controller.js +236 -0
  35. package/lib/src/owlly/controller/aerial-element-controller.js.map +1 -0
  36. package/lib/src/owlly/controller/basic-controller.d.ts +324 -0
  37. package/lib/src/owlly/controller/basic-controller.js +1239 -0
  38. package/lib/src/owlly/controller/basic-controller.js.map +1 -0
  39. package/lib/src/owlly/controller/camera-controller.d.ts +37 -0
  40. package/lib/src/owlly/controller/camera-controller.js +138 -0
  41. package/lib/src/owlly/controller/camera-controller.js.map +1 -0
  42. package/lib/src/owlly/controller/controller.d.ts +61 -0
  43. package/lib/src/owlly/controller/controller.js +24 -0
  44. package/lib/src/owlly/controller/controller.js.map +1 -0
  45. package/lib/src/owlly/controller/index.d.ts +2 -0
  46. package/lib/src/owlly/controller/index.js +14 -0
  47. package/lib/src/owlly/controller/index.js.map +1 -0
  48. package/lib/src/owlly/controller/mouse-indicator-controller.d.ts +34 -0
  49. package/lib/src/owlly/controller/mouse-indicator-controller.js +119 -0
  50. package/lib/src/owlly/controller/mouse-indicator-controller.js.map +1 -0
  51. package/lib/src/owlly/controller/orbit-control.d.ts +147 -0
  52. package/lib/src/owlly/controller/orbit-control.js +265 -0
  53. package/lib/src/owlly/controller/orbit-control.js.map +1 -0
  54. package/lib/src/owlly/controller/panorama-adjust-controller.d.ts +45 -0
  55. package/lib/src/owlly/controller/panorama-adjust-controller.js +158 -0
  56. package/lib/src/owlly/controller/panorama-adjust-controller.js.map +1 -0
  57. package/lib/src/owlly/controller/panorama-controller.d.ts +441 -0
  58. package/lib/src/owlly/controller/panorama-controller.js +1944 -0
  59. package/lib/src/owlly/controller/panorama-controller.js.map +1 -0
  60. package/lib/src/owlly/controller/panorama-transform-controller.d.ts +66 -0
  61. package/lib/src/owlly/controller/panorama-transform-controller.js +137 -0
  62. package/lib/src/owlly/controller/panorama-transform-controller.js.map +1 -0
  63. package/lib/src/owlly/controller/plane-controller.d.ts +43 -0
  64. package/lib/src/owlly/controller/plane-controller.js +174 -0
  65. package/lib/src/owlly/controller/plane-controller.js.map +1 -0
  66. package/lib/src/owlly/controller/texture-controller.d.ts +181 -0
  67. package/lib/src/owlly/controller/texture-controller.js +876 -0
  68. package/lib/src/owlly/controller/texture-controller.js.map +1 -0
  69. package/lib/src/owlly/controller/tile-panorama-controller.d.ts +308 -0
  70. package/lib/src/owlly/controller/tile-panorama-controller.js +1354 -0
  71. package/lib/src/owlly/controller/tile-panorama-controller.js.map +1 -0
  72. package/lib/src/owlly/controller/transform-controller.d.ts +106 -0
  73. package/lib/src/owlly/controller/transform-controller.js +546 -0
  74. package/lib/src/owlly/controller/transform-controller.js.map +1 -0
  75. package/lib/src/owlly/element/bottom-nav-element.d.ts +65 -0
  76. package/lib/src/owlly/element/bottom-nav-element.js +258 -0
  77. package/lib/src/owlly/element/bottom-nav-element.js.map +1 -0
  78. package/lib/src/owlly/element/camera.d.ts +82 -0
  79. package/lib/src/owlly/element/camera.js +284 -0
  80. package/lib/src/owlly/element/camera.js.map +1 -0
  81. package/lib/src/owlly/element/dom-2d-element.d.ts +35 -0
  82. package/lib/src/owlly/element/dom-2d-element.js +49 -0
  83. package/lib/src/owlly/element/dom-2d-element.js.map +1 -0
  84. package/lib/src/owlly/element/dom-3d-element.d.ts +27 -0
  85. package/lib/src/owlly/element/dom-3d-element.js +34 -0
  86. package/lib/src/owlly/element/dom-3d-element.js.map +1 -0
  87. package/lib/src/owlly/element/dom-label-2d.d.ts +116 -0
  88. package/lib/src/owlly/element/dom-label-2d.js +383 -0
  89. package/lib/src/owlly/element/dom-label-2d.js.map +1 -0
  90. package/lib/src/owlly/element/element.d.ts +53 -0
  91. package/lib/src/owlly/element/element.js +76 -0
  92. package/lib/src/owlly/element/element.js.map +1 -0
  93. package/lib/src/owlly/element/floor-model.d.ts +83 -0
  94. package/lib/src/owlly/element/floor-model.js +228 -0
  95. package/lib/src/owlly/element/floor-model.js.map +1 -0
  96. package/lib/src/owlly/element/gif-kit/Gif.d.ts +96 -0
  97. package/lib/src/owlly/element/gif-kit/Gif.js +433 -0
  98. package/lib/src/owlly/element/gif-kit/Gif.js.map +1 -0
  99. package/lib/src/owlly/element/gif-kit/GifColor.d.ts +21 -0
  100. package/lib/src/owlly/element/gif-kit/GifColor.js +38 -0
  101. package/lib/src/owlly/element/gif-kit/GifColor.js.map +1 -0
  102. package/lib/src/owlly/element/gif-kit/GifCompressedCodesToByteArrayConverter.d.ts +20 -0
  103. package/lib/src/owlly/element/gif-kit/GifCompressedCodesToByteArrayConverter.js +51 -0
  104. package/lib/src/owlly/element/gif-kit/GifCompressedCodesToByteArrayConverter.js.map +1 -0
  105. package/lib/src/owlly/element/gif-kit/GifFrame.d.ts +31 -0
  106. package/lib/src/owlly/element/gif-kit/GifFrame.js +97 -0
  107. package/lib/src/owlly/element/gif-kit/GifFrame.js.map +1 -0
  108. package/lib/src/owlly/element/gif-kit/GifImage.d.ts +23 -0
  109. package/lib/src/owlly/element/gif-kit/GifImage.js +8 -0
  110. package/lib/src/owlly/element/gif-kit/GifImage.js.map +1 -0
  111. package/lib/src/owlly/element/gif-kit/GifParser.d.ts +17 -0
  112. package/lib/src/owlly/element/gif-kit/GifParser.js +197 -0
  113. package/lib/src/owlly/element/gif-kit/GifParser.js.map +1 -0
  114. package/lib/src/owlly/element/gif-kit/GifPresenter.d.ts +20 -0
  115. package/lib/src/owlly/element/gif-kit/GifPresenter.js +44 -0
  116. package/lib/src/owlly/element/gif-kit/GifPresenter.js.map +1 -0
  117. package/lib/src/owlly/element/gif-kit/GifVersion.d.ts +10 -0
  118. package/lib/src/owlly/element/gif-kit/GifVersion.js +13 -0
  119. package/lib/src/owlly/element/gif-kit/GifVersion.js.map +1 -0
  120. package/lib/src/owlly/element/gltf-mesh-element.d.ts +31 -0
  121. package/lib/src/owlly/element/gltf-mesh-element.js +137 -0
  122. package/lib/src/owlly/element/gltf-mesh-element.js.map +1 -0
  123. package/lib/src/owlly/element/index.d.ts +20 -0
  124. package/lib/src/owlly/element/index.js +25 -0
  125. package/lib/src/owlly/element/index.js.map +1 -0
  126. package/lib/src/owlly/element/map-kit/area.d.ts +24 -0
  127. package/lib/src/owlly/element/map-kit/area.js +218 -0
  128. package/lib/src/owlly/element/map-kit/area.js.map +1 -0
  129. package/lib/src/owlly/element/map-kit/block-set.d.ts +39 -0
  130. package/lib/src/owlly/element/map-kit/block-set.js +91 -0
  131. package/lib/src/owlly/element/map-kit/block-set.js.map +1 -0
  132. package/lib/src/owlly/element/map-kit/block.d.ts +77 -0
  133. package/lib/src/owlly/element/map-kit/block.js +339 -0
  134. package/lib/src/owlly/element/map-kit/block.js.map +1 -0
  135. package/lib/src/owlly/element/map-kit/index.d.ts +4 -0
  136. package/lib/src/owlly/element/map-kit/index.js +7 -0
  137. package/lib/src/owlly/element/map-kit/index.js.map +1 -0
  138. package/lib/src/owlly/element/map-kit/shape.d.ts +131 -0
  139. package/lib/src/owlly/element/map-kit/shape.js +190 -0
  140. package/lib/src/owlly/element/map-kit/shape.js.map +1 -0
  141. package/lib/src/owlly/element/mesh-element.d.ts +22 -0
  142. package/lib/src/owlly/element/mesh-element.js +64 -0
  143. package/lib/src/owlly/element/mesh-element.js.map +1 -0
  144. package/lib/src/owlly/element/mesh-line-2d.d.ts +82 -0
  145. package/lib/src/owlly/element/mesh-line-2d.js +888 -0
  146. package/lib/src/owlly/element/mesh-line-2d.js.map +1 -0
  147. package/lib/src/owlly/element/meshline-o.d.ts +64 -0
  148. package/lib/src/owlly/element/meshline-o.js +679 -0
  149. package/lib/src/owlly/element/meshline-o.js.map +1 -0
  150. package/lib/src/owlly/element/panorama-group.d.ts +241 -0
  151. package/lib/src/owlly/element/panorama-group.js +967 -0
  152. package/lib/src/owlly/element/panorama-group.js.map +1 -0
  153. package/lib/src/owlly/element/panorama.d.ts +132 -0
  154. package/lib/src/owlly/element/panorama.js +813 -0
  155. package/lib/src/owlly/element/panorama.js.map +1 -0
  156. package/lib/src/owlly/element/path-group.d.ts +69 -0
  157. package/lib/src/owlly/element/path-group.js +172 -0
  158. package/lib/src/owlly/element/path-group.js.map +1 -0
  159. package/lib/src/owlly/element/path.d.ts +99 -0
  160. package/lib/src/owlly/element/path.js +532 -0
  161. package/lib/src/owlly/element/path.js.map +1 -0
  162. package/lib/src/owlly/element/placeable-2d.d.ts +158 -0
  163. package/lib/src/owlly/element/placeable-2d.js +471 -0
  164. package/lib/src/owlly/element/placeable-2d.js.map +1 -0
  165. package/lib/src/owlly/element/polygon-mesh.d.ts +107 -0
  166. package/lib/src/owlly/element/polygon-mesh.js +308 -0
  167. package/lib/src/owlly/element/polygon-mesh.js.map +1 -0
  168. package/lib/src/owlly/element/ring-element.d.ts +79 -0
  169. package/lib/src/owlly/element/ring-element.js +384 -0
  170. package/lib/src/owlly/element/ring-element.js.map +1 -0
  171. package/lib/src/owlly/element/sphere-mesh.d.ts +28 -0
  172. package/lib/src/owlly/element/sphere-mesh.js +70 -0
  173. package/lib/src/owlly/element/sphere-mesh.js.map +1 -0
  174. package/lib/src/owlly/element/svg-floor-model.d.ts +22 -0
  175. package/lib/src/owlly/element/svg-floor-model.js +185 -0
  176. package/lib/src/owlly/element/svg-floor-model.js.map +1 -0
  177. package/lib/src/owlly/element/svg-floors.d.ts +27 -0
  178. package/lib/src/owlly/element/svg-floors.js +110 -0
  179. package/lib/src/owlly/element/svg-floors.js.map +1 -0
  180. package/lib/src/owlly/element/tile-panorama-group.d.ts +335 -0
  181. package/lib/src/owlly/element/tile-panorama-group.js +1007 -0
  182. package/lib/src/owlly/element/tile-panorama-group.js.map +1 -0
  183. package/lib/src/owlly/element/tile-panorama.d.ts +161 -0
  184. package/lib/src/owlly/element/tile-panorama.js +511 -0
  185. package/lib/src/owlly/element/tile-panorama.js.map +1 -0
  186. package/lib/src/owlly/element/tile-plane.d.ts +105 -0
  187. package/lib/src/owlly/element/tile-plane.js +361 -0
  188. package/lib/src/owlly/element/tile-plane.js.map +1 -0
  189. package/lib/src/owlly/element/video-element.d.ts +33 -0
  190. package/lib/src/owlly/element/video-element.js +160 -0
  191. package/lib/src/owlly/element/video-element.js.map +1 -0
  192. package/lib/src/owlly/geometries/ExtrudeGeometry2.d.ts +15 -0
  193. package/lib/src/owlly/geometries/ExtrudeGeometry2.js +211 -0
  194. package/lib/src/owlly/geometries/ExtrudeGeometry2.js.map +1 -0
  195. package/lib/src/owlly/index.d.ts +13 -0
  196. package/lib/src/owlly/index.js +17 -0
  197. package/lib/src/owlly/index.js.map +1 -0
  198. package/lib/src/owlly/overlay/canvas-overlay.d.ts +96 -0
  199. package/lib/src/owlly/overlay/canvas-overlay.js +511 -0
  200. package/lib/src/owlly/overlay/canvas-overlay.js.map +1 -0
  201. package/lib/src/owlly/overlay/css-2d-overlay.d.ts +14 -0
  202. package/lib/src/owlly/overlay/css-2d-overlay.js +36 -0
  203. package/lib/src/owlly/overlay/css-2d-overlay.js.map +1 -0
  204. package/lib/src/owlly/overlay/css-3d-overlay.d.ts +16 -0
  205. package/lib/src/owlly/overlay/css-3d-overlay.js +37 -0
  206. package/lib/src/owlly/overlay/css-3d-overlay.js.map +1 -0
  207. package/lib/src/owlly/overlay/index.d.ts +6 -0
  208. package/lib/src/owlly/overlay/index.js +12 -0
  209. package/lib/src/owlly/overlay/index.js.map +1 -0
  210. package/lib/src/owlly/overlay/label-overlay.d.ts +62 -0
  211. package/lib/src/owlly/overlay/label-overlay.js +329 -0
  212. package/lib/src/owlly/overlay/label-overlay.js.map +1 -0
  213. package/lib/src/owlly/overlay/overlay.d.ts +14 -0
  214. package/lib/src/owlly/overlay/overlay.js +5 -0
  215. package/lib/src/owlly/overlay/overlay.js.map +1 -0
  216. package/lib/src/owlly/overlay/path-overlay.d.ts +39 -0
  217. package/lib/src/owlly/overlay/path-overlay.js +125 -0
  218. package/lib/src/owlly/overlay/path-overlay.js.map +1 -0
  219. package/lib/src/owlly/overlay/path-overlay2.d.ts +35 -0
  220. package/lib/src/owlly/overlay/path-overlay2.js +119 -0
  221. package/lib/src/owlly/overlay/path-overlay2.js.map +1 -0
  222. package/lib/src/owlly/overlay/poi-overlay-3d.d.ts +278 -0
  223. package/lib/src/owlly/overlay/poi-overlay-3d.js +1433 -0
  224. package/lib/src/owlly/overlay/poi-overlay-3d.js.map +1 -0
  225. package/lib/src/owlly/overlay/poi-overlay.d.ts +277 -0
  226. package/lib/src/owlly/overlay/poi-overlay.js +1412 -0
  227. package/lib/src/owlly/overlay/poi-overlay.js.map +1 -0
  228. package/lib/src/owlly/owlly-2d/index.d.ts +28 -0
  229. package/lib/src/owlly/owlly-2d/index.js +93 -0
  230. package/lib/src/owlly/owlly-2d/index.js.map +1 -0
  231. package/lib/src/owlly/screen/index.d.ts +1 -0
  232. package/lib/src/owlly/screen/index.js +2 -0
  233. package/lib/src/owlly/screen/index.js.map +1 -0
  234. package/lib/src/owlly/screen/screen.d.ts +73 -0
  235. package/lib/src/owlly/screen/screen.js +237 -0
  236. package/lib/src/owlly/screen/screen.js.map +1 -0
  237. package/lib/src/owlly/stage/__test__/stage.spec.d.ts +1 -0
  238. package/lib/src/owlly/stage/__test__/stage.spec.js +15 -0
  239. package/lib/src/owlly/stage/__test__/stage.spec.js.map +1 -0
  240. package/lib/src/owlly/stage/externals.d.ts +19 -0
  241. package/lib/src/owlly/stage/externals.js +25 -0
  242. package/lib/src/owlly/stage/externals.js.map +1 -0
  243. package/lib/src/owlly/stage/index.d.ts +4 -0
  244. package/lib/src/owlly/stage/index.js +7 -0
  245. package/lib/src/owlly/stage/index.js.map +1 -0
  246. package/lib/src/owlly/stage/owlly.d.ts +38 -0
  247. package/lib/src/owlly/stage/owlly.js +168 -0
  248. package/lib/src/owlly/stage/owlly.js.map +1 -0
  249. package/lib/src/owlly/stage/stage.d.ts +108 -0
  250. package/lib/src/owlly/stage/stage.js +235 -0
  251. package/lib/src/owlly/stage/stage.js.map +1 -0
  252. package/lib/src/owlly/utils/alignment-utils.d.ts +20 -0
  253. package/lib/src/owlly/utils/alignment-utils.js +64 -0
  254. package/lib/src/owlly/utils/alignment-utils.js.map +1 -0
  255. package/lib/src/owlly/utils/basic-calc.d.ts +18 -0
  256. package/lib/src/owlly/utils/basic-calc.js +130 -0
  257. package/lib/src/owlly/utils/basic-calc.js.map +1 -0
  258. package/lib/src/owlly/utils/basic-tools.d.ts +71 -0
  259. package/lib/src/owlly/utils/basic-tools.js +236 -0
  260. package/lib/src/owlly/utils/basic-tools.js.map +1 -0
  261. package/lib/src/owlly/utils/bvh-tree.d.ts +105 -0
  262. package/lib/src/owlly/utils/bvh-tree.js +540 -0
  263. package/lib/src/owlly/utils/bvh-tree.js.map +1 -0
  264. package/lib/src/owlly/utils/camera.d.ts +37 -0
  265. package/lib/src/owlly/utils/camera.js +51 -0
  266. package/lib/src/owlly/utils/camera.js.map +1 -0
  267. package/lib/src/owlly/utils/cube-texture-cache.d.ts +25 -0
  268. package/lib/src/owlly/utils/cube-texture-cache.js +144 -0
  269. package/lib/src/owlly/utils/cube-texture-cache.js.map +1 -0
  270. package/lib/src/owlly/utils/device-utils.d.ts +18 -0
  271. package/lib/src/owlly/utils/device-utils.js +42 -0
  272. package/lib/src/owlly/utils/device-utils.js.map +1 -0
  273. package/lib/src/owlly/utils/environment-utils.d.ts +37 -0
  274. package/lib/src/owlly/utils/environment-utils.js +74 -0
  275. package/lib/src/owlly/utils/environment-utils.js.map +1 -0
  276. package/lib/src/owlly/utils/event-hub.d.ts +50 -0
  277. package/lib/src/owlly/utils/event-hub.js +107 -0
  278. package/lib/src/owlly/utils/event-hub.js.map +1 -0
  279. package/lib/src/owlly/utils/events.d.ts +219 -0
  280. package/lib/src/owlly/utils/events.js +220 -0
  281. package/lib/src/owlly/utils/events.js.map +1 -0
  282. package/lib/src/owlly/utils/geometry-utils.d.ts +119 -0
  283. package/lib/src/owlly/utils/geometry-utils.js +623 -0
  284. package/lib/src/owlly/utils/geometry-utils.js.map +1 -0
  285. package/lib/src/owlly/utils/helper.d.ts +6 -0
  286. package/lib/src/owlly/utils/helper.js +25 -0
  287. package/lib/src/owlly/utils/helper.js.map +1 -0
  288. package/lib/src/owlly/utils/index.d.ts +14 -0
  289. package/lib/src/owlly/utils/index.js +18 -0
  290. package/lib/src/owlly/utils/index.js.map +1 -0
  291. package/lib/src/owlly/utils/lru-cache.d.ts +26 -0
  292. package/lib/src/owlly/utils/lru-cache.js +110 -0
  293. package/lib/src/owlly/utils/lru-cache.js.map +1 -0
  294. package/lib/src/owlly/utils/map-utils.d.ts +7 -0
  295. package/lib/src/owlly/utils/map-utils.js +53 -0
  296. package/lib/src/owlly/utils/map-utils.js.map +1 -0
  297. package/lib/src/owlly/utils/number-utils.d.ts +8 -0
  298. package/lib/src/owlly/utils/number-utils.js +73 -0
  299. package/lib/src/owlly/utils/number-utils.js.map +1 -0
  300. package/lib/src/owlly/utils/panorama-model-util.d.ts +46 -0
  301. package/lib/src/owlly/utils/panorama-model-util.js +246 -0
  302. package/lib/src/owlly/utils/panorama-model-util.js.map +1 -0
  303. package/lib/src/owlly/utils/path-utils.d.ts +80 -0
  304. package/lib/src/owlly/utils/path-utils.js +729 -0
  305. package/lib/src/owlly/utils/path-utils.js.map +1 -0
  306. package/lib/src/owlly/utils/svgutils.d.ts +138 -0
  307. package/lib/src/owlly/utils/svgutils.js +562 -0
  308. package/lib/src/owlly/utils/svgutils.js.map +1 -0
  309. package/lib/src/owlly/utils/texture-cache.d.ts +29 -0
  310. package/lib/src/owlly/utils/texture-cache.js +116 -0
  311. package/lib/src/owlly/utils/texture-cache.js.map +1 -0
  312. package/lib/src/owlly/utils/tile-util.d.ts +187 -0
  313. package/lib/src/owlly/utils/tile-util.js +457 -0
  314. package/lib/src/owlly/utils/tile-util.js.map +1 -0
  315. package/lib/src/owlly/utils/time-profiler.d.ts +21 -0
  316. package/lib/src/owlly/utils/time-profiler.js +49 -0
  317. package/lib/src/owlly/utils/time-profiler.js.map +1 -0
  318. package/lib/src/owlly/view/__test__/perspective-view.spec.d.ts +0 -0
  319. package/lib/src/owlly/view/__test__/perspective-view.spec.js +22 -0
  320. package/lib/src/owlly/view/__test__/perspective-view.spec.js.map +1 -0
  321. package/lib/src/owlly/view/camera-view.d.ts +35 -0
  322. package/lib/src/owlly/view/camera-view.js +102 -0
  323. package/lib/src/owlly/view/camera-view.js.map +1 -0
  324. package/lib/src/owlly/view/index.d.ts +3 -0
  325. package/lib/src/owlly/view/index.js +6 -0
  326. package/lib/src/owlly/view/index.js.map +1 -0
  327. package/lib/src/owlly/view/orthographic-view.d.ts +40 -0
  328. package/lib/src/owlly/view/orthographic-view.js +95 -0
  329. package/lib/src/owlly/view/orthographic-view.js.map +1 -0
  330. package/lib/src/owlly/view/perspective-view.d.ts +40 -0
  331. package/lib/src/owlly/view/perspective-view.js +96 -0
  332. package/lib/src/owlly/view/perspective-view.js.map +1 -0
  333. package/lib/src/owlly/view/svg-map-view.d.ts +46 -0
  334. package/lib/src/owlly/view/svg-map-view.js +145 -0
  335. package/lib/src/owlly/view/svg-map-view.js.map +1 -0
  336. package/lib/src/owlly/view/view.d.ts +146 -0
  337. package/lib/src/owlly/view/view.js +318 -0
  338. package/lib/src/owlly/view/view.js.map +1 -0
  339. package/lib/src/web/main.centroid.d.ts +0 -0
  340. package/lib/src/web/main.centroid.js +74 -0
  341. package/lib/src/web/main.centroid.js.map +1 -0
  342. package/lib/src/web/main.hyma.meshline2d.d.ts +1 -0
  343. package/lib/src/web/main.hyma.meshline2d.js +76 -0
  344. package/lib/src/web/main.hyma.meshline2d.js.map +1 -0
  345. package/lib/src/web/main.jyfang.sample.d.ts +0 -0
  346. package/lib/src/web/main.jyfang.sample.js +122 -0
  347. package/lib/src/web/main.jyfang.sample.js.map +1 -0
  348. package/lib/src/web/main.rpeng.extrude.d.ts +1 -0
  349. package/lib/src/web/main.rpeng.extrude.js +180 -0
  350. package/lib/src/web/main.rpeng.extrude.js.map +1 -0
  351. package/lib/src/web/main.rpeng.mes.plane.d.ts +1 -0
  352. package/lib/src/web/main.rpeng.mes.plane.js +135 -0
  353. package/lib/src/web/main.rpeng.mes.plane.js.map +1 -0
  354. package/lib/src/web/main.rpeng.sample.d.ts +0 -0
  355. package/lib/src/web/main.rpeng.sample.js +318 -0
  356. package/lib/src/web/main.rpeng.sample.js.map +1 -0
  357. package/lib/src/web/main.rpeng.vr.d.ts +1 -0
  358. package/lib/src/web/main.rpeng.vr.js +141 -0
  359. package/lib/src/web/main.rpeng.vr.js.map +1 -0
  360. package/lib/src/web/main.sample.d.ts +1 -0
  361. package/lib/src/web/main.sample.js +52 -0
  362. package/lib/src/web/main.sample.js.map +1 -0
  363. package/lib/src/web/quattree.hyma.d.ts +0 -0
  364. package/lib/src/web/quattree.hyma.js +150 -0
  365. package/lib/src/web/quattree.hyma.js.map +1 -0
  366. package/lib/src/web/sensor-vr-plugin.d.ts +0 -0
  367. package/lib/src/web/sensor-vr-plugin.js +166 -0
  368. package/lib/src/web/sensor-vr-plugin.js.map +1 -0
  369. package/package.json +142 -0
  370. package/src/@types/SceneUtils.d.ts +9 -0
  371. package/src/@types/chaikin-smooth.d.ts +5 -0
  372. package/src/@types/global.d.ts +3 -0
  373. package/src/@types/snapsvg.d.ts +11 -0
  374. package/src/@types/svgson.d.ts +30 -0
  375. package/src/assets/favicon.ico +0 -0
  376. package/src/external/lines/line-geometry.ts +70 -0
  377. package/src/external/lines/line-material.ts +453 -0
  378. package/src/external/lines/line-segments-2.ts +194 -0
  379. package/src/external/lines/line-segments-geometry.ts +197 -0
  380. package/src/external/loaders/gltf-loader.ts +3004 -0
  381. package/src/external/orbit-controls.ts +1070 -0
  382. package/src/external/renderers/css-2d-renderer.ts +185 -0
  383. package/src/external/renderers/css-3d-renderer.ts +245 -0
  384. package/src/external/transform-controls.ts +1532 -0
  385. package/src/external/util/buffer-geometry-utils.ts +783 -0
  386. package/src/owlly/controller/aerial-element-controller.ts +277 -0
  387. package/src/owlly/controller/basic-controller.ts +1509 -0
  388. package/src/owlly/controller/camera-controller.ts +155 -0
  389. package/src/owlly/controller/controller.ts +76 -0
  390. package/src/owlly/controller/index.ts +15 -0
  391. package/src/owlly/controller/mouse-indicator-controller.ts +157 -0
  392. package/src/owlly/controller/orbit-control.ts +310 -0
  393. package/src/owlly/controller/panorama-adjust-controller.ts +183 -0
  394. package/src/owlly/controller/panorama-controller.ts +2234 -0
  395. package/src/owlly/controller/panorama-transform-controller.ts +151 -0
  396. package/src/owlly/controller/plane-controller.ts +222 -0
  397. package/src/owlly/controller/texture-controller.ts +949 -0
  398. package/src/owlly/controller/tile-panorama-controller.ts +1633 -0
  399. package/src/owlly/controller/transform-controller.ts +684 -0
  400. package/src/owlly/element/bottom-nav-element.ts +352 -0
  401. package/src/owlly/element/camera.ts +389 -0
  402. package/src/owlly/element/dom-2d-element.ts +88 -0
  403. package/src/owlly/element/dom-3d-element.ts +87 -0
  404. package/src/owlly/element/dom-label-2d.ts +497 -0
  405. package/src/owlly/element/element.ts +117 -0
  406. package/src/owlly/element/floor-model.ts +290 -0
  407. package/src/owlly/element/gif-kit/Gif.ts +509 -0
  408. package/src/owlly/element/gif-kit/GifColor.ts +44 -0
  409. package/src/owlly/element/gif-kit/GifCompressedCodesToByteArrayConverter.ts +56 -0
  410. package/src/owlly/element/gif-kit/GifFrame.ts +207 -0
  411. package/src/owlly/element/gif-kit/GifImage.ts +26 -0
  412. package/src/owlly/element/gif-kit/GifParser.ts +254 -0
  413. package/src/owlly/element/gif-kit/GifPresenter.ts +46 -0
  414. package/src/owlly/element/gif-kit/GifVersion.ts +12 -0
  415. package/src/owlly/element/gltf-mesh-element.ts +184 -0
  416. package/src/owlly/element/index.ts +25 -0
  417. package/src/owlly/element/map-kit/area.ts +232 -0
  418. package/src/owlly/element/map-kit/block-set.ts +102 -0
  419. package/src/owlly/element/map-kit/block.ts +417 -0
  420. package/src/owlly/element/map-kit/index.ts +6 -0
  421. package/src/owlly/element/map-kit/shape.ts +285 -0
  422. package/src/owlly/element/mesh-element.ts +94 -0
  423. package/src/owlly/element/mesh-line-2d.ts +1032 -0
  424. package/src/owlly/element/meshline-o.ts +802 -0
  425. package/src/owlly/element/panorama-group.ts +1250 -0
  426. package/src/owlly/element/panorama.ts +1044 -0
  427. package/src/owlly/element/path-group.ts +212 -0
  428. package/src/owlly/element/path.ts +727 -0
  429. package/src/owlly/element/placeable-2d.ts +627 -0
  430. package/src/owlly/element/polygon-mesh.ts +344 -0
  431. package/src/owlly/element/ring-element.ts +517 -0
  432. package/src/owlly/element/sphere-mesh.ts +96 -0
  433. package/src/owlly/element/svg-floor-model.ts +200 -0
  434. package/src/owlly/element/svg-floors.ts +121 -0
  435. package/src/owlly/element/tile-panorama-group.ts +1314 -0
  436. package/src/owlly/element/tile-panorama.ts +636 -0
  437. package/src/owlly/element/tile-plane.ts +430 -0
  438. package/src/owlly/element/video-element.ts +190 -0
  439. package/src/owlly/geometries/ExtrudeGeometry2.ts +255 -0
  440. package/src/owlly/index.ts +19 -0
  441. package/src/owlly/overlay/canvas-overlay.ts +642 -0
  442. package/src/owlly/overlay/css-2d-overlay.ts +48 -0
  443. package/src/owlly/overlay/css-3d-overlay.ts +50 -0
  444. package/src/owlly/overlay/index.ts +11 -0
  445. package/src/owlly/overlay/label-overlay.ts +419 -0
  446. package/src/owlly/overlay/overlay.ts +17 -0
  447. package/src/owlly/overlay/path-overlay.ts +170 -0
  448. package/src/owlly/overlay/path-overlay2.ts +149 -0
  449. package/src/owlly/overlay/poi-overlay-3d.ts +1759 -0
  450. package/src/owlly/overlay/poi-overlay.ts +1739 -0
  451. package/src/owlly/owlly-2d/index.ts +108 -0
  452. package/src/owlly/screen/index.ts +1 -0
  453. package/src/owlly/screen/screen.ts +323 -0
  454. package/src/owlly/stage/__test__/stage.spec.ts +15 -0
  455. package/src/owlly/stage/externals.ts +45 -0
  456. package/src/owlly/stage/index.ts +12 -0
  457. package/src/owlly/stage/owlly.ts +223 -0
  458. package/src/owlly/stage/stage.ts +274 -0
  459. package/src/owlly/utils/alignment-utils.ts +84 -0
  460. package/src/owlly/utils/basic-calc.ts +141 -0
  461. package/src/owlly/utils/basic-tools.ts +286 -0
  462. package/src/owlly/utils/bvh-tree.ts +695 -0
  463. package/src/owlly/utils/camera.ts +72 -0
  464. package/src/owlly/utils/cube-texture-cache.ts +155 -0
  465. package/src/owlly/utils/device-utils.ts +53 -0
  466. package/src/owlly/utils/environment-utils.ts +81 -0
  467. package/src/owlly/utils/event-hub.ts +120 -0
  468. package/src/owlly/utils/events.ts +266 -0
  469. package/src/owlly/utils/geometry-utils.ts +749 -0
  470. package/src/owlly/utils/helper.ts +33 -0
  471. package/src/owlly/utils/index.ts +17 -0
  472. package/src/owlly/utils/lru-cache.ts +126 -0
  473. package/src/owlly/utils/map-utils.ts +55 -0
  474. package/src/owlly/utils/number-utils.ts +75 -0
  475. package/src/owlly/utils/panorama-model-util.ts +255 -0
  476. package/src/owlly/utils/path-utils.ts +837 -0
  477. package/src/owlly/utils/svgutils.ts +732 -0
  478. package/src/owlly/utils/texture-cache.ts +132 -0
  479. package/src/owlly/utils/tile-util.ts +563 -0
  480. package/src/owlly/utils/time-profiler.ts +57 -0
  481. package/src/owlly/view/__test__/perspective-view.spec.ts +23 -0
  482. package/src/owlly/view/camera-view.ts +114 -0
  483. package/src/owlly/view/index.ts +5 -0
  484. package/src/owlly/view/orthographic-view.ts +124 -0
  485. package/src/owlly/view/perspective-view.ts +125 -0
  486. package/src/owlly/view/svg-map-view.ts +187 -0
  487. package/src/owlly/view/view.ts +409 -0
  488. package/src/public/js/jsmpeg.min.js +3129 -0
  489. package/src/web/index.html +52 -0
  490. package/src/web/main.centroid.ts +85 -0
  491. package/src/web/main.hyma.meshline2d.ts +84 -0
  492. package/src/web/main.jyfang.sample.ts +139 -0
  493. package/src/web/main.rpeng.extrude.ts +194 -0
  494. package/src/web/main.rpeng.mes.plane.ts +161 -0
  495. package/src/web/main.rpeng.sample.ts +345 -0
  496. package/src/web/main.rpeng.vr.ts +159 -0
  497. package/src/web/main.sample.ts +59 -0
  498. package/src/web/quattree.hyma.ts +163 -0
  499. package/src/web/sensor-vr-plugin.ts +201 -0
  500. package/src/web/testPixel.png +0 -0
@@ -0,0 +1,511 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { Externals } from '../stage/externals';
11
+ import { Element, ElementFrameContext } from './element';
12
+ import { EventHub } from '../utils/event-hub';
13
+ import { Events, OwllyEvents } from '../utils/events';
14
+ import { DeviceUtils } from '../utils/device-utils';
15
+ import { TilePlaneUtil } from './tile-plane';
16
+ import { CubeFaceConfig, TileTextureInfo, TileUtil } from '../utils/tile-util';
17
+ let sphereInstance;
18
+ const TILE_PANORAMA_SIZE = 2;
19
+ /**
20
+ * 全景图对象
21
+ * @noInheritDoc
22
+ */
23
+ class TilePanorama extends Element {
24
+ /**
25
+ * @param textureURLs 低清立方体贴图六张图的URL数组(本地相对路径或网络URL均可),按右左上下前后的顺序
26
+ * @param highTextureURLs 高清立方体贴图六张图的URL数组(本地相对路径或网络URL均可),按右左上下前后的顺序
27
+ * @param useLowTextureURLsOnly 可选,设置后则(如果没有提供瓦片贴图)只使用低清立方体贴图
28
+ * @param tiledTextureURLRoot 可选,瓦片贴图URL的前缀部分,若没有则用highTextureURLs和lowTextureURLs作为贴图源
29
+ */
30
+ constructor(pid, seqID, textureURLs, neighborPanoramaIDs = [], levelMax, offLinTextureUrls, offLineTextureLevel, position, quaternion) {
31
+ super();
32
+ this.level = 0;
33
+ /** @ignore */
34
+ this.levelMax = 0;
35
+ /** @ignore */
36
+ this.offLineTextureLevel = -1;
37
+ this.pid = pid;
38
+ this.seqID = seqID;
39
+ this.textureURLs = textureURLs;
40
+ this.levelMax = levelMax;
41
+ this.neighborPanoramaIDs = neighborPanoramaIDs;
42
+ this.offLinTextureUrls = offLinTextureUrls || [];
43
+ if (offLineTextureLevel != null) {
44
+ this.offLineTextureLevel = offLineTextureLevel;
45
+ }
46
+ this.initialized = false;
47
+ this.mounted = false;
48
+ this.needsUpdate = false;
49
+ this.tilePlanes = [];
50
+ this.isPlayingVideo = false;
51
+ this.videoCanvas = null;
52
+ this.videoContentType = 'mp4';
53
+ this.setTransform(position, quaternion);
54
+ }
55
+ /**
56
+ * 关联包围框
57
+ * @param size
58
+ */
59
+ linkLineBox(size) {
60
+ const { THREE } = Externals.getInstance();
61
+ const boxGeometry = new THREE.BoxBufferGeometry(size, size, size);
62
+ this.wireFrame = new THREE.LineSegments(new THREE.EdgesGeometry(boxGeometry), new THREE.LineBasicMaterial({ color: 0xff0000 }));
63
+ this.wireFrame.material.visible = false;
64
+ this.wireFrame.renderOrder = 100;
65
+ this.add(this.wireFrame);
66
+ }
67
+ /**
68
+ * 关联球
69
+ * @returns
70
+ */
71
+ linkShere() {
72
+ const { THREE } = Externals.getInstance();
73
+ if (!sphereInstance) {
74
+ const sphereGeometry = new THREE.SphereBufferGeometry(1, 60, 40);
75
+ sphereGeometry.scale(1, -1, 1);
76
+ sphereGeometry.rotateY(-90 * Math.PI / 180.0);
77
+ sphereInstance = new THREE.Mesh(sphereGeometry);
78
+ sphereInstance.visible = false;
79
+ sphereInstance.renderOrder = 150;
80
+ }
81
+ else {
82
+ // sphereInstance.matrix.identity();
83
+ }
84
+ // sphereInstance.applyMatrix4(matrix);
85
+ return sphereInstance;
86
+ }
87
+ /**
88
+ * 挂载
89
+ * @ignore
90
+ */
91
+ mount() {
92
+ TilePlaneUtil.setPlanesVisible(true);
93
+ this.tilePlanes = TilePlaneUtil.getPlanesByMatrix(this.pid, this.level, this.textureURLs, this.offLineTextureLevel, this.offLinTextureUrls);
94
+ this.tilePlanes.forEach((plane) => {
95
+ this.add(plane);
96
+ plane.visible = true;
97
+ // plane.renderOnce();
98
+ });
99
+ console.log("this.tilePlanes", this.tilePlanes);
100
+ // this.sphereMesh = this.linkShere();
101
+ this.linkLineBox(TILE_PANORAMA_SIZE);
102
+ // this.add(this.sphereMesh);
103
+ this.mounted = true;
104
+ this.emit(Events.DID_LOAD_PANORAMA, this.pid);
105
+ }
106
+ /**
107
+ * 卸载
108
+ */
109
+ unMount() {
110
+ TilePlaneUtil.setPlanesVisible(false);
111
+ this.tilePlanes.forEach((plane) => {
112
+ // plane.visible = false;
113
+ this.remove(plane);
114
+ });
115
+ this.tilePlanes = [];
116
+ if (this.sphereMesh) {
117
+ this.remove();
118
+ this.sphereMesh = null;
119
+ }
120
+ this.mounted = false;
121
+ }
122
+ /**
123
+ * 更新等级
124
+ * @param level
125
+ */
126
+ updateLevel(level) {
127
+ const tLevel = Math.min(level, this.levelMax);
128
+ if (this.level !== tLevel) {
129
+ this.level = tLevel;
130
+ if (this.tilePlanes) {
131
+ this.tilePlanes.forEach((plane) => {
132
+ plane.level = tLevel;
133
+ });
134
+ }
135
+ }
136
+ }
137
+ /**
138
+ * 获取预处理纹理信息
139
+ * @returns
140
+ */
141
+ getPreTextureInfos() {
142
+ const ref = [];
143
+ CubeFaceConfig.forEach((config, index) => {
144
+ const { face, } = config;
145
+ const { level, textureURLs, offLineTextureLevel, offLinTextureUrls, } = this;
146
+ const pPid = this.pid + (face + 1) / 10;
147
+ const count = TileUtil.getCount(this.level);
148
+ for (let i = 0; i < count; i++) {
149
+ const info = new TileTextureInfo(pPid, 0, level, i, textureURLs[index], offLineTextureLevel, offLinTextureUrls[index]);
150
+ if (level === 0) {
151
+ info.frize = true;
152
+ }
153
+ ref.push(info);
154
+ }
155
+ });
156
+ return ref;
157
+ }
158
+ /**
159
+ * 设置位移
160
+ * @param position
161
+ * @param quaternion
162
+ */
163
+ setTransform(position, quaternion) {
164
+ if (position) {
165
+ this.position.copy(position);
166
+ }
167
+ if (quaternion) {
168
+ this.quaternion.copy(quaternion);
169
+ }
170
+ const { THREE } = Externals.getInstance();
171
+ this.baseQuaternion = new THREE.Quaternion().copy(this.quaternion);
172
+ this.additionalQuaternion = new THREE.Quaternion();
173
+ /* eslint-disable no-underscore-dangle */
174
+ const onQuaternionChangeCallback = this.quaternion._onChangeCallback;
175
+ this.quaternion._onChange(() => {
176
+ onQuaternionChangeCallback();
177
+ const targetQuaternion = new THREE.Quaternion()
178
+ .multiplyQuaternions(this.baseQuaternion, this.additionalQuaternion);
179
+ if (targetQuaternion.equals(this.quaternion))
180
+ return;
181
+ this.baseQuaternion = this.quaternion.clone();
182
+ const { x, y, z, w, } = new THREE.Quaternion().multiplyQuaternions(this.baseQuaternion, this.additionalQuaternion);
183
+ this.quaternion.set(x, y, z, w);
184
+ this.needsUpdate = true;
185
+ });
186
+ const onRotationChangeCallback = this.rotation._onChangeCallback;
187
+ this.rotation._onChange(() => {
188
+ onRotationChangeCallback();
189
+ const reverse = this.additionalQuaternion.clone().invert();
190
+ this.baseQuaternion = this.quaternion.clone().multiply(reverse);
191
+ });
192
+ this.eventListeners = {
193
+ onPanoramaSelected: (panorama) => {
194
+ this.isSelected = panorama === this;
195
+ if (!this.isSelected)
196
+ return;
197
+ this.emit(Events.PANORAMA_SELECTED, this.pid);
198
+ },
199
+ onEnded: () => { },
200
+ };
201
+ EventHub.on(OwllyEvents.ELEMENT_SELECTED, this.eventListeners.onPanoramaSelected);
202
+ }
203
+ // /**
204
+ // * 为全景图对象设置立方体贴图
205
+ // * @param cubeTexture 立方体贴图对象
206
+ // */
207
+ // public setTexture(): void {
208
+ // this.needsUpdate = true;
209
+ // if (!this.panoramaLoaded) {
210
+ // this.emit(Events.DID_LOAD_PANORAMA, this.pid);
211
+ // }
212
+ // this.panoramaLoaded = true;
213
+ // }
214
+ /**
215
+ * 暂停视频播放
216
+ */
217
+ pauseVideo() {
218
+ if (this.videoContentType === 'ts') {
219
+ if (this.mpegVideoPlayer)
220
+ this.mpegVideoPlayer.pause();
221
+ }
222
+ else {
223
+ const videoElementID = `pano_vid_${this.pid}`;
224
+ this.video = this.video || document.getElementById(videoElementID);
225
+ if (!this.video) {
226
+ return;
227
+ }
228
+ this.video.pause();
229
+ }
230
+ }
231
+ /**
232
+ * 恢复视频播放
233
+ */
234
+ resumeVideo() {
235
+ return __awaiter(this, void 0, void 0, function* () {
236
+ if (this.videoContentType === 'ts') {
237
+ if (this.mpegVideoPlayer)
238
+ this.mpegVideoPlayer.play();
239
+ }
240
+ else {
241
+ const videoElementID = `pano_vid_${this.pid}`;
242
+ this.video = this.video || document.getElementById(videoElementID);
243
+ if (!this.video) {
244
+ return;
245
+ }
246
+ yield this.video.play();
247
+ }
248
+ });
249
+ }
250
+ /**
251
+ * 停止视频播放,并释放视频相关资源
252
+ */
253
+ stopVideo() {
254
+ if (!this.sphereMesh) {
255
+ return;
256
+ }
257
+ this.sphereMesh.visible = false;
258
+ if (this.videoContentType === 'ts') {
259
+ if (this.mpegVideoPlayer) {
260
+ this.mpegVideoPlayer.stop();
261
+ this.mpegVideoPlayer.destroy();
262
+ this.mpegVideoPlayer = null;
263
+ }
264
+ const canvasTexture = this.sphereMesh.material.map;
265
+ if (canvasTexture)
266
+ canvasTexture.dispose();
267
+ this.sphereMesh.material.dispose();
268
+ this.videoCanvas = null;
269
+ }
270
+ else {
271
+ const videoElementID = `pano_vid_${this.pid}`;
272
+ this.video = this.video || document.getElementById(videoElementID);
273
+ const videoTexture = this.sphereMesh.material.map;
274
+ if (videoTexture) {
275
+ videoTexture.dispose();
276
+ }
277
+ this.sphereMesh.material.dispose();
278
+ if (this.video) {
279
+ this.video.pause();
280
+ this.video.removeAttribute('src');
281
+ this.video.load();
282
+ this.video = null;
283
+ }
284
+ }
285
+ if (this.eventListeners.onEnded)
286
+ this.eventListeners.onEnded();
287
+ this.isPlayingVideo = false;
288
+ this.needsUpdate = true;
289
+ }
290
+ /**
291
+ * 开始视频播放
292
+ * @param videoURL 视频地址
293
+ * @param loop 是否循环播放
294
+ * @param callbacks 回调函数集合,可选
295
+ */
296
+ playVideo(videoURL, loop, callbacks, contentType = 'mp4', canvasSize = [2048, 2048]) {
297
+ if (!this.sphereMesh) {
298
+ return null;
299
+ }
300
+ const { THREE } = Externals.getInstance();
301
+ const { onReadyToPlay, onEnded, onPrepareToPlay } = callbacks || {};
302
+ this.videoContentType = contentType;
303
+ this.eventListeners.onEnded = onEnded || (() => { });
304
+ if (this.videoContentType === 'ts') {
305
+ if (!JSMpeg || !JSMpeg.Player)
306
+ throw new Error('JSMpeg is needed. Please get JSMpeg from https://github.com/phoboslab/jsmpeg');
307
+ if (!this.videoCanvas) {
308
+ this.videoCanvas = document.createElement('canvas');
309
+ [this.videoCanvas.width, this.videoCanvas.height] = canvasSize;
310
+ }
311
+ this.mpegVideoPlayer = new JSMpeg.Player(videoURL, {
312
+ canvas: this.videoCanvas,
313
+ loop,
314
+ autoplay: false,
315
+ disableGl: false,
316
+ onSourceEstablished: () => {
317
+ this.needsUpdate = true;
318
+ if (onPrepareToPlay)
319
+ onPrepareToPlay();
320
+ },
321
+ onPlay: () => {
322
+ if (this.sphereMesh) {
323
+ this.sphereMesh.visible = true;
324
+ }
325
+ this.needsUpdate = true;
326
+ if (onReadyToPlay)
327
+ onReadyToPlay();
328
+ this.isPlayingVideo = true;
329
+ },
330
+ onPause: () => { },
331
+ onStalled: () => { },
332
+ onEnded: () => {
333
+ this.stopVideo();
334
+ },
335
+ chunkSize: 8 * 1024 * 1024,
336
+ videoBufferSize: 8 * 512 * 1024,
337
+ decodeFirstFrame: false,
338
+ preserveDrawingBuffer: false,
339
+ });
340
+ const texture = new THREE.CanvasTexture(this.videoCanvas);
341
+ texture.needsUpdate = true;
342
+ if (DeviceUtils.DetectIOS())
343
+ texture.flipY = false;
344
+ this.sphereMesh.material = new THREE.MeshBasicMaterial({
345
+ map: texture,
346
+ // side: DoubleSide,
347
+ transparent: false,
348
+ depthTest: false,
349
+ depthWrite: false,
350
+ });
351
+ this.mpegVideoPlayer.source.established = false;
352
+ this.mpegVideoPlayer.source.loadedSize = 0;
353
+ this.mpegVideoPlayer.demuxer.startTime = 0;
354
+ this.mpegVideoPlayer.demuxer.currentTime = 0;
355
+ this.mpegVideoPlayer.demuxer.bits = null;
356
+ this.mpegVideoPlayer.demuxer.leftoverBytes = null;
357
+ this.mpegVideoPlayer.audioOut.resetEnqueuedTime();
358
+ this.mpegVideoPlayer.audioOut.unlock();
359
+ this.mpegVideoPlayer.seek(0);
360
+ this.mpegVideoPlayer.play();
361
+ }
362
+ else {
363
+ const videoElementID = `pano_vid_${this.pid}`;
364
+ this.video = document.getElementById(videoElementID);
365
+ if (!this.video) {
366
+ this.video = document.createElement('video');
367
+ this.video.id = videoElementID;
368
+ this.video.setAttribute('webkit-playsinline', 'true');
369
+ this.video.setAttribute('x5-playsinline', 'true');
370
+ this.video.setAttribute('playsinline', 'true');
371
+ this.video.setAttribute('crossorigin', 'anonymous');
372
+ // console.info('#Video# video', video);
373
+ }
374
+ this.video.src = videoURL;
375
+ this.video.loop = !!loop;
376
+ this.video.addEventListener('playing', () => {
377
+ // console.info('#Video# playing', ev);
378
+ if (this.sphereMesh) {
379
+ this.sphereMesh.visible = true;
380
+ }
381
+ this.needsUpdate = true;
382
+ if (onReadyToPlay) {
383
+ onReadyToPlay(this.video);
384
+ }
385
+ this.isPlayingVideo = true;
386
+ });
387
+ this.video.addEventListener('ended', () => {
388
+ this.stopVideo();
389
+ });
390
+ this.video.addEventListener('play', () => {
391
+ // console.info('#Video# play', ev);
392
+ this.needsUpdate = true;
393
+ if (onPrepareToPlay) {
394
+ onPrepareToPlay(this.video);
395
+ }
396
+ });
397
+ this.video.play();
398
+ const texture = new THREE.VideoTexture(this.video);
399
+ texture.needsUpdate = true;
400
+ this.sphereMesh.material = new THREE.MeshBasicMaterial({
401
+ map: texture,
402
+ // side: DoubleSide,
403
+ transparent: false,
404
+ depthTest: false,
405
+ depthWrite: false,
406
+ });
407
+ return this.video;
408
+ }
409
+ return null;
410
+ }
411
+ /**
412
+ * 设置是否只使用低分辨率贴图
413
+ * @param useLowTexturesOnly 是否只使用低分辨率贴图
414
+ */
415
+ setUseLowTexturesOnly(useLowTexturesOnly) {
416
+ this.useLowTextureURLsOnly = useLowTexturesOnly;
417
+ }
418
+ /**
419
+ * 是否使用地分辨率贴图
420
+ * @returns
421
+ */
422
+ isUseLowTexturesOnly() {
423
+ return this.useLowTextureURLsOnly;
424
+ }
425
+ /**
426
+ * 清理
427
+ */
428
+ dispose() {
429
+ super.dispose();
430
+ if (this.mounted) {
431
+ this.unMount();
432
+ }
433
+ this.initialized = false;
434
+ EventHub.off(OwllyEvents.ELEMENT_SELECTED, this.eventListeners.onPanoramaSelected);
435
+ }
436
+ /**
437
+ * @ignore
438
+ */
439
+ update() {
440
+ const frameContext = new ElementFrameContext(this);
441
+ if (!this.initialized) {
442
+ this.initialized = true;
443
+ frameContext.needUpdate = true;
444
+ }
445
+ else if (this.needsUpdate || this.isPlayingVideo) {
446
+ frameContext.needUpdate = true;
447
+ if (this.sphereMesh
448
+ && this.isPlayingVideo
449
+ && this.videoCanvas
450
+ && this.sphereMesh.material.map) {
451
+ this.sphereMesh.material.map.needsUpdate = true;
452
+ }
453
+ this.needsUpdate = false;
454
+ }
455
+ if (this.initialized && !this.parent) {
456
+ frameContext.shouldPlaceElement = true;
457
+ }
458
+ return frameContext;
459
+ }
460
+ /**
461
+ * 使用欧拉角模式设置矫正
462
+ * @param roll 横滚角, 坐标轴为x
463
+ * @param pitch 俯仰角, 坐标轴为y
464
+ * @param yaw 偏航角, 坐标轴为z
465
+ */
466
+ setAdditionalRotationInEuler(roll, pitch, yaw) {
467
+ const { THREE } = Externals.getInstance();
468
+ this.additionalQuaternion.setFromEuler(new THREE.Euler(roll, pitch, yaw));
469
+ const { x, y, z, w, } = this.baseQuaternion.clone().multiply(this.additionalQuaternion);
470
+ this.quaternion.set(x, y, z, w);
471
+ this.needsUpdate = true;
472
+ return this.additionalQuaternion.clone();
473
+ }
474
+ /**
475
+ * 使用四元数模式设置矫正
476
+ * @param x 四元数的x值
477
+ * @param y 四元数的y值
478
+ * @param z 四元数的y值
479
+ * @param w 四元数的w值
480
+ */
481
+ setAdditionalRotationInQuaternion(x, y, z, w) {
482
+ const { THREE } = Externals.getInstance();
483
+ this.additionalQuaternion.set(x, y, z, w);
484
+ const { x: tx, y: ty, z: tz, w: tw, } = this.baseQuaternion.clone().multiply(this.additionalQuaternion);
485
+ this.quaternion.set(tx, ty, tz, tw);
486
+ this.needsUpdate = true;
487
+ return new THREE.Euler().setFromQuaternion(this.additionalQuaternion);
488
+ }
489
+ // /**
490
+ // * @ignore
491
+ // * @param view
492
+ // * @returns
493
+ // */
494
+ // public renderingViewChanged(view: View): void {
495
+ // if (!view.camera) return;
496
+ // super.renderingViewChanged(view);
497
+ // this.tilePlanes.forEach((tilePlane) => {
498
+ // tilePlane.renderingViewChanged(view);
499
+ // });
500
+ // }
501
+ /**
502
+ * 获取盒子
503
+ * @ignore
504
+ * @returns
505
+ */
506
+ getBox() {
507
+ return { size: 2, matrix: this.matrix };
508
+ }
509
+ }
510
+ export { TilePanorama };
511
+ //# sourceMappingURL=tile-panorama.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tile-panorama.js","sourceRoot":"","sources":["../../../../src/owlly/element/tile-panorama.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAY,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEtD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAa,aAAa,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,QA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AAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,OAAO,IAAI,CAAC,oBAAoB,CAAC,KAAK,EAAE,CAAC;IAC3C,CAAC;IAED;;;;;;OAMG;IACI,iCAAiC,CACtC,CAAS,EACT,CAAS,EACT,CAAS,EACT,CAAS;QAET,MAAM,EAAE,KAAK,EAAE,GAAG,SAAS,CAAC,WAAW,EAAE,CAAC;QAC1C,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAC1C,MAAM,EACJ,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,GAC3B,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;QACpE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QACpC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,OAAO,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;IACxE,CAAC;IAED,MAAM;IACN,aAAa;IACb,iBAAiB;IACjB,cAAc;IACd,MAAM;IACN,kDAAkD;IAClD,8BAA8B;IAC9B,sCAAsC;IACtC,6CAA6C;IAC7C,4CAA4C;IAC5C,QAAQ;IACR,IAAI;IAEJ;;;;OAIG;IACI,MAAM;QACX,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;IAC1C,CAAC;CACF;AAED,OAAO,EAAE,YAAY,EAAiC,CAAC"}
@@ -0,0 +1,105 @@
1
+ import { NS_THREE } from '../stage/externals';
2
+ import { Element, ElementFrameContext, View } from '..';
3
+ import { TileTextureInfo } from '../utils/tile-util';
4
+ /**
5
+ * 瓦片平面,可以是平面,也可以是曲面
6
+ */
7
+ declare class TilePlane extends Element {
8
+ private initialized;
9
+ /** 全景面id @ignore */
10
+ pfid: number;
11
+ private planeGeometry;
12
+ private uniforms;
13
+ private plane;
14
+ private needsUpdate;
15
+ /** @ignore */
16
+ textureMap: Map<string, TileTextureInfo>;
17
+ /** @ignore */
18
+ level: number;
19
+ /** @ignore */
20
+ revers: boolean;
21
+ /** @ignore */
22
+ face: number;
23
+ /** @ignore */
24
+ flipX: boolean;
25
+ /** @ignore */
26
+ flipY: boolean;
27
+ /** @ignore */
28
+ textureRootUrl: string;
29
+ /** @ignore */
30
+ offLineTextureRootUrl?: string;
31
+ /** @ignore */
32
+ offLineTextureLevel: number;
33
+ /**
34
+ * 构造
35
+ * @param face 面数
36
+ * @param flipX x翻转
37
+ * @param flipY y翻转
38
+ */
39
+ constructor(face: number, flipX?: boolean, flipY?: boolean);
40
+ /**
41
+ * 更新面id
42
+ * @ignore
43
+ * @param pfid 全景面id
44
+ * @param level 全景等级
45
+ */
46
+ updatePfid(pfid: number, level: number): void;
47
+ /**
48
+ * 设置纹理
49
+ * @param max
50
+ * @param textures
51
+ */
52
+ private setTexturesUniforms;
53
+ /**
54
+ * 更新纹理
55
+ * @param textures
56
+ * @param textureMap
57
+ */
58
+ updateTextures(textures: NS_THREE.Texture[], textureMap: Map<string, TileTextureInfo>): void;
59
+ /**
60
+ * 更新纹理图
61
+ * @ignore
62
+ * @param textureMap
63
+ */
64
+ updateInfos(textureMap: Map<string, TileTextureInfo>): void;
65
+ /**
66
+ * 更新在相机中的信息
67
+ * @ignore
68
+ * @param view
69
+ * @returns
70
+ */
71
+ udpateInCamera(view: View): TileTextureInfo[];
72
+ /**
73
+ * 更新
74
+ * @returns
75
+ */
76
+ update(): ElementFrameContext;
77
+ renderOnce(): void;
78
+ }
79
+ /**
80
+ * 瓦片平面工具类
81
+ */
82
+ declare class TilePlaneUtil {
83
+ private static cubeMatrix;
84
+ /**
85
+ * 设置平面可见性
86
+ * @ignore
87
+ * @param visible
88
+ */
89
+ static setPlanesVisible(visible: boolean): void;
90
+ /**
91
+ * 根据矩阵获取平面组
92
+ * @ignore
93
+ * @param pid 全景id
94
+ * @param level 瓦片等级
95
+ * @param textureUrls 纹理地址
96
+ * @returns
97
+ */
98
+ static getPlanesByMatrix(pid: number, level: number, textureUrls: string[], offLineTextureLevel?: number, offLineTextureUrls?: string[]): TilePlane[];
99
+ /**
100
+ * 获取cube平面矩阵
101
+ * @returns
102
+ */
103
+ static getCubeMatrix(): NS_THREE.Matrix4[];
104
+ }
105
+ export { TilePlane, TilePlaneUtil };