From d47eefb00ce5b6fcd3a4a8320a4ccfda070ff35f Mon Sep 17 00:00:00 2001 From: andy Date: Fri, 10 Mar 2006 19:47:23 +0000 Subject: [PATCH] Fix an uninitialized data condition that crept in during the recent groundcache addition -- the ground callback doesn't do anything at solution time, so the ground plane was unset. Valgrind was whining about this; it's not clear that it was actually causing a problem. --- src/FDM/YASim/Airplane.cpp | 11 ++++++----- src/FDM/YASim/Model.cpp | 8 ++++++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/FDM/YASim/Airplane.cpp b/src/FDM/YASim/Airplane.cpp index df9dfbe60..e9763673e 100644 --- a/src/FDM/YASim/Airplane.cpp +++ b/src/FDM/YASim/Airplane.cpp @@ -677,11 +677,12 @@ void Airplane::compile() } // Ground effect - float gepos[3]; - float gespan = 0; - if(_wing) - gespan = _wing->getGroundEffect(gepos); - _model.setGroundEffect(gepos, gespan, 0.15f); + if(_wing) { + float gepos[3]; + float gespan = 0; + gespan = _wing->getGroundEffect(gepos); + _model.setGroundEffect(gepos, gespan, 0.15f); + } solveGear(); if(_wing && _tail) solve(); diff --git a/src/FDM/YASim/Model.cpp b/src/FDM/YASim/Model.cpp index ece48823d..e38de2515 100644 --- a/src/FDM/YASim/Model.cpp +++ b/src/FDM/YASim/Model.cpp @@ -60,6 +60,14 @@ Model::Model() _ground_cb = new Ground(); _hook = 0; _launchbar = 0; + + _groundEffectSpan = 0; + _groundEffect = 0; + for(i=0; i<3; i++) _wingCenter[i] = 0; + + _global_ground[0] = 0; _global_ground[1] = 0; _global_ground[2] = 1; + _global_ground[3] = -100000; + } Model::~Model()