mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 23:25:53 +08:00
Ref T231, utility functions
* corrected altitude also considering CG * 0 if CG is NULL
This commit is contained in:
@@ -45,6 +45,12 @@ namespace BlackMisc
|
||||
return m_elevationPlane.isWithinRange(coordinate);
|
||||
}
|
||||
|
||||
const CLength &CInterpolationHints::getCGAboveGroundOrZero() const
|
||||
{
|
||||
static const CLength zero;
|
||||
return this->hasCGAboveGround() ? this->getCGAboveGround() : zero;
|
||||
}
|
||||
|
||||
void CInterpolationHints::setAircraftParts(const CAircraftParts &parts, bool hasParts)
|
||||
{
|
||||
m_hasParts = hasParts;
|
||||
|
||||
@@ -66,6 +66,9 @@ namespace BlackMisc
|
||||
//! Get CG above ground
|
||||
const PhysicalQuantities::CLength &getCGAboveGround() const { return m_cgAboveGround;}
|
||||
|
||||
//! Get CG above ground or 0 ("Zero")
|
||||
const PhysicalQuantities::CLength &getCGAboveGroundOrZero() const;
|
||||
|
||||
//! Has CG above ground
|
||||
bool hasCGAboveGround() const { return m_cgAboveGround.isNull(); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user