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 constants for Direction2d and Direction3d #11180

Merged
merged 2 commits into from
Jan 2, 2024

Conversation

Jondolf
Copy link
Contributor

@Jondolf Jondolf commented Jan 2, 2024

Objective

I often need a direction along one of the cartesian XYZ axes, and it currently requires e.g. Direction2d::from_normalized(Vec2::X), which isn't ideal.

Solution

Add direction constants that are the same as the ones on Glam types. I also copied the doc comment format "A unit vector pointing along the ... axis", but I can change it if there's a better wording for directions.

@Jondolf Jondolf added C-Usability A targeted quality-of-life change that makes Bevy easier to use A-Math Fundamental domain-agnostic mathematical operations labels Jan 2, 2024
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

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

Merging as trivial <3

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jan 2, 2024
Merged via the queue into bevyengine:main with commit 2c5439b Jan 2, 2024
25 checks passed
@Jondolf Jondolf deleted the direction-constants branch January 2, 2024 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Math Fundamental domain-agnostic mathematical operations C-Usability A targeted quality-of-life change that makes Bevy easier to use
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants