Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pathfinding funnel adding unwanted point #79228

Merged
merged 1 commit into from
Aug 2, 2023

Conversation

smix8
Copy link
Contributor

@smix8 smix8 commented Jul 9, 2023

Fixes pathfinding funnel adding unwanted point due to precision issues.

Fixes #74696.

The pathfinding postprocessing corridorfunnel can run into precision issues when points are directly on top of polygon edges or corners along the path corridor adding unwanted path points snapped to the polygon corners.

If this happens this is normally corrected within the next step for the next polygon that removes this unwanted point again by clipping the existing path. This correction does not happen for the point at the beginning closest to the end point due to apex overlap.

With the change in this pr the postprocessing checks and skips ahead to the next polygon should the final path point overlap with the last pathway edge. This avoids both the precision issue as well as adding a path point directly on the edge basically overlapping the end point.

@smix8 smix8 added bug topic:navigation cherrypick:4.0 cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release labels Jul 9, 2023
@smix8 smix8 added this to the 4.2 milestone Jul 9, 2023
Fixes pathfinding funnel adding unwanted point due to precision issues.
@YuriSizov YuriSizov merged commit d7f0782 into godotengine:master Aug 2, 2023
@YuriSizov
Copy link
Contributor

Thanks!

@smix8 smix8 deleted the fix_funnel_4.x branch August 3, 2023 18:00
@YuriSizov
Copy link
Contributor

Cherry-picked for 4.1.3.

@YuriSizov YuriSizov removed the cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release label Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NavigationAgent2D gives incorrect path
3 participants