@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/math/Ray.js
CHANGED
|
@@ -48,7 +48,7 @@ export class Ray {
|
|
|
48
48
|
return Vec3.add(this.origin, this.direction.scaleTo(distance));
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
|
-
* Returns ray hit a
|
|
51
|
+
* Returns ray hit a triangle result.
|
|
52
52
|
* @public
|
|
53
53
|
* @param {Vec3} v0 - First triangle corner coordinate.
|
|
54
54
|
* @param {Vec3} v1 - Second triangle corner coordinate.
|
|
@@ -57,7 +57,7 @@ export class Ray {
|
|
|
57
57
|
* @returns {number} - Hit code, could 0 - og.Ray.OUTSIDE, 1 - og.Ray.INSIDE,
|
|
58
58
|
* 2 - og.Ray.INPLANE and 3 - og.Ray.AWAY(ray goes away from triangle).
|
|
59
59
|
*/
|
|
60
|
-
|
|
60
|
+
hitTriangleRes(v0, v1, v2, res) {
|
|
61
61
|
let u = v1.sub(v0);
|
|
62
62
|
let v = v2.sub(v0);
|
|
63
63
|
let n = u.cross(v);
|
|
@@ -101,37 +101,61 @@ export class Ray {
|
|
|
101
101
|
}
|
|
102
102
|
return Ray.INSIDE;
|
|
103
103
|
}
|
|
104
|
+
// /**
|
|
105
|
+
// * Gets a ray hit a plane result. If the ray cross the plane returns 1 - og.Ray.INSIDE otherwise returns 0 - og.Ray.OUTSIDE.
|
|
106
|
+
// * @public
|
|
107
|
+
// * @param {Vec3} v0 - First plane point.
|
|
108
|
+
// * @param {Vec3} v1 - Second plane point.
|
|
109
|
+
// * @param {Vec3} v2 - Third plane point.
|
|
110
|
+
// * @param {Vec3} res - Hit point object pointer that stores hit result.
|
|
111
|
+
// * @returns {number}
|
|
112
|
+
// */
|
|
113
|
+
// public hitPlaneRes(v0: Vec3, v1: Vec3, v2: Vec3, res: Vec3): number {
|
|
114
|
+
// let u = Vec3.sub(v1, v0);
|
|
115
|
+
// let v = Vec3.sub(v2, v0);
|
|
116
|
+
// let n = u.cross(v);
|
|
117
|
+
//
|
|
118
|
+
// let w0 = Vec3.sub(this.origin, v0);
|
|
119
|
+
// let a = -n.dot(w0);
|
|
120
|
+
// let b = n.dot(this.direction);
|
|
121
|
+
//
|
|
122
|
+
// // ray is parallel to the plane
|
|
123
|
+
// if (Math.abs(b) < EPS10) {
|
|
124
|
+
// if (a === 0) {
|
|
125
|
+
// return Ray.OUTSIDE;
|
|
126
|
+
// }
|
|
127
|
+
// }
|
|
128
|
+
//
|
|
129
|
+
// let r = a / b;
|
|
130
|
+
//
|
|
131
|
+
// if (r < 0) {
|
|
132
|
+
// return Ray.OUTSIDE;
|
|
133
|
+
// }
|
|
134
|
+
//
|
|
135
|
+
// let d = this.direction.scaleTo(r);
|
|
136
|
+
//
|
|
137
|
+
// // intersect point of ray and plane
|
|
138
|
+
// res.x = this.origin.x + d.x;
|
|
139
|
+
// res.y = this.origin.y + d.y;
|
|
140
|
+
// res.z = this.origin.z + d.z;
|
|
141
|
+
//
|
|
142
|
+
// return Ray.INSIDE;
|
|
143
|
+
// }
|
|
104
144
|
/**
|
|
105
|
-
*
|
|
106
|
-
* @
|
|
107
|
-
* @
|
|
108
|
-
* @param {Vec3} v1 - Second plane point.
|
|
109
|
-
* @param {Vec3} v2 - Third plane point.
|
|
110
|
-
* @param {Vec3} res - Hit point object pointer that stores hit result.
|
|
111
|
-
* @returns {number}
|
|
145
|
+
* Finds the intersection of the ray with a plane.
|
|
146
|
+
* @param {Plane} plane - The plane to intersect with.
|
|
147
|
+
* @returns {Vec3 | null} The intersection point or null if no intersection.
|
|
112
148
|
*/
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
let n = u.cross(v);
|
|
117
|
-
let w0 = Vec3.sub(this.origin, v0);
|
|
118
|
-
let a = -n.dot(w0);
|
|
119
|
-
let b = n.dot(this.direction);
|
|
120
|
-
// ray is parallel to the plane
|
|
121
|
-
if (Math.abs(b) < EPS10) {
|
|
122
|
-
if (a === 0) {
|
|
123
|
-
return Ray.OUTSIDE;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
let r = a / b;
|
|
127
|
-
if (r < 0) {
|
|
149
|
+
hitPlaneRes(plane, res) {
|
|
150
|
+
const d = this.direction.dot(plane.n);
|
|
151
|
+
if (Math.abs(d) < EPS10) {
|
|
128
152
|
return Ray.OUTSIDE;
|
|
129
153
|
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
res.
|
|
154
|
+
const t = plane.p.sub(this.origin).dot(plane.n) / d;
|
|
155
|
+
if (t < 0) {
|
|
156
|
+
return Ray.AWAY;
|
|
157
|
+
}
|
|
158
|
+
res.copy(this.getPoint(t));
|
|
135
159
|
return Ray.INSIDE;
|
|
136
160
|
}
|
|
137
161
|
/**
|
|
@@ -184,21 +208,4 @@ export class Ray {
|
|
|
184
208
|
// TODO
|
|
185
209
|
//
|
|
186
210
|
}
|
|
187
|
-
/**
|
|
188
|
-
* Finds the intersection of the ray with a plane.
|
|
189
|
-
* @param {Plane} plane - The plane to intersect with.
|
|
190
|
-
* @returns {Vec3 | null} The intersection point or null if no intersection.
|
|
191
|
-
*/
|
|
192
|
-
hitPlane2(plane, res) {
|
|
193
|
-
const d = this.direction.dot(plane.n);
|
|
194
|
-
if (Math.abs(d) < EPS10) {
|
|
195
|
-
return Ray.OUTSIDE;
|
|
196
|
-
}
|
|
197
|
-
const t = plane.p.sub(this.origin).dot(plane.n) / d;
|
|
198
|
-
if (t < 0) {
|
|
199
|
-
return Ray.AWAY;
|
|
200
|
-
}
|
|
201
|
-
res.copy(this.getPoint(t));
|
|
202
|
-
return Ray.INSIDE;
|
|
203
|
-
}
|
|
204
211
|
}
|
package/lib/js/math/Vec2.d.ts
CHANGED
|
@@ -92,6 +92,15 @@ export declare class Vec2 {
|
|
|
92
92
|
* @returns {Vec2}
|
|
93
93
|
*/
|
|
94
94
|
static orthoNormalize(normal: Vec2, tangent: Vec2): Vec2;
|
|
95
|
+
/**
|
|
96
|
+
* Get projection of the vector to plane where n - normal to the plane.
|
|
97
|
+
* @static
|
|
98
|
+
* @param {Vec2} b - Vector to project.
|
|
99
|
+
* @param {Vec2} n - Plane normal.
|
|
100
|
+
* @param {Vec2} [def] - Default value for non existed result.
|
|
101
|
+
* @returns {Vec2} -
|
|
102
|
+
*/
|
|
103
|
+
static proj_b_to_plane(b: Vec2, n: Vec2, def?: Vec3): Vec2;
|
|
95
104
|
/**
|
|
96
105
|
* Converts to 3d vector, third value is 0.0.
|
|
97
106
|
* @public
|
|
@@ -221,10 +230,17 @@ export declare class Vec2 {
|
|
|
221
230
|
clear(): Vec2;
|
|
222
231
|
/**
|
|
223
232
|
* Returns normalized vector.
|
|
233
|
+
* @deprecated
|
|
224
234
|
* @public
|
|
225
235
|
* @returns {Vec2}
|
|
226
236
|
*/
|
|
227
237
|
normal(): Vec2;
|
|
238
|
+
/**
|
|
239
|
+
* Returns normalized vector.
|
|
240
|
+
* @public
|
|
241
|
+
* @returns {Vec2}
|
|
242
|
+
*/
|
|
243
|
+
getNormal(): Vec2;
|
|
228
244
|
/**
|
|
229
245
|
* Normalize current vector.
|
|
230
246
|
* @public
|
|
@@ -299,6 +315,12 @@ export declare class Vec2 {
|
|
|
299
315
|
* @returns {Vec2}
|
|
300
316
|
*/
|
|
301
317
|
slerp(v2: Vec2, t: number): Vec2;
|
|
318
|
+
/**
|
|
319
|
+
* Returns true if vector's values are zero.
|
|
320
|
+
* @public
|
|
321
|
+
* @returns {boolean} -
|
|
322
|
+
*/
|
|
323
|
+
isZero(): boolean;
|
|
302
324
|
}
|
|
303
325
|
/**
|
|
304
326
|
* Vector 2d object creator.
|
package/lib/js/math/Vec2.js
CHANGED
|
@@ -122,6 +122,21 @@ export class Vec2 {
|
|
|
122
122
|
normal.scale(tangent.dot(normal));
|
|
123
123
|
return tangent.sub(normal).normalize();
|
|
124
124
|
}
|
|
125
|
+
/**
|
|
126
|
+
* Get projection of the vector to plane where n - normal to the plane.
|
|
127
|
+
* @static
|
|
128
|
+
* @param {Vec2} b - Vector to project.
|
|
129
|
+
* @param {Vec2} n - Plane normal.
|
|
130
|
+
* @param {Vec2} [def] - Default value for non existed result.
|
|
131
|
+
* @returns {Vec2} -
|
|
132
|
+
*/
|
|
133
|
+
static proj_b_to_plane(b, n, def) {
|
|
134
|
+
let res = b.sub(n.scaleTo(n.dot(b) / n.dot(n)));
|
|
135
|
+
if (def && res.isZero()) {
|
|
136
|
+
return new Vec2(def.x, def.y);
|
|
137
|
+
}
|
|
138
|
+
return res;
|
|
139
|
+
}
|
|
125
140
|
/**
|
|
126
141
|
* Converts to 3d vector, third value is 0.0.
|
|
127
142
|
* @public
|
|
@@ -302,10 +317,19 @@ export class Vec2 {
|
|
|
302
317
|
}
|
|
303
318
|
/**
|
|
304
319
|
* Returns normalized vector.
|
|
320
|
+
* @deprecated
|
|
305
321
|
* @public
|
|
306
322
|
* @returns {Vec2}
|
|
307
323
|
*/
|
|
308
324
|
normal() {
|
|
325
|
+
return this.getNormal();
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Returns normalized vector.
|
|
329
|
+
* @public
|
|
330
|
+
* @returns {Vec2}
|
|
331
|
+
*/
|
|
332
|
+
getNormal() {
|
|
309
333
|
let res = new Vec2();
|
|
310
334
|
res.copy(this);
|
|
311
335
|
let length = 1.0 / res.length();
|
|
@@ -450,6 +474,14 @@ export class Vec2 {
|
|
|
450
474
|
}
|
|
451
475
|
return Vec2.add(this.scale(scale0), v2.scale(scale1));
|
|
452
476
|
}
|
|
477
|
+
/**
|
|
478
|
+
* Returns true if vector's values are zero.
|
|
479
|
+
* @public
|
|
480
|
+
* @returns {boolean} -
|
|
481
|
+
*/
|
|
482
|
+
isZero() {
|
|
483
|
+
return !(this.x || this.y);
|
|
484
|
+
}
|
|
453
485
|
}
|
|
454
486
|
/**
|
|
455
487
|
* Vector 2d object creator.
|
package/lib/js/math/Vec3.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Quat } from "./Quat";
|
|
2
|
-
import { Vec4
|
|
3
|
-
import {
|
|
2
|
+
import { Vec4 } from "./Vec4";
|
|
3
|
+
import type { NumberArray4 } from "./Vec4";
|
|
4
|
+
import type { NumberArray2 } from "./Vec2";
|
|
4
5
|
export type NumberArray3 = [number, number, number];
|
|
5
6
|
/**
|
|
6
7
|
* Class represents a 3d vector.
|
package/lib/js/math/coder.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module og/math/coder
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { Vec4 } from "./Vec4";
|
|
5
|
+
import { Vec2 } from "./Vec2";
|
|
6
|
+
import type { NumberArray4 } from "./Vec4";
|
|
7
|
+
import type { NumberArray3 } from "./Vec3";
|
|
8
|
+
import type { NumberArray2 } from "./Vec2";
|
|
7
9
|
/**
|
|
8
10
|
* Encode 32 bit float value to the RGBA vector.
|
|
9
11
|
* @function
|
package/lib/js/math/index.d.ts
CHANGED
|
@@ -5,7 +5,10 @@ import { Mat4 } from './Mat4';
|
|
|
5
5
|
import { Plane } from './Plane';
|
|
6
6
|
import { Quat } from './Quat';
|
|
7
7
|
import { Ray } from './Ray';
|
|
8
|
-
import { Vec2
|
|
9
|
-
import { Vec3
|
|
10
|
-
import { Vec4
|
|
8
|
+
import { Vec2 } from './Vec2';
|
|
9
|
+
import { Vec3 } from './Vec3';
|
|
10
|
+
import { Vec4 } from './Vec4';
|
|
11
|
+
import type { NumberArray2 } from './Vec2';
|
|
12
|
+
import type { NumberArray3 } from './Vec3';
|
|
13
|
+
import type { NumberArray4 } from './Vec4';
|
|
11
14
|
export { Line2, Line3, Mat3, Mat4, Plane, Quat, Ray, Vec2, Vec3, Vec4, type NumberArray2, type NumberArray3, type NumberArray4 };
|
package/lib/js/math.d.ts
CHANGED
|
@@ -250,11 +250,11 @@ export declare function solve_iteration_fixed(f: (x: number) => number, x0: numb
|
|
|
250
250
|
* Solve using iteration; terminate when error is below err or the maximum
|
|
251
251
|
* number of iterations is reached. Used in Euler's equation(see og.orbit) solving.
|
|
252
252
|
* @function
|
|
253
|
-
* @param {(
|
|
253
|
+
* @param {function(number): number} f - Equation.
|
|
254
254
|
* @param {number} x0 - First approximation.
|
|
255
255
|
* @param {number} err - Maximal accepted error value.
|
|
256
256
|
* @param {number} maxIter - Maximum iterations.
|
|
257
|
-
* @returns {number} -
|
|
257
|
+
* @returns {number} - The computed solution.
|
|
258
258
|
*/
|
|
259
259
|
export declare function solve_iteration(f: (x: number) => number, x0: number, err: number, maxIter?: number): number;
|
|
260
260
|
/**
|
package/lib/js/math.js
CHANGED
|
@@ -329,11 +329,11 @@ export function solve_iteration_fixed(f, x0, maxIter) {
|
|
|
329
329
|
* Solve using iteration; terminate when error is below err or the maximum
|
|
330
330
|
* number of iterations is reached. Used in Euler's equation(see og.orbit) solving.
|
|
331
331
|
* @function
|
|
332
|
-
* @param {(
|
|
332
|
+
* @param {function(number): number} f - Equation.
|
|
333
333
|
* @param {number} x0 - First approximation.
|
|
334
334
|
* @param {number} err - Maximal accepted error value.
|
|
335
335
|
* @param {number} maxIter - Maximum iterations.
|
|
336
|
-
* @returns {number} -
|
|
336
|
+
* @returns {number} - The computed solution.
|
|
337
337
|
*/
|
|
338
338
|
export function solve_iteration(f, x0, err, maxIter = 50) {
|
|
339
339
|
let x = 0;
|
|
@@ -4,7 +4,8 @@ import { Planet } from "../../scene/Planet";
|
|
|
4
4
|
import { LonLat } from "../../LonLat";
|
|
5
5
|
import { Entity } from "../../entity/Entity";
|
|
6
6
|
import { EntityCollection } from "../../entity/EntityCollection";
|
|
7
|
-
import { EntityCollectionNode
|
|
7
|
+
import { EntityCollectionNode } from "../EntityCollectionNode";
|
|
8
|
+
import type { NodesDict } from "../EntityCollectionNode";
|
|
8
9
|
export declare class EarthEntityCollectionNodeLonLat extends EntityCollectionNode {
|
|
9
10
|
isNorth: boolean;
|
|
10
11
|
strategy: EarthEntityCollectionsTreeStrategy;
|
|
@@ -9,14 +9,12 @@ export declare class EarthQuadTreeStrategy extends QuadTreeStrategy {
|
|
|
9
9
|
* Current visible north pole nodes tree nodes array.
|
|
10
10
|
* @public
|
|
11
11
|
* @type {Node}
|
|
12
|
-
* @todo
|
|
13
12
|
*/
|
|
14
13
|
_visibleNodesNorth: Record<number, Node>;
|
|
15
14
|
/**
|
|
16
15
|
* Current visible south pole nodes tree nodes array.
|
|
17
16
|
* @public
|
|
18
17
|
* @type {Node}
|
|
19
|
-
* @todo
|
|
20
18
|
*/
|
|
21
19
|
_visibleNodesSouth: Record<number, Node>;
|
|
22
20
|
constructor(planet: Planet);
|
|
@@ -3,7 +3,8 @@ import { Planet } from "../../scene/Planet";
|
|
|
3
3
|
import { LonLat } from "../../LonLat";
|
|
4
4
|
import { Entity } from "../../entity/Entity";
|
|
5
5
|
import { EntityCollection } from "../../entity/EntityCollection";
|
|
6
|
-
import { EntityCollectionNode
|
|
6
|
+
import { EntityCollectionNode } from "../EntityCollectionNode";
|
|
7
|
+
import type { NodesDict } from "../EntityCollectionNode";
|
|
7
8
|
import { EquiEntityCollectionsTreeStrategy } from "./EquiEntityCollectionsTreeStrategy";
|
|
8
9
|
export declare class EquiEntityCollectionNodeLonLat extends EntityCollectionNode {
|
|
9
10
|
strategy: EquiEntityCollectionsTreeStrategy;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { Camera } from "../camera/Camera";
|
|
2
2
|
import { Control } from "../control/Control";
|
|
3
|
-
import { IBaseInputState, RendererEventsHandler } from "./RendererEvents";
|
|
3
|
+
import type { IBaseInputState, RendererEventsHandler } from "./RendererEvents";
|
|
4
4
|
import { EntityCollection } from "../entity/EntityCollection";
|
|
5
5
|
import { Framebuffer, Multisample } from "../webgl/index";
|
|
6
6
|
import { FontAtlas } from "../utils/FontAtlas";
|
|
7
|
-
import { Handler
|
|
7
|
+
import { Handler } from "../webgl/Handler";
|
|
8
|
+
import type { WebGLBufferExt } from "../webgl/Handler";
|
|
8
9
|
import { LabelWorker } from "../entity/LabelWorker";
|
|
9
10
|
import { RenderNode } from "../scene/RenderNode";
|
|
10
11
|
import { TextureAtlas } from "../utils/TextureAtlas";
|
|
11
12
|
import { Vec2 } from "../math/Vec2";
|
|
12
|
-
import {
|
|
13
|
+
import { Vec3 } from "../math/Vec3";
|
|
14
|
+
import type { NumberArray3 } from "../math/Vec3";
|
|
13
15
|
import { Vec4 } from "../math/Vec4";
|
|
14
16
|
interface IRendererParams {
|
|
15
17
|
controls?: Control[];
|
|
@@ -319,6 +319,8 @@ class Renderer {
|
|
|
319
319
|
});
|
|
320
320
|
this.pickingFramebuffer.init();
|
|
321
321
|
this.depthFramebuffer = new Framebuffer(this.handler, {
|
|
322
|
+
width: 640,
|
|
323
|
+
height: 480,
|
|
322
324
|
targets: [{
|
|
323
325
|
internalFormat: "RGBA",
|
|
324
326
|
type: "UNSIGNED_BYTE",
|
|
@@ -430,7 +432,7 @@ class Renderer {
|
|
|
430
432
|
this.blitFramebuffer && this.blitFramebuffer.setSize(c.width, c.height, true);
|
|
431
433
|
this.toneMappingFramebuffer && this.toneMappingFramebuffer.setSize(c.width, c.height, true);
|
|
432
434
|
this.screenDepthFramebuffer && this.screenDepthFramebuffer.setSize(c.clientWidth, c.clientHeight, true);
|
|
433
|
-
this.depthFramebuffer && this.depthFramebuffer.setSize(c.clientWidth, c.clientHeight, true);
|
|
435
|
+
//this.depthFramebuffer && this.depthFramebuffer.setSize(c.clientWidth, c.clientHeight, true);
|
|
434
436
|
if (this.handler.gl.type === "webgl") {
|
|
435
437
|
this.screenTexture.screen = this.sceneFramebuffer.textures[0];
|
|
436
438
|
this.screenTexture.picking = this.pickingFramebuffer.textures[0];
|
|
@@ -662,7 +664,7 @@ class Renderer {
|
|
|
662
664
|
e.dispatch(e.draw, this);
|
|
663
665
|
let frustums = this.activeCamera.frustums;
|
|
664
666
|
let pointerEvent = e.pointerEvent();
|
|
665
|
-
let
|
|
667
|
+
let mouseFree = !e.mouseState.leftButtonDown && !e.mouseState.rightButtonDown;
|
|
666
668
|
// Rendering scene nodes and entityCollections
|
|
667
669
|
let rn = this._renderNodesArr;
|
|
668
670
|
let k = frustums.length;
|
|
@@ -683,7 +685,7 @@ class Renderer {
|
|
|
683
685
|
}
|
|
684
686
|
this._drawEntityCollections(0);
|
|
685
687
|
e.dispatch(e.drawtransparent, this);
|
|
686
|
-
if (pointerEvent &&
|
|
688
|
+
if (pointerEvent && mouseFree) {
|
|
687
689
|
this._drawPickingBuffer(0);
|
|
688
690
|
}
|
|
689
691
|
this._drawDepthBuffer(0);
|
|
@@ -698,7 +700,7 @@ class Renderer {
|
|
|
698
700
|
while (k--) {
|
|
699
701
|
this.activeCamera.setCurrentFrustum(k);
|
|
700
702
|
this._drawEntityCollections(i);
|
|
701
|
-
if (pointerEvent &&
|
|
703
|
+
if (pointerEvent && mouseFree) {
|
|
702
704
|
this._drawPickingBuffer(i);
|
|
703
705
|
}
|
|
704
706
|
this._drawDepthBuffer(i);
|
|
@@ -707,10 +709,12 @@ class Renderer {
|
|
|
707
709
|
}
|
|
708
710
|
sceneFramebuffer.deactivate();
|
|
709
711
|
this.blitFramebuffer && sceneFramebuffer.blitTo(this.blitFramebuffer, 0);
|
|
710
|
-
if (pointerEvent) {
|
|
712
|
+
if (pointerEvent && mouseFree) {
|
|
711
713
|
this._readPickingBuffer();
|
|
712
714
|
}
|
|
713
|
-
|
|
715
|
+
if (mouseFree) {
|
|
716
|
+
this._readDepthBuffer();
|
|
717
|
+
}
|
|
714
718
|
// Tone mapping followed by rendering on the screen
|
|
715
719
|
this._fnScreenFrame();
|
|
716
720
|
e.dispatch(e.postdraw, this);
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { Events
|
|
1
|
+
import { Events } from "../Events";
|
|
2
|
+
import type { EventsHandler, EventCallback } from "../Events";
|
|
2
3
|
import { KeyboardHandler } from "../input/KeyboardHandler";
|
|
3
|
-
import { MouseHandler
|
|
4
|
+
import { MouseHandler } from "../input/MouseHandler";
|
|
5
|
+
import type { MouseHandlerEvent, MouseEventExt } from "../input/MouseHandler";
|
|
4
6
|
import { Renderer } from "./Renderer";
|
|
5
|
-
import {
|
|
7
|
+
import { TouchHandler } from "../input/TouchHandler";
|
|
8
|
+
import type { TouchEventExt } from "../input/TouchHandler";
|
|
6
9
|
import { Vec2 } from "../math/Vec2";
|
|
7
10
|
import { Vec3 } from "../math/Vec3";
|
|
8
11
|
export type RendererEventsHandler = RendererEvents & EventsHandler<RendererEventsType>;
|
|
@@ -111,6 +114,7 @@ export interface IMouseState extends IBaseInputState {
|
|
|
111
114
|
wheelDelta: number;
|
|
112
115
|
/** JavaScript mouse system event message. */
|
|
113
116
|
sys: MouseEvent | null;
|
|
117
|
+
isTouchPad: boolean;
|
|
114
118
|
}
|
|
115
119
|
export interface ITouchState extends IBaseInputState {
|
|
116
120
|
/** Touch has ended right now.*/
|
|
@@ -15,13 +15,13 @@ const ISBLACK = (c) => !(c[0] || c[1] || c[2]);
|
|
|
15
15
|
const NOTBLACK = (c) => !!(c[0] || c[1] || c[2]);
|
|
16
16
|
/**
|
|
17
17
|
* Stores current picking rgb color.
|
|
18
|
-
* @type {Array.<number>}
|
|
18
|
+
* @type {Array.<number>}
|
|
19
19
|
*/
|
|
20
20
|
let _currPickingColor = new Uint8Array(4);
|
|
21
21
|
let _tempCurrPickingColor = new Uint8Array(4);
|
|
22
22
|
/**
|
|
23
23
|
* Stores previous picked rgb color.
|
|
24
|
-
* @type {Array.<number>}
|
|
24
|
+
* @type {Array.<number>}
|
|
25
25
|
*/
|
|
26
26
|
let _prevPickingColor = new Uint8Array(4);
|
|
27
27
|
/**
|
|
@@ -71,7 +71,8 @@ class RendererEvents extends Events {
|
|
|
71
71
|
wheelDelta: 0,
|
|
72
72
|
sys: null,
|
|
73
73
|
pickingObject: null,
|
|
74
|
-
renderer: renderer
|
|
74
|
+
renderer: renderer,
|
|
75
|
+
isTouchPad: false
|
|
75
76
|
};
|
|
76
77
|
this.touchState = {
|
|
77
78
|
moving: false,
|
|
@@ -195,6 +196,7 @@ class RendererEvents extends Events {
|
|
|
195
196
|
* @protected
|
|
196
197
|
*/
|
|
197
198
|
onMouseWheel(event) {
|
|
199
|
+
this.mouseState.isTouchPad = event.isTouchPad || false;
|
|
198
200
|
this.mouseState.sys = event;
|
|
199
201
|
this.mouseState.wheelDelta = event.wheelDelta || 0;
|
|
200
202
|
}
|
package/lib/js/scene/Axes.d.ts
CHANGED
package/lib/js/scene/Planet.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { Atmosphere
|
|
1
|
+
import { Atmosphere } from "../control/Atmosphere";
|
|
2
|
+
import type { IAtmosphereParams } from "../control/Atmosphere";
|
|
2
3
|
import { Control } from "../control/Control";
|
|
3
|
-
import { EventsHandler } from "../Events";
|
|
4
|
+
import type { EventsHandler } from "../Events";
|
|
4
5
|
import { EmptyTerrain } from "../terrain/EmptyTerrain";
|
|
5
6
|
import { Extent } from "../Extent";
|
|
6
7
|
import { Entity } from "../entity/Entity";
|
|
7
8
|
import { Ellipsoid } from "../ellipsoid/Ellipsoid";
|
|
8
9
|
import { EntityCollection } from "../entity/EntityCollection";
|
|
9
10
|
import { GeoImageCreator } from "../utils/GeoImageCreator";
|
|
10
|
-
import { IBaseInputState } from "../renderer/RendererEvents";
|
|
11
|
+
import type { IBaseInputState } from "../renderer/RendererEvents";
|
|
11
12
|
import { Key, Lock } from "../Lock";
|
|
12
13
|
import { Layer } from "../layer/Layer";
|
|
13
14
|
import { Loader } from "../utils/Loader";
|
|
@@ -22,13 +23,14 @@ import { Ray } from "../math/Ray";
|
|
|
22
23
|
import { RenderNode } from "./RenderNode";
|
|
23
24
|
import { Sun } from "../control/Sun";
|
|
24
25
|
import { TerrainWorker } from "../utils/TerrainWorker";
|
|
25
|
-
import { Vec2, Vec3
|
|
26
|
+
import { Vec2, Vec3 } from "../math/index";
|
|
27
|
+
import type { NumberArray2, NumberArray3, NumberArray4 } from "../math/index";
|
|
26
28
|
import { Vector } from "../layer/Vector";
|
|
27
29
|
import { VectorTileCreator } from "../utils/VectorTileCreator";
|
|
28
|
-
import { WebGLBufferExt, WebGLTextureExt, IDefaultTextureParams } from "../webgl/Handler";
|
|
30
|
+
import type { WebGLBufferExt, WebGLTextureExt, IDefaultTextureParams } from "../webgl/Handler";
|
|
29
31
|
import { Program } from "../webgl/Program";
|
|
30
32
|
import { Segment } from "../segment/Segment";
|
|
31
|
-
import { AtmosphereParameters } from "../shaders/atmos";
|
|
33
|
+
import type { AtmosphereParameters } from "../shaders/atmos";
|
|
32
34
|
export interface IPlanetParams {
|
|
33
35
|
name?: string;
|
|
34
36
|
ellipsoid?: Ellipsoid;
|
|
@@ -631,5 +633,9 @@ export declare class Planet extends RenderNode {
|
|
|
631
633
|
getHeightDefault(lonLat: LonLat): Promise<number>;
|
|
632
634
|
getHeightAboveELL(lonLat: LonLat): Promise<number>;
|
|
633
635
|
onremove(): void;
|
|
636
|
+
/**
|
|
637
|
+
* @todo: refactor with events or something better
|
|
638
|
+
*/
|
|
639
|
+
stopDragging(): void;
|
|
634
640
|
}
|
|
635
641
|
export {};
|
package/lib/js/scene/Planet.js
CHANGED
|
@@ -771,7 +771,7 @@ export class Planet extends RenderNode {
|
|
|
771
771
|
this._renderedNodes = [];
|
|
772
772
|
for (let i = 0, len = temp.length; i < len; i++) {
|
|
773
773
|
let ri = temp[i];
|
|
774
|
-
let ht = ri.segment.centerNormal.dot(cam.
|
|
774
|
+
let ht = ri.segment.centerNormal.dot(cam.getBackward());
|
|
775
775
|
if (ri.segment.tileZoom === this.maxCurrZoom || ht < HORIZON_TANGENT) {
|
|
776
776
|
this._renderedNodes.push(ri);
|
|
777
777
|
let k = 0, inFrustum = ri.inFrustum;
|
|
@@ -1347,7 +1347,7 @@ export class Planet extends RenderNode {
|
|
|
1347
1347
|
* @returns {Vec2} - Screen coordinates.
|
|
1348
1348
|
*/
|
|
1349
1349
|
getPixelFromCartesian(coords) {
|
|
1350
|
-
return this.renderer.activeCamera.
|
|
1350
|
+
return this.renderer.activeCamera.project3v(coords);
|
|
1351
1351
|
}
|
|
1352
1352
|
/**
|
|
1353
1353
|
* Project geodetic coordinates to screen space.
|
|
@@ -1358,7 +1358,7 @@ export class Planet extends RenderNode {
|
|
|
1358
1358
|
getPixelFromLonLat(lonlat) {
|
|
1359
1359
|
let coords = this.ellipsoid.lonLatToCartesian(lonlat);
|
|
1360
1360
|
if (coords) {
|
|
1361
|
-
return this.renderer.activeCamera.
|
|
1361
|
+
return this.renderer.activeCamera.project3v(coords);
|
|
1362
1362
|
}
|
|
1363
1363
|
}
|
|
1364
1364
|
/**
|
|
@@ -1551,6 +1551,27 @@ export class Planet extends RenderNode {
|
|
|
1551
1551
|
this.quadTreeStrategy.destroyBranches();
|
|
1552
1552
|
this._renderedNodes = [];
|
|
1553
1553
|
}
|
|
1554
|
+
// function checkTerrainCollision(entity) {
|
|
1555
|
+
// let _tempTerrPoint = new Vec3();
|
|
1556
|
+
// let nodes = globus.planet._renderedNodes;
|
|
1557
|
+
// for (let j = 0; j < nodes.length; j++) {
|
|
1558
|
+
// let seg = nodes[j].segment;
|
|
1559
|
+
// if (seg && seg._extentLonLat.isInside(entity.getLonLat())) {
|
|
1560
|
+
// seg.getEntityTerrainPoint(entity, _tempTerrPoint);
|
|
1561
|
+
// entity.setCartesian3v(_tempTerrPoint);
|
|
1562
|
+
// break;
|
|
1563
|
+
// }
|
|
1564
|
+
// }
|
|
1565
|
+
// }
|
|
1566
|
+
/**
|
|
1567
|
+
* @todo: refactor with events or something better
|
|
1568
|
+
*/
|
|
1569
|
+
stopDragging() {
|
|
1570
|
+
if (this.renderer && this.renderer.controls.EarthNavigation) {
|
|
1571
|
+
//@ts-ignore
|
|
1572
|
+
this.renderer.controls.EarthNavigation.stop();
|
|
1573
|
+
}
|
|
1574
|
+
}
|
|
1554
1575
|
}
|
|
1555
1576
|
const PLANET_EVENTS = [
|
|
1556
1577
|
/**
|
package/lib/js/scene/SkyBox.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RenderNode } from './RenderNode';
|
|
2
|
-
import { WebGLBufferExt, WebGLTextureExt, Texture3DParams } from "../webgl/Handler";
|
|
2
|
+
import type { WebGLBufferExt, WebGLTextureExt, Texture3DParams } from "../webgl/Handler";
|
|
3
3
|
declare class SkyBox extends RenderNode {
|
|
4
4
|
params: Texture3DParams;
|
|
5
5
|
vertexPositionBuffer: WebGLBufferExt | null;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Box } from "../bv/Box";
|
|
2
2
|
import { Extent } from "../Extent";
|
|
3
3
|
import { Entity } from "../entity/Entity";
|
|
4
|
-
import { TypedArray } from "../utils/shared";
|
|
5
|
-
import { Handler
|
|
6
|
-
import {
|
|
4
|
+
import type { TypedArray } from "../utils/shared";
|
|
5
|
+
import { Handler } from "../webgl/Handler";
|
|
6
|
+
import type { WebGLBufferExt, WebGLTextureExt } from "../webgl/Handler";
|
|
7
|
+
import type { ITerrainWorkerData } from "../utils/TerrainWorker";
|
|
7
8
|
import { Layer } from "../layer/Layer";
|
|
8
9
|
import { LonLat } from "../LonLat";
|
|
9
10
|
import { Material } from "../layer/Material";
|
|
@@ -12,10 +13,11 @@ import { Planet } from "../scene/Planet";
|
|
|
12
13
|
import { PlanetCamera } from "../camera/PlanetCamera";
|
|
13
14
|
import { Program } from "../webgl/Program";
|
|
14
15
|
import { Proj } from "../proj/Proj";
|
|
15
|
-
import {
|
|
16
|
+
import { Sphere } from "../bv/Sphere";
|
|
17
|
+
import type { NumberArray6 } from "../bv/Sphere";
|
|
16
18
|
import { Slice } from "./Slice";
|
|
17
19
|
import { Vec3 } from "../math/Vec3";
|
|
18
|
-
import { IPlainSegmentWorkerData } from "../utils/PlainSegmentWorker";
|
|
20
|
+
import type { IPlainSegmentWorkerData } from "../utils/PlainSegmentWorker";
|
|
19
21
|
export declare function getTileCellIndex(coordinate: number, tileSize: number, worldEdge: number): number;
|
|
20
22
|
export declare function getTileCellExtent(x: number, y: number, z: number, worldExtent: Extent): Extent;
|
|
21
23
|
export declare const TILEGROUP_COMMON = 0;
|
|
@@ -175,25 +175,25 @@ class Segment {
|
|
|
175
175
|
_v0.set(verts[ind_v0], verts[ind_v0 + 1], verts[ind_v0 + 2]);
|
|
176
176
|
_v1.set(verts[ind_v0 + 3], verts[ind_v0 + 4], verts[ind_v0 + 5]);
|
|
177
177
|
_v2.set(verts[ind_v2], verts[ind_v2 + 1], verts[ind_v2 + 2]);
|
|
178
|
-
let d = _ray.
|
|
178
|
+
let d = _ray.hitTriangleRes(_v0, _v1, _v2, res);
|
|
179
179
|
if (d === Ray.INSIDE) {
|
|
180
180
|
return xyz.distance(res);
|
|
181
181
|
}
|
|
182
182
|
else if (d === Ray.AWAY) {
|
|
183
183
|
_rayEx.set(xyz, norm);
|
|
184
|
-
let d = _rayEx.
|
|
184
|
+
let d = _rayEx.hitTriangleRes(_v0, _v1, _v2, res);
|
|
185
185
|
if (d === Ray.INSIDE) {
|
|
186
186
|
return -xyz.distance(res);
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
_v3.set(verts[ind_v2 + 3], verts[ind_v2 + 4], verts[ind_v2 + 5]);
|
|
190
|
-
d = _ray.
|
|
190
|
+
d = _ray.hitTriangleRes(_v1, _v3, _v2, res);
|
|
191
191
|
if (d === Ray.INSIDE) {
|
|
192
192
|
return xyz.distance(res);
|
|
193
193
|
}
|
|
194
194
|
else if (d === Ray.AWAY) {
|
|
195
195
|
_rayEx.set(xyz, norm);
|
|
196
|
-
let d = _rayEx.
|
|
196
|
+
let d = _rayEx.hitTriangleRes(_v1, _v3, _v2, res);
|
|
197
197
|
if (d === Ray.INSIDE) {
|
|
198
198
|
return -xyz.distance(res);
|
|
199
199
|
}
|