@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,9 @@
|
|
|
1
|
+
import { LineSegmentsGeometry } from './line-segments-geometry';
|
|
2
|
+
declare class LineGeometry extends LineSegmentsGeometry {
|
|
3
|
+
isLineGeometry: true;
|
|
4
|
+
constructor();
|
|
5
|
+
setPositions(array: any[]): any;
|
|
6
|
+
setColors(array: any[]): any;
|
|
7
|
+
fromLine(line: any): any;
|
|
8
|
+
}
|
|
9
|
+
export { LineGeometry };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/* eslint-disable max-len, no-continue, @typescript-eslint/no-explicit-any, no-underscore-dangle, func-names, @typescript-eslint/no-this-alias, no-console, consistent-return, no-param-reassign, no-shadow */
|
|
2
|
+
import { LineSegmentsGeometry } from './line-segments-geometry';
|
|
3
|
+
class LineGeometry extends LineSegmentsGeometry {
|
|
4
|
+
constructor() {
|
|
5
|
+
super();
|
|
6
|
+
this.type = 'LineGeometry';
|
|
7
|
+
}
|
|
8
|
+
setPositions(array) {
|
|
9
|
+
// converts [ x1, y1, z1, x2, y2, z2, ... ] to pairs format
|
|
10
|
+
const length = array.length - 3;
|
|
11
|
+
const points = new Float32Array(2 * length);
|
|
12
|
+
for (let i = 0; i < length; i += 3) {
|
|
13
|
+
points[2 * i] = array[i];
|
|
14
|
+
points[2 * i + 1] = array[i + 1];
|
|
15
|
+
points[2 * i + 2] = array[i + 2];
|
|
16
|
+
points[2 * i + 3] = array[i + 3];
|
|
17
|
+
points[2 * i + 4] = array[i + 4];
|
|
18
|
+
points[2 * i + 5] = array[i + 5];
|
|
19
|
+
}
|
|
20
|
+
super.setPositions(points);
|
|
21
|
+
return this;
|
|
22
|
+
}
|
|
23
|
+
setColors(array) {
|
|
24
|
+
// converts [ r1, g1, b1, r2, g2, b2, ... ] to pairs format
|
|
25
|
+
const length = array.length - 3;
|
|
26
|
+
const colors = new Float32Array(2 * length);
|
|
27
|
+
for (let i = 0; i < length; i += 3) {
|
|
28
|
+
colors[2 * i] = array[i];
|
|
29
|
+
colors[2 * i + 1] = array[i + 1];
|
|
30
|
+
colors[2 * i + 2] = array[i + 2];
|
|
31
|
+
colors[2 * i + 3] = array[i + 3];
|
|
32
|
+
colors[2 * i + 4] = array[i + 4];
|
|
33
|
+
colors[2 * i + 5] = array[i + 5];
|
|
34
|
+
}
|
|
35
|
+
super.setColors(colors);
|
|
36
|
+
return this;
|
|
37
|
+
}
|
|
38
|
+
fromLine(line) {
|
|
39
|
+
const { geometry } = line;
|
|
40
|
+
if (geometry.isGeometry) {
|
|
41
|
+
console.error('THREE.LineGeometry no longer supports Geometry. Use THREE.BufferGeometry instead.');
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (geometry.isBufferGeometry) {
|
|
45
|
+
this.setPositions(geometry.attributes.position.array); // assumes non-indexed
|
|
46
|
+
}
|
|
47
|
+
// set colors, maybe
|
|
48
|
+
return this;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
export { LineGeometry };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NS_THREE } from '../../owlly/stage/externals';
|
|
2
|
+
declare class LineMaterial extends NS_THREE.ShaderMaterial {
|
|
3
|
+
isLineMaterial: boolean;
|
|
4
|
+
dashed: boolean;
|
|
5
|
+
resolution: any;
|
|
6
|
+
linewidth: any;
|
|
7
|
+
color: any;
|
|
8
|
+
constructor(parameters: any);
|
|
9
|
+
}
|
|
10
|
+
export { LineMaterial };
|
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
/* eslint-disable max-len, no-continue, @typescript-eslint/no-explicit-any, no-underscore-dangle, func-names, @typescript-eslint/no-this-alias, no-console, consistent-return, no-param-reassign */
|
|
2
|
+
import { Externals, NS_THREE } from '../../owlly/stage/externals';
|
|
3
|
+
function getUniformsLibLine() {
|
|
4
|
+
const { THREE } = Externals.getInstance();
|
|
5
|
+
return {
|
|
6
|
+
linewidth: { value: 1 },
|
|
7
|
+
resolution: { value: new THREE.Vector2(1, 1) },
|
|
8
|
+
dashScale: { value: 1 },
|
|
9
|
+
dashSize: { value: 1 },
|
|
10
|
+
dashOffset: { value: 0 },
|
|
11
|
+
gapSize: { value: 1 },
|
|
12
|
+
opacity: { value: 1 },
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function getShaderLibLine() {
|
|
16
|
+
const { THREE } = Externals.getInstance();
|
|
17
|
+
return {
|
|
18
|
+
uniforms: THREE.UniformsUtils.merge([
|
|
19
|
+
THREE.UniformsLib.common,
|
|
20
|
+
THREE.UniformsLib.fog,
|
|
21
|
+
getUniformsLibLine(),
|
|
22
|
+
]),
|
|
23
|
+
vertexShader: `
|
|
24
|
+
#include <common>
|
|
25
|
+
#include <color_pars_vertex>
|
|
26
|
+
#include <fog_pars_vertex>
|
|
27
|
+
#include <logdepthbuf_pars_vertex>
|
|
28
|
+
#include <clipping_planes_pars_vertex>
|
|
29
|
+
|
|
30
|
+
uniform float linewidth;
|
|
31
|
+
uniform vec2 resolution;
|
|
32
|
+
|
|
33
|
+
attribute vec3 instanceStart;
|
|
34
|
+
attribute vec3 instanceEnd;
|
|
35
|
+
|
|
36
|
+
attribute vec3 instanceColorStart;
|
|
37
|
+
attribute vec3 instanceColorEnd;
|
|
38
|
+
|
|
39
|
+
varying vec2 vUv;
|
|
40
|
+
|
|
41
|
+
#ifdef USE_DASH
|
|
42
|
+
|
|
43
|
+
uniform float dashScale;
|
|
44
|
+
attribute float instanceDistanceStart;
|
|
45
|
+
attribute float instanceDistanceEnd;
|
|
46
|
+
varying float vLineDistance;
|
|
47
|
+
|
|
48
|
+
#endif
|
|
49
|
+
|
|
50
|
+
void trimSegment( const in vec4 start, inout vec4 end ) {
|
|
51
|
+
|
|
52
|
+
// trim end segment so it terminates between the camera plane and the near plane
|
|
53
|
+
|
|
54
|
+
// conservative estimate of the near plane
|
|
55
|
+
float a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column
|
|
56
|
+
float b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column
|
|
57
|
+
float nearEstimate = - 0.5 * b / a;
|
|
58
|
+
|
|
59
|
+
float alpha = ( nearEstimate - start.z ) / ( end.z - start.z );
|
|
60
|
+
|
|
61
|
+
end.xyz = mix( start.xyz, end.xyz, alpha );
|
|
62
|
+
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
void main() {
|
|
66
|
+
|
|
67
|
+
#ifdef USE_COLOR
|
|
68
|
+
|
|
69
|
+
vColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;
|
|
70
|
+
|
|
71
|
+
#endif
|
|
72
|
+
|
|
73
|
+
#ifdef USE_DASH
|
|
74
|
+
|
|
75
|
+
vLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;
|
|
76
|
+
|
|
77
|
+
#endif
|
|
78
|
+
|
|
79
|
+
float aspect = resolution.x / resolution.y;
|
|
80
|
+
|
|
81
|
+
vUv = uv;
|
|
82
|
+
|
|
83
|
+
// camera space
|
|
84
|
+
vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );
|
|
85
|
+
vec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );
|
|
86
|
+
|
|
87
|
+
// special case for perspective projection, and segments that terminate either in, or behind, the camera plane
|
|
88
|
+
// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space
|
|
89
|
+
// but we need to perform ndc-space calculations in the shader, so we must address this issue directly
|
|
90
|
+
// perhaps there is a more elegant solution -- WestLangley
|
|
91
|
+
|
|
92
|
+
bool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column
|
|
93
|
+
|
|
94
|
+
if ( perspective ) {
|
|
95
|
+
|
|
96
|
+
if ( start.z < 0.0 && end.z >= 0.0 ) {
|
|
97
|
+
|
|
98
|
+
trimSegment( start, end );
|
|
99
|
+
|
|
100
|
+
} else if ( end.z < 0.0 && start.z >= 0.0 ) {
|
|
101
|
+
|
|
102
|
+
trimSegment( end, start );
|
|
103
|
+
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// clip space
|
|
109
|
+
vec4 clipStart = projectionMatrix * start;
|
|
110
|
+
vec4 clipEnd = projectionMatrix * end;
|
|
111
|
+
|
|
112
|
+
// ndc space
|
|
113
|
+
vec2 ndcStart = clipStart.xy / clipStart.w;
|
|
114
|
+
vec2 ndcEnd = clipEnd.xy / clipEnd.w;
|
|
115
|
+
|
|
116
|
+
// direction
|
|
117
|
+
vec2 dir = ndcEnd - ndcStart;
|
|
118
|
+
|
|
119
|
+
// account for clip-space aspect ratio
|
|
120
|
+
dir.x *= aspect;
|
|
121
|
+
dir = normalize( dir );
|
|
122
|
+
|
|
123
|
+
// perpendicular to dir
|
|
124
|
+
vec2 offset = vec2( dir.y, - dir.x );
|
|
125
|
+
|
|
126
|
+
// undo aspect ratio adjustment
|
|
127
|
+
dir.x /= aspect;
|
|
128
|
+
offset.x /= aspect;
|
|
129
|
+
|
|
130
|
+
// sign flip
|
|
131
|
+
if ( position.x < 0.0 ) offset *= - 1.0;
|
|
132
|
+
|
|
133
|
+
// endcaps
|
|
134
|
+
if ( position.y < 0.0 ) {
|
|
135
|
+
|
|
136
|
+
offset += - dir;
|
|
137
|
+
|
|
138
|
+
} else if ( position.y > 1.0 ) {
|
|
139
|
+
|
|
140
|
+
offset += dir;
|
|
141
|
+
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// adjust for linewidth
|
|
145
|
+
offset *= linewidth;
|
|
146
|
+
|
|
147
|
+
// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...
|
|
148
|
+
offset /= resolution.y;
|
|
149
|
+
|
|
150
|
+
// select end
|
|
151
|
+
vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;
|
|
152
|
+
|
|
153
|
+
// back to clip space
|
|
154
|
+
offset *= clip.w;
|
|
155
|
+
|
|
156
|
+
clip.xy += offset;
|
|
157
|
+
|
|
158
|
+
gl_Position = clip;
|
|
159
|
+
|
|
160
|
+
vec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation
|
|
161
|
+
|
|
162
|
+
#include <logdepthbuf_vertex>
|
|
163
|
+
#include <clipping_planes_vertex>
|
|
164
|
+
#include <fog_vertex>
|
|
165
|
+
|
|
166
|
+
}
|
|
167
|
+
`,
|
|
168
|
+
fragmentShader: `
|
|
169
|
+
uniform vec3 diffuse;
|
|
170
|
+
uniform float opacity;
|
|
171
|
+
|
|
172
|
+
#ifdef USE_DASH
|
|
173
|
+
|
|
174
|
+
uniform float dashSize;
|
|
175
|
+
uniform float dashOffset;
|
|
176
|
+
uniform float gapSize;
|
|
177
|
+
|
|
178
|
+
#endif
|
|
179
|
+
|
|
180
|
+
varying float vLineDistance;
|
|
181
|
+
|
|
182
|
+
#include <common>
|
|
183
|
+
#include <color_pars_fragment>
|
|
184
|
+
#include <fog_pars_fragment>
|
|
185
|
+
#include <logdepthbuf_pars_fragment>
|
|
186
|
+
#include <clipping_planes_pars_fragment>
|
|
187
|
+
|
|
188
|
+
varying vec2 vUv;
|
|
189
|
+
|
|
190
|
+
void main() {
|
|
191
|
+
|
|
192
|
+
#include <clipping_planes_fragment>
|
|
193
|
+
|
|
194
|
+
#ifdef USE_DASH
|
|
195
|
+
|
|
196
|
+
if ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps
|
|
197
|
+
|
|
198
|
+
if ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX
|
|
199
|
+
|
|
200
|
+
#endif
|
|
201
|
+
|
|
202
|
+
float alpha = opacity;
|
|
203
|
+
|
|
204
|
+
#ifdef ALPHA_TO_COVERAGE
|
|
205
|
+
|
|
206
|
+
// artifacts appear on some hardware if a derivative is taken within a conditional
|
|
207
|
+
float a = vUv.x;
|
|
208
|
+
float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;
|
|
209
|
+
float len2 = a * a + b * b;
|
|
210
|
+
float dlen = fwidth( len2 );
|
|
211
|
+
|
|
212
|
+
if ( abs( vUv.y ) > 1.0 ) {
|
|
213
|
+
|
|
214
|
+
alpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 );
|
|
215
|
+
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
#else
|
|
219
|
+
|
|
220
|
+
if ( abs( vUv.y ) > 1.0 ) {
|
|
221
|
+
|
|
222
|
+
float a = vUv.x;
|
|
223
|
+
float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;
|
|
224
|
+
float len2 = a * a + b * b;
|
|
225
|
+
|
|
226
|
+
if ( len2 > 1.0 ) discard;
|
|
227
|
+
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
#endif
|
|
231
|
+
|
|
232
|
+
vec4 diffuseColor = vec4( diffuse, alpha );
|
|
233
|
+
|
|
234
|
+
#include <logdepthbuf_fragment>
|
|
235
|
+
#include <color_fragment>
|
|
236
|
+
|
|
237
|
+
gl_FragColor = vec4( diffuseColor.rgb, alpha );
|
|
238
|
+
|
|
239
|
+
#include <tonemapping_fragment>
|
|
240
|
+
#include <encodings_fragment>
|
|
241
|
+
#include <fog_fragment>
|
|
242
|
+
#include <premultiplied_alpha_fragment>
|
|
243
|
+
|
|
244
|
+
}
|
|
245
|
+
`,
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
class LineMaterial extends NS_THREE.ShaderMaterial {
|
|
249
|
+
constructor(parameters) {
|
|
250
|
+
super((() => {
|
|
251
|
+
const { THREE } = Externals.getInstance();
|
|
252
|
+
const shaderLibLine = getShaderLibLine();
|
|
253
|
+
return {
|
|
254
|
+
type: 'LineMaterial',
|
|
255
|
+
uniforms: THREE.UniformsUtils.clone(shaderLibLine.uniforms),
|
|
256
|
+
vertexShader: shaderLibLine.vertexShader,
|
|
257
|
+
fragmentShader: shaderLibLine.fragmentShader,
|
|
258
|
+
clipping: true,
|
|
259
|
+
};
|
|
260
|
+
})());
|
|
261
|
+
this.isLineMaterial = true;
|
|
262
|
+
this.dashed = false;
|
|
263
|
+
Object.defineProperties(this, {
|
|
264
|
+
color: {
|
|
265
|
+
enumerable: true,
|
|
266
|
+
get() {
|
|
267
|
+
return this.uniforms.diffuse.value;
|
|
268
|
+
},
|
|
269
|
+
set(value) {
|
|
270
|
+
this.uniforms.diffuse.value = value;
|
|
271
|
+
},
|
|
272
|
+
},
|
|
273
|
+
linewidth: {
|
|
274
|
+
enumerable: true,
|
|
275
|
+
get() {
|
|
276
|
+
return this.uniforms.linewidth.value;
|
|
277
|
+
},
|
|
278
|
+
set(value) {
|
|
279
|
+
this.uniforms.linewidth.value = value;
|
|
280
|
+
},
|
|
281
|
+
},
|
|
282
|
+
dashed: {
|
|
283
|
+
enumerable: true,
|
|
284
|
+
get() {
|
|
285
|
+
return Boolean('USE_DASH' in this.defines);
|
|
286
|
+
},
|
|
287
|
+
set(value) {
|
|
288
|
+
if (Boolean(value) !== Boolean('USE_DASH' in this.defines)) {
|
|
289
|
+
this.needsUpdate = true;
|
|
290
|
+
}
|
|
291
|
+
if (value === true) {
|
|
292
|
+
this.defines.USE_DASH = '';
|
|
293
|
+
}
|
|
294
|
+
else {
|
|
295
|
+
delete this.defines.USE_DASH;
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
},
|
|
299
|
+
dashScale: {
|
|
300
|
+
enumerable: true,
|
|
301
|
+
get() {
|
|
302
|
+
return this.uniforms.dashScale.value;
|
|
303
|
+
},
|
|
304
|
+
set(value) {
|
|
305
|
+
this.uniforms.dashScale.value = value;
|
|
306
|
+
},
|
|
307
|
+
},
|
|
308
|
+
dashSize: {
|
|
309
|
+
enumerable: true,
|
|
310
|
+
get() {
|
|
311
|
+
return this.uniforms.dashSize.value;
|
|
312
|
+
},
|
|
313
|
+
set(value) {
|
|
314
|
+
this.uniforms.dashSize.value = value;
|
|
315
|
+
},
|
|
316
|
+
},
|
|
317
|
+
dashOffset: {
|
|
318
|
+
enumerable: true,
|
|
319
|
+
get() {
|
|
320
|
+
return this.uniforms.dashOffset.value;
|
|
321
|
+
},
|
|
322
|
+
set(value) {
|
|
323
|
+
this.uniforms.dashOffset.value = value;
|
|
324
|
+
},
|
|
325
|
+
},
|
|
326
|
+
gapSize: {
|
|
327
|
+
enumerable: true,
|
|
328
|
+
get() {
|
|
329
|
+
return this.uniforms.gapSize.value;
|
|
330
|
+
},
|
|
331
|
+
set(value) {
|
|
332
|
+
this.uniforms.gapSize.value = value;
|
|
333
|
+
},
|
|
334
|
+
},
|
|
335
|
+
opacity: {
|
|
336
|
+
enumerable: true,
|
|
337
|
+
get() {
|
|
338
|
+
return this.uniforms.opacity.value;
|
|
339
|
+
},
|
|
340
|
+
set(value) {
|
|
341
|
+
this.uniforms.opacity.value = value;
|
|
342
|
+
},
|
|
343
|
+
},
|
|
344
|
+
resolution: {
|
|
345
|
+
enumerable: true,
|
|
346
|
+
get() {
|
|
347
|
+
return this.uniforms.resolution.value;
|
|
348
|
+
},
|
|
349
|
+
set(value) {
|
|
350
|
+
this.uniforms.resolution.value.copy(value);
|
|
351
|
+
},
|
|
352
|
+
},
|
|
353
|
+
alphaToCoverage: {
|
|
354
|
+
enumerable: true,
|
|
355
|
+
get() {
|
|
356
|
+
return Boolean('ALPHA_TO_COVERAGE' in this.defines);
|
|
357
|
+
},
|
|
358
|
+
set(value) {
|
|
359
|
+
if (Boolean(value) !== Boolean('ALPHA_TO_COVERAGE' in this.defines)) {
|
|
360
|
+
this.needsUpdate = true;
|
|
361
|
+
}
|
|
362
|
+
if (value) {
|
|
363
|
+
this.defines.ALPHA_TO_COVERAGE = '';
|
|
364
|
+
this.extensions.derivatives = true;
|
|
365
|
+
}
|
|
366
|
+
else {
|
|
367
|
+
delete this.defines.ALPHA_TO_COVERAGE;
|
|
368
|
+
this.extensions.derivatives = false;
|
|
369
|
+
}
|
|
370
|
+
},
|
|
371
|
+
},
|
|
372
|
+
});
|
|
373
|
+
this.setValues(parameters);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
export { LineMaterial };
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/* eslint-disable max-len, no-continue, @typescript-eslint/no-explicit-any, no-underscore-dangle, func-names, @typescript-eslint/no-this-alias, no-console, consistent-return, no-param-reassign, no-shadow */
|
|
2
|
+
import { Externals, NS_THREE } from '../../owlly/stage/externals';
|
|
3
|
+
import { LineSegmentsGeometry } from './line-segments-geometry';
|
|
4
|
+
import { LineMaterial } from './line-material';
|
|
5
|
+
class LineSegments2 extends NS_THREE.Mesh {
|
|
6
|
+
constructor(geometry, material) {
|
|
7
|
+
super(geometry || new LineSegmentsGeometry(), material || new LineMaterial({ color: Math.random() * 0xffffff }));
|
|
8
|
+
this.isLineSegments2 = true;
|
|
9
|
+
const { THREE } = Externals.getInstance();
|
|
10
|
+
this.type = 'LineSegments2';
|
|
11
|
+
const that = this;
|
|
12
|
+
this.computeLineDistances = (function () {
|
|
13
|
+
const start = new THREE.Vector3();
|
|
14
|
+
const end = new THREE.Vector3();
|
|
15
|
+
return function () {
|
|
16
|
+
const { geometry } = that;
|
|
17
|
+
const { instanceStart } = geometry.attributes;
|
|
18
|
+
const { instanceEnd } = geometry.attributes;
|
|
19
|
+
const lineDistances = new Float32Array(2 * instanceStart.count);
|
|
20
|
+
for (let i = 0, j = 0, l = instanceStart.count; i < l; i += 1, j += 2) {
|
|
21
|
+
start.fromBufferAttribute(instanceStart, i);
|
|
22
|
+
end.fromBufferAttribute(instanceEnd, i);
|
|
23
|
+
lineDistances[j] = (j === 0) ? 0 : lineDistances[j - 1];
|
|
24
|
+
lineDistances[j + 1] = lineDistances[j] + start.distanceTo(end);
|
|
25
|
+
}
|
|
26
|
+
const instanceDistanceBuffer = new THREE.InstancedInterleavedBuffer(lineDistances, 2, 1); // d0, d1
|
|
27
|
+
geometry.setAttribute('instanceDistanceStart', new THREE.InterleavedBufferAttribute(instanceDistanceBuffer, 1, 0)); // d0
|
|
28
|
+
geometry.setAttribute('instanceDistanceEnd', new THREE.InterleavedBufferAttribute(instanceDistanceBuffer, 1, 1)); // d1
|
|
29
|
+
return that;
|
|
30
|
+
};
|
|
31
|
+
}());
|
|
32
|
+
this.raycast = (function () {
|
|
33
|
+
const start = new THREE.Vector4();
|
|
34
|
+
const end = new THREE.Vector4();
|
|
35
|
+
const ssOrigin = new THREE.Vector4();
|
|
36
|
+
const ssOrigin3 = new THREE.Vector3();
|
|
37
|
+
const mvMatrix = new THREE.Matrix4();
|
|
38
|
+
const line = new THREE.Line3();
|
|
39
|
+
const closestPoint = new THREE.Vector3();
|
|
40
|
+
return function (raycaster, intersects) {
|
|
41
|
+
if (raycaster.camera === null) {
|
|
42
|
+
console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');
|
|
43
|
+
}
|
|
44
|
+
const threshold = (raycaster.params.Line2 !== undefined) ? raycaster.params.Line2.threshold || 0 : 0;
|
|
45
|
+
const { ray } = raycaster;
|
|
46
|
+
const { camera } = raycaster;
|
|
47
|
+
const { projectionMatrix } = camera;
|
|
48
|
+
const { geometry } = that;
|
|
49
|
+
const { material } = that;
|
|
50
|
+
const { resolution } = material;
|
|
51
|
+
const lineWidth = material.linewidth + threshold;
|
|
52
|
+
const { instanceStart } = geometry.attributes;
|
|
53
|
+
const { instanceEnd } = geometry.attributes;
|
|
54
|
+
// camera forward is negative
|
|
55
|
+
const near = -camera.near;
|
|
56
|
+
// pick a point 1 unit out along the ray to avoid the ray origin
|
|
57
|
+
// sitting at the camera origin which will cause "w" to be 0 when
|
|
58
|
+
// applying the projection matrix.
|
|
59
|
+
ray.at(1, ssOrigin);
|
|
60
|
+
// ndc space [ - 1.0, 1.0 ]
|
|
61
|
+
ssOrigin.w = 1;
|
|
62
|
+
ssOrigin.applyMatrix4(camera.matrixWorldInverse);
|
|
63
|
+
ssOrigin.applyMatrix4(projectionMatrix);
|
|
64
|
+
ssOrigin.multiplyScalar(1 / ssOrigin.w);
|
|
65
|
+
// screen space
|
|
66
|
+
ssOrigin.x *= resolution.x / 2;
|
|
67
|
+
ssOrigin.y *= resolution.y / 2;
|
|
68
|
+
ssOrigin.z = 0;
|
|
69
|
+
ssOrigin3.copy(new THREE.Vector3(ssOrigin.x, ssOrigin.y, ssOrigin.z));
|
|
70
|
+
const { matrixWorld } = that;
|
|
71
|
+
mvMatrix.multiplyMatrices(camera.matrixWorldInverse, matrixWorld);
|
|
72
|
+
for (let i = 0, l = instanceStart.count; i < l; i++) {
|
|
73
|
+
start.fromBufferAttribute(instanceStart, i);
|
|
74
|
+
end.fromBufferAttribute(instanceEnd, i);
|
|
75
|
+
start.w = 1;
|
|
76
|
+
end.w = 1;
|
|
77
|
+
// camera space
|
|
78
|
+
start.applyMatrix4(mvMatrix);
|
|
79
|
+
end.applyMatrix4(mvMatrix);
|
|
80
|
+
// skip the segment if it's entirely behind the camera
|
|
81
|
+
const isBehindCameraNear = start.z > near && end.z > near;
|
|
82
|
+
if (isBehindCameraNear) {
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
// trim the segment if it extends behind camera near
|
|
86
|
+
if (start.z > near) {
|
|
87
|
+
const deltaDist = start.z - end.z;
|
|
88
|
+
const t = (start.z - near) / deltaDist;
|
|
89
|
+
start.lerp(end, t);
|
|
90
|
+
}
|
|
91
|
+
else if (end.z > near) {
|
|
92
|
+
const deltaDist = end.z - start.z;
|
|
93
|
+
const t = (end.z - near) / deltaDist;
|
|
94
|
+
end.lerp(start, t);
|
|
95
|
+
}
|
|
96
|
+
// clip space
|
|
97
|
+
start.applyMatrix4(projectionMatrix);
|
|
98
|
+
end.applyMatrix4(projectionMatrix);
|
|
99
|
+
// ndc space [ - 1.0, 1.0 ]
|
|
100
|
+
start.multiplyScalar(1 / start.w);
|
|
101
|
+
end.multiplyScalar(1 / end.w);
|
|
102
|
+
// screen space
|
|
103
|
+
start.x *= resolution.x / 2;
|
|
104
|
+
start.y *= resolution.y / 2;
|
|
105
|
+
end.x *= resolution.x / 2;
|
|
106
|
+
end.y *= resolution.y / 2;
|
|
107
|
+
// create 2d segment
|
|
108
|
+
line.start.set(start.x, start.y, line.start.z);
|
|
109
|
+
line.start.z = 0;
|
|
110
|
+
line.end.set(end.x, end.y, line.end.z);
|
|
111
|
+
line.end.z = 0;
|
|
112
|
+
// get closest point on ray to segment
|
|
113
|
+
const param = line.closestPointToPointParameter(ssOrigin3, true);
|
|
114
|
+
line.at(param, closestPoint);
|
|
115
|
+
// check if the intersection point is within clip space
|
|
116
|
+
const zPos = THREE.MathUtils.lerp(start.z, end.z, param);
|
|
117
|
+
const isInClipSpace = zPos >= -1 && zPos <= 1;
|
|
118
|
+
const isInside = ssOrigin3.distanceTo(closestPoint) < lineWidth * 0.5;
|
|
119
|
+
if (isInClipSpace && isInside) {
|
|
120
|
+
line.start.fromBufferAttribute(instanceStart, i);
|
|
121
|
+
line.end.fromBufferAttribute(instanceEnd, i);
|
|
122
|
+
line.start.applyMatrix4(matrixWorld);
|
|
123
|
+
line.end.applyMatrix4(matrixWorld);
|
|
124
|
+
const pointOnLine = new THREE.Vector3();
|
|
125
|
+
const point = new THREE.Vector3();
|
|
126
|
+
ray.distanceSqToSegment(line.start, line.end, point, pointOnLine);
|
|
127
|
+
intersects.push({
|
|
128
|
+
point,
|
|
129
|
+
pointOnLine,
|
|
130
|
+
distance: ray.origin.distanceTo(point),
|
|
131
|
+
object: that,
|
|
132
|
+
face: null,
|
|
133
|
+
faceIndex: i,
|
|
134
|
+
uv: null,
|
|
135
|
+
uv2: null,
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
}());
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
export { LineSegments2 };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { NS_THREE } from '../../owlly/stage/externals';
|
|
2
|
+
declare class LineSegmentsGeometry extends NS_THREE.InstancedBufferGeometry {
|
|
3
|
+
isLineSegmentsGeometry: true;
|
|
4
|
+
constructor();
|
|
5
|
+
applyMatrix4(matrix: any): this;
|
|
6
|
+
setPositions(array: any): this;
|
|
7
|
+
setColors(array: any): this;
|
|
8
|
+
fromWireframeGeometry(geometry: any): this;
|
|
9
|
+
fromEdgesGeometry(geometry: any): this;
|
|
10
|
+
fromMesh(mesh: any): this;
|
|
11
|
+
fromLineSegments(lineSegments: any): any;
|
|
12
|
+
toJSON(): any;
|
|
13
|
+
applyMatrix(matrix: any): any;
|
|
14
|
+
}
|
|
15
|
+
export { LineSegmentsGeometry };
|