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

Add get_bounds() function to NavigationMeshSourceGeometryData #95137

Merged
merged 1 commit into from
Aug 19, 2024

Conversation

smix8
Copy link
Contributor

@smix8 smix8 commented Aug 4, 2024

Adds get_bounds() function to NavigationMeshSourceGeometryData2D/3D to get a global bounding box Rect2/AABB that covers all the geometry.

Knowing the bounding box of the source geometry is valuable information. Very important for certain systems like calculating the affected grid cells that require updates or the required bounding boxes for chunk navigation mesh baking.

Calculating the bounding box manually in scripts is very, very slow for larger geometry and also not that straight forward as the different arrays and objects stored inside source geometry data need to be converted to actual vertex positions.

@smix8 smix8 added enhancement topic:navigation cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release labels Aug 4, 2024
@smix8 smix8 added this to the 4.4 milestone Aug 4, 2024
@smix8 smix8 force-pushed the source_geo_bounds branch from fdccb61 to 4197879 Compare August 4, 2024 16:18
@smix8 smix8 requested a review from a team as a code owner August 4, 2024 16:18
@smix8 smix8 requested a review from a team August 16, 2024 20:19
Copy link
Contributor

@Scony Scony left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Adds get_bounds() function to NavigationMeshSourceGeometryData2D/3D to get a bounding box that covers all the geometry.
@smix8 smix8 force-pushed the source_geo_bounds branch from 4197879 to 2e1f6b5 Compare August 18, 2024 22:12
@akien-mga akien-mga merged commit 8b98d9a into godotengine:master Aug 19, 2024
18 checks passed
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release enhancement topic:navigation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants