@aibee/owlly 1.0.25 → 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,470 @@
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 { CSS2DObject } from '../../external/renderers/css-2d-renderer';
12
+ import { Element, ElementFrameContext } from './element';
13
+ import { EventHub } from '../utils/event-hub';
14
+ import { OwllyEvents, Events } from '../utils/events';
15
+ import { Gif } from './gif-kit/Gif';
16
+ import { GifPresenter } from './gif-kit/GifPresenter';
17
+ /**
18
+ * 2D贴图对象
19
+ * @noInheritDoc
20
+ */
21
+ class Placeable2D extends Element {
22
+ /**
23
+ * 注意:最好在[PanoramaController]初始化视角之前就添加好,否则会漏掉初始所在全景图的[MOVE_TO_PANORAMA]事件通知
24
+ * @param labelID 唯一ID
25
+ * @param url 图片地址
26
+ * @param options 可选参数,如矩形宽高
27
+ * @example
28
+ * ```typescript
29
+ * const placeable = new Placeable2D(1, url,
30
+ * {
31
+ * width: 0.3,
32
+ * height: 0.3,
33
+ * });
34
+ * stage.bindElement(placeable);
35
+ * ```
36
+ */
37
+ constructor(labelID, url, options) {
38
+ super();
39
+ // eslint-disable-next-line
40
+ this.frames = [];
41
+ this.labelID = labelID;
42
+ this.initialized = false;
43
+ this.needUpdate = false;
44
+ this.isEditingInView = new Map();
45
+ this.currentPID = -1;
46
+ this.movedToNewPanorama = true;
47
+ this.outOfRange = true;
48
+ this.currentDisplayTime = 0;
49
+ this.frameIndex = 0;
50
+ this.tileDispDuration = 60;
51
+ this.hidden = false;
52
+ const { THREE } = Externals.getInstance();
53
+ const { width, height, depthTest, } = options || {};
54
+ this.width = width || 0.1;
55
+ this.height = height || 0.1;
56
+ this.depthTest = depthTest || false;
57
+ const geometry = new THREE.PlaneBufferGeometry(this.width, this.height);
58
+ // 顶点着色器
59
+ const vertexShader = `
60
+ varying vec2 vUv;
61
+ void main(){
62
+ vUv = uv;
63
+ gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
64
+ }`;
65
+ // 片源着色器
66
+ const fragmentShader = `
67
+ uniform sampler2D map;
68
+ uniform vec4 blendColor;
69
+ uniform float opacity;
70
+ varying vec2 vUv;
71
+ void main(){
72
+ vec4 texColor = texture2D(map, vUv);
73
+ gl_FragColor = vec4((texColor * (1.0 - blendColor.a) + blendColor * blendColor.a).rgb, texColor.a) * vec4(1, 1, 1, opacity);
74
+ }`;
75
+ // uniform参数
76
+ this.uniforms = {
77
+ map: {
78
+ type: 't',
79
+ value: null,
80
+ },
81
+ blendColor: {
82
+ type: 'v4',
83
+ value: new THREE.Vector4(0, 0, 0, 0.0),
84
+ },
85
+ opacity: { value: 1 },
86
+ };
87
+ this.material = new THREE.ShaderMaterial({
88
+ // 设置透明属性,这样透过全景图就能看到标签
89
+ transparent: true,
90
+ vertexShader,
91
+ fragmentShader,
92
+ uniforms: this.uniforms,
93
+ depthTest: this.depthTest,
94
+ depthWrite: false,
95
+ name: 'placeable2DMaterial',
96
+ side: THREE.DoubleSide,
97
+ });
98
+ this.labelMesh = new THREE.Mesh(geometry, this.material);
99
+ this.labelMesh.renderOrder = 400;
100
+ this.add(this.labelMesh);
101
+ this.imgElement = document.createElement('div');
102
+ this.imgElement.style.pointerEvents = 'none';
103
+ this.imgElement.innerHTML = `<div><img width=50px height=50px src="${url}"></div>`;
104
+ this.cssObject = new CSS2DObject(this.imgElement);
105
+ this.add(this.cssObject);
106
+ this.viewConfigurations = new Map();
107
+ this.eventListeners = {
108
+ onMoveToPanorama: (pid, position) => {
109
+ this.updateCurrentBindingPanorama(pid, position);
110
+ },
111
+ onPositionChanged: (position, element, view) => {
112
+ if (element !== this)
113
+ return;
114
+ const { visible } = this.getViewConfigurationByPanoramaId(view, this.currentPID);
115
+ this.updateViewConfigurationByPanoramaId(view, this.currentPID, { visible, position });
116
+ },
117
+ };
118
+ // EventHub.on(OwllyEvents.RENDERING_VIEW_CHANGED, this.eventListeners.onCurrentViewChanged);
119
+ EventHub.on(Events.MOVE_TO_PANORAMA, this.eventListeners.onMoveToPanorama);
120
+ EventHub.on(OwllyEvents.ELEMENT_POSITION_UPDATED, this.eventListeners.onPositionChanged);
121
+ if (url)
122
+ this.load(url);
123
+ }
124
+ // private async parseStream(stream: SuperGifStream): Promise<void> {
125
+ // try {
126
+ // const parser = new SuperGifParser(stream, this.handler);
127
+ // await parser.parse();
128
+ // } catch (err) {
129
+ // // this.handleError('parse');
130
+ // }
131
+ // }
132
+ // private handler = {
133
+ // img: (imgs: any) => {
134
+ // console.log('-------------------------', imgs);
135
+ // },
136
+ // }
137
+ load(url) {
138
+ return __awaiter(this, void 0, void 0, function* () {
139
+ this.initialized = false;
140
+ const regex = /\.gif$/;
141
+ const n = url.search(regex);
142
+ const { THREE } = Externals.getInstance();
143
+ if (n > 0) {
144
+ const xhr = new XMLHttpRequest();
145
+ xhr.open('GET', url, true);
146
+ xhr.responseType = 'arraybuffer';
147
+ xhr.onload = () => __awaiter(this, void 0, void 0, function* () {
148
+ let arrayBuffer;
149
+ arrayBuffer = xhr.response;
150
+ this.gif = Gif.parse(arrayBuffer);
151
+ if (arrayBuffer.toString().indexOf('ArrayBuffer') > 0) {
152
+ arrayBuffer = new Uint8Array(arrayBuffer);
153
+ }
154
+ // const stream = new SuperGifStream(arrayBuffer);
155
+ // await this.parseStream(stream);
156
+ this.gif.split(true).forEach((i) => __awaiter(this, void 0, void 0, function* () {
157
+ const img = new Image();
158
+ const blob = GifPresenter.writeToBlob(i.writeToArrayBuffer());
159
+ // img.src = GifPresenter.writeToDataUrl(i.writeToArrayBuffer());
160
+ img.src = URL.createObjectURL(blob);
161
+ img.onload = () => __awaiter(this, void 0, void 0, function* () {
162
+ this.frames.push(img);
163
+ if (this.gif.frames.length === this.frames.length) {
164
+ this.frameIndex = 0;
165
+ this.currentDisplayTime = new Date().getTime();
166
+ const geometry = new THREE.PlaneBufferGeometry(this.width, this.height);
167
+ this.gifCanvas = document.createElement('canvas');
168
+ this.gifCanvas.width = this.gif.width;
169
+ this.gifCanvas.height = this.gif.height;
170
+ this.gifContext = this.gifCanvas.getContext('2d');
171
+ // document.body.appendChild(cnv);
172
+ if (this.gifContext) {
173
+ this.gifContext.drawImage(this.frames[this.frameIndex], 0, 0, this.gif.width, this.gif.height);
174
+ }
175
+ this.giftexture = new THREE.Texture(this.gifCanvas);
176
+ this.giftexture.needsUpdate = true;
177
+ this.gifMaterial = new THREE.MeshBasicMaterial({
178
+ map: this.giftexture,
179
+ transparent: true,
180
+ side: THREE.DoubleSide,
181
+ });
182
+ // this.gifMaterial = new MeshBasicMaterial({ color: 0x2194ce, transparent: true, side: DoubleSide });
183
+ this.gifLabelMesh = new THREE.Mesh(geometry, this.gifMaterial);
184
+ this.add(this.gifLabelMesh);
185
+ // console.log('----texture-------', this.gif.width, this.gif.height, this.giftexture);
186
+ this.needUpdate = true;
187
+ this.emit(Events.ELEMENT_LOADED, this);
188
+ }
189
+ });
190
+ }));
191
+ });
192
+ xhr.send();
193
+ }
194
+ else {
195
+ // console.log(`## Loading texture from:${url}`);
196
+ new THREE.TextureLoader().load(url, (texture) => {
197
+ // console.log('## Texture loaded');
198
+ this.uniforms.map.value = texture;
199
+ this.needUpdate = true;
200
+ this.emit(Events.ELEMENT_LOADED, this);
201
+ });
202
+ // url.slice();
203
+ }
204
+ });
205
+ }
206
+ drawCanvas() {
207
+ if (this.gifContext) {
208
+ this.gifContext.clearRect(0, 0, this.gif.width, this.gif.height);
209
+ this.gifContext.drawImage(this.frames[this.frameIndex], 0, 0, this.gif.width, this.gif.height);
210
+ this.giftexture.needsUpdate = true;
211
+ this.needUpdate = true;
212
+ }
213
+ // this._texture.needsUpdate = true;
214
+ }
215
+ update() {
216
+ const frameContext = new ElementFrameContext(this);
217
+ if (!this.initialized) {
218
+ this.initialized = true;
219
+ frameContext.needUpdate = true;
220
+ }
221
+ if (this.needUpdate) {
222
+ frameContext.needUpdate = true;
223
+ this.needUpdate = false;
224
+ }
225
+ if (this.gifLabelMesh !== null) {
226
+ const time = new Date().getTime();
227
+ if ((time - this.currentDisplayTime) >= this.tileDispDuration) {
228
+ this.currentDisplayTime = time;
229
+ this.frameIndex += 1;
230
+ if (this.frameIndex >= this.frames.length) {
231
+ this.frameIndex = 0;
232
+ }
233
+ this.drawCanvas();
234
+ // console.log('Add Frame', this.frameIndex);
235
+ }
236
+ }
237
+ if (this.initialized && !this.parent) {
238
+ frameContext.shouldPlaceElement = true;
239
+ }
240
+ return frameContext;
241
+ }
242
+ dispose() {
243
+ const texture = this.uniforms.map.value;
244
+ if (texture) {
245
+ texture.dispose();
246
+ }
247
+ // EventHub.off(OwllyEvents.RENDERING_VIEW_CHANGED, this.eventListeners.onCurrentViewChanged);
248
+ EventHub.off(Events.MOVE_TO_PANORAMA, this.eventListeners.onMoveToPanorama);
249
+ EventHub.off(OwllyEvents.ELEMENT_POSITION_UPDATED, this.eventListeners.onPositionChanged);
250
+ this.imgElement = null;
251
+ this.cssObject.dispatchEvent({ type: 'remove' });
252
+ this.remove(this.cssObject);
253
+ this.cssObject = null;
254
+ super.dispose();
255
+ }
256
+ // renderingViewChanged(view: View): void {
257
+ // const conf0 = this.viewConfigurations.get(view);
258
+ // const { THREE } = Externals.getInstance();
259
+ // if (!conf0) return;
260
+ // const conf = {
261
+ // faceToCamera: true,
262
+ // keepZOnFaceToCamera: true,
263
+ // } as Placeable2DViewConfigurationInternal;
264
+ // if (undefined !== conf0.faceToCamera) {
265
+ // conf.faceToCamera = conf0.faceToCamera;
266
+ // }
267
+ // if (undefined !== conf0.keepZOnFaceToCamera) {
268
+ // conf.keepZOnFaceToCamera = conf0.keepZOnFaceToCamera;
269
+ // }
270
+ // conf.visibilities = conf0.visibilities;
271
+ // if (this.movedToNewPanorama && this.currentPanoramaPosition) {
272
+ // conf.positions = conf0.positions;
273
+ // if (conf.positions) {
274
+ // let position = conf.positions.get(this.currentPID);
275
+ // if (!position) {
276
+ // position = conf.positions.get(-1);
277
+ // }
278
+ // if (position) {
279
+ // this.position.copy(position);
280
+ // }
281
+ // }
282
+ // this.outOfRange = this.currentPanoramaPosition.distanceTo(this.position) >= conf0.visibleScope!;
283
+ // this.movedToNewPanorama = false;
284
+ // }
285
+ // if (conf.visibilities) {
286
+ // let visibility = conf.visibilities.get(this.currentPID);
287
+ // if (undefined === visibility) {
288
+ // visibility = conf.visibilities.get(-1);
289
+ // }
290
+ // visibility = visibility && !this.outOfRange;
291
+ // const editing = !!this.isEditingInView.get(view);
292
+ // this.labelMesh.visible = !!((visibility || editing) && conf0.showMesh) && !this.hidden;
293
+ // this.cssObject!.visible = !!((visibility || editing) && conf0.showDom) && !this.hidden;
294
+ // this.visible = this.labelMesh.visible || this.cssObject!.visible;
295
+ // this.uniforms.opacity.value = 1;
296
+ // if (this.cssObject!.visible && !conf0.showMesh) {
297
+ // this.labelMesh.visible = true;
298
+ // this.uniforms.opacity.value = 0;
299
+ // }
300
+ // if (this.isEditingInView.get(view) && !visibility) {
301
+ // this.uniforms.blendColor.value = new THREE.Vector4(1, 0, 0, 0.5);
302
+ // } else this.uniforms.blendColor.value = new THREE.Vector4(0, 0, 0, 0);
303
+ // }
304
+ // if (conf.faceToCamera && view.camera) {
305
+ // this.up.copy(view.camera.up).normalize();
306
+ // if (conf.keepZOnFaceToCamera) {
307
+ // const v = new THREE.Vector3().copy(view.camera.position).sub(this.position);
308
+ // const positionOnZ = view.camera.position.clone().addScaledVector(this.up, -v.dot(this.up));
309
+ // this.lookAt(positionOnZ);
310
+ // } else {
311
+ // this.lookAt(view.camera.position);
312
+ // }
313
+ // }
314
+ // }
315
+ /**
316
+ * 设置在指定View中的显示配置参数
317
+ * @param configuration 显示配置对象
318
+ * @example
319
+ * ```typescript
320
+ * label2D.addViewConfiguration({
321
+ * targetView: view,
322
+ * positions: [
323
+ * { pid: 6, position: labelPosition3 },
324
+ * { pid: 3, position: labelPosition6 },
325
+ * ],
326
+ * visibilities: [{ pid: -1, visible: false }],
327
+ * faceToCamera: true,
328
+ * });
329
+ * ```
330
+ */
331
+ addViewConfiguration(configuration) {
332
+ const config = {
333
+ targetView: configuration.targetView,
334
+ faceToCamera: configuration.faceToCamera,
335
+ keepZOnFaceToCamera: configuration.keepZOnFaceToCamera,
336
+ showDom: false,
337
+ showMesh: true,
338
+ visibleScope: 5,
339
+ };
340
+ const prevConfig = this.viewConfigurations.get(configuration.targetView);
341
+ if (prevConfig) {
342
+ config.visibilities = prevConfig.visibilities;
343
+ config.positions = prevConfig.positions;
344
+ if (undefined === config.faceToCamera) {
345
+ config.faceToCamera = prevConfig.faceToCamera;
346
+ }
347
+ if (undefined === config.keepZOnFaceToCamera) {
348
+ config.keepZOnFaceToCamera = prevConfig.keepZOnFaceToCamera;
349
+ }
350
+ config.showDom = prevConfig.showDom;
351
+ config.showMesh = prevConfig.showMesh;
352
+ config.visibleScope = prevConfig.visibleScope;
353
+ }
354
+ if (configuration.showDom !== undefined)
355
+ config.showDom = configuration.showDom;
356
+ if (configuration.showMesh !== undefined)
357
+ config.showMesh = configuration.showMesh;
358
+ if (configuration.visibleScope !== undefined)
359
+ config.visibleScope = configuration.visibleScope;
360
+ if (configuration.visibilities) {
361
+ if (!config.visibilities) {
362
+ config.visibilities = new Map();
363
+ }
364
+ configuration.visibilities.forEach((item) => {
365
+ config.visibilities.set(item.pid, item.visible);
366
+ });
367
+ }
368
+ if (configuration.positions) {
369
+ if (!config.positions) {
370
+ config.positions = new Map();
371
+ }
372
+ configuration.positions.forEach((item) => {
373
+ config.positions.set(item.pid, item.position);
374
+ });
375
+ }
376
+ this.viewConfigurations.set(config.targetView, config);
377
+ }
378
+ /**
379
+ * 设置当前标签是否处于编辑模式
380
+ * @param editingMode 是否设置为编辑模式
381
+ */
382
+ setEditingMode(targetView, editingMode) {
383
+ this.isEditingInView.set(targetView, editingMode);
384
+ this.needUpdate = true;
385
+ // if (editingMode) {
386
+ // this.editViewConfiguration(targetView, {
387
+ // position: this.position.clone(),
388
+ // visibility: this.visible,
389
+ // });
390
+ // }
391
+ }
392
+ isEditing(targetView) {
393
+ return !!this.isEditingInView.get(targetView);
394
+ }
395
+ /**
396
+ * 设置标签尺寸
397
+ * @param width 宽度
398
+ * @param height 高度
399
+ */
400
+ setSize(width, height) {
401
+ const { THREE } = Externals.getInstance();
402
+ this.width = width;
403
+ this.height = height;
404
+ const geometry = new THREE.PlaneBufferGeometry(width, height);
405
+ this.labelMesh.geometry = geometry;
406
+ }
407
+ /**
408
+ * 查询当前设置的标签尺寸
409
+ * @returns number数组,依次是width, height
410
+ */
411
+ getSize() {
412
+ return [this.width, this.height];
413
+ }
414
+ /**
415
+ * 设置imgElement Css
416
+ * @param cssText string
417
+ * @param width 宽
418
+ * @param height 高
419
+ */
420
+ setDomCSS(width, height, cssText) {
421
+ if (this.imgElement) {
422
+ const img = this.imgElement.getElementsByTagName('img')[0];
423
+ let css;
424
+ if (cssText) {
425
+ css = `${cssText};width:${width.toString()}px;height:${height.toString()}px;`;
426
+ }
427
+ else
428
+ css = `width:${width.toString()}px;height:${height.toString()}px;`;
429
+ img.style.cssText = css;
430
+ this.width = width;
431
+ this.height = height;
432
+ this.isDomElement = true;
433
+ }
434
+ }
435
+ getViewConfigurationByPanoramaId(view, pid) {
436
+ const conf = this.viewConfigurations.get(view);
437
+ if (!conf)
438
+ throw new Error('Cannot find view configuration');
439
+ const position = conf.positions.has(pid) ? conf.positions.get(pid) : conf.positions.get(-1);
440
+ const visible = conf.visibilities.has(pid) ? conf.visibilities.get(pid) : conf.visibilities.get(-1);
441
+ return { visible, position };
442
+ }
443
+ updateViewConfigurationByPanoramaId(view, pid, { visible, position }) {
444
+ const conf = this.viewConfigurations.get(view);
445
+ if (!conf)
446
+ throw new Error('Cannot find view configuration');
447
+ if (position !== undefined)
448
+ conf.positions.set(pid, position);
449
+ if (visible !== undefined)
450
+ conf.visibilities.set(pid, visible);
451
+ this.needUpdate = true;
452
+ }
453
+ /**
454
+ * 手动更新Placeable2D当前所在全景点位
455
+ * @param pid 点位id
456
+ * @param position 全景点位坐标
457
+ */
458
+ updateCurrentBindingPanorama(pid, position) {
459
+ this.currentPID = pid;
460
+ this.movedToNewPanorama = true;
461
+ this.currentPanoramaPosition = position ? position.clone() : null;
462
+ }
463
+ /**
464
+ * 将Placeable2D设置为不可见
465
+ */
466
+ setHidden(hidden) {
467
+ this.hidden = hidden;
468
+ }
469
+ }
470
+ export { Placeable2D };
@@ -0,0 +1,107 @@
1
+ import { NS_THREE } from '../stage/externals';
2
+ import { Element, ElementFrameContext } from './element';
3
+ import { Shape } from './map-kit/shape';
4
+ declare class PolygonMesh extends Element {
5
+ private initialized;
6
+ private loaded;
7
+ private verticesInvalidated;
8
+ private shape;
9
+ private zShape;
10
+ private vertices;
11
+ private group;
12
+ /**
13
+ * 生成三角化多边形网格
14
+ * 通过一个Shape描述形状, 通过第二个Shape来做高度的描述.
15
+ * @param shape 如果shape是一个"line", 则它是一个从折线描述的一个立面, 此时zShape的pathStep里面应该是和shape相同长度的PathStep数组, 里面的command和coords长度与第一个shape逐一对应, 但coords表示是z的起始位置和z的结束位置
16
+ * 并以每个类型为MOVE的PathStep作为折线段的起点
17
+ * 如果shape是一个'shape', 则它是一个从多边形描述的水平图形, 这时zShape的pathStep里面应该是和shape相同长度的PathStep数组, 里面的command和coords长度与第一个shape逐一对应, 但coords[0]表示其z高度
18
+ * 除第一个以外的类型为MOVE的PathStep作为一个孔的起点,可参考earcut的定义方式:https://github.com/mapbox/earcut
19
+ * @param zShape 见上述说明
20
+ * @example
21
+ * ```
22
+ const rectsLinesShapeData = {
23
+ id: 'rectsLines',
24
+ x: panoData[2].position.x,
25
+ y: panoData[2].position.y,
26
+ zIndex: 1000,
27
+ height: panoData[2].position.z - 0.5,
28
+ shapeType: 'line',
29
+ path: 'm-2,-2l-2,2l2,2l2,-2l-2,-2m-1,-1l-1,1l1,1l1,-1l-1,-1',
30
+ fill: 0x00ffff,
31
+ opacity: 1.0,
32
+ scale: [1.0, 1.0, 1.0],
33
+ rotation: [0.0, 0.0, 0.0, 1.0],
34
+ };
35
+ const rectsLines = new Shape(rectsLinesShapeData);
36
+
37
+ const rectsSidesShapeData = {
38
+ id: 'rectsSides',
39
+ shapeType: 'line',
40
+ path: 'm1,0l1,0l1,0l1,0l1,0m1,-1l1,-1l1,-1l1,-1l1,-1',
41
+ };
42
+ const rectsSides = new Shape(rectsSidesShapeData);
43
+
44
+ const facade = new PolygonMesh(
45
+ rectsLines,
46
+ rectsSides,
47
+ );
48
+ stage.bindElement(facade);
49
+
50
+ const rectsPolygonShapeData = {
51
+ id: 'rectsPolygon',
52
+ x: panoData[2].position.x,
53
+ y: panoData[2].position.y,
54
+ zIndex: 1100,
55
+ height: panoData[2].position.z - 0.5,
56
+ shapeType: 'shape',
57
+ path: 'm-2,-2l-2,2l2,2l2,-2l-2,-2m-1,-1l-1,1l1,1l1,-1l-1,-1',
58
+ fill: 0xff00ff,
59
+ opacity: 1.0,
60
+ scale: [1.0, 1.0, 1.0],
61
+ rotation: [0.0, 0.0, 0.0, 1.0],
62
+ };
63
+ const rectsPolygon = new Shape(rectsPolygonShapeData);
64
+ const polygon = new PolygonMesh(
65
+ rectsPolygon,
66
+ rectsSides,
67
+ );
68
+ stage.bindElement(polygon);
69
+ * ```
70
+ */
71
+ constructor(shape: Shape, zShape: Shape, optionalParams?: {
72
+ material?: NS_THREE.Material;
73
+ });
74
+ private updateGeometries;
75
+ private updateMaterials;
76
+ /**
77
+ * 以当前Shape成员更新Mesh
78
+ */
79
+ applyShapes(shape?: Shape, zShape?: Shape): void;
80
+ setColor(color: NS_THREE.Color | string | number, opacity?: number): void;
81
+ /**
82
+ * 把当前顶点数组同步到Mesh的Geometry以及Shape成员的PathSteps中
83
+ */
84
+ private applyVertices;
85
+ /**
86
+ * 设置单个已有顶点的位置
87
+ * @param index 顶点序号
88
+ * @param position 三维坐标
89
+ * @returns 若顶点序号越界,则返回false
90
+ */
91
+ setVertex(index: number, position: NS_THREE.Vector3): boolean;
92
+ /**
93
+ * 获得从顶点序号到顶点位置的映射Map
94
+ */
95
+ getVertexMap(): Map<number, NS_THREE.Vector3>;
96
+ /**
97
+ * 得到当前用以描述顶面/线的Shape对象
98
+ */
99
+ getShape(): Shape;
100
+ /**
101
+ * 得到当前用以描述侧面的Shape对象
102
+ */
103
+ getZShape(): Shape;
104
+ update(): ElementFrameContext;
105
+ dispose(): void;
106
+ }
107
+ export { PolygonMesh };