From c277c31f29f2a38d9467b859c9302c20d08e07c2 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Wed, 28 Aug 2024 10:45:38 -0700 Subject: [PATCH] wip --- fixed_wide_vectors/src/macros/mod.rs | 7 +++++ fixed_wide_vectors/src/vector.rs | 41 ++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/fixed_wide_vectors/src/macros/mod.rs b/fixed_wide_vectors/src/macros/mod.rs index 7faa7dd..2d5a568 100644 --- a/fixed_wide_vectors/src/macros/mod.rs +++ b/fixed_wide_vectors/src/macros/mod.rs @@ -250,6 +250,13 @@ macro_rules! impl_vector { }; } +#[doc(hidden)] +#[macro_export(local_inner_macros)] +macro_rules! impl_vector { + ( $struct: ident { $($field: ident), + }, ( $($generic: ident), + ), $size: expr, + $struct: ident { $($field: ident), + }, ( $($generic: ident), + ), $size: expr ) => { + } +} #[doc(hidden)] #[macro_export(local_inner_macros)] diff --git a/fixed_wide_vectors/src/vector.rs b/fixed_wide_vectors/src/vector.rs index 6e7dae6..34d29f1 100644 --- a/fixed_wide_vectors/src/vector.rs +++ b/fixed_wide_vectors/src/vector.rs @@ -66,3 +66,44 @@ pub struct Vector4 { 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 }, (T, T), 2, + Vector2 { x, y }, (T, T), 2, +); +crate::impl_matrix!( + Vector2 { x, y }, (T, T), 2, + Vector3 { x, y, z }, (T, T, T), 3, +); +crate::impl_matrix!( + Vector2 { x, y }, (T, T), 2, + Vector4 { x, y, z, w }, (T, T, T, T), 4, +); + +crate::impl_matrix!( + Vector3 { x, y, z }, (T, T, T), 3, + Vector2 { x, y }, (T, T), 2, +); +crate::impl_matrix!( + Vector3 { x, y, z }, (T, T, T), 3, + Vector3 { x, y, z }, (T, T, T), 3, +); +crate::impl_matrix!( + Vector3 { x, y, z }, (T, T, T), 3, + Vector4 { x, y, z, w }, (T, T, T, T), 4, +); + +crate::impl_matrix!( + Vector4 { x, y, z, w }, (T, T, T, T), 4, + Vector2 { x, y }, (T, T), 2, +); +crate::impl_matrix!( + Vector4 { x, y, z, w }, (T, T, T, T), 4, + Vector3 { x, y, z }, (T, T, T), 3, +); +crate::impl_matrix!( + Vector4 { x, y, z, w }, (T, T, T, T), 4, + Vector4 { x, y, z, w }, (T, T, T, T), 4, +); +*/