From f7a904b274b2077d6b578928e6ac02055b0e4c88 Mon Sep 17 00:00:00 2001 From: Philip Turner <71743241+philipturner@users.noreply.github.com> Date: Thu, 2 Sep 2021 16:37:47 -0400 Subject: [PATCH] Decrease the chance of rectangle intersection happening incorrectly --- AR MultiPendulum.xcodeproj/project.pbxproj | 4 ++-- .../Rectangles/Utilities_Implementation.metal | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/AR MultiPendulum.xcodeproj/project.pbxproj b/AR MultiPendulum.xcodeproj/project.pbxproj index 9041ecd..2ab8f68 100644 --- a/AR MultiPendulum.xcodeproj/project.pbxproj +++ b/AR MultiPendulum.xcodeproj/project.pbxproj @@ -1524,7 +1524,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 9; + CURRENT_PROJECT_VERSION = 10; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = 6T952M2592; ENABLE_PREVIEWS = YES; @@ -1549,7 +1549,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 9; + CURRENT_PROJECT_VERSION = 10; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = 6T952M2592; ENABLE_PREVIEWS = YES; diff --git a/AR MultiPendulum/MultiPendulum/Rendering/Shape Intersections/Rectangles/Utilities_Implementation.metal b/AR MultiPendulum/MultiPendulum/Rendering/Shape Intersections/Rectangles/Utilities_Implementation.metal index 56cc8b7..899e4e8 100644 --- a/AR MultiPendulum/MultiPendulum/Rendering/Shape Intersections/Rectangles/Utilities_Implementation.metal +++ b/AR MultiPendulum/MultiPendulum/Rendering/Shape Intersections/Rectangles/Utilities_Implementation.metal @@ -51,10 +51,10 @@ float Utilities::getIntersectionProgress(float2x2 line1, float2x2 line2, threadg float progress0 = fast::divide(dot(intersection - line1[0], delta1), length_squared(delta1)); - if (progress0 < 1e-5 || progress0 > 1 - 1e-5) + if (progress0 < 1e-4 || progress0 > 1 - 1e-4) { - if (abs(progress0) < 1e-5 || - abs(progress0 - 1) < 1e-5) + if (abs(progress0) < 1e-4 || + abs(progress0 - 1) < 1e-4) { *shouldReturnEarly = true; } @@ -63,10 +63,10 @@ float Utilities::getIntersectionProgress(float2x2 line1, float2x2 line2, threadg } float progress1 = fast::divide(dot(intersection - line2[0], delta2), length_squared(delta2)); - if (progress1 < 1e-5 || progress1 > 1 - 1e-5) + if (progress1 < 1e-4 || progress1 > 1 - 1e-4) { - if (abs(progress1) < 1e-5 || - abs(progress1 - 1) < 1e-5) + if (abs(progress1) < 1e-4 || + abs(progress1 - 1) < 1e-4) { *shouldReturnEarly = true; }