Fix for sub-model initial offsets
The offset in body coordinates is needed by the FGAIBallistic in some cases, restore this.
This commit is contained in:
parent
2266c27930
commit
910bd2c0fd
1 changed files with 12 additions and 0 deletions
|
@ -394,6 +394,18 @@ void FGSubmodelMgr::transform(submodel *sm)
|
|||
userpos.setLongitudeDeg(IC.lon);
|
||||
userpos.setElevationFt(IC.alt);
|
||||
|
||||
if (sm->offsets_in_meter) {
|
||||
_x_offset = -sm->x_offset->get_value() * SG_METER_TO_FEET;
|
||||
_y_offset = sm->y_offset->get_value() * SG_METER_TO_FEET;
|
||||
_z_offset = sm->z_offset->get_value() * SG_METER_TO_FEET;
|
||||
}
|
||||
else {
|
||||
_x_offset = sm->x_offset->get_value();
|
||||
_y_offset = sm->y_offset->get_value();
|
||||
_z_offset = sm->z_offset->get_value();
|
||||
}
|
||||
|
||||
// this updates the 'offsetpos' member of us
|
||||
setOffsetPos(sm);
|
||||
|
||||
// Compute initial orientation using yaw and pitch offsets and parent's orientation
|
||||
|
|
Loading…
Reference in a new issue