Make `Mat[x]::new()` functions public
LegNeato opened this issue · 1 comments
LegNeato commented
The Mat[x]::new()
functions are not public but they are for Vec
s. Is there a reason we must use from_cols
or the fields directly instead of calling new()
? For reference, here is the private function for Mat3
:
#[allow(clippy::too_many_arguments)]
#[inline(always)]
#[must_use]
const fn new(
m00: f32,
m01: f32,
m02: f32,
m10: f32,
m11: f32,
m12: f32,
m20: f32,
m21: f32,
m22: f32,
) -> Self {
Self {
x_axis: Vec3::new(m00, m01, m02),
y_axis: Vec3::new(m10, m11, m12),
z_axis: Vec3::new(m20, m21, m22),
}
}
I put up a PR in case this is an oversight rather than an explicit choice.
bitshifter commented
The purpose of from_cols
is that it explicitly describes that the input data should be column vectors as opposed to row vectors, this is why raw new
is not exposed as is. If I were to expose a new method that takes values in column order I'd suggest calling it from_cols_values
which would use similar naming to existing methods.