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 NavigationLink helper functions for global positions #73229

Merged
merged 1 commit into from Feb 16, 2023

Conversation

smix8
Copy link
Contributor

@smix8 smix8 commented Feb 13, 2023

Adds NavigationLink helper functions to set the links start and end position with global positions or get them as global positions.

Adds global start and end position for the navigation link to the link_reached signal of NavigationAgent. That signal gets emitted when a navigation link waypoint is reached. Requires that owner meta data is enabled on the NavigationAgent.

Also fixes the problems mentioned in the proposal discussion here godotengine/godot-proposals#6167

While helping out GDQuest with a navigation demo I noticed myself that a lot of script boilerplate is needed to make good use of the current NavigationLink positions or the NavigationAgent signal so I added helpers and added to the signal data.

@smix8 smix8 requested review from a team as code owners February 13, 2023 15:11
@YuriSizov YuriSizov added this to the 4.1 milestone Feb 13, 2023
Copy link
Contributor

@DarkKilauea DarkKilauea left a comment

Choose a reason for hiding this comment

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

Suggested minor documentation tweaks and possible renames for dictionary keys.

Implementation looks fine to me.

scene/2d/navigation_agent_2d.cpp Outdated Show resolved Hide resolved
doc/classes/NavigationLink3D.xml Show resolved Hide resolved
doc/classes/NavigationAgent2D.xml Outdated Show resolved Hide resolved
doc/classes/NavigationAgent2D.xml Outdated Show resolved Hide resolved
Adds helper functions to set the links start and end position with global positions or get them as global positions.

Adds global start and end position for the navigation link to the 'link_reached' signal of NavigationAgent. That signal gets emitted when a navigation link waypoint is reached. Requires that 'owner' meta data is enabled on the NavigationAgent.
@smix8 smix8 force-pushed the navlink_global_positions_4.x branch from 0ff47ea to d87f124 Compare February 14, 2023 21:02
@akien-mga akien-mga modified the milestones: 4.1, 4.0 Feb 15, 2023
Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

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

Approved for 4.0 as an important usability improvement for the new feature.

@DarkKilauea
Copy link
Contributor

LGTM

@akien-mga akien-mga merged commit 9533833 into godotengine:master Feb 16, 2023
@akien-mga
Copy link
Member

Thanks!

@smix8 smix8 deleted the navlink_global_positions_4.x branch February 16, 2023 11:56
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.

None yet

4 participants