1
0
Fork 0

Curt noticed a while back that YASim was producing alpha and sideslip

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.
This commit is contained in:
andy 2006-08-28 17:24:34 +00:00
parent 03bba2a792
commit 2f2d486778
3 changed files with 5 additions and 4 deletions

View 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.

View 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.

View 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);