@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,168 @@
|
|
|
1
|
+
import TWEEN from '@tweenjs/tween.js';
|
|
2
|
+
// #if WEB_ONLY
|
|
3
|
+
// import Stats from 'stats.js';
|
|
4
|
+
// #endif
|
|
5
|
+
import { TimeProfiler } from '../utils/time-profiler';
|
|
6
|
+
// #if WEB_ONLY
|
|
7
|
+
import { Owlly2D } from '../owlly-2d';
|
|
8
|
+
// #endif
|
|
9
|
+
import { EventHub } from '../utils/event-hub';
|
|
10
|
+
import { Events } from '../utils/events';
|
|
11
|
+
import { EnvironmentUtils, Env } from '../utils/environment-utils';
|
|
12
|
+
let frameTime;
|
|
13
|
+
let timeSaver;
|
|
14
|
+
let now;
|
|
15
|
+
class Owlly {
|
|
16
|
+
constructor() {
|
|
17
|
+
this.stages = new Set();
|
|
18
|
+
this.screens = new Set();
|
|
19
|
+
this.controllers = new Set();
|
|
20
|
+
this.timeProfiler = new TimeProfiler();
|
|
21
|
+
this.selfManageTick = true;
|
|
22
|
+
// #if WEB_ONLY
|
|
23
|
+
// if (EnvironmentUtils.GetEnv() === Env.Web) {
|
|
24
|
+
// this.stats = new Stats();
|
|
25
|
+
// this.stats.showPanel(0);
|
|
26
|
+
// this.stats.dom.style.setProperty('display', 'none');
|
|
27
|
+
// this.statsEnabled = false;
|
|
28
|
+
// if (document) document.body.appendChild(this.stats.dom);
|
|
29
|
+
// }
|
|
30
|
+
// #endif
|
|
31
|
+
this.listeners = {
|
|
32
|
+
windowResizeListener: () => { this.onWindowResize(); },
|
|
33
|
+
windowUnloadListener: () => { this.beforeWindowUnload(); },
|
|
34
|
+
onTick: this.tick.bind(this),
|
|
35
|
+
};
|
|
36
|
+
this.registerEvents();
|
|
37
|
+
if (EnvironmentUtils.GetEnv() === Env.Web && requestAnimationFrame) {
|
|
38
|
+
this.setRequestAnimationFrameFunction(requestAnimationFrame);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
static GetSharedInstance() {
|
|
42
|
+
if (!this.SHARED_INSTANCE)
|
|
43
|
+
this.SHARED_INSTANCE = new Owlly();
|
|
44
|
+
return this.SHARED_INSTANCE;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* 时钟函数
|
|
48
|
+
* @param time 距离上一帧的时间, ms
|
|
49
|
+
*/
|
|
50
|
+
tick(time) {
|
|
51
|
+
this.timeProfiler.tick(time);
|
|
52
|
+
// EventHub.emit(Events.FPS_UPDATED, this.timeProfiler.getFPS());
|
|
53
|
+
EventHub.emit(Events.TICK);
|
|
54
|
+
const screenNeedsUpdate = Array.from(this.screens).reduce((tf, screen) => (screen.update() || tf), false);
|
|
55
|
+
const controllersNeedsUpdate = Array.from(this.controllers).reduce((tf, controller) => (controller.update() || tf), false);
|
|
56
|
+
const elementsNeedsUpdate = Array.from(this.stages).reduce((tf, stage) => (stage.tick() || tf), false);
|
|
57
|
+
if (this.forceRender || screenNeedsUpdate || controllersNeedsUpdate || elementsNeedsUpdate) {
|
|
58
|
+
this.screens.forEach((screen) => {
|
|
59
|
+
screen.renderScreen();
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
TWEEN.update();
|
|
63
|
+
// #if WEB_ONLY
|
|
64
|
+
// if (this.statsEnabled) {
|
|
65
|
+
// this.stats.end();
|
|
66
|
+
// this.stats.begin();
|
|
67
|
+
// }
|
|
68
|
+
// #endif
|
|
69
|
+
if (this.selfManageTick)
|
|
70
|
+
Owlly.RequestAnimationFrame(this.listeners.onTick);
|
|
71
|
+
}
|
|
72
|
+
registerEvents() {
|
|
73
|
+
if (EnvironmentUtils.GetEnv() === Env.Web)
|
|
74
|
+
window.addEventListener('resize', this.listeners.windowResizeListener);
|
|
75
|
+
}
|
|
76
|
+
onWindowResize() {
|
|
77
|
+
this.screens.forEach((screen) => {
|
|
78
|
+
screen.resize(window.innerWidth, window.innerHeight);
|
|
79
|
+
});
|
|
80
|
+
this.forceRender = true;
|
|
81
|
+
// #if WEB_ONLY
|
|
82
|
+
if (Owlly2D.initialized)
|
|
83
|
+
Owlly2D.resize();
|
|
84
|
+
// #endif
|
|
85
|
+
}
|
|
86
|
+
beforeWindowUnload() {
|
|
87
|
+
Array.from(this.stages).forEach((s) => {
|
|
88
|
+
s.dispose();
|
|
89
|
+
});
|
|
90
|
+
if (window)
|
|
91
|
+
window.removeEventListener('resize', this.listeners.windowResizeListener);
|
|
92
|
+
// #if WEB_ONLY
|
|
93
|
+
if (Owlly2D.initialized)
|
|
94
|
+
Owlly2D.dispose();
|
|
95
|
+
// if (document) document.body.removeChild(this.stats.dom);
|
|
96
|
+
// #endif
|
|
97
|
+
}
|
|
98
|
+
registerStage(stage) {
|
|
99
|
+
this.stages.add(stage);
|
|
100
|
+
}
|
|
101
|
+
unregisterStage(stage) {
|
|
102
|
+
this.stages.delete(stage);
|
|
103
|
+
}
|
|
104
|
+
registerScreen(screen) {
|
|
105
|
+
this.screens.add(screen);
|
|
106
|
+
}
|
|
107
|
+
unregisterScreen(screen) {
|
|
108
|
+
this.screens.delete(screen);
|
|
109
|
+
}
|
|
110
|
+
registerController(controller) {
|
|
111
|
+
this.controllers.add(controller);
|
|
112
|
+
}
|
|
113
|
+
unregisterController(controller) {
|
|
114
|
+
this.controllers.delete(controller);
|
|
115
|
+
}
|
|
116
|
+
setStatsEnabled(value) {
|
|
117
|
+
if (EnvironmentUtils.GetEnv() !== Env.Web)
|
|
118
|
+
return;
|
|
119
|
+
// #if WEB_ONLY
|
|
120
|
+
this.statsEnabled = value;
|
|
121
|
+
// this.stats.dom.style.setProperty('display', value ? 'block' : 'none');
|
|
122
|
+
// #endif
|
|
123
|
+
}
|
|
124
|
+
setRequestAnimationFrameFunction(requestAnimationFrame) {
|
|
125
|
+
// if (Owlly.RequestAnimationFrame) return;
|
|
126
|
+
Owlly.RequestAnimationFrame = requestAnimationFrame.bind(
|
|
127
|
+
// TODO: 此处小程序可能存在问题
|
|
128
|
+
// eslint-disable-next-line no-nested-ternary
|
|
129
|
+
EnvironmentUtils.GetEnv() === Env.Web
|
|
130
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
131
|
+
? (window.IS_DELEGATE ? window.delegateWindow : window) : this);
|
|
132
|
+
if (this.selfManageTick)
|
|
133
|
+
Owlly.RequestAnimationFrame(this.listeners.onTick);
|
|
134
|
+
}
|
|
135
|
+
toggleTickSelfManagement(value) {
|
|
136
|
+
if (this.selfManageTick === value)
|
|
137
|
+
return;
|
|
138
|
+
this.selfManageTick = value;
|
|
139
|
+
if (this.selfManageTick)
|
|
140
|
+
Owlly.RequestAnimationFrame(this.listeners.onTick);
|
|
141
|
+
}
|
|
142
|
+
renderNextFrame() {
|
|
143
|
+
this.forceRender = true;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
function updateTick() {
|
|
147
|
+
const owlly = Owlly.GetSharedInstance();
|
|
148
|
+
if (!timeSaver) {
|
|
149
|
+
frameTime = 0;
|
|
150
|
+
timeSaver = Date.now();
|
|
151
|
+
}
|
|
152
|
+
now = Date.now();
|
|
153
|
+
frameTime += now - timeSaver;
|
|
154
|
+
owlly.tick(frameTime);
|
|
155
|
+
timeSaver = now;
|
|
156
|
+
}
|
|
157
|
+
function forceRender() {
|
|
158
|
+
const owlly = Owlly.GetSharedInstance();
|
|
159
|
+
owlly.renderNextFrame();
|
|
160
|
+
}
|
|
161
|
+
// only for debugging
|
|
162
|
+
// declare global {
|
|
163
|
+
// interface Window {
|
|
164
|
+
// Owlly: any; // eslint-disable-line
|
|
165
|
+
// }
|
|
166
|
+
// }
|
|
167
|
+
// if (window) window.Owlly = Owlly;
|
|
168
|
+
export { Owlly, updateTick, forceRender };
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { NS_THREE } from './externals';
|
|
2
|
+
import { Element } from '../element/element';
|
|
3
|
+
import { View } from '../view';
|
|
4
|
+
import { Controller } from '../controller';
|
|
5
|
+
/**
|
|
6
|
+
* 场景类, 所有元素应当置于场景中, 视图与场景绑定后可渲染内容
|
|
7
|
+
*/
|
|
8
|
+
declare class Stage {
|
|
9
|
+
/**
|
|
10
|
+
* Stage 所使用的 THREE Scene
|
|
11
|
+
*/
|
|
12
|
+
scene: NS_THREE.Scene;
|
|
13
|
+
private elements;
|
|
14
|
+
private lights;
|
|
15
|
+
private axesHelper;
|
|
16
|
+
private stageListeners;
|
|
17
|
+
private disposed;
|
|
18
|
+
constructor();
|
|
19
|
+
private registerEvents;
|
|
20
|
+
private initLights;
|
|
21
|
+
/**
|
|
22
|
+
* 旧的时钟函数, 后期应删除
|
|
23
|
+
* @deprecated
|
|
24
|
+
*/
|
|
25
|
+
tick(): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* 时钟钩子函数
|
|
28
|
+
* @returns 是否需要重新渲染
|
|
29
|
+
*/
|
|
30
|
+
update(): boolean;
|
|
31
|
+
private handleElementUpdate;
|
|
32
|
+
/**
|
|
33
|
+
* 绑定视图至场景
|
|
34
|
+
* @param view 需要添加的视图
|
|
35
|
+
*/
|
|
36
|
+
bindView(view: View): void;
|
|
37
|
+
/**
|
|
38
|
+
* 销毁视图
|
|
39
|
+
* @param view 需要销毁的视图
|
|
40
|
+
*/
|
|
41
|
+
disposeView(view: View): void;
|
|
42
|
+
/**
|
|
43
|
+
* 绑定一个新的控制器到场景
|
|
44
|
+
* @param controller 添加的控制器
|
|
45
|
+
*/
|
|
46
|
+
bindController(controller: Controller): void;
|
|
47
|
+
/**
|
|
48
|
+
* 销毁控制器
|
|
49
|
+
* @param controller 销毁的控制器
|
|
50
|
+
*/
|
|
51
|
+
disposeController(controller?: Controller): Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* 绑定元素至场景
|
|
54
|
+
* @param element 需要绑定的元素
|
|
55
|
+
*/
|
|
56
|
+
bindElement(element: Element): void;
|
|
57
|
+
/**
|
|
58
|
+
* 销毁元素
|
|
59
|
+
* @param element 需要销毁的元素
|
|
60
|
+
*/
|
|
61
|
+
disposeElement(element: Element): void;
|
|
62
|
+
/**
|
|
63
|
+
* 解绑元素, 元素仅会从 Stage 中移除而非销毁
|
|
64
|
+
* @param element 需要解绑的元素
|
|
65
|
+
*/
|
|
66
|
+
unbindElement(element: Element): void;
|
|
67
|
+
/**
|
|
68
|
+
* (调试用) 开关性能统计
|
|
69
|
+
* @param value 开关值
|
|
70
|
+
*/
|
|
71
|
+
setStatsEnabled(value: boolean): void;
|
|
72
|
+
/**
|
|
73
|
+
* (调试用) 开关场景xyz轴指示器
|
|
74
|
+
* @param value 开关值
|
|
75
|
+
*/
|
|
76
|
+
setAxesEnabled(value: boolean): void;
|
|
77
|
+
/**
|
|
78
|
+
* 强制渲染
|
|
79
|
+
* @deprecated
|
|
80
|
+
*/
|
|
81
|
+
render(): void;
|
|
82
|
+
/**
|
|
83
|
+
* 销毁场景
|
|
84
|
+
*/
|
|
85
|
+
dispose(): void;
|
|
86
|
+
resizeElements(viewWidth: number, viewHeight: number): void;
|
|
87
|
+
renderElements(): void;
|
|
88
|
+
/**
|
|
89
|
+
* 强制重新计算绘制区域
|
|
90
|
+
* @deprecated
|
|
91
|
+
*/
|
|
92
|
+
forceResize(): void;
|
|
93
|
+
/**
|
|
94
|
+
* 设置全场景背景色
|
|
95
|
+
* @param hexColor 颜色, 可以使用字符串
|
|
96
|
+
*/
|
|
97
|
+
setBackgroundColor(hexColor: number | string): void;
|
|
98
|
+
/**
|
|
99
|
+
* 设置帧函数
|
|
100
|
+
* @param requestAnimationFrame
|
|
101
|
+
*/
|
|
102
|
+
setFrameTickFunction(requestAnimationFrame: Function): void;
|
|
103
|
+
/**
|
|
104
|
+
* @ignore
|
|
105
|
+
*/
|
|
106
|
+
toggleTickSelfManagement(value: boolean): void;
|
|
107
|
+
}
|
|
108
|
+
export { Stage };
|
|
@@ -0,0 +1,234 @@
|
|
|
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 './externals';
|
|
11
|
+
import { EventHub } from '../utils/event-hub';
|
|
12
|
+
import { OwllyEvents, Events } from '../utils/events';
|
|
13
|
+
import { Owlly } from './owlly';
|
|
14
|
+
/**
|
|
15
|
+
* 场景类, 所有元素应当置于场景中, 视图与场景绑定后可渲染内容
|
|
16
|
+
*/
|
|
17
|
+
class Stage {
|
|
18
|
+
constructor() {
|
|
19
|
+
const { THREE } = Externals.getInstance();
|
|
20
|
+
this.scene = new THREE.Scene();
|
|
21
|
+
this.elements = new Set();
|
|
22
|
+
this.lights = new THREE.Group();
|
|
23
|
+
this.initLights();
|
|
24
|
+
this.scene.add(this.lights);
|
|
25
|
+
this.axesHelper = new THREE.AxesHelper(10);
|
|
26
|
+
this.axesHelper.visible = false;
|
|
27
|
+
this.scene.add(this.axesHelper);
|
|
28
|
+
this.disposed = false;
|
|
29
|
+
this.stageListeners = {
|
|
30
|
+
onDisposeElement: (element) => {
|
|
31
|
+
if (Array.isArray(element)) {
|
|
32
|
+
element.forEach((e) => { this.stageListeners.onDisposeElement(e); });
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
this.disposeElement(element);
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
onElementLoaded: (element) => {
|
|
39
|
+
EventHub.emit(Events.ELEMENT_LOADED, element);
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
this.registerEvents();
|
|
43
|
+
Owlly.GetSharedInstance().registerStage(this);
|
|
44
|
+
}
|
|
45
|
+
registerEvents() {
|
|
46
|
+
EventHub.on(OwllyEvents.DISPOSE_ELEMENT, this.stageListeners.onDisposeElement);
|
|
47
|
+
EventHub.on(OwllyEvents.ELEMENT_LOADED, this.stageListeners.onElementLoaded);
|
|
48
|
+
}
|
|
49
|
+
initLights() {
|
|
50
|
+
const { THREE } = Externals.getInstance();
|
|
51
|
+
const hemisphereLight = new THREE.HemisphereLight(0xffffff, 0xffffff, 0.75);
|
|
52
|
+
// hemisphereLight.color.setHSL(0.6, 0.75, 0.5);
|
|
53
|
+
// hemisphereLight.groundColor.setHSL(0.095, 0.5, 0.5);
|
|
54
|
+
hemisphereLight.position.set(0, 50, 0);
|
|
55
|
+
this.lights.add(hemisphereLight);
|
|
56
|
+
const directionalLight = new THREE.DirectionalLight(0xffffff, 0.23);
|
|
57
|
+
directionalLight.color.setHSL(0.1, 1, 0.95);
|
|
58
|
+
directionalLight.position.set(-0.5, 1, 0.75);
|
|
59
|
+
directionalLight.position.multiplyScalar(50);
|
|
60
|
+
// directionalLight.position.set(-50, 60, 50);
|
|
61
|
+
// directionalLight.castShadow = true;
|
|
62
|
+
// directionalLight.shadow.camera.bottom = -200;
|
|
63
|
+
// directionalLight.shadow.camera.top = 200;
|
|
64
|
+
// directionalLight.shadow.camera.left = -200;
|
|
65
|
+
// directionalLight.shadow.camera.right = 200;
|
|
66
|
+
this.lights.add(directionalLight);
|
|
67
|
+
this.lights.add(directionalLight.target);
|
|
68
|
+
directionalLight.target.updateMatrixWorld();
|
|
69
|
+
const directionalLight2 = new THREE.DirectionalLight(0xffffff, 0.23);
|
|
70
|
+
directionalLight2.color.setHSL(0.1, 1, 0.95);
|
|
71
|
+
directionalLight2.position.set(0.5, -1, 0.75);
|
|
72
|
+
directionalLight2.position.multiplyScalar(50);
|
|
73
|
+
this.lights.add(directionalLight2);
|
|
74
|
+
this.lights.add(directionalLight2.target);
|
|
75
|
+
directionalLight2.target.updateMatrixWorld();
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* 旧的时钟函数, 后期应删除
|
|
79
|
+
* @deprecated
|
|
80
|
+
*/
|
|
81
|
+
tick() {
|
|
82
|
+
return this.update();
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* 时钟钩子函数
|
|
86
|
+
* @returns 是否需要重新渲染
|
|
87
|
+
*/
|
|
88
|
+
update() {
|
|
89
|
+
if (this.disposed)
|
|
90
|
+
return false;
|
|
91
|
+
const elements = Array.from(this.elements);
|
|
92
|
+
const elementsNeedsUpdate = elements.reduce((tf, e) => (this.handleElementUpdate(e.update()) || tf), false);
|
|
93
|
+
return elementsNeedsUpdate;
|
|
94
|
+
}
|
|
95
|
+
handleElementUpdate(context) {
|
|
96
|
+
if (context.shouldPlaceElement) {
|
|
97
|
+
this.scene.add(context.element);
|
|
98
|
+
}
|
|
99
|
+
return context.needUpdate;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* 绑定视图至场景
|
|
103
|
+
* @param view 需要添加的视图
|
|
104
|
+
*/
|
|
105
|
+
bindView(view) {
|
|
106
|
+
view.bindStage(this);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* 销毁视图
|
|
110
|
+
* @param view 需要销毁的视图
|
|
111
|
+
*/
|
|
112
|
+
disposeView(view) {
|
|
113
|
+
view.dispose();
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* 绑定一个新的控制器到场景
|
|
117
|
+
* @param controller 添加的控制器
|
|
118
|
+
*/
|
|
119
|
+
bindController(controller) {
|
|
120
|
+
if (controller.initWithScene)
|
|
121
|
+
controller.initWithScene(this.scene);
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* 销毁控制器
|
|
125
|
+
* @param controller 销毁的控制器
|
|
126
|
+
*/
|
|
127
|
+
disposeController(controller) {
|
|
128
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* 绑定元素至场景
|
|
133
|
+
* @param element 需要绑定的元素
|
|
134
|
+
*/
|
|
135
|
+
bindElement(element) {
|
|
136
|
+
this.elements.add(element);
|
|
137
|
+
// if (element.resize) this.forceResize();
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* 销毁元素
|
|
141
|
+
* @param element 需要销毁的元素
|
|
142
|
+
*/
|
|
143
|
+
disposeElement(element) {
|
|
144
|
+
this.unbindElement(element);
|
|
145
|
+
if (element)
|
|
146
|
+
element.dispose();
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* 解绑元素, 元素仅会从 Stage 中移除而非销毁
|
|
150
|
+
* @param element 需要解绑的元素
|
|
151
|
+
*/
|
|
152
|
+
unbindElement(element) {
|
|
153
|
+
if (!this.elements.has(element))
|
|
154
|
+
return;
|
|
155
|
+
this.scene.remove(element);
|
|
156
|
+
this.elements.delete(element);
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* (调试用) 开关性能统计
|
|
160
|
+
* @param value 开关值
|
|
161
|
+
*/
|
|
162
|
+
setStatsEnabled(value) {
|
|
163
|
+
Owlly.GetSharedInstance().setStatsEnabled(value);
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* (调试用) 开关场景xyz轴指示器
|
|
167
|
+
* @param value 开关值
|
|
168
|
+
*/
|
|
169
|
+
setAxesEnabled(value) {
|
|
170
|
+
this.axesHelper.visible = value;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* 强制渲染
|
|
174
|
+
* @deprecated
|
|
175
|
+
*/
|
|
176
|
+
render() {
|
|
177
|
+
throw new Error('[Owlly] This function is no longer being used. Use forceRender() exported from Owlly directly instead.');
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* 销毁场景
|
|
181
|
+
*/
|
|
182
|
+
dispose() {
|
|
183
|
+
const elements = Array.from(this.elements);
|
|
184
|
+
elements.forEach((e) => {
|
|
185
|
+
this.elements.delete(e);
|
|
186
|
+
e.dispose();
|
|
187
|
+
});
|
|
188
|
+
EventHub.off(OwllyEvents.DISPOSE_ELEMENT, this.stageListeners.onDisposeElement);
|
|
189
|
+
EventHub.off(OwllyEvents.ELEMENT_LOADED, this.stageListeners.onElementLoaded);
|
|
190
|
+
this.disposed = true;
|
|
191
|
+
Owlly.GetSharedInstance().unregisterStage(this);
|
|
192
|
+
}
|
|
193
|
+
resizeElements(viewWidth, viewHeight) {
|
|
194
|
+
this.elements.forEach((element) => {
|
|
195
|
+
if (element.resize)
|
|
196
|
+
element.resize(viewWidth, viewHeight);
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
renderElements() {
|
|
200
|
+
this.elements.forEach((element) => {
|
|
201
|
+
if (element.render)
|
|
202
|
+
element.render();
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* 强制重新计算绘制区域
|
|
207
|
+
* @deprecated
|
|
208
|
+
*/
|
|
209
|
+
forceResize() {
|
|
210
|
+
throw new Error('[Owlly] This function is no longer being used. Use Screen.resize() instead.');
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* 设置全场景背景色
|
|
214
|
+
* @param hexColor 颜色, 可以使用字符串
|
|
215
|
+
*/
|
|
216
|
+
setBackgroundColor(hexColor) {
|
|
217
|
+
const { THREE } = Externals.getInstance();
|
|
218
|
+
this.scene.background = new THREE.Color(hexColor);
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* 设置帧函数
|
|
222
|
+
* @param requestAnimationFrame
|
|
223
|
+
*/
|
|
224
|
+
setFrameTickFunction(requestAnimationFrame) {
|
|
225
|
+
Owlly.GetSharedInstance().setRequestAnimationFrameFunction(requestAnimationFrame);
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* @ignore
|
|
229
|
+
*/
|
|
230
|
+
toggleTickSelfManagement(value) {
|
|
231
|
+
Owlly.GetSharedInstance().toggleTickSelfManagement(value);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
export { Stage };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { View } from '../view/view';
|
|
2
|
+
declare class AlignmentUtils {
|
|
3
|
+
/**
|
|
4
|
+
* 获取2d与3d之间的对齐参数
|
|
5
|
+
* @param view 基准视图
|
|
6
|
+
* @param baseImageScale 底图缩放等级, 绝对值
|
|
7
|
+
* @param offset 底图整体偏移, 结构为 [ number, number ], 对应x, y轴偏移值
|
|
8
|
+
* @param imageSize 底图图片尺寸, 结构为 [ number, number ], 对应宽度, 高度
|
|
9
|
+
* @returns { upTrans: number[]; downTrans: number[]; matrixWorld: number[]; } 三个矩阵,
|
|
10
|
+
* uptrans: 2d转3d, downTrans: 3d转2d, matrixWorld: 相机自身参数, 重设时使用
|
|
11
|
+
*/
|
|
12
|
+
static getTransformMatrices(view: View, baseImageScale: number, offset: [number, number], imageSize: [number, number]): {
|
|
13
|
+
upTransOrigin: number[];
|
|
14
|
+
downTransOrigin: number[];
|
|
15
|
+
upTrans: number[];
|
|
16
|
+
downTrans: number[];
|
|
17
|
+
matrixWorld: number[];
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export { AlignmentUtils };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Externals } from '../stage/externals';
|
|
2
|
+
class AlignmentUtils {
|
|
3
|
+
/**
|
|
4
|
+
* 获取2d与3d之间的对齐参数
|
|
5
|
+
* @param view 基准视图
|
|
6
|
+
* @param baseImageScale 底图缩放等级, 绝对值
|
|
7
|
+
* @param offset 底图整体偏移, 结构为 [ number, number ], 对应x, y轴偏移值
|
|
8
|
+
* @param imageSize 底图图片尺寸, 结构为 [ number, number ], 对应宽度, 高度
|
|
9
|
+
* @returns { upTrans: number[]; downTrans: number[]; matrixWorld: number[]; } 三个矩阵,
|
|
10
|
+
* uptrans: 2d转3d, downTrans: 3d转2d, matrixWorld: 相机自身参数, 重设时使用
|
|
11
|
+
*/
|
|
12
|
+
static getTransformMatrices(view, baseImageScale, offset, imageSize) {
|
|
13
|
+
if (!view.camera || !view.renderer)
|
|
14
|
+
throw new Error('Cannot find Camera or Renderer object in view');
|
|
15
|
+
const c = view.camera;
|
|
16
|
+
const r = view.renderer;
|
|
17
|
+
const { THREE } = Externals.getInstance();
|
|
18
|
+
const raycaster = new THREE.Raycaster();
|
|
19
|
+
raycaster.setFromCamera({ x: -1, y: -1 }, c);
|
|
20
|
+
const from = raycaster.ray.origin.clone().x;
|
|
21
|
+
raycaster.setFromCamera({ x: 1, y: 1 }, c);
|
|
22
|
+
const to = raycaster.ray.origin.clone().x;
|
|
23
|
+
const ratio = Math.abs(to - from) / r.domElement.clientWidth * baseImageScale; // * r.getPixelRatio()
|
|
24
|
+
const camera = new THREE.Camera();
|
|
25
|
+
const rotation = new THREE.Euler().setFromQuaternion(c.quaternion.clone()).z;
|
|
26
|
+
const offsetX = ratio * (offset[0] * Math.cos(rotation) + offset[1] * Math.sin(rotation));
|
|
27
|
+
const offsetY = ratio * (-offset[0] * Math.sin(rotation) + offset[1] * Math.cos(rotation));
|
|
28
|
+
camera.copy(c);
|
|
29
|
+
camera.position.add(new THREE.Vector3(offsetX, -offsetY, 0));
|
|
30
|
+
camera.updateMatrixWorld();
|
|
31
|
+
const preScaleMatrix = new THREE.Matrix4();
|
|
32
|
+
const preScaleArray = new Array(16).fill(0);
|
|
33
|
+
preScaleArray[0] = 1 / baseImageScale;
|
|
34
|
+
preScaleArray[5] = 1 / baseImageScale;
|
|
35
|
+
preScaleArray[10] = 1;
|
|
36
|
+
preScaleArray[15] = 1;
|
|
37
|
+
preScaleMatrix.fromArray(preScaleArray);
|
|
38
|
+
const postTransformMatrix = new THREE.Matrix4();
|
|
39
|
+
const postTransformArray = new Array(16).fill(0);
|
|
40
|
+
postTransformArray[0] = imageSize[0] / 2;
|
|
41
|
+
postTransformArray[5] = -imageSize[1] / 2;
|
|
42
|
+
postTransformArray[10] = 1;
|
|
43
|
+
postTransformArray[12] = imageSize[0] / 2;
|
|
44
|
+
postTransformArray[13] = imageSize[1] / 2;
|
|
45
|
+
postTransformArray[15] = 1;
|
|
46
|
+
postTransformMatrix.fromArray(postTransformArray);
|
|
47
|
+
const downTransOrigin = camera.projectionMatrix.clone()
|
|
48
|
+
.multiply(preScaleMatrix)
|
|
49
|
+
.multiply(camera.matrixWorldInverse);
|
|
50
|
+
const upTransOrigin = downTransOrigin.clone().invert();
|
|
51
|
+
const downTrans = postTransformMatrix.clone().multiply(downTransOrigin);
|
|
52
|
+
const upTrans = downTrans.clone().invert();
|
|
53
|
+
const matrixWorld = camera.matrixWorld.elements.slice();
|
|
54
|
+
return {
|
|
55
|
+
upTransOrigin: upTransOrigin.elements.slice(),
|
|
56
|
+
downTransOrigin: downTransOrigin.elements.slice(),
|
|
57
|
+
upTrans: upTrans.elements.slice(),
|
|
58
|
+
downTrans: downTrans.elements.slice(),
|
|
59
|
+
matrixWorld,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
export { AlignmentUtils };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface Coord2d {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
}
|
|
5
|
+
interface TurningInfo {
|
|
6
|
+
point: number[];
|
|
7
|
+
angle: number;
|
|
8
|
+
startTPoint: number[];
|
|
9
|
+
endTPoint: number[];
|
|
10
|
+
startIndex: number;
|
|
11
|
+
endIndex: number;
|
|
12
|
+
}
|
|
13
|
+
declare class BasicCalcTool {
|
|
14
|
+
static getLineCross(line1_p1: Coord2d, line1_p2: Coord2d, line2_p1: Coord2d, line2_p2: Coord2d): boolean;
|
|
15
|
+
static calcTurning(linePoints: [number, number][], turningStandard?: number[]): TurningInfo[];
|
|
16
|
+
static chunk(items: any[], size: number): any[][];
|
|
17
|
+
}
|
|
18
|
+
export { BasicCalcTool, TurningInfo };
|