lol idk #1

Open
Quaternions wants to merge 826 commits from StrafesNET/strafe-project:master into master
Showing only changes of commit b772647137 - Show all commits

View File

@ -54,6 +54,20 @@ macro_rules! impl_matrix {
)
)
}
#[inline]
// MatY<VecX>.VecX = VecY
pub fn transform_vector<U,V>(self,rhs:Vector<X,U>)->Vector<Y,V>
where
T:core::ops::Mul<U,Output=V>,
V:core::iter::Sum,
U:Copy,
{
Vector::new(
self.array.map(|axis|
Vector::new(axis).dot(rhs)
)
)
}
}
impl<const X:usize,const Y:usize,T> Matrix<X,Y,T>
where
@ -85,6 +99,18 @@ macro_rules! impl_matrix {
self.dot(rhs)
}
}
impl<const X:usize,const Y:usize,T,U,V> core::ops::Mul<Vector<X,U>> for Matrix<X,Y,T>
where
T:core::ops::Mul<U,Output=V>,
V:core::iter::Sum,
U:Copy,
{
type Output=Vector<Y,V>;
#[inline]
fn mul(self,rhs:Vector<X,U>)->Self::Output{
self.transform_vector(rhs)
}
}
#[cfg(feature="fixed_wide")]
$crate::impl_matrix_wide_dot_8x8!();
}