Skip to content

Functions to work with rows #639

@Danvil

Description

@Danvil

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) -> Self
  • Mat3::from_rows_array(m: &[f32; 9) -> Self
  • Mat3::from_rows_slice(slice: &[f32]) -> Self
  • Mat3::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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions