summaryrefslogtreecommitdiff
path: root/src/mbgl/map/transform.hpp
Commit message (Collapse)AuthorAgeFilesLines
* [core] Add min and max pitch optionsJuha Alanen2020-02-201-0/+3
|
* [core] Refactoring transform state (#15956)zmiao2019-12-051-4/+1
| | | | | | | | | | * [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] make padding optional when camera position is requested.Łukasz Paczos2019-08-291-1/+1
| | | | When padding is not provided, the current one that's cached in the TransformState is going to be returned.
* [core] Reuse flyTo constant screen velocity calculation for easeTo ↵Aleksandar Stojiljkovic2019-08-081-3/+7
| | | | | | | | | | | | | implementation. When using flyTo for easeTo: Limit zoom out to min(startZoom, targetZoom). Reduce cinematic zoom in animation at the end of transition, Linear zoom interpolation. The patch also sets linear interpolation for flyTo edgeInsets animation, as it looks more appropriate to follow the approach taken for pitch and bearing. Fixes: #15144
* [core] Limit pitch based on edge insets. Fix max Z calculation in getProjMatrix.Aleksandar Stojiljkovic2019-08-011-0/+3
| | | | | | | | | | | | | 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] Offset viewport center when edge insets are specifiedAleksandar Stojiljkovic2019-05-281-3/+2
| | | | | | | | | | | | | | | | | | | | | 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
* [core] Remove optional from Map::setLatLngBounds()Ander Conselvan de Oliveira2019-03-141-1/+1
| | | | | | | | 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-2/+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] consolidate Axonometric rendering APISudarsana Babu Nagineni2019-03-081-6/+3
| | | | | | | Instead of having individual APIs for setting axonometric and skew options, create ProjectionMode struct that holds all the relevant options for Axonometric rendering and introduce setter/getter on the Map for those options.
* [core] Transform{State}: s/angle/bearing/Bruno de Oliveira Abinader2019-03-041-5/+2
|
* [core] Use unwrapped longitude for bounds checkBruno de Oliveira Abinader2019-02-261-1/+1
|
* [core] Cleanup Transform, use {jump,ease}To() insteadBruno de Oliveira Abinader2018-11-271-39/+1
|
* [core] Remove error-prone setlatLng overloadBruno de Oliveira Abinader2018-11-271-1/+0
|
* [ios,macos] Fix for infinite loop crash when setting shape to nil in ↵Julian Rex2018-05-211-1/+1
| | | | MGLMapViewDelegate methods (#11614)
* [core, node] Support axonometric renderingLauren Budorick2017-10-141-0/+8
|
* [core] Make TransformState LatLngBounds optionalBruno de Oliveira Abinader2017-06-011-1/+1
|
* [core] Reduce use of RecalculateStyleJohn Firebaugh2017-05-051-4/+3
| | | | | | | * Don't use it to track zoom changes. Instead, Style::update can use the zoom history to check for a change in zoom from the previous frame. * Don't use it to track active property transitions. Style already knows which layers/light have an active transition, and can re-evaluate only those that do. This leaves layer property changes as the only use of RecalculateStyle.
* [all] Remove redundant scale-related camera methodsJohn Firebaugh2017-04-131-22/+0
| | | | We don't need to have two different measurement systems for map zoom.
* [core] Revert use of optional<EdgeInsets>, because EdgeInsets has a natural ↵John Firebaugh2017-04-111-9/+9
| | | | "empty" state
* [core] Added {set,get}{Min,Max}PitchBruno de Oliveira Abinader2017-04-111-0/+2
|
* [core] Added Map::{get,set}LatLngBoundsBruno de Oliveira Abinader2017-04-111-0/+1
|
* [core] Move {Map,Transform}::{get,set}{Min,Max}Zoom to bounds pragmaBruno de Oliveira Abinader2017-04-111-3/+5
|
* [core] Updated Size::isEmpty and TransformState::valid checksBruno de Oliveira Abinader2017-04-101-1/+1
|
* [core] Added Map::latLngBoundsForCameraBruno de Oliveira Abinader2017-03-241-0/+2
|
* [core] Replace MapChange enum with MapObserverBruno de Oliveira Abinader2017-03-151-4/+3
|
* [core] [android] - allow zooming/scaling to use AnimationOptions (#8181)Tobrun2017-02-281-19/+19
| | | [glfw] - allow glfw binding to use AnimationOptions instead of using direction directly
* [core] - allow moveBy to use AnimationOptionsTobrun2017-02-201-1/+1
| | | | [android] - update jni bindings for moveBy with an interpolator
* [core] change std::array<uint16_t, 2> to mbgl::SizeKonstantin Käfer2016-10-271-1/+1
|
* [core] code style cleanupsKonstantin Käfer2016-07-011-3/+3
| | | | | | | - puts function definitions in a namespace ... {} rather than using namespace ...; - remove trailing whitespace - add trailing newline - protect SQL statements from being formatted by clang-format
* [core] use #pragma once instead of ifdef include guardsKonstantin Käfer2016-05-251-4/+1
|
* [core] remove MockView and View dependency in TransformKonstantin Käfer2016-05-181-4/+5
|
* [core] Added Viewport modeBruno de Oliveira Abinader2016-05-111-2/+6
| | | | | | Satisfies embedding platforms that requires the viewport coordinate systems to be set according to its standards e.g. viewport mirrored vertically.
* [core, ios, osx] cameraThatFitsCoordinateBoundsMinh Nguyễn2016-04-221-0/+2
| | | | | | Added an API to get a camera that you can pass into -[MGLMapView setCamera:] that fits the given coordinate bounds, by analogy with -[MKMapView regionThatFits:] or -[MKMapView mapRectThatFits:edgePadding:]. Added mbgl::Map::getCameraOptions() for getting the current camera options more conveniently.
* [core] Don't copy TransformState (#3501)Thiago Marcos P. Santos2016-04-151-1/+1
|
* [core] Simplify LatLng::unwrapForShortestPath usageBruno de Oliveira Abinader2016-03-141-0/+2
| | | | | | | | | | Simplify LatLng::{wrap,unwrapForShortestPath} code, avoiding duplicated code between Transform::{latLngToScreenCoordinate,easeTo,flyTo}. Added unit tests for camera usage in Transform to detect cases like e.g. crossing the antimeridian as a shortest path between two coordinates. Transform::flyTo precision loss to be handled in #4298.
* [core] Harden Transform anchor & padding usageBruno de Oliveira Abinader2016-03-131-13/+23
| | | | | Use optional values for anchor & padding in Map and Transform functions instead of NaNs. Added unit tests to stress some edge cases.
* [core] Check for NaNs in EdgeInsetsBruno de Oliveira Abinader2016-03-101-3/+3
|
* [core] Added Transform::getScreenCoordinateBruno de Oliveira Abinader2016-03-101-0/+1
|
* [core] Moved wrapping to LatLng scopeBruno de Oliveira Abinader2016-03-011-2/+0
| | | | Fixes a precision loss when converting unwrapped LatLngs.
* [core] PrecisionPoint is now ScreenCoordinateBruno de Oliveira Abinader2016-03-011-10/+10
|
* [core, ios, osx] Only constrain after adding to a windowMinh Nguyễn2016-02-101-0/+4
| | | | | | Introduced a setter/getter for constrain mode. On iOS and OS X, the zoom level inspectable causes the zoom level to be set independently from the longitude and latitude. Thus, the latitude inspectable had no effect because the latitude was constrained to 0 at z0. Temporarily removing the heightwise constraint allows the map to center on the intended location before zooming, which is the usual case for storyboards and XIBs. On iOS, the only guarantee we have timing-wise is that all the inspectables are applied after initialization but before the view is added to a window. So we reimpose the heightwise constraint as soon as the view is added to a window, that is, before the user has a chance to pan the map out of bounds. Fixes #3868.
* [core] add setMaxZoom, setMinZoomAnsis Brammanis2016-01-281-0/+3
| | | | also change the default maxZoom to 20 to match -js.
* [core, ios, osx] Tilt around visual center pointMinh Nguyễn2016-01-261-0/+8
| | | | The tilt gesture on both iOS and OS X now respects the content insets. On iOS, in user tracking mode, it additionally respects the user dot’s position if it’s aligned to the top or bottom of the view.
* [core, ios, osx, android, glfw] Flipped origin of Map::latLngForPixel(), ↵Minh Nguyễn2016-01-181-0/+4
| | | | | | | | Map::pixelForLatLng() Map and Transform methods assume an origin at the top-left corner of the view, like iOS, Android, and GLFW but unlike OS X. Transform is responsible for flipping coordinates between the top-left origin of Map and the bottom-left origin of TransformState. Fixes #3574.
* [core, osx] Added optional padding to convenience methodsMinh Nguyễn2016-01-181-5/+23
| | | | Methods that offer a convenient way to jump or ease now accept an optional padding parameter. MGLMapView specifies the padding to ensure that keyboard-based zooming and rotation respects the toolbar.
* [core] Added padding option to CameraOptionsMinh Nguyễn2016-01-181-1/+2
| | | | | | Moved EdgeInsets to geo.hpp so CameraOptions and Transform can refer to it. Added a padding option to CameraOptions that alters the frame of reference for the center option. Added optional padding parameters to LatLng getters and setters. Working towards #2600.
* [core] Consolidated easeTo and flyToMinh Nguyễn2016-01-141-5/+5
| | | | Pushed much of easeTo() and flyTo() into startTransition() to avoid code duplication.
* [core] Moved camera methods next to each otherMinh Nguyễn2016-01-141-2/+8
|
* [core] Consolidated zoom and angle anchor logicMinh Nguyễn2016-01-141-0/+2
| | | | Made anchor a CameraOption for easeTo().
* [core] Standardize transform originMinh Nguyễn2016-01-141-5/+31
| | | | All Transform methods that take a PrecisionPoint now assume a “flipped” origin at the upper-left corner of the view. Previously, some methods assumed an origin at the lower-left corner.