@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,161 @@
|
|
|
1
|
+
import { NS_THREE } from '../stage/externals';
|
|
2
|
+
import { Element, ElementFrameContext } from './element';
|
|
3
|
+
import { View } from '../view';
|
|
4
|
+
import { TilePlane } from './tile-plane';
|
|
5
|
+
import { TileTextureInfo } from '../utils/tile-util';
|
|
6
|
+
interface TilePanoramaViewConfiguration {
|
|
7
|
+
targetView: View;
|
|
8
|
+
showBorder?: boolean;
|
|
9
|
+
showSkyBox?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 全景图对象
|
|
13
|
+
* @noInheritDoc
|
|
14
|
+
*/
|
|
15
|
+
declare class TilePanorama extends Element {
|
|
16
|
+
private initialized;
|
|
17
|
+
private needsUpdate;
|
|
18
|
+
private level;
|
|
19
|
+
/** @ignore */
|
|
20
|
+
levelMax: number;
|
|
21
|
+
private sphereMesh;
|
|
22
|
+
private isPlayingVideo;
|
|
23
|
+
private video;
|
|
24
|
+
private wireFrame;
|
|
25
|
+
/** @ignore */
|
|
26
|
+
tilePlanes: TilePlane[];
|
|
27
|
+
pid: number;
|
|
28
|
+
/** @ignore */
|
|
29
|
+
seqID: number;
|
|
30
|
+
/** @ignore */
|
|
31
|
+
neighborPanoramaIDs: number[];
|
|
32
|
+
/** @ignore */
|
|
33
|
+
highTextureURLs: string[];
|
|
34
|
+
/** @ignore */
|
|
35
|
+
textureURLs: string[];
|
|
36
|
+
/** @ignore */
|
|
37
|
+
offLinTextureUrls: string[];
|
|
38
|
+
/** @ignore */
|
|
39
|
+
offLineTextureLevel: number;
|
|
40
|
+
/** @ignore */
|
|
41
|
+
useLowTextureURLsOnly: boolean;
|
|
42
|
+
/** @ignore */
|
|
43
|
+
tiledTextureURLRoot: string | undefined;
|
|
44
|
+
private baseQuaternion;
|
|
45
|
+
private additionalQuaternion;
|
|
46
|
+
private panoramaLoaded;
|
|
47
|
+
private eventListeners;
|
|
48
|
+
private isSelected;
|
|
49
|
+
private videoCanvas;
|
|
50
|
+
private mpegVideoPlayer;
|
|
51
|
+
private videoContentType;
|
|
52
|
+
private mounted;
|
|
53
|
+
/**
|
|
54
|
+
* @param textureURLs 低清立方体贴图六张图的URL数组(本地相对路径或网络URL均可),按右左上下前后的顺序
|
|
55
|
+
* @param highTextureURLs 高清立方体贴图六张图的URL数组(本地相对路径或网络URL均可),按右左上下前后的顺序
|
|
56
|
+
* @param useLowTextureURLsOnly 可选,设置后则(如果没有提供瓦片贴图)只使用低清立方体贴图
|
|
57
|
+
* @param tiledTextureURLRoot 可选,瓦片贴图URL的前缀部分,若没有则用highTextureURLs和lowTextureURLs作为贴图源
|
|
58
|
+
*/
|
|
59
|
+
constructor(pid: number, seqID: number, textureURLs: string[], neighborPanoramaIDs: number[], levelMax: number, offLinTextureUrls?: string[], offLineTextureLevel?: number, position?: NS_THREE.Vector3, quaternion?: NS_THREE.Quaternion);
|
|
60
|
+
/**
|
|
61
|
+
* 关联包围框
|
|
62
|
+
* @param size
|
|
63
|
+
*/
|
|
64
|
+
private linkLineBox;
|
|
65
|
+
/**
|
|
66
|
+
* 关联球
|
|
67
|
+
* @returns
|
|
68
|
+
*/
|
|
69
|
+
private linkShere;
|
|
70
|
+
/**
|
|
71
|
+
* 挂载
|
|
72
|
+
* @ignore
|
|
73
|
+
*/
|
|
74
|
+
mount(): void;
|
|
75
|
+
/**
|
|
76
|
+
* 卸载
|
|
77
|
+
*/
|
|
78
|
+
unMount(): void;
|
|
79
|
+
/**
|
|
80
|
+
* 更新等级
|
|
81
|
+
* @param level
|
|
82
|
+
*/
|
|
83
|
+
updateLevel(level: number): void;
|
|
84
|
+
/**
|
|
85
|
+
* 获取预处理纹理信息
|
|
86
|
+
* @returns
|
|
87
|
+
*/
|
|
88
|
+
getPreTextureInfos(): TileTextureInfo[];
|
|
89
|
+
/**
|
|
90
|
+
* 设置位移
|
|
91
|
+
* @param position
|
|
92
|
+
* @param quaternion
|
|
93
|
+
*/
|
|
94
|
+
private setTransform;
|
|
95
|
+
/**
|
|
96
|
+
* 暂停视频播放
|
|
97
|
+
*/
|
|
98
|
+
pauseVideo(): void;
|
|
99
|
+
/**
|
|
100
|
+
* 恢复视频播放
|
|
101
|
+
*/
|
|
102
|
+
resumeVideo(): Promise<void>;
|
|
103
|
+
/**
|
|
104
|
+
* 停止视频播放,并释放视频相关资源
|
|
105
|
+
*/
|
|
106
|
+
stopVideo(): void;
|
|
107
|
+
/**
|
|
108
|
+
* 开始视频播放
|
|
109
|
+
* @param videoURL 视频地址
|
|
110
|
+
* @param loop 是否循环播放
|
|
111
|
+
* @param callbacks 回调函数集合,可选
|
|
112
|
+
*/
|
|
113
|
+
playVideo(videoURL: string, loop: boolean, callbacks?: {
|
|
114
|
+
onPrepareToPlay?: (video?: HTMLVideoElement) => void;
|
|
115
|
+
onReadyToPlay?: (video?: HTMLVideoElement) => void;
|
|
116
|
+
onEnded?: (video?: HTMLVideoElement) => void;
|
|
117
|
+
}, contentType?: 'mp4' | 'ts', canvasSize?: [number, number]): HTMLVideoElement | null;
|
|
118
|
+
/**
|
|
119
|
+
* 设置是否只使用低分辨率贴图
|
|
120
|
+
* @param useLowTexturesOnly 是否只使用低分辨率贴图
|
|
121
|
+
*/
|
|
122
|
+
setUseLowTexturesOnly(useLowTexturesOnly: boolean): void;
|
|
123
|
+
/**
|
|
124
|
+
* 是否使用地分辨率贴图
|
|
125
|
+
* @returns
|
|
126
|
+
*/
|
|
127
|
+
isUseLowTexturesOnly(): boolean;
|
|
128
|
+
/**
|
|
129
|
+
* 清理
|
|
130
|
+
*/
|
|
131
|
+
dispose(): void;
|
|
132
|
+
/**
|
|
133
|
+
* @ignore
|
|
134
|
+
*/
|
|
135
|
+
update(): ElementFrameContext;
|
|
136
|
+
/**
|
|
137
|
+
* 使用欧拉角模式设置矫正
|
|
138
|
+
* @param roll 横滚角, 坐标轴为x
|
|
139
|
+
* @param pitch 俯仰角, 坐标轴为y
|
|
140
|
+
* @param yaw 偏航角, 坐标轴为z
|
|
141
|
+
*/
|
|
142
|
+
setAdditionalRotationInEuler(roll: number, pitch: number, yaw: number): NS_THREE.Quaternion;
|
|
143
|
+
/**
|
|
144
|
+
* 使用四元数模式设置矫正
|
|
145
|
+
* @param x 四元数的x值
|
|
146
|
+
* @param y 四元数的y值
|
|
147
|
+
* @param z 四元数的y值
|
|
148
|
+
* @param w 四元数的w值
|
|
149
|
+
*/
|
|
150
|
+
setAdditionalRotationInQuaternion(x: number, y: number, z: number, w: number): NS_THREE.Euler;
|
|
151
|
+
/**
|
|
152
|
+
* 获取盒子
|
|
153
|
+
* @ignore
|
|
154
|
+
* @returns
|
|
155
|
+
*/
|
|
156
|
+
getBox(): {
|
|
157
|
+
size: number;
|
|
158
|
+
matrix: NS_THREE.Matrix4;
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
export { TilePanorama, TilePanoramaViewConfiguration };
|
|
@@ -0,0 +1,509 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { Externals } from '../stage/externals';
|
|
11
|
+
import { Element, ElementFrameContext } from './element';
|
|
12
|
+
import { EventHub } from '../utils/event-hub';
|
|
13
|
+
import { Events, OwllyEvents } from '../utils/events';
|
|
14
|
+
import { DeviceUtils } from '../utils/device-utils';
|
|
15
|
+
import { TilePlaneUtil } from './tile-plane';
|
|
16
|
+
import { CubeFaceConfig, TileTextureInfo, TileUtil } from '../utils/tile-util';
|
|
17
|
+
let sphereInstance;
|
|
18
|
+
const TILE_PANORAMA_SIZE = 2;
|
|
19
|
+
/**
|
|
20
|
+
* 全景图对象
|
|
21
|
+
* @noInheritDoc
|
|
22
|
+
*/
|
|
23
|
+
class TilePanorama extends Element {
|
|
24
|
+
/**
|
|
25
|
+
* @param textureURLs 低清立方体贴图六张图的URL数组(本地相对路径或网络URL均可),按右左上下前后的顺序
|
|
26
|
+
* @param highTextureURLs 高清立方体贴图六张图的URL数组(本地相对路径或网络URL均可),按右左上下前后的顺序
|
|
27
|
+
* @param useLowTextureURLsOnly 可选,设置后则(如果没有提供瓦片贴图)只使用低清立方体贴图
|
|
28
|
+
* @param tiledTextureURLRoot 可选,瓦片贴图URL的前缀部分,若没有则用highTextureURLs和lowTextureURLs作为贴图源
|
|
29
|
+
*/
|
|
30
|
+
constructor(pid, seqID, textureURLs, neighborPanoramaIDs = [], levelMax, offLinTextureUrls, offLineTextureLevel, position, quaternion) {
|
|
31
|
+
super();
|
|
32
|
+
this.level = 0;
|
|
33
|
+
/** @ignore */
|
|
34
|
+
this.levelMax = 0;
|
|
35
|
+
/** @ignore */
|
|
36
|
+
this.offLineTextureLevel = -1;
|
|
37
|
+
this.pid = pid;
|
|
38
|
+
this.seqID = seqID;
|
|
39
|
+
this.textureURLs = textureURLs;
|
|
40
|
+
this.levelMax = levelMax;
|
|
41
|
+
this.neighborPanoramaIDs = neighborPanoramaIDs;
|
|
42
|
+
this.offLinTextureUrls = offLinTextureUrls || [];
|
|
43
|
+
if (offLineTextureLevel != null) {
|
|
44
|
+
this.offLineTextureLevel = offLineTextureLevel;
|
|
45
|
+
}
|
|
46
|
+
this.initialized = false;
|
|
47
|
+
this.mounted = false;
|
|
48
|
+
this.needsUpdate = false;
|
|
49
|
+
this.tilePlanes = [];
|
|
50
|
+
this.isPlayingVideo = false;
|
|
51
|
+
this.videoCanvas = null;
|
|
52
|
+
this.videoContentType = 'mp4';
|
|
53
|
+
this.setTransform(position, quaternion);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* 关联包围框
|
|
57
|
+
* @param size
|
|
58
|
+
*/
|
|
59
|
+
linkLineBox(size) {
|
|
60
|
+
const { THREE } = Externals.getInstance();
|
|
61
|
+
const boxGeometry = new THREE.BoxBufferGeometry(size, size, size);
|
|
62
|
+
this.wireFrame = new THREE.LineSegments(new THREE.EdgesGeometry(boxGeometry), new THREE.LineBasicMaterial({ color: 0xff0000 }));
|
|
63
|
+
this.wireFrame.material.visible = false;
|
|
64
|
+
this.wireFrame.renderOrder = 100;
|
|
65
|
+
this.add(this.wireFrame);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* 关联球
|
|
69
|
+
* @returns
|
|
70
|
+
*/
|
|
71
|
+
linkShere() {
|
|
72
|
+
const { THREE } = Externals.getInstance();
|
|
73
|
+
if (!sphereInstance) {
|
|
74
|
+
const sphereGeometry = new THREE.SphereBufferGeometry(1, 60, 40);
|
|
75
|
+
sphereGeometry.scale(1, -1, 1);
|
|
76
|
+
sphereGeometry.rotateY(-90 * Math.PI / 180.0);
|
|
77
|
+
sphereInstance = new THREE.Mesh(sphereGeometry);
|
|
78
|
+
sphereInstance.visible = false;
|
|
79
|
+
sphereInstance.renderOrder = 150;
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
// sphereInstance.matrix.identity();
|
|
83
|
+
}
|
|
84
|
+
// sphereInstance.applyMatrix4(matrix);
|
|
85
|
+
return sphereInstance;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* 挂载
|
|
89
|
+
* @ignore
|
|
90
|
+
*/
|
|
91
|
+
mount() {
|
|
92
|
+
TilePlaneUtil.setPlanesVisible(true);
|
|
93
|
+
this.tilePlanes = TilePlaneUtil.getPlanesByMatrix(this.pid, this.level, this.textureURLs, this.offLineTextureLevel, this.offLinTextureUrls);
|
|
94
|
+
this.tilePlanes.forEach((plane) => {
|
|
95
|
+
this.add(plane);
|
|
96
|
+
plane.visible = true;
|
|
97
|
+
// plane.renderOnce();
|
|
98
|
+
});
|
|
99
|
+
this.sphereMesh = this.linkShere();
|
|
100
|
+
this.linkLineBox(TILE_PANORAMA_SIZE);
|
|
101
|
+
this.add(this.sphereMesh);
|
|
102
|
+
this.mounted = true;
|
|
103
|
+
this.emit(Events.DID_LOAD_PANORAMA, this.pid);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* 卸载
|
|
107
|
+
*/
|
|
108
|
+
unMount() {
|
|
109
|
+
TilePlaneUtil.setPlanesVisible(false);
|
|
110
|
+
this.tilePlanes.forEach((plane) => {
|
|
111
|
+
// plane.visible = false;
|
|
112
|
+
this.remove(plane);
|
|
113
|
+
});
|
|
114
|
+
this.tilePlanes = [];
|
|
115
|
+
if (this.sphereMesh) {
|
|
116
|
+
this.remove();
|
|
117
|
+
this.sphereMesh = null;
|
|
118
|
+
}
|
|
119
|
+
this.mounted = false;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* 更新等级
|
|
123
|
+
* @param level
|
|
124
|
+
*/
|
|
125
|
+
updateLevel(level) {
|
|
126
|
+
const tLevel = Math.min(level, this.levelMax);
|
|
127
|
+
if (this.level !== tLevel) {
|
|
128
|
+
this.level = tLevel;
|
|
129
|
+
if (this.tilePlanes) {
|
|
130
|
+
this.tilePlanes.forEach((plane) => {
|
|
131
|
+
plane.level = tLevel;
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* 获取预处理纹理信息
|
|
138
|
+
* @returns
|
|
139
|
+
*/
|
|
140
|
+
getPreTextureInfos() {
|
|
141
|
+
const ref = [];
|
|
142
|
+
CubeFaceConfig.forEach((config, index) => {
|
|
143
|
+
const { face, } = config;
|
|
144
|
+
const { level, textureURLs, offLineTextureLevel, offLinTextureUrls, } = this;
|
|
145
|
+
const pPid = this.pid + (face + 1) / 10;
|
|
146
|
+
const count = TileUtil.getCount(this.level);
|
|
147
|
+
for (let i = 0; i < count; i++) {
|
|
148
|
+
const info = new TileTextureInfo(pPid, 0, level, i, textureURLs[index], offLineTextureLevel, offLinTextureUrls[index]);
|
|
149
|
+
if (level === 0) {
|
|
150
|
+
info.frize = true;
|
|
151
|
+
}
|
|
152
|
+
ref.push(info);
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
return ref;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* 设置位移
|
|
159
|
+
* @param position
|
|
160
|
+
* @param quaternion
|
|
161
|
+
*/
|
|
162
|
+
setTransform(position, quaternion) {
|
|
163
|
+
if (position) {
|
|
164
|
+
this.position.copy(position);
|
|
165
|
+
}
|
|
166
|
+
if (quaternion) {
|
|
167
|
+
this.quaternion.copy(quaternion);
|
|
168
|
+
}
|
|
169
|
+
const { THREE } = Externals.getInstance();
|
|
170
|
+
this.baseQuaternion = new THREE.Quaternion().copy(this.quaternion);
|
|
171
|
+
this.additionalQuaternion = new THREE.Quaternion();
|
|
172
|
+
/* eslint-disable no-underscore-dangle */
|
|
173
|
+
const onQuaternionChangeCallback = this.quaternion._onChangeCallback;
|
|
174
|
+
this.quaternion._onChange(() => {
|
|
175
|
+
onQuaternionChangeCallback();
|
|
176
|
+
const targetQuaternion = new THREE.Quaternion()
|
|
177
|
+
.multiplyQuaternions(this.baseQuaternion, this.additionalQuaternion);
|
|
178
|
+
if (targetQuaternion.equals(this.quaternion))
|
|
179
|
+
return;
|
|
180
|
+
this.baseQuaternion = this.quaternion.clone();
|
|
181
|
+
const { x, y, z, w, } = new THREE.Quaternion().multiplyQuaternions(this.baseQuaternion, this.additionalQuaternion);
|
|
182
|
+
this.quaternion.set(x, y, z, w);
|
|
183
|
+
this.needsUpdate = true;
|
|
184
|
+
});
|
|
185
|
+
const onRotationChangeCallback = this.rotation._onChangeCallback;
|
|
186
|
+
this.rotation._onChange(() => {
|
|
187
|
+
onRotationChangeCallback();
|
|
188
|
+
const reverse = this.additionalQuaternion.clone().invert();
|
|
189
|
+
this.baseQuaternion = this.quaternion.clone().multiply(reverse);
|
|
190
|
+
});
|
|
191
|
+
this.eventListeners = {
|
|
192
|
+
onPanoramaSelected: (panorama) => {
|
|
193
|
+
this.isSelected = panorama === this;
|
|
194
|
+
if (!this.isSelected)
|
|
195
|
+
return;
|
|
196
|
+
this.emit(Events.PANORAMA_SELECTED, this.pid);
|
|
197
|
+
},
|
|
198
|
+
onEnded: () => { },
|
|
199
|
+
};
|
|
200
|
+
EventHub.on(OwllyEvents.ELEMENT_SELECTED, this.eventListeners.onPanoramaSelected);
|
|
201
|
+
}
|
|
202
|
+
// /**
|
|
203
|
+
// * 为全景图对象设置立方体贴图
|
|
204
|
+
// * @param cubeTexture 立方体贴图对象
|
|
205
|
+
// */
|
|
206
|
+
// public setTexture(): void {
|
|
207
|
+
// this.needsUpdate = true;
|
|
208
|
+
// if (!this.panoramaLoaded) {
|
|
209
|
+
// this.emit(Events.DID_LOAD_PANORAMA, this.pid);
|
|
210
|
+
// }
|
|
211
|
+
// this.panoramaLoaded = true;
|
|
212
|
+
// }
|
|
213
|
+
/**
|
|
214
|
+
* 暂停视频播放
|
|
215
|
+
*/
|
|
216
|
+
pauseVideo() {
|
|
217
|
+
if (this.videoContentType === 'ts') {
|
|
218
|
+
if (this.mpegVideoPlayer)
|
|
219
|
+
this.mpegVideoPlayer.pause();
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
const videoElementID = `pano_vid_${this.pid}`;
|
|
223
|
+
this.video = this.video || document.getElementById(videoElementID);
|
|
224
|
+
if (!this.video) {
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
this.video.pause();
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* 恢复视频播放
|
|
232
|
+
*/
|
|
233
|
+
resumeVideo() {
|
|
234
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
235
|
+
if (this.videoContentType === 'ts') {
|
|
236
|
+
if (this.mpegVideoPlayer)
|
|
237
|
+
this.mpegVideoPlayer.play();
|
|
238
|
+
}
|
|
239
|
+
else {
|
|
240
|
+
const videoElementID = `pano_vid_${this.pid}`;
|
|
241
|
+
this.video = this.video || document.getElementById(videoElementID);
|
|
242
|
+
if (!this.video) {
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
yield this.video.play();
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* 停止视频播放,并释放视频相关资源
|
|
251
|
+
*/
|
|
252
|
+
stopVideo() {
|
|
253
|
+
if (!this.sphereMesh) {
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
this.sphereMesh.visible = false;
|
|
257
|
+
if (this.videoContentType === 'ts') {
|
|
258
|
+
if (this.mpegVideoPlayer) {
|
|
259
|
+
this.mpegVideoPlayer.stop();
|
|
260
|
+
this.mpegVideoPlayer.destroy();
|
|
261
|
+
this.mpegVideoPlayer = null;
|
|
262
|
+
}
|
|
263
|
+
const canvasTexture = this.sphereMesh.material.map;
|
|
264
|
+
if (canvasTexture)
|
|
265
|
+
canvasTexture.dispose();
|
|
266
|
+
this.sphereMesh.material.dispose();
|
|
267
|
+
this.videoCanvas = null;
|
|
268
|
+
}
|
|
269
|
+
else {
|
|
270
|
+
const videoElementID = `pano_vid_${this.pid}`;
|
|
271
|
+
this.video = this.video || document.getElementById(videoElementID);
|
|
272
|
+
const videoTexture = this.sphereMesh.material.map;
|
|
273
|
+
if (videoTexture) {
|
|
274
|
+
videoTexture.dispose();
|
|
275
|
+
}
|
|
276
|
+
this.sphereMesh.material.dispose();
|
|
277
|
+
if (this.video) {
|
|
278
|
+
this.video.pause();
|
|
279
|
+
this.video.removeAttribute('src');
|
|
280
|
+
this.video.load();
|
|
281
|
+
this.video = null;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
if (this.eventListeners.onEnded)
|
|
285
|
+
this.eventListeners.onEnded();
|
|
286
|
+
this.isPlayingVideo = false;
|
|
287
|
+
this.needsUpdate = true;
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* 开始视频播放
|
|
291
|
+
* @param videoURL 视频地址
|
|
292
|
+
* @param loop 是否循环播放
|
|
293
|
+
* @param callbacks 回调函数集合,可选
|
|
294
|
+
*/
|
|
295
|
+
playVideo(videoURL, loop, callbacks, contentType = 'mp4', canvasSize = [2048, 2048]) {
|
|
296
|
+
if (!this.sphereMesh) {
|
|
297
|
+
return null;
|
|
298
|
+
}
|
|
299
|
+
const { THREE } = Externals.getInstance();
|
|
300
|
+
const { onReadyToPlay, onEnded, onPrepareToPlay } = callbacks || {};
|
|
301
|
+
this.videoContentType = contentType;
|
|
302
|
+
this.eventListeners.onEnded = onEnded || (() => { });
|
|
303
|
+
if (this.videoContentType === 'ts') {
|
|
304
|
+
if (!JSMpeg || !JSMpeg.Player)
|
|
305
|
+
throw new Error('JSMpeg is needed. Please get JSMpeg from https://github.com/phoboslab/jsmpeg');
|
|
306
|
+
if (!this.videoCanvas) {
|
|
307
|
+
this.videoCanvas = document.createElement('canvas');
|
|
308
|
+
[this.videoCanvas.width, this.videoCanvas.height] = canvasSize;
|
|
309
|
+
}
|
|
310
|
+
this.mpegVideoPlayer = new JSMpeg.Player(videoURL, {
|
|
311
|
+
canvas: this.videoCanvas,
|
|
312
|
+
loop,
|
|
313
|
+
autoplay: false,
|
|
314
|
+
disableGl: false,
|
|
315
|
+
onSourceEstablished: () => {
|
|
316
|
+
this.needsUpdate = true;
|
|
317
|
+
if (onPrepareToPlay)
|
|
318
|
+
onPrepareToPlay();
|
|
319
|
+
},
|
|
320
|
+
onPlay: () => {
|
|
321
|
+
if (this.sphereMesh) {
|
|
322
|
+
this.sphereMesh.visible = true;
|
|
323
|
+
}
|
|
324
|
+
this.needsUpdate = true;
|
|
325
|
+
if (onReadyToPlay)
|
|
326
|
+
onReadyToPlay();
|
|
327
|
+
this.isPlayingVideo = true;
|
|
328
|
+
},
|
|
329
|
+
onPause: () => { },
|
|
330
|
+
onStalled: () => { },
|
|
331
|
+
onEnded: () => {
|
|
332
|
+
this.stopVideo();
|
|
333
|
+
},
|
|
334
|
+
chunkSize: 8 * 1024 * 1024,
|
|
335
|
+
videoBufferSize: 8 * 512 * 1024,
|
|
336
|
+
decodeFirstFrame: false,
|
|
337
|
+
preserveDrawingBuffer: false,
|
|
338
|
+
});
|
|
339
|
+
const texture = new THREE.CanvasTexture(this.videoCanvas);
|
|
340
|
+
texture.needsUpdate = true;
|
|
341
|
+
if (DeviceUtils.DetectIOS())
|
|
342
|
+
texture.flipY = false;
|
|
343
|
+
this.sphereMesh.material = new THREE.MeshBasicMaterial({
|
|
344
|
+
map: texture,
|
|
345
|
+
// side: DoubleSide,
|
|
346
|
+
transparent: false,
|
|
347
|
+
depthTest: false,
|
|
348
|
+
depthWrite: false,
|
|
349
|
+
});
|
|
350
|
+
this.mpegVideoPlayer.source.established = false;
|
|
351
|
+
this.mpegVideoPlayer.source.loadedSize = 0;
|
|
352
|
+
this.mpegVideoPlayer.demuxer.startTime = 0;
|
|
353
|
+
this.mpegVideoPlayer.demuxer.currentTime = 0;
|
|
354
|
+
this.mpegVideoPlayer.demuxer.bits = null;
|
|
355
|
+
this.mpegVideoPlayer.demuxer.leftoverBytes = null;
|
|
356
|
+
this.mpegVideoPlayer.audioOut.resetEnqueuedTime();
|
|
357
|
+
this.mpegVideoPlayer.audioOut.unlock();
|
|
358
|
+
this.mpegVideoPlayer.seek(0);
|
|
359
|
+
this.mpegVideoPlayer.play();
|
|
360
|
+
}
|
|
361
|
+
else {
|
|
362
|
+
const videoElementID = `pano_vid_${this.pid}`;
|
|
363
|
+
this.video = document.getElementById(videoElementID);
|
|
364
|
+
if (!this.video) {
|
|
365
|
+
this.video = document.createElement('video');
|
|
366
|
+
this.video.id = videoElementID;
|
|
367
|
+
this.video.setAttribute('webkit-playsinline', 'true');
|
|
368
|
+
this.video.setAttribute('x5-playsinline', 'true');
|
|
369
|
+
this.video.setAttribute('playsinline', 'true');
|
|
370
|
+
this.video.setAttribute('crossorigin', 'anonymous');
|
|
371
|
+
// console.info('#Video# video', video);
|
|
372
|
+
}
|
|
373
|
+
this.video.src = videoURL;
|
|
374
|
+
this.video.loop = !!loop;
|
|
375
|
+
this.video.addEventListener('playing', () => {
|
|
376
|
+
// console.info('#Video# playing', ev);
|
|
377
|
+
if (this.sphereMesh) {
|
|
378
|
+
this.sphereMesh.visible = true;
|
|
379
|
+
}
|
|
380
|
+
this.needsUpdate = true;
|
|
381
|
+
if (onReadyToPlay) {
|
|
382
|
+
onReadyToPlay(this.video);
|
|
383
|
+
}
|
|
384
|
+
this.isPlayingVideo = true;
|
|
385
|
+
});
|
|
386
|
+
this.video.addEventListener('ended', () => {
|
|
387
|
+
this.stopVideo();
|
|
388
|
+
});
|
|
389
|
+
this.video.addEventListener('play', () => {
|
|
390
|
+
// console.info('#Video# play', ev);
|
|
391
|
+
this.needsUpdate = true;
|
|
392
|
+
if (onPrepareToPlay) {
|
|
393
|
+
onPrepareToPlay(this.video);
|
|
394
|
+
}
|
|
395
|
+
});
|
|
396
|
+
this.video.play();
|
|
397
|
+
const texture = new THREE.VideoTexture(this.video);
|
|
398
|
+
texture.needsUpdate = true;
|
|
399
|
+
this.sphereMesh.material = new THREE.MeshBasicMaterial({
|
|
400
|
+
map: texture,
|
|
401
|
+
// side: DoubleSide,
|
|
402
|
+
transparent: false,
|
|
403
|
+
depthTest: false,
|
|
404
|
+
depthWrite: false,
|
|
405
|
+
});
|
|
406
|
+
return this.video;
|
|
407
|
+
}
|
|
408
|
+
return null;
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* 设置是否只使用低分辨率贴图
|
|
412
|
+
* @param useLowTexturesOnly 是否只使用低分辨率贴图
|
|
413
|
+
*/
|
|
414
|
+
setUseLowTexturesOnly(useLowTexturesOnly) {
|
|
415
|
+
this.useLowTextureURLsOnly = useLowTexturesOnly;
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* 是否使用地分辨率贴图
|
|
419
|
+
* @returns
|
|
420
|
+
*/
|
|
421
|
+
isUseLowTexturesOnly() {
|
|
422
|
+
return this.useLowTextureURLsOnly;
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* 清理
|
|
426
|
+
*/
|
|
427
|
+
dispose() {
|
|
428
|
+
super.dispose();
|
|
429
|
+
if (this.mounted) {
|
|
430
|
+
this.unMount();
|
|
431
|
+
}
|
|
432
|
+
this.initialized = false;
|
|
433
|
+
EventHub.off(OwllyEvents.ELEMENT_SELECTED, this.eventListeners.onPanoramaSelected);
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* @ignore
|
|
437
|
+
*/
|
|
438
|
+
update() {
|
|
439
|
+
const frameContext = new ElementFrameContext(this);
|
|
440
|
+
if (!this.initialized) {
|
|
441
|
+
this.initialized = true;
|
|
442
|
+
frameContext.needUpdate = true;
|
|
443
|
+
}
|
|
444
|
+
else if (this.needsUpdate || this.isPlayingVideo) {
|
|
445
|
+
frameContext.needUpdate = true;
|
|
446
|
+
if (this.sphereMesh
|
|
447
|
+
&& this.isPlayingVideo
|
|
448
|
+
&& this.videoCanvas
|
|
449
|
+
&& this.sphereMesh.material.map) {
|
|
450
|
+
this.sphereMesh.material.map.needsUpdate = true;
|
|
451
|
+
}
|
|
452
|
+
this.needsUpdate = false;
|
|
453
|
+
}
|
|
454
|
+
if (this.initialized && !this.parent) {
|
|
455
|
+
frameContext.shouldPlaceElement = true;
|
|
456
|
+
}
|
|
457
|
+
return frameContext;
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* 使用欧拉角模式设置矫正
|
|
461
|
+
* @param roll 横滚角, 坐标轴为x
|
|
462
|
+
* @param pitch 俯仰角, 坐标轴为y
|
|
463
|
+
* @param yaw 偏航角, 坐标轴为z
|
|
464
|
+
*/
|
|
465
|
+
setAdditionalRotationInEuler(roll, pitch, yaw) {
|
|
466
|
+
const { THREE } = Externals.getInstance();
|
|
467
|
+
this.additionalQuaternion.setFromEuler(new THREE.Euler(roll, pitch, yaw));
|
|
468
|
+
const { x, y, z, w, } = this.baseQuaternion.clone().multiply(this.additionalQuaternion);
|
|
469
|
+
this.quaternion.set(x, y, z, w);
|
|
470
|
+
this.needsUpdate = true;
|
|
471
|
+
return this.additionalQuaternion.clone();
|
|
472
|
+
}
|
|
473
|
+
/**
|
|
474
|
+
* 使用四元数模式设置矫正
|
|
475
|
+
* @param x 四元数的x值
|
|
476
|
+
* @param y 四元数的y值
|
|
477
|
+
* @param z 四元数的y值
|
|
478
|
+
* @param w 四元数的w值
|
|
479
|
+
*/
|
|
480
|
+
setAdditionalRotationInQuaternion(x, y, z, w) {
|
|
481
|
+
const { THREE } = Externals.getInstance();
|
|
482
|
+
this.additionalQuaternion.set(x, y, z, w);
|
|
483
|
+
const { x: tx, y: ty, z: tz, w: tw, } = this.baseQuaternion.clone().multiply(this.additionalQuaternion);
|
|
484
|
+
this.quaternion.set(tx, ty, tz, tw);
|
|
485
|
+
this.needsUpdate = true;
|
|
486
|
+
return new THREE.Euler().setFromQuaternion(this.additionalQuaternion);
|
|
487
|
+
}
|
|
488
|
+
// /**
|
|
489
|
+
// * @ignore
|
|
490
|
+
// * @param view
|
|
491
|
+
// * @returns
|
|
492
|
+
// */
|
|
493
|
+
// public renderingViewChanged(view: View): void {
|
|
494
|
+
// if (!view.camera) return;
|
|
495
|
+
// super.renderingViewChanged(view);
|
|
496
|
+
// this.tilePlanes.forEach((tilePlane) => {
|
|
497
|
+
// tilePlane.renderingViewChanged(view);
|
|
498
|
+
// });
|
|
499
|
+
// }
|
|
500
|
+
/**
|
|
501
|
+
* 获取盒子
|
|
502
|
+
* @ignore
|
|
503
|
+
* @returns
|
|
504
|
+
*/
|
|
505
|
+
getBox() {
|
|
506
|
+
return { size: 2, matrix: this.matrix };
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
export { TilePanorama };
|