@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,65 @@
|
|
|
1
|
+
import { NS_THREE } from '../stage/externals';
|
|
2
|
+
import { Element, ElementFrameContext } from './element';
|
|
3
|
+
declare class BottomNavElement extends Element {
|
|
4
|
+
torus: NS_THREE.Mesh;
|
|
5
|
+
centerArrowMesh: NS_THREE.Mesh;
|
|
6
|
+
textMeshMap: Map<string, {
|
|
7
|
+
mesh: NS_THREE.Mesh;
|
|
8
|
+
textWidth: number;
|
|
9
|
+
spacing: number;
|
|
10
|
+
spacingLeft: number;
|
|
11
|
+
}>;
|
|
12
|
+
private leftMeshGroup;
|
|
13
|
+
private centerMeshGroup;
|
|
14
|
+
private rightMeshGroup;
|
|
15
|
+
private textMeshGroup;
|
|
16
|
+
private textValuePre;
|
|
17
|
+
private enabled;
|
|
18
|
+
private initialized;
|
|
19
|
+
private needUpdate;
|
|
20
|
+
private viewWidth;
|
|
21
|
+
private viewHeight;
|
|
22
|
+
private bottomWidth;
|
|
23
|
+
private bottomRadius;
|
|
24
|
+
private directionPre;
|
|
25
|
+
private r;
|
|
26
|
+
private h;
|
|
27
|
+
private isStop;
|
|
28
|
+
private angle;
|
|
29
|
+
private text;
|
|
30
|
+
private direction;
|
|
31
|
+
private maxLeftAngle;
|
|
32
|
+
private maxRightAngle;
|
|
33
|
+
constructor(option: {
|
|
34
|
+
centerArrowMesh: NS_THREE.Mesh;
|
|
35
|
+
textMeshMap?: Map<string, {
|
|
36
|
+
mesh: NS_THREE.Mesh;
|
|
37
|
+
textWidth: number;
|
|
38
|
+
spacing: number;
|
|
39
|
+
spacingLeft: number;
|
|
40
|
+
}>;
|
|
41
|
+
maxLeftAngle?: number;
|
|
42
|
+
maxRightAngle?: number;
|
|
43
|
+
bottomWidth: number;
|
|
44
|
+
bottomRadius: number;
|
|
45
|
+
});
|
|
46
|
+
private createBottomNav;
|
|
47
|
+
updateText(angle: number, value: string | number): void;
|
|
48
|
+
private renderText;
|
|
49
|
+
setDirection(direction: string): void;
|
|
50
|
+
setAngle(angle: number): void;
|
|
51
|
+
setText(text: string): void;
|
|
52
|
+
setRing(angle: number, text: string, direction?: string): void;
|
|
53
|
+
setToursPosition(x: number, y: number, z: number): void;
|
|
54
|
+
setOpacity(opacity: number): void;
|
|
55
|
+
/**
|
|
56
|
+
* 设置是否更新
|
|
57
|
+
* @param value 开关值
|
|
58
|
+
*/
|
|
59
|
+
setEnabled(value: boolean): void;
|
|
60
|
+
play(): void;
|
|
61
|
+
resize(width: number, height: number): void;
|
|
62
|
+
update(): ElementFrameContext;
|
|
63
|
+
dispose(): void;
|
|
64
|
+
}
|
|
65
|
+
export { BottomNavElement };
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import { NS_THREE } from '../stage/externals';
|
|
2
|
+
import { Element, ElementFrameContext } from './element';
|
|
3
|
+
class BottomNavElement extends Element {
|
|
4
|
+
constructor(option) {
|
|
5
|
+
super();
|
|
6
|
+
const { centerArrowMesh,
|
|
7
|
+
// textArrowMesh,
|
|
8
|
+
textMeshMap, maxLeftAngle, maxRightAngle, bottomWidth, bottomRadius, } = option;
|
|
9
|
+
// this.textArrowMesh = textArrowMesh!;
|
|
10
|
+
// this.textArrowMesh.visible = false;
|
|
11
|
+
// this.torus.add(this.textArrowMesh);
|
|
12
|
+
this.enabled = true;
|
|
13
|
+
this.bottomWidth = bottomWidth;
|
|
14
|
+
this.bottomRadius = bottomRadius;
|
|
15
|
+
this.textMeshMap = textMeshMap;
|
|
16
|
+
this.textValuePre = 0;
|
|
17
|
+
this.maxLeftAngle = maxLeftAngle || 0;
|
|
18
|
+
this.maxRightAngle = maxRightAngle || 0;
|
|
19
|
+
this.centerArrowMesh = centerArrowMesh.clone();
|
|
20
|
+
this.createBottomNav();
|
|
21
|
+
this.setRing(0, '定位中', 'center');
|
|
22
|
+
this.initialized = false;
|
|
23
|
+
this.needUpdate = true;
|
|
24
|
+
this.directionPre = 'center';
|
|
25
|
+
}
|
|
26
|
+
;
|
|
27
|
+
;
|
|
28
|
+
createBottomNav() {
|
|
29
|
+
const material = new NS_THREE.MeshBasicMaterial({
|
|
30
|
+
color: 0xffffff,
|
|
31
|
+
wireframe: false,
|
|
32
|
+
transparent: true,
|
|
33
|
+
blending: NS_THREE.CustomBlending,
|
|
34
|
+
blendSrc: NS_THREE.OneFactor,
|
|
35
|
+
});
|
|
36
|
+
material.needsUpdate = true;
|
|
37
|
+
material.visible = true;
|
|
38
|
+
material.opacity = 1;
|
|
39
|
+
const h = this.bottomWidth;
|
|
40
|
+
const r = this.bottomRadius;
|
|
41
|
+
const count = 128;
|
|
42
|
+
const points = [];
|
|
43
|
+
for (let i = 0; i < count; i++) {
|
|
44
|
+
const x = r * Math.sin(Math.PI * 2 * i / count);
|
|
45
|
+
const y = r * Math.cos(Math.PI * 2 * i / count);
|
|
46
|
+
if (i > count / 2) {
|
|
47
|
+
points.push(new NS_THREE.Vector2(x - h / 2, y));
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
points.push(new NS_THREE.Vector2(x + h / 2, y));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
const heartShape = new NS_THREE.Shape(points);
|
|
54
|
+
const geometry = new NS_THREE.ShapeGeometry(heartShape);
|
|
55
|
+
this.torus = new NS_THREE.Mesh(geometry, material);
|
|
56
|
+
this.torus.position.set(0, 0, 1);
|
|
57
|
+
this.torus.lookAt(0, 0, 1);
|
|
58
|
+
this.add(this.torus);
|
|
59
|
+
}
|
|
60
|
+
// 控制圆盘的偏移以及文字显示
|
|
61
|
+
updateText(angle, value) {
|
|
62
|
+
if (this.leftMeshGroup)
|
|
63
|
+
this.leftMeshGroup.visible = false;
|
|
64
|
+
// if (this.centerMeshGroup) this.centerMeshGroup.visible = false;
|
|
65
|
+
if (this.rightMeshGroup)
|
|
66
|
+
this.rightMeshGroup.visible = false;
|
|
67
|
+
// if (this.textArrowMesh) this.textArrowMesh.visible = false;
|
|
68
|
+
// 分别处理左、右、中
|
|
69
|
+
const valueText = [];
|
|
70
|
+
valueText.push(...value.toString());
|
|
71
|
+
// 判断是否更新文字
|
|
72
|
+
let textUpdate = false;
|
|
73
|
+
if (this.textValuePre !== value) {
|
|
74
|
+
textUpdate = true;
|
|
75
|
+
}
|
|
76
|
+
if (this.directionPre !== this.direction) {
|
|
77
|
+
textUpdate = true;
|
|
78
|
+
}
|
|
79
|
+
this.textValuePre = value;
|
|
80
|
+
this.directionPre = this.direction;
|
|
81
|
+
if (this.direction === 'left') {
|
|
82
|
+
// debugger;
|
|
83
|
+
// 定位在左侧
|
|
84
|
+
if (textUpdate) {
|
|
85
|
+
if (this.textMeshGroup)
|
|
86
|
+
this.torus.remove(this.textMeshGroup);
|
|
87
|
+
this.textMeshGroup = this.renderText(valueText, 0);
|
|
88
|
+
this.textMeshGroup.position.set(-this.textMeshGroup.groupOffsetAngle / 2, 0, 0);
|
|
89
|
+
this.torus.add(this.textMeshGroup);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
else if (this.direction === 'right') {
|
|
93
|
+
// debugger;
|
|
94
|
+
// // 定位在右侧
|
|
95
|
+
if (textUpdate) {
|
|
96
|
+
if (this.textMeshGroup)
|
|
97
|
+
this.torus.remove(this.textMeshGroup);
|
|
98
|
+
this.textMeshGroup = this.renderText(valueText, 0);
|
|
99
|
+
this.textMeshGroup.position.set(-this.textMeshGroup.groupOffsetAngle / 2, 0, 0);
|
|
100
|
+
this.torus.add(this.textMeshGroup);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
else if (this.direction === 'center') {
|
|
104
|
+
// debugger;
|
|
105
|
+
if (!this.centerMeshGroup) {
|
|
106
|
+
// 文字
|
|
107
|
+
this.centerMeshGroup = this.centerArrowMesh;
|
|
108
|
+
this.centerMeshGroup.position.set(0, this.bottomRadius + 11, 3);
|
|
109
|
+
this.torus.add(this.centerMeshGroup);
|
|
110
|
+
// 对正
|
|
111
|
+
// this.centerMeshGroup.rotateZ(this.centerMeshGroup.groupOffsetAngle / 2);
|
|
112
|
+
}
|
|
113
|
+
this.centerMeshGroup.visible = true;
|
|
114
|
+
if (textUpdate) {
|
|
115
|
+
if (this.textMeshGroup)
|
|
116
|
+
this.torus.remove(this.textMeshGroup);
|
|
117
|
+
this.textMeshGroup = this.renderText(valueText, 0);
|
|
118
|
+
this.textMeshGroup.position.set(-this.textMeshGroup.groupOffsetAngle / 2, 0, 0);
|
|
119
|
+
this.torus.add(this.textMeshGroup);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
else if (this.direction === 'stop') {
|
|
123
|
+
if (textUpdate) {
|
|
124
|
+
if (this.textMeshGroup)
|
|
125
|
+
this.torus.remove(this.textMeshGroup);
|
|
126
|
+
this.textMeshGroup = this.renderText(valueText, 0);
|
|
127
|
+
this.textMeshGroup.position.set(-this.textMeshGroup.groupOffsetAngle / 2, 0, 0);
|
|
128
|
+
this.torus.add(this.textMeshGroup);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
// 绘制文字
|
|
133
|
+
renderText(values, angle = 0, reverse = false) {
|
|
134
|
+
const textList = reverse ? values.reverse() : values;
|
|
135
|
+
// 弧度累计
|
|
136
|
+
let groupOffsetAngle = 0;
|
|
137
|
+
if (reverse) {
|
|
138
|
+
groupOffsetAngle = -angle;
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
groupOffsetAngle = angle;
|
|
142
|
+
}
|
|
143
|
+
// debugger;
|
|
144
|
+
const textMeshGroup = new NS_THREE.Group();
|
|
145
|
+
let firstAngle = 0;
|
|
146
|
+
let lastAngle = 0;
|
|
147
|
+
textList.forEach((item, index) => {
|
|
148
|
+
const textMeshData = this.textMeshMap.get(item);
|
|
149
|
+
if (!textMeshData)
|
|
150
|
+
return;
|
|
151
|
+
const textMesh = textMeshData.mesh.clone();
|
|
152
|
+
// textMesh.material.visible = true;
|
|
153
|
+
// 文字自身宽度
|
|
154
|
+
const radian = textMeshData.textWidth;
|
|
155
|
+
if (index === 0)
|
|
156
|
+
firstAngle = radian;
|
|
157
|
+
if (index === textList.length - 1)
|
|
158
|
+
lastAngle = radian;
|
|
159
|
+
groupOffsetAngle += radian / 2;
|
|
160
|
+
// 左间距
|
|
161
|
+
if (textMeshData.spacingLeft) {
|
|
162
|
+
const rad = textMeshData.spacingLeft / 2;
|
|
163
|
+
groupOffsetAngle += rad;
|
|
164
|
+
}
|
|
165
|
+
// 定位
|
|
166
|
+
textMesh.position.set(groupOffsetAngle, 0, 15);
|
|
167
|
+
// 横向偏移量累加
|
|
168
|
+
if (reverse) {
|
|
169
|
+
groupOffsetAngle -= radian / 2;
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
groupOffsetAngle += radian / 2;
|
|
173
|
+
}
|
|
174
|
+
// 右间距
|
|
175
|
+
if (textMeshData.spacing) {
|
|
176
|
+
const rad = textMeshData.spacing;
|
|
177
|
+
if (reverse) {
|
|
178
|
+
groupOffsetAngle -= rad;
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
groupOffsetAngle += rad;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
textMeshGroup.add(textMesh);
|
|
185
|
+
});
|
|
186
|
+
// 文字整体弧度
|
|
187
|
+
textMeshGroup.groupOffsetAngle = Math.abs(groupOffsetAngle);
|
|
188
|
+
textMeshGroup.lastAngle = lastAngle;
|
|
189
|
+
textMeshGroup.firstAngle = firstAngle;
|
|
190
|
+
return textMeshGroup;
|
|
191
|
+
}
|
|
192
|
+
setDirection(direction) {
|
|
193
|
+
this.direction = direction;
|
|
194
|
+
}
|
|
195
|
+
setAngle(angle) {
|
|
196
|
+
this.angle = angle;
|
|
197
|
+
}
|
|
198
|
+
setText(text) {
|
|
199
|
+
this.text = text;
|
|
200
|
+
}
|
|
201
|
+
setRing(angle, text, direction = 'center') {
|
|
202
|
+
this.setAngle(angle);
|
|
203
|
+
this.setText(text);
|
|
204
|
+
this.setDirection(direction);
|
|
205
|
+
}
|
|
206
|
+
setToursPosition(x, y, z) {
|
|
207
|
+
this.torus.position.set(x, y, z);
|
|
208
|
+
}
|
|
209
|
+
setOpacity(opacity) {
|
|
210
|
+
this.torus.traverse((o) => {
|
|
211
|
+
const mesh = o;
|
|
212
|
+
if (mesh.isMesh && !Array.isArray(mesh.material)) {
|
|
213
|
+
mesh.material.blending = NS_THREE.CustomBlending;
|
|
214
|
+
mesh.material.blendSrc = NS_THREE.SrcAlphaFactor;
|
|
215
|
+
mesh.material.transparent = true;
|
|
216
|
+
mesh.material.opacity = opacity;
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* 设置是否更新
|
|
222
|
+
* @param value 开关值
|
|
223
|
+
*/
|
|
224
|
+
setEnabled(value) {
|
|
225
|
+
this.enabled = value;
|
|
226
|
+
}
|
|
227
|
+
play() {
|
|
228
|
+
this.isStop = false;
|
|
229
|
+
}
|
|
230
|
+
/*
|
|
231
|
+
暂停时隐藏箭头,角度锁定为0
|
|
232
|
+
*/
|
|
233
|
+
resize(width, height) {
|
|
234
|
+
if (this.viewWidth === width && this.viewHeight === height)
|
|
235
|
+
return;
|
|
236
|
+
this.viewWidth = width;
|
|
237
|
+
this.viewHeight = height;
|
|
238
|
+
}
|
|
239
|
+
update() {
|
|
240
|
+
const frameContext = new ElementFrameContext(this);
|
|
241
|
+
frameContext.needUpdate = this.needUpdate;
|
|
242
|
+
// 添加圆盘
|
|
243
|
+
if (!this.initialized && this.torus) {
|
|
244
|
+
frameContext.shouldPlaceElement = true;
|
|
245
|
+
this.initialized = true;
|
|
246
|
+
}
|
|
247
|
+
if (this.enabled) {
|
|
248
|
+
this.updateText(-this.angle, this.text);
|
|
249
|
+
}
|
|
250
|
+
return frameContext;
|
|
251
|
+
}
|
|
252
|
+
dispose() {
|
|
253
|
+
this.torus.remove();
|
|
254
|
+
this.textMeshMap.clear();
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
export { BottomNavElement };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { NS_THREE } from '../stage/externals';
|
|
2
|
+
import { Element, ElementFrameContext } from './element';
|
|
3
|
+
/**
|
|
4
|
+
* 相机内参
|
|
5
|
+
*/
|
|
6
|
+
interface CameraIntrinsic {
|
|
7
|
+
/** Field Of View */
|
|
8
|
+
fov: NS_THREE.Vector2;
|
|
9
|
+
/** 分辨率 */
|
|
10
|
+
resolution: NS_THREE.Vector2;
|
|
11
|
+
/** 焦距 */
|
|
12
|
+
f: NS_THREE.Vector2;
|
|
13
|
+
/** 中心偏移 */
|
|
14
|
+
c: NS_THREE.Vector2;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 相机元素
|
|
18
|
+
* @noInheritDoc
|
|
19
|
+
*/
|
|
20
|
+
declare class Camera extends Element {
|
|
21
|
+
private initialized;
|
|
22
|
+
private camera;
|
|
23
|
+
private yaw;
|
|
24
|
+
private pitch;
|
|
25
|
+
private lookAtPoint;
|
|
26
|
+
intrinsic: CameraIntrinsic;
|
|
27
|
+
private helpers;
|
|
28
|
+
private cameraHelper;
|
|
29
|
+
private updateLookAtThisFrame;
|
|
30
|
+
private eventListeners;
|
|
31
|
+
private visibleScope;
|
|
32
|
+
/** 可碰撞元素 */
|
|
33
|
+
intersectables: NS_THREE.Object3D[];
|
|
34
|
+
readonly isCamera: true;
|
|
35
|
+
constructor(yaw?: number, pitch?: number, visibleScope?: number);
|
|
36
|
+
load(yaw?: number, pitch?: number, visibleScope?: number): void;
|
|
37
|
+
dispose(): void;
|
|
38
|
+
private updatePitchYawFromLookVector;
|
|
39
|
+
private onRotationChange;
|
|
40
|
+
private onQuaternionChange;
|
|
41
|
+
/** @ignore */
|
|
42
|
+
update(): ElementFrameContext;
|
|
43
|
+
/** @ignore */
|
|
44
|
+
getThreeCamera(): NS_THREE.PerspectiveCamera;
|
|
45
|
+
/**
|
|
46
|
+
* 获取相机内参
|
|
47
|
+
* @returns 相机内参
|
|
48
|
+
*/
|
|
49
|
+
getIntrinsic(): CameraIntrinsic;
|
|
50
|
+
/** 获取偏航角 */
|
|
51
|
+
getYaw(): number;
|
|
52
|
+
/** 获取俯仰角 */
|
|
53
|
+
getPitch(): number;
|
|
54
|
+
/** 获取相机Field Of View */
|
|
55
|
+
getFov(): number;
|
|
56
|
+
/** 获取相机图像比例 */
|
|
57
|
+
getAspect(): number;
|
|
58
|
+
/** 获取相机姿态四元数 */
|
|
59
|
+
getQuaternion(): NS_THREE.Quaternion;
|
|
60
|
+
/**
|
|
61
|
+
* 设定偏航角
|
|
62
|
+
* @param yaw 偏航角
|
|
63
|
+
*/
|
|
64
|
+
setYaw(yaw: number): void;
|
|
65
|
+
/**
|
|
66
|
+
* 设定俯仰角
|
|
67
|
+
* @param pitch 俯仰角
|
|
68
|
+
*/
|
|
69
|
+
setPitch(pitch: number): void;
|
|
70
|
+
/** @ignore */
|
|
71
|
+
setCameraHelperVisible(value: boolean, render?: boolean): void;
|
|
72
|
+
/** @ignore */
|
|
73
|
+
lookAt(vector: number | NS_THREE.Vector3, y?: number, z?: number, updatePitchYaw?: boolean): void;
|
|
74
|
+
/** @ignore */
|
|
75
|
+
updateLookAt(): void;
|
|
76
|
+
get quaternion(): NS_THREE.Quaternion;
|
|
77
|
+
getViewingFrustumMesh(): {
|
|
78
|
+
vertices: NS_THREE.Vector3[];
|
|
79
|
+
triangles: number[];
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
export { Camera, CameraIntrinsic };
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
import { Externals, NS_THREE } from '../stage/externals';
|
|
2
|
+
import { Element, ElementFrameContext } from './element';
|
|
3
|
+
import { Camera as CameraUtils } from '../utils/camera';
|
|
4
|
+
import { EventHub } from '../utils/event-hub';
|
|
5
|
+
import { BasicTools } from '../utils/basic-tools';
|
|
6
|
+
import { OwllyEvents } from '../utils/events';
|
|
7
|
+
import { GeometryUtils } from '../utils/geometry-utils';
|
|
8
|
+
/**
|
|
9
|
+
* @ignore
|
|
10
|
+
*/
|
|
11
|
+
class CameraPosition extends NS_THREE.Vector3 {
|
|
12
|
+
constructor(x, y, z, callback) {
|
|
13
|
+
super(x, y, z);
|
|
14
|
+
if (callback)
|
|
15
|
+
this.callback = callback;
|
|
16
|
+
}
|
|
17
|
+
set(x, y, z) {
|
|
18
|
+
super.set(x, y, z);
|
|
19
|
+
if (this.callback)
|
|
20
|
+
this.callback();
|
|
21
|
+
return this;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/** @ignore */
|
|
25
|
+
class CameraHelper extends NS_THREE.CameraHelper {
|
|
26
|
+
constructor(camera) {
|
|
27
|
+
super(camera);
|
|
28
|
+
const { THREE } = Externals.getInstance();
|
|
29
|
+
const elements = camera.matrixWorld.elements.slice();
|
|
30
|
+
elements[12] = 0;
|
|
31
|
+
elements[13] = 0;
|
|
32
|
+
elements[14] = 0;
|
|
33
|
+
this.matrix = new THREE.Matrix4().fromArray(elements);
|
|
34
|
+
}
|
|
35
|
+
update() {
|
|
36
|
+
const elements = this.camera.matrixWorld.elements.slice();
|
|
37
|
+
elements[12] = 0;
|
|
38
|
+
elements[13] = 0;
|
|
39
|
+
elements[14] = 0;
|
|
40
|
+
this.matrix.fromArray(elements);
|
|
41
|
+
super.update();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* 相机元素
|
|
46
|
+
* @noInheritDoc
|
|
47
|
+
*/
|
|
48
|
+
class Camera extends Element {
|
|
49
|
+
constructor(yaw = 0, pitch = -10, visibleScope = 20) {
|
|
50
|
+
super();
|
|
51
|
+
const { THREE } = Externals.getInstance();
|
|
52
|
+
this.initialized = false;
|
|
53
|
+
this.camera = new THREE.PerspectiveCamera();
|
|
54
|
+
this.lookAtPoint = new THREE.Vector3();
|
|
55
|
+
this.helpers = new THREE.Group();
|
|
56
|
+
// TODO(jyfang): make intrinsic dynamic
|
|
57
|
+
this.intrinsic = {
|
|
58
|
+
resolution: new THREE.Vector2(2560, 1440),
|
|
59
|
+
fov: new THREE.Vector2(48.1, 28.2),
|
|
60
|
+
f: new THREE.Vector2(2782.6289319729026, 2775.8932388798476),
|
|
61
|
+
c: new THREE.Vector2(1300.2770029742769, 729.80388257009895),
|
|
62
|
+
};
|
|
63
|
+
this.intersectables = [];
|
|
64
|
+
this.renderOrder = 250;
|
|
65
|
+
this.load(yaw, pitch, visibleScope);
|
|
66
|
+
// Override position, rotation, quaternion settings
|
|
67
|
+
Object.defineProperty(this, 'position', {
|
|
68
|
+
value: new CameraPosition(this.position.x, this.position.y, this.position.z, () => { this.updateLookAtThisFrame = true; }),
|
|
69
|
+
enumerable: true,
|
|
70
|
+
configurable: true,
|
|
71
|
+
});
|
|
72
|
+
/* eslint-disable no-underscore-dangle */
|
|
73
|
+
this.rotation._onChange(() => { this.onRotationChange(); });
|
|
74
|
+
this.quaternion._onChange(() => { this.onQuaternionChange(); });
|
|
75
|
+
/* eslint-enable no-underscore-dangle */
|
|
76
|
+
this.eventListeners = {
|
|
77
|
+
onCameraSelected: (camera) => {
|
|
78
|
+
this.cameraHelper.visible = camera === this;
|
|
79
|
+
this.updateLookAtThisFrame = true;
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
EventHub.on(OwllyEvents.ELEMENT_SELECTED, this.eventListeners.onCameraSelected);
|
|
83
|
+
}
|
|
84
|
+
load(yaw = 0, pitch = -10, visibleScope = 20) {
|
|
85
|
+
this.yaw = yaw;
|
|
86
|
+
this.pitch = pitch;
|
|
87
|
+
this.visibleScope = visibleScope;
|
|
88
|
+
this.camera.fov = this.intrinsic.fov.y;
|
|
89
|
+
this.camera.aspect = this.intrinsic.fov.x / this.intrinsic.fov.y;
|
|
90
|
+
this.camera.near = 0.1;
|
|
91
|
+
this.camera.far = 200;
|
|
92
|
+
this.camera.up.set(0, 0, 1);
|
|
93
|
+
this.up.set(0, 0, 1);
|
|
94
|
+
if (this.helpers) {
|
|
95
|
+
const { children } = this.helpers;
|
|
96
|
+
this.helpers.remove(...children);
|
|
97
|
+
children.forEach((c) => { BasicTools.dispose(c, true); });
|
|
98
|
+
this.intersectables = [];
|
|
99
|
+
}
|
|
100
|
+
const { THREE } = Externals.getInstance();
|
|
101
|
+
this.cameraHelper = new CameraHelper(this.camera);
|
|
102
|
+
const cameraCube = new THREE.Mesh(new THREE.BoxGeometry(0.2, 0.2, 0.2), new THREE.MeshLambertMaterial({
|
|
103
|
+
color: 0x0000ff,
|
|
104
|
+
emissive: 0x072534,
|
|
105
|
+
depthWrite: true,
|
|
106
|
+
depthTest: true,
|
|
107
|
+
}));
|
|
108
|
+
this.helpers.add(cameraCube);
|
|
109
|
+
this.add(this.camera);
|
|
110
|
+
this.add(this.helpers);
|
|
111
|
+
this.add(this.cameraHelper);
|
|
112
|
+
this.camera.renderOrder = 250;
|
|
113
|
+
this.helpers.renderOrder = 250;
|
|
114
|
+
this.cameraHelper.renderOrder = 250;
|
|
115
|
+
this.camera.far = this.visibleScope;
|
|
116
|
+
this.camera.updateProjectionMatrix();
|
|
117
|
+
this.cameraHelper.update();
|
|
118
|
+
this.camera.far = 200;
|
|
119
|
+
this.camera.updateProjectionMatrix();
|
|
120
|
+
this.cameraHelper.visible = false;
|
|
121
|
+
this.intersectables.push(cameraCube);
|
|
122
|
+
this.initialized = true;
|
|
123
|
+
this.updateLookAtThisFrame = true;
|
|
124
|
+
}
|
|
125
|
+
dispose() {
|
|
126
|
+
super.dispose();
|
|
127
|
+
this.remove(this.camera);
|
|
128
|
+
this.remove(this.helpers);
|
|
129
|
+
this.remove(this.cameraHelper);
|
|
130
|
+
BasicTools.dispose(this.helpers, true);
|
|
131
|
+
BasicTools.dispose(this.cameraHelper, true);
|
|
132
|
+
EventHub.off(OwllyEvents.ELEMENT_SELECTED, this.eventListeners.onCameraSelected);
|
|
133
|
+
}
|
|
134
|
+
updatePitchYawFromLookVector(v) {
|
|
135
|
+
const { yaw, pitch } = CameraUtils.getYawPitchFromCameraLookVector(v);
|
|
136
|
+
this.pitch = pitch;
|
|
137
|
+
this.yaw = yaw;
|
|
138
|
+
}
|
|
139
|
+
onRotationChange() {
|
|
140
|
+
const rotation = this.rotation.clone();
|
|
141
|
+
const { THREE } = Externals.getInstance();
|
|
142
|
+
this.rotation
|
|
143
|
+
.setFromQuaternion(new THREE.Quaternion(0, 0, 0, 1), undefined, false);
|
|
144
|
+
this.camera.rotation.copy(rotation);
|
|
145
|
+
this.helpers.rotation.copy(rotation);
|
|
146
|
+
this.camera.updateProjectionMatrix();
|
|
147
|
+
const lookAtVector = this.camera.getWorldDirection(new THREE.Vector3(0, 0, -1));
|
|
148
|
+
this.updatePitchYawFromLookVector(lookAtVector);
|
|
149
|
+
this.updateLookAtThisFrame = true;
|
|
150
|
+
}
|
|
151
|
+
onQuaternionChange() {
|
|
152
|
+
const quaternion = this.quaternion.clone();
|
|
153
|
+
const { THREE } = Externals.getInstance();
|
|
154
|
+
this.quaternion
|
|
155
|
+
.setFromEuler(new THREE.Euler(0, 0, 0), false);
|
|
156
|
+
this.camera.quaternion.copy(quaternion);
|
|
157
|
+
this.helpers.quaternion.copy(quaternion);
|
|
158
|
+
this.camera.updateProjectionMatrix();
|
|
159
|
+
const lookAtVector = this.camera.getWorldDirection(new THREE.Vector3(0, 0, -1));
|
|
160
|
+
this.updatePitchYawFromLookVector(lookAtVector);
|
|
161
|
+
this.updateLookAtThisFrame = true;
|
|
162
|
+
}
|
|
163
|
+
/** @ignore */
|
|
164
|
+
update() {
|
|
165
|
+
const frameContext = new ElementFrameContext(this);
|
|
166
|
+
if (this.initialized && !this.parent) {
|
|
167
|
+
frameContext.shouldPlaceElement = true;
|
|
168
|
+
frameContext.needUpdate = true;
|
|
169
|
+
}
|
|
170
|
+
if (this.updateLookAtThisFrame) {
|
|
171
|
+
this.lookAtPoint = CameraUtils.getCameraLookAtPositionByYawPitch(this.position.clone(), this.yaw, this.pitch).position;
|
|
172
|
+
this.lookAt(this.lookAtPoint, 0, 0, false);
|
|
173
|
+
frameContext.needUpdate = true;
|
|
174
|
+
this.updateLookAtThisFrame = false;
|
|
175
|
+
}
|
|
176
|
+
return frameContext;
|
|
177
|
+
}
|
|
178
|
+
/** @ignore */
|
|
179
|
+
getThreeCamera() {
|
|
180
|
+
return this.camera;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* 获取相机内参
|
|
184
|
+
* @returns 相机内参
|
|
185
|
+
*/
|
|
186
|
+
getIntrinsic() {
|
|
187
|
+
return this.intrinsic;
|
|
188
|
+
}
|
|
189
|
+
/** 获取偏航角 */
|
|
190
|
+
getYaw() {
|
|
191
|
+
return this.yaw;
|
|
192
|
+
}
|
|
193
|
+
/** 获取俯仰角 */
|
|
194
|
+
getPitch() {
|
|
195
|
+
return this.pitch;
|
|
196
|
+
}
|
|
197
|
+
/** 获取相机Field Of View */
|
|
198
|
+
getFov() {
|
|
199
|
+
return this.camera.fov;
|
|
200
|
+
}
|
|
201
|
+
/** 获取相机图像比例 */
|
|
202
|
+
getAspect() {
|
|
203
|
+
return this.camera.aspect;
|
|
204
|
+
}
|
|
205
|
+
/** 获取相机姿态四元数 */
|
|
206
|
+
getQuaternion() {
|
|
207
|
+
return this.camera.quaternion.clone();
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* 设定偏航角
|
|
211
|
+
* @param yaw 偏航角
|
|
212
|
+
*/
|
|
213
|
+
setYaw(yaw) {
|
|
214
|
+
this.yaw = yaw;
|
|
215
|
+
this.updateLookAtThisFrame = true;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* 设定俯仰角
|
|
219
|
+
* @param pitch 俯仰角
|
|
220
|
+
*/
|
|
221
|
+
setPitch(pitch) {
|
|
222
|
+
this.pitch = pitch;
|
|
223
|
+
this.updateLookAtThisFrame = true;
|
|
224
|
+
}
|
|
225
|
+
/** @ignore */
|
|
226
|
+
setCameraHelperVisible(value, render) {
|
|
227
|
+
this.cameraHelper.visible = value;
|
|
228
|
+
this.updateLookAtThisFrame = !!render;
|
|
229
|
+
}
|
|
230
|
+
/** @ignore */
|
|
231
|
+
lookAt(vector, y, z, updatePitchYaw = true) {
|
|
232
|
+
const { THREE } = Externals.getInstance();
|
|
233
|
+
if (updatePitchYaw) {
|
|
234
|
+
let v;
|
|
235
|
+
if (vector instanceof THREE.Vector3) {
|
|
236
|
+
v = this.position.clone().add(vector.clone().multiplyScalar(-1)).normalize();
|
|
237
|
+
}
|
|
238
|
+
else {
|
|
239
|
+
v = this.position.clone().add(new THREE.Vector3(vector, y, z).multiplyScalar(-1)).normalize();
|
|
240
|
+
}
|
|
241
|
+
this.updatePitchYawFromLookVector(v);
|
|
242
|
+
}
|
|
243
|
+
this.helpers.lookAt(vector, y, z);
|
|
244
|
+
this.camera.lookAt(vector, y, z);
|
|
245
|
+
this.camera.updateProjectionMatrix();
|
|
246
|
+
if (this.cameraHelper) {
|
|
247
|
+
this.camera.far = this.visibleScope;
|
|
248
|
+
this.camera.updateProjectionMatrix();
|
|
249
|
+
this.cameraHelper.update();
|
|
250
|
+
this.camera.far = 200;
|
|
251
|
+
this.camera.updateProjectionMatrix();
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
/** @ignore */
|
|
255
|
+
updateLookAt() {
|
|
256
|
+
this.updateLookAtThisFrame = true;
|
|
257
|
+
}
|
|
258
|
+
get quaternion() {
|
|
259
|
+
return this.camera.quaternion.clone();
|
|
260
|
+
}
|
|
261
|
+
getViewingFrustumMesh() {
|
|
262
|
+
this.updateLookAt();
|
|
263
|
+
this.update();
|
|
264
|
+
this.camera.far = this.visibleScope;
|
|
265
|
+
this.camera.updateProjectionMatrix();
|
|
266
|
+
this.cameraHelper.update();
|
|
267
|
+
const cam = this.camera;
|
|
268
|
+
const eye = this.position.clone();
|
|
269
|
+
const { THREE } = Externals.getInstance();
|
|
270
|
+
const target = new THREE.Vector3(0, 0, -1).multiplyScalar(this.visibleScope)
|
|
271
|
+
.applyMatrix4(cam.matrixWorld);
|
|
272
|
+
const up = new THREE.Vector3(0, 0, 1);
|
|
273
|
+
const fovYDegrees = cam.fov;
|
|
274
|
+
const aspectRatio = cam.aspect;
|
|
275
|
+
const { near, far } = cam;
|
|
276
|
+
// console.info(`## eye, target, fovY=${fovYDegrees}, aspect=${aspectRatio}, near=${near}, far=${far}`, eye, target);
|
|
277
|
+
const frustumMesh = GeometryUtils.FrustumMesh(eye, target, up, fovYDegrees, aspectRatio, near, far);
|
|
278
|
+
this.camera.far = 200;
|
|
279
|
+
this.camera.updateProjectionMatrix();
|
|
280
|
+
return frustumMesh;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
export { Camera };
|