]> git.mxchange.org Git - flightgear.git/commitdiff
Curt noticed a while back that YASim was producing alpha and sideslip
authorandy <andy>
Mon, 28 Aug 2006 17:24:34 +0000 (17:24 +0000)
committerandy <andy>
Mon, 28 Aug 2006 17:24:34 +0000 (17:24 +0000)
values that were angles between the aircraft's orientation and the
global velocity vector, not the airflow velocity.  So the HUD velocity
vector was wrong when the wind was non-zero.  Fix that.

src/FDM/YASim/Glue.cpp
src/FDM/YASim/Glue.hpp
src/FDM/YASim/YASim.cxx

index 8922363da0a83720b596bfc0b8a3753ea91d6795..90e9fdb249efe32262ec770009b9a74595034e97 100644 (file)
@@ -2,11 +2,12 @@
 #include "Glue.hpp"
 namespace yasim {
 
-void Glue::calcAlphaBeta(State* s, float* alpha, float* beta)
+void Glue::calcAlphaBeta(State* s, float* wind, float* alpha, float* beta)
 {
     // Convert the velocity to the aircraft frame.
     float v[3];
-    Math::vmul33(s->orient, s->v, v);
+    Math::sub3(s->v, wind, v);
+    Math::vmul33(s->orient, v, v);
 
     // By convention, positive alpha is an up pitch, and a positive
     // beta is yawed to the right.
index dd621e12db50158b91cea2bbdf8613db54a9839c..12f2f8349f8dc6ab941b0ec8ca3fe2b61139a6a1 100644 (file)
@@ -10,7 +10,7 @@ namespace yasim {
 // out the middle of the western hemisphere.
 class Glue {
 public:
-    static void calcAlphaBeta(State* s, float* alpha, float* beta);
+    static void calcAlphaBeta(State* s, float* wind, float* alpha, float* beta);
 
     // Calculates the instantaneous rotation velocities about each
     // axis.
index 924399afea10e55a0d115c4ada7732c4abbdf985..27fcbff6d64672baa49f822b3daa06ef74b7f9d6 100644 (file)
@@ -441,7 +441,7 @@ void YASim::copyFromYASim()
 
     // orientation
     float alpha, beta;
-    Glue::calcAlphaBeta(s, &alpha, &beta);
+    Glue::calcAlphaBeta(s, wind, &alpha, &beta);
     _set_Alpha(alpha);
     _set_Beta(beta);