]> git.mxchange.org Git - simgear.git/commitdiff
Oops, it was the scenery up vector, not the viewer up vector
authorehofman <ehofman>
Thu, 5 Nov 2009 16:58:48 +0000 (16:58 +0000)
committerTim Moore <timoore@redhat.com>
Sat, 7 Nov 2009 07:52:16 +0000 (08:52 +0100)
simgear/scene/sky/sky.cxx

index 21662c66b5cdc574dd27ee56a5c1a36f58cd5504..4d833f35d7b9faefc7037d0b099ac274a20b433a 100644 (file)
@@ -152,7 +152,12 @@ bool SGSky::reposition( const SGSkyState &st, const SGEphemeris& eph, double dt
 
     SGGeod geodZeroViewPos = SGGeod::fromGeodM(st.pos_geod, 0);
     zero_elev = toVec3f( SGVec3d::fromGeod(geodZeroViewPos) );
-    view_up = toVec3f( st.ori.backTransform(SGVec3d::e2()) );
+
+    // calculate the scenery up vector
+    SGQuatd hlOr = SGQuatd::fromLonLat(st.pos_geod);
+    view_up = toVec3f(hlOr.backTransform(-SGVec3d::e3()));
+
+    // viewer location
     lon = st.pos_geod.getLongitudeRad();
     lat = st.pos_geod.getLatitudeRad();
     alt = st.pos_geod.getElevationM();