#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>
#include "viewer.hxx"
+#include "CameraGroup.hxx"
+
+using namespace flightgear;
\f
////////////////////////////////////////////////////////////////////////
// Implementation of FGViewer.
_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;
_roll_offset_deg);
// Offsets to the eye position
- SGVec3d eyeOff(-_offset_m.z(), _offset_m.y(), -_offset_m.x());
+ SGVec3d eyeOff(-_offset_m.z(), _offset_m.x(), -_offset_m.y());
SGQuatd ec2eye = geodEyeHlOr*geodEyeOr;
SGVec3d eyeCart = SGVec3d::fromGeod(geodEyePos);
eyeCart += (ec2eye*eyeOffsetOr).backTransform(eyeOff);
}
}
}
-
+ recalc();
+ _cameraGroup->update(_absolute_view_pos.osg(), mViewOrientation.osg());
+ _cameraGroup->setCameraParameters(get_v_fov(), get_aspect_ratio());
}