wip transpose
This commit is contained in:
parent
9ef9b5ff3f
commit
23a6ffb243
@ -252,9 +252,18 @@ 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 ) => {
|
||||
macro_rules! impl_matrix {
|
||||
( $struct_outer: ident { $($field_outer: ident), + }, $size_outer: expr,
|
||||
$struct_inner: ident { $($field_inner: ident), + }, $size_inner: expr ) => {
|
||||
impl<T> Transpose for $struct_outer<$struct_inner<T>> {
|
||||
fn transpose(self) -> $struct_inner<$struct_outer<T>> {
|
||||
$struct_inner{
|
||||
$( $field_inner: $struct_outer {
|
||||
$( $field_outer: self.$field_outer.$field_inner), +
|
||||
} ), +
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -67,43 +67,43 @@ 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,
|
||||
Vector2 { x, y }, 2,
|
||||
Vector2 { x, y }, 2
|
||||
);
|
||||
crate::impl_matrix!(
|
||||
Vector2 { x, y }, (T, T), 2,
|
||||
Vector3 { x, y, z }, (T, T, T), 3,
|
||||
Vector2 { x, y }, 2,
|
||||
Vector3 { x, y, z }, 3
|
||||
);
|
||||
crate::impl_matrix!(
|
||||
Vector2 { x, y }, (T, T), 2,
|
||||
Vector4 { x, y, z, w }, (T, T, T, T), 4,
|
||||
Vector2 { x, y }, 2,
|
||||
Vector4 { x, y, z, w }, 4
|
||||
);
|
||||
|
||||
crate::impl_matrix!(
|
||||
Vector3 { x, y, z }, (T, T, T), 3,
|
||||
Vector2 { x, y }, (T, T), 2,
|
||||
Vector3 { x, y, z }, 3,
|
||||
Vector2 { x, y }, 2
|
||||
);
|
||||
crate::impl_matrix!(
|
||||
Vector3 { x, y, z }, (T, T, T), 3,
|
||||
Vector3 { x, y, z }, (T, T, T), 3,
|
||||
Vector3 { x, y, z }, 3,
|
||||
Vector3 { x, y, z }, 3
|
||||
);
|
||||
crate::impl_matrix!(
|
||||
Vector3 { x, y, z }, (T, T, T), 3,
|
||||
Vector4 { x, y, z, w }, (T, T, T, T), 4,
|
||||
Vector3 { x, y, z }, 3,
|
||||
Vector4 { x, y, z, w }, 4
|
||||
);
|
||||
|
||||
crate::impl_matrix!(
|
||||
Vector4 { x, y, z, w }, (T, T, T, T), 4,
|
||||
Vector2 { x, y }, (T, T), 2,
|
||||
Vector4 { x, y, z, w }, 4,
|
||||
Vector2 { x, y }, 2
|
||||
);
|
||||
crate::impl_matrix!(
|
||||
Vector4 { x, y, z, w }, (T, T, T, T), 4,
|
||||
Vector3 { x, y, z }, (T, T, T), 3,
|
||||
Vector4 { x, y, z, w }, 4,
|
||||
Vector3 { x, y, z }, 3
|
||||
);
|
||||
crate::impl_matrix!(
|
||||
Vector4 { x, y, z, w }, (T, T, T, T), 4,
|
||||
Vector4 { x, y, z, w }, (T, T, T, T), 4,
|
||||
Vector4 { x, y, z, w }, 4,
|
||||
Vector4 { x, y, z, w }, 4
|
||||
);
|
||||
*/
|
||||
//*/
|
||||
|
Loading…
Reference in New Issue
Block a user