X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FNetwork%2Fray.cxx;h=855a644a857a6b4289b306cb3e290ef8e62ef6fc;hb=a1031b052dd40ca3a4ea68dcd7f572b7d9e4bb24;hp=af3b14b39cdaa7480ac78adcfac0cda8b6993ada;hpb=c9813d1b5d79b4aad13c263690a0223086af25ac;p=flightgear.git diff --git a/src/Network/ray.cxx b/src/Network/ray.cxx index af3b14b39..855a644a8 100644 --- a/src/Network/ray.cxx +++ b/src/Network/ray.cxx @@ -20,13 +20,16 @@ // // $Id$ +#ifdef HAVE_CONFIG_H +# include +#endif #include #include #include -#include - +#include +#include #include "ray.hxx" @@ -63,7 +66,8 @@ FGRAY::~FGRAY() { bool FGRAY::gen_message() { // cout << "generating RayWoodworth message" << endl; - FGInterface *f = cur_fdm_state; + FlightProperties f; + int axis, subaxis; const double fullscale[6] = { -0.5, -0.5, -0.5, /* radians */ -0.3, -0.3, -0.15 /* meters */ }; @@ -72,8 +76,8 @@ bool FGRAY::gen_message() { double dt = 0.05; /* seconds */ /* get basic information about gravity */ - double grav_acc = -9.81; - double vert_acc = f->get_A_Z_pilot() * 0.3; + double grav_acc = -Environment::Gravity::instance()->getGravity( f.getPosition() ); + double vert_acc = f.get_A_Z_pilot() * 0.3; if ( -3.0 < vert_acc ) vert_acc = -3.0; @@ -86,13 +90,13 @@ bool FGRAY::gen_message() { /* Retrieve the desired components */ switch ( axis ) { - case 0: ang_pos = f->get_Phi(); - lin_acc = f->get_A_Y_pilot() * 0.3; + case 0: ang_pos = f.get_Phi(); + lin_acc = f.get_A_Y_pilot() * 0.3; break; - case 1: ang_pos = f->get_Theta(); - lin_acc = f->get_A_X_pilot() * 0.3; + case 1: ang_pos = f.get_Theta(); + lin_acc = f.get_A_X_pilot() * 0.3; break; - case 2: ang_pos = f->get_Psi(); + case 2: ang_pos = f.get_Psi(); lin_acc = grav_acc - vert_acc; break; default: