mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-06 02:16:04 +08:00
Fix floating point comparison
This commit is contained in:
committed by
Klaus Basan
parent
05e0480bb4
commit
f637b2996d
@@ -765,7 +765,9 @@ namespace XSwiftBus
|
|||||||
{
|
{
|
||||||
const auto now = std::chrono::system_clock::now();
|
const auto now = std::chrono::system_clock::now();
|
||||||
|
|
||||||
if (plane->surfaces.gearPosition != plane->targetGearPosition)
|
static const float epsilon = std::numeric_limits<float>::epsilon();
|
||||||
|
const float f = plane->surfaces.gearPosition - plane->targetGearPosition;
|
||||||
|
if (std::abs(f) > epsilon)
|
||||||
{
|
{
|
||||||
// interpolate gear position
|
// interpolate gear position
|
||||||
constexpr float gearMoveTimeMs = 5000;
|
constexpr float gearMoveTimeMs = 5000;
|
||||||
|
|||||||
Reference in New Issue
Block a user