From 5a01272258d71d01ac94eb64e363883fb0a2f071 Mon Sep 17 00:00:00 2001 From: Mat Sutcliffe Date: Wed, 9 Feb 2022 20:01:54 +0000 Subject: [PATCH] [XP] Set velocity to zero when paused --- src/xswiftbus/service.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/xswiftbus/service.h b/src/xswiftbus/service.h index fe7369f5d..36b11be59 100644 --- a/src/xswiftbus/service.h +++ b/src/xswiftbus/service.h @@ -157,16 +157,16 @@ namespace XSwiftBus //! Get aircraft local velocity in world coordinates meters per second //! @{ - double getLocalXVelocityMps() const { return m_velocityX.get(); } - double getLocalYVelocityMps() const { return m_velocityY.get(); } - double getLocalZVelocityMps() const { return m_velocityZ.get(); } + double getLocalXVelocityMps() const { return isPaused() ? 0 : m_velocityX.get(); } + double getLocalYVelocityMps() const { return isPaused() ? 0 : m_velocityY.get(); } + double getLocalZVelocityMps() const { return isPaused() ? 0 : m_velocityZ.get(); } //! @} //! Get aircraft angular velocity in radians per second //! @{ - double getPitchRadPerSec() const { return m_pitchVelocity.get(); } - double getRollRadPerSec() const { return m_rollVelocity.get(); } - double getHeadingRadPerSec() const { return m_headingVelocity.get(); } + double getPitchRadPerSec() const { return isPaused() ? 0 : m_pitchVelocity.get(); } + double getRollRadPerSec() const { return isPaused() ? 0 : m_rollVelocity.get(); } + double getHeadingRadPerSec() const { return isPaused() ? 0 : m_headingVelocity.get(); } //! @} //! Get whether any wheel is on the ground