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);
}
_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 );
}
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;