#include <string.h> // strcmp
#include <plib/sg.h>
+#include <plib/ssg.h>
+
+#include <simgear/compiler.h>
+
+#include <Model/acmodel.hxx>
#include "viewmgr.hxx"
#include "fg_props.hxx"
double near_m;
bool internal;
+ double aspect_ratio_multiplier
+ = fgGetDouble("/sim/current-view/aspect-ratio-multiplier");
+
for (int i = 0; i < fgGetInt("/sim/number-views"); i++) {
viewpath = "/sim/view";
sprintf(stridx, "[%d]", i);
damp_roll, damp_pitch, damp_heading,
x_offset_m, y_offset_m,z_offset_m,
heading_offset_deg, pitch_offset_deg,
- roll_offset_deg, fov_deg,
+ roll_offset_deg, fov_deg, aspect_ratio_multiplier,
target_x_offset_m, target_y_offset_m,
target_z_offset_m, near_m, internal ));
else
false, 0, 0.0, 0.0, 0.0,
x_offset_m, y_offset_m, z_offset_m,
heading_offset_deg, pitch_offset_deg,
- roll_offset_deg, fov_deg, 0, 0, 0, near_m,
- internal ));
+ roll_offset_deg, fov_deg, aspect_ratio_multiplier,
+ 0, 0, 0, near_m, internal ));
}
copyToCurrent();
&FGViewMgr::getFOV_deg, &FGViewMgr::setFOV_deg);
fgSetArchivable("/sim/current-view/field-of-view");
+ fgTie("/sim/current-view/aspect-ratio-multiplier", this,
+ &FGViewMgr::getARM_deg, &FGViewMgr::setARM_deg);
+ fgSetArchivable("/sim/current-view/field-of-view");
+
fgTie("/sim/current-view/ground-level-nearplane-m", this,
&FGViewMgr::getNear_m, &FGViewMgr::setNear_m);
fgSetArchivable("/sim/current-view/ground-level-nearplane-m");
fgUntie("/sim/current-view/goal-heading-offset-deg");
fgUntie("/sim/current-view/pitch-offset-deg");
fgUntie("/sim/current-view/goal-pitch-offset-deg");
- fgUntie("/sim/field-of-view");
+ fgUntie("/sim/current-view/field-of-view");
+ fgUntie("/sim/current-view/aspect-ratio-multiplier");
fgUntie("/sim/current-view/view-number");
fgUntie("/sim/current-view/axes/long");
fgUntie("/sim/current-view/axes/lat");
set_view( newview );
// copy in view data
copyToCurrent ();
+
+ // Copy the fdm's position into the SGLocation which is shared with
+ // some views ...
+ globals->get_aircraft_model()->update(0);
+ // Do the update ...
+ update(0);
}
view->set_fov(fov);
}
+double
+FGViewMgr::getARM_deg () const
+{
+ const FGViewer * view = get_current_view();
+ return (view == 0 ? 0 : view->get_aspect_ratio_multiplier());
+}
+
+void
+FGViewMgr::setARM_deg (double aspect_ratio_multiplier)
+{
+ FGViewer * view = get_current_view();
+ if (view != 0)
+ view->set_aspect_ratio_multiplier(aspect_ratio_multiplier);
+}
+
double
FGViewMgr::getNear_m () const
{