Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- SphericalProjection_original.cpp 2011-12-20 20:19:12.000000000 +0100
- +++ SphericalProjection.cpp 2012-05-23 19:51:57.539813700 +0200
- @@ -19,6 +19,8 @@
- #include "GeoDataPoint.h"
- #include "global.h"
- +#include <QDebug>
- +
- #define SAFE_DISTANCE
- namespace Marble
- @@ -81,10 +83,15 @@
- const ViewportParams *viewport,
- qreal &x, qreal &y, bool &globeHidesPoint ) const
- {
- + qDebug() << "SphericalProjection::screenCoordinates() lat: " << coordinates.latitude() << " lon: " << coordinates.longitude() << " type: " << coordinates.getType();
- qreal absoluteAltitude = coordinates.altitude() + EARTH_RADIUS;
- Quaternion qpos = coordinates.quaternion();
- - qpos.rotateAroundAxis( *( viewport->planetAxisMatrix() ) );
- + if (coordinates.getType()){
- + viewport->setTime(coordinates.getTime());
- + viewport->setOld(coordinates.isOld());
- + }
- + qpos.rotateAroundAxis( *( viewport->planetAxisMatrix( coordinates.getType() ) ));
- qreal pixelAltitude = ( ( viewport->radius() )
- / EARTH_RADIUS * absoluteAltitude );
- @@ -92,6 +99,7 @@
- // Skip placemarks at the other side of the earth.
- if ( qpos.v[Q_Z] < 0 ) {
- globeHidesPoint = true;
- + coordinates.setOld(true);
- return false;
- }
- }
- @@ -106,6 +114,7 @@
- + earthCenteredY * earthCenteredY )
- < radius * radius ) ) {
- globeHidesPoint = true;
- + coordinates.setOld(true);
- return false;
- }
- }
- @@ -117,10 +126,12 @@
- // Skip placemarks that are outside the screen area
- if ( x < 0 || x >= viewport->width() || y < 0 || y >= viewport->height() ) {
- globeHidesPoint = false;
- + coordinates.setOld(true);
- return false;
- }
- globeHidesPoint = false;
- + coordinates.setOld(true);
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement