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

Improve NavigationObstacle2D debug visuals and performance #100708

Merged
merged 1 commit into from
Dec 23, 2024

Conversation

smix8
Copy link
Contributor

@smix8 smix8 commented Dec 21, 2024

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.

navobstacle2d_debug

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.

bool are_vertices_clockwise() const { return vertices_are_clockwise; };
bool are_vertices_valid() const { return vertices_are_valid; };

Improves NavigationObstacle2D debug visuals by aligning them closer to their aleady improved 3D counterpart.
@smix8 smix8 force-pushed the navobstacle2d_debug branch from be97754 to 23ea3ab Compare December 21, 2024 18:53
@smix8 smix8 requested a review from a team December 21, 2024 23:35
@Repiteo Repiteo merged commit e109ac2 into godotengine:master Dec 23, 2024
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Dec 23, 2024

Thanks!

@smix8 smix8 deleted the navobstacle2d_debug branch December 24, 2024 00:58
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.

3 participants