1
0
Fork 0

Bugfix: correct calculation of range and realtive bearing when parent is not the main model.

Signed-off-by: Vivian Meazza <vivian.meazza@lineone.net>
This commit is contained in:
Vivian Meazza 2012-10-12 21:59:06 +01:00 committed by Anders Gidenstam
parent b838691f50
commit bbea07e8b1

View file

@ -243,6 +243,7 @@ void FGAIWingman::formateToAC(double dt){
double p_hdg, p_pch, p_rll, p_agl, p_ht, p_wow = 0; double p_hdg, p_pch, p_rll, p_agl, p_ht, p_wow = 0;
setTgtOffsets(dt, 25); setTgtOffsets(dt, 25);
_setUserPos();
if (_pnode != 0) { if (_pnode != 0) {
setParentPos(); setParentPos();
@ -253,7 +254,6 @@ void FGAIWingman::formateToAC(double dt){
setOffsetPos(_parentpos, p_hdg, p_pch, p_rll); setOffsetPos(_parentpos, p_hdg, p_pch, p_rll);
setSpeed(_p_spd_node->getDoubleValue()); setSpeed(_p_spd_node->getDoubleValue());
}else { }else {
_setUserPos();
p_hdg = manager->get_user_heading(); p_hdg = manager->get_user_heading();
p_pch = manager->get_user_pitch(); p_pch = manager->get_user_pitch();
p_rll = manager->get_user_roll(); p_rll = manager->get_user_roll();
@ -341,6 +341,7 @@ void FGAIWingman::Join(double dt) {
double p_hdg, p_pch, p_rll = 0; double p_hdg, p_pch, p_rll = 0;
setTgtOffsets(dt, 25); setTgtOffsets(dt, 25);
_setUserPos();
if (_pnode != 0) { if (_pnode != 0) {
setParentPos(); setParentPos();
@ -351,7 +352,6 @@ void FGAIWingman::Join(double dt) {
parent_hdg = _p_hdg_node->getDoubleValue(); parent_hdg = _p_hdg_node->getDoubleValue();
parent_spd = _p_spd_node->getDoubleValue(); parent_spd = _p_spd_node->getDoubleValue();
}else { }else {
_setUserPos();
p_hdg = manager->get_user_heading(); p_hdg = manager->get_user_heading();
p_pch = manager->get_user_pitch(); p_pch = manager->get_user_pitch();
p_rll = manager->get_user_roll(); p_rll = manager->get_user_roll();