@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,383 @@
|
|
|
1
|
+
import { NS_THREE } from '../stage/externals';
|
|
2
|
+
import { Element, ElementFrameContext } from './element';
|
|
3
|
+
class RingElement extends Element {
|
|
4
|
+
constructor(option) {
|
|
5
|
+
super();
|
|
6
|
+
const { innerRadius, outerRadius, tubeRadius, textArrowMesh, signMesh, textMeshMap, maxLeftAngle, maxRightAngle, downMesh, } = option;
|
|
7
|
+
const geometry = new NS_THREE.RingGeometry(innerRadius, outerRadius, 540, 1);
|
|
8
|
+
const material = new NS_THREE.MeshBasicMaterial({
|
|
9
|
+
color: 0xffffff,
|
|
10
|
+
wireframe: false,
|
|
11
|
+
blending: NS_THREE.CustomBlending,
|
|
12
|
+
blendSrc: NS_THREE.OneFactor,
|
|
13
|
+
});
|
|
14
|
+
material.needsUpdate = true;
|
|
15
|
+
material.visible = true;
|
|
16
|
+
material.opacity = 1;
|
|
17
|
+
this.torus = new NS_THREE.Mesh(geometry, material);
|
|
18
|
+
this.torus.position.set(0, 0, 1);
|
|
19
|
+
this.torus.lookAt(0, 0, 1);
|
|
20
|
+
this.add(this.torus);
|
|
21
|
+
this.enabled = true;
|
|
22
|
+
this.textArrowMesh = textArrowMesh;
|
|
23
|
+
this.textArrowMesh.visible = false;
|
|
24
|
+
this.signMesh = signMesh;
|
|
25
|
+
this.signMesh.visible = false;
|
|
26
|
+
this.downMesh = downMesh;
|
|
27
|
+
this.downMesh.visible = true;
|
|
28
|
+
this.torus.add(this.textArrowMesh);
|
|
29
|
+
this.textMeshMap = textMeshMap;
|
|
30
|
+
this.textValuePre = 0;
|
|
31
|
+
this.tubeRadius = tubeRadius || 0;
|
|
32
|
+
this.maxLeftAngle = maxLeftAngle || 0;
|
|
33
|
+
this.maxRightAngle = maxRightAngle || 0;
|
|
34
|
+
this.setRing(0, '123米', 'center');
|
|
35
|
+
// console.log(this.textArrowMesh, this.textMeshMap);
|
|
36
|
+
// this.createImage(r + d / 2, d, torus);
|
|
37
|
+
// this.createText(r + d / 2, d, torus);
|
|
38
|
+
const r = innerRadius;
|
|
39
|
+
const d = outerRadius - innerRadius;
|
|
40
|
+
this.innerRadius = innerRadius;
|
|
41
|
+
this.outerRadius = outerRadius;
|
|
42
|
+
this.navRadius = r + d / 2;
|
|
43
|
+
this.createMask(innerRadius, outerRadius);
|
|
44
|
+
this.createSign(innerRadius, d);
|
|
45
|
+
this.createDown(innerRadius);
|
|
46
|
+
this.initialized = false;
|
|
47
|
+
this.needUpdate = true;
|
|
48
|
+
this.directionPre = 'center';
|
|
49
|
+
}
|
|
50
|
+
// 刻度线
|
|
51
|
+
createSign(r, d) {
|
|
52
|
+
for (let angle = 0; angle < 2 * Math.PI; angle += Math.PI / 180) {
|
|
53
|
+
const sx = Math.cos(angle) * (r + d / 2);
|
|
54
|
+
const sy = Math.sin(angle) * (r + d / 2);
|
|
55
|
+
const p = {
|
|
56
|
+
x: sy,
|
|
57
|
+
y: sx,
|
|
58
|
+
};
|
|
59
|
+
// 刻度线
|
|
60
|
+
const lineMesh = this.signMesh.clone();
|
|
61
|
+
lineMesh.position.set(p.x, p.y, 2);
|
|
62
|
+
lineMesh.lookAt(0, 0, 1);
|
|
63
|
+
if (angle < Math.PI) {
|
|
64
|
+
lineMesh.rotateY(Math.PI / 2);
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
lineMesh.rotateY(-Math.PI / 2);
|
|
68
|
+
}
|
|
69
|
+
lineMesh.visible = true;
|
|
70
|
+
this.torus.add(lineMesh);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
createDown(r) {
|
|
74
|
+
const downMesh = this.downMesh.clone();
|
|
75
|
+
downMesh.position.set(0, r - 10, 10);
|
|
76
|
+
this.downArrow = downMesh;
|
|
77
|
+
this.add(downMesh);
|
|
78
|
+
}
|
|
79
|
+
// 文字后面遮罩层
|
|
80
|
+
createMask(r, d) {
|
|
81
|
+
const material = new NS_THREE.MeshBasicMaterial({
|
|
82
|
+
transparent: true,
|
|
83
|
+
blending: NS_THREE.CustomBlending,
|
|
84
|
+
blendSrc: NS_THREE.OneFactor,
|
|
85
|
+
color: 0xffffff,
|
|
86
|
+
});
|
|
87
|
+
const geometry = new NS_THREE.RingGeometry(r + d / 2, r - d / 2, 540, 1, Math.PI / 2, Math.PI / 18);
|
|
88
|
+
this.maskCenterMesh = new NS_THREE.Mesh(geometry, material);
|
|
89
|
+
this.maskCenterMesh.position.set(0, 0, 3);
|
|
90
|
+
// this.maskCenterMesh.lookAt(0, 0, 1);
|
|
91
|
+
// 中心遮罩跟随圆动,两边的固定在左右
|
|
92
|
+
this.torus.add(this.maskCenterMesh);
|
|
93
|
+
}
|
|
94
|
+
// 控制圆盘的偏移以及文字显示
|
|
95
|
+
updateText(angle, value) {
|
|
96
|
+
// 计算偏移量
|
|
97
|
+
let torusOffsetAngle = angle;
|
|
98
|
+
if (this.isStop) {
|
|
99
|
+
torusOffsetAngle = 0;
|
|
100
|
+
this.direction = 'center';
|
|
101
|
+
}
|
|
102
|
+
if (this.direction === 'left') {
|
|
103
|
+
torusOffsetAngle = -this.maxLeftAngle;
|
|
104
|
+
}
|
|
105
|
+
if (this.direction === 'right') {
|
|
106
|
+
torusOffsetAngle = -this.maxRightAngle;
|
|
107
|
+
}
|
|
108
|
+
if (this.leftMeshGroup)
|
|
109
|
+
this.leftMeshGroup.visible = false;
|
|
110
|
+
if (this.centerMeshGroup)
|
|
111
|
+
this.centerMeshGroup.visible = false;
|
|
112
|
+
if (this.rightMeshGroup)
|
|
113
|
+
this.rightMeshGroup.visible = false;
|
|
114
|
+
if (this.textArrowMesh)
|
|
115
|
+
this.textArrowMesh.visible = false;
|
|
116
|
+
// 分别处理左、右、中
|
|
117
|
+
const valueText = [];
|
|
118
|
+
valueText.push(...value.toString());
|
|
119
|
+
// 判断是否更新文字
|
|
120
|
+
let textUpdate = false;
|
|
121
|
+
if (this.textValuePre !== value) {
|
|
122
|
+
textUpdate = true;
|
|
123
|
+
}
|
|
124
|
+
if (this.directionPre !== this.direction) {
|
|
125
|
+
textUpdate = true;
|
|
126
|
+
}
|
|
127
|
+
this.textValuePre = value;
|
|
128
|
+
this.directionPre = this.direction;
|
|
129
|
+
if (this.direction === 'left') {
|
|
130
|
+
// 定位在左侧
|
|
131
|
+
if (!this.leftMeshGroup) {
|
|
132
|
+
this.leftMeshGroup = this.renderText('ls'.split(''));
|
|
133
|
+
this.torus.add(this.leftMeshGroup);
|
|
134
|
+
}
|
|
135
|
+
if (textUpdate) {
|
|
136
|
+
if (this.leftTextMeshGroup)
|
|
137
|
+
this.leftMeshGroup.remove(this.leftTextMeshGroup);
|
|
138
|
+
this.leftTextMeshGroup = this.renderText(valueText, this.leftMeshGroup.groupOffsetAngle);
|
|
139
|
+
this.leftMeshGroup.add(this.leftTextMeshGroup);
|
|
140
|
+
// 更新遮罩层
|
|
141
|
+
if (this.maskCenterMesh && textUpdate) {
|
|
142
|
+
const g = this.maskCenterMesh.geometry;
|
|
143
|
+
const geometry = new NS_THREE.RingGeometry(this.innerRadius, this.outerRadius, 60, 1, 0, this.leftTextMeshGroup.groupOffsetAngle - this.leftTextMeshGroup.lastAngle / 2);
|
|
144
|
+
this.maskCenterMesh.geometry = geometry;
|
|
145
|
+
setTimeout(() => {
|
|
146
|
+
g.dispose();
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
// 最大左偏移量
|
|
151
|
+
// let maxLeftAngleOffset = 0;
|
|
152
|
+
// if (torusOffsetAngle < -this.maxLeftAngle) {
|
|
153
|
+
// maxLeftAngleOffset = torusOffsetAngle + this.maxLeftAngle;
|
|
154
|
+
// this.leftMeshGroup.rotation.z = maxLeftAngleOffset;
|
|
155
|
+
// }
|
|
156
|
+
if (this.maskCenterMesh) {
|
|
157
|
+
this.maskCenterMesh.rotation.z = Math.PI / 2
|
|
158
|
+
- this.leftTextMeshGroup.groupOffsetAngle
|
|
159
|
+
+ this.leftTextMeshGroup.lastAngle / 2;
|
|
160
|
+
// + maxLeftAngleOffset;
|
|
161
|
+
}
|
|
162
|
+
this.leftMeshGroup.visible = true;
|
|
163
|
+
}
|
|
164
|
+
else if (this.direction === 'right') {
|
|
165
|
+
// // 定位在右侧
|
|
166
|
+
if (!this.rightMeshGroup) {
|
|
167
|
+
this.rightMeshGroup = this.renderText('sr'.split(''), 0, true);
|
|
168
|
+
this.torus.add(this.rightMeshGroup);
|
|
169
|
+
}
|
|
170
|
+
if (textUpdate) {
|
|
171
|
+
if (this.rightTextMeshGroup)
|
|
172
|
+
this.rightMeshGroup.remove(this.rightTextMeshGroup);
|
|
173
|
+
this.rightTextMeshGroup = this.renderText(valueText, this.rightMeshGroup.groupOffsetAngle, true);
|
|
174
|
+
// // 减去上面的旋转量,以适应文字变化
|
|
175
|
+
this.rightMeshGroup.add(this.rightTextMeshGroup);
|
|
176
|
+
}
|
|
177
|
+
this.rightMeshGroup.visible = true;
|
|
178
|
+
// 最大右偏移量
|
|
179
|
+
// let maxRightAngleOffset = 0;
|
|
180
|
+
// if (torusOffsetAngle > -this.maxRightAngle) {
|
|
181
|
+
// maxRightAngleOffset = torusOffsetAngle + this.maxRightAngle;
|
|
182
|
+
// this.rightMeshGroup.rotation.z = maxRightAngleOffset;
|
|
183
|
+
// }
|
|
184
|
+
// 更新遮罩层
|
|
185
|
+
if (this.maskCenterMesh && textUpdate) {
|
|
186
|
+
const g = this.maskCenterMesh.geometry;
|
|
187
|
+
const geometry = new NS_THREE.RingGeometry(this.innerRadius, this.outerRadius, 60, 1, 0, this.rightTextMeshGroup.groupOffsetAngle - this.rightTextMeshGroup.firstAngle / 2);
|
|
188
|
+
this.maskCenterMesh.geometry = geometry;
|
|
189
|
+
this.maskCenterMesh.rotation.z = Math.PI / 2;
|
|
190
|
+
setTimeout(() => {
|
|
191
|
+
g.dispose();
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
else if (this.direction === 'center') {
|
|
196
|
+
if (textUpdate) {
|
|
197
|
+
// 文字
|
|
198
|
+
if (this.centerMeshGroup)
|
|
199
|
+
this.torus.remove(this.centerMeshGroup);
|
|
200
|
+
this.centerMeshGroup = this.renderText(valueText);
|
|
201
|
+
this.torus.add(this.centerMeshGroup);
|
|
202
|
+
// 对正
|
|
203
|
+
this.centerMeshGroup.rotateZ(this.centerMeshGroup.groupOffsetAngle / 2);
|
|
204
|
+
}
|
|
205
|
+
this.centerMeshGroup.visible = true;
|
|
206
|
+
// 到终点达,和全屏,隐藏箭头
|
|
207
|
+
if (this.isStop || !this.showTopArrow) {
|
|
208
|
+
this.textArrowMesh.visible = false;
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
// 顶部箭头
|
|
212
|
+
this.textArrowMesh.visible = true;
|
|
213
|
+
this.textArrowMesh.position.set(0, this.innerRadius + this.tubeRadius, 5); // 部分在圆里
|
|
214
|
+
}
|
|
215
|
+
// 更新遮罩层
|
|
216
|
+
if (this.maskCenterMesh && textUpdate) {
|
|
217
|
+
const g = this.maskCenterMesh.geometry;
|
|
218
|
+
const geometry = new NS_THREE.RingGeometry(this.innerRadius, this.outerRadius, 60, 1, 0, this.centerMeshGroup.groupOffsetAngle
|
|
219
|
+
- this.centerMeshGroup.firstAngle / 2
|
|
220
|
+
- this.centerMeshGroup.lastAngle / 2);
|
|
221
|
+
this.maskCenterMesh.geometry = geometry;
|
|
222
|
+
this.maskCenterMesh.rotation.z = Math.PI / 2
|
|
223
|
+
- this.centerMeshGroup.groupOffsetAngle / 2
|
|
224
|
+
+ this.centerMeshGroup.lastAngle / 2;
|
|
225
|
+
setTimeout(() => {
|
|
226
|
+
g.dispose();
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
if (this.isStop) {
|
|
231
|
+
this.torus.rotation.z = 0;
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
this.torus.rotation.z = -torusOffsetAngle;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
// 绘制文字
|
|
238
|
+
renderText(values, angle = 0, reverse = false) {
|
|
239
|
+
const textList = reverse ? values.reverse() : values;
|
|
240
|
+
// 弧度累计
|
|
241
|
+
let groupOffsetAngle = 0;
|
|
242
|
+
if (reverse) {
|
|
243
|
+
groupOffsetAngle = -angle;
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
groupOffsetAngle = angle;
|
|
247
|
+
}
|
|
248
|
+
const textMeshGroup = new NS_THREE.Group();
|
|
249
|
+
let firstAngle = 0;
|
|
250
|
+
let lastAngle = 0;
|
|
251
|
+
textList.forEach((item, index) => {
|
|
252
|
+
const textMeshData = this.textMeshMap.get(item);
|
|
253
|
+
if (!textMeshData)
|
|
254
|
+
return;
|
|
255
|
+
const textMesh = textMeshData.mesh.clone();
|
|
256
|
+
// textMesh.material.visible = true;
|
|
257
|
+
// 文字自身宽度
|
|
258
|
+
const radian = index === 0
|
|
259
|
+
? Math.asin(textMeshData.textWidth / 2 / this.navRadius) * 2
|
|
260
|
+
: Math.asin(textMeshData.textWidth / 2 / this.navRadius) * 2;
|
|
261
|
+
if (index === 0)
|
|
262
|
+
firstAngle = radian;
|
|
263
|
+
if (index === textList.length - 1)
|
|
264
|
+
lastAngle = radian;
|
|
265
|
+
if (reverse) {
|
|
266
|
+
groupOffsetAngle -= radian / 2;
|
|
267
|
+
}
|
|
268
|
+
else {
|
|
269
|
+
groupOffsetAngle += radian / 2;
|
|
270
|
+
}
|
|
271
|
+
// 左间距
|
|
272
|
+
if (textMeshData.spacingLeft) {
|
|
273
|
+
const rad = Math.asin(textMeshData.spacingLeft / 2 / this.navRadius) * 2;
|
|
274
|
+
if (reverse) {
|
|
275
|
+
groupOffsetAngle -= rad;
|
|
276
|
+
}
|
|
277
|
+
else {
|
|
278
|
+
groupOffsetAngle += rad;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
// 定位
|
|
282
|
+
const r = this.navRadius;
|
|
283
|
+
const x = r * Math.sin(groupOffsetAngle);
|
|
284
|
+
const y = r * Math.cos(groupOffsetAngle);
|
|
285
|
+
textMesh.position.set(x, y, 15);
|
|
286
|
+
// 旋转
|
|
287
|
+
textMesh.rotateZ(-groupOffsetAngle);
|
|
288
|
+
// 横向偏移量累加
|
|
289
|
+
if (reverse) {
|
|
290
|
+
groupOffsetAngle -= radian / 2;
|
|
291
|
+
}
|
|
292
|
+
else {
|
|
293
|
+
groupOffsetAngle += radian / 2;
|
|
294
|
+
}
|
|
295
|
+
// 右间距
|
|
296
|
+
if (textMeshData.spacing) {
|
|
297
|
+
const rad = Math.asin(textMeshData.spacing / 2 / this.navRadius) * 2;
|
|
298
|
+
if (reverse) {
|
|
299
|
+
groupOffsetAngle -= rad;
|
|
300
|
+
}
|
|
301
|
+
else {
|
|
302
|
+
groupOffsetAngle += rad;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
textMeshGroup.add(textMesh);
|
|
306
|
+
});
|
|
307
|
+
// 文字整体弧度
|
|
308
|
+
textMeshGroup.groupOffsetAngle = Math.abs(groupOffsetAngle);
|
|
309
|
+
textMeshGroup.lastAngle = lastAngle;
|
|
310
|
+
textMeshGroup.firstAngle = firstAngle;
|
|
311
|
+
return textMeshGroup;
|
|
312
|
+
}
|
|
313
|
+
setDirection(direction) {
|
|
314
|
+
this.direction = direction;
|
|
315
|
+
}
|
|
316
|
+
setAngle(angle) {
|
|
317
|
+
this.angle = angle;
|
|
318
|
+
}
|
|
319
|
+
setText(text) {
|
|
320
|
+
this.text = text;
|
|
321
|
+
}
|
|
322
|
+
setRing(angle, text, direction = 'center') {
|
|
323
|
+
this.setAngle(angle);
|
|
324
|
+
this.setText(text);
|
|
325
|
+
this.setDirection(direction);
|
|
326
|
+
}
|
|
327
|
+
setToursPosition(x, y, z) {
|
|
328
|
+
this.torus.position.set(x, y, z);
|
|
329
|
+
}
|
|
330
|
+
setTopArrowVisible(visible) {
|
|
331
|
+
this.showTopArrow = visible;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* 设置是否更新
|
|
335
|
+
* @param value 开关值
|
|
336
|
+
*/
|
|
337
|
+
setEnabled(value) {
|
|
338
|
+
this.enabled = value;
|
|
339
|
+
}
|
|
340
|
+
play() {
|
|
341
|
+
this.isStop = false;
|
|
342
|
+
}
|
|
343
|
+
/*
|
|
344
|
+
暂停时隐藏箭头,角度锁定为0
|
|
345
|
+
*/
|
|
346
|
+
stop() {
|
|
347
|
+
this.isStop = true;
|
|
348
|
+
}
|
|
349
|
+
resize(width, height) {
|
|
350
|
+
if (this.viewWidth === width && this.viewHeight === height)
|
|
351
|
+
return;
|
|
352
|
+
this.viewWidth = width;
|
|
353
|
+
this.viewHeight = height;
|
|
354
|
+
}
|
|
355
|
+
update() {
|
|
356
|
+
const frameContext = new ElementFrameContext(this);
|
|
357
|
+
frameContext.needUpdate = this.needUpdate;
|
|
358
|
+
// 添加圆盘
|
|
359
|
+
if (!this.initialized && this.torus) {
|
|
360
|
+
frameContext.shouldPlaceElement = true;
|
|
361
|
+
this.initialized = true;
|
|
362
|
+
}
|
|
363
|
+
if (this.enabled) {
|
|
364
|
+
// console.log('update');
|
|
365
|
+
this.updateText(-this.angle, this.text);
|
|
366
|
+
}
|
|
367
|
+
// if (this.isStop) {
|
|
368
|
+
// this.torus.rotation.z = 0;
|
|
369
|
+
// } else {
|
|
370
|
+
// // this.torus.rotateZ(torusOffsetAngle);
|
|
371
|
+
// this.torus.rotation.z = this.angle;
|
|
372
|
+
// }
|
|
373
|
+
// if (this.visible) {
|
|
374
|
+
// frameContext.needUpdate = true;
|
|
375
|
+
// }
|
|
376
|
+
return frameContext;
|
|
377
|
+
}
|
|
378
|
+
dispose() {
|
|
379
|
+
this.torus.remove();
|
|
380
|
+
this.textMeshMap.clear();
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
export { RingElement };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { NS_THREE } from '../stage/externals';
|
|
2
|
+
import { Element, ElementFrameContext } from './element';
|
|
3
|
+
import { View } from '../view/view';
|
|
4
|
+
declare class SphereMesh extends Element {
|
|
5
|
+
private initialized;
|
|
6
|
+
private loaded;
|
|
7
|
+
private group;
|
|
8
|
+
private eventListeners;
|
|
9
|
+
/**
|
|
10
|
+
* @param radius 半径
|
|
11
|
+
* @param optionalParams 可选参数,包括是否可见、颜色等等
|
|
12
|
+
* @example ```
|
|
13
|
+
* const sphere = new SphereMesh(0.1, { fillColor: 0x00ffff, hidden: true });
|
|
14
|
+
* sphere.position.set(0, 0, 0);
|
|
15
|
+
* stage.bindElement(sphere);
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
constructor(radius: number, optionalParams?: {
|
|
19
|
+
hidden?: boolean;
|
|
20
|
+
material?: NS_THREE.Material;
|
|
21
|
+
fillColor?: NS_THREE.Color | string | number;
|
|
22
|
+
opacity?: number;
|
|
23
|
+
});
|
|
24
|
+
setOnCurrentViewChanged(func: (view: View) => void): void;
|
|
25
|
+
update(): ElementFrameContext;
|
|
26
|
+
dispose(): void;
|
|
27
|
+
}
|
|
28
|
+
export { SphereMesh };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Externals } from '../stage/externals';
|
|
2
|
+
import { Element, ElementFrameContext } from './element';
|
|
3
|
+
import { BasicTools } from '../utils/basic-tools';
|
|
4
|
+
// import { EventHub } from '../utils/event-hub';
|
|
5
|
+
// import { OwllyEvents } from '../utils/events';
|
|
6
|
+
class SphereMesh extends Element {
|
|
7
|
+
/**
|
|
8
|
+
* @param radius 半径
|
|
9
|
+
* @param optionalParams 可选参数,包括是否可见、颜色等等
|
|
10
|
+
* @example ```
|
|
11
|
+
* const sphere = new SphereMesh(0.1, { fillColor: 0x00ffff, hidden: true });
|
|
12
|
+
* sphere.position.set(0, 0, 0);
|
|
13
|
+
* stage.bindElement(sphere);
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
constructor(radius, optionalParams) {
|
|
17
|
+
super();
|
|
18
|
+
const { THREE } = Externals.getInstance();
|
|
19
|
+
const options = optionalParams || {};
|
|
20
|
+
this.group = new THREE.Group();
|
|
21
|
+
this.add(this.group);
|
|
22
|
+
const material = options.material || new THREE.MeshBasicMaterial({
|
|
23
|
+
color: options.fillColor ? options.fillColor : 0x00ff00,
|
|
24
|
+
transparent: true,
|
|
25
|
+
opacity: options.opacity !== undefined ? options.opacity : 1,
|
|
26
|
+
side: THREE.DoubleSide,
|
|
27
|
+
depthWrite: true,
|
|
28
|
+
});
|
|
29
|
+
if (options.hidden === false) {
|
|
30
|
+
material.visible = false;
|
|
31
|
+
}
|
|
32
|
+
const geometry = new THREE.SphereGeometry(radius, 60, 40);
|
|
33
|
+
const mesh = new THREE.Mesh(geometry, material);
|
|
34
|
+
mesh.renderOrder = 1000;
|
|
35
|
+
this.group.add(mesh);
|
|
36
|
+
this.initialized = false;
|
|
37
|
+
this.loaded = true;
|
|
38
|
+
}
|
|
39
|
+
setOnCurrentViewChanged(func) {
|
|
40
|
+
// if (this.eventListeners && this.eventListeners.onCurrentViewChanged) {
|
|
41
|
+
// EventHub.off(OwllyEvents.RENDERING_VIEW_CHANGED, this.eventListeners.onCurrentViewChanged);
|
|
42
|
+
// }
|
|
43
|
+
this.eventListeners = {
|
|
44
|
+
onCurrentViewChanged: func,
|
|
45
|
+
};
|
|
46
|
+
// EventHub.on(OwllyEvents.RENDERING_VIEW_CHANGED, this.eventListeners.onCurrentViewChanged);
|
|
47
|
+
}
|
|
48
|
+
// renderingViewChanged(view: View): void {
|
|
49
|
+
// if (this.eventListeners && this.eventListeners.onCurrentViewChanged) {
|
|
50
|
+
// this.eventListeners.onCurrentViewChanged(view);
|
|
51
|
+
// }
|
|
52
|
+
// }
|
|
53
|
+
update() {
|
|
54
|
+
const frameContext = new ElementFrameContext(this);
|
|
55
|
+
if (!this.initialized && this.loaded) {
|
|
56
|
+
this.initialized = true;
|
|
57
|
+
frameContext.needUpdate = true;
|
|
58
|
+
}
|
|
59
|
+
if (this.initialized && !this.parent) {
|
|
60
|
+
frameContext.shouldPlaceElement = true;
|
|
61
|
+
}
|
|
62
|
+
return frameContext;
|
|
63
|
+
}
|
|
64
|
+
dispose() {
|
|
65
|
+
super.dispose();
|
|
66
|
+
BasicTools.dispose(this, true);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
export { SphereMesh };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Element, ElementFrameContext } from './element';
|
|
2
|
+
import { ModelSvgMapping } from '../view/svg-map-view';
|
|
3
|
+
/**
|
|
4
|
+
* SVG楼层模型, 不应再被维护
|
|
5
|
+
* @noInheritDoc
|
|
6
|
+
* @deprecated
|
|
7
|
+
*/
|
|
8
|
+
declare class SvgFloorModel extends Element {
|
|
9
|
+
private initialized;
|
|
10
|
+
private loaded;
|
|
11
|
+
private opacity;
|
|
12
|
+
private mapping;
|
|
13
|
+
private groundMeshes;
|
|
14
|
+
constructor(url: string, mapping: ModelSvgMapping, opacity?: number);
|
|
15
|
+
private static getShapeDefs;
|
|
16
|
+
load(url: string): Promise<void>;
|
|
17
|
+
setOpacity(value: number): void;
|
|
18
|
+
setShadowEnabled(value: boolean): void;
|
|
19
|
+
update(): ElementFrameContext;
|
|
20
|
+
dispose(): void;
|
|
21
|
+
}
|
|
22
|
+
export { SvgFloorModel };
|
|
@@ -0,0 +1,184 @@
|
|
|
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 { parse } from 'svgson';
|
|
11
|
+
import { Externals } from '../stage/externals';
|
|
12
|
+
import { Element, ElementFrameContext } from './element';
|
|
13
|
+
import { SvgUtils } from '../utils/svgutils';
|
|
14
|
+
import { BasicTools } from '../utils/basic-tools';
|
|
15
|
+
/**
|
|
16
|
+
* SVG楼层模型, 不应再被维护
|
|
17
|
+
* @noInheritDoc
|
|
18
|
+
* @deprecated
|
|
19
|
+
*/
|
|
20
|
+
class SvgFloorModel extends Element {
|
|
21
|
+
constructor(url, mapping, opacity = 1) {
|
|
22
|
+
super();
|
|
23
|
+
this.initialized = false;
|
|
24
|
+
this.loaded = false;
|
|
25
|
+
this.opacity = opacity;
|
|
26
|
+
this.mapping = mapping;
|
|
27
|
+
this.groundMeshes = [];
|
|
28
|
+
if (url)
|
|
29
|
+
this.load(url);
|
|
30
|
+
}
|
|
31
|
+
static getShapeDefs(canvasObject) {
|
|
32
|
+
const result = [];
|
|
33
|
+
const { THREE } = Externals.getInstance();
|
|
34
|
+
if (canvasObject.commands && canvasObject.commands.length) {
|
|
35
|
+
const shape = new THREE.Shape();
|
|
36
|
+
const holes = [];
|
|
37
|
+
let hole = null;
|
|
38
|
+
let shapeCount = 0;
|
|
39
|
+
canvasObject.commands.forEach(({ command, args }) => {
|
|
40
|
+
if (hole && shapeCount > 1) {
|
|
41
|
+
if (command === 'M') {
|
|
42
|
+
if (hole)
|
|
43
|
+
holes.push(hole);
|
|
44
|
+
hole = new THREE.Path();
|
|
45
|
+
hole.moveTo(args[0], args[1]);
|
|
46
|
+
}
|
|
47
|
+
if (command === 'C')
|
|
48
|
+
hole.bezierCurveTo(args[0], args[1], args[2], args[3], args[4], args[5]);
|
|
49
|
+
if (command === 'L')
|
|
50
|
+
hole.lineTo(args[0], args[1]);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
if (command === 'M') {
|
|
54
|
+
shapeCount += 1;
|
|
55
|
+
if (shapeCount === 2) {
|
|
56
|
+
hole = new THREE.Path();
|
|
57
|
+
hole.moveTo(args[0], args[1]);
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
shape.moveTo(args[0], args[1]);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (command === 'C')
|
|
64
|
+
shape.bezierCurveTo(args[0], args[1], args[2], args[3], args[4], args[5]);
|
|
65
|
+
if (command === 'L')
|
|
66
|
+
shape.lineTo(args[0], args[1]);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
if (hole)
|
|
70
|
+
holes.push(hole);
|
|
71
|
+
shape.holes = holes;
|
|
72
|
+
const shapeDef = { shape };
|
|
73
|
+
if (canvasObject.fill) {
|
|
74
|
+
Object.assign(shapeDef, { color: parseInt(canvasObject.fill.substr(1), 16) });
|
|
75
|
+
}
|
|
76
|
+
if (canvasObject.tag) {
|
|
77
|
+
Object.assign(shapeDef, { tag: canvasObject.tag });
|
|
78
|
+
}
|
|
79
|
+
result.push(shapeDef);
|
|
80
|
+
}
|
|
81
|
+
if (canvasObject.children && canvasObject.children.length) {
|
|
82
|
+
canvasObject.children.forEach((child) => {
|
|
83
|
+
result.push(...SvgFloorModel.getShapeDefs(child));
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
return result;
|
|
87
|
+
}
|
|
88
|
+
load(url) {
|
|
89
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
+
this.initialized = false;
|
|
91
|
+
this.loaded = false;
|
|
92
|
+
const { THREE } = Externals.getInstance();
|
|
93
|
+
// Avoid using axios. Use FileLoader instead.
|
|
94
|
+
const svg = yield new Promise((resolve) => {
|
|
95
|
+
const fileLoader = new THREE.FileLoader();
|
|
96
|
+
fileLoader.load(url, (data) => {
|
|
97
|
+
resolve(data);
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
const svgObject = yield parse(svg);
|
|
101
|
+
const canvasObject = SvgUtils.svg2canvas(svgObject, this.mapping);
|
|
102
|
+
if (canvasObject !== null) {
|
|
103
|
+
const shapeDefs = SvgFloorModel.getShapeDefs(canvasObject);
|
|
104
|
+
const group = new THREE.Group();
|
|
105
|
+
shapeDefs.forEach(({ shape, color, tag }) => {
|
|
106
|
+
const options = {
|
|
107
|
+
steps: 1,
|
|
108
|
+
depth: 1,
|
|
109
|
+
bevelEnabled: false,
|
|
110
|
+
bevelThickness: 0.1,
|
|
111
|
+
bevelSize: 0.2,
|
|
112
|
+
bevelOffset: 0,
|
|
113
|
+
bevelSegments: 2,
|
|
114
|
+
};
|
|
115
|
+
switch (tag) {
|
|
116
|
+
case 'ground':
|
|
117
|
+
Object.assign(options, { bevelSize: 0.1, depth: 0.8 });
|
|
118
|
+
break;
|
|
119
|
+
case 'store':
|
|
120
|
+
Object.assign(options, { depth: 2, bevelThickness: 0.3, bevelSize: 0.3 });
|
|
121
|
+
break;
|
|
122
|
+
default:
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
const geometry = new THREE.ExtrudeBufferGeometry(shape, options);
|
|
126
|
+
const material = new THREE.MeshLambertMaterial({
|
|
127
|
+
color,
|
|
128
|
+
transparent: true,
|
|
129
|
+
opacity: this.opacity,
|
|
130
|
+
});
|
|
131
|
+
const mesh = new THREE.Mesh(geometry, material);
|
|
132
|
+
switch (tag) {
|
|
133
|
+
case 'ground':
|
|
134
|
+
mesh.receiveShadow = true;
|
|
135
|
+
mesh.position.set(0, 0, -0.2);
|
|
136
|
+
this.groundMeshes.push(mesh);
|
|
137
|
+
break;
|
|
138
|
+
case 'impassable':
|
|
139
|
+
case 'store':
|
|
140
|
+
mesh.castShadow = true;
|
|
141
|
+
break;
|
|
142
|
+
default:
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
group.add(mesh);
|
|
146
|
+
});
|
|
147
|
+
this.add(group);
|
|
148
|
+
this.loaded = true;
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
setOpacity(value) {
|
|
153
|
+
const { THREE } = Externals.getInstance();
|
|
154
|
+
this.traverse((o) => {
|
|
155
|
+
const m = o;
|
|
156
|
+
if (m.isMesh && m.material instanceof THREE.Material) {
|
|
157
|
+
m.material.opacity = value;
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
setShadowEnabled(value) {
|
|
162
|
+
this.groundMeshes.forEach((m) => {
|
|
163
|
+
// eslint-disable-next-line
|
|
164
|
+
m.receiveShadow = value;
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
update() {
|
|
168
|
+
const frameContext = new ElementFrameContext(this);
|
|
169
|
+
if (!this.initialized && this.loaded) {
|
|
170
|
+
this.initialized = true;
|
|
171
|
+
frameContext.needUpdate = true;
|
|
172
|
+
}
|
|
173
|
+
if (this.initialized && !this.parent) {
|
|
174
|
+
frameContext.shouldPlaceElement = true;
|
|
175
|
+
}
|
|
176
|
+
return frameContext;
|
|
177
|
+
}
|
|
178
|
+
dispose() {
|
|
179
|
+
super.dispose();
|
|
180
|
+
this.groundMeshes = [];
|
|
181
|
+
BasicTools.dispose(this, true);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
export { SvgFloorModel };
|