From 607ece8f61908b9b8e5f6a8252d81e2ca52521a4 Mon Sep 17 00:00:00 2001 From: Brandon Lai-Cheong <brandon.lai-cheong@uwaterloo.ca> Date: Tue, 3 Dec 2024 12:41:16 -0500 Subject: [PATCH] fixed debug check point equality --- src/debug_utilities/mostly_equal.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/debug_utilities/mostly_equal.cpp b/src/debug_utilities/mostly_equal.cpp index 98585a3..72574fc 100644 --- a/src/debug_utilities/mostly_equal.cpp +++ b/src/debug_utilities/mostly_equal.cpp @@ -2,14 +2,16 @@ #include <point.h> #include <triangle.h> +#define DEBUG_EPSILON 0.0001 + bool mostlyEqual(float a, float b) { - return abs(a - b) < 0.0001; + return abs(a - b) < DEBUG_EPSILON; } bool mostlyEqual(const Point &a, const Point &b) { - return mostlyEqual(a.x, b.x) && mostlyEqual(a.y, b.y); + return mostlyEqual(a.x, b.x) && mostlyEqual(a.y, b.y) && mostlyEqual(a.z, b.z); } // mostly equal -- GitLab