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 From<(Vec2<T>, T)> for Vec3<T>? #71

Closed
Imberflur opened this issue Mar 3, 2021 · 3 comments
Closed

Add From<(Vec2<T>, T)> for Vec3<T>? #71

Imberflur opened this issue Mar 3, 2021 · 3 comments

Comments

@Imberflur
Copy link
Contributor

Right now this either has to be done by:

Vec3::new(vec2.x, vec2.y, z)

or

Vec3::from(vec2) + Vec3::unit_z() * z

where it could just be

Vec3::from((vec2, z))

And this would be really convenient in creating APIs that take Into<Vec3<T>> since then just (vec2, z) could be passed in instead of having to convert it.

@yoanlcq
Copy link
Owner

yoanlcq commented Mar 3, 2021

Interesting, PR #70 is a bit related. Although, I understand how what is being asked here is slightly different, and I agree that it would be elegant.

I'll look into this today.

@yoanlcq yoanlcq closed this as completed in 81b47c6 Mar 3, 2021
@yoanlcq
Copy link
Owner

yoanlcq commented Mar 3, 2021

I closed this in a commit, but I still need to wait for CI to greenlight this. When it's OK, I'll publish a new version with this feature.

@yoanlcq
Copy link
Owner

yoanlcq commented Mar 3, 2021

Version 0.14.1 has been published just now with this feature. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants