@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,531 @@
|
|
|
1
|
+
import { Externals } from '../stage/externals';
|
|
2
|
+
import { ElementFrameContext, Element } from './element';
|
|
3
|
+
import { BasicTools } from '../utils/basic-tools';
|
|
4
|
+
import { PathUtils } from '../utils/path-utils';
|
|
5
|
+
import { FloorModel } from './floor-model';
|
|
6
|
+
import { EventHub } from '../utils/event-hub';
|
|
7
|
+
import { OwllyEvents } from '../utils/events';
|
|
8
|
+
/**
|
|
9
|
+
* 路径元素, 渲染路径箭头(暂未引入箭头Mesh)
|
|
10
|
+
* @noInheritDoc
|
|
11
|
+
*/
|
|
12
|
+
class Path extends Element {
|
|
13
|
+
/**
|
|
14
|
+
* @param path 路径
|
|
15
|
+
* @param options 可选参数集
|
|
16
|
+
* @param floorModel FloorModel对象,用于计算地面高度坐标
|
|
17
|
+
* @param groundParams GroundParameters对象,用于计算地面高度坐标
|
|
18
|
+
* @param color 路劲的颜色
|
|
19
|
+
* 当有groundParams时则优先使用它计算,忽略floorModel参数
|
|
20
|
+
*/
|
|
21
|
+
constructor(path, options) {
|
|
22
|
+
super();
|
|
23
|
+
this.modelInitialized = false;
|
|
24
|
+
this.pointMap = new Map();
|
|
25
|
+
this.gradientDistance = 2;
|
|
26
|
+
this.viewDistance = (options || {}).viewDistance || 30;
|
|
27
|
+
// this.gradientDistance = options?.gradientDistance || 2;
|
|
28
|
+
// this.dynamicPathEnabled = options?.dynamicPathEnabled || false;
|
|
29
|
+
// this.jointHintDistance = 10;
|
|
30
|
+
if (path)
|
|
31
|
+
this.load(path, options);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* @param path 路径点二维坐标数组
|
|
36
|
+
* @param params 其它可选参数
|
|
37
|
+
* @param arrowImageRatio 箭头图像的宽高比,用于生成纹理坐标
|
|
38
|
+
* @param arrowImageURL 箭头图像URL
|
|
39
|
+
* @param floorModel FloorModel对象,用于计算地面高度坐标
|
|
40
|
+
* @param groundParams GroundParameters对象,用于计算地面高度坐标
|
|
41
|
+
* @param color 路劲的颜色
|
|
42
|
+
* 当存在groundParams时优先用它计算,忽略floorModel
|
|
43
|
+
*/
|
|
44
|
+
static generatePathMesh(path, params) {
|
|
45
|
+
const { viewDistance = 10, gradientDistance = 2, arrowImageRatio = 1, arrowImageURL, floorModel, groundParams, color, dynamicPathEnabled, width = 0.3, } = params || {};
|
|
46
|
+
// const simplifiedPath = PathUtils.simplify(path, true).map((p) => ({ x: p.x, y: -p.y }));
|
|
47
|
+
const simplifiedPath = PathUtils.simplify(path, true);
|
|
48
|
+
const smoothedPath = PathUtils.smoothPath(simplifiedPath.map((p) => ([p.x, p.y])));
|
|
49
|
+
const centerNormals = [];
|
|
50
|
+
const pathDistance = [0];
|
|
51
|
+
const pathProgress = [0];
|
|
52
|
+
const { THREE } = Externals.getInstance();
|
|
53
|
+
smoothedPath.reduce(([x0, y0], [x1, y1], i) => {
|
|
54
|
+
centerNormals.push(new THREE.Vector2(y0 - y1, x1 - x0).normalize());
|
|
55
|
+
const len = Math.sqrt((Math.pow((x0 - x1), 2)) + (Math.pow((y0 - y1), 2)));
|
|
56
|
+
pathDistance.push(pathDistance[i - 1] + len);
|
|
57
|
+
return [x1, y1];
|
|
58
|
+
});
|
|
59
|
+
for (let i = 0, pathLen = pathDistance.length; i < pathLen; i += 1) {
|
|
60
|
+
pathProgress[i] = pathDistance[i] / pathDistance[pathLen - 1];
|
|
61
|
+
}
|
|
62
|
+
const sideAPath = [];
|
|
63
|
+
const sideBPath = [];
|
|
64
|
+
const halfWidth = width;
|
|
65
|
+
centerNormals.forEach((n, i) => {
|
|
66
|
+
if (i === 0) {
|
|
67
|
+
const [x0, y0] = smoothedPath[0];
|
|
68
|
+
sideAPath.push([x0 + n.x * halfWidth, y0 + n.y * halfWidth]);
|
|
69
|
+
sideBPath.push([x0 - n.x * halfWidth, y0 - n.y * halfWidth]);
|
|
70
|
+
// console.log(`#Path# SideA[${i}]=(${x0 + n.x * halfWidth}, ${y0 + n.y * halfWidth}), SideB[${i}]=(${x0 - n.x * halfWidth}, ${y0 - n.y * halfWidth})`);
|
|
71
|
+
}
|
|
72
|
+
const [x, y] = smoothedPath[i + 1];
|
|
73
|
+
sideAPath.push([x + n.x * halfWidth, y + n.y * halfWidth]);
|
|
74
|
+
sideBPath.push([x - n.x * halfWidth, y - n.y * halfWidth]);
|
|
75
|
+
// console.log(`#Path# SideA[${i}+1]=(${x + n.x * halfWidth}, ${y + n.y * halfWidth}), SideB[${i}+1]=(${x - n.x * halfWidth}, ${y - n.y * halfWidth})`);
|
|
76
|
+
});
|
|
77
|
+
sideBPath.reverse();
|
|
78
|
+
const shape = new THREE.Shape();
|
|
79
|
+
shape.moveTo(...sideAPath[0]);
|
|
80
|
+
sideAPath.forEach((p, i) => {
|
|
81
|
+
if (i === 0)
|
|
82
|
+
return;
|
|
83
|
+
shape.lineTo(...p);
|
|
84
|
+
});
|
|
85
|
+
sideBPath.forEach((p) => {
|
|
86
|
+
shape.lineTo(...p);
|
|
87
|
+
});
|
|
88
|
+
shape.lineTo(...sideAPath[0]);
|
|
89
|
+
const geometry = new THREE.ShapeBufferGeometry(shape);
|
|
90
|
+
const arrowTexcoordScaleT = arrowImageRatio / halfWidth * 0.5;
|
|
91
|
+
let dynamicPath = false;
|
|
92
|
+
if (dynamicPathEnabled) {
|
|
93
|
+
dynamicPath = true;
|
|
94
|
+
}
|
|
95
|
+
const uniforms = {
|
|
96
|
+
// arrowTexture: {
|
|
97
|
+
// value: null,
|
|
98
|
+
// },
|
|
99
|
+
arrowTexcoordScaleT: {
|
|
100
|
+
value: arrowTexcoordScaleT,
|
|
101
|
+
},
|
|
102
|
+
current: { value: 0.0 },
|
|
103
|
+
dynamic: { value: dynamicPath },
|
|
104
|
+
/* eslint-disable @typescript-eslint/camelcase */
|
|
105
|
+
full_length: { value: pathDistance[pathDistance.length - 1] },
|
|
106
|
+
view_distance: { value: viewDistance },
|
|
107
|
+
gradient_distance: { value: gradientDistance },
|
|
108
|
+
};
|
|
109
|
+
if (arrowImageURL) {
|
|
110
|
+
new THREE.TextureLoader().load(arrowImageURL, (texture) => {
|
|
111
|
+
texture.wrapS = THREE.RepeatWrapping;
|
|
112
|
+
texture.wrapT = THREE.RepeatWrapping;
|
|
113
|
+
texture.generateMipmaps = true;
|
|
114
|
+
texture.minFilter = THREE.LinearMipMapLinearFilter;
|
|
115
|
+
texture.magFilter = THREE.LinearMipMapLinearFilter;
|
|
116
|
+
// uniforms.arrowTexture.value = texture;
|
|
117
|
+
if (texture.image && texture.image.width && texture.image.height) {
|
|
118
|
+
uniforms.arrowTexcoordScaleT.value = texture.image.width / texture.image.height / halfWidth * 0.5;
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
const material = new THREE.ShaderMaterial({
|
|
123
|
+
vertexShader: `
|
|
124
|
+
attribute vec3 a_color;
|
|
125
|
+
attribute vec2 a_texcoord;
|
|
126
|
+
attribute float progress;
|
|
127
|
+
varying float vProgress;
|
|
128
|
+
varying vec3 vColor;
|
|
129
|
+
varying vec2 vTexcoord;
|
|
130
|
+
void main() {
|
|
131
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
132
|
+
vProgress = progress;
|
|
133
|
+
vColor = a_color;
|
|
134
|
+
vTexcoord = a_texcoord;
|
|
135
|
+
}
|
|
136
|
+
`,
|
|
137
|
+
fragmentShader: `
|
|
138
|
+
precision mediump float;
|
|
139
|
+
varying float vProgress;
|
|
140
|
+
varying vec3 vColor;
|
|
141
|
+
varying vec2 vTexcoord;
|
|
142
|
+
uniform float current;
|
|
143
|
+
uniform bool dynamic;
|
|
144
|
+
uniform float full_length;
|
|
145
|
+
uniform float view_distance;
|
|
146
|
+
uniform float gradient_distance;
|
|
147
|
+
// uniform sampler2D arrowTexture;
|
|
148
|
+
uniform float arrowTexcoordScaleT;
|
|
149
|
+
float alpha;
|
|
150
|
+
float cur;
|
|
151
|
+
bool dy;
|
|
152
|
+
void main() {
|
|
153
|
+
alpha = 0.8;
|
|
154
|
+
cur = current;
|
|
155
|
+
dy = dynamic;
|
|
156
|
+
if (vProgress < cur) {
|
|
157
|
+
alpha = 0.0;
|
|
158
|
+
} else {
|
|
159
|
+
if (vProgress > cur + view_distance) {
|
|
160
|
+
alpha = 0.0;
|
|
161
|
+
} else {
|
|
162
|
+
if (vProgress > cur + gradient_distance) {
|
|
163
|
+
alpha = 0.8;
|
|
164
|
+
if (cur > full_length - view_distance) {
|
|
165
|
+
cur = full_length - view_distance;
|
|
166
|
+
}
|
|
167
|
+
if (vProgress > cur + view_distance - gradient_distance) {
|
|
168
|
+
alpha = abs(cur + view_distance - vProgress) / gradient_distance * 0.8;
|
|
169
|
+
}
|
|
170
|
+
} else {
|
|
171
|
+
alpha = abs(vProgress - cur) / gradient_distance * 0.8;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// vec4 textureColor = texture2D(arrowTexture, vec2(vTexcoord.s, vTexcoord.t * arrowTexcoordScaleT));
|
|
177
|
+
// gl_FragColor = vec4((1.0 - textureColor.a) * vColor + textureColor.a * textureColor.rgb, 0.8);
|
|
178
|
+
if(dy) {
|
|
179
|
+
gl_FragColor = vec4(vColor,alpha);
|
|
180
|
+
} else {
|
|
181
|
+
gl_FragColor = vec4(vColor,0.8);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
}
|
|
185
|
+
`,
|
|
186
|
+
uniforms,
|
|
187
|
+
side: THREE.DoubleSide,
|
|
188
|
+
depthTest: !dynamicPath,
|
|
189
|
+
});
|
|
190
|
+
let minX = Number.MAX_SAFE_INTEGER;
|
|
191
|
+
let minY = Number.MAX_SAFE_INTEGER;
|
|
192
|
+
const { array, count } = geometry.attributes.position;
|
|
193
|
+
for (let i = 0, j = 0; i < count; i += 1, j += 3) {
|
|
194
|
+
const x = array[j];
|
|
195
|
+
const y = array[j + 1];
|
|
196
|
+
if (array[j] < minX)
|
|
197
|
+
minX = x;
|
|
198
|
+
if (array[j + 1] < minY)
|
|
199
|
+
minY = y;
|
|
200
|
+
}
|
|
201
|
+
// const { index: indices } = geometry;
|
|
202
|
+
if (groundParams && groundParams.groundPlane) {
|
|
203
|
+
for (let i = 0, j = 0; i < count; i += 1, j += 3) {
|
|
204
|
+
const x = array[j];
|
|
205
|
+
const y = array[j + 1];
|
|
206
|
+
let z = 0.5;
|
|
207
|
+
const groundPoint = FloorModel.intersectWithGroundPlane(new THREE.Vector3(x, y, z), groundParams);
|
|
208
|
+
if (groundPoint) {
|
|
209
|
+
z = groundPoint.z + PathUtils.PathMeshOffsetZ;
|
|
210
|
+
}
|
|
211
|
+
array[j + 2] = z;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
const updateZWithFloorModel = () => {
|
|
216
|
+
if (!floorModel || !floorModel.isModelLoaded())
|
|
217
|
+
return;
|
|
218
|
+
for (let i = 0, j = 0; i < count; i += 1, j += 3) {
|
|
219
|
+
const x = array[j];
|
|
220
|
+
const y = array[j + 1];
|
|
221
|
+
let z = 0.5;
|
|
222
|
+
const groundPoint = floorModel.intersectGround(new THREE.Vector3(x, y, z));
|
|
223
|
+
// console.info('#PathArrow# groundPoint:', groundPoint);
|
|
224
|
+
if (groundPoint) {
|
|
225
|
+
z = groundPoint.z + PathUtils.PathMeshOffsetZ;
|
|
226
|
+
}
|
|
227
|
+
array[j + 2] = z;
|
|
228
|
+
}
|
|
229
|
+
geometry.attributes.position.needsUpdate = true;
|
|
230
|
+
};
|
|
231
|
+
if (floorModel && floorModel.isModelLoaded()) {
|
|
232
|
+
updateZWithFloorModel();
|
|
233
|
+
}
|
|
234
|
+
EventHub.on(OwllyEvents.ELEMENT_LOADED, (element) => {
|
|
235
|
+
if (!(element instanceof FloorModel))
|
|
236
|
+
return;
|
|
237
|
+
if (element !== floorModel)
|
|
238
|
+
return;
|
|
239
|
+
updateZWithFloorModel();
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
geometry.attributes.position.needsUpdate = true;
|
|
243
|
+
// TODO(jyfang): arrow meshes not needed now
|
|
244
|
+
const arrowMeshes = [];
|
|
245
|
+
if (arrowImageURL) {
|
|
246
|
+
const geom = new THREE.PlaneBufferGeometry(0.5 * halfWidth / 0.3, 0.5 * halfWidth / 0.3);
|
|
247
|
+
const materialTop = new THREE.MeshBasicMaterial({
|
|
248
|
+
color: 0xFFFFFF,
|
|
249
|
+
transparent: true,
|
|
250
|
+
opacity: 0.8,
|
|
251
|
+
blending: THREE.NormalBlending,
|
|
252
|
+
side: THREE.DoubleSide,
|
|
253
|
+
depthTest: !dynamicPath,
|
|
254
|
+
});
|
|
255
|
+
const texture = new THREE.TextureLoader().load(arrowImageURL);
|
|
256
|
+
texture.needsUpdate = true;
|
|
257
|
+
materialTop.needsUpdate = true;
|
|
258
|
+
materialTop.map = texture;
|
|
259
|
+
const baseArrowMesh = new THREE.Mesh(geom, materialTop);
|
|
260
|
+
for (let i = 0, threshold = 0.8, pathLen = smoothedPath.length; i < pathLen; i += 1) {
|
|
261
|
+
if (pathDistance[i] > threshold) {
|
|
262
|
+
threshold += 0.8;
|
|
263
|
+
const [x, y] = smoothedPath[i];
|
|
264
|
+
const { x: nx, y: ny } = centerNormals[i === pathLen - 1 ? i - 1 : i];
|
|
265
|
+
const newMesh = baseArrowMesh.clone();
|
|
266
|
+
newMesh.position.set(x, y, -0.5);
|
|
267
|
+
if (groundParams) {
|
|
268
|
+
const floorPos = FloorModel.intersectWithGroundPlane(new THREE.Vector3(x, y, 2), groundParams);
|
|
269
|
+
if (floorPos) {
|
|
270
|
+
floorPos.z += PathUtils.ArrowMeshOffsetZ;
|
|
271
|
+
newMesh.position.copy(floorPos);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
else if (floorModel) {
|
|
275
|
+
const floorPos = floorModel.intersectGround(new THREE.Vector3(x, y, 2));
|
|
276
|
+
if (floorPos) {
|
|
277
|
+
floorPos.z += PathUtils.ArrowMeshOffsetZ;
|
|
278
|
+
newMesh.position.copy(floorPos);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
newMesh.material = materialTop.clone();
|
|
282
|
+
newMesh.rotateZ(new THREE.Vector2(ny, -nx).angle() - 0.5 * Math.PI);
|
|
283
|
+
arrowMeshes.push({ arrowMesh: newMesh, index: i });
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
const pathMinX = Math.floor(minX);
|
|
288
|
+
const pathMinY = Math.floor(minY);
|
|
289
|
+
const pointMap = new Map();
|
|
290
|
+
smoothedPath.forEach(([x, y], i) => {
|
|
291
|
+
const [row, col] = PathUtils.getPointHash(x, y, pathMinX, pathMinY, 25);
|
|
292
|
+
if (!pointMap.has(`${row}`))
|
|
293
|
+
pointMap.set(`${row}`, new Map());
|
|
294
|
+
const mapRow = pointMap.get(`${row}`);
|
|
295
|
+
if (!mapRow.has(`${col}`))
|
|
296
|
+
mapRow.set(`${col}`, []);
|
|
297
|
+
mapRow.get(`${col}`).push([i, x, y]);
|
|
298
|
+
});
|
|
299
|
+
// TODO(jyfang): no floating arrows right now.
|
|
300
|
+
// const floatingArrows = [];
|
|
301
|
+
// let lastTurnIndex = 0;
|
|
302
|
+
// for (let i = 0; i < simplifiedPath.length - 2; i += 1) {
|
|
303
|
+
// const p0 = simplifiedPath[i];
|
|
304
|
+
// const p1 = simplifiedPath[i + 1];
|
|
305
|
+
// const p2 = simplifiedPath[i + 2];
|
|
306
|
+
// const v0 = new Vector2(p0.x - p1.x, p0.y - p1.y);
|
|
307
|
+
// const v1 = new Vector2(p2.x - p1.x, p2.y - p1.y);
|
|
308
|
+
// const deg = NavigationPath.getAngle(v0, v1) / Math.PI * 180;
|
|
309
|
+
// if (deg < 135) {
|
|
310
|
+
// const newMesh = this.baseFloatingArrowMesh.clone();
|
|
311
|
+
// newMesh.position.setX(p1.x);
|
|
312
|
+
// newMesh.position.setY(p1.y);
|
|
313
|
+
// newMesh.material = this.baseFloatingArrowMesh.material.clone();
|
|
314
|
+
// newMesh.up.set(0, 0, 1);
|
|
315
|
+
// newMesh.rotateZ(Math.PI + v1.angle());
|
|
316
|
+
// newMesh.rotateX(Math.PI / 2);
|
|
317
|
+
// newMesh.renderOrder = 250;
|
|
318
|
+
// newMesh.scale.set(2, 2, 2);
|
|
319
|
+
// const pathPointIndex = NavigationPath.findNeareastPathPoint(
|
|
320
|
+
// p1.x, p1.y, pathMinX, pathMinY, pointMap, true,
|
|
321
|
+
// );
|
|
322
|
+
// if (pathDistance[pathPointIndex] - pathDistance[lastTurnIndex] > this.jointHintDistance) {
|
|
323
|
+
// floatingArrows.push({ mesh: newMesh, index: pathPointIndex });
|
|
324
|
+
// lastTurnIndex = pathPointIndex;
|
|
325
|
+
// }
|
|
326
|
+
// }
|
|
327
|
+
// }
|
|
328
|
+
const progressBuffer = new Float32Array(count);
|
|
329
|
+
const colorBuffer = new Float32Array(count * 3);
|
|
330
|
+
// rgb(255, 140, 0) rgb(240, 68, 55)
|
|
331
|
+
/* eslint-disable */
|
|
332
|
+
let rs = 1.0, gs = 140 / 255, bs = 0;
|
|
333
|
+
let rd = 240 / 255, gd = 68 / 255, bd = 55 / 255;
|
|
334
|
+
if (color) {
|
|
335
|
+
const colorChange = [];
|
|
336
|
+
for (let i = 2; i < 8; i += 2) {
|
|
337
|
+
colorChange.push(parseInt(`0x${color.slice(i, i + 2)}`));
|
|
338
|
+
}
|
|
339
|
+
rs = colorChange[0] / 255, gs = colorChange[1] / 255, bs = colorChange[2] / 255;
|
|
340
|
+
rd = colorChange[0] / 255, gd = colorChange[1] / 255, bd = colorChange[2] / 255;
|
|
341
|
+
}
|
|
342
|
+
const rdiff = rd - rs, gdiff = gd - gs, bdiff = bd - bs;
|
|
343
|
+
/* eslint-enable */
|
|
344
|
+
for (let i = 0, j = 0; i < count; i += 1, j += 3) {
|
|
345
|
+
const px = array[j];
|
|
346
|
+
const py = array[j + 1];
|
|
347
|
+
const [row, col] = PathUtils.getPointHash(px, py, pathMinX, pathMinY, 25);
|
|
348
|
+
let dist = Number.MAX_SAFE_INTEGER;
|
|
349
|
+
if (pointMap.has(`${row}`)
|
|
350
|
+
&& pointMap.get(`${row}`).has(`${col}`)) {
|
|
351
|
+
pointMap.get(`${row}`).get(`${col}`).forEach(([index, x, y]) => {
|
|
352
|
+
const d2 = (Math.pow((px - x), 2)) + (Math.pow((py - y), 2));
|
|
353
|
+
if (d2 > dist)
|
|
354
|
+
return;
|
|
355
|
+
dist = d2;
|
|
356
|
+
const l = pathDistance[index];
|
|
357
|
+
const p = pathProgress[index];
|
|
358
|
+
progressBuffer[i] = l;
|
|
359
|
+
colorBuffer[i * 3] = rs + p * rdiff;
|
|
360
|
+
colorBuffer[i * 3 + 1] = gs + p * gdiff;
|
|
361
|
+
colorBuffer[i * 3 + 2] = bs + p * bdiff;
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
// const texcoordBuffer = new Float32Array(count * 2);
|
|
366
|
+
// let x0 = (array[0] + array[(count - 1) * 3]) / 2;
|
|
367
|
+
// let y0 = (array[1] + array[(count - 1) * 3 + 1]) / 2;
|
|
368
|
+
// let totalDistance = 0;
|
|
369
|
+
// for (let i = 0; i < count / 2; i += 1) {
|
|
370
|
+
// const x1 = (array[i * 3] + array[(count - 1 - i) * 3]) / 2;
|
|
371
|
+
// const y1 = (array[i * 3 + 1] + array[(count - 1 - i) * 3 + 1]) / 2;
|
|
372
|
+
// totalDistance += Math.sqrt((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0));
|
|
373
|
+
// x0 = x1;
|
|
374
|
+
// y0 = y1;
|
|
375
|
+
// texcoordBuffer[i * 2] = 0.0;
|
|
376
|
+
// texcoordBuffer[(count - 1 - i) * 2] = 1.0;
|
|
377
|
+
// if (i === count / 2 - 1) {
|
|
378
|
+
// texcoordBuffer[i * 2 + 1] = totalDistance;
|
|
379
|
+
// texcoordBuffer[(count - 1 - i) * 2 + 1] = totalDistance;
|
|
380
|
+
// } else {
|
|
381
|
+
// const vAB = new Vector2(
|
|
382
|
+
// array[(count - 1 - i) * 3] - array[i * 3],
|
|
383
|
+
// array[(count - 1 - i) * 3 + 1] - array[i * 3 + 1],
|
|
384
|
+
// );
|
|
385
|
+
// const crossProduct = vAB.cross(centerNormals[i]);
|
|
386
|
+
// const offset = crossProduct / 2;
|
|
387
|
+
// texcoordBuffer[i * 2 + 1] = totalDistance - offset;
|
|
388
|
+
// texcoordBuffer[(count - 1 - i) * 2 + 1] = totalDistance + offset;
|
|
389
|
+
// }
|
|
390
|
+
// // if (i % 2 === 0) {
|
|
391
|
+
// // texcoordBuffer[i * 2 + 1] = 0.0;
|
|
392
|
+
// // texcoordBuffer[(count - 1 - i) * 2 + 1] = 0.0;
|
|
393
|
+
// // } else {
|
|
394
|
+
// // texcoordBuffer[i * 2 + 1] = 1.0;
|
|
395
|
+
// // texcoordBuffer[(count - 1 - i) * 2 + 1] = 1.0;
|
|
396
|
+
// // }
|
|
397
|
+
// }
|
|
398
|
+
// geometry.addAttribute('a_texcoord', new BufferAttribute(texcoordBuffer, 2));
|
|
399
|
+
geometry.addAttribute('progress', new THREE.BufferAttribute(progressBuffer, 1));
|
|
400
|
+
geometry.addAttribute('a_color', new THREE.BufferAttribute(colorBuffer, 3));
|
|
401
|
+
material.transparent = true;
|
|
402
|
+
const mesh = new THREE.Mesh(geometry, material);
|
|
403
|
+
return {
|
|
404
|
+
mesh,
|
|
405
|
+
arrowMeshes,
|
|
406
|
+
newPath: smoothedPath,
|
|
407
|
+
pointMap,
|
|
408
|
+
pathMinX,
|
|
409
|
+
pathMinY,
|
|
410
|
+
progressBuffer,
|
|
411
|
+
pathDistance,
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* 载入路径
|
|
416
|
+
* @param path 路径
|
|
417
|
+
*/
|
|
418
|
+
load(path, options) {
|
|
419
|
+
const { groundParams, floorModel, arrowImageURL, color, dynamicPathEnabled, // / = 'imgs/arrow.png',
|
|
420
|
+
width, viewDistance, } = options || {};
|
|
421
|
+
const { mesh, arrowMeshes,
|
|
422
|
+
// newPath,
|
|
423
|
+
pathMinX, pathMinY, pointMap, pathDistance, } = Path.generatePathMesh(path, {
|
|
424
|
+
groundParams,
|
|
425
|
+
floorModel,
|
|
426
|
+
arrowImageURL,
|
|
427
|
+
color,
|
|
428
|
+
dynamicPathEnabled,
|
|
429
|
+
width,
|
|
430
|
+
viewDistance,
|
|
431
|
+
});
|
|
432
|
+
this.pathMesh = mesh;
|
|
433
|
+
this.pathMesh.up.set(0, 0, 1);
|
|
434
|
+
this.pathMesh.renderOrder = 200;
|
|
435
|
+
this.add(this.pathMesh);
|
|
436
|
+
this.arrowMeshes = [];
|
|
437
|
+
this.pathArrowMeshes = arrowMeshes;
|
|
438
|
+
arrowMeshes.forEach(({ arrowMesh }) => {
|
|
439
|
+
arrowMesh.renderOrder = 201;
|
|
440
|
+
this.arrowMeshes.push(arrowMesh);
|
|
441
|
+
this.add(arrowMesh);
|
|
442
|
+
});
|
|
443
|
+
// this.path = newPath;
|
|
444
|
+
this.pathMinX = pathMinX;
|
|
445
|
+
this.pathMinY = pathMinY;
|
|
446
|
+
this.pointMap = pointMap;
|
|
447
|
+
this.pathDistance = pathDistance;
|
|
448
|
+
this.modelInitialized = true;
|
|
449
|
+
}
|
|
450
|
+
/** @ignore */
|
|
451
|
+
update() {
|
|
452
|
+
const frameContext = new ElementFrameContext(this);
|
|
453
|
+
if (this.modelInitialized) {
|
|
454
|
+
this.modelInitialized = false;
|
|
455
|
+
frameContext.needUpdate = true;
|
|
456
|
+
}
|
|
457
|
+
const { THREE } = Externals.getInstance();
|
|
458
|
+
// TODO(jyfang): dynamic path
|
|
459
|
+
if (this.dynamicPathEnabled && this.pathMesh && this.bindedCamera) {
|
|
460
|
+
const { position: { x: cameraX, y: cameraY } } = this.bindedCamera;
|
|
461
|
+
const [row, col] = PathUtils.getPointHash(cameraX, cameraY, this.pathMinX, this.pathMinY, 25);
|
|
462
|
+
let dist = Number.MAX_SAFE_INTEGER;
|
|
463
|
+
let currentProgress = 0;
|
|
464
|
+
if (this.pointMap.get(`${row}`)) {
|
|
465
|
+
const mapRow = this.pointMap.get(`${row}`).get(`${col}`);
|
|
466
|
+
if (this.pointMap.get(`${row}`) && mapRow) {
|
|
467
|
+
// console.log(mapRow, this.viewDistance, this.position, [row, col], this.pathDistance, this.pointMap);
|
|
468
|
+
mapRow.forEach(([index, x, y]) => {
|
|
469
|
+
const d2 = (Math.pow((cameraX - x), 2)) + (Math.pow((cameraY - y), 2));
|
|
470
|
+
if (d2 > dist)
|
|
471
|
+
return;
|
|
472
|
+
dist = d2;
|
|
473
|
+
currentProgress = this.pathDistance[index];
|
|
474
|
+
});
|
|
475
|
+
const fullLength = this.pathDistance[this.pathDistance.length - 1];
|
|
476
|
+
if (currentProgress < 5)
|
|
477
|
+
currentProgress = 0;
|
|
478
|
+
this.pathArrowMeshes.forEach(({ arrowMesh: m, index: pathIndex }) => {
|
|
479
|
+
const prog = this.pathDistance[pathIndex];
|
|
480
|
+
let cur = currentProgress;
|
|
481
|
+
if (m.isMesh && m.material instanceof THREE.Material) {
|
|
482
|
+
m.material.opacity = 0;
|
|
483
|
+
}
|
|
484
|
+
if (prog > cur && prog < cur + this.viewDistance) {
|
|
485
|
+
if (m.isMesh && m.material instanceof THREE.Material) {
|
|
486
|
+
m.material.opacity = 0.8;
|
|
487
|
+
}
|
|
488
|
+
if (prog < cur + this.gradientDistance) {
|
|
489
|
+
if (m.isMesh && m.material instanceof THREE.Material) {
|
|
490
|
+
m.material.opacity = Math.abs(prog - cur) / this.gradientDistance * 0.8;
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
else {
|
|
494
|
+
if (cur > fullLength - this.viewDistance) {
|
|
495
|
+
cur = fullLength - this.viewDistance;
|
|
496
|
+
}
|
|
497
|
+
if (prog > cur + this.viewDistance - this.gradientDistance) {
|
|
498
|
+
if (m.isMesh && m.material instanceof THREE.Material) {
|
|
499
|
+
m.material.opacity = Math.abs(cur + this.viewDistance - prog)
|
|
500
|
+
/ this.gradientDistance * 0.8;
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
if (m.isMesh && m.material instanceof THREE.Material) {
|
|
506
|
+
m.material.needsUpdate = true;
|
|
507
|
+
}
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
if (this.pathMesh.material instanceof THREE.ShaderMaterial) {
|
|
511
|
+
this.pathMesh.material.uniforms.current.value = currentProgress;
|
|
512
|
+
this.pathMesh.material.needsUpdate = true;
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
if (this.modelInitialized && !this.parent) {
|
|
517
|
+
frameContext.shouldPlaceElement = true;
|
|
518
|
+
}
|
|
519
|
+
return frameContext;
|
|
520
|
+
}
|
|
521
|
+
dispose() {
|
|
522
|
+
super.dispose();
|
|
523
|
+
BasicTools.dispose(this, true);
|
|
524
|
+
}
|
|
525
|
+
setPathSettings(camera, viewDistance, dynamicPathEnabled) {
|
|
526
|
+
this.bindedCamera = camera;
|
|
527
|
+
this.viewDistance = viewDistance;
|
|
528
|
+
this.dynamicPathEnabled = dynamicPathEnabled;
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
export { Path };
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { NS_THREE } from '../stage/externals';
|
|
2
|
+
import { Element, ElementFrameContext } from './element';
|
|
3
|
+
import { View } from '../view/view';
|
|
4
|
+
/**
|
|
5
|
+
* @param targetView 指定的View
|
|
6
|
+
* @param faceToCamera 是否始终朝向摄像机,即公告牌模式。默认为true
|
|
7
|
+
* @param keepZOnFaceToCamera 是否保持Z轴垂直于地面
|
|
8
|
+
* @param visibilities 全景图pid与可见性对应关系的数组
|
|
9
|
+
* 其中如果有某个元素的pid为-1,表示其对应的visible属性会应用到所有未特别设置的全景点上
|
|
10
|
+
* @param positions 全景图pid与位置对应关系的数组
|
|
11
|
+
* 其中如果有某个元素的pid为-1,表示其对应的position属性会应用到所有未特别设置的全景点上
|
|
12
|
+
*/
|
|
13
|
+
interface Placeable2DViewConfiguration {
|
|
14
|
+
targetView: View;
|
|
15
|
+
visibilities?: {
|
|
16
|
+
pid: number;
|
|
17
|
+
visible: boolean;
|
|
18
|
+
}[];
|
|
19
|
+
positions?: {
|
|
20
|
+
pid: number;
|
|
21
|
+
position: NS_THREE.Vector3;
|
|
22
|
+
}[];
|
|
23
|
+
faceToCamera?: boolean;
|
|
24
|
+
keepZOnFaceToCamera?: boolean;
|
|
25
|
+
showMesh?: boolean;
|
|
26
|
+
showDom?: boolean;
|
|
27
|
+
visibleScope?: number;
|
|
28
|
+
}
|
|
29
|
+
interface Placeable2DViewConfigurationInternal {
|
|
30
|
+
targetView: View;
|
|
31
|
+
visibilities?: Map<number, boolean>;
|
|
32
|
+
positions?: Map<number, NS_THREE.Vector3>;
|
|
33
|
+
faceToCamera?: boolean;
|
|
34
|
+
keepZOnFaceToCamera?: boolean;
|
|
35
|
+
showMesh?: boolean;
|
|
36
|
+
showDom?: boolean;
|
|
37
|
+
visibleScope?: number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* 2D贴图对象
|
|
41
|
+
* @noInheritDoc
|
|
42
|
+
*/
|
|
43
|
+
declare class Placeable2D extends Element {
|
|
44
|
+
private initialized;
|
|
45
|
+
private needUpdate;
|
|
46
|
+
private material;
|
|
47
|
+
private uniforms;
|
|
48
|
+
private labelMesh;
|
|
49
|
+
private gif;
|
|
50
|
+
private gifLabelMesh;
|
|
51
|
+
private currentDisplayTime;
|
|
52
|
+
private frameIndex;
|
|
53
|
+
private gifMaterial;
|
|
54
|
+
private frames;
|
|
55
|
+
private tileDispDuration;
|
|
56
|
+
private gifCanvas;
|
|
57
|
+
private gifContext;
|
|
58
|
+
private giftexture;
|
|
59
|
+
private width;
|
|
60
|
+
private height;
|
|
61
|
+
labelID: number;
|
|
62
|
+
viewConfigurations: Map<View, Placeable2DViewConfigurationInternal>;
|
|
63
|
+
private eventListeners;
|
|
64
|
+
private currentPID;
|
|
65
|
+
private isEditingInView;
|
|
66
|
+
private movedToNewPanorama;
|
|
67
|
+
private cssObject;
|
|
68
|
+
private imgElement;
|
|
69
|
+
private outOfRange;
|
|
70
|
+
private currentPanoramaPosition;
|
|
71
|
+
isDomElement: boolean;
|
|
72
|
+
private hidden;
|
|
73
|
+
private depthTest;
|
|
74
|
+
/**
|
|
75
|
+
* 注意:最好在[PanoramaController]初始化视角之前就添加好,否则会漏掉初始所在全景图的[MOVE_TO_PANORAMA]事件通知
|
|
76
|
+
* @param labelID 唯一ID
|
|
77
|
+
* @param url 图片地址
|
|
78
|
+
* @param options 可选参数,如矩形宽高
|
|
79
|
+
* @example
|
|
80
|
+
* ```typescript
|
|
81
|
+
* const placeable = new Placeable2D(1, url,
|
|
82
|
+
* {
|
|
83
|
+
* width: 0.3,
|
|
84
|
+
* height: 0.3,
|
|
85
|
+
* });
|
|
86
|
+
* stage.bindElement(placeable);
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
constructor(labelID: number, url: string, options?: {
|
|
90
|
+
width?: number;
|
|
91
|
+
height?: number;
|
|
92
|
+
depthTest?: boolean;
|
|
93
|
+
});
|
|
94
|
+
load(url: string): Promise<void>;
|
|
95
|
+
private drawCanvas;
|
|
96
|
+
update(): ElementFrameContext;
|
|
97
|
+
dispose(): void;
|
|
98
|
+
/**
|
|
99
|
+
* 设置在指定View中的显示配置参数
|
|
100
|
+
* @param configuration 显示配置对象
|
|
101
|
+
* @example
|
|
102
|
+
* ```typescript
|
|
103
|
+
* label2D.addViewConfiguration({
|
|
104
|
+
* targetView: view,
|
|
105
|
+
* positions: [
|
|
106
|
+
* { pid: 6, position: labelPosition3 },
|
|
107
|
+
* { pid: 3, position: labelPosition6 },
|
|
108
|
+
* ],
|
|
109
|
+
* visibilities: [{ pid: -1, visible: false }],
|
|
110
|
+
* faceToCamera: true,
|
|
111
|
+
* });
|
|
112
|
+
* ```
|
|
113
|
+
*/
|
|
114
|
+
addViewConfiguration(configuration: Placeable2DViewConfiguration): void;
|
|
115
|
+
/**
|
|
116
|
+
* 设置当前标签是否处于编辑模式
|
|
117
|
+
* @param editingMode 是否设置为编辑模式
|
|
118
|
+
*/
|
|
119
|
+
setEditingMode(targetView: View, editingMode: boolean): void;
|
|
120
|
+
isEditing(targetView: View): boolean;
|
|
121
|
+
/**
|
|
122
|
+
* 设置标签尺寸
|
|
123
|
+
* @param width 宽度
|
|
124
|
+
* @param height 高度
|
|
125
|
+
*/
|
|
126
|
+
setSize(width: number, height: number): void;
|
|
127
|
+
/**
|
|
128
|
+
* 查询当前设置的标签尺寸
|
|
129
|
+
* @returns number数组,依次是width, height
|
|
130
|
+
*/
|
|
131
|
+
getSize(): number[];
|
|
132
|
+
/**
|
|
133
|
+
* 设置imgElement Css
|
|
134
|
+
* @param cssText string
|
|
135
|
+
* @param width 宽
|
|
136
|
+
* @param height 高
|
|
137
|
+
*/
|
|
138
|
+
setDomCSS(width: number, height: number, cssText?: string): void;
|
|
139
|
+
getViewConfigurationByPanoramaId(view: View, pid: number): {
|
|
140
|
+
visible: boolean;
|
|
141
|
+
position: NS_THREE.Vector3;
|
|
142
|
+
};
|
|
143
|
+
updateViewConfigurationByPanoramaId(view: View, pid: number, { visible, position }: {
|
|
144
|
+
visible?: boolean;
|
|
145
|
+
position?: NS_THREE.Vector3;
|
|
146
|
+
}): void;
|
|
147
|
+
/**
|
|
148
|
+
* 手动更新Placeable2D当前所在全景点位
|
|
149
|
+
* @param pid 点位id
|
|
150
|
+
* @param position 全景点位坐标
|
|
151
|
+
*/
|
|
152
|
+
updateCurrentBindingPanorama(pid: number, position: NS_THREE.Vector3): void;
|
|
153
|
+
/**
|
|
154
|
+
* 将Placeable2D设置为不可见
|
|
155
|
+
*/
|
|
156
|
+
setHidden(hidden: boolean): void;
|
|
157
|
+
}
|
|
158
|
+
export { Placeable2D, Placeable2DViewConfiguration };
|