diff options
author | Michal Klocek <michal.klocek@theqtcompany.com> | 2015-04-28 11:05:48 +0200 |
---|---|---|
committer | Michal Klocek <michal.klocek@theqtcompany.com> | 2015-05-21 08:13:08 +0000 |
commit | c40da252cf5ccdc5b5d2ce30b0f7f272e3d1c5bf (patch) | |
tree | ea95c613824eb18c628c9317addc5524cd5f28e6 /src/location/maps/qgeocameratiles.cpp | |
parent | 27baf7d76a30496d1270981cfb3dc1aad63461d3 (diff) | |
download | qtlocation-c40da252cf5ccdc5b5d2ce30b0f7f272e3d1c5bf.tar.gz |
Fix missing tiles on some zoomLevels
When ratio between screen size and tile size was high,
frustum far clipping plane was preventing intersection
points calculations.
Do not use magic value for far clipping plane, since frustum
is not used in projection for int zoom level changes, simplify
near clipping plane. Near clipping plane should be always
smaller than possible altitude value. Far plane should always
exceed altitude to allow intersections with z plane.
Task-number: QTBUG-45508
Change-Id: I59693ace794de37f0ad3544c11eb0c5a471eeb04
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src/location/maps/qgeocameratiles.cpp')
-rw-r--r-- | src/location/maps/qgeocameratiles.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/location/maps/qgeocameratiles.cpp b/src/location/maps/qgeocameratiles.cpp index 2c7a7505..8023adcd 100644 --- a/src/location/maps/qgeocameratiles.cpp +++ b/src/location/maps/qgeocameratiles.cpp @@ -334,8 +334,9 @@ Frustum QGeoCameraTilesPrivate::createFrustum(double fieldOfViewGradient) const QDoubleVector3D side = QDoubleVector3D::normal(view, QDoubleVector3D(0.0, 1.0, 0.0)); QDoubleVector3D up = QDoubleVector3D::normal(side, view); - double nearPlane = m_sideLength / (1.0 * m_tileSize * (1 << m_maxZoom)); - double farPlane = 3.0; + double nearPlane = 1 / (4.0 * m_tileSize ); + double farPlane = altitude + 1.0; + double aspectRatio = 1.0 * m_screenSize.width() / m_screenSize.height(); |