]> git.mxchange.org Git - flightgear.git/commitdiff
Commit the current state of affairs to see if it fixes the position code for others
authorehofman <ehofman>
Thu, 29 Oct 2009 13:34:43 +0000 (13:34 +0000)
committerTim Moore <timoore@redhat.com>
Thu, 29 Oct 2009 22:09:21 +0000 (23:09 +0100)
src/Main/viewmgr.cxx
src/Model/acmodel.cxx
src/Model/acmodel.hxx

index cc254991b5b2c7fc06bde2f06101102b3e9e9215..b31b9912b3a6dca715b2a26ede8fac70bcacefca 100644 (file)
@@ -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);
 }
index 1a93a49ab15153f3d1bc5c9d16b6a8c529293e8e..305c1fbeb87b7b7dfb884bac0e4d2402f60f6a3f 100644 (file)
@@ -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 );
 }
 
index f9917a1d79ebcdf250a4ddda042a7d1bb00aa5b2..da3c844f56888a5e6ba849264e3b5b87aaf02281 100644 (file)
@@ -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;