-
Notifications
You must be signed in to change notification settings - Fork 159
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
2d array conversion rows vs columns mismatch? #21
Comments
Maybe this is a bit too ambiguous. I'm not sure what I was thinking at the time when I wrote it, but the layout as it is loaded matches how it is stored in the Mat4 (e.g. treated as columns). Perhaps it would be better to replace this from imp with an explicit function to avoid any confusion? I think one of the other popular Rust libraries uses explicit functions rather than from, maybe it was nalgebra. |
Yeah I was thinking something similar also, have explicit load/store functions for different variants of this on the object instead, then one have a chance to document and name it based on how it works. |
Naming is hard! So far I have:
Which convert from array data in column-major order to a I'm not totally sold on this naming convention, happy to accept alternative suggestions. Not sure I can deprecated the |
Yeah I'm not fully sure what are good names for them either. But having that instead of the traits would be better at least. And do think it is fine to nuke the trait functions now as the API is evolving (before a 1.0 stable release), with some heads up. |
Removed `From` trait implementations converting between 1D and 2D arrays and matrix types to avoid any potential confusion about data being loaded and stored in column major order. New function names hopefully make it clear that column major ordering is being used. Fixes #21.
EmbarkStudios/rust-ecosystem#36 (comment) fixed in release 0.8.0. |
One issue I ran into when starting using
glam
for our stuff was this 2d array conversion function:I wasn't expecting it to load the rows of the fixed 2d array into the columns and vice versa here. Think when converting from a 2d array that has a definition of rows and columns the most expected result would be to convert from that representation to the internal representation (which in glam is colum-major) for storage.
So how about changing this function to internally transpose the stores here?
Also have the
impl From<[f32; 16]> for Mat4
and for that it makes sense store the data linearly directly as colum-major because there is no additional information about how the source is organized wrt to rows and vectors.The text was updated successfully, but these errors were encountered: