-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Allow Navigation to be more flexible #47024
Conversation
What happens if the two polys (edges) overlap slightly? In the past, that would break navigation, too. Also, is this for 2D only or also for 3D? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR doesn't have the 3D editor, right?
Hello, could you give my idea of an improvement if it is not implemented? the idea would be to have a slider in the inspector when creating a navmesh and that will be used to extrude the nacmesh in to prevent it from always navigating overboard and make it look like a more natural movement |
I don't know, it seems to work fine. Overlapping regions stil does not work, but if it's close enough to create a pathway it seems to work. It's for both 3D and 2D, behind the scene the 2D servers calls the 3D version.
Nope, I am not familiar with the 3D editor enough. And without a working test project it's hard to test.
Sorry that's out of the scope of this PR. You may open a proposal in the godot-proposal repository if you want. |
@AndreaCatania I made the changes you requested, thanks! |
Not sure how feasible it is, but would computing the boolean difference/intersection between overlapping regions help with said overlap breaking navigation? That way you could remove the difference from one region, or have the intersection as a separate region, and the edges would line up cleanly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job!
Thanks! |
This was removed by mistake in godotengine#47024, NavigationServer uses internal mutability for thread safety, and removing `const` breaks the contract.
In the previous implementation, you needed two edges to be almost exactly similar for two regions to be connected (same length, close to each other and almost parallel. Now, the conditions are similar but two edges of different length can be connected too. This makes navigation a lot more flexible.
I also implemented some changes: