summaryrefslogtreecommitdiff
path: root/src/mbgl/map/transform_state.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add FreeCameraOptions to the Map classMikko Pulkki2020-05-021-2/+79
|
* Refactor TransformState to use internal 3d cameraMikko Pulkki2020-05-021-34/+92
|
* [build] Fix undefined behavour sanitizer (#16375)zmiao2020-04-071-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * [build] Fix integer overflow runtime error for core part Temporarily remove circle ci UBSAN build precondition * [build] Enable all of the ubsans [build] Check runtime error [build] Update UBSAN_OPTION * [build] Add UBSAN blacklist [build] Ignore system libraries [build] Ignore vendor library * [build] Fix implicit conversion runtime error in core * [build] Fix division by zero runtime error * [build] Add unfixed error to ubsan blacklist * [build] Make UBSAN halt on error Revert "Temporary remove build precondition" * [build] Fix division by zero error * [build] Make UBSAN officially work without FIXME prefix * [build] Fix implicit conversion from int64_t to uint64_t * [build] Rename style test json file name * Address review findings
* Refactor tileCover to support lod tilesMikko Pulkki2020-04-061-1/+9
|
* [core] Fix readability-* errorsThiago Marcos P. Santos2020-03-301-3/+6
| | | | As reported by clang-tidy-8.
* [core] Fix performance-unnecessary-value-param errorsThiago Marcos P. Santos2020-03-231-1/+1
| | | | As reported by clang-tidy-8.
* Add additional transformState::latLngToScreenCoordinate getter (#16311)galinelle2020-03-191-2/+6
| | | | | | This change adds a latLngToScreenCoordinate overload, to retrieve the projected vec4 in additional to the ScreenCoordinate object, that is useful to detect whether the projected latLng is in front or behind the camera.
* [core] Add min and max pitch optionsJuha Alanen2020-02-251-2/+27
|
* [core] Refactoring transform state (#15956)zmiao2019-12-051-44/+232
| | | | | | | | | | * [core] Refactoring transform state class * [core] update matrix in transform, Fix precision * [core] Make matrix mutable so that we only update them when needed * [core] Add getters for matrices
* [core] Fix MapSnapshotter build failure on WindowsAnder Conselvan de Oliveira2019-11-131-5/+1
| | | | | | | | MSVC implementation of std::promise is buggy and only works with types that can be default-constructed. To avoid a compilation failure in the instantiation of ask() inside MapSnapshotter::getRegion(), which creates a std::promise<LanLngBounds>, make LatLngBounds' default constructor public.
* [core] make padding optional when camera position is requested.Łukasz Paczos2019-08-291-2/+2
| | | | When padding is not provided, the current one that's cached in the TransformState is going to be returned.
* [core] Fix tileCover / TileCoordinate fromScreenCoordinate(#15442)Aleksandar Stojiljkovic2019-08-231-3/+10
| | | | | | | Remove unecessary tile coordinate unproject -> project step. Unproject+project isn't always a noop and this was the issue leading to wrong cover calculation in high pitch values. Fixes: https://github.com/mapbox/mapbox-gl-native/issues/15442
* [core] Limit pitch based on edge insets. Fix max Z calculation in getProjMatrix.Aleksandar Stojiljkovic2019-08-011-10/+10
| | | | | | | | | | | | | Patch partly fixes #15163 in a way that it doesn't allow loading tens of thousands of tiles and attempt to show area above horizon: Limit pitch based on edge insets. It is not too bad - current limit of 60 degrees stays active until center of perspective is moved towards the bottom, to 84% of screen height. The plan is to split removal of 60 degrees limit to follow up patch. Fix max Z calculation in getProjMatrix. TransformState::getProjMatrix calculation of farZ was complex with possibility to lead to negative z values. Replacing it with simpler, precise calculation: furthestDistance = cameraToCenterDistance / (1 - tanFovAboveCenter * std::tan(getPitch())); TransformState::getProjMatrix calculation of farZ was an aproximation. Replacing it with simpler, but precise calculation. Related to: #15163
* [core] Fix collision with content insetsAleksandar Stojiljkovic2019-07-171-4/+4
| | | | | | | | | | | | | | | Viewport center offset usage was wrongly submitted in #14664. It was part of alternative approach that used enlarged viewport. Existing and added tests were not sufficient to spot the regression, since the collision check padding is usually larger than the center offset x and y. Annotation picking has tolerance of only 10 pixels but no annotation integration test was using content insets. Usage of offset is not needed because `posMatrix` in e.g. `CollisionIndex::projectPoint(const mat4& posMatrix, const Point<float>& point)` already incorporates center offset (projection matrix) and the code in current master was just offsetting all by the value. Modified [ios] MGLAnnotationViewIntegrationTests.testSelectingAnnotationWithCenterOffset to use different insets. It verifies the fix. Fixes [iOS] Annotations are not selectable (added via iosapp menu) #15106: In case of #15106, view's original content insets is {top:88, bottom:34}, causing that center offset is {x:0, y:27} and selection with tolerance of 10 wouldn't select annotation. After tapping the view, so that the header gets removed, view's content insets get changed to {top:44, bottom:34}, center offset is {x:0, y:5} and annotation selection would work, as described in #15106. Fixes: #15106
* [core] Offset viewport center when edge insets are specifiedAleksandar Stojiljkovic2019-05-281-18/+24
| | | | | | | | | | | | | | | | | | | | | The change is implemented in TransformState::getProjMatrix, the rest of the code is making sure that existing API contracts stay and there are tests verifyingrendering and render query processing only items within screen and given tolerance around screen edges. MapView: don't bake edge insets into relalculated camera center. Keep edge insets as property of camera in TransformState (similar to pitch, zoom, bearing) independent from specified camera center. Interpolate edge insets in animation. iOS Demo app: "Turn On/Off Content Insets" pitch the camera and navigate to convenient location in Denver, where streets are parallel to cardinal directions, to illustrate viewport center offset when edge insets are set. Tests: ViewFrustumCulling: although Annotations are deprecated, queryRenderedFeatures related tests in Annotations would need to get ported and decided to add the edge insets related query tests next to them. Verify frustum culling (render+queryRenderedFeatures) With different camera and edge insets setups. TODO: port Annotations tests. Transform.Padding: Verify that coordinates take proper place on screen after applying edge insets. LocalGlyphRasterizer: verify text rendering when applying padding. Related to #11882: both use projection matrix elements [8] and [9]. Alternative approach to this was to increase and offset map origin so that the screen would be a sub-rectangle in larger map viewport. This approach has a drawback of unecessary processing the items that are outside screen area. Fixes #12107, #12728, navigation-sdks/issues/120
* Refactor: coordinatePointMatrix skip recomputation (#14507)Aleksandar Stojiljkovic2019-05-131-5/+5
| | | | | | | | coordinatePointMatrix is always used with getZoom(): Projection::worldSize(scale) / std::pow(2, z) is computed as scale * util::tileSize / std::pow(2, z) scale is equal to std::pow(2, z). ____________________________________=> Projection::worldSize(scale) / std::pow(2, z) => util::tileSize.
* [core] Remove optional from Map::setLatLngBounds()Ander Conselvan de Oliveira2019-03-141-6/+5
| | | | | | | | This is a first step into grouping together bounds related Map methods into one that takes a "BoundOptions" object. LatLngBounds::unbounded() replaces an undefined optional<LatLngBounds>. v2: Document LatLngBounds::unbounded()
* [core] Remove support for setting minimum and maximum pitchAnder Conselvan de Oliveira2019-03-141-20/+0
| | | | | | | | | Support for limiting pitch was introduced in commit c4fc89977bcb ([core] Added {set,get}{Min,Max}Pitch) in 2017 but was never exposed by the platform SDKs. Simplify the Map interface by removing this unused feature. v2: Add util::PITCH_MIN
* [core] Transform{State}: s/angle/bearing/Bruno de Oliveira Abinader2019-03-041-7/+7
|
* [core] Do not consider X axis when constraining scaleBruno de Oliveira Abinader2018-11-291-5/+2
|
* [core] Cleanup Transform, use {jump,ease}To() insteadBruno de Oliveira Abinader2018-11-271-10/+9
|
* [core] Add TransformState::getCameraOptions()Bruno de Oliveira Abinader2018-10-191-0/+20
|
* [core] Do not constrain on X axis in ConstrainMode::HeightOnlyBruno de Oliveira Abinader2018-10-021-10/+15
|
* [android] add support for gnustlKonstantin Käfer2018-09-111-1/+1
|
* [core] don't use floating point versions of pow/logKonstantin Käfer2018-06-041-3/+3
| | | | | | GLIBC 2.27 added new versioned symbols of powf and logf, while the double versions of pow and log remained stable. Prefer the double version to avoid introducing a dependency on a newer version of GLIBC than strictly necessary. See https://lists.gnu.org/archive/html/info-gnu/2018-02/msg00000.html
* [core] fix circle querying for scale and alignmentChris Loer2018-04-261-0/+13
| | | | | | | This fixes circle querying for cases where either circle-pitch-alignment=map or circle-pitch-scaling=viewport
* [core] align raster imagery rendering to pixel rid to avoid blurrinessKonstantin Käfer2018-01-241-3/+18
|
* [core, node] Support axonometric renderingLauren Budorick2017-10-141-0/+9
|
* [core] TransformState::getIntegerZoom should be uint8_tBruno de Oliveira Abinader2017-09-151-1/+1
|
* [core] Improved label pitch-scaling: approximate collision box shapes based ↵Chris Loer2017-07-111-0/+12
| | | | on tile distance from camera.
* [core] Clamp to scale boundaries in TransformState::setLatLngZoomBruno de Oliveira Abinader2017-06-281-1/+1
|
* [core] Make TransformState LatLngBounds optionalBruno de Oliveira Abinader2017-06-011-6/+11
|
* [core] Render fill-extrusion layers (#8431)Lauren Budorick2017-04-271-3/+6
|
* [all] Remove redundant scale-related camera methodsJohn Firebaugh2017-04-131-4/+0
| | | | We don't need to have two different measurement systems for map zoom.
* [core] Added {set,get}{Min,Max}PitchBruno de Oliveira Abinader2017-04-111-0/+19
|
* [core] Added Map::{get,set}LatLngBoundsBruno de Oliveira Abinader2017-04-111-2/+13
|
* [core] Move {Map,Transform}::{get,set}{Min,Max}Zoom to bounds pragmaBruno de Oliveira Abinader2017-04-111-0/+2
|
* [core] Updated Size::isEmpty and TransformState::valid checksBruno de Oliveira Abinader2017-04-101-2/+5
|
* [all] Make LatLng coordinates read-onlyJohn Firebaugh2017-04-061-2/+2
|
* [core] fix matrix z range and remove hackAnsis Brammanis2016-12-211-3/+6
| | | | | | | ported from -js: 0b5520fa5ab2a4659d80dcffa8b035a0d84fe1ca This should fix the issue behind #2270 and remove the need for the hack added in #3740.
* [core, ios] replace `altitude` with `fov`Ansis Brammanis2016-12-211-14/+20
| | | | | | | | | ported from -js: eb6c6596c6a7a61363d30356674e0002153b1d19 `altitude` was a terribly-named variable that was used to indirectly control the fov. This should eliminate some confusion. `altitude` was equivalent to `cameraToCenterDistance / height`
* [core] Use double in TransformState::zoomScaleBruno de Oliveira Abinader2016-11-271-1/+1
|
* Revert "[core] Don't use GL_LINEAR if panning w/o rotation nor pitch"Bruno de Oliveira Abinader2016-11-011-0/+4
| | | | This reverts commit a70bfd89108cf1aef75181819ae43e550a69255e.
* [core] Cleanup TransformState::getIntegerZoomBruno de Oliveira Abinader2016-10-311-1/+1
|
* [core] Moved util::log2 to its own headerBruno de Oliveira Abinader2016-10-311-2/+2
| | | | | | - Added util::{MIN,MAX}_ZOOM_F to avoid consecutive conversions from double to float - Move util::log2 to its own header (part of mbgl/math)
* [core] Don't use GL_LINEAR if panning w/o rotation nor pitchBruno de Oliveira Abinader2016-10-311-4/+0
|
* [core] change std::array<uint16_t, 2> to mbgl::SizeKonstantin Käfer2016-10-271-22/+20
|
* [core] Move TransformState::{un,}project() to ProjectionBruno de Oliveira Abinader2016-10-191-22/+6
|
* [core] Move TransformState::worldSize() to ProjectionBruno de Oliveira Abinader2016-10-191-12/+8
|
* [core] Fix matrix when panning around the worldBruno de Oliveira Abinader2016-07-121-1/+1
| | | | Partially reverts commit 1d46e83.