wip
This commit is contained in:
parent
247987b51d
commit
d65fe40354
@ -46,8 +46,8 @@ macro_rules! impl_matrix {
|
||||
}
|
||||
|
||||
// Impl floating-point based methods
|
||||
//#[cfg(feature="fixed_wide_traits")]
|
||||
//$crate::impl_wide_matrix_operations!( ($struct_outer { $($field_outer), + }, $size_outer), ($struct_inner, $size_inner), $fields_inner );
|
||||
#[cfg(feature="fixed_wide_traits")]
|
||||
$crate::impl_wide_matrix_operations!( ($struct_outer { $($field_outer), + }, $size_outer), ($struct_inner, $size_inner), $fields_inner );
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,10 @@ macro_rules! impl_wide_vector_operations {
|
||||
};
|
||||
}
|
||||
|
||||
/*
|
||||
// Notes:
|
||||
// Mat3<Vec2>.dot(Vec3) -> 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 {
|
||||
@ -44,11 +47,11 @@ macro_rules! impl_wide_matrix_operations {
|
||||
#[inline]
|
||||
fn wide_mul(self, rhs: Self) -> Self::Output {
|
||||
$struct{
|
||||
$( $field: self.$field.wide_mul(rhs.$field) ), +
|
||||
$( $field_outer: self.$field_outer.wide_mul(rhs.$field_outer) ), +
|
||||
}
|
||||
}
|
||||
}
|
||||
impl<V:core::ops::Add<Output=V>,U,T:fixed_wide_traits::wide::WideMul<U,Output=V>> fixed_wide_traits::wide::WideDot<$struct<U>> for $struct<T> {
|
||||
impl<U,T:fixed_wide_traits::wide::WideMul<U,Output=V>> fixed_wide_traits::wide::WideDot<$struct<U>> for $struct<T> {
|
||||
type Output=V;
|
||||
#[inline]
|
||||
fn wide_dot(self, rhs: $struct<U>) -> Self::Output {
|
||||
@ -57,17 +60,18 @@ macro_rules! impl_wide_matrix_operations {
|
||||
)
|
||||
}
|
||||
}
|
||||
/* TODO: nasty determinant macro
|
||||
impl<U:std::ops::Add<Output=U>,T:Copy+fixed_wide_traits::wide::WideMul<Output=U>> $struct<T> {
|
||||
#[inline]
|
||||
pub fn wide_length_squared(&self) -> U {
|
||||
pub fn wide_det(&self) -> U {
|
||||
$crate::sum_repeating!(
|
||||
$( + self.$field.wide_mul(self.$field) ) +
|
||||
)
|
||||
}
|
||||
}
|
||||
*/
|
||||
};
|
||||
}
|
||||
*/
|
||||
|
||||
// HACK: Allows us to sum repeating tokens in macros.
|
||||
// See: https://stackoverflow.com/a/60187870/17452730
|
||||
|
Loading…
Reference in New Issue
Block a user