impl Into<glam::Mat4> for Planar64Affine3
This commit is contained in:
parent
8bccc2fe66
commit
af1939a576
@ -525,6 +525,19 @@ impl Planar64Affine3{
|
|||||||
self.translation.fix_2()+self.matrix3*point
|
self.translation.fix_2()+self.matrix3*point
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
impl Into<glam::Mat4> for Planar64Affine3{
|
||||||
|
#[inline]
|
||||||
|
fn into(self)->glam::Mat4{
|
||||||
|
let matrix3=self.matrix3.to_array().map(|row|row.map(Into::<f32>::into));
|
||||||
|
let translation=self.translation.to_array().map(Into::<f32>::into);
|
||||||
|
glam::Mat4::from_cols_array(&[
|
||||||
|
matrix3[0][0],matrix3[0][1],matrix3[0][2],0.0,
|
||||||
|
matrix3[1][0],matrix3[1][1],matrix3[1][2],0.0,
|
||||||
|
matrix3[2][0],matrix3[2][1],matrix3[2][2],0.0,
|
||||||
|
translation[0],translation[1],translation[2],1.0
|
||||||
|
])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_sqrt(){
|
fn test_sqrt(){
|
||||||
|
Loading…
Reference in New Issue
Block a user