mat mul brain blasting
This commit is contained in:
parent
0c41d3182e
commit
8a89fcefc6
@ -34,30 +34,31 @@ macro_rules! impl_wide_vector_operations {
|
||||
}
|
||||
|
||||
// Notes:
|
||||
// Mat3<Vec2>.dot(Vec3) -> Vec2
|
||||
// Mat3<Vec2>.dot(Vec2) -> Vec3
|
||||
// Mat3<Vec4>.dot(Mat4<Vec2>) -> Mat3<Vec2>
|
||||
// mat.mat can be implemented off the back of mat.vec
|
||||
|
||||
#[doc(hidden)]
|
||||
#[macro_export(local_inner_macros)]
|
||||
macro_rules! impl_wide_matrix_operations {
|
||||
(
|
||||
($struct_outer: ident { $($field_outer: ident), + }, $vector_outer: ident, $size_outer: expr),
|
||||
($struct_inner: ident { $($field_inner: ident), + }, $matrix_inner: ident, $size_inner: expr)
|
||||
($struct_outer: ident { $($field_outer: ident), + }, $vector_outer: ident { $($vector_field_outer: ident), + }, $size_outer: expr),
|
||||
($struct_inner: ident { $($field_inner: ident), + }, $matrix_inner: ident { $($matrix_field_inner: ident), + }, $size_inner: expr)
|
||||
) => {
|
||||
/* Hide this
|
||||
impl<T,U> fixed_wide_traits::wide::WideDot<$struct<U>> for $struct<T>
|
||||
// U is a vec type
|
||||
impl<T,U> fixed_wide_traits::wide::WideDot<$matrix_inner<U>> for $struct_outer<$struct_inner<T>>
|
||||
where
|
||||
U:$crate::Transpose
|
||||
$matrix_inner<U>:$crate::Transpose,
|
||||
$struct_inner<T>:fixed_wide_traits::wide::WideDot<U>,
|
||||
{
|
||||
type Output=V;
|
||||
type Output=$struct_outer<<$struct_inner<T> as fixed_wide_traits::wide::WideDot<U>>::Output>;
|
||||
#[inline]
|
||||
fn wide_dot(self, rhs: $struct<U>) -> Self::Output {
|
||||
$crate::sum_repeating!(
|
||||
$( + (self.$field.wide_mul(rhs.$field)) ) +
|
||||
)
|
||||
fn wide_dot(self, rhs: $matrix_inner<U>) -> Self::Output {
|
||||
//just made this up, don't trust it
|
||||
let tr=rhs.transpose();
|
||||
self.map(|axis|tr.wide_dot(axis))
|
||||
}
|
||||
}
|
||||
*/
|
||||
/* TODO: nasty determinant macro
|
||||
impl<U:std::ops::Add<Output=U>,T:Copy+fixed_wide_traits::wide::WideMul<Output=U>> $struct<T> {
|
||||
#[inline]
|
||||
|
Loading…
Reference in New Issue
Block a user