Oops, it was the scenery up vector, not the viewer up vector

This commit is contained in:
ehofman
2009-11-05 16:58:48 +00:00
committed by Tim Moore
parent 39472e4d81
commit b66905c2f6

View 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();