Fixes assertion failures reported by Julian smith.
These were due to the ground callback instance of FlightGear not setting the ellipse parameters of the 'contact' location. this commit make JSBSim immune to that scenario.
This commit is contained in:
parent
388d66b6a6
commit
bb0b69bc41
3 changed files with 8 additions and 3 deletions
|
@ -662,8 +662,11 @@ double FGInitialCondition::GetAltitudeASLFtIC(void) const
|
|||
|
||||
double FGInitialCondition::GetTerrainElevationFtIC(void) const
|
||||
{
|
||||
FGLocation contact;
|
||||
FGColumnVector3 normal, v, w;
|
||||
FGLocation contact;
|
||||
double a = fdmex->GetInertial()->GetSemimajor();
|
||||
double b = fdmex->GetInertial()->GetSemiminor();
|
||||
contact.SetEllipse(a, b);
|
||||
fdmex->GetInertial()->GetContactPoint(position, contact, normal, v, w);
|
||||
return contact.GetGeodAltitude();
|
||||
}
|
||||
|
|
|
@ -211,8 +211,9 @@ FGColumnVector3 FGInertial::GetGravityJ2(const FGLocation& position) const
|
|||
|
||||
void FGInertial::SetAltitudeAGL(FGLocation& location, double altitudeAGL)
|
||||
{
|
||||
FGLocation contact;
|
||||
FGColumnVector3 vDummy;
|
||||
FGLocation contact;
|
||||
contact.SetEllipse(a, b);
|
||||
GroundCallback->GetAGLevel(location, contact, vDummy, vDummy, vDummy);
|
||||
double groundHeight = contact.GetGeodAltitude();
|
||||
double longitude = location.GetLongitude();
|
||||
|
|
|
@ -548,8 +548,9 @@ void FGPropagate::RecomputeLocalTerrainVelocity()
|
|||
|
||||
double FGPropagate::GetTerrainElevation(void) const
|
||||
{
|
||||
FGLocation contact;
|
||||
FGColumnVector3 vDummy;
|
||||
FGLocation contact;
|
||||
contact.SetEllipse(in.SemiMajor, in.SemiMinor);
|
||||
Inertial->GetContactPoint(VState.vLocation, contact, vDummy, vDummy, vDummy);
|
||||
return contact.GetGeodAltitude();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue