Functions to work with rows
Matrix types (Mat3, DMat3, ..) seem to be missing functions to work with rows. This would be useful to have for various mathematical operations and also for interop with other libraries.
I would propose to add these functions:
Mat3::set_row(&mut self, i: usize, value: Vec3)Mat3::from_rows(row_1: Vec3, row_2: Vec3, row_3: Vec3) -> SelfMat3::from_rows_array(m: &[f32; 9) -> SelfMat3::from_rows_slice(slice: &[f32]) -> SelfMat3::to_rows_array(&self) -> [f32; 9]
Similarly for all of these matrix types:
- Mat2
- DMat2
- Mat3
- DMat3
- Mat4
- DMat4
Happy to create a PR if this is something which you would appreciate.
The main reason I didn't add them is working with rows will incur additional overhead due to the need to transpose, because the user needs to transpose data themselves that cost is explicit. However as long as row functions include a doc comment reminding the user that glam stores matrix vectors as columns and accessing rows has a higher overhead then I'm OK with adding them for convenience.