summaryrefslogtreecommitdiff
path: root/src/mbgl/map/transform_state.hpp
diff options
context:
space:
mode:
authorAnsis Brammanis <brammanis@gmail.com>2015-08-14 12:41:18 +0300
committerAnsis Brammanis <brammanis@gmail.com>2015-08-24 18:41:50 -0400
commit8d22e2bf017c1442a15b1fbe404dff77fb21e8fc (patch)
tree62c130aff8e89d04a0f224d18ae7e3dd53f0e60b /src/mbgl/map/transform_state.hpp
parentd5139107123b3cadcce2c80d4aea0ed3a6256683 (diff)
downloadqtlocation-mapboxgl-8d22e2bf017c1442a15b1fbe404dff77fb21e8fc.tar.gz
port perspective projection matrix from -js
Diffstat (limited to 'src/mbgl/map/transform_state.hpp')
-rw-r--r--src/mbgl/map/transform_state.hpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/mbgl/map/transform_state.hpp b/src/mbgl/map/transform_state.hpp
index 16f2de2f79..3996e6e544 100644
--- a/src/mbgl/map/transform_state.hpp
+++ b/src/mbgl/map/transform_state.hpp
@@ -49,6 +49,9 @@ public:
// Rotation
float getAngle() const;
+ float getAltitude() const;
+ float getPitch() const;
+
// Projection
const vec2<double> pixelForLatLng(const LatLng latLng) const;
const LatLng latLngForPixel(const vec2<double> pixel) const;
@@ -56,6 +59,9 @@ public:
// Changing
bool isChanging() const;
+ double pixel_x() const;
+ double pixel_y() const;
+
private:
void constrain(double& scale, double& y) const;
@@ -63,9 +69,6 @@ private:
double min_scale = std::pow(2, 0);
double max_scale = std::pow(2, 18);
- double pixel_x() const;
- double pixel_y() const;
-
// logical dimensions
uint16_t width = 0, height = 0;
@@ -80,6 +83,8 @@ private:
double x = 0, y = 0;
double angle = 0;
double scale = 1;
+ double altitude = 1.5;
+ double pitch = 0;
// cache values for spherical mercator math
double Bc = (scale * util::tileSize) / 360;