Open ghost opened 4 years ago
Something like
pub const OPENGL_TO_WGPU_MATRIX: Mat4 = mat4(
1f32, 0f32, 0f32, 0f32,
0f32, 1f32, 0f32, 0f32,
0f32, 0f32, 0.5f32, 0f32,
0f32, 0f32, 0.5f32, 1f32
);
doesn't compile either.
I gave a try to simply writing a const equivalent of the current construction methods. The problem is that only Sized is allowed to be used as a generic bound in const functions whereas algebra requires input types to impl Scalar
trait.
A way around this would be to write const constructors for certain containers × primitives that manually construct underlying matrices using array storage. This would be extremely useful for the glm version but it might also be useful for other nalgebra use cases too.
EDIT: I incorrectly said mentioned up vector compiles. It was just my IDE not showing it as an error. Didn't compile.
it would be great if i could do stuff like
const up: glm::Vec3 = glm::vec3(0., 1., 0.);
since that function will always produce the same outputhttps://github.com/rust-lang/rust/issues/57563