I have a Matrix4<f32>
representing a transformation. I would like to convert it to a [f32; 16]
to use with wgpu.
I've not managed to find the right method (if there is one at all).
I have a Matrix4<f32>
representing a transformation. I would like to convert it to a [f32; 16]
to use with wgpu.
I've not managed to find the right method (if there is one at all).
Copyright © 2021 Jogjafile Inc.
You can use
as_slice()
to convert it into a&[f32]
, and then convert that into a[f32; 16]
usingtry_into()
.Here's an example: