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 glam swizzles traits to prelude #9387

Merged

Conversation

tguichaoua
Copy link
Contributor

Objective

Add possibility to use the glam's swizzles traits without having to manually import them.

use bevy::prelude::*;
- use bevy::math::Vec3Swizzles;

fn foo(x: Vec3) {
    let y: Vec2 = x.xy();
}

Solution

Add the swizzles traits to bevy's prelude.


Changelog

  • Vec2Swizzles, Vec3Swizzles and Vec4Swizzles are now part of the prelude.

@alice-i-cecile alice-i-cecile added C-Usability A targeted quality-of-life change that makes Bevy easier to use A-Math Fundamental domain-agnostic mathematical operations labels Aug 8, 2023
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.

This sort of utility trait is a good fit for the prelude IMO.

Copy link
Contributor

@killercup killercup left a comment

Choose a reason for hiding this comment

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

None of the methods are dangerous to overlap with some other trait, and to me it's nice to have more features discoverable by default :)

@hymm hymm added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Aug 9, 2023
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Aug 10, 2023
Merged via the queue into bevyengine:main with commit 37915e1 Aug 10, 2023
24 checks passed
@tguichaoua tguichaoua deleted the swizzles_trait_in_prelude branch August 10, 2023 17:33
github-merge-queue bot pushed a commit that referenced this pull request Aug 29, 2023
# Objective

- Since #9387, there is no need to import VecSwizzles separately, it is
already included in the prelude.

## Solution

- Remove the imports.
rdrpenguin04 pushed a commit to rdrpenguin04/bevy that referenced this pull request Jan 9, 2024
# Objective

- Since bevyengine#9387, there is no need to import VecSwizzles separately, it is
already included in the prelude.

## Solution

- Remove the imports.
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 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.

5 participants