@openglobus/og 0.23.0 → 0.24.1
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/@openglobus/js/Clock.d.ts +2 -2
- package/lib/@openglobus/js/Globe.d.ts +10 -6
- package/lib/@openglobus/js/LonLat.d.ts +2 -2
- package/lib/@openglobus/js/Object3d.d.ts +3 -2
- package/lib/@openglobus/js/Popup.d.ts +7 -4
- package/lib/@openglobus/js/astro/astro.d.ts +1 -1
- package/lib/@openglobus/js/astro/earth.d.ts +1 -1
- package/lib/@openglobus/js/bv/Box.d.ts +1 -1
- package/lib/@openglobus/js/camera/Camera.d.ts +55 -19
- package/lib/@openglobus/js/camera/Frustum.d.ts +2 -2
- package/lib/@openglobus/js/camera/PlanetCamera.d.ts +14 -1
- package/lib/@openglobus/js/control/Atmosphere.d.ts +3 -3
- package/lib/@openglobus/js/control/AtmosphereConfig.d.ts +2 -2
- package/lib/@openglobus/js/control/CameraLock.d.ts +3 -3
- package/lib/@openglobus/js/control/CompassButton.d.ts +1 -1
- package/lib/@openglobus/js/control/DebugInfo.d.ts +1 -1
- package/lib/@openglobus/js/control/EarthCoordinates.d.ts +2 -2
- package/lib/@openglobus/js/control/GeoImageDragControl.d.ts +2 -2
- package/lib/@openglobus/js/control/KeyboardNavigation.d.ts +1 -1
- package/lib/@openglobus/js/control/LayerAnimation.d.ts +2 -2
- package/lib/@openglobus/js/control/LayerSwitcher.d.ts +4 -2
- package/lib/@openglobus/js/control/Lighting.d.ts +2 -1
- package/lib/@openglobus/js/control/MouseNavigation.d.ts +64 -52
- package/lib/@openglobus/js/control/OldMouseNavigation.d.ts +65 -0
- package/lib/@openglobus/js/control/RulerSwitcher.d.ts +2 -1
- package/lib/@openglobus/js/control/ScaleControl.d.ts +2 -1
- package/lib/@openglobus/js/control/SegmentBoundVisualization.d.ts +2 -1
- package/lib/@openglobus/js/control/ShowFps.d.ts +2 -1
- package/lib/@openglobus/js/control/SimpleNavigation.d.ts +3 -2
- package/lib/@openglobus/js/control/SimpleSkyBackground.d.ts +2 -1
- package/lib/@openglobus/js/control/Sun.d.ts +2 -1
- package/lib/@openglobus/js/control/ToggleWireframe.d.ts +2 -1
- package/lib/@openglobus/js/control/TouchNavigation.d.ts +3 -2
- package/lib/@openglobus/js/control/ZoomControl.d.ts +2 -1
- package/lib/@openglobus/js/control/drawing/DrawingControl.d.ts +1 -1
- package/lib/@openglobus/js/control/drawing/LineStringDrawingScene.d.ts +1 -1
- package/lib/@openglobus/js/control/drawing/PolygonDrawingScene.d.ts +3 -3
- package/lib/@openglobus/js/control/elevationProfile/ElevationProfile.d.ts +1 -1
- package/lib/@openglobus/js/control/elevationProfile/ElevationProfileButtonsView.d.ts +3 -2
- package/lib/@openglobus/js/control/elevationProfile/ElevationProfileControl.d.ts +2 -2
- package/lib/@openglobus/js/control/elevationProfile/ElevationProfileLegend.d.ts +1 -1
- package/lib/@openglobus/js/control/elevationProfile/ElevationProfileScene.d.ts +2 -2
- package/lib/@openglobus/js/control/elevationProfile/ElevationProfileView.d.ts +6 -4
- package/lib/@openglobus/js/control/elevationProfile/PointListDialog.d.ts +1 -1
- package/lib/@openglobus/js/control/geoObjectEditor/ArrowEntity.d.ts +1 -1
- package/lib/@openglobus/js/control/geoObjectEditor/AxisTrackEntity.d.ts +1 -1
- package/lib/@openglobus/js/control/geoObjectEditor/GeoObjectEditor.d.ts +1 -1
- package/lib/@openglobus/js/control/geoObjectEditor/GeoObjectEditorDialog.d.ts +1 -1
- package/lib/@openglobus/js/control/geoObjectEditor/GeoObjectEditorScene.d.ts +2 -2
- package/lib/@openglobus/js/control/geoObjectEditor/MoveAxisEntity.d.ts +1 -1
- package/lib/@openglobus/js/control/geoObjectEditor/MovePlaneEntity.d.ts +1 -1
- package/lib/@openglobus/js/control/geoObjectEditor/RotateEntity.d.ts +1 -1
- package/lib/@openglobus/js/control/heightRuler/HeightRuler.d.ts +1 -1
- package/lib/@openglobus/js/control/heightRuler/HeightRulerScene.d.ts +1 -1
- package/lib/@openglobus/js/control/index.d.ts +1 -2
- package/lib/@openglobus/js/control/ruler/Ruler.d.ts +2 -1
- package/lib/@openglobus/js/control/ruler/RulerScene.d.ts +2 -2
- package/lib/@openglobus/js/control/selection/Selection.d.ts +2 -1
- package/lib/@openglobus/js/control/timeline/TimelineControl.d.ts +1 -1
- package/lib/@openglobus/js/control/timeline/TimelineModel.d.ts +1 -1
- package/lib/@openglobus/js/control/timeline/TimelineView.d.ts +4 -3
- package/lib/@openglobus/js/ellipsoid/Ellipsoid.d.ts +1 -1
- package/lib/@openglobus/js/entity/BaseBillboard.d.ts +6 -3
- package/lib/@openglobus/js/entity/BaseBillboardHandler.d.ts +2 -2
- package/lib/@openglobus/js/entity/Billboard.d.ts +3 -2
- package/lib/@openglobus/js/entity/Entity.d.ts +47 -32
- package/lib/@openglobus/js/entity/EntityCollection.d.ts +4 -3
- package/lib/@openglobus/js/entity/GeoObject.d.ts +2 -11
- package/lib/@openglobus/js/entity/Geometry.d.ts +4 -3
- package/lib/@openglobus/js/entity/GeometryHandler.d.ts +3 -2
- package/lib/@openglobus/js/entity/InstanceData.d.ts +2 -2
- package/lib/@openglobus/js/entity/Label.d.ts +4 -2
- package/lib/@openglobus/js/entity/LabelHandler.d.ts +1 -1
- package/lib/@openglobus/js/entity/PointCloud.d.ts +1 -1
- package/lib/@openglobus/js/entity/Polyline.d.ts +9 -7
- package/lib/@openglobus/js/entity/Ray.d.ts +4 -2
- package/lib/@openglobus/js/entity/RayHandler.d.ts +2 -2
- package/lib/@openglobus/js/entity/Strip.d.ts +5 -3
- package/lib/@openglobus/js/input/KeyboardHandler.d.ts +1 -1
- package/lib/@openglobus/js/input/MouseHandler.d.ts +1 -0
- package/lib/@openglobus/js/layer/BaseGeoImage.d.ts +6 -5
- package/lib/@openglobus/js/layer/Bing.d.ts +2 -1
- package/lib/@openglobus/js/layer/CanvasTiles.d.ts +4 -3
- package/lib/@openglobus/js/layer/GeoImage.d.ts +2 -1
- package/lib/@openglobus/js/layer/GeoTexture2d.d.ts +3 -2
- package/lib/@openglobus/js/layer/GeoVideo.d.ts +2 -1
- package/lib/@openglobus/js/layer/KML.d.ts +5 -3
- package/lib/@openglobus/js/layer/Layer.d.ts +5 -4
- package/lib/@openglobus/js/layer/Material.d.ts +2 -2
- package/lib/@openglobus/js/layer/OpenStreetMap.d.ts +2 -1
- package/lib/@openglobus/js/layer/Vector.d.ts +9 -7
- package/lib/@openglobus/js/layer/WMS.d.ts +2 -1
- package/lib/@openglobus/js/layer/XYZ.d.ts +4 -3
- package/lib/@openglobus/js/math/Mat3.d.ts +1 -1
- package/lib/@openglobus/js/math/Mat4.d.ts +10 -1
- package/lib/@openglobus/js/math/Plane.d.ts +3 -1
- package/lib/@openglobus/js/math/Quat.d.ts +7 -1
- package/lib/@openglobus/js/math/Ray.d.ts +6 -16
- package/lib/@openglobus/js/math/Vec2.d.ts +22 -0
- package/lib/@openglobus/js/math/Vec3.d.ts +3 -2
- package/lib/@openglobus/js/math/coder.d.ts +5 -3
- package/lib/@openglobus/js/math/index.d.ts +6 -3
- package/lib/@openglobus/js/math.d.ts +2 -2
- package/lib/@openglobus/js/quadTree/earth/EarthEntityCollectionNodeLonLat.d.ts +2 -1
- package/lib/@openglobus/js/quadTree/earth/EarthQuadTreeStrategy.d.ts +0 -2
- package/lib/@openglobus/js/quadTree/equi/EquiEntityCollectionNodeLonLat.d.ts +2 -1
- package/lib/@openglobus/js/renderer/Renderer.d.ts +5 -3
- package/lib/@openglobus/js/renderer/RendererEvents.d.ts +7 -3
- package/lib/@openglobus/js/scene/Axes.d.ts +1 -1
- package/lib/@openglobus/js/scene/Planet.d.ts +12 -6
- package/lib/@openglobus/js/scene/SkyBox.d.ts +1 -1
- package/lib/@openglobus/js/segment/Segment.d.ts +7 -5
- package/lib/@openglobus/js/segment/SegmentLonLat.d.ts +1 -1
- package/lib/@openglobus/js/segment/SegmentLonLatEqui.d.ts +1 -1
- package/lib/@openglobus/js/shaders/atmos.d.ts +1 -1
- package/lib/@openglobus/js/shaders/drawnode.d.ts +1 -1
- package/lib/@openglobus/js/terrain/BilTerrain.d.ts +3 -2
- package/lib/@openglobus/js/terrain/EmptyTerrain.d.ts +1 -1
- package/lib/@openglobus/js/terrain/GlobusRgbTerrain.d.ts +2 -1
- package/lib/@openglobus/js/terrain/GlobusTerrain.d.ts +5 -4
- package/lib/@openglobus/js/terrain/RgbTerrain.d.ts +3 -2
- package/lib/@openglobus/js/ui/Button.d.ts +3 -2
- package/lib/@openglobus/js/ui/ButtonGroup.d.ts +1 -1
- package/lib/@openglobus/js/ui/Checkbox.d.ts +3 -2
- package/lib/@openglobus/js/ui/Color.d.ts +3 -2
- package/lib/@openglobus/js/ui/Dialog.d.ts +3 -2
- package/lib/@openglobus/js/ui/Input.d.ts +3 -2
- package/lib/@openglobus/js/ui/Slider.d.ts +3 -2
- package/lib/@openglobus/js/ui/ToggleButton.d.ts +4 -3
- package/lib/@openglobus/js/ui/View.d.ts +1 -1
- package/lib/@openglobus/js/utils/FontAtlas.d.ts +1 -1
- package/lib/@openglobus/js/utils/GeoImageCreator.d.ts +1 -1
- package/lib/@openglobus/js/utils/Loader.d.ts +1 -1
- package/lib/@openglobus/js/utils/NormalMapCreator.d.ts +2 -1
- package/lib/@openglobus/js/utils/TerrainWorker.d.ts +1 -1
- package/lib/@openglobus/js/utils/TextureAtlas.d.ts +4 -2
- package/lib/@openglobus/js/utils/objParser.d.ts +1 -1
- package/lib/@openglobus/js/utils/shared.d.ts +5 -3
- package/lib/@openglobus/js/webgl/Framebuffer.d.ts +3 -2
- package/lib/@openglobus/js/webgl/Handler.d.ts +32 -19
- package/lib/@openglobus/js/webgl/Multisample.d.ts +2 -1
- package/lib/@openglobus/js/webgl/Program.d.ts +2 -2
- package/lib/@openglobus/js/webgl/ProgramController.d.ts +2 -1
- package/lib/@openglobus/js/webgl/variableHandlers.d.ts +1 -1
- package/lib/@openglobus/og.esm.js +1 -1
- package/lib/@openglobus/og.esm.js.map +1 -1
- package/lib/@openglobus/og.umd.js +1 -1
- package/lib/@openglobus/og.umd.js.map +1 -1
- package/lib/js/Clock.d.ts +2 -2
- package/lib/js/Globe.d.ts +10 -6
- package/lib/js/Globe.js +10 -4
- package/lib/js/LonLat.d.ts +2 -2
- package/lib/js/Object3d.d.ts +3 -2
- package/lib/js/Popup.d.ts +7 -4
- package/lib/js/Popup.js +1 -1
- package/lib/js/astro/astro.d.ts +1 -1
- package/lib/js/astro/earth.d.ts +1 -1
- package/lib/js/bv/Box.d.ts +1 -1
- package/lib/js/camera/Camera.d.ts +55 -19
- package/lib/js/camera/Camera.js +82 -28
- package/lib/js/camera/Frustum.d.ts +2 -2
- package/lib/js/camera/PlanetCamera.d.ts +14 -1
- package/lib/js/camera/PlanetCamera.js +52 -5
- package/lib/js/control/Atmosphere.d.ts +3 -3
- package/lib/js/control/AtmosphereConfig.d.ts +2 -2
- package/lib/js/control/CameraLock.d.ts +3 -3
- package/lib/js/control/CameraLock.js +1 -1
- package/lib/js/control/CompassButton.d.ts +1 -1
- package/lib/js/control/DebugInfo.d.ts +1 -1
- package/lib/js/control/DebugInfo.js +30 -10
- package/lib/js/control/EarthCoordinates.d.ts +2 -2
- package/lib/js/control/GeoImageDragControl.d.ts +2 -2
- package/lib/js/control/KeyboardNavigation.d.ts +1 -1
- package/lib/js/control/KeyboardNavigation.js +8 -8
- package/lib/js/control/LayerAnimation.d.ts +2 -2
- package/lib/js/control/LayerSwitcher.d.ts +4 -2
- package/lib/js/control/Lighting.d.ts +2 -1
- package/lib/js/control/MouseNavigation.d.ts +64 -52
- package/lib/js/control/MouseNavigation.js +361 -305
- package/lib/js/control/MouseWheelZoomControl.d.ts +0 -44
- package/lib/js/control/MouseWheelZoomControl.js +270 -181
- package/lib/js/control/OldMouseNavigation.d.ts +65 -0
- package/lib/js/control/OldMouseNavigation.js +368 -0
- package/lib/js/control/RulerSwitcher.d.ts +2 -1
- package/lib/js/control/ScaleControl.d.ts +2 -1
- package/lib/js/control/ScaleControl.js +2 -2
- package/lib/js/control/SegmentBoundVisualization.d.ts +2 -1
- package/lib/js/control/ShowFps.d.ts +2 -1
- package/lib/js/control/SimpleNavigation.d.ts +3 -2
- package/lib/js/control/SimpleNavigation.js +8 -7
- package/lib/js/control/SimpleSkyBackground.d.ts +2 -1
- package/lib/js/control/Sun.d.ts +2 -1
- package/lib/js/control/Sun.js +5 -5
- package/lib/js/control/ToggleWireframe.d.ts +2 -1
- package/lib/js/control/TouchNavigation.d.ts +3 -2
- package/lib/js/control/TouchNavigation.js +11 -8
- package/lib/js/control/ZoomControl.d.ts +2 -1
- package/lib/js/control/drawing/DrawingControl.d.ts +1 -1
- package/lib/js/control/drawing/LineStringDrawingScene.d.ts +1 -1
- package/lib/js/control/drawing/PolygonDrawingScene.d.ts +3 -3
- package/lib/js/control/elevationProfile/ElevationProfile.d.ts +1 -1
- package/lib/js/control/elevationProfile/ElevationProfileButtonsView.d.ts +3 -2
- package/lib/js/control/elevationProfile/ElevationProfileControl.d.ts +2 -2
- package/lib/js/control/elevationProfile/ElevationProfileLegend.d.ts +1 -1
- package/lib/js/control/elevationProfile/ElevationProfileScene.d.ts +2 -2
- package/lib/js/control/elevationProfile/ElevationProfileScene.js +2 -1
- package/lib/js/control/elevationProfile/ElevationProfileView.d.ts +6 -4
- package/lib/js/control/elevationProfile/ElevationProfileView.js +1 -1
- package/lib/js/control/elevationProfile/PointListDialog.d.ts +1 -1
- package/lib/js/control/geoObjectEditor/ArrowEntity.d.ts +1 -1
- package/lib/js/control/geoObjectEditor/AxisTrackEntity.d.ts +1 -1
- package/lib/js/control/geoObjectEditor/GeoObjectEditor.d.ts +1 -1
- package/lib/js/control/geoObjectEditor/GeoObjectEditorDialog.d.ts +1 -1
- package/lib/js/control/geoObjectEditor/GeoObjectEditorDialog.js +19 -33
- package/lib/js/control/geoObjectEditor/GeoObjectEditorScene.d.ts +2 -2
- package/lib/js/control/geoObjectEditor/GeoObjectEditorScene.js +18 -18
- package/lib/js/control/geoObjectEditor/MoveAxisEntity.d.ts +1 -1
- package/lib/js/control/geoObjectEditor/MoveAxisEntity.js +3 -2
- package/lib/js/control/geoObjectEditor/MovePlaneEntity.d.ts +1 -1
- package/lib/js/control/geoObjectEditor/MovePlaneEntity.js +1 -4
- package/lib/js/control/geoObjectEditor/RotateEntity.d.ts +1 -1
- package/lib/js/control/geoObjectEditor/RotateEntity.js +1 -1
- package/lib/js/control/heightRuler/HeightRuler.d.ts +1 -1
- package/lib/js/control/heightRuler/HeightRulerScene.d.ts +1 -1
- package/lib/js/control/index.d.ts +1 -2
- package/lib/js/control/index.js +1 -2
- package/lib/js/control/ruler/Ruler.d.ts +2 -1
- package/lib/js/control/ruler/RulerScene.d.ts +2 -2
- package/lib/js/control/selection/Selection.d.ts +2 -1
- package/lib/js/control/timeline/TimelineControl.d.ts +1 -1
- package/lib/js/control/timeline/TimelineModel.d.ts +1 -1
- package/lib/js/control/timeline/TimelineView.d.ts +4 -3
- package/lib/js/control/visibleExtent/Segment.js +4 -4
- package/lib/js/ellipsoid/Ellipsoid.d.ts +1 -1
- package/lib/js/ellipsoid/Ellipsoid.js +1 -1
- package/lib/js/entity/BaseBillboard.d.ts +6 -3
- package/lib/js/entity/BaseBillboardHandler.d.ts +2 -2
- package/lib/js/entity/Billboard.d.ts +3 -2
- package/lib/js/entity/Entity.d.ts +47 -32
- package/lib/js/entity/Entity.js +62 -47
- package/lib/js/entity/EntityCollection.d.ts +4 -3
- package/lib/js/entity/GeoObject.d.ts +2 -11
- package/lib/js/entity/GeoObject.js +0 -3
- package/lib/js/entity/Geometry.d.ts +4 -3
- package/lib/js/entity/GeometryHandler.d.ts +3 -2
- package/lib/js/entity/InstanceData.d.ts +2 -2
- package/lib/js/entity/InstanceData.js +6 -3
- package/lib/js/entity/Label.d.ts +4 -2
- package/lib/js/entity/LabelHandler.d.ts +1 -1
- package/lib/js/entity/PointCloud.d.ts +1 -1
- package/lib/js/entity/Polyline.d.ts +9 -7
- package/lib/js/entity/Polyline.js +2 -1
- package/lib/js/entity/Ray.d.ts +4 -2
- package/lib/js/entity/RayHandler.d.ts +2 -2
- package/lib/js/entity/Strip.d.ts +5 -3
- package/lib/js/input/KeyboardHandler.d.ts +1 -1
- package/lib/js/input/MouseHandler.d.ts +1 -0
- package/lib/js/input/MouseHandler.js +12 -1
- package/lib/js/layer/BaseGeoImage.d.ts +6 -5
- package/lib/js/layer/Bing.d.ts +2 -1
- package/lib/js/layer/CanvasTiles.d.ts +4 -3
- package/lib/js/layer/GeoImage.d.ts +2 -1
- package/lib/js/layer/GeoTexture2d.d.ts +3 -2
- package/lib/js/layer/GeoVideo.d.ts +2 -1
- package/lib/js/layer/KML.d.ts +5 -3
- package/lib/js/layer/KML.js +1 -1
- package/lib/js/layer/Layer.d.ts +5 -4
- package/lib/js/layer/Material.d.ts +2 -2
- package/lib/js/layer/OpenStreetMap.d.ts +2 -1
- package/lib/js/layer/Vector.d.ts +9 -7
- package/lib/js/layer/Vector.js +1 -1
- package/lib/js/layer/WMS.d.ts +2 -1
- package/lib/js/layer/XYZ.d.ts +4 -3
- package/lib/js/math/Mat3.d.ts +1 -1
- package/lib/js/math/Mat3.js +1 -1
- package/lib/js/math/Mat4.d.ts +10 -1
- package/lib/js/math/Mat4.js +17 -1
- package/lib/js/math/Plane.d.ts +3 -1
- package/lib/js/math/Plane.js +11 -1
- package/lib/js/math/Quat.d.ts +7 -1
- package/lib/js/math/Quat.js +7 -1
- package/lib/js/math/Ray.d.ts +6 -16
- package/lib/js/math/Ray.js +53 -46
- package/lib/js/math/Vec2.d.ts +22 -0
- package/lib/js/math/Vec2.js +32 -0
- package/lib/js/math/Vec3.d.ts +3 -2
- package/lib/js/math/coder.d.ts +5 -3
- package/lib/js/math/index.d.ts +6 -3
- package/lib/js/math.d.ts +2 -2
- package/lib/js/math.js +2 -2
- package/lib/js/quadTree/earth/EarthEntityCollectionNodeLonLat.d.ts +2 -1
- package/lib/js/quadTree/earth/EarthQuadTreeStrategy.d.ts +0 -2
- package/lib/js/quadTree/equi/EquiEntityCollectionNodeLonLat.d.ts +2 -1
- package/lib/js/renderer/Renderer.d.ts +5 -3
- package/lib/js/renderer/Renderer.js +10 -6
- package/lib/js/renderer/RendererEvents.d.ts +7 -3
- package/lib/js/renderer/RendererEvents.js +5 -3
- package/lib/js/scene/Axes.d.ts +1 -1
- package/lib/js/scene/Planet.d.ts +12 -6
- package/lib/js/scene/Planet.js +24 -3
- package/lib/js/scene/SkyBox.d.ts +1 -1
- package/lib/js/segment/Segment.d.ts +7 -5
- package/lib/js/segment/Segment.js +4 -4
- package/lib/js/segment/SegmentLonLat.d.ts +1 -1
- package/lib/js/segment/SegmentLonLatEqui.d.ts +1 -1
- package/lib/js/shaders/atmos.d.ts +1 -1
- package/lib/js/shaders/drawnode.d.ts +1 -1
- package/lib/js/terrain/BilTerrain.d.ts +3 -2
- package/lib/js/terrain/EmptyTerrain.d.ts +1 -1
- package/lib/js/terrain/GlobusRgbTerrain.d.ts +2 -1
- package/lib/js/terrain/GlobusTerrain.d.ts +5 -4
- package/lib/js/terrain/GlobusTerrain.js +2 -2
- package/lib/js/terrain/RgbTerrain.d.ts +3 -2
- package/lib/js/ui/Button.d.ts +3 -2
- package/lib/js/ui/ButtonGroup.d.ts +1 -1
- package/lib/js/ui/Checkbox.d.ts +3 -2
- package/lib/js/ui/Color.d.ts +3 -2
- package/lib/js/ui/Dialog.d.ts +3 -2
- package/lib/js/ui/Input.d.ts +3 -2
- package/lib/js/ui/Slider.d.ts +3 -2
- package/lib/js/ui/ToggleButton.d.ts +4 -3
- package/lib/js/ui/View.d.ts +1 -1
- package/lib/js/utils/FontAtlas.d.ts +1 -1
- package/lib/js/utils/GeoImageCreator.d.ts +1 -1
- package/lib/js/utils/Loader.d.ts +1 -1
- package/lib/js/utils/NormalMapCreator.d.ts +2 -1
- package/lib/js/utils/TerrainWorker.d.ts +1 -1
- package/lib/js/utils/TextureAtlas.d.ts +4 -2
- package/lib/js/utils/objParser.d.ts +1 -1
- package/lib/js/utils/shared.d.ts +5 -3
- package/lib/js/webgl/Framebuffer.d.ts +3 -2
- package/lib/js/webgl/Handler.d.ts +32 -19
- package/lib/js/webgl/Handler.js +48 -36
- package/lib/js/webgl/Multisample.d.ts +2 -1
- package/lib/js/webgl/Program.d.ts +2 -2
- package/lib/js/webgl/ProgramController.d.ts +2 -1
- package/lib/js/webgl/variableHandlers.d.ts +1 -1
- package/package.json +2 -2
- package/lib/@openglobus/js/control/EarthNavigation.d.ts +0 -50
- package/lib/@openglobus/js/control/MouseWheelZoomControl.d.ts +0 -44
- package/lib/js/control/EarthNavigation.d.ts +0 -50
- package/lib/js/control/EarthNavigation.js +0 -202
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
import * as math from "../math";
|
|
2
|
+
import { Control } from "./Control";
|
|
3
|
+
import { input } from "../input/input";
|
|
4
|
+
import { Key } from "../Lock";
|
|
5
|
+
import { LonLat } from "../LonLat";
|
|
6
|
+
import { Mat4 } from "../math/Mat4";
|
|
7
|
+
import { Quat } from "../math/Quat";
|
|
8
|
+
import { Ray } from "../math/Ray";
|
|
9
|
+
import { Sphere } from "../bv/Sphere";
|
|
10
|
+
import { Vec3 } from "../math/Vec3";
|
|
11
|
+
import { Plane } from "../math/Plane";
|
|
12
|
+
/**
|
|
13
|
+
* Mouse planet camera dragging control.
|
|
14
|
+
*/
|
|
15
|
+
export class OldMouseNavigation extends Control {
|
|
16
|
+
constructor(options = {}) {
|
|
17
|
+
super(options);
|
|
18
|
+
this._deactivate = false;
|
|
19
|
+
this._shiftBusy = false;
|
|
20
|
+
this._name = "mouseNavigation";
|
|
21
|
+
this.grabbedPoint = new Vec3();
|
|
22
|
+
this._eye0 = new Vec3();
|
|
23
|
+
this.pointOnEarth = new Vec3();
|
|
24
|
+
this.earthUp = new Vec3();
|
|
25
|
+
this.inertia = 0.007;
|
|
26
|
+
this.grabbedSpheroid = new Sphere();
|
|
27
|
+
this.qRot = new Quat();
|
|
28
|
+
this.scaleRot = 0.0;
|
|
29
|
+
this.distDiff = 0.3;
|
|
30
|
+
this.stepsCount = 8;
|
|
31
|
+
this.stepsForward = null;
|
|
32
|
+
this.stepIndex = 0;
|
|
33
|
+
this._lmbDoubleClickActive = true;
|
|
34
|
+
this.minSlope = options.minSlope || 0.1;
|
|
35
|
+
this._wheelDirection = +1;
|
|
36
|
+
this._keyLock = new Key();
|
|
37
|
+
}
|
|
38
|
+
static getMovePointsFromPixelTerrain(cam, planet, stepsCount, delta, point, forward, dir) {
|
|
39
|
+
const steps = [];
|
|
40
|
+
let eye = cam.eye.clone(), n = cam.getBackward(), u = cam.getRight(), v = cam.getUp();
|
|
41
|
+
let a = planet.getCartesianFromPixelTerrain(point);
|
|
42
|
+
if (!a) {
|
|
43
|
+
a = planet.getCartesianFromPixelTerrain(planet.renderer.handler.getCenter());
|
|
44
|
+
}
|
|
45
|
+
if (a) {
|
|
46
|
+
if (!dir) {
|
|
47
|
+
dir = Vec3.sub(a, cam.eye).normalize();
|
|
48
|
+
}
|
|
49
|
+
let d = (delta * cam.eye.distance(a)) / stepsCount;
|
|
50
|
+
if (forward) {
|
|
51
|
+
d = -1.25 * d;
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
d *= 2;
|
|
55
|
+
}
|
|
56
|
+
const scaled_n = n.scaleTo(d);
|
|
57
|
+
const slope = dir.dot(cam.eye.normal().negate());
|
|
58
|
+
if (slope >= 0.1) {
|
|
59
|
+
const grabbedSpheroid = new Sphere();
|
|
60
|
+
grabbedSpheroid.radius = a.length();
|
|
61
|
+
let rotArr = [], eyeArr = [];
|
|
62
|
+
let breaked = false;
|
|
63
|
+
for (let i = 0; i < stepsCount; i++) {
|
|
64
|
+
eye.addA(scaled_n);
|
|
65
|
+
const b = new Ray(eye, dir).hitSphere(grabbedSpheroid);
|
|
66
|
+
eyeArr[i] = eye.clone();
|
|
67
|
+
if (b) {
|
|
68
|
+
rotArr[i] = new Mat4().rotateBetweenVectors(a.normal(), b.normal());
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
breaked = true;
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
if (!breaked) {
|
|
76
|
+
for (let i = 0; i < stepsCount; i++) {
|
|
77
|
+
let rot = rotArr[i];
|
|
78
|
+
steps[i] = {
|
|
79
|
+
eye: rot.mulVec3(eyeArr[i]),
|
|
80
|
+
v: rot.mulVec3(v),
|
|
81
|
+
u: rot.mulVec3(u),
|
|
82
|
+
n: rot.mulVec3(n)
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
eye = cam.eye.clone();
|
|
88
|
+
for (let i = 0; i < stepsCount; i++) {
|
|
89
|
+
steps[i] = {
|
|
90
|
+
eye: eye.addA(scaled_n).clone(),
|
|
91
|
+
v: v,
|
|
92
|
+
u: u,
|
|
93
|
+
n: n,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
for (let i = 0; i < stepsCount; i++) {
|
|
100
|
+
steps[i] = {
|
|
101
|
+
eye: eye.addA(dir.scaleTo(-d)).clone(),
|
|
102
|
+
v: v,
|
|
103
|
+
u: u,
|
|
104
|
+
n: n,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return steps;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
onactivate() {
|
|
112
|
+
if (this.renderer) {
|
|
113
|
+
this.renderer.events.on("mousewheel", this.onMouseWheel, this);
|
|
114
|
+
this.renderer.events.on("lhold", this.onMouseLeftButtonDown, this);
|
|
115
|
+
this.renderer.events.on("rhold", this.onMouseRightButtonDown, this);
|
|
116
|
+
this.renderer.events.on("ldown", this.onMouseLeftButtonClick, this);
|
|
117
|
+
this.renderer.events.on("lup", this.onMouseLeftButtonUp, this);
|
|
118
|
+
this.renderer.events.on("rdown", this.onMouseRightButtonClick, this);
|
|
119
|
+
this.renderer.events.on("draw", this.onDraw, this, -1000);
|
|
120
|
+
this.renderer.events.on("mousemove", this.onMouseMove, this);
|
|
121
|
+
this.renderer.events.on("mouseleave", this.onMouseLeave, this);
|
|
122
|
+
this.renderer.events.on("mouseenter", this.onMouseEnter, this);
|
|
123
|
+
if (this._lmbDoubleClickActive) {
|
|
124
|
+
this.renderer.events.on("ldblclick", this.onMouseLeftButtonDoubleClick, this);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
ondeactivate() {
|
|
129
|
+
if (this.renderer) {
|
|
130
|
+
this.renderer.events.off("mousewheel", this.onMouseWheel);
|
|
131
|
+
this.renderer.events.off("lhold", this.onMouseLeftButtonDown);
|
|
132
|
+
this.renderer.events.off("rhold", this.onMouseRightButtonDown);
|
|
133
|
+
this.renderer.events.off("ldown", this.onMouseLeftButtonClick);
|
|
134
|
+
this.renderer.events.off("lup", this.onMouseLeftButtonUp);
|
|
135
|
+
this.renderer.events.off("rdown", this.onMouseRightButtonClick);
|
|
136
|
+
this.renderer.events.off("draw", this.onDraw);
|
|
137
|
+
this.renderer.events.off("ldblclick", this.onMouseLeftButtonDoubleClick);
|
|
138
|
+
this.renderer.events.off("mouseleave", this.onMouseLeave);
|
|
139
|
+
this.renderer.events.off("mouseenter", this.onMouseEnter);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
activateDoubleClickZoom() {
|
|
143
|
+
if (!this._lmbDoubleClickActive) {
|
|
144
|
+
this._lmbDoubleClickActive = true;
|
|
145
|
+
this.renderer && this.renderer.events.on("ldblclick", this.onMouseLeftButtonDoubleClick, this);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
deactivateDoubleClickZoom() {
|
|
149
|
+
if (this._lmbDoubleClickActive) {
|
|
150
|
+
this._lmbDoubleClickActive = false;
|
|
151
|
+
this.renderer && this.renderer.events.off("ldblclick", this.onMouseLeftButtonDoubleClick);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
onMouseEnter(e) {
|
|
155
|
+
const renderEvents = this.renderer.events;
|
|
156
|
+
if (renderEvents.isKeyPressed(input.KEY_ALT)) {
|
|
157
|
+
renderEvents.releaseKeys();
|
|
158
|
+
}
|
|
159
|
+
renderEvents.updateButtonsStates(e.sys.buttons);
|
|
160
|
+
if (renderEvents.mouseState.leftButtonDown) {
|
|
161
|
+
this.renderer.handler.canvas.classList.add("ogGrabbingPoiner");
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
this.renderer.handler.canvas.classList.remove("ogGrabbingPoiner");
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
onMouseLeave() {
|
|
168
|
+
if (this.renderer.events.mouseState.leftButtonDown) {
|
|
169
|
+
this.scaleRot = 0;
|
|
170
|
+
}
|
|
171
|
+
this.renderer.handler.canvas.classList.remove("ogGrabbingPoiner");
|
|
172
|
+
}
|
|
173
|
+
onMouseWheel(e) {
|
|
174
|
+
if (this.stepIndex) {
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
this.planet.stopFlying();
|
|
178
|
+
this.stopRotation();
|
|
179
|
+
this._deactivate = true;
|
|
180
|
+
this.lockPlanet(true);
|
|
181
|
+
this.stepsForward = OldMouseNavigation.getMovePointsFromPixelTerrain(this.planet.camera, this.planet, this.stepsCount, this.distDiff, e.pos, e.wheelDelta > 0, e.direction) || null;
|
|
182
|
+
this._wheelDirection = e.wheelDelta;
|
|
183
|
+
if (this.stepsForward) {
|
|
184
|
+
this.stepIndex = this.stepsCount;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
oninit() {
|
|
188
|
+
this.activate();
|
|
189
|
+
if (this.renderer) {
|
|
190
|
+
this.renderer.events.on("keyfree", input.KEY_ALT, this.onShiftFree, this);
|
|
191
|
+
this.renderer.events.on("keyfree", input.KEY_PRINTSCREEN, this.onShiftFree, this);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
onMouseLeftButtonDoubleClick(e) {
|
|
195
|
+
this.planet.stopFlying();
|
|
196
|
+
this.stopRotation();
|
|
197
|
+
const p = this.planet.getCartesianFromPixelTerrain(e.pos);
|
|
198
|
+
if (p) {
|
|
199
|
+
const cam = this.planet.camera;
|
|
200
|
+
let maxAlt = cam.maxAltitude + this.planet.ellipsoid.polarSize;
|
|
201
|
+
let minAlt = cam.minAltitude + this.planet.ellipsoid.polarSize;
|
|
202
|
+
const camAlt = cam.eye.length();
|
|
203
|
+
const g = this.planet.ellipsoid.cartesianToLonLat(p);
|
|
204
|
+
if (camAlt > maxAlt || camAlt < minAlt) {
|
|
205
|
+
this.planet.flyLonLat(new LonLat(g.lon, g.lat));
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
if (this.renderer.events.isKeyPressed(input.KEY_ALT)) {
|
|
209
|
+
this.planet.flyLonLat(new LonLat(g.lon, g.lat, cam.eye.distance(p) * 2.0));
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
this.planet.flyLonLat(new LonLat(g.lon, g.lat, cam.eye.distance(p) * 0.57));
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
onMouseLeftButtonClick() {
|
|
217
|
+
if (this._active) {
|
|
218
|
+
this.renderer.handler.canvas.classList.add("ogGrabbingPoiner");
|
|
219
|
+
this.grabbedPoint = this.planet.getCartesianFromMouseTerrain();
|
|
220
|
+
if (this.grabbedPoint) {
|
|
221
|
+
this._eye0.copy(this.planet.camera.eye);
|
|
222
|
+
this.grabbedSpheroid.radius = this.grabbedPoint.length();
|
|
223
|
+
this.stopRotation();
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
stopRotation() {
|
|
228
|
+
this.qRot.clear();
|
|
229
|
+
this.freePlanet();
|
|
230
|
+
}
|
|
231
|
+
onMouseLeftButtonUp(e) {
|
|
232
|
+
this.renderer.handler.canvas.classList.remove("ogGrabbingPoiner");
|
|
233
|
+
if (e.x === e.prev_x && e.y === e.prev_y) {
|
|
234
|
+
this.scaleRot = 0.0;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
onMouseLeftButtonDown(e) {
|
|
238
|
+
if (this._active) {
|
|
239
|
+
if (!this.grabbedPoint) {
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
this.planet.stopFlying();
|
|
243
|
+
if (e.moving) {
|
|
244
|
+
let cam = this.planet.camera;
|
|
245
|
+
if (cam.slope > 0.2) {
|
|
246
|
+
const targetPoint = new Ray(cam.eye, e.direction).hitSphere(this.grabbedSpheroid);
|
|
247
|
+
if (targetPoint) {
|
|
248
|
+
this.scaleRot = 1.0;
|
|
249
|
+
this.qRot = Quat.getRotationBetweenVectors(targetPoint.normal(), this.grabbedPoint.normal());
|
|
250
|
+
let rot = this.qRot;
|
|
251
|
+
cam.eye = rot.mulVec3(cam.eye);
|
|
252
|
+
cam.rotate(rot);
|
|
253
|
+
// cam._u = rot.mulVec3(cam._u);
|
|
254
|
+
// cam._r = rot.mulVec3(cam._r);
|
|
255
|
+
// cam._b = rot.mulVec3(cam._b);
|
|
256
|
+
// cam._f.set(-cam._b.x, -cam._b.y, -cam._b.z);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
else {
|
|
260
|
+
let p0 = this.grabbedPoint, p1 = Vec3.add(p0, cam.getRight()), p2 = Vec3.add(p0, p0.normal());
|
|
261
|
+
let px = new Vec3();
|
|
262
|
+
if (new Ray(cam.eye, e.direction).hitPlaneRes(Plane.fromPoints(p0, p1, p2), px) === Ray.INSIDE) {
|
|
263
|
+
cam.eye = this._eye0.addA(px.subA(p0).negate());
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
onMouseRightButtonClick(e) {
|
|
270
|
+
this.stopRotation();
|
|
271
|
+
this.planet.stopFlying();
|
|
272
|
+
this.pointOnEarth = this.planet.getCartesianFromPixelTerrain(e.pos);
|
|
273
|
+
if (this.pointOnEarth) {
|
|
274
|
+
this.earthUp = this.pointOnEarth.normal();
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
onMouseRightButtonDown(e) {
|
|
278
|
+
const cam = this.planet.camera;
|
|
279
|
+
if (this.pointOnEarth && e.moving) {
|
|
280
|
+
this.renderer.controlsBag.scaleRot = 1.0;
|
|
281
|
+
let l = (0.5 / cam.eye.distance(this.pointOnEarth)) * cam._lonLat.height * math.RADIANS;
|
|
282
|
+
if (l > 0.007) {
|
|
283
|
+
l = 0.007;
|
|
284
|
+
}
|
|
285
|
+
else if (l < 0.003) {
|
|
286
|
+
l = 0.003;
|
|
287
|
+
}
|
|
288
|
+
cam.rotateHorizontal(l * (e.x - e.prev_x), false, this.pointOnEarth, this.earthUp);
|
|
289
|
+
cam.rotateVertical(l * (e.y - e.prev_y), this.pointOnEarth, this.minSlope);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
onShiftFree() {
|
|
293
|
+
this._shiftBusy = false;
|
|
294
|
+
}
|
|
295
|
+
onMouseMove(e) {
|
|
296
|
+
if (this._active && this.renderer.events.isKeyPressed(input.KEY_ALT)) {
|
|
297
|
+
if (!this._shiftBusy) {
|
|
298
|
+
this._shiftBusy = true;
|
|
299
|
+
this.onMouseRightButtonClick(e);
|
|
300
|
+
}
|
|
301
|
+
this.onMouseRightButtonDown(e);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
onDraw() {
|
|
305
|
+
if (this._active) {
|
|
306
|
+
const r = this.renderer;
|
|
307
|
+
const cam = this.planet.camera;
|
|
308
|
+
let prevEye = cam.eye.clone();
|
|
309
|
+
if (this.stepIndex) {
|
|
310
|
+
r.controlsBag.scaleRot = 1.0;
|
|
311
|
+
const sf = this.stepsForward[this.stepsCount - this.stepIndex--];
|
|
312
|
+
cam.eye = sf.eye;
|
|
313
|
+
//@ts-ignore
|
|
314
|
+
cam._u = sf.v;
|
|
315
|
+
//@ts-ignore
|
|
316
|
+
cam._r = sf.u;
|
|
317
|
+
//@ts-ignore
|
|
318
|
+
cam._b = sf.n;
|
|
319
|
+
//@ts-ignore
|
|
320
|
+
cam._f.set(-cam._b.x, -cam._b.y, -cam._b.z);
|
|
321
|
+
}
|
|
322
|
+
else {
|
|
323
|
+
if (this._deactivate) {
|
|
324
|
+
this._deactivate = false;
|
|
325
|
+
this.freePlanet();
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
if (r.events.mouseState.leftButtonDown || !this.scaleRot) {
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
this.scaleRot -= this.inertia;
|
|
332
|
+
if (this.scaleRot <= 0.0) {
|
|
333
|
+
this.scaleRot = 0.0;
|
|
334
|
+
}
|
|
335
|
+
else {
|
|
336
|
+
r.controlsBag.scaleRot = this.scaleRot;
|
|
337
|
+
let rot = this.qRot
|
|
338
|
+
.slerp(Quat.IDENTITY, 1.0 - this.scaleRot * this.scaleRot * this.scaleRot)
|
|
339
|
+
.normalize();
|
|
340
|
+
if (!(rot.x || rot.y || rot.z)) {
|
|
341
|
+
this.scaleRot = 0.0;
|
|
342
|
+
}
|
|
343
|
+
cam.eye = rot.mulVec3(cam.eye);
|
|
344
|
+
cam.rotate(rot);
|
|
345
|
+
// cam._u = rot.mulVec3(cam._u);
|
|
346
|
+
// cam._r = rot.mulVec3(cam._r);
|
|
347
|
+
// cam._b = rot.mulVec3(cam._b);
|
|
348
|
+
// cam._f.set(-cam._b.x, -cam._b.y, -cam._b.z);
|
|
349
|
+
}
|
|
350
|
+
if (cam.eye.distance(prevEye) / cam.getAltitude() > 0.01) {
|
|
351
|
+
this.lockPlanet();
|
|
352
|
+
}
|
|
353
|
+
else {
|
|
354
|
+
this.freePlanet();
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
lockPlanet(skipTerrain) {
|
|
359
|
+
this.planet.layerLock.lock(this._keyLock);
|
|
360
|
+
!skipTerrain && this.planet.terrainLock.lock(this._keyLock);
|
|
361
|
+
this.planet._normalMapCreator.lock(this._keyLock);
|
|
362
|
+
}
|
|
363
|
+
freePlanet() {
|
|
364
|
+
this.planet.layerLock.free(this._keyLock);
|
|
365
|
+
this.planet.terrainLock.free(this._keyLock);
|
|
366
|
+
this.planet._normalMapCreator.free(this._keyLock);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Control
|
|
1
|
+
import { Control } from "./Control";
|
|
2
|
+
import type { IControlParams } from "./Control";
|
|
2
3
|
import { HeightRuler } from "./heightRuler/HeightRuler";
|
|
3
4
|
interface IRulerSwitcherParams extends IControlParams {
|
|
4
5
|
ignoreTerrain?: boolean;
|
|
@@ -63,13 +63,13 @@ export class ScaleControl extends Control {
|
|
|
63
63
|
let s0 = px;
|
|
64
64
|
let dist = this.planet.getDistanceFromPixel(s0) || 0;
|
|
65
65
|
if (dist === 0) {
|
|
66
|
-
s0 = cam.
|
|
66
|
+
s0 = cam.project3v(Vec3.ZERO);
|
|
67
67
|
dist = this.planet.getDistanceFromPixel(s0) || 0;
|
|
68
68
|
}
|
|
69
69
|
let p0 = cam.getForward().scaleTo(dist).addA(cam.eye);
|
|
70
70
|
let tempSize = dist * Math.tan(cam.viewAngle * RADIANS);
|
|
71
71
|
let p1 = p0.add(cam.getRight().scaleTo(tempSize));
|
|
72
|
-
let s1 = cam.
|
|
72
|
+
let s1 = cam.project3v(p1);
|
|
73
73
|
this._mPx = tempSize / s1.distance(s0);
|
|
74
74
|
let metersInMinSize = this._mPx * this._minWidth;
|
|
75
75
|
let index = binarySearch(scale, metersInMinSize, (a, b) => a - b);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Control
|
|
2
|
-
import {
|
|
1
|
+
import { Control } from "./Control";
|
|
2
|
+
import type { IControlParams } from "./Control";
|
|
3
|
+
import type { IMouseState } from "../renderer/RendererEvents";
|
|
3
4
|
import { Vec3 } from "../math/Vec3";
|
|
4
5
|
interface ISimpleNavigationParams extends IControlParams {
|
|
5
6
|
speed?: number;
|
|
@@ -3,6 +3,7 @@ import { input } from "../input/input";
|
|
|
3
3
|
import { Vec3 } from "../math/Vec3";
|
|
4
4
|
import * as math from "../math";
|
|
5
5
|
import { Ray } from "../math/Ray";
|
|
6
|
+
import { Plane } from "../math/Plane";
|
|
6
7
|
/**
|
|
7
8
|
* Simple keyboard camera navigation with W,S,A,D and shift keys to fly around the scene.
|
|
8
9
|
*/
|
|
@@ -45,7 +46,7 @@ export class SimpleNavigation extends Control {
|
|
|
45
46
|
p2 = Vec3.add(p0, Vec3.UP);
|
|
46
47
|
}
|
|
47
48
|
let px = new Vec3();
|
|
48
|
-
if (new Ray(cam.eye, e.direction).
|
|
49
|
+
if (new Ray(cam.eye, e.direction).hitPlaneRes(Plane.fromPoints(p0, p1, p2), px) === Ray.INSIDE) {
|
|
49
50
|
cam.eye = this._eye0.addA(px.subA(p0).negate());
|
|
50
51
|
}
|
|
51
52
|
}
|
|
@@ -97,32 +98,32 @@ export class SimpleNavigation extends Control {
|
|
|
97
98
|
};
|
|
98
99
|
this.onCameraLookUp = () => {
|
|
99
100
|
let cam = this.renderer.activeCamera;
|
|
100
|
-
cam.
|
|
101
|
+
cam.setPitch(0.5);
|
|
101
102
|
cam.update();
|
|
102
103
|
};
|
|
103
104
|
this.onCameraLookDown = () => {
|
|
104
105
|
let cam = this.renderer.activeCamera;
|
|
105
|
-
cam.
|
|
106
|
+
cam.setPitch(-0.5);
|
|
106
107
|
cam.update();
|
|
107
108
|
};
|
|
108
109
|
this.onCameraTurnLeft = () => {
|
|
109
110
|
let cam = this.renderer.activeCamera;
|
|
110
|
-
cam.
|
|
111
|
+
cam.setYaw(0.5);
|
|
111
112
|
cam.update();
|
|
112
113
|
};
|
|
113
114
|
this.onCameraTurnRight = () => {
|
|
114
115
|
let cam = this.renderer.activeCamera;
|
|
115
|
-
cam.
|
|
116
|
+
cam.setYaw(-0.5);
|
|
116
117
|
cam.update();
|
|
117
118
|
};
|
|
118
119
|
this.onCameraRollLeft = () => {
|
|
119
120
|
let cam = this.renderer.activeCamera;
|
|
120
|
-
cam.
|
|
121
|
+
cam.setRoll(-0.5);
|
|
121
122
|
cam.update();
|
|
122
123
|
};
|
|
123
124
|
this.onCameraRollRight = () => {
|
|
124
125
|
let cam = this.renderer.activeCamera;
|
|
125
|
-
cam.
|
|
126
|
+
cam.setRoll(0.5);
|
|
126
127
|
cam.update();
|
|
127
128
|
};
|
|
128
129
|
this.speed = options.speed || 1.0; // m/s
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Control
|
|
1
|
+
import { Control } from "./Control";
|
|
2
|
+
import type { IControlParams } from "./Control";
|
|
2
3
|
interface ISimpleSkyBackgroundParams extends IControlParams {
|
|
3
4
|
}
|
|
4
5
|
export declare class SimpleSkyBackground extends Control {
|
package/lib/js/control/Sun.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Control
|
|
1
|
+
import { Control } from "./Control";
|
|
2
|
+
import type { IControlParams } from "./Control";
|
|
2
3
|
import { Clock } from "../Clock";
|
|
3
4
|
import { LightSource } from "../light/LightSource";
|
|
4
5
|
interface ISunParams extends IControlParams {
|
package/lib/js/control/Sun.js
CHANGED
|
@@ -71,18 +71,18 @@ export class Sun extends Control {
|
|
|
71
71
|
this._lightOn = true;
|
|
72
72
|
this._f = 1;
|
|
73
73
|
let n = cam.eye.normal(), u = cam.getForward();
|
|
74
|
-
u.scale(Math.sign(cam.
|
|
74
|
+
u.scale(Math.sign(cam.getUp().dot(n))); // up
|
|
75
75
|
if (cam.slope > 0.99) {
|
|
76
|
-
u = cam.
|
|
76
|
+
u = cam.getUp();
|
|
77
77
|
}
|
|
78
78
|
let tu = Vec3.proj_b_to_plane(u, n, u).normalize().scale(this.offsetVertical);
|
|
79
|
-
let tr = Vec3.proj_b_to_plane(cam.
|
|
79
|
+
let tr = Vec3.proj_b_to_plane(cam.getRight(), n, cam.getRight())
|
|
80
80
|
.normalize()
|
|
81
81
|
.scale(this.offsetHorizontal); // right
|
|
82
82
|
let d = tu.add(tr);
|
|
83
83
|
let pos = cam.eye.add(d);
|
|
84
84
|
if (this._k > 0) {
|
|
85
|
-
this._k -= 0.
|
|
85
|
+
this._k -= 0.001;
|
|
86
86
|
let rot = Quat.getRotationBetweenVectors(this.sunlight._position.normal(), pos.normal());
|
|
87
87
|
let r = rot.slerp(Quat.IDENTITY, this._k).normalize();
|
|
88
88
|
this.sunlight.setPosition3v(r.mulVec3(this.sunlight._position));
|
|
@@ -94,7 +94,7 @@ export class Sun extends Control {
|
|
|
94
94
|
else {
|
|
95
95
|
this._k = 1;
|
|
96
96
|
if (this._f > 0) {
|
|
97
|
-
this._f -= 0.
|
|
97
|
+
this._f -= 0.001;
|
|
98
98
|
let rot = Quat.getRotationBetweenVectors(this.sunlight._position.normal(), getSunPosition(this._currDate).normal());
|
|
99
99
|
let r = rot.slerp(Quat.IDENTITY, this._f).normalize();
|
|
100
100
|
this.sunlight.setPosition3v(r.mulVec3(this.sunlight._position));
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { Control
|
|
1
|
+
import { Control } from "./Control";
|
|
2
|
+
import type { IControlParams } from "./Control";
|
|
2
3
|
import { Key } from "../Lock";
|
|
3
4
|
import { Quat } from "../math/Quat";
|
|
4
5
|
import { Sphere } from "../bv/Sphere";
|
|
5
6
|
import { Vec2 } from "../math/Vec2";
|
|
6
7
|
import { Vec3 } from "../math/Vec3";
|
|
7
|
-
import { ITouchState } from "../renderer/RendererEvents";
|
|
8
|
+
import type { ITouchState } from "../renderer/RendererEvents";
|
|
8
9
|
interface ITouchNavigationParams extends IControlParams {
|
|
9
10
|
}
|
|
10
11
|
declare class TouchExt {
|
|
@@ -7,6 +7,7 @@ import { Ray } from "../math/Ray";
|
|
|
7
7
|
import { Sphere } from "../bv/Sphere";
|
|
8
8
|
import { Vec2 } from "../math/Vec2";
|
|
9
9
|
import { Vec3 } from "../math/Vec3";
|
|
10
|
+
import { Plane } from "../math/Plane";
|
|
10
11
|
class TouchExt {
|
|
11
12
|
constructor() {
|
|
12
13
|
this.x = 0;
|
|
@@ -198,18 +199,19 @@ export class TouchNavigation extends Control {
|
|
|
198
199
|
this.qRot = Quat.getRotationBetweenVectors(targetPoint.normal(), t.grabbedPoint.normal());
|
|
199
200
|
let rot = this.qRot;
|
|
200
201
|
cam.eye = rot.mulVec3(cam.eye);
|
|
201
|
-
cam.
|
|
202
|
-
cam.
|
|
203
|
-
cam.
|
|
202
|
+
cam.rotate(rot);
|
|
203
|
+
// cam._r = rot.mulVec3(cam._r);
|
|
204
|
+
// cam._u = rot.mulVec3(cam._u);
|
|
205
|
+
// cam._b = rot.mulVec3(cam._b);
|
|
204
206
|
cam.checkTerrainCollision();
|
|
205
207
|
cam.update();
|
|
206
208
|
this.scaleRot = 1;
|
|
207
209
|
}
|
|
208
210
|
else {
|
|
209
|
-
let p0 = t.grabbedPoint, p1 = Vec3.add(p0, cam.
|
|
211
|
+
let p0 = t.grabbedPoint, p1 = Vec3.add(p0, cam.getUp()), p2 = Vec3.add(p0, p0.getNormal());
|
|
210
212
|
let dir = cam.unproject(t.x, t.y);
|
|
211
213
|
let px = new Vec3();
|
|
212
|
-
if (new Ray(cam.eye, dir).
|
|
214
|
+
if (new Ray(cam.eye, dir).hitPlaneRes(Plane.fromPoints(p0, p1, p2), px) === Ray.INSIDE) {
|
|
213
215
|
cam.eye = this._eye0.addA(px.subA(p0).negate());
|
|
214
216
|
cam.checkTerrainCollision();
|
|
215
217
|
cam.update();
|
|
@@ -243,9 +245,10 @@ export class TouchNavigation extends Control {
|
|
|
243
245
|
this.scaleRot = 0;
|
|
244
246
|
}
|
|
245
247
|
cam.eye = rot.mulVec3(cam.eye);
|
|
246
|
-
cam.
|
|
247
|
-
cam.
|
|
248
|
-
cam.
|
|
248
|
+
cam.rotate(rot);
|
|
249
|
+
// cam._r = rot.mulVec3(cam._r);
|
|
250
|
+
// cam._u = rot.mulVec3(cam._u);
|
|
251
|
+
// cam._b = rot.mulVec3(cam._b);
|
|
249
252
|
cam.checkTerrainCollision();
|
|
250
253
|
cam.update();
|
|
251
254
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Key } from "../Lock";
|
|
2
|
-
import { Control
|
|
2
|
+
import { Control } from "./Control";
|
|
3
|
+
import type { IControlParams } from "./Control";
|
|
3
4
|
import { Renderer } from "../renderer/Renderer";
|
|
4
5
|
import { Vec2 } from "../math/Vec2";
|
|
5
6
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Control, IControlParams } from "../Control";
|
|
1
|
+
import { Control, type IControlParams } from "../Control";
|
|
2
2
|
import { PolygonDrawingScene } from "./PolygonDrawingScene";
|
|
3
3
|
declare class DrawingControl extends Control {
|
|
4
4
|
protected _drawingScene: PolygonDrawingScene;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Vec2 } from "../../math/Vec2";
|
|
2
2
|
import { Vec3 } from "../../math/Vec3";
|
|
3
|
-
import { PolygonDrawingScene, IPolygonDrawingSceneParams } from "./PolygonDrawingScene";
|
|
3
|
+
import { PolygonDrawingScene, type IPolygonDrawingSceneParams } from "./PolygonDrawingScene";
|
|
4
4
|
declare class LineStringDrawingScene extends PolygonDrawingScene {
|
|
5
5
|
constructor(props: IPolygonDrawingSceneParams);
|
|
6
6
|
get geometryType(): string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { EventsHandler } from '../../Events';
|
|
2
|
-
import { CoordinatesType } from "../../entity/Geometry";
|
|
1
|
+
import { type EventsHandler } from '../../Events';
|
|
2
|
+
import type { CoordinatesType } from "../../entity/Geometry";
|
|
3
3
|
import { Entity } from '../../entity/Entity';
|
|
4
|
-
import { IMouseState } from "../../renderer/RendererEvents";
|
|
4
|
+
import type { IMouseState } from "../../renderer/RendererEvents";
|
|
5
5
|
import { Object3d } from '../../Object3d';
|
|
6
6
|
import { Planet } from '../../scene/Planet';
|
|
7
7
|
import { RenderNode } from '../../scene/RenderNode';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { View
|
|
1
|
+
import { View } from "../../ui/View";
|
|
2
|
+
import type { IViewParams, ViewEventsList } from "../../ui/View";
|
|
2
3
|
import { ToggleButton } from "../../ui/ToggleButton";
|
|
3
|
-
import { EventsHandler } from "../../Events";
|
|
4
|
+
import type { EventsHandler } from "../../Events";
|
|
4
5
|
import { ElevationProfile } from "./ElevationProfile";
|
|
5
6
|
interface IElevationProfileButtonsViewParams extends IViewParams {
|
|
6
7
|
}
|