@aibee/owlly 1.0.25 → 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,106 @@
|
|
|
1
|
+
import { NS_THREE } from '../stage/externals';
|
|
2
|
+
import { View } from '../view/view';
|
|
3
|
+
import { Element } from '../element/element';
|
|
4
|
+
import { Controller } from './controller';
|
|
5
|
+
/**
|
|
6
|
+
* Element变换控制器
|
|
7
|
+
*/
|
|
8
|
+
declare class TransformController extends Controller {
|
|
9
|
+
private transformControl;
|
|
10
|
+
private scene;
|
|
11
|
+
private activeElement;
|
|
12
|
+
private renderFrame;
|
|
13
|
+
private mouseState;
|
|
14
|
+
private button;
|
|
15
|
+
private mousePositionBuffer;
|
|
16
|
+
private controlMode;
|
|
17
|
+
private snapToObject;
|
|
18
|
+
private detectOnMove;
|
|
19
|
+
private transformActivated;
|
|
20
|
+
protected mouseEventHandlers: {
|
|
21
|
+
onPointerDown: (ev: PointerEvent) => void;
|
|
22
|
+
onPointerMove: (ev: PointerEvent) => void;
|
|
23
|
+
onPointerUp: (ev: PointerEvent) => void;
|
|
24
|
+
};
|
|
25
|
+
protected touchEventHandlers: {
|
|
26
|
+
onTouchStart: (ev: TouchEvent) => void;
|
|
27
|
+
onTouchMove: (ev: TouchEvent) => void;
|
|
28
|
+
onTouchEnd: (ev: TouchEvent) => void;
|
|
29
|
+
};
|
|
30
|
+
private selectableElements;
|
|
31
|
+
private selectableElementsOnScreen;
|
|
32
|
+
private selectedElement;
|
|
33
|
+
private selectedElementIntersection;
|
|
34
|
+
private view;
|
|
35
|
+
private elementResponseDistance2D;
|
|
36
|
+
private elementWorldDetectionDistance;
|
|
37
|
+
private onScreenElementWorldDetectionDistance;
|
|
38
|
+
constructor(view: View);
|
|
39
|
+
private registerPointerEvents;
|
|
40
|
+
private unregisterPointerEvents;
|
|
41
|
+
private snapActiveElement;
|
|
42
|
+
private onPointerDown;
|
|
43
|
+
private onPointerMove;
|
|
44
|
+
private onPointerUp;
|
|
45
|
+
private onTouchStart;
|
|
46
|
+
private onTouchMove;
|
|
47
|
+
private onTouchEnd;
|
|
48
|
+
unbind(): void;
|
|
49
|
+
/** @ignore */
|
|
50
|
+
update(): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* 绑定视图
|
|
53
|
+
* @param view 需要绑定的View
|
|
54
|
+
*/
|
|
55
|
+
bindView(view: View): void;
|
|
56
|
+
renderingViewChanged(v: View): void;
|
|
57
|
+
/** @ignore */
|
|
58
|
+
initWithScene(scene: NS_THREE.Scene): void;
|
|
59
|
+
/**
|
|
60
|
+
* 将控制杆附着至元素
|
|
61
|
+
* @param element 需要调整的元素
|
|
62
|
+
*/
|
|
63
|
+
attach(element: Element): void;
|
|
64
|
+
/**
|
|
65
|
+
* 解除控制杆
|
|
66
|
+
*/
|
|
67
|
+
detach(): void;
|
|
68
|
+
/**
|
|
69
|
+
* 获取编辑模式
|
|
70
|
+
*/
|
|
71
|
+
getMode(): string;
|
|
72
|
+
/**
|
|
73
|
+
* 设置编辑模式
|
|
74
|
+
* @param mode 编辑模式, 值为 "translate"(移动), "rotate"(旋转), "scale"(缩放), "snap"(自动吸附到Mesh), "collision"(碰撞) 其一.
|
|
75
|
+
*/
|
|
76
|
+
setMode(mode: string, snapToObject?: NS_THREE.Object3D, detectOnMove?: boolean): void;
|
|
77
|
+
/**
|
|
78
|
+
* 设置控制杆尺寸
|
|
79
|
+
* @param size 控制杆尺寸 默认为1
|
|
80
|
+
*/
|
|
81
|
+
setSize(size: number): void;
|
|
82
|
+
/**
|
|
83
|
+
* 设置X, Y, Z轴控制杆可见性
|
|
84
|
+
* @param x X轴控制杆可见性
|
|
85
|
+
* @param y Y轴控制杆可见性
|
|
86
|
+
* @param z Z轴控制杆可见性
|
|
87
|
+
*/
|
|
88
|
+
setStickVisibility(x: boolean, y: boolean, z: boolean, view?: View): void;
|
|
89
|
+
/**
|
|
90
|
+
* 设置平移时移动的最小单位
|
|
91
|
+
* @param snap 移动最小单位, 默认值为null
|
|
92
|
+
*/
|
|
93
|
+
setTransitionSnap(snap: number | null): void;
|
|
94
|
+
/**
|
|
95
|
+
* 设置旋转时的最小旋转单位
|
|
96
|
+
* @param snap 旋转最小单位, 单位为弧度, 默认值为null
|
|
97
|
+
*/
|
|
98
|
+
setRotationSnap(snap: number | null): void;
|
|
99
|
+
setEnabled(value: boolean): void;
|
|
100
|
+
bindElement(e: Element | Element[], detectOnScreen?: boolean): void;
|
|
101
|
+
unbindElement(e: Element | Element[]): void;
|
|
102
|
+
set2DElementDetectionRadius(distance: number): void;
|
|
103
|
+
setElementWorldDetectionDistance(distance: number): void;
|
|
104
|
+
setOnScreenElementWorldDetectionDistance(distance: number): void;
|
|
105
|
+
}
|
|
106
|
+
export { TransformController };
|
|
@@ -0,0 +1,545 @@
|
|
|
1
|
+
import { Externals } from '../stage/externals';
|
|
2
|
+
import { Element } from '../element/element';
|
|
3
|
+
import { Events, OwllyEvents } from '../utils/events';
|
|
4
|
+
import { BasicTools } from '../utils/basic-tools';
|
|
5
|
+
import { Controller } from './controller';
|
|
6
|
+
import { Placeable2D } from '../element/placeable-2d';
|
|
7
|
+
import { FloorModel } from '../element/floor-model';
|
|
8
|
+
import { TransformControls } from '../../external/transform-controls';
|
|
9
|
+
var MouseState;
|
|
10
|
+
(function (MouseState) {
|
|
11
|
+
MouseState[MouseState["IDLE"] = 0] = "IDLE";
|
|
12
|
+
MouseState[MouseState["DOWN"] = 1] = "DOWN";
|
|
13
|
+
MouseState[MouseState["MOVE"] = 2] = "MOVE";
|
|
14
|
+
})(MouseState || (MouseState = {}));
|
|
15
|
+
class TransformControlsInjected extends TransformControls {
|
|
16
|
+
constructor(view, object, domElement) {
|
|
17
|
+
super(object, domElement);
|
|
18
|
+
this.bindingView = view;
|
|
19
|
+
this.visibilityMap = new Map();
|
|
20
|
+
this.pointerDownSuper = this.pointerDown;
|
|
21
|
+
this.pointerHoverSuper = this.pointerHover;
|
|
22
|
+
this.pointerMoveSuper = this.pointerMove;
|
|
23
|
+
this.pointerUpSuper = this.pointerUp;
|
|
24
|
+
this.disposeSuper = this.dispose;
|
|
25
|
+
this.pointerDown = function pointerDown(pointer) {
|
|
26
|
+
const { showX, showY, showZ } = this;
|
|
27
|
+
const { showX: x, showY: y, showZ: z } = this.visibilityMap.get(this.bindingView);
|
|
28
|
+
this.showX = x;
|
|
29
|
+
this.showY = y;
|
|
30
|
+
this.showZ = z;
|
|
31
|
+
if (this.object && this.object.parent)
|
|
32
|
+
this.updateMatrixWorld();
|
|
33
|
+
this.pointerDownSuper(pointer);
|
|
34
|
+
this.showX = showX;
|
|
35
|
+
this.showY = showY;
|
|
36
|
+
this.showZ = showZ;
|
|
37
|
+
if (this.object && this.object.parent)
|
|
38
|
+
this.updateMatrixWorld();
|
|
39
|
+
};
|
|
40
|
+
this.pointerHover = function pointerHover(pointer) {
|
|
41
|
+
const { showX, showY, showZ } = this;
|
|
42
|
+
const { showX: x, showY: y, showZ: z } = this.visibilityMap.get(this.bindingView);
|
|
43
|
+
this.showX = x;
|
|
44
|
+
this.showY = y;
|
|
45
|
+
this.showZ = z;
|
|
46
|
+
if (this.object && this.object.parent)
|
|
47
|
+
this.updateMatrixWorld();
|
|
48
|
+
this.pointerHoverSuper(pointer);
|
|
49
|
+
this.showX = showX;
|
|
50
|
+
this.showY = showY;
|
|
51
|
+
this.showZ = showZ;
|
|
52
|
+
if (this.object && this.object.parent)
|
|
53
|
+
this.updateMatrixWorld();
|
|
54
|
+
};
|
|
55
|
+
this.pointerMove = function pointerMove(pointer) {
|
|
56
|
+
const { showX, showY, showZ } = this;
|
|
57
|
+
const { showX: x, showY: y, showZ: z } = this.visibilityMap.get(this.bindingView);
|
|
58
|
+
this.showX = x;
|
|
59
|
+
this.showY = y;
|
|
60
|
+
this.showZ = z;
|
|
61
|
+
if (this.object && this.object.parent)
|
|
62
|
+
this.updateMatrixWorld();
|
|
63
|
+
this.pointerMoveSuper(pointer);
|
|
64
|
+
this.showX = showX;
|
|
65
|
+
this.showY = showY;
|
|
66
|
+
this.showZ = showZ;
|
|
67
|
+
if (this.object && this.object.parent)
|
|
68
|
+
this.updateMatrixWorld();
|
|
69
|
+
};
|
|
70
|
+
this.pointerUp = function pointerUp(pointer) {
|
|
71
|
+
const { showX, showY, showZ } = this;
|
|
72
|
+
const { showX: x, showY: y, showZ: z } = this.visibilityMap.get(this.bindingView);
|
|
73
|
+
this.showX = x;
|
|
74
|
+
this.showY = y;
|
|
75
|
+
this.showZ = z;
|
|
76
|
+
if (this.object && this.object.parent)
|
|
77
|
+
this.updateMatrixWorld();
|
|
78
|
+
this.pointerUpSuper(pointer);
|
|
79
|
+
this.showX = showX;
|
|
80
|
+
this.showY = showY;
|
|
81
|
+
this.showZ = showZ;
|
|
82
|
+
if (this.object && this.object.parent)
|
|
83
|
+
this.updateMatrixWorld();
|
|
84
|
+
};
|
|
85
|
+
this.dispose = function dispose() {
|
|
86
|
+
this.visibilityMap.clear();
|
|
87
|
+
this.disposeSuper();
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
updateViewVisibilitySettings(conf, view) {
|
|
91
|
+
if (view) {
|
|
92
|
+
this.visibilityMap.set(view, conf);
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
this.visibilityMap.forEach((_, k) => {
|
|
96
|
+
this.visibilityMap.set(k, conf);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
getViewVisibilitySettings(view) {
|
|
101
|
+
return this.visibilityMap.get(view);
|
|
102
|
+
}
|
|
103
|
+
removeViewVisibilitySettings(view) {
|
|
104
|
+
this.visibilityMap.delete(view);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Element变换控制器
|
|
109
|
+
*/
|
|
110
|
+
class TransformController extends Controller {
|
|
111
|
+
// private eventListeners: {
|
|
112
|
+
// onViewChangedListener: Function;
|
|
113
|
+
// };
|
|
114
|
+
constructor(view) {
|
|
115
|
+
super();
|
|
116
|
+
const { THREE } = Externals.getInstance();
|
|
117
|
+
this.mouseState = MouseState.IDLE;
|
|
118
|
+
this.mouseEventHandlers = {
|
|
119
|
+
onPointerDown: (e) => { this.onPointerDown(e); },
|
|
120
|
+
onPointerMove: (e) => { this.onPointerMove(e); },
|
|
121
|
+
onPointerUp: (e) => { this.onPointerUp(e); },
|
|
122
|
+
};
|
|
123
|
+
this.touchEventHandlers = {
|
|
124
|
+
onTouchStart: (e) => { this.onTouchStart(e); },
|
|
125
|
+
onTouchMove: (e) => { this.onTouchMove(e); },
|
|
126
|
+
onTouchEnd: () => { this.onTouchEnd(); },
|
|
127
|
+
};
|
|
128
|
+
this.selectableElements = new Set();
|
|
129
|
+
this.selectableElementsOnScreen = new Set();
|
|
130
|
+
this.elementResponseDistance2D = 30;
|
|
131
|
+
this.elementWorldDetectionDistance = -1;
|
|
132
|
+
this.onScreenElementWorldDetectionDistance = 13;
|
|
133
|
+
this.mousePositionBuffer = new THREE.Vector2();
|
|
134
|
+
this.detectOnMove = false;
|
|
135
|
+
// this.eventListeners = {
|
|
136
|
+
// onViewChangedListener: (v: View): void => {
|
|
137
|
+
// const conf = this.transformControl.getViewVisibilitySettings(v)
|
|
138
|
+
// || this.transformControl.getViewVisibilitySettings(this.view)!;
|
|
139
|
+
// if (!conf) return;
|
|
140
|
+
// const { showX, showY, showZ } = conf;
|
|
141
|
+
// this.transformControl.showX = showX;
|
|
142
|
+
// this.transformControl.showY = showY;
|
|
143
|
+
// this.transformControl.showZ = showZ;
|
|
144
|
+
// },
|
|
145
|
+
// };
|
|
146
|
+
// EventHub.on(OwllyEvents.RENDERING_VIEW_CHANGED, this.eventListeners.onViewChangedListener);
|
|
147
|
+
this.bindView(view);
|
|
148
|
+
}
|
|
149
|
+
registerPointerEvents(dom) {
|
|
150
|
+
dom.addEventListener('pointerdown', this.mouseEventHandlers.onPointerDown);
|
|
151
|
+
dom.addEventListener('pointermove', this.mouseEventHandlers.onPointerMove);
|
|
152
|
+
dom.addEventListener('pointerup', this.mouseEventHandlers.onPointerUp);
|
|
153
|
+
dom.addEventListener('touchstart', this.touchEventHandlers.onTouchStart);
|
|
154
|
+
dom.addEventListener('touchmove', this.touchEventHandlers.onTouchMove);
|
|
155
|
+
dom.addEventListener('touchend', this.touchEventHandlers.onTouchEnd);
|
|
156
|
+
}
|
|
157
|
+
unregisterPointerEvents(dom) {
|
|
158
|
+
dom.removeEventListener('pointerdown', this.mouseEventHandlers.onPointerDown);
|
|
159
|
+
dom.removeEventListener('pointermove', this.mouseEventHandlers.onPointerMove);
|
|
160
|
+
dom.removeEventListener('pointerup', this.mouseEventHandlers.onPointerUp);
|
|
161
|
+
dom.removeEventListener('touchstart', this.touchEventHandlers.onTouchStart);
|
|
162
|
+
dom.removeEventListener('touchmove', this.touchEventHandlers.onTouchMove);
|
|
163
|
+
dom.removeEventListener('touchend', this.touchEventHandlers.onTouchEnd);
|
|
164
|
+
}
|
|
165
|
+
snapActiveElement(x, y, clientWidth, clientHeight) {
|
|
166
|
+
if (this.controlMode !== 'snap' || !this.activeElement || !this.snapToObject) {
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
169
|
+
const { THREE } = Externals.getInstance();
|
|
170
|
+
const raycaster = new THREE.Raycaster();
|
|
171
|
+
raycaster.setFromCamera({ x: 2 * x / clientWidth - 1, y: 1 - 2 * y / clientHeight }, this.view.camera);
|
|
172
|
+
const intersections = raycaster.intersectObject(this.snapToObject, true);
|
|
173
|
+
if (intersections && intersections.length > 0) {
|
|
174
|
+
intersections.sort((a, b) => a.distance - b.distance);
|
|
175
|
+
// console.info('#Snap# snapActiveElement intersections[0]=', intersections[0]);
|
|
176
|
+
this.activeElement.position.copy(intersections[0].point);
|
|
177
|
+
this.emit(Events.ELEMENT_POSITION_UPDATED, this.activeElement.position.clone(), this.activeElement, this.view);
|
|
178
|
+
}
|
|
179
|
+
return true;
|
|
180
|
+
}
|
|
181
|
+
onPointerDown(e) {
|
|
182
|
+
if (e.pointerType !== 'mouse')
|
|
183
|
+
return;
|
|
184
|
+
this.mouseState = MouseState.DOWN;
|
|
185
|
+
this.button = e.button;
|
|
186
|
+
const { clientX, clientY } = e;
|
|
187
|
+
const { clientWidth, clientHeight } = this.view.container;
|
|
188
|
+
const { left: rectX, top: rectY } = this.view.container.getBoundingClientRect();
|
|
189
|
+
const x = clientX - rectX;
|
|
190
|
+
const y = clientY - rectY;
|
|
191
|
+
const { THREE } = Externals.getInstance();
|
|
192
|
+
this.mousePositionBuffer.set(x, y);
|
|
193
|
+
if (this.controlMode === 'collision') {
|
|
194
|
+
const raycaster = new THREE.Raycaster();
|
|
195
|
+
raycaster.setFromCamera({ x: 2 * x / clientWidth - 1, y: 1 - 2 * y / clientHeight }, this.view.camera);
|
|
196
|
+
if (this.snapToObject instanceof FloorModel) {
|
|
197
|
+
const result = this.snapToObject.intersectRay(raycaster.ray.origin, raycaster.ray.direction, true);
|
|
198
|
+
if (result && result.length) {
|
|
199
|
+
const intersection = result[0];
|
|
200
|
+
const data = {
|
|
201
|
+
distance: intersection.intersectionPoint.distanceTo(raycaster.ray.origin),
|
|
202
|
+
point: intersection.intersectionPoint,
|
|
203
|
+
object: this.snapToObject,
|
|
204
|
+
};
|
|
205
|
+
this.selectedElement = this.snapToObject;
|
|
206
|
+
this.selectedElementIntersection = data;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
const intersections = raycaster.intersectObject(this.snapToObject, true);
|
|
211
|
+
if (intersections && intersections.length > 0) {
|
|
212
|
+
intersections.sort((a, b) => a.distance - b.distance);
|
|
213
|
+
this.selectedElement = this.snapToObject;
|
|
214
|
+
[this.selectedElementIntersection] = intersections;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
if (this.snapActiveElement(x, y, clientWidth, clientHeight)) {
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
let elements = Array.from(this.selectableElementsOnScreen);
|
|
222
|
+
const boundingBoxes = new Map();
|
|
223
|
+
elements.forEach((ele) => {
|
|
224
|
+
if (ele instanceof Placeable2D && ele.isDomElement) {
|
|
225
|
+
const size = ele.getSize();
|
|
226
|
+
boundingBoxes.set(ele, [size[0], size[1]]);
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
const intersectionObject = BasicTools.getMouseIntersectionOnScreen(elements, { x, y }, { screenWidth: clientWidth, screenHeight: clientHeight }, 2 * this.elementResponseDistance2D, this.view.camera, elements, this.onScreenElementWorldDetectionDistance, boundingBoxes);
|
|
230
|
+
if (intersectionObject && intersectionObject instanceof Element) {
|
|
231
|
+
this.mouseState = MouseState.DOWN;
|
|
232
|
+
this.selectedElement = intersectionObject;
|
|
233
|
+
this.selectedElementIntersection = BasicTools.getMouseIntersection([intersectionObject], { x: 2 * x / clientWidth - 1, y: 1 - 2 * y / clientHeight }, this.view.camera, elements, this.elementWorldDetectionDistance);
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
elements = Array.from(this.selectableElements);
|
|
237
|
+
const intersection = BasicTools.getMouseIntersection(elements, { x: 2 * x / clientWidth - 1, y: 1 - 2 * y / clientHeight }, this.view.camera, elements, this.elementWorldDetectionDistance);
|
|
238
|
+
if (intersection && intersection.object instanceof Element) {
|
|
239
|
+
this.mouseState = MouseState.DOWN;
|
|
240
|
+
this.selectedElement = intersection.object;
|
|
241
|
+
this.selectedElementIntersection = intersection;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
onPointerMove(e) {
|
|
245
|
+
if (e.pointerType !== 'mouse')
|
|
246
|
+
return;
|
|
247
|
+
if (this.mouseState !== MouseState.DOWN && this.mouseState !== MouseState.MOVE && !this.detectOnMove)
|
|
248
|
+
return;
|
|
249
|
+
const { clientX, clientY } = e;
|
|
250
|
+
const { clientWidth, clientHeight } = this.view.container;
|
|
251
|
+
const { left: rectX, top: rectY } = this.view.container.getBoundingClientRect();
|
|
252
|
+
const x = clientX - rectX;
|
|
253
|
+
const y = clientY - rectY;
|
|
254
|
+
const { THREE } = Externals.getInstance();
|
|
255
|
+
const distance = new THREE.Vector2(x, y).distanceToSquared(this.mousePositionBuffer);
|
|
256
|
+
if (this.mouseState === MouseState.DOWN && distance > 100)
|
|
257
|
+
this.mouseState = MouseState.MOVE;
|
|
258
|
+
this.snapActiveElement(x, y, clientWidth, clientHeight);
|
|
259
|
+
if (this.controlMode === 'collision'
|
|
260
|
+
&& (this.mouseState === MouseState.MOVE || this.detectOnMove)) {
|
|
261
|
+
const raycaster = new THREE.Raycaster();
|
|
262
|
+
raycaster.setFromCamera({ x: 2 * x / clientWidth - 1, y: 1 - 2 * y / clientHeight }, this.view.camera);
|
|
263
|
+
if (this.snapToObject instanceof FloorModel) {
|
|
264
|
+
const result = this.snapToObject.intersectRay(raycaster.ray.origin, raycaster.ray.direction, true);
|
|
265
|
+
if (result && result.length) {
|
|
266
|
+
const intersection = result[0];
|
|
267
|
+
const data = {
|
|
268
|
+
distance: intersection.intersectionPoint.distanceTo(raycaster.ray.origin),
|
|
269
|
+
point: intersection.intersectionPoint,
|
|
270
|
+
object: this.snapToObject,
|
|
271
|
+
};
|
|
272
|
+
this.emit(Events.ELEMENT_SELECTED, this.snapToObject, data);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
else {
|
|
276
|
+
const intersections = raycaster.intersectObject(this.snapToObject, true);
|
|
277
|
+
if (intersections && intersections.length > 0) {
|
|
278
|
+
intersections.sort((a, b) => a.distance - b.distance);
|
|
279
|
+
this.emit(Events.ELEMENT_SELECTED, this.snapToObject, intersections[0]);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
onPointerUp(e) {
|
|
285
|
+
if (e.pointerType !== 'mouse' || this.transformActivated)
|
|
286
|
+
return;
|
|
287
|
+
if (this.mouseState === MouseState.DOWN) {
|
|
288
|
+
this.emit(Events.ELEMENT_SELECTED, this.selectedElement, this.selectedElementIntersection, this.button);
|
|
289
|
+
}
|
|
290
|
+
this.mouseState = MouseState.IDLE;
|
|
291
|
+
this.selectedElement = null;
|
|
292
|
+
this.selectedElementIntersection = null;
|
|
293
|
+
}
|
|
294
|
+
onTouchStart(e) {
|
|
295
|
+
this.mouseState = MouseState.DOWN;
|
|
296
|
+
const { clientX, clientY } = e.touches[0];
|
|
297
|
+
const { clientWidth, clientHeight } = this.view.container;
|
|
298
|
+
const { left: rectX, top: rectY } = this.view.container.getBoundingClientRect();
|
|
299
|
+
const x = clientX - rectX;
|
|
300
|
+
const y = clientY - rectY;
|
|
301
|
+
this.mousePositionBuffer.set(x, y);
|
|
302
|
+
if (this.snapActiveElement(x, y, clientWidth, clientHeight)) {
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
let elements = Array.from(this.selectableElementsOnScreen);
|
|
306
|
+
const boundingBoxes = new Map();
|
|
307
|
+
elements.forEach((ele) => {
|
|
308
|
+
if (ele instanceof Placeable2D && ele.isDomElement) {
|
|
309
|
+
const size = ele.getSize();
|
|
310
|
+
boundingBoxes.set(ele, [size[0], size[1]]);
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
const intersectionObject = BasicTools.getMouseIntersectionOnScreen(elements, { x, y }, { screenWidth: clientWidth, screenHeight: clientHeight }, 2 * this.elementResponseDistance2D, this.view.camera, elements, this.onScreenElementWorldDetectionDistance, boundingBoxes);
|
|
314
|
+
if (intersectionObject && intersectionObject instanceof Element) {
|
|
315
|
+
this.mouseState = MouseState.DOWN;
|
|
316
|
+
this.selectedElement = intersectionObject;
|
|
317
|
+
this.selectedElementIntersection = BasicTools.getMouseIntersection([intersectionObject], { x: 2 * x / clientWidth - 1, y: 1 - 2 * y / clientHeight }, this.view.camera, elements, this.elementWorldDetectionDistance);
|
|
318
|
+
return;
|
|
319
|
+
}
|
|
320
|
+
elements = Array.from(this.selectableElements);
|
|
321
|
+
const intersection = BasicTools.getMouseIntersection(elements, { x: 2 * x / clientWidth - 1, y: 1 - 2 * y / clientHeight }, this.view.camera, elements, this.elementWorldDetectionDistance);
|
|
322
|
+
if (intersection && intersection.object instanceof Element) {
|
|
323
|
+
this.mouseState = MouseState.DOWN;
|
|
324
|
+
this.selectedElement = intersection.object;
|
|
325
|
+
this.selectedElementIntersection = intersection;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
onTouchMove(e) {
|
|
329
|
+
if (this.mouseState !== MouseState.DOWN)
|
|
330
|
+
return;
|
|
331
|
+
const { clientX, clientY } = e.touches[0];
|
|
332
|
+
const { clientWidth, clientHeight } = this.view.container;
|
|
333
|
+
const { left: rectX, top: rectY } = this.view.container.getBoundingClientRect();
|
|
334
|
+
const x = clientX - rectX;
|
|
335
|
+
const y = clientY - rectY;
|
|
336
|
+
const { THREE } = Externals.getInstance();
|
|
337
|
+
if (new THREE.Vector2(x, y).distanceToSquared(this.mousePositionBuffer) > 100)
|
|
338
|
+
this.mouseState = MouseState.MOVE;
|
|
339
|
+
this.snapActiveElement(x, y, clientWidth, clientHeight);
|
|
340
|
+
}
|
|
341
|
+
onTouchEnd() {
|
|
342
|
+
if (this.mouseState === MouseState.DOWN) {
|
|
343
|
+
this.emit(Events.ELEMENT_SELECTED, this.selectedElement, this.selectedElementIntersection);
|
|
344
|
+
}
|
|
345
|
+
this.mouseState = MouseState.IDLE;
|
|
346
|
+
this.selectedElement = null;
|
|
347
|
+
this.selectedElementIntersection = null;
|
|
348
|
+
}
|
|
349
|
+
unbind() {
|
|
350
|
+
super.unbind();
|
|
351
|
+
this.scene.remove(this.transformControl);
|
|
352
|
+
this.transformControl.dispose();
|
|
353
|
+
this.unregisterPointerEvents(this.view.container);
|
|
354
|
+
// EventHub.off(OwllyEvents.RENDERING_VIEW_CHANGED, this.eventListeners.onViewChangedListener);
|
|
355
|
+
}
|
|
356
|
+
/** @ignore */
|
|
357
|
+
update() {
|
|
358
|
+
const result = !!this.renderFrame;
|
|
359
|
+
this.renderFrame = false;
|
|
360
|
+
return result;
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* 绑定视图
|
|
364
|
+
* @param view 需要绑定的View
|
|
365
|
+
*/
|
|
366
|
+
bindView(view) {
|
|
367
|
+
// super.bindView(view);
|
|
368
|
+
if (!view.camera || !view.renderer) {
|
|
369
|
+
throw new Error('No Camera or Renderer found in view');
|
|
370
|
+
}
|
|
371
|
+
this.view = view;
|
|
372
|
+
this.transformControl = new TransformControlsInjected(view, view.camera, view.container);
|
|
373
|
+
this.transformControl.addEventListener('objectChange', () => {
|
|
374
|
+
this.emit(OwllyEvents.ELEMENT_POSITION_UPDATED, this.activeElement.position.clone(), this.activeElement, this.view);
|
|
375
|
+
});
|
|
376
|
+
this.transformControl.addEventListener('change', () => { this.renderFrame = true; });
|
|
377
|
+
this.transformControl.addEventListener('mouseUp', () => {
|
|
378
|
+
const mode = this.controlMode;
|
|
379
|
+
if (mode === 'translate') {
|
|
380
|
+
this.emit(Events.ELEMENT_POSITION_UPDATED, this.activeElement.position.clone(), this.activeElement);
|
|
381
|
+
}
|
|
382
|
+
else if (mode === 'rotate') {
|
|
383
|
+
this.emit(Events.ELEMENT_POSE_UPDATED, this.activeElement.quaternion.clone(), this.activeElement);
|
|
384
|
+
}
|
|
385
|
+
else if (mode === 'scale') {
|
|
386
|
+
// TODO(jyfang): do nothing now, add scale event
|
|
387
|
+
}
|
|
388
|
+
this.transformActivated = false;
|
|
389
|
+
this.emit(Events.TRANSFORM_DEACTIVATED);
|
|
390
|
+
});
|
|
391
|
+
this.transformControl.addEventListener('mouseDown', () => {
|
|
392
|
+
this.transformActivated = true;
|
|
393
|
+
this.emit(Events.TRANSFORM_ACTIVATED);
|
|
394
|
+
});
|
|
395
|
+
// (this.transformControl as {
|
|
396
|
+
// pointerHover: (pointer: { x: number; y: number }) => void;
|
|
397
|
+
// })!.pointerHover = (pointer): void => {}
|
|
398
|
+
// this.transformControl.addEventListener('dragging-changed', (event) => {
|
|
399
|
+
// super.setEnabled(!event.value);
|
|
400
|
+
// });
|
|
401
|
+
this.registerPointerEvents(view.container);
|
|
402
|
+
this.controlMode = this.transformControl.getMode();
|
|
403
|
+
this.transformControl.updateViewVisibilitySettings({ showX: true, showY: true, showZ: true }, view);
|
|
404
|
+
}
|
|
405
|
+
renderingViewChanged(v) {
|
|
406
|
+
const conf = this.transformControl.getViewVisibilitySettings(v)
|
|
407
|
+
|| this.transformControl.getViewVisibilitySettings(this.view);
|
|
408
|
+
if (!conf)
|
|
409
|
+
return;
|
|
410
|
+
const { showX, showY, showZ } = conf;
|
|
411
|
+
this.transformControl.showX = showX;
|
|
412
|
+
this.transformControl.showY = showY;
|
|
413
|
+
this.transformControl.showZ = showZ;
|
|
414
|
+
}
|
|
415
|
+
/** @ignore */
|
|
416
|
+
initWithScene(scene) {
|
|
417
|
+
this.scene = scene;
|
|
418
|
+
this.scene.add(this.transformControl);
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* 将控制杆附着至元素
|
|
422
|
+
* @param element 需要调整的元素
|
|
423
|
+
*/
|
|
424
|
+
attach(element) {
|
|
425
|
+
if (this.activeElement)
|
|
426
|
+
this.transformControl.detach();
|
|
427
|
+
this.activeElement = element;
|
|
428
|
+
this.transformControl.attach(this.activeElement);
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* 解除控制杆
|
|
432
|
+
*/
|
|
433
|
+
detach() {
|
|
434
|
+
this.setMode('translate');
|
|
435
|
+
this.mouseState = MouseState.IDLE;
|
|
436
|
+
this.transformControl.detach();
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
* 获取编辑模式
|
|
440
|
+
*/
|
|
441
|
+
getMode() {
|
|
442
|
+
return this.controlMode;
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
* 设置编辑模式
|
|
446
|
+
* @param mode 编辑模式, 值为 "translate"(移动), "rotate"(旋转), "scale"(缩放), "snap"(自动吸附到Mesh), "collision"(碰撞) 其一.
|
|
447
|
+
*/
|
|
448
|
+
setMode(mode, snapToObject, detectOnMove = false) {
|
|
449
|
+
this.controlMode = mode;
|
|
450
|
+
if (mode === 'snap' || mode === 'collision') {
|
|
451
|
+
if (snapToObject) {
|
|
452
|
+
this.snapToObject = snapToObject;
|
|
453
|
+
this.transformControl.detach();
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
else {
|
|
457
|
+
if (this.activeElement) {
|
|
458
|
+
this.transformControl.attach(this.activeElement);
|
|
459
|
+
}
|
|
460
|
+
this.transformControl.setMode(mode);
|
|
461
|
+
}
|
|
462
|
+
this.detectOnMove = detectOnMove;
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* 设置控制杆尺寸
|
|
466
|
+
* @param size 控制杆尺寸 默认为1
|
|
467
|
+
*/
|
|
468
|
+
setSize(size) {
|
|
469
|
+
this.transformControl.setSize(size);
|
|
470
|
+
}
|
|
471
|
+
/**
|
|
472
|
+
* 设置X, Y, Z轴控制杆可见性
|
|
473
|
+
* @param x X轴控制杆可见性
|
|
474
|
+
* @param y Y轴控制杆可见性
|
|
475
|
+
* @param z Z轴控制杆可见性
|
|
476
|
+
*/
|
|
477
|
+
setStickVisibility(x, y, z, view) {
|
|
478
|
+
this.transformControl.updateViewVisibilitySettings({ showX: x, showY: y, showZ: z }, view);
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
* 设置平移时移动的最小单位
|
|
482
|
+
* @param snap 移动最小单位, 默认值为null
|
|
483
|
+
*/
|
|
484
|
+
setTransitionSnap(snap) {
|
|
485
|
+
this.transformControl.setTranslationSnap(snap);
|
|
486
|
+
}
|
|
487
|
+
/**
|
|
488
|
+
* 设置旋转时的最小旋转单位
|
|
489
|
+
* @param snap 旋转最小单位, 单位为弧度, 默认值为null
|
|
490
|
+
*/
|
|
491
|
+
setRotationSnap(snap) {
|
|
492
|
+
this.transformControl.setRotationSnap(snap);
|
|
493
|
+
}
|
|
494
|
+
setEnabled(value) {
|
|
495
|
+
// super.setEnabled(value);
|
|
496
|
+
this.transformControl.enabled = value;
|
|
497
|
+
if (value) {
|
|
498
|
+
this.unregisterPointerEvents(this.view.container);
|
|
499
|
+
this.registerPointerEvents(this.view.container);
|
|
500
|
+
}
|
|
501
|
+
else {
|
|
502
|
+
this.unregisterPointerEvents(this.view.container);
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
bindElement(e, detectOnScreen) {
|
|
506
|
+
if (detectOnScreen === true) {
|
|
507
|
+
if (Array.isArray(e)) {
|
|
508
|
+
e.forEach((ele) => { this.selectableElementsOnScreen.add(ele); });
|
|
509
|
+
}
|
|
510
|
+
else
|
|
511
|
+
this.selectableElementsOnScreen.add(e);
|
|
512
|
+
}
|
|
513
|
+
else if (Array.isArray(e)) {
|
|
514
|
+
e.forEach((ele) => { this.selectableElements.add(ele); });
|
|
515
|
+
}
|
|
516
|
+
else
|
|
517
|
+
this.selectableElements.add(e);
|
|
518
|
+
}
|
|
519
|
+
unbindElement(e) {
|
|
520
|
+
if (Array.isArray(e)) {
|
|
521
|
+
e.forEach((ele) => {
|
|
522
|
+
if (ele === this.activeElement)
|
|
523
|
+
this.detach();
|
|
524
|
+
this.selectableElements.delete(ele);
|
|
525
|
+
this.selectableElementsOnScreen.delete(ele);
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
else {
|
|
529
|
+
if (e === this.activeElement)
|
|
530
|
+
this.detach();
|
|
531
|
+
this.selectableElements.delete(e);
|
|
532
|
+
this.selectableElementsOnScreen.delete(e);
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
set2DElementDetectionRadius(distance) {
|
|
536
|
+
this.elementResponseDistance2D = distance;
|
|
537
|
+
}
|
|
538
|
+
setElementWorldDetectionDistance(distance) {
|
|
539
|
+
this.elementWorldDetectionDistance = distance;
|
|
540
|
+
}
|
|
541
|
+
setOnScreenElementWorldDetectionDistance(distance) {
|
|
542
|
+
this.onScreenElementWorldDetectionDistance = distance;
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
export { TransformController };
|