@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
package/lib/js/Clock.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EventsHandler } from "./Events";
|
|
2
|
-
import { JulianDate } from "./astro/jd";
|
|
1
|
+
import { type EventsHandler } from "./Events";
|
|
2
|
+
import type { JulianDate } from "./astro/jd";
|
|
3
3
|
import { Handler } from "./webgl/Handler";
|
|
4
4
|
type ClockEventsList = ["tick", "end", "start", "stop"];
|
|
5
5
|
export interface IClockParams {
|
package/lib/js/Globe.d.ts
CHANGED
|
@@ -2,14 +2,15 @@ import { Control } from "./control/Control";
|
|
|
2
2
|
import { Ellipsoid } from "./ellipsoid/Ellipsoid";
|
|
3
3
|
import { EmptyTerrain } from "./terrain/EmptyTerrain";
|
|
4
4
|
import { Layer } from "./layer/Layer";
|
|
5
|
-
import { NumberArray2 } from "./math/Vec2";
|
|
6
|
-
import { NumberArray4 } from "./math/Vec4";
|
|
5
|
+
import type { NumberArray2 } from "./math/Vec2";
|
|
6
|
+
import type { NumberArray4 } from "./math/Vec4";
|
|
7
7
|
import { Planet } from "./scene/Planet";
|
|
8
8
|
import { Sun } from "./control/Sun";
|
|
9
|
-
import {
|
|
9
|
+
import { Renderer } from "./renderer/Renderer";
|
|
10
|
+
import type { HTMLDivElementExt } from "./renderer/Renderer";
|
|
10
11
|
import { RenderNode } from "./scene/RenderNode";
|
|
11
12
|
import { Extent } from "./Extent";
|
|
12
|
-
import { IAtmosphereParams } from "./control/Atmosphere";
|
|
13
|
+
import type { IAtmosphereParams } from "./control/Atmosphere";
|
|
13
14
|
export interface IGlobeParams {
|
|
14
15
|
attributionContainer?: HTMLElement;
|
|
15
16
|
target?: string | HTMLElement;
|
|
@@ -33,7 +34,6 @@ export interface IGlobeParams {
|
|
|
33
34
|
transitionOpacityEnabled?: boolean;
|
|
34
35
|
terrain?: EmptyTerrain;
|
|
35
36
|
controls?: Control[];
|
|
36
|
-
useEarthNavigation?: boolean;
|
|
37
37
|
minSlope?: number;
|
|
38
38
|
sun?: {
|
|
39
39
|
active?: boolean;
|
|
@@ -48,6 +48,10 @@ export interface IGlobeParams {
|
|
|
48
48
|
gamma?: number;
|
|
49
49
|
exposure?: number;
|
|
50
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* @typedef {Array<number>} LonLatCoordinate
|
|
53
|
+
* @typedef {Array<LonLatCoordinate>} ExtentBoundingBox
|
|
54
|
+
*/
|
|
51
55
|
/**
|
|
52
56
|
* Creates a WebGL context with globe.
|
|
53
57
|
* @class
|
|
@@ -79,7 +83,7 @@ export interface IGlobeParams {
|
|
|
79
83
|
* @param {EmptyTerrain} [options.terrain] - Terrain provider. Default no terrain - og.terrain.EmptyTerrain.
|
|
80
84
|
* @param {Array.<Control>} [options.controls] - Renderer controls array.
|
|
81
85
|
* @param {Array.<Layer>} [options.layers] - Planet layers.
|
|
82
|
-
* @param {Extent|
|
|
86
|
+
* @param {Extent | ExtentBoundingBox} [options.viewExtent] [options.viewExtent] - Viewable starting extent.
|
|
83
87
|
* @param {boolean} [options.autoActivate=true] - Globe rendering auto activation flag. True is default.
|
|
84
88
|
* @param {HTMLElement} [options.attributionContainer] - Container for attribution list.
|
|
85
89
|
* @param {number} [options.maxGridSize=128] = Maximal segment grid size. 128 is default
|
package/lib/js/Globe.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
// #
|
|
1
|
+
// #StandWith
|
|
2
2
|
import { CompassButton } from "./control/CompassButton";
|
|
3
3
|
import { EarthCoordinates } from "./control/EarthCoordinates";
|
|
4
|
-
import { EarthNavigation } from "./control/EarthNavigation";
|
|
5
4
|
import { EmptyTerrain } from "./terrain/EmptyTerrain";
|
|
6
5
|
import { Handler } from "./webgl/Handler";
|
|
7
6
|
import { isEmpty } from "./utils/shared";
|
|
@@ -17,6 +16,10 @@ const DEFAULT_SPEC_SRC = `/spec.png`;
|
|
|
17
16
|
const DEFAULT_RESOURCES_SRC = '/res';
|
|
18
17
|
/** @const {string} */
|
|
19
18
|
const PLANET_NAME_PREFIX = "globus_planet_";
|
|
19
|
+
/**
|
|
20
|
+
* @typedef {Array<number>} LonLatCoordinate
|
|
21
|
+
* @typedef {Array<LonLatCoordinate>} ExtentBoundingBox
|
|
22
|
+
*/
|
|
20
23
|
/**
|
|
21
24
|
* Creates a WebGL context with globe.
|
|
22
25
|
* @class
|
|
@@ -48,7 +51,7 @@ const PLANET_NAME_PREFIX = "globus_planet_";
|
|
|
48
51
|
* @param {EmptyTerrain} [options.terrain] - Terrain provider. Default no terrain - og.terrain.EmptyTerrain.
|
|
49
52
|
* @param {Array.<Control>} [options.controls] - Renderer controls array.
|
|
50
53
|
* @param {Array.<Layer>} [options.layers] - Planet layers.
|
|
51
|
-
* @param {Extent|
|
|
54
|
+
* @param {Extent | ExtentBoundingBox} [options.viewExtent] [options.viewExtent] - Viewable starting extent.
|
|
52
55
|
* @param {boolean} [options.autoActivate=true] - Globe rendering auto activation flag. True is default.
|
|
53
56
|
* @param {HTMLElement} [options.attributionContainer] - Container for attribution list.
|
|
54
57
|
* @param {number} [options.maxGridSize=128] = Maximal segment grid size. 128 is default
|
|
@@ -178,7 +181,7 @@ class Globe {
|
|
|
178
181
|
else {
|
|
179
182
|
this.planet.addControls([
|
|
180
183
|
new ZoomControl(),
|
|
181
|
-
|
|
184
|
+
new MouseNavigation(),
|
|
182
185
|
new TouchNavigation(),
|
|
183
186
|
new EarthCoordinates(),
|
|
184
187
|
new ScaleControl(),
|
|
@@ -262,6 +265,9 @@ class Globe {
|
|
|
262
265
|
t.appendChild(this.$inner);
|
|
263
266
|
}
|
|
264
267
|
}
|
|
268
|
+
else {
|
|
269
|
+
console.warn(`Target container not found. Provided target: ${target}`);
|
|
270
|
+
}
|
|
265
271
|
}
|
|
266
272
|
detach() {
|
|
267
273
|
if (this.$target) {
|
package/lib/js/LonLat.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NumberArray2 } from "./math/Vec2";
|
|
2
|
-
import { NumberArray3 } from "./math/Vec3";
|
|
1
|
+
import type { NumberArray2 } from "./math/Vec2";
|
|
2
|
+
import type { NumberArray3 } from "./math/Vec3";
|
|
3
3
|
/**
|
|
4
4
|
* Represents a geographical point with a certain latitude, longitude and height.
|
|
5
5
|
* @class
|
package/lib/js/Object3d.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { TypedArray } from './utils/shared';
|
|
2
|
-
import {
|
|
1
|
+
import type { TypedArray } from './utils/shared';
|
|
2
|
+
import { Vec3 } from './math/Vec3';
|
|
3
|
+
import type { NumberArray3 } from './math/Vec3';
|
|
3
4
|
import { Mat4 } from "./math/Mat4";
|
|
4
5
|
interface IObject3dParams {
|
|
5
6
|
name?: string;
|
package/lib/js/Popup.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { EventsHandler } from "./Events";
|
|
1
|
+
import type { EventsHandler } from "./Events";
|
|
2
2
|
import { LonLat } from "./LonLat";
|
|
3
3
|
import { Planet } from "./scene/Planet";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { Vec2 } from "./math/Vec2";
|
|
5
|
+
import { Vec3 } from "./math/Vec3";
|
|
6
|
+
import type { NumberArray2 } from "./math/Vec2";
|
|
7
|
+
import type { NumberArray3 } from "./math/Vec3";
|
|
8
|
+
import { View } from './ui/View';
|
|
9
|
+
import type { IViewParams, ViewEventsList } from './ui/View';
|
|
7
10
|
interface IPopupParams extends IViewParams {
|
|
8
11
|
planet: Planet;
|
|
9
12
|
title?: string;
|
package/lib/js/Popup.js
CHANGED
|
@@ -117,7 +117,7 @@ class Popup extends View {
|
|
|
117
117
|
let look = cart.sub(cam.eye), v = Math.sqrt((f + g) * (f + g) - f * f);
|
|
118
118
|
if (v > look.length() && cam.getForward().dot(look.normalize()) > 0.0) {
|
|
119
119
|
this.el.style.display = "block";
|
|
120
|
-
this.setScreen(cam.
|
|
120
|
+
this.setScreen(cam.project3v(cart));
|
|
121
121
|
}
|
|
122
122
|
else {
|
|
123
123
|
this.el.style.display = "none";
|
package/lib/js/astro/astro.d.ts
CHANGED
package/lib/js/astro/earth.d.ts
CHANGED
package/lib/js/bv/Box.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Vec3 } from "../math/Vec3";
|
|
2
|
-
import { NumberArray6 } from "./Sphere";
|
|
2
|
+
import type { NumberArray6 } from "./Sphere";
|
|
3
3
|
import { Ellipsoid } from "../ellipsoid/Ellipsoid";
|
|
4
4
|
import { Extent } from "../Extent";
|
|
5
5
|
type Vec3Array8 = [Vec3, Vec3, Vec3, Vec3, Vec3, Vec3, Vec3, Vec3];
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import { EventsHandler } from "../Events";
|
|
1
|
+
import { type EventsHandler } from "../Events";
|
|
2
2
|
import { Frustum } from "./Frustum";
|
|
3
|
-
import { Mat3
|
|
4
|
-
import {
|
|
3
|
+
import { Mat3 } from "../math/Mat3";
|
|
4
|
+
import type { NumberArray9 } from "../math/Mat3";
|
|
5
|
+
import { Mat4 } from "../math/Mat4";
|
|
6
|
+
import type { NumberArray16 } from "../math/Mat4";
|
|
5
7
|
import { Renderer } from "../renderer/Renderer";
|
|
6
|
-
import { Vec2
|
|
8
|
+
import { Vec2 } from "../math/Vec2";
|
|
9
|
+
import type { NumberArray2 } from "../math/Vec2";
|
|
7
10
|
import { Vec3 } from "../math/Vec3";
|
|
8
11
|
import { Sphere } from "../bv/Sphere";
|
|
12
|
+
import { Quat } from "../math/Quat";
|
|
9
13
|
type CameraEvents = ["viewchange", "moveend"];
|
|
10
14
|
export interface ICameraParams {
|
|
11
15
|
eye?: Vec3;
|
|
@@ -89,22 +93,28 @@ declare class Camera {
|
|
|
89
93
|
protected _normalMatrix: Mat3;
|
|
90
94
|
/**
|
|
91
95
|
* Camera right vector.
|
|
92
|
-
* @
|
|
96
|
+
* @protected
|
|
93
97
|
* @type {Vec3}
|
|
94
98
|
*/
|
|
95
99
|
_r: Vec3;
|
|
96
100
|
/**
|
|
97
101
|
* Camera up vector.
|
|
98
|
-
* @
|
|
102
|
+
* @protected
|
|
99
103
|
* @type {Vec3}
|
|
100
104
|
*/
|
|
101
105
|
_u: Vec3;
|
|
102
106
|
/**
|
|
103
107
|
* Camera backward vector.
|
|
104
|
-
* @
|
|
108
|
+
* @protected
|
|
105
109
|
* @type {Vec3}
|
|
106
110
|
*/
|
|
107
111
|
_b: Vec3;
|
|
112
|
+
/**
|
|
113
|
+
* Camera forward vector.
|
|
114
|
+
* @protected
|
|
115
|
+
* @type {Vec3}
|
|
116
|
+
*/
|
|
117
|
+
_f: Vec3;
|
|
108
118
|
protected _pr: Vec3;
|
|
109
119
|
protected _pu: Vec3;
|
|
110
120
|
protected _pb: Vec3;
|
|
@@ -208,23 +218,40 @@ declare class Camera {
|
|
|
208
218
|
*/
|
|
209
219
|
slide(du: number, dv: number, dn: number): void;
|
|
210
220
|
/**
|
|
211
|
-
* Roll the camera to the angle in
|
|
221
|
+
* Roll the camera to the angle in radians
|
|
222
|
+
* @public
|
|
223
|
+
* @param {number} angle - Delta roll angle in radians
|
|
224
|
+
*/
|
|
225
|
+
setRoll(angle: number): void;
|
|
226
|
+
/**
|
|
227
|
+
* Pitch the camera to the angle in radians
|
|
212
228
|
* @public
|
|
213
|
-
* @param {number} angle - Delta
|
|
229
|
+
* @param {number} angle - Delta pitch angle in radians
|
|
214
230
|
*/
|
|
215
|
-
|
|
231
|
+
setPitch(angle: number): void;
|
|
216
232
|
/**
|
|
217
|
-
*
|
|
233
|
+
* Yaw the camera to the angle in radians
|
|
218
234
|
* @public
|
|
219
|
-
* @param {number} angle - Delta
|
|
235
|
+
* @param {number} angle - Delta yaw angle in radians
|
|
236
|
+
*/
|
|
237
|
+
setYaw(angle: number): void;
|
|
238
|
+
setPitchYawRoll(pitch: number, yaw: number, roll: number): void;
|
|
239
|
+
getPitch(): number;
|
|
240
|
+
getYaw(): number;
|
|
241
|
+
getRoll(): number;
|
|
242
|
+
/**
|
|
243
|
+
* Returns camera quaternion
|
|
220
244
|
*/
|
|
221
|
-
|
|
245
|
+
getRotation(): Quat;
|
|
246
|
+
setRotation(rot: Quat, up?: Vec3, right?: Vec3, back?: Vec3): void;
|
|
247
|
+
rotate(rot: Quat): void;
|
|
222
248
|
/**
|
|
223
|
-
*
|
|
249
|
+
* Returns normal vector direction to the unprojected screen point from camera eye
|
|
224
250
|
* @public
|
|
225
|
-
* @param {
|
|
251
|
+
* @param {Vec2} pos - Screen X coordinate
|
|
252
|
+
* @returns {Vec3} - Direction vector
|
|
226
253
|
*/
|
|
227
|
-
|
|
254
|
+
unproject2v(pos: Vec2): Vec3;
|
|
228
255
|
/**
|
|
229
256
|
* Returns normal vector direction to the unprojected screen point from camera eye
|
|
230
257
|
* @public
|
|
@@ -239,7 +266,16 @@ declare class Camera {
|
|
|
239
266
|
* @param {Vec3} v - Cartesian 3d coordinates
|
|
240
267
|
* @returns {Vec2} - Screen point coordinates
|
|
241
268
|
*/
|
|
242
|
-
|
|
269
|
+
project3v(v: Vec3): Vec2;
|
|
270
|
+
/**
|
|
271
|
+
* Gets projected 3d point to the 2d screen coordinates
|
|
272
|
+
* @public
|
|
273
|
+
* @param {number} x - X coordinate
|
|
274
|
+
* @param {number} y - Y coordinate
|
|
275
|
+
* @param {number} z - Z coordinate
|
|
276
|
+
* @returns {Vec2} - Screen point coordinates
|
|
277
|
+
*/
|
|
278
|
+
project(x: number, y: number, z: number): Vec2;
|
|
243
279
|
/**
|
|
244
280
|
* Rotates camera around center point
|
|
245
281
|
* @public
|
|
@@ -249,7 +285,7 @@ declare class Camera {
|
|
|
249
285
|
* @param {Vec3} [center] - Point that the camera rotates around
|
|
250
286
|
* @param {Vec3} [up] - Camera up vector
|
|
251
287
|
*/
|
|
252
|
-
rotateAround(angle: number, isArc?: boolean, center?: Vec3
|
|
288
|
+
rotateAround(angle: number, isArc?: boolean, center?: Vec3, up?: Vec3): void;
|
|
253
289
|
/**
|
|
254
290
|
* Rotates camera around center point by horizontal.
|
|
255
291
|
* @public
|
|
@@ -259,7 +295,7 @@ declare class Camera {
|
|
|
259
295
|
* @param {Vec3} [center] - Point that the camera rotates around.
|
|
260
296
|
* @param {Vec3} [up] - Camera up vector.
|
|
261
297
|
*/
|
|
262
|
-
rotateHorizontal(angle: number, isArc?: boolean, center?: Vec3
|
|
298
|
+
rotateHorizontal(angle: number, isArc?: boolean, center?: Vec3, up?: Vec3): void;
|
|
263
299
|
/**
|
|
264
300
|
* Rotates camera around center point by vertical.
|
|
265
301
|
* @param {number} angle - Rotation angle in radians.
|
package/lib/js/camera/Camera.js
CHANGED
|
@@ -7,6 +7,7 @@ import { Vec2 } from "../math/Vec2";
|
|
|
7
7
|
import { Vec3 } from "../math/Vec3";
|
|
8
8
|
import { Vec4 } from "../math/Vec4";
|
|
9
9
|
import { Quat } from "../math/Quat";
|
|
10
|
+
import { RADIANS } from "../math";
|
|
10
11
|
const EVENT_NAMES = [
|
|
11
12
|
/**
|
|
12
13
|
* When camera has been updated.
|
|
@@ -50,6 +51,7 @@ class Camera {
|
|
|
50
51
|
this._r = new Vec3(1.0, 0.0, 0.0);
|
|
51
52
|
this._u = new Vec3(0.0, 1.0, 0.0);
|
|
52
53
|
this._b = new Vec3(0.0, 0.0, 1.0);
|
|
54
|
+
this._f = this._b.negateTo();
|
|
53
55
|
// Previous frame values
|
|
54
56
|
this._pr = this._r.clone();
|
|
55
57
|
this._pu = this._u.clone();
|
|
@@ -147,7 +149,7 @@ class Camera {
|
|
|
147
149
|
return this._r.negateTo();
|
|
148
150
|
}
|
|
149
151
|
getForward() {
|
|
150
|
-
return this.
|
|
152
|
+
return this._f.clone();
|
|
151
153
|
}
|
|
152
154
|
getBackward() {
|
|
153
155
|
return this._b.clone();
|
|
@@ -218,7 +220,7 @@ class Camera {
|
|
|
218
220
|
this._tanViewAngle_hradOneByHeight =
|
|
219
221
|
this._tanViewAngle_hrad * this.renderer.handler._oneByHeight;
|
|
220
222
|
let c = this.renderer.handler.canvas;
|
|
221
|
-
this._projSizeConst = Math.min(c.clientWidth < 512 ? 512 : c.clientWidth, c.clientHeight < 512 ? 512 : c.clientHeight) / (angle *
|
|
223
|
+
this._projSizeConst = Math.min(c.clientWidth < 512 ? 512 : c.clientWidth, c.clientHeight < 512 ? 512 : c.clientHeight) / (angle * RADIANS);
|
|
222
224
|
for (let i = 0, len = this.frustums.length; i < len; i++) {
|
|
223
225
|
this.frustums[i].setProjectionMatrix(angle, aspect, this.frustums[i].near, this.frustums[i].far);
|
|
224
226
|
}
|
|
@@ -264,6 +266,7 @@ class Camera {
|
|
|
264
266
|
this._b.normalize();
|
|
265
267
|
this._r.normalize();
|
|
266
268
|
this._u.copy(this._b.cross(this._r));
|
|
269
|
+
this._f.set(-this._b.x, -this._b.y, -this._b.z);
|
|
267
270
|
return this;
|
|
268
271
|
}
|
|
269
272
|
/**
|
|
@@ -276,6 +279,7 @@ class Camera {
|
|
|
276
279
|
this._b.set(this.eye.x - look.x, this.eye.y - look.y, this.eye.z - look.z);
|
|
277
280
|
this._r.copy((up || this._u).cross(this._b));
|
|
278
281
|
this._b.normalize();
|
|
282
|
+
this._f.set(-this._b.x, -this._b.y, -this._b.z);
|
|
279
283
|
this._r.normalize();
|
|
280
284
|
this._u.copy(this._b.cross(this._r));
|
|
281
285
|
}
|
|
@@ -292,41 +296,82 @@ class Camera {
|
|
|
292
296
|
this.eye.z += du * this._r.z + dv * this._u.z + dn * this._b.z;
|
|
293
297
|
}
|
|
294
298
|
/**
|
|
295
|
-
* Roll the camera to the angle in
|
|
299
|
+
* Roll the camera to the angle in radians
|
|
296
300
|
* @public
|
|
297
|
-
* @param {number} angle - Delta roll angle in
|
|
301
|
+
* @param {number} angle - Delta roll angle in radians
|
|
298
302
|
*/
|
|
299
|
-
|
|
300
|
-
let cs = Math.cos(
|
|
301
|
-
let sn = Math.sin(
|
|
303
|
+
setRoll(angle) {
|
|
304
|
+
let cs = Math.cos(angle);
|
|
305
|
+
let sn = Math.sin(angle);
|
|
302
306
|
let t = this._r.clone();
|
|
303
307
|
this._r.set(cs * t.x - sn * this._u.x, cs * t.y - sn * this._u.y, cs * t.z - sn * this._u.z);
|
|
304
308
|
this._u.set(sn * t.x + cs * this._u.x, sn * t.y + cs * this._u.y, sn * t.z + cs * this._u.z);
|
|
305
309
|
}
|
|
306
310
|
/**
|
|
307
|
-
* Pitch the camera to the angle in
|
|
311
|
+
* Pitch the camera to the angle in radians
|
|
308
312
|
* @public
|
|
309
|
-
* @param {number} angle - Delta pitch angle in
|
|
313
|
+
* @param {number} angle - Delta pitch angle in radians
|
|
310
314
|
*/
|
|
311
|
-
|
|
312
|
-
let cs = Math.cos(
|
|
313
|
-
let sn = Math.sin(
|
|
314
|
-
let t = this._b
|
|
315
|
+
setPitch(angle) {
|
|
316
|
+
let cs = Math.cos(angle);
|
|
317
|
+
let sn = Math.sin(angle);
|
|
318
|
+
let t = this._b;
|
|
315
319
|
this._b.set(cs * t.x - sn * this._u.x, cs * t.y - sn * this._u.y, cs * t.z - sn * this._u.z);
|
|
316
320
|
this._u.set(sn * t.x + cs * this._u.x, sn * t.y + cs * this._u.y, sn * t.z + cs * this._u.z);
|
|
317
321
|
}
|
|
318
322
|
/**
|
|
319
|
-
* Yaw the camera to the angle in
|
|
323
|
+
* Yaw the camera to the angle in radians
|
|
320
324
|
* @public
|
|
321
|
-
* @param {number} angle - Delta yaw angle in
|
|
325
|
+
* @param {number} angle - Delta yaw angle in radians
|
|
322
326
|
*/
|
|
323
|
-
|
|
324
|
-
let cs = Math.cos(
|
|
325
|
-
let sn = Math.sin(
|
|
326
|
-
let t = this._r
|
|
327
|
+
setYaw(angle) {
|
|
328
|
+
let cs = Math.cos(angle);
|
|
329
|
+
let sn = Math.sin(angle);
|
|
330
|
+
let t = this._r;
|
|
327
331
|
this._r.set(cs * t.x - sn * this._b.x, cs * t.y - sn * this._b.y, cs * t.z - sn * this._b.z);
|
|
328
332
|
this._b.set(sn * t.x + cs * this._b.x, sn * t.y + cs * this._b.y, sn * t.z + cs * this._b.z);
|
|
329
333
|
}
|
|
334
|
+
setPitchYawRoll(pitch, yaw, roll) {
|
|
335
|
+
let qRot = new Quat();
|
|
336
|
+
qRot.setPitchYawRoll(pitch, yaw, roll);
|
|
337
|
+
this.setRotation(qRot);
|
|
338
|
+
}
|
|
339
|
+
getPitch() {
|
|
340
|
+
return this.getRotation().getPitch();
|
|
341
|
+
}
|
|
342
|
+
getYaw() {
|
|
343
|
+
return this.getRotation().getYaw();
|
|
344
|
+
}
|
|
345
|
+
getRoll() {
|
|
346
|
+
return this.getRotation().getRoll();
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Returns camera quaternion
|
|
350
|
+
*/
|
|
351
|
+
getRotation() {
|
|
352
|
+
return Quat.getLookRotation(this._f, this._u).conjugate();
|
|
353
|
+
}
|
|
354
|
+
setRotation(rot, up, right, back) {
|
|
355
|
+
rot.mulVec3Res(up || new Vec3(0, 1, 0), this._u);
|
|
356
|
+
rot.mulVec3Res(right || new Vec3(1, 0, 0), this._r);
|
|
357
|
+
rot.mulVec3Res(back || new Vec3(0, 0, 1), this._b);
|
|
358
|
+
this._f.set(-this._b.x, -this._b.y, -this._b.z);
|
|
359
|
+
}
|
|
360
|
+
rotate(rot) {
|
|
361
|
+
rot.mulVec3Res(this._u, this._u);
|
|
362
|
+
rot.mulVec3Res(this._r, this._r);
|
|
363
|
+
rot.mulVec3Res(this._b, this._b);
|
|
364
|
+
this._f.set(-this._b.x, -this._b.y, -this._b.z);
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Returns normal vector direction to the unprojected screen point from camera eye
|
|
368
|
+
* @public
|
|
369
|
+
* @param {Vec2} pos - Screen X coordinate
|
|
370
|
+
* @returns {Vec3} - Direction vector
|
|
371
|
+
*/
|
|
372
|
+
unproject2v(pos) {
|
|
373
|
+
return this.unproject(pos.x, pos.y);
|
|
374
|
+
}
|
|
330
375
|
/**
|
|
331
376
|
* Returns normal vector direction to the unprojected screen point from camera eye
|
|
332
377
|
* @public
|
|
@@ -346,8 +391,19 @@ class Camera {
|
|
|
346
391
|
* @param {Vec3} v - Cartesian 3d coordinates
|
|
347
392
|
* @returns {Vec2} - Screen point coordinates
|
|
348
393
|
*/
|
|
349
|
-
|
|
350
|
-
|
|
394
|
+
project3v(v) {
|
|
395
|
+
return this.project(v.x, v.y, v.z);
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* Gets projected 3d point to the 2d screen coordinates
|
|
399
|
+
* @public
|
|
400
|
+
* @param {number} x - X coordinate
|
|
401
|
+
* @param {number} y - Y coordinate
|
|
402
|
+
* @param {number} z - Z coordinate
|
|
403
|
+
* @returns {Vec2} - Screen point coordinates
|
|
404
|
+
*/
|
|
405
|
+
project(x, y, z) {
|
|
406
|
+
let r = this.frustums[0].projectionViewMatrix.mulVec4(new Vec4(x, y, z, 1.0)), c = this.renderer.handler.canvas;
|
|
351
407
|
return new Vec2((1 + r.x / r.w) * c.width * 0.5, (1 - r.y / r.w) * c.height * 0.5);
|
|
352
408
|
}
|
|
353
409
|
/**
|
|
@@ -359,17 +415,15 @@ class Camera {
|
|
|
359
415
|
* @param {Vec3} [center] - Point that the camera rotates around
|
|
360
416
|
* @param {Vec3} [up] - Camera up vector
|
|
361
417
|
*/
|
|
362
|
-
rotateAround(angle, isArc, center, up) {
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
let
|
|
366
|
-
let tr = new Mat4().setIdentity().translate(center);
|
|
367
|
-
let ntr = new Mat4().setIdentity().translate(center.negateTo());
|
|
368
|
-
let trm = tr.mul(rot).mul(ntr);
|
|
418
|
+
rotateAround(angle, isArc = false, center = Vec3.ZERO, up = Vec3.UP) {
|
|
419
|
+
up = isArc ? this._u : up;
|
|
420
|
+
let rot = Mat4.getRotation(angle, up);
|
|
421
|
+
let trm = Mat4.getRotationAroundPoint(angle, center, up);
|
|
369
422
|
this.eye = trm.mulVec3(this.eye);
|
|
370
423
|
this._u = rot.mulVec3(this._u).normalize();
|
|
371
424
|
this._r = rot.mulVec3(this._r).normalize();
|
|
372
425
|
this._b = rot.mulVec3(this._b).normalize();
|
|
426
|
+
this._f.set(-this._b.x, -this._b.y, -this._b.z);
|
|
373
427
|
}
|
|
374
428
|
/**
|
|
375
429
|
* Rotates camera around center point by horizontal.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Box } from "../bv/Box";
|
|
2
|
-
import { Mat4, NumberArray16 } from "../math/Mat4";
|
|
3
|
-
import { NumberArray4 } from "../math/Vec4";
|
|
2
|
+
import { Mat4, type NumberArray16 } from "../math/Mat4";
|
|
3
|
+
import type { NumberArray4 } from "../math/Vec4";
|
|
4
4
|
import { Sphere } from "../bv/Sphere";
|
|
5
5
|
import { Vec3 } from "../math/Vec3";
|
|
6
6
|
interface IFrustumParams {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Camera, ICameraParams } from "./Camera";
|
|
1
|
+
import { Camera, type ICameraParams } from "./Camera";
|
|
2
2
|
import { Key } from "../Lock";
|
|
3
3
|
import { LonLat } from "../LonLat";
|
|
4
4
|
import { Planet } from "../scene/Planet";
|
|
@@ -228,7 +228,20 @@ declare class PlanetCamera extends Camera {
|
|
|
228
228
|
checkFly(): void;
|
|
229
229
|
checkTerrainCollision(): Vec3 | undefined;
|
|
230
230
|
getSurfaceVisibleDistance(d: number): number;
|
|
231
|
+
/**
|
|
232
|
+
* should be yje same as getYaw
|
|
233
|
+
*/
|
|
231
234
|
getHeading(): number;
|
|
232
235
|
isVisible(poi: Vec3): boolean;
|
|
236
|
+
getPitch(): number;
|
|
237
|
+
/**
|
|
238
|
+
* should be the same as getHeading
|
|
239
|
+
*/
|
|
240
|
+
getYaw(): number;
|
|
241
|
+
getRoll(): number;
|
|
242
|
+
setPitch(a: number): void;
|
|
243
|
+
setYaw(a: number): void;
|
|
244
|
+
setRoll(a: number): void;
|
|
245
|
+
setPitchYawRoll(pitch: number, yaw: number, roll: number): void;
|
|
233
246
|
}
|
|
234
247
|
export { PlanetCamera };
|