diff --git a/src/Main/viewmgr.cxx b/src/Main/viewmgr.cxx index cc254991b..b31b9912b 100644 --- a/src/Main/viewmgr.cxx +++ b/src/Main/viewmgr.cxx @@ -302,11 +302,10 @@ FGViewMgr::update (double dt) smgr->set_orientation(loop_view->getViewOrientation(), loop_view->getViewOrientationOffset()); - // get the model velocity for the in-cockpit view - SGVec3d velocity = SGVec3d(0,0,0); + // get the model velocity + SGVec3f velocity = SGVec3f::zeros(); if ( !stationary() ) { - FGAircraftModel *aircraft = globals->get_aircraft_model(); - velocity = aircraft->getVelocity(); + velocity = globals->get_aircraft_model()->getVelocity(); } smgr->set_velocity(velocity); } diff --git a/src/Model/acmodel.cxx b/src/Model/acmodel.cxx index 1a93a49ab..305c1fbeb 100644 --- a/src/Model/acmodel.cxx +++ b/src/Model/acmodel.cxx @@ -131,10 +131,10 @@ FGAircraftModel::update (double dt) _roll->getDoubleValue()); _fx->set_orientation( orient ); - SGQuatd q(-0.5, -0.5, 0.5, 0.5); - _velocity = q.backTransform( SGVec3d( _speed_n->getDoubleValue(), - _speed_e->getDoubleValue(), - _speed_d->getDoubleValue()) ); + SGQuatf q(-0.5, -0.5, 0.5, 0.5); + _velocity = q.backTransform( SGVec3f(_speed_n->getFloatValue(), + _speed_e->getFloatValue(), + _speed_d->getFloatValue()) ); _fx->set_velocity( _velocity ); } diff --git a/src/Model/acmodel.hxx b/src/Model/acmodel.hxx index f9917a1d7..da3c844f5 100644 --- a/src/Model/acmodel.hxx +++ b/src/Model/acmodel.hxx @@ -39,12 +39,12 @@ public: virtual void unbind (); virtual void update (double dt); virtual SGModelPlacement * get3DModel() { return _aircraft; } - virtual SGVec3d getVelocity() { return _velocity; } + virtual SGVec3f& getVelocity() { return _velocity; } private: SGModelPlacement * _aircraft; - SGVec3d _velocity; + SGVec3f _velocity; SGSharedPtr<FGFX> _fx; SGPropertyNode_ptr _lon;