X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FMain%2Fviewer.cxx;h=4b77efb8cbd4c28a09797d020a140903d3c08ad7;hb=a4e81f4ff075e6a3c0c2ea1b5a29c0bcdfdbc671;hp=1f6194826ca57d554b9b60224054350c4a0cc81d;hpb=b1674cb5063992cfa2bbf61bbaa827fbf89229d9;p=flightgear.git diff --git a/src/Main/viewer.cxx b/src/Main/viewer.cxx index 1f6194826..4b77efb8c 100644 --- a/src/Main/viewer.cxx +++ b/src/Main/viewer.cxx @@ -561,8 +561,11 @@ FGViewer::recalcLookAt () recalcOurOwnLocation( _target_location, _target_lon_deg, _target_lat_deg, _target_alt_ft, _target_roll_deg, _target_pitch_deg, _target_heading_deg ); } - // save the "at" target object positon... - sgCopyVec3(at_pos, _target_location->get_view_pos()); + // calculate the "at" target object positon relative to eye or view's tile center... + sgdVec3 dVec3; + sgdSetVec3(dVec3, _location->get_tile_center()[0], _location->get_tile_center()[1], _location->get_tile_center()[2]); + sgdSubVec3(dVec3, _target_location->get_absolute_view_pos(), dVec3 ); + sgSetVec3(at_pos, dVec3[0], dVec3[1], dVec3[2]); // Update location data for eye... if ( _from_model ) {