Skip to content

add_edges helper for directional navigation#17389

Merged
alice-i-cecile merged 5 commits intobevyengine:mainfrom
alice-i-cecile:add-edges-nav
Jan 16, 2025
Merged

add_edges helper for directional navigation#17389
alice-i-cecile merged 5 commits intobevyengine:mainfrom
alice-i-cecile:add-edges-nav

Conversation

@alice-i-cecile
Copy link
Member

Objective

While add_looping_edges is a helpful method for manually defining directional navigation maps, we don't always want to loop around!

Solution

Add a non-looping variant.

These commits are cherrypicked from the more complex #17247.

Testing

I've updated the directional_navigation example to use these changes, and verified that it works.

@alice-i-cecile alice-i-cecile added A-UI Graphical user interfaces, styles, layouts, and widgets C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jan 15, 2025
@alice-i-cecile alice-i-cecile added this to the 0.16 milestone Jan 15, 2025
BenjaminBrienen

This comment was marked as outdated.

alice-i-cecile and others added 2 commits January 15, 2025 16:54
Co-authored-by: Rob Parrett <robparrett@gmail.com>
Co-authored-by: Benjamin Brienen <benjamin.brienen@outlook.com>
/// Add symmetrical edges between each consecutive pair of entities in the provided slice.
///
/// Unlike [`add_looping_edges`](Self::add_looping_edges), this method does not loop back to the first entity.
pub fn add_edges(&mut self, entities: &[Entity], direction: CompassOctant) {
Copy link
Contributor

Choose a reason for hiding this comment

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

A motivated person could follow up to rework add_looping_edges to use reuse add_edges.

@BenjaminBrienen BenjaminBrienen added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jan 15, 2025
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jan 15, 2025
Merged via the queue into bevyengine:main with commit 72f7074 Jan 16, 2025
29 checks passed
@alice-i-cecile alice-i-cecile deleted the add-edges-nav branch January 16, 2025 00:59
mrchantey pushed a commit to mrchantey/bevy that referenced this pull request Feb 4, 2025
# Objective

While `add_looping_edges` is a helpful method for manually defining
directional navigation maps, we don't always want to loop around!

## Solution

Add a non-looping variant.

These commits are cherrypicked from the more complex bevyengine#17247.

## Testing

I've updated the `directional_navigation` example to use these changes,
and verified that it works.

---------

Co-authored-by: Rob Parrett <robparrett@gmail.com>
Co-authored-by: Benjamin Brienen <benjamin.brienen@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-UI Graphical user interfaces, styles, layouts, and widgets C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants