- // the coordinates generated by the above "recalcPositionVectors"
- sgCopyVec3(_zero_elev, _zero_elev_view_pos);
- sgCopyVec3(_view_pos, _relative_view_pos);
-
-
-
- // get the world up radial vector from planet center
- // (ie. effect of aircraft location on earth "sphere" approximation)
- sgSetVec3( _world_up, UP[0][0], UP[0][1], UP[0][2] );
-
-
-
- // Creat local matrix with current geodetic position. Converting
- // the orientation (pitch/roll/heading) to vectors.
- fgMakeLOCAL( LOCAL, _pitch_deg * SG_DEGREES_TO_RADIANS,
- _roll_deg * SG_DEGREES_TO_RADIANS,
- -_heading_deg * SG_DEGREES_TO_RADIANS);
- // Adjust LOCAL to current world_up vector (adjustment for planet location)
- sgPostMultMat4( LOCAL, UP );
- // make sg vectors view up, right and forward vectors from LOCAL
- sgSetVec3( _view_up, LOCAL[0][0], LOCAL[0][1], LOCAL[0][2] );
- sgSetVec3( right, LOCAL[1][0], LOCAL[1][1], LOCAL[1][2] );
- sgSetVec3( forward, LOCAL[2][0], LOCAL[2][1], LOCAL[2][2] );
-
-
-
- // create xyz offsets Vector
- sgVec3 position_offset;
- sgSetVec3( position_offset, _y_offset_m, _x_offset_m, _z_offset_m );