Improve NavigationObstacle2D debug visuals and performance #100708
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Improves NavigationObstacle2D debug visuals by aligning them closer to their aleady improved 3D counterpart.
Also improves performance on larger obstacles due to using a simple static line mesh instead of inefficient canvas item polygon and polyline drawing. It now shows the edge winding with a small "arrow" aka if the obstacle pushes out or in. It also colors in red when the vertices are invalid, aka fail the triangulation due to e.g. crossed edges.
To improve performance for both the 2D and 3D obstacle also adds internal functions to avoid recalculating the vertices winding and validity all the time. They are now calculated once vertices are set with the result cached and available to query with two new internal functions on both the 2D and 3D obstacle.