]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/viewer.cxx
Merge branch 'jt/runway' into next
[flightgear.git] / src / Main / viewer.cxx
index 7c4388b16a78c202ec93d989121b02f40981d602..f2ffd56c9d57a5fae327aae613bc7e6fc6068f45 100644 (file)
@@ -37,7 +37,6 @@
 
 #include <simgear/debug/logstream.hxx>
 #include <simgear/constants.h>
-#include <simgear/math/point3d.hxx>
 #include <simgear/math/polar3d.hxx>
 #include <simgear/math/sg_geodesy.hxx>
 #include <simgear/scene/model/location.hxx>
@@ -50,6 +49,9 @@
 
 #include "viewer.hxx"
 
+#include "CameraGroup.hxx"
+
+using namespace flightgear;
 \f
 ////////////////////////////////////////////////////////////////////////
 // Implementation of FGViewer.
@@ -81,7 +83,8 @@ FGViewer::FGViewer( fgViewType Type, bool from_model, int from_model_index,
     _damp_heading(0),
     _scaling_type(FG_SCALING_MAX),
     _location(0),
-    _target_location(0)
+    _target_location(0),
+    _cameraGroup(CameraGroup::getDefault())
 {
     _absolute_view_pos = SGVec3d(0, 0, 0);
     _type = Type;
@@ -764,5 +767,7 @@ FGViewer::update (double dt)
       }
     }
   }
-
+  recalc();
+  _cameraGroup->update(_absolute_view_pos.osg(), mViewOrientation.osg());
+  _cameraGroup->setCameraParameters(get_v_fov(), get_aspect_ratio());
 }