Skip to content

Commit

Permalink
Decrease the chance of rectangle intersection happening incorrectly
Browse files Browse the repository at this point in the history
  • Loading branch information
philipturner committed Sep 2, 2021
1 parent 9bddf7a commit f7a904b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions AR MultiPendulum.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down

0 comments on commit f7a904b

Please sign in to comment.