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

center align navigation view #599

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Xtarsia
Copy link
Contributor

@Xtarsia Xtarsia commented Jan 19, 2025

fixes #597 by adding a 0.5 offset to the uv when doing the control_map lookup.

image

@TokisanGames
Copy link
Owner

TokisanGames commented Jan 20, 2025

Thank you. Does this address the first case where it captures the top left vertex, but not the bottom right vertex? It looks like this is a cosmetic fix, but the navigation server should receive the bottom right vertices.

Maybe this should be ceil instead of floor. Or +2.
https://github.com/TokisanGames/Terrain3D/blob/main/src/terrain_3d.cpp#L651

Or this <= region_loc + region_size
https://github.com/TokisanGames/Terrain3D/blob/main/src/terrain_3d.cpp#L643

@Xtarsia
Copy link
Contributor Author

Xtarsia commented Jan 20, 2025

I don't think those edges exist. Its the 0 to (region_size - 1) indexing thing again.

This is 9 64m regions, 5 of which are filled entirely with nav (with only the offset in the shader).

image

I think we should be drawing the region gizmo, and the debug view region grid with the 0.5 offset as well.

I did test the changes to _generate_triangles() but it had no effect, as it would just lookup that location, find no region (and thus no nav painted), and skip generating that triangle pair.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Baked navmesh doesn't equally fill the painted navigable area
2 participants