Skip to content

Expects incorrect argument count in nalgebra_glm::Vec3::new() #10579

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

Closed
TinBryn opened this issue Oct 18, 2021 · 3 comments
Closed

Expects incorrect argument count in nalgebra_glm::Vec3::new() #10579

TinBryn opened this issue Oct 18, 2021 · 3 comments

Comments

@TinBryn
Copy link

TinBryn commented Oct 18, 2021

This is probably a really hard one as I'm guessing nalgebra-glm uses some fancy macro magic to make this work. This line of code is flagged by Rust-analyzer as expecting 4 arguments but found 3.

let _v3 = nalgebra_glm::Vec3::new(1.0, 2.0, 3.0);

while when I add a forth argument, rustc now flags it saying that it expects 3 arguments but found 4.

let _v4 = nalgebra_glm::Vec3::new(1.0, 2.0, 3.0, 4.0);

@lnicola
Copy link
Member

lnicola commented Oct 18, 2021

Probably #10340, we don't support const generics and nalgebra-glm seems to be a wrapper around nalgebra: https://docs.rs/nalgebra-glm/0.15.0/nalgebra_glm/type.TVec3.html.

But forgive me for asking, what's a Vec3 with four components? Surely that doesn't compile? 😄.

@TinBryn
Copy link
Author

TinBryn commented Oct 18, 2021

It doesn't compile, rustc flags it as an error, but rust-analyzer flags the three argument version as an error.

I don't need anything near what nalgebra-glm provides, just some simple homogeneous 3d maths, so I'll look for crate with a simpler implementation/interface.

@TinBryn TinBryn closed this as completed Oct 18, 2021
@lnicola
Copy link
Member

lnicola commented Oct 18, 2021

I know about https://crates.io/crates/ultraviolet and https://crates.io/crates/cgmath, but haven't tested them.

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