From 0ff6c68c013f30d0786ba991e80e907508cc6ad9 Mon Sep 17 00:00:00 2001 From: ehofman Date: Sat, 28 Jun 2003 21:49:45 +0000 Subject: [PATCH] This patch normalizes the heading value YASim reports to the interface --- src/FDM/YASim/YASim.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/FDM/YASim/YASim.cxx b/src/FDM/YASim/YASim.cxx index f65c627f4..b2906f152 100644 --- a/src/FDM/YASim/YASim.cxx +++ b/src/FDM/YASim/YASim.cxx @@ -24,6 +24,7 @@ using namespace yasim; static const float RAD2DEG = 180/3.14159265358979323846; +static const float PI2 = 3.14159265358979323846*2; static const float RAD2RPM = 9.54929658551; static const float M2FT = 3.2808399; static const float FT2M = 0.3048; @@ -466,6 +467,8 @@ void YASim::copyFromYASim() Math::mmul33(s->orient, tmp, tmp); float roll, pitch, hdg; Glue::orient2euler(tmp, &roll, &pitch, &hdg); + // make heading positive value + if(hdg < 0.0) hdg += PI2; _set_Euler_Angles(roll, pitch, hdg); // rotation