1
0
Fork 0

Use computed gravity instead of hardcoded value

This commit is contained in:
Torsten Dreyer 2011-06-08 20:17:40 +02:00
parent f52cf4e3b8
commit bad5fbf66a
2 changed files with 4 additions and 4 deletions

View file

@ -32,6 +32,7 @@
#include "AIBallistic.hxx"
#include <Main/util.hxx>
#include <Environment/gravity.hxx>
using namespace simgear;
@ -51,7 +52,6 @@ _elapsed_time(0),
_aero_stabilised(false),
_drag_area(0.007),
_life_timer(0.0),
_gravity(32.1740485564),
_buoyancy(0),
_wind(true),
_mass(0),
@ -727,7 +727,7 @@ void FGAIBallistic::Run(double dt) {
if ( speed < 0.0 )
speed = 0.0;
double speed_fps = speed * SG_KT_TO_FPS;
// double speed_fps = speed * SG_KT_TO_FPS;
// calculate vertical and horizontal speed components
calcVSHS();
@ -858,7 +858,8 @@ void FGAIBallistic::Run(double dt) {
hs = 0;
// adjust vertical speed for acceleration of gravity, buoyancy, and vertical force
vs -= (_gravity - _buoyancy - v_force_acc_fpss - normal_force_fpss) * dt;
double gravity = Environment::Gravity::instance()->getGravity(pos);
vs -= (gravity - _buoyancy - v_force_acc_fpss - normal_force_fpss) * dt;
if (vs <= 0.00001 && vs >= -0.00001)
vs = 0;

View file

@ -175,7 +175,6 @@ private:
bool _aero_stabilised; // if true, object will align with trajectory
double _drag_area; // equivalent drag area in ft2
double _life_timer; // seconds
double _gravity; // fps^2
double _buoyancy; // fps^2
bool _wind; // if true, local wind will be applied to object
double _Cd; // drag coefficient