@aibee/owlly 1.0.26 → 1.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/external/lines/line-geometry.d.ts +9 -0
- package/lib/external/lines/line-geometry.js +51 -0
- package/lib/external/lines/line-material.d.ts +10 -0
- package/lib/external/lines/line-material.js +376 -0
- package/lib/external/lines/line-segments-2.d.ts +7 -0
- package/lib/external/lines/line-segments-2.js +143 -0
- package/lib/external/lines/line-segments-geometry.d.ts +15 -0
- package/lib/external/lines/line-segments-geometry.js +140 -0
- package/lib/external/loaders/gltf-loader.d.ts +77 -0
- package/lib/external/loaders/gltf-loader.js +2318 -0
- package/lib/external/orbit-controls.d.ts +44 -0
- package/lib/external/orbit-controls.js +745 -0
- package/lib/external/renderers/css-2d-renderer.d.ts +16 -0
- package/lib/external/renderers/css-2d-renderer.js +121 -0
- package/lib/external/renderers/css-3d-renderer.d.ts +18 -0
- package/lib/external/renderers/css-3d-renderer.js +138 -0
- package/lib/external/transform-controls.d.ts +106 -0
- package/lib/external/transform-controls.js +1112 -0
- package/lib/owlly/controller/aerial-element-controller.d.ts +65 -0
- package/lib/owlly/controller/aerial-element-controller.js +235 -0
- package/lib/owlly/controller/basic-controller.d.ts +324 -0
- package/lib/owlly/controller/basic-controller.js +1238 -0
- package/lib/owlly/controller/camera-controller.d.ts +37 -0
- package/lib/owlly/controller/camera-controller.js +137 -0
- package/lib/owlly/controller/controller.d.ts +61 -0
- package/lib/owlly/controller/controller.js +23 -0
- package/lib/owlly/controller/index.d.ts +2 -0
- package/lib/owlly/controller/index.js +13 -0
- package/lib/owlly/controller/mouse-indicator-controller.d.ts +34 -0
- package/lib/owlly/controller/mouse-indicator-controller.js +118 -0
- package/lib/owlly/controller/orbit-control.d.ts +147 -0
- package/lib/owlly/controller/orbit-control.js +264 -0
- package/lib/owlly/controller/panorama-adjust-controller.d.ts +45 -0
- package/lib/owlly/controller/panorama-adjust-controller.js +157 -0
- package/lib/owlly/controller/panorama-controller.d.ts +441 -0
- package/lib/owlly/controller/panorama-controller.js +1943 -0
- package/lib/owlly/controller/panorama-transform-controller.d.ts +66 -0
- package/lib/owlly/controller/panorama-transform-controller.js +136 -0
- package/lib/owlly/controller/plane-controller.d.ts +43 -0
- package/lib/owlly/controller/plane-controller.js +173 -0
- package/lib/owlly/controller/texture-controller.d.ts +181 -0
- package/lib/owlly/controller/texture-controller.js +875 -0
- package/lib/owlly/controller/tile-panorama-controller.d.ts +308 -0
- package/lib/owlly/controller/tile-panorama-controller.js +1353 -0
- package/lib/owlly/controller/transform-controller.d.ts +106 -0
- package/lib/owlly/controller/transform-controller.js +545 -0
- package/lib/owlly/element/bottom-nav-element.d.ts +65 -0
- package/lib/owlly/element/bottom-nav-element.js +257 -0
- package/lib/owlly/element/camera.d.ts +82 -0
- package/lib/owlly/element/camera.js +283 -0
- package/lib/owlly/element/dom-2d-element.d.ts +35 -0
- package/lib/owlly/element/dom-2d-element.js +48 -0
- package/lib/owlly/element/dom-3d-element.d.ts +27 -0
- package/lib/owlly/element/dom-3d-element.js +33 -0
- package/lib/owlly/element/dom-label-2d.d.ts +116 -0
- package/lib/owlly/element/dom-label-2d.js +382 -0
- package/lib/owlly/element/element.d.ts +53 -0
- package/lib/owlly/element/element.js +75 -0
- package/lib/owlly/element/floor-model.d.ts +83 -0
- package/lib/owlly/element/floor-model.js +227 -0
- package/lib/owlly/element/gif-kit/Gif.d.ts +96 -0
- package/lib/owlly/element/gif-kit/Gif.js +432 -0
- package/lib/owlly/element/gif-kit/GifColor.d.ts +21 -0
- package/lib/owlly/element/gif-kit/GifColor.js +37 -0
- package/lib/owlly/element/gif-kit/GifCompressedCodesToByteArrayConverter.d.ts +20 -0
- package/lib/owlly/element/gif-kit/GifCompressedCodesToByteArrayConverter.js +50 -0
- package/lib/owlly/element/gif-kit/GifFrame.d.ts +31 -0
- package/lib/owlly/element/gif-kit/GifFrame.js +96 -0
- package/lib/owlly/element/gif-kit/GifImage.d.ts +23 -0
- package/lib/owlly/element/gif-kit/GifImage.js +7 -0
- package/lib/owlly/element/gif-kit/GifParser.d.ts +17 -0
- package/lib/owlly/element/gif-kit/GifParser.js +196 -0
- package/lib/owlly/element/gif-kit/GifPresenter.d.ts +20 -0
- package/lib/owlly/element/gif-kit/GifPresenter.js +43 -0
- package/lib/owlly/element/gif-kit/GifVersion.d.ts +10 -0
- package/lib/owlly/element/gif-kit/GifVersion.js +12 -0
- package/lib/owlly/element/gltf-mesh-element.d.ts +31 -0
- package/lib/owlly/element/gltf-mesh-element.js +136 -0
- package/lib/owlly/element/index.d.ts +20 -0
- package/lib/owlly/element/index.js +24 -0
- package/lib/owlly/element/map-kit/shape.d.ts +131 -0
- package/lib/owlly/element/map-kit/shape.js +189 -0
- package/lib/owlly/element/mesh-element.d.ts +22 -0
- package/lib/owlly/element/mesh-element.js +63 -0
- package/lib/owlly/element/mesh-line-2d.d.ts +82 -0
- package/lib/owlly/element/mesh-line-2d.js +887 -0
- package/lib/owlly/element/meshline-o.d.ts +64 -0
- package/lib/owlly/element/meshline-o.js +678 -0
- package/lib/owlly/element/panorama-group.d.ts +241 -0
- package/lib/owlly/element/panorama-group.js +966 -0
- package/lib/owlly/element/panorama.d.ts +132 -0
- package/lib/owlly/element/panorama.js +812 -0
- package/lib/owlly/element/path-group.d.ts +69 -0
- package/lib/owlly/element/path-group.js +171 -0
- package/lib/owlly/element/path.d.ts +99 -0
- package/lib/owlly/element/path.js +531 -0
- package/lib/owlly/element/placeable-2d.d.ts +158 -0
- package/lib/owlly/element/placeable-2d.js +470 -0
- package/lib/owlly/element/polygon-mesh.d.ts +107 -0
- package/lib/owlly/element/polygon-mesh.js +307 -0
- package/lib/owlly/element/ring-element.d.ts +79 -0
- package/lib/owlly/element/ring-element.js +383 -0
- package/lib/owlly/element/sphere-mesh.d.ts +28 -0
- package/lib/owlly/element/sphere-mesh.js +69 -0
- package/lib/owlly/element/svg-floor-model.d.ts +22 -0
- package/lib/owlly/element/svg-floor-model.js +184 -0
- package/lib/owlly/element/svg-floors.d.ts +27 -0
- package/lib/owlly/element/svg-floors.js +109 -0
- package/lib/owlly/element/tile-panorama-group.d.ts +335 -0
- package/lib/owlly/element/tile-panorama-group.js +1006 -0
- package/lib/owlly/element/tile-panorama.d.ts +161 -0
- package/lib/owlly/element/tile-panorama.js +509 -0
- package/lib/owlly/element/tile-plane.d.ts +105 -0
- package/lib/owlly/element/tile-plane.js +360 -0
- package/lib/owlly/element/video-element.d.ts +33 -0
- package/lib/owlly/element/video-element.js +159 -0
- package/lib/owlly/geometries/ExtrudeGeometry2.d.ts +15 -0
- package/lib/owlly/geometries/ExtrudeGeometry2.js +210 -0
- package/lib/owlly/index.d.ts +13 -0
- package/lib/owlly/index.js +16 -0
- package/lib/owlly/overlay/canvas-overlay.d.ts +96 -0
- package/lib/owlly/overlay/canvas-overlay.js +510 -0
- package/lib/owlly/overlay/css-2d-overlay.d.ts +14 -0
- package/lib/owlly/overlay/css-2d-overlay.js +35 -0
- package/lib/owlly/overlay/css-3d-overlay.d.ts +16 -0
- package/lib/owlly/overlay/css-3d-overlay.js +36 -0
- package/lib/owlly/overlay/index.d.ts +6 -0
- package/lib/owlly/overlay/index.js +11 -0
- package/lib/owlly/overlay/label-overlay.d.ts +62 -0
- package/lib/owlly/overlay/label-overlay.js +328 -0
- package/lib/owlly/overlay/overlay.d.ts +14 -0
- package/lib/owlly/overlay/overlay.js +4 -0
- package/lib/owlly/overlay/path-overlay.d.ts +39 -0
- package/lib/owlly/overlay/path-overlay.js +124 -0
- package/lib/owlly/overlay/path-overlay2.d.ts +35 -0
- package/lib/owlly/overlay/path-overlay2.js +118 -0
- package/lib/owlly/overlay/poi-overlay-3d.d.ts +278 -0
- package/lib/owlly/overlay/poi-overlay-3d.js +1432 -0
- package/lib/owlly/overlay/poi-overlay.d.ts +277 -0
- package/lib/owlly/overlay/poi-overlay.js +1411 -0
- package/lib/owlly/owlly-2d/index.d.ts +28 -0
- package/lib/owlly/owlly-2d/index.js +92 -0
- package/lib/owlly/screen/index.d.ts +1 -0
- package/lib/owlly/screen/index.js +1 -0
- package/lib/owlly/screen/screen.d.ts +73 -0
- package/lib/owlly/screen/screen.js +236 -0
- package/lib/owlly/stage/externals.d.ts +19 -0
- package/lib/owlly/stage/externals.js +24 -0
- package/lib/owlly/stage/index.d.ts +4 -0
- package/lib/owlly/stage/index.js +6 -0
- package/lib/owlly/stage/owlly.d.ts +38 -0
- package/lib/owlly/stage/owlly.js +168 -0
- package/lib/owlly/stage/stage.d.ts +108 -0
- package/lib/owlly/stage/stage.js +234 -0
- package/lib/owlly/utils/alignment-utils.d.ts +20 -0
- package/lib/owlly/utils/alignment-utils.js +63 -0
- package/lib/owlly/utils/basic-calc.d.ts +18 -0
- package/lib/owlly/utils/basic-calc.js +129 -0
- package/lib/owlly/utils/basic-tools.d.ts +71 -0
- package/lib/owlly/utils/basic-tools.js +235 -0
- package/lib/owlly/utils/bvh-tree.d.ts +105 -0
- package/lib/owlly/utils/bvh-tree.js +539 -0
- package/lib/owlly/utils/camera.d.ts +37 -0
- package/lib/owlly/utils/camera.js +50 -0
- package/lib/owlly/utils/cube-texture-cache.d.ts +25 -0
- package/lib/owlly/utils/cube-texture-cache.js +143 -0
- package/lib/owlly/utils/device-utils.d.ts +18 -0
- package/lib/owlly/utils/device-utils.js +41 -0
- package/lib/owlly/utils/environment-utils.d.ts +37 -0
- package/lib/owlly/utils/environment-utils.js +73 -0
- package/lib/owlly/utils/event-hub.d.ts +50 -0
- package/lib/owlly/utils/event-hub.js +106 -0
- package/lib/owlly/utils/events.d.ts +219 -0
- package/lib/owlly/utils/events.js +219 -0
- package/lib/owlly/utils/geometry-utils.d.ts +119 -0
- package/lib/owlly/utils/geometry-utils.js +622 -0
- package/lib/owlly/utils/helper.d.ts +6 -0
- package/lib/owlly/utils/helper.js +24 -0
- package/lib/owlly/utils/index.d.ts +14 -0
- package/lib/owlly/utils/index.js +17 -0
- package/lib/owlly/utils/lru-cache.d.ts +26 -0
- package/lib/owlly/utils/lru-cache.js +109 -0
- package/lib/owlly/utils/map-utils.d.ts +7 -0
- package/lib/owlly/utils/map-utils.js +52 -0
- package/lib/owlly/utils/number-utils.d.ts +8 -0
- package/lib/owlly/utils/number-utils.js +72 -0
- package/lib/owlly/utils/panorama-model-util.d.ts +46 -0
- package/lib/owlly/utils/panorama-model-util.js +245 -0
- package/lib/owlly/utils/path-utils.d.ts +80 -0
- package/lib/owlly/utils/path-utils.js +728 -0
- package/lib/owlly/utils/svgutils.d.ts +138 -0
- package/lib/owlly/utils/svgutils.js +561 -0
- package/lib/owlly/utils/texture-cache.d.ts +29 -0
- package/lib/owlly/utils/texture-cache.js +115 -0
- package/lib/owlly/utils/tile-util.d.ts +187 -0
- package/lib/owlly/utils/tile-util.js +456 -0
- package/lib/owlly/utils/time-profiler.d.ts +21 -0
- package/lib/owlly/utils/time-profiler.js +48 -0
- package/lib/owlly/view/camera-view.d.ts +35 -0
- package/lib/owlly/view/camera-view.js +101 -0
- package/lib/owlly/view/index.d.ts +3 -0
- package/lib/owlly/view/index.js +5 -0
- package/lib/owlly/view/orthographic-view.d.ts +40 -0
- package/lib/owlly/view/orthographic-view.js +94 -0
- package/lib/owlly/view/perspective-view.d.ts +40 -0
- package/lib/owlly/view/perspective-view.js +95 -0
- package/lib/owlly/view/svg-map-view.d.ts +46 -0
- package/lib/owlly/view/svg-map-view.js +144 -0
- package/lib/owlly/view/view.d.ts +146 -0
- package/lib/owlly/view/view.js +317 -0
- package/lib/prod/owlly.esm.js +93462 -0
- package/lib/prod/owlly.esm.js.map +1 -0
- package/lib/prod/owlly.esm.min.js +54 -0
- package/lib/prod/owlly.iife.js +93560 -0
- package/lib/prod/owlly.iife.js.map +1 -0
- package/lib/prod/owlly.iife.min.js +69 -0
- package/lib/prod/owlly.miniapp.js +73845 -0
- package/lib/prod/owlly.miniapp.js.map +1 -0
- package/lib/prod/owlly.miniapp.min.js +63 -0
- package/lib/prod/src/external/lines/line-geometry.d.ts +9 -0
- package/lib/prod/src/external/lines/line-material.d.ts +10 -0
- package/lib/prod/src/external/lines/line-segments-2.d.ts +7 -0
- package/lib/prod/src/external/lines/line-segments-geometry.d.ts +15 -0
- package/lib/prod/src/external/loaders/gltf-loader.d.ts +77 -0
- package/lib/prod/src/external/orbit-controls.d.ts +44 -0
- package/lib/prod/src/external/renderers/css-2d-renderer.d.ts +16 -0
- package/lib/prod/src/external/renderers/css-3d-renderer.d.ts +18 -0
- package/lib/prod/src/external/transform-controls.d.ts +106 -0
- package/lib/prod/src/external/util/buffer-geometry-utils.d.ts +45 -0
- package/lib/prod/src/owlly/controller/aerial-element-controller.d.ts +65 -0
- package/lib/prod/src/owlly/controller/basic-controller.d.ts +324 -0
- package/lib/prod/src/owlly/controller/camera-controller.d.ts +37 -0
- package/lib/prod/src/owlly/controller/controller.d.ts +61 -0
- package/lib/prod/src/owlly/controller/index.d.ts +2 -0
- package/lib/prod/src/owlly/controller/mouse-indicator-controller.d.ts +34 -0
- package/lib/prod/src/owlly/controller/orbit-control.d.ts +147 -0
- package/lib/prod/src/owlly/controller/panorama-adjust-controller.d.ts +45 -0
- package/lib/prod/src/owlly/controller/panorama-controller.d.ts +441 -0
- package/lib/prod/src/owlly/controller/panorama-transform-controller.d.ts +66 -0
- package/lib/prod/src/owlly/controller/plane-controller.d.ts +43 -0
- package/lib/prod/src/owlly/controller/texture-controller.d.ts +183 -0
- package/lib/prod/src/owlly/controller/tile-panorama-controller.d.ts +308 -0
- package/lib/prod/src/owlly/controller/transform-controller.d.ts +106 -0
- package/lib/prod/src/owlly/element/bottom-nav-element.d.ts +65 -0
- package/lib/prod/src/owlly/element/camera.d.ts +82 -0
- package/lib/prod/src/owlly/element/dom-2d-element.d.ts +35 -0
- package/lib/prod/src/owlly/element/dom-3d-element.d.ts +27 -0
- package/lib/prod/src/owlly/element/dom-label-2d.d.ts +116 -0
- package/lib/prod/src/owlly/element/element.d.ts +53 -0
- package/lib/prod/src/owlly/element/floor-model.d.ts +83 -0
- package/lib/prod/src/owlly/element/gif-kit/Gif.d.ts +96 -0
- package/lib/prod/src/owlly/element/gif-kit/GifColor.d.ts +21 -0
- package/lib/prod/src/owlly/element/gif-kit/GifCompressedCodesToByteArrayConverter.d.ts +20 -0
- package/lib/prod/src/owlly/element/gif-kit/GifFrame.d.ts +31 -0
- package/lib/prod/src/owlly/element/gif-kit/GifImage.d.ts +23 -0
- package/lib/prod/src/owlly/element/gif-kit/GifParser.d.ts +17 -0
- package/lib/prod/src/owlly/element/gif-kit/GifPresenter.d.ts +20 -0
- package/lib/prod/src/owlly/element/gif-kit/GifVersion.d.ts +10 -0
- package/lib/prod/src/owlly/element/gltf-mesh-element.d.ts +31 -0
- package/lib/prod/src/owlly/element/index.d.ts +6 -0
- package/lib/prod/src/owlly/element/map-kit/area.d.ts +24 -0
- package/lib/prod/src/owlly/element/map-kit/block-set.d.ts +39 -0
- package/lib/prod/src/owlly/element/map-kit/block.d.ts +77 -0
- package/lib/prod/src/owlly/element/map-kit/index.d.ts +3 -0
- package/lib/prod/src/owlly/element/map-kit/shape.d.ts +131 -0
- package/lib/prod/src/owlly/element/mesh-element.d.ts +22 -0
- package/lib/prod/src/owlly/element/mesh-line-2d.d.ts +82 -0
- package/lib/prod/src/owlly/element/meshline-o.d.ts +64 -0
- package/lib/prod/src/owlly/element/panorama-group.d.ts +241 -0
- package/lib/prod/src/owlly/element/panorama.d.ts +132 -0
- package/lib/prod/src/owlly/element/path-group.d.ts +69 -0
- package/lib/prod/src/owlly/element/path.d.ts +99 -0
- package/lib/prod/src/owlly/element/placeable-2d.d.ts +158 -0
- package/lib/prod/src/owlly/element/polygon-mesh.d.ts +107 -0
- package/lib/prod/src/owlly/element/ring-element.d.ts +79 -0
- package/lib/prod/src/owlly/element/sphere-mesh.d.ts +28 -0
- package/lib/prod/src/owlly/element/svg-floor-model.d.ts +22 -0
- package/lib/prod/src/owlly/element/svg-floors.d.ts +27 -0
- package/lib/prod/src/owlly/element/tile-panorama-group.d.ts +335 -0
- package/lib/prod/src/owlly/element/tile-panorama.d.ts +162 -0
- package/lib/prod/src/owlly/element/tile-plane.d.ts +114 -0
- package/lib/prod/src/owlly/element/video-element.d.ts +33 -0
- package/lib/prod/src/owlly/geometries/ExtrudeGeometry2.d.ts +15 -0
- package/lib/prod/src/owlly/index.d.ts +13 -0
- package/lib/prod/src/owlly/overlay/canvas-overlay.d.ts +96 -0
- package/lib/prod/src/owlly/overlay/css-2d-overlay.d.ts +14 -0
- package/lib/prod/src/owlly/overlay/css-3d-overlay.d.ts +16 -0
- package/lib/prod/src/owlly/overlay/index.d.ts +5 -0
- package/lib/prod/src/owlly/overlay/label-overlay.d.ts +62 -0
- package/lib/prod/src/owlly/overlay/overlay.d.ts +14 -0
- package/lib/prod/src/owlly/overlay/path-overlay.d.ts +39 -0
- package/lib/prod/src/owlly/overlay/path-overlay2.d.ts +35 -0
- package/lib/prod/src/owlly/overlay/poi-overlay-3d.d.ts +278 -0
- package/lib/prod/src/owlly/overlay/poi-overlay.d.ts +277 -0
- package/lib/prod/src/owlly/owlly-2d/index.d.ts +28 -0
- package/lib/prod/src/owlly/screen/index.d.ts +1 -0
- package/lib/prod/src/owlly/screen/screen.d.ts +73 -0
- package/lib/prod/src/owlly/stage/__test__/stage.spec.d.ts +1 -0
- package/lib/prod/src/owlly/stage/externals.d.ts +19 -0
- package/lib/prod/src/owlly/stage/index.d.ts +3 -0
- package/lib/prod/src/owlly/stage/owlly.d.ts +38 -0
- package/lib/prod/src/owlly/stage/stage.d.ts +108 -0
- package/lib/prod/src/owlly/utils/alignment-utils.d.ts +20 -0
- package/lib/prod/src/owlly/utils/basic-calc.d.ts +18 -0
- package/lib/prod/src/owlly/utils/basic-tools.d.ts +71 -0
- package/lib/prod/src/owlly/utils/bvh-tree.d.ts +105 -0
- package/lib/prod/src/owlly/utils/camera.d.ts +37 -0
- package/lib/prod/src/owlly/utils/cube-texture-cache.d.ts +25 -0
- package/lib/prod/src/owlly/utils/device-utils.d.ts +18 -0
- package/lib/prod/src/owlly/utils/environment-utils.d.ts +37 -0
- package/lib/prod/src/owlly/utils/event-hub.d.ts +50 -0
- package/lib/prod/src/owlly/utils/events.d.ts +219 -0
- package/lib/prod/src/owlly/utils/geometry-utils.d.ts +119 -0
- package/lib/prod/src/owlly/utils/helper.d.ts +6 -0
- package/lib/prod/src/owlly/utils/index.d.ts +13 -0
- package/lib/prod/src/owlly/utils/lru-cache.d.ts +26 -0
- package/lib/prod/src/owlly/utils/map-utils.d.ts +7 -0
- package/lib/prod/src/owlly/utils/number-utils.d.ts +8 -0
- package/lib/prod/src/owlly/utils/panorama-model-util.d.ts +46 -0
- package/lib/prod/src/owlly/utils/path-utils.d.ts +80 -0
- package/lib/prod/src/owlly/utils/svgutils.d.ts +138 -0
- package/lib/prod/src/owlly/utils/texture-cache.d.ts +29 -0
- package/lib/prod/src/owlly/utils/tile-util.d.ts +187 -0
- package/lib/prod/src/owlly/utils/time-profiler.d.ts +21 -0
- package/lib/prod/src/owlly/view/__test__/perspective-view.spec.d.ts +0 -0
- package/lib/prod/src/owlly/view/camera-view.d.ts +35 -0
- package/lib/prod/src/owlly/view/index.d.ts +3 -0
- package/lib/prod/src/owlly/view/orthographic-view.d.ts +40 -0
- package/lib/prod/src/owlly/view/perspective-view.d.ts +40 -0
- package/lib/prod/src/owlly/view/svg-map-view.d.ts +46 -0
- package/lib/prod/src/owlly/view/view.d.ts +146 -0
- package/lib/src/owlly/controller/texture-controller.d.ts +3 -1
- package/lib/src/owlly/controller/texture-controller.js +16 -1
- package/lib/src/owlly/controller/texture-controller.js.map +1 -1
- package/lib/src/owlly/controller/tile-panorama-controller.js +4 -0
- package/lib/src/owlly/controller/tile-panorama-controller.js.map +1 -1
- package/lib/src/owlly/element/tile-panorama.d.ts +1 -0
- package/lib/src/owlly/element/tile-panorama.js +16 -3
- package/lib/src/owlly/element/tile-panorama.js.map +1 -1
- package/lib/src/owlly/element/tile-plane.d.ts +9 -0
- package/lib/src/owlly/element/tile-plane.js +27 -0
- package/lib/src/owlly/element/tile-plane.js.map +1 -1
- package/lib/src/owlly/overlay/poi-overlay-3d.js.map +1 -1
- package/lib/src/owlly/overlay/poi-overlay.js.map +1 -1
- package/lib/src/owlly/stage/owlly.js +7 -1
- package/lib/src/owlly/stage/owlly.js.map +1 -1
- package/lib/src/owlly/stage/stage.js +2 -0
- package/lib/src/owlly/stage/stage.js.map +1 -1
- package/lib/src/web/main.rpeng.mes.plane.js.map +1 -1
- package/package.json +16 -7
- package/src/owlly/controller/texture-controller.ts +18 -1
- package/src/owlly/controller/tile-panorama-controller.ts +3 -1
- package/src/owlly/element/tile-panorama.ts +14 -0
- package/src/owlly/element/tile-plane.ts +26 -0
- package/src/owlly/overlay/poi-overlay-3d.ts +0 -4
- package/src/owlly/overlay/poi-overlay.ts +0 -4
- package/src/owlly/stage/owlly.ts +6 -1
- package/src/owlly/stage/stage.ts +2 -0
- package/src/web/main.rpeng.mes.plane.ts +0 -6
|
@@ -0,0 +1,1006 @@
|
|
|
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 { NS_THREE, Externals } from '../stage/externals';
|
|
11
|
+
import { Element, ElementFrameContext } from './element';
|
|
12
|
+
import { CubeTextureCache } from '../utils/cube-texture-cache';
|
|
13
|
+
import { EventHub } from '../utils/event-hub';
|
|
14
|
+
import { FloorModel } from './floor-model';
|
|
15
|
+
import { OwllyEvents, Events } from '../utils/events';
|
|
16
|
+
import { BasicTools } from '../utils/basic-tools';
|
|
17
|
+
import { TilePanorama } from './tile-panorama';
|
|
18
|
+
import { TextureController } from '../controller/texture-controller';
|
|
19
|
+
/** 全景点位显示模式
|
|
20
|
+
* 点位的显示/隐藏状态通过[setIndicatorVisibility]方法设置,
|
|
21
|
+
* 但是最终是否显示、以何外观显示,则是结合PanoramaGroup在当前View的显示模式来决定
|
|
22
|
+
* @param AlwaysHide 不论显示/隐藏的设置如何,都不显示
|
|
23
|
+
* @param AlwaysShow 不论显示/隐藏的设置如何,都不显示。该模式主要用于俯视全局视图用
|
|
24
|
+
* @param Editing 编辑模式,隐藏/显示状态的点位用不同的外观显示
|
|
25
|
+
* @param Show 按显示/隐葳的状态设置决定是否显示
|
|
26
|
+
*/
|
|
27
|
+
var IndicatorDisplayMode;
|
|
28
|
+
(function (IndicatorDisplayMode) {
|
|
29
|
+
IndicatorDisplayMode[IndicatorDisplayMode["AlwaysHide"] = 0] = "AlwaysHide";
|
|
30
|
+
IndicatorDisplayMode[IndicatorDisplayMode["AlwaysShow"] = 1] = "AlwaysShow";
|
|
31
|
+
IndicatorDisplayMode[IndicatorDisplayMode["Editing"] = 2] = "Editing";
|
|
32
|
+
IndicatorDisplayMode[IndicatorDisplayMode["Show"] = 3] = "Show";
|
|
33
|
+
})(IndicatorDisplayMode || (IndicatorDisplayMode = {}));
|
|
34
|
+
/**
|
|
35
|
+
* 全景图组
|
|
36
|
+
* @noInheritDoc
|
|
37
|
+
*/
|
|
38
|
+
class TilePanoramaGroup extends Element {
|
|
39
|
+
/**
|
|
40
|
+
* @param modelElement 模型对象,通常应该是FloorModel
|
|
41
|
+
* @param groundParams 地面参数对象,若有则在计算地面高度时忽略modelElement,优先使用它
|
|
42
|
+
* @param indicatorImageURL 显示状态全景点地面标识的图片URL
|
|
43
|
+
* @param invisibleIndicatorImageURL 编辑模式下隐藏状态全景点地面标识的图片URL
|
|
44
|
+
* @param indicatorWidth 全景点地面标识宽度
|
|
45
|
+
* @param indicatorHeight 全景点地面标识高度
|
|
46
|
+
* @example
|
|
47
|
+
* ``` typescript
|
|
48
|
+
* panoMgr = new TilePanoramaGroup(panoramaDataList, 2, {
|
|
49
|
+
* floorModel,
|
|
50
|
+
* groundParams,
|
|
51
|
+
* });
|
|
52
|
+
* stage.bindElement(panoMgr);
|
|
53
|
+
*/
|
|
54
|
+
constructor(panoramaDataList, options) {
|
|
55
|
+
super();
|
|
56
|
+
this.initialized = false;
|
|
57
|
+
// this.currentPanorama = null;
|
|
58
|
+
const { modelElement, groundParams, indicatorImageURL, invisibleIndicatorImageURL, indicatorWidth, indicatorHeight, indicatorPositionMap, globalScale, showInvisible, } = options || { globalScale: 1 };
|
|
59
|
+
const { THREE } = Externals.getInstance();
|
|
60
|
+
this.currentPanoramaID = -1;
|
|
61
|
+
this.panoramaMap = new Map();
|
|
62
|
+
this.indicatorMap = new Map();
|
|
63
|
+
this.indicatorVisibilityMap = new Map();
|
|
64
|
+
this.indicatorHiddenMap = new Map();
|
|
65
|
+
this.indicatorPositionMap = indicatorPositionMap ? indicatorPositionMap : new Map();
|
|
66
|
+
this.inSightIndicators = [];
|
|
67
|
+
this.indicatorWidth = indicatorWidth || (2 * TilePanoramaGroup.IndicatorRadius);
|
|
68
|
+
this.indicatorHeight = indicatorHeight || (2 * TilePanoramaGroup.IndicatorRadius);
|
|
69
|
+
this.maxWorldDistance = 13;
|
|
70
|
+
this.globalScale = globalScale || 1;
|
|
71
|
+
this.showInvisible = showInvisible || false;
|
|
72
|
+
this.group = new THREE.Group();
|
|
73
|
+
this.add(this.group);
|
|
74
|
+
this.viewConfigurations = new Map();
|
|
75
|
+
this.eventListeners = {
|
|
76
|
+
onFloorModelLoaded: (element) => {
|
|
77
|
+
if (element !== this.modelElement)
|
|
78
|
+
return;
|
|
79
|
+
this.updateIndicatorsPositions();
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
this.groundParams = groundParams;
|
|
83
|
+
this.bindModelElement(modelElement);
|
|
84
|
+
this.initIndicator(indicatorImageURL, invisibleIndicatorImageURL);
|
|
85
|
+
this.initPanoramas(panoramaDataList);
|
|
86
|
+
this.initIndicatorPosition();
|
|
87
|
+
EventHub.on(OwllyEvents.ELEMENT_LOADED, this.eventListeners.onFloorModelLoaded);
|
|
88
|
+
this.initialized = false;
|
|
89
|
+
this.needUpdate = false;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* @ignore
|
|
93
|
+
* @param panoramaDataList
|
|
94
|
+
*/
|
|
95
|
+
initPanoramas(panoramaDataList) {
|
|
96
|
+
this.panoramaDatas = new Map();
|
|
97
|
+
panoramaDataList.forEach((item) => {
|
|
98
|
+
this.panoramaDatas.set(item.pid, item);
|
|
99
|
+
});
|
|
100
|
+
panoramaDataList.forEach((item) => {
|
|
101
|
+
const panorama = new TilePanorama(item.pid, item.seqID, item.useLowTextureURLsOnly
|
|
102
|
+
? (item.textureURLs || item.highTextureURLs)
|
|
103
|
+
: (item.highTextureURLs || item.textureURLs), item.neighbourPanoramaIDs, item.useLowTextureURLsOnly ? 1 : 2, item.offLineTextureUrls, item.offLineTextureLevel, item.position, item.quaternion);
|
|
104
|
+
panorama.scale.set(this.globalScale, this.globalScale, this.globalScale);
|
|
105
|
+
this.putPanorama(panorama);
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
initIndicatorPosition() {
|
|
109
|
+
if (this.modelElement instanceof FloorModel) {
|
|
110
|
+
if (this.modelElement.isModelLoaded()) {
|
|
111
|
+
this.updateIndicatorsPositions();
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* 更新最大等级
|
|
117
|
+
* @param levelMax 最大等级
|
|
118
|
+
*/
|
|
119
|
+
updateLevelMax(levelMax) {
|
|
120
|
+
if (this.panoramaMap) {
|
|
121
|
+
this.panoramaMap.forEach((pano) => {
|
|
122
|
+
pano.levelMax = levelMax;
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* 销毁
|
|
128
|
+
* @param exceptForCubeTextureOfPID
|
|
129
|
+
*/
|
|
130
|
+
dispose(exceptForCubeTextureOfPID) {
|
|
131
|
+
super.dispose();
|
|
132
|
+
EventHub.off(OwllyEvents.ELEMENT_LOADED, this.eventListeners.onFloorModelLoaded);
|
|
133
|
+
if (this.panoramaMap) {
|
|
134
|
+
this.panoramaMap.forEach((pano) => {
|
|
135
|
+
// console.info('#PanoCtrl# 5 Will remove pano:', pano.position);
|
|
136
|
+
this.group.remove(pano);
|
|
137
|
+
if (exceptForCubeTextureOfPID !== pano.pid) {
|
|
138
|
+
CubeTextureCache.sharedInstance.recycleCubeTexture(pano.textureURLs);
|
|
139
|
+
}
|
|
140
|
+
pano.dispose();
|
|
141
|
+
});
|
|
142
|
+
this.panoramaMap.clear();
|
|
143
|
+
}
|
|
144
|
+
if (this.indicatorMap) {
|
|
145
|
+
this.indicatorMap.forEach((indicator) => {
|
|
146
|
+
this.group.remove(indicator);
|
|
147
|
+
});
|
|
148
|
+
this.indicatorMap.clear();
|
|
149
|
+
}
|
|
150
|
+
if (this.boundBox) {
|
|
151
|
+
this.group.remove(this.boundBox);
|
|
152
|
+
this.boundBox.geometry.dispose();
|
|
153
|
+
this.boundBox = null;
|
|
154
|
+
}
|
|
155
|
+
this.remove(this.group);
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* 初始化indicator
|
|
159
|
+
* @param indicatorImageURL
|
|
160
|
+
* @param invisibleIndicatorImageURL
|
|
161
|
+
*/
|
|
162
|
+
initIndicator(indicatorImageURL, invisibleIndicatorImageURL) {
|
|
163
|
+
const { THREE } = Externals.getInstance();
|
|
164
|
+
const vertexShader = `
|
|
165
|
+
varying vec2 vUv;
|
|
166
|
+
void main(){
|
|
167
|
+
vUv = uv;
|
|
168
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
169
|
+
}
|
|
170
|
+
`;
|
|
171
|
+
const fragmentShader = `
|
|
172
|
+
uniform sampler2D map;
|
|
173
|
+
uniform float opacity;
|
|
174
|
+
uniform vec4 blendColor;
|
|
175
|
+
varying vec2 vUv;
|
|
176
|
+
void main(){
|
|
177
|
+
vec4 texColor = texture2D(map, vUv);
|
|
178
|
+
gl_FragColor = vec4((texColor * (1.0 - blendColor.a) + blendColor * blendColor.a).rgb, texColor.a * opacity);
|
|
179
|
+
}
|
|
180
|
+
`;
|
|
181
|
+
this.indicatorShaderUniforms = {
|
|
182
|
+
map: {
|
|
183
|
+
type: 't',
|
|
184
|
+
value: null,
|
|
185
|
+
},
|
|
186
|
+
blendColor: {
|
|
187
|
+
type: 'v4',
|
|
188
|
+
value: new THREE.Vector4(0, 0, 0, 0),
|
|
189
|
+
},
|
|
190
|
+
opacity: { value: 1 },
|
|
191
|
+
};
|
|
192
|
+
this.invisibleIndicatorShaderUniforms = {
|
|
193
|
+
map: {
|
|
194
|
+
type: 't',
|
|
195
|
+
value: null,
|
|
196
|
+
},
|
|
197
|
+
blendColor: {
|
|
198
|
+
type: 'v4',
|
|
199
|
+
value: new THREE.Vector4(1.0, 0.0, 0.0, 0.5),
|
|
200
|
+
},
|
|
201
|
+
opacity: { value: 1 },
|
|
202
|
+
};
|
|
203
|
+
this.indicatorMaterials = new Map();
|
|
204
|
+
let indicatorMaterial;
|
|
205
|
+
let indicatorGeometry;
|
|
206
|
+
if (indicatorImageURL) {
|
|
207
|
+
indicatorGeometry = new THREE.PlaneBufferGeometry(this.indicatorWidth, this.indicatorHeight);
|
|
208
|
+
indicatorMaterial = new THREE.ShaderMaterial({
|
|
209
|
+
// 设置透明属性,这样透过全景图就能看到标签
|
|
210
|
+
transparent: true,
|
|
211
|
+
vertexShader,
|
|
212
|
+
fragmentShader,
|
|
213
|
+
uniforms: this.indicatorShaderUniforms,
|
|
214
|
+
side: NS_THREE.DoubleSide,
|
|
215
|
+
depthTest: false,
|
|
216
|
+
depthWrite: false,
|
|
217
|
+
name: 'indicatorMaterial',
|
|
218
|
+
});
|
|
219
|
+
this.indicatorImageURL = indicatorImageURL;
|
|
220
|
+
new THREE.TextureLoader().load(indicatorImageURL, (texture) => {
|
|
221
|
+
this.indicatorShaderUniforms.map.value = texture;
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
indicatorGeometry = new THREE.CircleGeometry(this.indicatorWidth / 2, 32);
|
|
226
|
+
indicatorMaterial = new THREE.MeshBasicMaterial({ transparent: true });
|
|
227
|
+
indicatorMaterial.side = NS_THREE.DoubleSide;
|
|
228
|
+
indicatorMaterial.depthTest = false;
|
|
229
|
+
indicatorMaterial.depthWrite = false;
|
|
230
|
+
indicatorMaterial.color = new THREE.Color(0xffffff);
|
|
231
|
+
}
|
|
232
|
+
let invisibleIndicatorMaterial;
|
|
233
|
+
const invisibleIndicatorImageURL1 = invisibleIndicatorImageURL || indicatorImageURL;
|
|
234
|
+
if (invisibleIndicatorImageURL1) {
|
|
235
|
+
invisibleIndicatorMaterial = new THREE.ShaderMaterial({
|
|
236
|
+
// 设置透明属性,这样透过全景图就能看到标签
|
|
237
|
+
transparent: true,
|
|
238
|
+
vertexShader,
|
|
239
|
+
fragmentShader,
|
|
240
|
+
uniforms: this.invisibleIndicatorShaderUniforms,
|
|
241
|
+
side: NS_THREE.DoubleSide,
|
|
242
|
+
depthTest: false,
|
|
243
|
+
depthWrite: false,
|
|
244
|
+
name: 'invisibleIndicatorMaterial',
|
|
245
|
+
});
|
|
246
|
+
new THREE.TextureLoader().load(invisibleIndicatorImageURL1, (texture) => {
|
|
247
|
+
this.invisibleIndicatorShaderUniforms.map.value = texture;
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
invisibleIndicatorMaterial = new THREE.MeshBasicMaterial();
|
|
252
|
+
invisibleIndicatorMaterial.side = NS_THREE.DoubleSide;
|
|
253
|
+
invisibleIndicatorMaterial.depthTest = false;
|
|
254
|
+
invisibleIndicatorMaterial.depthWrite = false;
|
|
255
|
+
invisibleIndicatorMaterial.color = new THREE.Color(0xff0000);
|
|
256
|
+
}
|
|
257
|
+
const indicator = new THREE.Mesh(indicatorGeometry, indicatorMaterial);
|
|
258
|
+
this.setIndicatorMeshPrototype(indicator);
|
|
259
|
+
this.setIndicatorMaterial(indicatorMaterial, IndicatorDisplayMode.Editing, true);
|
|
260
|
+
this.setIndicatorMaterial(invisibleIndicatorMaterial, IndicatorDisplayMode.Editing, false);
|
|
261
|
+
this.setIndicatorMaterial(indicatorMaterial, IndicatorDisplayMode.Show, true);
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* 更新标签
|
|
265
|
+
*/
|
|
266
|
+
updateIndicators() {
|
|
267
|
+
const pidPositionMap = this.getPIDPositionMap(this.inSightIndicators);
|
|
268
|
+
pidPositionMap.forEach((p, pid) => {
|
|
269
|
+
const position = this.indicatorPositionMap.get(pid);
|
|
270
|
+
if (!position) {
|
|
271
|
+
if (this.groundParams || this.modelElement instanceof FloorModel) {
|
|
272
|
+
let precisePosition;
|
|
273
|
+
// console.log('## TilePanoramaGroup.update() will update indicator position');
|
|
274
|
+
if (this.groundParams && this.groundParams.groundPlane) {
|
|
275
|
+
precisePosition = FloorModel.intersectWithGroundPlane(p, this.groundParams);
|
|
276
|
+
}
|
|
277
|
+
else {
|
|
278
|
+
const model = this.modelElement;
|
|
279
|
+
precisePosition = model.intersectGround(p);
|
|
280
|
+
}
|
|
281
|
+
if (precisePosition) {
|
|
282
|
+
this.indicatorPositionMap.set(pid, precisePosition);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
this.inSightIndicators.forEach((pid) => {
|
|
288
|
+
let indicator = this.indicatorMap.get(pid);
|
|
289
|
+
if (!indicator) {
|
|
290
|
+
indicator = this.indicatorMeshPrototype.clone();
|
|
291
|
+
this.indicatorMap.set(pid, indicator);
|
|
292
|
+
this.group.add(indicator);
|
|
293
|
+
const panoData = this.panoramaDatas.get(pid);
|
|
294
|
+
if (panoData && panoData.position) {
|
|
295
|
+
indicator.position.copy(panoData.position);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
const position = this.indicatorPositionMap.get(pid);
|
|
299
|
+
if (position) {
|
|
300
|
+
indicator.position.copy(position);
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* @ignore
|
|
306
|
+
*/
|
|
307
|
+
update() {
|
|
308
|
+
const frameContext = new ElementFrameContext(this);
|
|
309
|
+
if (!this.initialized) {
|
|
310
|
+
this.initialized = true;
|
|
311
|
+
frameContext.needUpdate = true;
|
|
312
|
+
}
|
|
313
|
+
else if (this.needUpdate) {
|
|
314
|
+
this.updateIndicators();
|
|
315
|
+
this.needUpdate = false;
|
|
316
|
+
frameContext.needUpdate = true;
|
|
317
|
+
}
|
|
318
|
+
else if (this.currentPanorama) {
|
|
319
|
+
const subFrameContext = this.currentPanorama.update();
|
|
320
|
+
if (subFrameContext.needUpdate) {
|
|
321
|
+
frameContext.needUpdate = true;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
if (this.initialized && !this.parent) {
|
|
325
|
+
frameContext.shouldPlaceElement = true;
|
|
326
|
+
}
|
|
327
|
+
return frameContext;
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* 绑定模型Element对象(用于创建天空包围盒供全景切换时使用)
|
|
331
|
+
* @param modelElement 模型Element对象
|
|
332
|
+
*/
|
|
333
|
+
bindModelElement(modelElement) {
|
|
334
|
+
if (modelElement) {
|
|
335
|
+
this.modelElement = modelElement;
|
|
336
|
+
}
|
|
337
|
+
if (this.boundBox) {
|
|
338
|
+
this.group.remove(this.boundBox);
|
|
339
|
+
this.boundBox = null;
|
|
340
|
+
}
|
|
341
|
+
this.getModelBoundBox();
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* 获取盒子
|
|
345
|
+
* @param rootObj
|
|
346
|
+
* @param globalScale
|
|
347
|
+
* @returns
|
|
348
|
+
*/
|
|
349
|
+
static getBoundBox(rootObj) {
|
|
350
|
+
if (!rootObj)
|
|
351
|
+
return null;
|
|
352
|
+
const { THREE } = Externals.getInstance();
|
|
353
|
+
const box = new THREE.Box3().setFromObject(rootObj);
|
|
354
|
+
const size = box.getSize(new THREE.Vector3());
|
|
355
|
+
const sideLength = Math.max(size.x, size.y, size.z); // 外扩10个单位
|
|
356
|
+
// const minX = -sideLength;
|
|
357
|
+
// const maxX = sideLength;
|
|
358
|
+
// const minY = -sideLength;
|
|
359
|
+
// const maxY = sideLength;
|
|
360
|
+
// const minZ = -sideLength;
|
|
361
|
+
// const maxZ = sideLength;
|
|
362
|
+
// const boundBox = new THREE.Mesh(new THREE.BoxBufferGeometry(maxX - minX, maxY - minY, maxZ - minZ));
|
|
363
|
+
// boundBox.position.set((maxX + minX) / 2, (maxY + minY) / 2, (maxZ + minZ) / 2);
|
|
364
|
+
const boundBox = new THREE.Mesh(new THREE.BoxBufferGeometry(sideLength, sideLength, sideLength));
|
|
365
|
+
boundBox.position.copy(box.max.clone().add(box.min).multiplyScalar(0.5));
|
|
366
|
+
return boundBox;
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* 获取模型盒子
|
|
370
|
+
* @returns
|
|
371
|
+
*/
|
|
372
|
+
getModelBoundBox() {
|
|
373
|
+
if (this.boundBox)
|
|
374
|
+
return;
|
|
375
|
+
this.boundBox = TilePanoramaGroup.getBoundBox(this.modelElement);
|
|
376
|
+
if (this.boundBox) {
|
|
377
|
+
this.boundBox.visible = true;
|
|
378
|
+
// 设置天空盒不被视锥裁剪,这样天空盒资源就能直接加载到GPU里面
|
|
379
|
+
this.boundBox.frustumCulled = false;
|
|
380
|
+
this.boundBox.renderOrder = 100;
|
|
381
|
+
this.group.add(this.boundBox);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* 设置包围盒出现
|
|
386
|
+
* @param material
|
|
387
|
+
* @returns
|
|
388
|
+
*/
|
|
389
|
+
setBoundBoxAppearance(material) {
|
|
390
|
+
this.getModelBoundBox();
|
|
391
|
+
if (!this.boundBox)
|
|
392
|
+
return;
|
|
393
|
+
this.boundBox.material = material;
|
|
394
|
+
this.needUpdate = true;
|
|
395
|
+
}
|
|
396
|
+
setBoundBoxVisible(visible) {
|
|
397
|
+
if (!this.boundBox)
|
|
398
|
+
return;
|
|
399
|
+
this.boundBox.visible = visible;
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* 加载指定全景图并加入场景(显示要通过PanoramaController)
|
|
403
|
+
* @param panorama 要加载的全景图
|
|
404
|
+
*/
|
|
405
|
+
presentPanorama(panorama) {
|
|
406
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
407
|
+
const res = yield this.initTexturesByPanorama(panorama);
|
|
408
|
+
return res;
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
/**
|
|
412
|
+
* 根据全景对象初始化纹理
|
|
413
|
+
* @param panorama
|
|
414
|
+
*/
|
|
415
|
+
initTexturesByPanorama(panorama) {
|
|
416
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
417
|
+
panorama.updateLevel(0);
|
|
418
|
+
// console.log('initTextures', panorama.pid);
|
|
419
|
+
const needInits = panorama.getPreTextureInfos();
|
|
420
|
+
const res = yield TextureController.instance.initTextures(needInits);
|
|
421
|
+
return res;
|
|
422
|
+
// console.log('initTexturesEnd', panorama.pid);
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* 加载指定PID的全景图并加入场景(显示要通过PanoramaController)
|
|
427
|
+
* @param pid 要加载的全景图ID
|
|
428
|
+
*/
|
|
429
|
+
presentPanoramaOfPID(pid) {
|
|
430
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
431
|
+
const pano = this.getPanoramaByPID(pid);
|
|
432
|
+
let res = 1;
|
|
433
|
+
if (pano) {
|
|
434
|
+
res = yield this.presentPanorama(pano);
|
|
435
|
+
}
|
|
436
|
+
if (res) {
|
|
437
|
+
this.currentPanoramaID = pid;
|
|
438
|
+
this.currentPanorama = pano;
|
|
439
|
+
this.emit(Events.PANORAMA_PRESENTED, pid);
|
|
440
|
+
}
|
|
441
|
+
return res;
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
visibleRadiusOfView(view) {
|
|
445
|
+
if (!view)
|
|
446
|
+
return TilePanoramaGroup.DefaultVisibleRadius;
|
|
447
|
+
const conf = this.viewConfigurations.get(view);
|
|
448
|
+
if (conf && conf.visibleRadius)
|
|
449
|
+
return conf.visibleRadius;
|
|
450
|
+
return TilePanoramaGroup.DefaultVisibleRadius;
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* @ignore
|
|
454
|
+
* @param centerPID
|
|
455
|
+
* @param view
|
|
456
|
+
* @returns
|
|
457
|
+
*/
|
|
458
|
+
panoramaIDsAround(centerPID, view) {
|
|
459
|
+
const rootNode = this.panoramaDatas.get(centerPID);
|
|
460
|
+
if (!rootNode || !rootNode.position) {
|
|
461
|
+
return null;
|
|
462
|
+
}
|
|
463
|
+
const ret = [centerPID];
|
|
464
|
+
const visibleRadius = this.visibleRadiusOfView(view);
|
|
465
|
+
const neighbours = rootNode.neighbourPanoramaIDs.map((pid) => this.panoramaDatas.get(pid));
|
|
466
|
+
neighbours.forEach((neighbour) => {
|
|
467
|
+
if (neighbour && neighbour.position) {
|
|
468
|
+
const distance = rootNode.position.distanceTo(neighbour.position);
|
|
469
|
+
if ((this.showInvisible || neighbour.visible) && distance <= visibleRadius) {
|
|
470
|
+
ret.push(neighbour.pid);
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
});
|
|
474
|
+
return ret;
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* 设置当前位于的全景点位。将加载指定全景点并预加载其相邻全景点
|
|
478
|
+
* @param {number} currentPID 全景点位ID
|
|
479
|
+
* @returns 1为初始化成功, 0为初始化失败
|
|
480
|
+
*/
|
|
481
|
+
presentPanoramaAround(currentPID, view) {
|
|
482
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
483
|
+
const panoIDs = this.panoramaIDsAround(currentPID, view);
|
|
484
|
+
let res = 1;
|
|
485
|
+
if (panoIDs) {
|
|
486
|
+
res = yield this.presentPanoramaOfPID(currentPID);
|
|
487
|
+
}
|
|
488
|
+
return res;
|
|
489
|
+
});
|
|
490
|
+
}
|
|
491
|
+
/** @ignore */
|
|
492
|
+
getPIDPositionMap(pids) {
|
|
493
|
+
const ret = new Map();
|
|
494
|
+
pids.forEach((value) => {
|
|
495
|
+
const panoData = this.panoramaDatas.get(value);
|
|
496
|
+
if (panoData) {
|
|
497
|
+
ret.set(value, panoData.position);
|
|
498
|
+
}
|
|
499
|
+
});
|
|
500
|
+
return ret;
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* 根据pid获取标签的位置
|
|
504
|
+
* @param pid
|
|
505
|
+
* @returns
|
|
506
|
+
*/
|
|
507
|
+
getIndicatorPosition(pid) {
|
|
508
|
+
return this.indicatorPositionMap.get(pid);
|
|
509
|
+
}
|
|
510
|
+
/**
|
|
511
|
+
* 显示指定全景点位标签
|
|
512
|
+
* @param pidPositionMap 从PID映射到全景点位位置的Map
|
|
513
|
+
*/
|
|
514
|
+
presentPanoramaIndicators(pidPositionMap) {
|
|
515
|
+
if (!this.modelElement)
|
|
516
|
+
return;
|
|
517
|
+
const { THREE } = Externals.getInstance();
|
|
518
|
+
this.inSightIndicators = [];
|
|
519
|
+
pidPositionMap.forEach((position, pid) => {
|
|
520
|
+
if (this.groundParams || this.modelElement instanceof FloorModel) {
|
|
521
|
+
const savedPosition = this.indicatorPositionMap.get(pid);
|
|
522
|
+
if (!savedPosition) {
|
|
523
|
+
let p;
|
|
524
|
+
// console.log('## TilePanoramaGroup.presentPanoramaIndicators() will update indicator position');
|
|
525
|
+
if (this.groundParams && this.groundParams.groundPlane) {
|
|
526
|
+
p = FloorModel.intersectWithGroundPlane(position, this.groundParams);
|
|
527
|
+
}
|
|
528
|
+
else {
|
|
529
|
+
const model = this.modelElement;
|
|
530
|
+
p = model.intersectGround(position);
|
|
531
|
+
}
|
|
532
|
+
if (p) {
|
|
533
|
+
this.indicatorPositionMap.set(pid, p.add(new THREE.Vector3(0, 0, TilePanoramaGroup.IndicatorOffsetZ)));
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
this.inSightIndicators.push(pid);
|
|
538
|
+
});
|
|
539
|
+
this.needUpdate = true;
|
|
540
|
+
}
|
|
541
|
+
/**
|
|
542
|
+
* 更新标签位置
|
|
543
|
+
*/
|
|
544
|
+
updateIndicatorsPositions() {
|
|
545
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
546
|
+
const { THREE } = Externals.getInstance();
|
|
547
|
+
this.panoramaMap.forEach((pano, pid) => {
|
|
548
|
+
const savedPosition = this.indicatorPositionMap.get(pid);
|
|
549
|
+
if (savedPosition)
|
|
550
|
+
return;
|
|
551
|
+
const { position } = pano;
|
|
552
|
+
let p;
|
|
553
|
+
// console.log('## TilePanoramaGroup.presentPanoramaIndicators() will update indicator position');
|
|
554
|
+
if (this.groundParams && this.groundParams.groundPlane) {
|
|
555
|
+
p = FloorModel.intersectWithGroundPlane(position, this.groundParams);
|
|
556
|
+
}
|
|
557
|
+
else {
|
|
558
|
+
const model = this.modelElement;
|
|
559
|
+
p = model.intersectGround(position);
|
|
560
|
+
}
|
|
561
|
+
if (p) {
|
|
562
|
+
this.indicatorPositionMap.set(pid, p.add(new THREE.Vector3(0, 0, TilePanoramaGroup.IndicatorOffsetZ)));
|
|
563
|
+
}
|
|
564
|
+
});
|
|
565
|
+
const pidPositionMap = yield this.getPIDPositionMap(this.inSightIndicators);
|
|
566
|
+
this.presentPanoramaIndicators(pidPositionMap);
|
|
567
|
+
});
|
|
568
|
+
}
|
|
569
|
+
/**
|
|
570
|
+
* 显示指定全景点及其相邻全景点上的标签
|
|
571
|
+
* @param pid “中心”全景点ID,一般指摄像机当前所在的全景点PID
|
|
572
|
+
*/
|
|
573
|
+
presentPanoramaIndicatorsAround(pid, view) {
|
|
574
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
575
|
+
const pids = this.panoramaIDsAround(pid, view);
|
|
576
|
+
if (pids) {
|
|
577
|
+
const pidPositionMap = yield this.getPIDPositionMap(pids);
|
|
578
|
+
this.presentPanoramaIndicators(pidPositionMap);
|
|
579
|
+
}
|
|
580
|
+
});
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* 获取pid的标签是否可见
|
|
584
|
+
* @param pid
|
|
585
|
+
* @returns
|
|
586
|
+
*/
|
|
587
|
+
getIndicatorVisibility(pid) {
|
|
588
|
+
const visibility = this.indicatorVisibilityMap.get(pid);
|
|
589
|
+
if (undefined === visibility)
|
|
590
|
+
return true;
|
|
591
|
+
return visibility;
|
|
592
|
+
}
|
|
593
|
+
/**
|
|
594
|
+
* 设置指定全景点位的显示/隐藏状态
|
|
595
|
+
* @param visibility 显示/隐藏状态
|
|
596
|
+
* @param pid 可选,可以是全景图点位PID数组,也可以是单个PID,
|
|
597
|
+
* 若不设置则应用到本PanoramaGroup的所有全景点位上
|
|
598
|
+
*/
|
|
599
|
+
setIndicatorVisibility(visibility, pid) {
|
|
600
|
+
let pidArray;
|
|
601
|
+
if (pid === undefined) {
|
|
602
|
+
pidArray = [];
|
|
603
|
+
this.indicatorMap.forEach((value, key) => {
|
|
604
|
+
pidArray.push(key);
|
|
605
|
+
});
|
|
606
|
+
}
|
|
607
|
+
else if (Array.isArray(pid)) {
|
|
608
|
+
pidArray = pid;
|
|
609
|
+
}
|
|
610
|
+
else {
|
|
611
|
+
pidArray = [pid];
|
|
612
|
+
}
|
|
613
|
+
pidArray.forEach((value) => {
|
|
614
|
+
this.indicatorVisibilityMap.set(value, visibility);
|
|
615
|
+
const indicator = this.indicatorMap.get(value);
|
|
616
|
+
if (indicator) {
|
|
617
|
+
this.group.remove(indicator);
|
|
618
|
+
this.indicatorMap.delete(value);
|
|
619
|
+
}
|
|
620
|
+
});
|
|
621
|
+
this.needUpdate = true;
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* 设置标签隐藏
|
|
625
|
+
* @param hidden 隐藏
|
|
626
|
+
* @param pid 指定pid
|
|
627
|
+
*/
|
|
628
|
+
setIndicatorHidden(hidden, pid) {
|
|
629
|
+
let pidArray;
|
|
630
|
+
if (pid === undefined) {
|
|
631
|
+
pidArray = [];
|
|
632
|
+
this.indicatorMap.forEach((value, key) => {
|
|
633
|
+
pidArray.push(key);
|
|
634
|
+
});
|
|
635
|
+
}
|
|
636
|
+
else if (Array.isArray(pid)) {
|
|
637
|
+
pidArray = pid;
|
|
638
|
+
}
|
|
639
|
+
else {
|
|
640
|
+
pidArray = [pid];
|
|
641
|
+
}
|
|
642
|
+
pidArray.forEach((value) => {
|
|
643
|
+
this.indicatorHiddenMap.set(value, hidden);
|
|
644
|
+
const indicator = this.indicatorMap.get(value);
|
|
645
|
+
if (indicator) {
|
|
646
|
+
this.group.remove(indicator);
|
|
647
|
+
this.indicatorMap.delete(value);
|
|
648
|
+
}
|
|
649
|
+
});
|
|
650
|
+
this.needUpdate = true;
|
|
651
|
+
}
|
|
652
|
+
/**
|
|
653
|
+
* 与全景点标志作相交测试
|
|
654
|
+
* 若有任一个全景点标志与射线相交则返回最近一个的相应PID
|
|
655
|
+
* 若没有则返回-1
|
|
656
|
+
* @param rayOrigin 射线起点
|
|
657
|
+
* @param rayDirection 射线方向
|
|
658
|
+
*/
|
|
659
|
+
intersectIndicators(rayOrigin, rayDirection) {
|
|
660
|
+
let results = [];
|
|
661
|
+
const v = rayDirection.normalize();
|
|
662
|
+
const radius = Math.min(this.indicatorHeight, this.indicatorWidth) / 2;
|
|
663
|
+
this.indicatorMap.forEach((indicator, pid) => {
|
|
664
|
+
const p = indicator.position;
|
|
665
|
+
if (Number.isNaN(p.x))
|
|
666
|
+
return;
|
|
667
|
+
const u = p.clone().sub(rayOrigin);
|
|
668
|
+
const uDotV = u.dot(v);
|
|
669
|
+
if (uDotV > 0) {
|
|
670
|
+
const uOnV = v.clone().multiplyScalar(uDotV);
|
|
671
|
+
const distance = u.sub(uOnV).length();
|
|
672
|
+
if (distance <= radius) {
|
|
673
|
+
results.push({
|
|
674
|
+
pid,
|
|
675
|
+
distance,
|
|
676
|
+
});
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
});
|
|
680
|
+
if (results.length > 0) {
|
|
681
|
+
results = results.sort((a, b) => {
|
|
682
|
+
if (a.distance < b.distance)
|
|
683
|
+
return -1;
|
|
684
|
+
if (a.distance > b.distance)
|
|
685
|
+
return 1;
|
|
686
|
+
return 0;
|
|
687
|
+
});
|
|
688
|
+
return results[0].pid;
|
|
689
|
+
}
|
|
690
|
+
return -1;
|
|
691
|
+
}
|
|
692
|
+
/**
|
|
693
|
+
* @ignore
|
|
694
|
+
* @param screenPosition
|
|
695
|
+
* @param radius
|
|
696
|
+
* @param param2
|
|
697
|
+
* @param camera
|
|
698
|
+
* @returns
|
|
699
|
+
*/
|
|
700
|
+
intersectIndicatorsOnScreen(screenPosition, radius, { screenWidth, screenHeight }, camera) {
|
|
701
|
+
const indicatorsEntries = Array.from(this.indicatorMap);
|
|
702
|
+
const indicators = indicatorsEntries.map(([, mesh]) => mesh);
|
|
703
|
+
const intersection = BasicTools.getMouseIntersectionOnScreen(indicators, screenPosition, { screenWidth, screenHeight }, radius, camera, indicators, this.maxWorldDistance);
|
|
704
|
+
if (intersection) {
|
|
705
|
+
const target = indicatorsEntries.find(([, mesh]) => mesh === intersection);
|
|
706
|
+
if (target)
|
|
707
|
+
return target[0];
|
|
708
|
+
}
|
|
709
|
+
return -1;
|
|
710
|
+
}
|
|
711
|
+
/**
|
|
712
|
+
* 添加全景点
|
|
713
|
+
* @param {Panorama} pano 全景图对象
|
|
714
|
+
*/
|
|
715
|
+
putPanorama(pano) {
|
|
716
|
+
const oldNode = this.panoramaMap.get(pano.pid);
|
|
717
|
+
if (oldNode) {
|
|
718
|
+
// console.info('#PanoCtrl# 4 Will remove pano:', oldNode.position);
|
|
719
|
+
this.group.remove(oldNode);
|
|
720
|
+
oldNode.dispose();
|
|
721
|
+
}
|
|
722
|
+
this.panoramaMap.set(pano.pid, pano);
|
|
723
|
+
// pano.visible = false;
|
|
724
|
+
this.group.add(pano);
|
|
725
|
+
this.needUpdate = true;
|
|
726
|
+
}
|
|
727
|
+
/**
|
|
728
|
+
* 指定预构建全景对象的顺序策略
|
|
729
|
+
* @param preInitStrategy 多义参数,表示具体的创建顺序
|
|
730
|
+
* 当为'all'时,直接按构造函数中panoramaDataList的顺序创建全部全景对象
|
|
731
|
+
* 当为一个整数值时,表示一个全景PID,将按全景点邻接关系以广度优先搜索的顺序创建全景对象
|
|
732
|
+
* 当为一个整数数组时,以数组指定的PID顺序依次创建
|
|
733
|
+
*/
|
|
734
|
+
initializePanoramasIfNecessary(preInitStrategy) {
|
|
735
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
736
|
+
let pids = [];
|
|
737
|
+
if (Array.isArray(preInitStrategy)) {
|
|
738
|
+
pids = preInitStrategy;
|
|
739
|
+
}
|
|
740
|
+
else if (preInitStrategy === 'all') {
|
|
741
|
+
pids = Array.from(this.panoramaDatas.keys());
|
|
742
|
+
}
|
|
743
|
+
else {
|
|
744
|
+
const pid0 = preInitStrategy;
|
|
745
|
+
pids.push(pid0);
|
|
746
|
+
const visited = new Set();
|
|
747
|
+
visited.add(pid0);
|
|
748
|
+
const bfsQueue = [pid0];
|
|
749
|
+
while (bfsQueue.length > 0) {
|
|
750
|
+
const pid = bfsQueue.splice(0, 1)[0];
|
|
751
|
+
const pano = this.panoramaDatas.get(pid);
|
|
752
|
+
if (pano) {
|
|
753
|
+
pano.neighbourPanoramaIDs.forEach((neighbourPID) => {
|
|
754
|
+
if (!visited.has(neighbourPID)) {
|
|
755
|
+
visited.add(neighbourPID);
|
|
756
|
+
bfsQueue.push(neighbourPID);
|
|
757
|
+
pids.push(neighbourPID);
|
|
758
|
+
}
|
|
759
|
+
});
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
const promises = pids.map((pid) => this.getPanoramaByPID(pid));
|
|
764
|
+
return Promise.all(promises);
|
|
765
|
+
});
|
|
766
|
+
}
|
|
767
|
+
/**
|
|
768
|
+
* 获得指定ID的全景点对象
|
|
769
|
+
* @param pid 全景点ID
|
|
770
|
+
*/
|
|
771
|
+
getPanoramaByPID(pid) {
|
|
772
|
+
const ret = this.panoramaMap.get(pid);
|
|
773
|
+
if (ret) {
|
|
774
|
+
return ret;
|
|
775
|
+
}
|
|
776
|
+
const item = this.panoramaDatas.get(pid);
|
|
777
|
+
if (!item) {
|
|
778
|
+
return undefined;
|
|
779
|
+
}
|
|
780
|
+
const panorama = new TilePanorama(item.pid, item.seqID, item.useLowTextureURLsOnly
|
|
781
|
+
? (item.textureURLs || item.highTextureURLs)
|
|
782
|
+
: (item.highTextureURLs || item.textureURLs), item.neighbourPanoramaIDs, item.useLowTextureURLsOnly ? 1 : 2, item.offLineTextureUrls, item.offLineTextureLevel, item.position, item.quaternion);
|
|
783
|
+
panorama.scale.set(this.globalScale, this.globalScale, this.globalScale);
|
|
784
|
+
this.putPanorama(panorama);
|
|
785
|
+
return panorama;
|
|
786
|
+
}
|
|
787
|
+
/**
|
|
788
|
+
* 立刻获得指定ID的全景点对象
|
|
789
|
+
* @param pid 全景点ID
|
|
790
|
+
*/
|
|
791
|
+
getPanoramaByPIDInstant(pid) {
|
|
792
|
+
const ret = this.panoramaMap.get(pid);
|
|
793
|
+
return ret || null;
|
|
794
|
+
}
|
|
795
|
+
/**
|
|
796
|
+
* @ignore
|
|
797
|
+
* @param rayDirection
|
|
798
|
+
*/
|
|
799
|
+
getNeghbourPanoClosestToRay(rayDirection) {
|
|
800
|
+
if (this.currentPanoramaID === -1)
|
|
801
|
+
return -1;
|
|
802
|
+
const pano = this.panoramaMap.get(this.currentPanoramaID);
|
|
803
|
+
if (!pano)
|
|
804
|
+
return -1;
|
|
805
|
+
if (!pano.neighborPanoramaIDs || pano.neighborPanoramaIDs.length === 0)
|
|
806
|
+
return -1;
|
|
807
|
+
const AngleDegreeThreshold = 12.0;
|
|
808
|
+
const direction = rayDirection.clone().normalize();
|
|
809
|
+
let maxCos = -1.0;
|
|
810
|
+
let ret = -1;
|
|
811
|
+
pano.neighborPanoramaIDs.forEach((pid) => {
|
|
812
|
+
const neighbour = this.panoramaMap.get(pid);
|
|
813
|
+
if (!neighbour)
|
|
814
|
+
return;
|
|
815
|
+
const cosin = neighbour.position.clone().sub(pano.position).normalize().dot(direction);
|
|
816
|
+
if (cosin > maxCos) {
|
|
817
|
+
maxCos = cosin;
|
|
818
|
+
ret = pid;
|
|
819
|
+
}
|
|
820
|
+
});
|
|
821
|
+
if (maxCos >= Math.cos(Math.PI * AngleDegreeThreshold / 180.0)) {
|
|
822
|
+
return ret;
|
|
823
|
+
}
|
|
824
|
+
return -1;
|
|
825
|
+
}
|
|
826
|
+
/**
|
|
827
|
+
* @ignore
|
|
828
|
+
*/
|
|
829
|
+
updateIndicatorGeometry() {
|
|
830
|
+
const { THREE } = Externals.getInstance();
|
|
831
|
+
let indicatorGeometry;
|
|
832
|
+
if (this.indicatorImageURL) {
|
|
833
|
+
indicatorGeometry = new THREE.PlaneBufferGeometry(this.indicatorWidth, this.indicatorHeight);
|
|
834
|
+
}
|
|
835
|
+
else {
|
|
836
|
+
indicatorGeometry = new THREE.CircleGeometry(this.indicatorWidth / 2, 32);
|
|
837
|
+
}
|
|
838
|
+
const indicatorSet = new Set();
|
|
839
|
+
Array.from(this.indicatorMap).forEach(([, mesh]) => {
|
|
840
|
+
indicatorSet.add(mesh.geometry);
|
|
841
|
+
mesh.geometry = indicatorGeometry;
|
|
842
|
+
});
|
|
843
|
+
Array.from(indicatorSet).forEach((geometry) => {
|
|
844
|
+
geometry.dispose();
|
|
845
|
+
});
|
|
846
|
+
this.indicatorMeshPrototype.geometry = indicatorGeometry;
|
|
847
|
+
const indicator = new THREE.Mesh(indicatorGeometry, this.indicatorMeshPrototype.material);
|
|
848
|
+
this.setIndicatorMeshPrototype(indicator);
|
|
849
|
+
}
|
|
850
|
+
/**
|
|
851
|
+
* 改变地面全景点标识的尺寸
|
|
852
|
+
* @param width 宽度
|
|
853
|
+
* @param height 高度
|
|
854
|
+
*/
|
|
855
|
+
setIndicatorSize(width, height) {
|
|
856
|
+
this.indicatorWidth = width;
|
|
857
|
+
this.indicatorHeight = height;
|
|
858
|
+
this.updateIndicatorGeometry();
|
|
859
|
+
}
|
|
860
|
+
/**
|
|
861
|
+
* 设置标签的图片
|
|
862
|
+
* @param url
|
|
863
|
+
*/
|
|
864
|
+
setIndicatorImageURL(url) {
|
|
865
|
+
const { THREE } = Externals.getInstance();
|
|
866
|
+
new THREE.TextureLoader().load(url, (texture) => {
|
|
867
|
+
const vertexShader = `
|
|
868
|
+
varying vec2 vUv;
|
|
869
|
+
void main(){
|
|
870
|
+
vUv = uv;
|
|
871
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
872
|
+
}
|
|
873
|
+
`;
|
|
874
|
+
const fragmentShader = `
|
|
875
|
+
uniform sampler2D map;
|
|
876
|
+
uniform float opacity;
|
|
877
|
+
uniform vec4 blendColor;
|
|
878
|
+
varying vec2 vUv;
|
|
879
|
+
void main(){
|
|
880
|
+
vec4 texColor = texture2D(map, vUv);
|
|
881
|
+
gl_FragColor = vec4((texColor * (1.0 - blendColor.a) + blendColor * blendColor.a).rgb, texColor.a * opacity);
|
|
882
|
+
}
|
|
883
|
+
`;
|
|
884
|
+
let currentMaterial = this.getIndicatorMaterial(IndicatorDisplayMode.Editing, true);
|
|
885
|
+
let newMaterial = new THREE.ShaderMaterial({
|
|
886
|
+
// 设置透明属性,这样透过全景图就能看到标签
|
|
887
|
+
transparent: true,
|
|
888
|
+
vertexShader,
|
|
889
|
+
fragmentShader,
|
|
890
|
+
uniforms: this.indicatorShaderUniforms,
|
|
891
|
+
side: NS_THREE.DoubleSide,
|
|
892
|
+
depthTest: false,
|
|
893
|
+
depthWrite: false,
|
|
894
|
+
name: 'indicatorMaterial',
|
|
895
|
+
});
|
|
896
|
+
this.setIndicatorMaterial(newMaterial, IndicatorDisplayMode.Editing, true);
|
|
897
|
+
currentMaterial.dispose();
|
|
898
|
+
currentMaterial = this.getIndicatorMaterial(IndicatorDisplayMode.Show, true);
|
|
899
|
+
this.setIndicatorMaterial(newMaterial, IndicatorDisplayMode.Show, true);
|
|
900
|
+
currentMaterial.dispose();
|
|
901
|
+
newMaterial = new THREE.ShaderMaterial({
|
|
902
|
+
transparent: true,
|
|
903
|
+
vertexShader,
|
|
904
|
+
fragmentShader,
|
|
905
|
+
uniforms: this.invisibleIndicatorShaderUniforms,
|
|
906
|
+
side: NS_THREE.DoubleSide,
|
|
907
|
+
depthTest: false,
|
|
908
|
+
depthWrite: false,
|
|
909
|
+
name: 'invisibleIndicatorMaterial',
|
|
910
|
+
});
|
|
911
|
+
this.indicatorShaderUniforms.map.value = texture;
|
|
912
|
+
this.invisibleIndicatorShaderUniforms.map.value = texture;
|
|
913
|
+
this.setIndicatorMaterial(newMaterial, IndicatorDisplayMode.Editing, false);
|
|
914
|
+
if (!this.indicatorImageURL) {
|
|
915
|
+
this.setIndicatorMeshPrototype(new THREE.Mesh(new THREE.PlaneBufferGeometry(this.indicatorWidth, this.indicatorHeight), newMaterial));
|
|
916
|
+
}
|
|
917
|
+
this.indicatorImageURL = url;
|
|
918
|
+
this.needUpdate = true;
|
|
919
|
+
this.updateIndicatorGeometry();
|
|
920
|
+
});
|
|
921
|
+
}
|
|
922
|
+
/**
|
|
923
|
+
* 查询当前设置的地面全景点标识尺寸
|
|
924
|
+
* @returns number数组,依次是width, height
|
|
925
|
+
*/
|
|
926
|
+
getIndicatorSize() {
|
|
927
|
+
return [this.indicatorWidth, this.indicatorHeight];
|
|
928
|
+
}
|
|
929
|
+
setIndicatorMeshPrototype(mesh) {
|
|
930
|
+
this.indicatorMeshPrototype = mesh;
|
|
931
|
+
this.panoramaMap.forEach((pano, pid) => {
|
|
932
|
+
const indicator = this.indicatorMap.get(pid);
|
|
933
|
+
if (indicator) {
|
|
934
|
+
this.group.remove(indicator);
|
|
935
|
+
this.indicatorMap.delete(pid);
|
|
936
|
+
}
|
|
937
|
+
});
|
|
938
|
+
mesh.renderOrder = 300;
|
|
939
|
+
this.needUpdate = true;
|
|
940
|
+
}
|
|
941
|
+
/**
|
|
942
|
+
* 设定全景点位标签的原型对象,每个全景点位的标签会以该原型对象为母本clone出来
|
|
943
|
+
* @param prototypeObject 点位标签原型Object3D对象
|
|
944
|
+
* @param mode 点位的展示模式
|
|
945
|
+
* @param visibility 点位的显隐状态设置
|
|
946
|
+
*/
|
|
947
|
+
setIndicatorMaterial(material, mode, visibility) {
|
|
948
|
+
let map1 = this.indicatorMaterials.get(mode);
|
|
949
|
+
if (!map1) {
|
|
950
|
+
map1 = new Map();
|
|
951
|
+
this.indicatorMaterials.set(mode, map1);
|
|
952
|
+
}
|
|
953
|
+
map1.set(visibility, material);
|
|
954
|
+
this.needUpdate = true;
|
|
955
|
+
}
|
|
956
|
+
/**
|
|
957
|
+
* 获取标签材质
|
|
958
|
+
* @param mode
|
|
959
|
+
* @param visibility
|
|
960
|
+
* @returns
|
|
961
|
+
*/
|
|
962
|
+
getIndicatorMaterial(mode, visibility) {
|
|
963
|
+
let map1 = this.indicatorMaterials.get(mode);
|
|
964
|
+
if (!map1) {
|
|
965
|
+
map1 = new Map();
|
|
966
|
+
this.indicatorMaterials.set(mode, map1);
|
|
967
|
+
}
|
|
968
|
+
return map1.get(visibility);
|
|
969
|
+
}
|
|
970
|
+
/**
|
|
971
|
+
* 配置全景图组在不同view中的显示状态
|
|
972
|
+
* @param configuration 全景图组配置,见[[PanoramaGroupViewConfiguration]]
|
|
973
|
+
*/
|
|
974
|
+
addGroupViewConfiguration(configuration) {
|
|
975
|
+
const conf0 = this.viewConfigurations.get(configuration.targetView);
|
|
976
|
+
if (conf0) {
|
|
977
|
+
if (configuration.showBoundBox === undefined && conf0.showBoundBox !== undefined) {
|
|
978
|
+
configuration.showBoundBox = conf0.showBoundBox;
|
|
979
|
+
}
|
|
980
|
+
if (configuration.visibleRadius === undefined && conf0.visibleRadius !== undefined) {
|
|
981
|
+
configuration.visibleRadius = conf0.visibleRadius;
|
|
982
|
+
}
|
|
983
|
+
if (configuration.indicatorDisplayMode === undefined && conf0.indicatorDisplayMode !== undefined) {
|
|
984
|
+
configuration.indicatorDisplayMode = conf0.indicatorDisplayMode;
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
this.viewConfigurations.set(configuration.targetView, configuration);
|
|
988
|
+
this.needUpdate = true;
|
|
989
|
+
// /!!!For Debug #Async#
|
|
990
|
+
// this.setBoundBoxVisible(configuration.showBoundBox!);
|
|
991
|
+
}
|
|
992
|
+
/**
|
|
993
|
+
* 设置最大时间距离
|
|
994
|
+
* @param distance
|
|
995
|
+
*/
|
|
996
|
+
setMaxWorldDistance(distance) {
|
|
997
|
+
this.maxWorldDistance = distance;
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
/** 默认有效半径 */
|
|
1001
|
+
TilePanoramaGroup.DefaultVisibleRadius = 10;
|
|
1002
|
+
/** 标签显示半径 */
|
|
1003
|
+
TilePanoramaGroup.IndicatorRadius = 0.1;
|
|
1004
|
+
/** 标签高度偏移 */
|
|
1005
|
+
TilePanoramaGroup.IndicatorOffsetZ = 0.1;
|
|
1006
|
+
export { TilePanoramaGroup, IndicatorDisplayMode, };
|