mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 05:26:45 +08:00
refs #852 Added a floating-point onGround value in CAircraftParts.
This commit is contained in:
@@ -133,5 +133,14 @@ namespace BlackMisc
|
||||
return this->m_engines.isEngineOn(number);
|
||||
}
|
||||
|
||||
double CAircraftParts::isOnGroundInterpolated() const
|
||||
{
|
||||
if (this->m_isOnGroundInterpolated < 0)
|
||||
{
|
||||
return this->m_isOnGround ? 1.0 : 0.0;
|
||||
}
|
||||
return this->m_isOnGroundInterpolated;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
@@ -116,6 +116,12 @@ namespace BlackMisc
|
||||
//! Set aircraft on ground
|
||||
void setOnGround(bool onGround) { m_isOnGround = onGround; }
|
||||
|
||||
//! Is aircraft on ground? (Smoothly interpolated between 0 and 1.)
|
||||
double isOnGroundInterpolated() const;
|
||||
|
||||
//! Set aircraft on ground. (Smoothly interpolated between 0 and 1.)
|
||||
void setOnGroundInterpolated(double onGround) { m_isOnGroundInterpolated = onGround; }
|
||||
|
||||
//! Milliseconds to add to timestamp for interpolation
|
||||
void setTimeOffsetMs(qint64 offset) { this->m_timeOffsetMs = offset; }
|
||||
|
||||
@@ -135,6 +141,7 @@ namespace BlackMisc
|
||||
bool m_gearDown = false;
|
||||
bool m_spoilersOut = false;
|
||||
bool m_isOnGround = false;
|
||||
double m_isOnGroundInterpolated = -1;
|
||||
qint64 m_timeOffsetMs = 0;
|
||||
|
||||
BLACK_METACLASS(
|
||||
@@ -145,6 +152,7 @@ namespace BlackMisc
|
||||
BLACK_METAMEMBER_NAMED(spoilersOut, "spoilers_out"),
|
||||
BLACK_METAMEMBER_NAMED(engines, "engines"),
|
||||
BLACK_METAMEMBER_NAMED(isOnGround, "on_ground"),
|
||||
BLACK_METAMEMBER(isOnGroundInterpolated, 0, DisabledForJson | DisabledForComparison),
|
||||
BLACK_METAMEMBER(timestampMSecsSinceEpoch, 0, DisabledForJson | DisabledForComparison),
|
||||
BLACK_METAMEMBER(timeOffsetMs, 0, DisabledForJson | DisabledForComparison)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user