From 33b335f98783503970dd449d9b66dc21bfde5227 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Wed, 28 Aug 2024 14:09:44 -0700 Subject: [PATCH] what if do like this - wait idk --- fixed_wide_vectors/src/macros/mod.rs | 5 ++-- fixed_wide_vectors/src/vector.rs | 44 +++------------------------- 2 files changed, 6 insertions(+), 43 deletions(-) diff --git a/fixed_wide_vectors/src/macros/mod.rs b/fixed_wide_vectors/src/macros/mod.rs index f84a672..2691ffa 100644 --- a/fixed_wide_vectors/src/macros/mod.rs +++ b/fixed_wide_vectors/src/macros/mod.rs @@ -267,14 +267,13 @@ macro_rules! impl_matrix_inner { #[doc(hidden)] #[macro_export(local_inner_macros)] macro_rules! impl_matrix { - ( $struct_outer: ident { $($field_outer: ident),+ }, $size_outer: expr, - $struct_inner: ident { $($field_inner: ident), + }, $size_inner: expr ) => { + ( $struct_outer: ident { $($field_outer: ident),+ }, $size_outer: expr) => { impl Transpose for $struct_outer<$struct_inner> { fn transpose(self) -> $struct_inner<$struct_outer> { $struct_inner { $( $field_inner: impl_matrix_inner!( - $struct_outer { $($field_outer),+ }, $size_outer, + Vector2{x,y}, $size_outer, $field_inner ) ),+ diff --git a/fixed_wide_vectors/src/vector.rs b/fixed_wide_vectors/src/vector.rs index 323bb9a..9267b0a 100644 --- a/fixed_wide_vectors/src/vector.rs +++ b/fixed_wide_vectors/src/vector.rs @@ -67,43 +67,7 @@ crate::impl_vector!(Vector2 { x, y }, (T, T), 2); crate::impl_vector!(Vector3 { x, y, z }, (T, T, T), 3); crate::impl_vector!(Vector4 { x, y, z, w }, (T, T, T, T), 4); -//* -crate::impl_matrix!( - Vector2 { x, y }, 2, - Vector2 { x, y }, 2 -); -crate::impl_matrix!( - Vector2 { x, y }, 2, - Vector3 { x, y, z }, 3 -); -crate::impl_matrix!( - Vector2 { x, y }, 2, - Vector4 { x, y, z, w }, 4 -); - -crate::impl_matrix!( - Vector3 { x, y, z }, 3, - Vector2 { x, y }, 2 -); -crate::impl_matrix!( - Vector3 { x, y, z }, 3, - Vector3 { x, y, z }, 3 -); -crate::impl_matrix!( - Vector3 { x, y, z }, 3, - Vector4 { x, y, z, w }, 4 -); - -crate::impl_matrix!( - Vector4 { x, y, z, w }, 4, - Vector2 { x, y }, 2 -); -crate::impl_matrix!( - Vector4 { x, y, z, w }, 4, - Vector3 { x, y, z }, 3 -); -crate::impl_matrix!( - Vector4 { x, y, z, w }, 4, - Vector4 { x, y, z, w }, 4 -); -//*/ +//This internally implements non square matrices, idk how else to separate the repeated fields +crate::impl_matrix!(Vector2 { x, y }, 2); +crate::impl_matrix!(Vector3 { x, y, z }, 3); +crate::impl_matrix!(Vector4 { x, y, z, w }, 4);