11//! a set of common SPIR-V Matrices, used for intrinsics
22
3- use crate :: glam:: { Affine3A , Mat3 , Mat3A , Mat4 , Vec3 , Vec3A } ;
3+ use crate :: glam:: { Affine3A , Mat3 , Mat3A , Mat4 , Vec3 } ;
44use core:: fmt:: { Debug , Display , Formatter } ;
55
66/// A Matrix with 4 columns of [`Vec3`], very similar to glam's [`Affine3A`].
@@ -18,10 +18,10 @@ use core::fmt::{Debug, Display, Formatter};
1818#[ spirv( matrix) ]
1919#[ allow( missing_docs) ]
2020pub struct Matrix4x3 {
21- pub x_axis : Vec3A ,
22- pub y_axis : Vec3A ,
23- pub z_axis : Vec3A ,
24- pub w_axis : Vec3A ,
21+ pub x_axis : Vec3 ,
22+ pub y_axis : Vec3 ,
23+ pub z_axis : Vec3 ,
24+ pub w_axis : Vec3 ,
2525}
2626
2727/// The `from_*` fn signatures should match [`Affine3A`], to make it easier to switch to [`Affine3A`] later.
@@ -30,10 +30,10 @@ impl Matrix4x3 {
3030 /// Convert from glam's [`Affine3A`]
3131 pub fn from_affine3a ( affine : Affine3A ) -> Self {
3232 Self {
33- x_axis : affine. x_axis ,
34- y_axis : affine. y_axis ,
35- z_axis : affine. z_axis ,
36- w_axis : affine. w_axis ,
33+ x_axis : affine. x_axis . to_vec3 ( ) ,
34+ y_axis : affine. y_axis . to_vec3 ( ) ,
35+ z_axis : affine. z_axis . to_vec3 ( ) ,
36+ w_axis : affine. w_axis . to_vec3 ( ) ,
3737 }
3838 }
3939
@@ -61,11 +61,11 @@ impl Matrix4x3 {
6161 pub fn to_affine3a ( self ) -> Affine3A {
6262 Affine3A {
6363 matrix3 : Mat3A {
64- x_axis : self . x_axis ,
65- y_axis : self . y_axis ,
66- z_axis : self . z_axis ,
64+ x_axis : self . x_axis . to_vec3a ( ) ,
65+ y_axis : self . y_axis . to_vec3a ( ) ,
66+ z_axis : self . z_axis . to_vec3a ( ) ,
6767 } ,
68- translation : self . w_axis ,
68+ translation : self . w_axis . to_vec3a ( ) ,
6969 }
7070 }
7171
0 commit comments