Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
fd588d1b60 | |||
9da1c1ad1e | |||
0d5092cd84 | |||
8a89fcefc6 | |||
0c41d3182e | |||
85d0b3d1ac | |||
2da8130402 | |||
d65fe40354 | |||
247987b51d |
102
fixed_wide_vectors/src/macros/common.rs
Normal file
102
fixed_wide_vectors/src/macros/common.rs
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
#[doc(hidden)]
|
||||||
|
#[macro_export(local_inner_macros)]
|
||||||
|
macro_rules! impl_common {
|
||||||
|
( $struct: ident { $($field: ident), + }, ( $($generic: ident), + ), $size: expr ) => {
|
||||||
|
impl<T> $struct<T> {
|
||||||
|
/// Constructs a new vector with the specified values for each field.
|
||||||
|
///
|
||||||
|
/// # Example
|
||||||
|
///
|
||||||
|
/// ```
|
||||||
|
/// use fixed_wide_vectors::Vector2;
|
||||||
|
///
|
||||||
|
/// let vec2 = Vector2::new(0, 0);
|
||||||
|
///
|
||||||
|
/// assert_eq!(vec2.x, 0);
|
||||||
|
/// assert_eq!(vec2.y, 0);
|
||||||
|
/// ```
|
||||||
|
#[inline(always)]
|
||||||
|
pub const fn new( $($field: T), + ) -> Self {
|
||||||
|
Self {
|
||||||
|
$( $field ), +
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Consumes the vector and returns its values as an array.
|
||||||
|
///
|
||||||
|
/// # Example
|
||||||
|
///
|
||||||
|
/// ```
|
||||||
|
/// use fixed_wide_vectors::Vector2;
|
||||||
|
///
|
||||||
|
/// let vec2 = Vector2::new(0, 0);
|
||||||
|
/// let array = vec2.to_array();
|
||||||
|
///
|
||||||
|
/// assert_eq!(array, [0, 0]);
|
||||||
|
/// ```
|
||||||
|
#[inline(always)]
|
||||||
|
pub fn to_array(self) -> [T; $size] {
|
||||||
|
[ $(self.$field), + ]
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Consumes the vector and returns its values as a tuple.
|
||||||
|
///
|
||||||
|
/// # Example
|
||||||
|
///
|
||||||
|
/// ```
|
||||||
|
/// use fixed_wide_vectors::Vector2;
|
||||||
|
///
|
||||||
|
/// let vec2 = Vector2::new(0, 0);
|
||||||
|
/// let tuple = vec2.to_tuple();
|
||||||
|
///
|
||||||
|
/// assert_eq!(tuple, (0, 0));
|
||||||
|
/// ```
|
||||||
|
#[inline(always)]
|
||||||
|
pub fn to_tuple(self) -> ( $($generic), + ) {
|
||||||
|
( $(self.$field), + )
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Consumes the vector and returns a new vector with the given function applied on each field.
|
||||||
|
///
|
||||||
|
/// # Example
|
||||||
|
///
|
||||||
|
/// ```
|
||||||
|
/// use fixed_wide_vectors::Vector2;
|
||||||
|
///
|
||||||
|
/// let vec2 = Vector2::new(1, 2)
|
||||||
|
/// .map(|i| i * 2);
|
||||||
|
///
|
||||||
|
/// assert_eq!(vec2, Vector2::new(2, 4));
|
||||||
|
/// ```
|
||||||
|
#[inline]
|
||||||
|
pub fn map<F, U>(self, f: F) -> $struct<U>
|
||||||
|
where
|
||||||
|
F: Fn(T) -> U
|
||||||
|
{
|
||||||
|
$struct {
|
||||||
|
$( $field: f(self.$field) ), +
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<T: Copy> $struct<T> {
|
||||||
|
/// Constructs a vector using the given `value` as the value for all of its fields.
|
||||||
|
///
|
||||||
|
/// # Example
|
||||||
|
///
|
||||||
|
/// ```
|
||||||
|
/// use fixed_wide_vectors::Vector2;
|
||||||
|
///
|
||||||
|
/// let vec2 = Vector2::from_value(0);
|
||||||
|
///
|
||||||
|
/// assert_eq!(vec2, Vector2::new(0, 0));
|
||||||
|
/// ```
|
||||||
|
#[inline(always)]
|
||||||
|
pub const fn from_value(value: T) -> Self {
|
||||||
|
Self {
|
||||||
|
$( $field: value ), +
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -2,6 +2,26 @@
|
|||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[macro_export(local_inner_macros)]
|
#[macro_export(local_inner_macros)]
|
||||||
macro_rules! impl_matrix {
|
macro_rules! impl_matrix {
|
||||||
|
(
|
||||||
|
($struct_outer: ident { $($field_outer: ident), + }, $vector_outer: ident { $($vector_field_outer: ident), + }, $size_outer: expr),
|
||||||
|
( $($generic_outer: tt), + )
|
||||||
|
) => {
|
||||||
|
$crate::impl_common!($struct_outer { $($field_outer), + }, ( $($generic_outer), + ), $size_outer);
|
||||||
|
impl<U> $struct_outer<U> {
|
||||||
|
#[inline(always)]
|
||||||
|
pub fn to_vector(self) -> $vector_outer<U> {
|
||||||
|
$vector_outer {
|
||||||
|
$(
|
||||||
|
$vector_field_outer: self.$field_outer
|
||||||
|
), +
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#[doc(hidden)]
|
||||||
|
#[macro_export(local_inner_macros)]
|
||||||
|
macro_rules! impl_matrix_inner {
|
||||||
(
|
(
|
||||||
($struct_outer: ident { $($field_outer: ident), + }, $vector_outer: ident { $($vector_field_outer: ident), + }, $size_outer: 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),
|
($struct_inner: ident { $($field_inner: ident), + }, $matrix_inner: ident { $($matrix_field_inner: ident), + }, $size_inner: expr),
|
||||||
@ -46,8 +66,11 @@ macro_rules! impl_matrix {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Impl floating-point based methods
|
// Impl floating-point based methods
|
||||||
//#[cfg(feature="fixed_wide_traits")]
|
#[cfg(feature="fixed_wide_traits")]
|
||||||
//$crate::impl_wide_matrix_operations!( ($struct_outer { $($field_outer), + }, $size_outer), ($struct_inner, $size_inner), $fields_inner );
|
$crate::impl_wide_matrix_operations!(
|
||||||
|
($struct_outer { $($field_outer), + }, $vector_outer { $($vector_field_outer), + }, $size_outer),
|
||||||
|
($struct_inner { $($field_inner), + }, $matrix_inner { $($matrix_field_inner), + }, $size_inner)
|
||||||
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#[cfg(feature="fixed_wide_traits")]
|
#[cfg(feature="fixed_wide_traits")]
|
||||||
pub mod wide;
|
pub mod wide;
|
||||||
|
|
||||||
|
pub mod common;
|
||||||
pub mod vector;
|
pub mod vector;
|
||||||
pub mod matrix;
|
pub mod matrix;
|
||||||
|
@ -3,102 +3,7 @@
|
|||||||
#[macro_export(local_inner_macros)]
|
#[macro_export(local_inner_macros)]
|
||||||
macro_rules! impl_vector {
|
macro_rules! impl_vector {
|
||||||
( $struct: ident { $($field: ident), + }, ( $($generic: ident), + ), $size: expr ) => {
|
( $struct: ident { $($field: ident), + }, ( $($generic: ident), + ), $size: expr ) => {
|
||||||
impl<T> $struct<T> {
|
$crate::impl_common!($struct { $($field), + }, ( $($generic), + ), $size);
|
||||||
/// Constructs a new vector with the specified values for each field.
|
|
||||||
///
|
|
||||||
/// # Example
|
|
||||||
///
|
|
||||||
/// ```
|
|
||||||
/// use fixed_wide_vectors::Vector2;
|
|
||||||
///
|
|
||||||
/// let vec2 = Vector2::new(0, 0);
|
|
||||||
///
|
|
||||||
/// assert_eq!(vec2.x, 0);
|
|
||||||
/// assert_eq!(vec2.y, 0);
|
|
||||||
/// ```
|
|
||||||
#[inline(always)]
|
|
||||||
pub const fn new( $($field: T), + ) -> Self {
|
|
||||||
Self {
|
|
||||||
$( $field ), +
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Consumes the vector and returns its values as an array.
|
|
||||||
///
|
|
||||||
/// # Example
|
|
||||||
///
|
|
||||||
/// ```
|
|
||||||
/// use fixed_wide_vectors::Vector2;
|
|
||||||
///
|
|
||||||
/// let vec2 = Vector2::new(0, 0);
|
|
||||||
/// let array = vec2.to_array();
|
|
||||||
///
|
|
||||||
/// assert_eq!(array, [0, 0]);
|
|
||||||
/// ```
|
|
||||||
#[inline(always)]
|
|
||||||
pub fn to_array(self) -> [T; $size] {
|
|
||||||
[ $(self.$field), + ]
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Consumes the vector and returns its values as a tuple.
|
|
||||||
///
|
|
||||||
/// # Example
|
|
||||||
///
|
|
||||||
/// ```
|
|
||||||
/// use fixed_wide_vectors::Vector2;
|
|
||||||
///
|
|
||||||
/// let vec2 = Vector2::new(0, 0);
|
|
||||||
/// let tuple = vec2.to_tuple();
|
|
||||||
///
|
|
||||||
/// assert_eq!(tuple, (0, 0));
|
|
||||||
/// ```
|
|
||||||
#[inline(always)]
|
|
||||||
pub fn to_tuple(self) -> ( $($generic), + ) {
|
|
||||||
( $(self.$field), + )
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Consumes the vector and returns a new vector with the given function applied on each field.
|
|
||||||
///
|
|
||||||
/// # Example
|
|
||||||
///
|
|
||||||
/// ```
|
|
||||||
/// use fixed_wide_vectors::Vector2;
|
|
||||||
///
|
|
||||||
/// let vec2 = Vector2::new(1, 2)
|
|
||||||
/// .map(|i| i * 2);
|
|
||||||
///
|
|
||||||
/// assert_eq!(vec2, Vector2::new(2, 4));
|
|
||||||
/// ```
|
|
||||||
#[inline]
|
|
||||||
pub fn map<F, U>(self, f: F) -> $struct<U>
|
|
||||||
where
|
|
||||||
F: Fn(T) -> U
|
|
||||||
{
|
|
||||||
$struct {
|
|
||||||
$( $field: f(self.$field) ), +
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<T: Copy> $struct<T> {
|
|
||||||
/// Constructs a vector using the given `value` as the value for all of its fields.
|
|
||||||
///
|
|
||||||
/// # Example
|
|
||||||
///
|
|
||||||
/// ```
|
|
||||||
/// use fixed_wide_vectors::Vector2;
|
|
||||||
///
|
|
||||||
/// let vec2 = Vector2::from_value(0);
|
|
||||||
///
|
|
||||||
/// assert_eq!(vec2, Vector2::new(0, 0));
|
|
||||||
/// ```
|
|
||||||
#[inline(always)]
|
|
||||||
pub const fn from_value(value: T) -> Self {
|
|
||||||
Self {
|
|
||||||
$( $field: value ), +
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<T> From<[T; $size]> for $struct<T> {
|
impl<T> From<[T; $size]> for $struct<T> {
|
||||||
fn from(from: [T; $size]) -> Self {
|
fn from(from: [T; $size]) -> Self {
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#[macro_export(local_inner_macros)]
|
#[macro_export(local_inner_macros)]
|
||||||
macro_rules! impl_wide_vector_operations {
|
macro_rules! impl_wide_vector_operations {
|
||||||
( $struct: ident { $($field: ident), + }, $size: expr ) => {
|
( $struct: ident { $($field: ident), + }, $size: expr ) => {
|
||||||
|
//this one is shared between vec and mat
|
||||||
impl<U,T:Copy+fixed_wide_traits::wide::WideMul<Output=U>> fixed_wide_traits::wide::WideMul for $struct<T> {
|
impl<U,T:Copy+fixed_wide_traits::wide::WideMul<Output=U>> fixed_wide_traits::wide::WideMul for $struct<T> {
|
||||||
type Output=$struct<U>;
|
type Output=$struct<U>;
|
||||||
#[inline]
|
#[inline]
|
||||||
@ -11,6 +12,7 @@ macro_rules! impl_wide_vector_operations {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//these ones are vec only
|
||||||
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<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> {
|
||||||
type Output=V;
|
type Output=V;
|
||||||
#[inline]
|
#[inline]
|
||||||
@ -31,6 +33,57 @@ macro_rules! impl_wide_vector_operations {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Notes:
|
||||||
|
// 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_mul {
|
||||||
|
(
|
||||||
|
($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),
|
||||||
|
($rhs_struct_inner: ident { $($rhs_field_inner: ident), + }, $rhs_matrix_inner: ident { $($rhs_matrix_field_inner: ident), + }, $rhs_size_inner: expr)
|
||||||
|
) => {
|
||||||
|
impl<T,U> fixed_wide_traits::wide::WideDot<$matrix_inner<$rhs_struct_inner<U>>> for $struct_outer<$struct_inner<T>>
|
||||||
|
where
|
||||||
|
$struct_inner<T>:fixed_wide_traits::wide::WideDot<$rhs_struct_inner<U>>,
|
||||||
|
{
|
||||||
|
type Output=$struct_outer<<$struct_inner<T> as fixed_wide_traits::wide::WideDot<$rhs_struct_inner<U>>::Output>;
|
||||||
|
#[inline]
|
||||||
|
fn wide_dot(self,rhs:$matrix_inner<$rhs_struct_inner<U>>)->Self::Output{
|
||||||
|
//just made this up, don't trust it
|
||||||
|
let tr=rhs.transpose();
|
||||||
|
//TODO: use a macro expansion instead of transpose and map
|
||||||
|
self.map(|axis|
|
||||||
|
tr.map(|trax|
|
||||||
|
axis.wide_dot(trax)
|
||||||
|
).to_vector()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#[doc(hidden)]
|
||||||
|
#[macro_export(local_inner_macros)]
|
||||||
|
macro_rules! impl_wide_matrix_operations {
|
||||||
|
(
|
||||||
|
($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)
|
||||||
|
) => {
|
||||||
|
/* 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_det(&self) -> U {
|
||||||
|
$crate::sum_repeating!(
|
||||||
|
$( + self.$field.wide_mul(self.$field) ) +
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// HACK: Allows us to sum repeating tokens in macros.
|
// HACK: Allows us to sum repeating tokens in macros.
|
||||||
// See: https://stackoverflow.com/a/60187870/17452730
|
// See: https://stackoverflow.com/a/60187870/17452730
|
||||||
|
@ -16,15 +16,19 @@ pub struct Matrix4<T> {
|
|||||||
pub w_axis: T,
|
pub w_axis: T,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
crate::impl_matrix!((Matrix2 { x_axis, y_axis }, Vector2 { x, y }, 2), (T, T));
|
||||||
|
crate::impl_matrix!((Matrix3 { x_axis, y_axis, z_axis }, Vector3 { x, y, z }, 3), (T, T, T));
|
||||||
|
crate::impl_matrix!((Matrix4 { x_axis, y_axis, z_axis, w_axis }, Vector4 { x, y, z, w }, 4), (T, T, T, T));
|
||||||
|
|
||||||
crate::impl_extend!(Matrix2 { x_axis, y_axis }, Matrix3, z_axis);
|
crate::impl_extend!(Matrix2 { x_axis, y_axis }, Matrix3, z_axis);
|
||||||
crate::impl_extend!(Matrix3 { x_axis, y_axis, z_axis }, Matrix4, w_axis);
|
crate::impl_extend!(Matrix3 { x_axis, y_axis, z_axis }, Matrix4, w_axis);
|
||||||
|
|
||||||
crate::impl_matrix!((Matrix2 { x_axis, y_axis }, Vector2 { x, y }, 2), (Vector2 { x, y }, Matrix2 { x_axis, y_axis }, 2), ((T, T), (T, T)) );
|
crate::impl_matrix_inner!((Matrix2 { x_axis, y_axis }, Vector2 { x, y }, 2), (Vector2 { x, y }, Matrix2 { x_axis, y_axis }, 2), ((T, T), (T, T)) );
|
||||||
crate::impl_matrix!((Matrix2 { x_axis, y_axis }, Vector2 { x, y }, 2), (Vector3 { x, y, z }, Matrix3 { x_axis, y_axis, z_axis }, 3), ((T, T, T), (T, T, T)) );
|
crate::impl_matrix_inner!((Matrix2 { x_axis, y_axis }, Vector2 { x, y }, 2), (Vector3 { x, y, z }, Matrix3 { x_axis, y_axis, z_axis }, 3), ((T, T, T), (T, T, T)) );
|
||||||
crate::impl_matrix!((Matrix2 { x_axis, y_axis }, Vector2 { x, y }, 2), (Vector4 { x, y, z, w }, Matrix4 { x_axis, y_axis, z_axis, w_axis }, 4), ((T, T, T, T), (T, T, T, T)) );
|
crate::impl_matrix_inner!((Matrix2 { x_axis, y_axis }, Vector2 { x, y }, 2), (Vector4 { x, y, z, w }, Matrix4 { x_axis, y_axis, z_axis, w_axis }, 4), ((T, T, T, T), (T, T, T, T)) );
|
||||||
crate::impl_matrix!((Matrix3 { x_axis, y_axis, z_axis }, Vector3 { x, y, z }, 3), (Vector2 { x, y }, Matrix2 { x_axis, y_axis }, 2), ((T, T), (T, T), (T, T)) );
|
crate::impl_matrix_inner!((Matrix3 { x_axis, y_axis, z_axis }, Vector3 { x, y, z }, 3), (Vector2 { x, y }, Matrix2 { x_axis, y_axis }, 2), ((T, T), (T, T), (T, T)) );
|
||||||
crate::impl_matrix!((Matrix3 { x_axis, y_axis, z_axis }, Vector3 { x, y, z }, 3), (Vector3 { x, y, z }, Matrix3 { x_axis, y_axis, z_axis }, 3), ((T, T, T), (T, T, T), (T, T, T)) );
|
crate::impl_matrix_inner!((Matrix3 { x_axis, y_axis, z_axis }, Vector3 { x, y, z }, 3), (Vector3 { x, y, z }, Matrix3 { x_axis, y_axis, z_axis }, 3), ((T, T, T), (T, T, T), (T, T, T)) );
|
||||||
crate::impl_matrix!((Matrix3 { x_axis, y_axis, z_axis }, Vector3 { x, y, z }, 3), (Vector4 { x, y, z, w }, Matrix4 { x_axis, y_axis, z_axis, w_axis }, 4), ((T, T, T, T), (T, T, T, T), (T, T, T, T)) );
|
crate::impl_matrix_inner!((Matrix3 { x_axis, y_axis, z_axis }, Vector3 { x, y, z }, 3), (Vector4 { x, y, z, w }, Matrix4 { x_axis, y_axis, z_axis, w_axis }, 4), ((T, T, T, T), (T, T, T, T), (T, T, T, T)) );
|
||||||
crate::impl_matrix!((Matrix4 { x_axis, y_axis, z_axis, w_axis }, Vector4 { x, y, z, w }, 4), (Vector2 { x, y }, Matrix2 { x_axis, y_axis }, 2), ((T, T), (T, T), (T, T), (T, T)) );
|
crate::impl_matrix_inner!((Matrix4 { x_axis, y_axis, z_axis, w_axis }, Vector4 { x, y, z, w }, 4), (Vector2 { x, y }, Matrix2 { x_axis, y_axis }, 2), ((T, T), (T, T), (T, T), (T, T)) );
|
||||||
crate::impl_matrix!((Matrix4 { x_axis, y_axis, z_axis, w_axis }, Vector4 { x, y, z, w }, 4), (Vector3 { x, y, z }, Matrix3 { x_axis, y_axis, z_axis }, 3), ((T, T, T), (T, T, T), (T, T, T), (T, T, T)) );
|
crate::impl_matrix_inner!((Matrix4 { x_axis, y_axis, z_axis, w_axis }, Vector4 { x, y, z, w }, 4), (Vector3 { x, y, z }, Matrix3 { x_axis, y_axis, z_axis }, 3), ((T, T, T), (T, T, T), (T, T, T), (T, T, T)) );
|
||||||
crate::impl_matrix!((Matrix4 { x_axis, y_axis, z_axis, w_axis }, Vector4 { x, y, z, w }, 4), (Vector4 { x, y, z, w }, Matrix4 { x_axis, y_axis, z_axis, w_axis }, 4), ((T, T, T, T), (T, T, T, T), (T, T, T, T), (T, T, T, T)) );
|
crate::impl_matrix_inner!((Matrix4 { x_axis, y_axis, z_axis, w_axis }, Vector4 { x, y, z, w }, 4), (Vector4 { x, y, z, w }, Matrix4 { x_axis, y_axis, z_axis, w_axis }, 4), ((T, T, T, T), (T, T, T, T), (T, T, T, T), (T, T, T, T)) );
|
||||||
|
@ -70,12 +70,12 @@ crate::impl_vector!(Vector4 { x, y, z, w }, (T, T, T, T), 4);
|
|||||||
crate::impl_extend!(Vector2 { x, y }, Vector3, z);
|
crate::impl_extend!(Vector2 { x, y }, Vector3, z);
|
||||||
crate::impl_extend!(Vector3 { x, y, z }, Vector4, w);
|
crate::impl_extend!(Vector3 { x, y, z }, Vector4, w);
|
||||||
|
|
||||||
crate::impl_matrix!((Vector2 { x, y }, Vector2 { x, y }, 2), (Vector2 { x, y }, Vector2 { x, y }, 2), ((T, T), (T, T)) );
|
crate::impl_matrix_inner!((Vector2 { x, y }, Vector2 { x, y }, 2), (Vector2 { x, y }, Vector2 { x, y }, 2), ((T, T), (T, T)) );
|
||||||
crate::impl_matrix!((Vector2 { x, y }, Vector2 { x, y }, 2), (Vector3 { x, y, z }, Vector3 { x, y, z }, 3), ((T, T, T), (T, T, T)) );
|
crate::impl_matrix_inner!((Vector2 { x, y }, Vector2 { x, y }, 2), (Vector3 { x, y, z }, Vector3 { x, y, z }, 3), ((T, T, T), (T, T, T)) );
|
||||||
crate::impl_matrix!((Vector2 { x, y }, Vector2 { x, y }, 2), (Vector4 { x, y, z, w }, Vector4 { x, y, z, w }, 4), ((T, T, T, T), (T, T, T, T)) );
|
crate::impl_matrix_inner!((Vector2 { x, y }, Vector2 { x, y }, 2), (Vector4 { x, y, z, w }, Vector4 { x, y, z, w }, 4), ((T, T, T, T), (T, T, T, T)) );
|
||||||
crate::impl_matrix!((Vector3 { x, y, z }, Vector3 { x, y, z }, 3), (Vector2 { x, y }, Vector2 { x, y }, 2), ((T, T), (T, T), (T, T)) );
|
crate::impl_matrix_inner!((Vector3 { x, y, z }, Vector3 { x, y, z }, 3), (Vector2 { x, y }, Vector2 { x, y }, 2), ((T, T), (T, T), (T, T)) );
|
||||||
crate::impl_matrix!((Vector3 { x, y, z }, Vector3 { x, y, z }, 3), (Vector3 { x, y, z }, Vector3 { x, y, z }, 3), ((T, T, T), (T, T, T), (T, T, T)) );
|
crate::impl_matrix_inner!((Vector3 { x, y, z }, Vector3 { x, y, z }, 3), (Vector3 { x, y, z }, Vector3 { x, y, z }, 3), ((T, T, T), (T, T, T), (T, T, T)) );
|
||||||
crate::impl_matrix!((Vector3 { x, y, z }, Vector3 { x, y, z }, 3), (Vector4 { x, y, z, w }, Vector4 { x, y, z, w }, 4), ((T, T, T, T), (T, T, T, T), (T, T, T, T)) );
|
crate::impl_matrix_inner!((Vector3 { x, y, z }, Vector3 { x, y, z }, 3), (Vector4 { x, y, z, w }, Vector4 { x, y, z, w }, 4), ((T, T, T, T), (T, T, T, T), (T, T, T, T)) );
|
||||||
crate::impl_matrix!((Vector4 { x, y, z, w }, Vector4 { x, y, z, w }, 4), (Vector2 { x, y }, Vector2 { x, y }, 2), ((T, T), (T, T), (T, T), (T, T)) );
|
crate::impl_matrix_inner!((Vector4 { x, y, z, w }, Vector4 { x, y, z, w }, 4), (Vector2 { x, y }, Vector2 { x, y }, 2), ((T, T), (T, T), (T, T), (T, T)) );
|
||||||
crate::impl_matrix!((Vector4 { x, y, z, w }, Vector4 { x, y, z, w }, 4), (Vector3 { x, y, z }, Vector3 { x, y, z }, 3), ((T, T, T), (T, T, T), (T, T, T), (T, T, T)) );
|
crate::impl_matrix_inner!((Vector4 { x, y, z, w }, Vector4 { x, y, z, w }, 4), (Vector3 { x, y, z }, Vector3 { x, y, z }, 3), ((T, T, T), (T, T, T), (T, T, T), (T, T, T)) );
|
||||||
crate::impl_matrix!((Vector4 { x, y, z, w }, Vector4 { x, y, z, w }, 4), (Vector4 { x, y, z, w }, Vector4 { x, y, z, w }, 4), ((T, T, T, T), (T, T, T, T), (T, T, T, T), (T, T, T, T)) );
|
crate::impl_matrix_inner!((Vector4 { x, y, z, w }, Vector4 { x, y, z, w }, 4), (Vector4 { x, y, z, w }, Vector4 { x, y, z, w }, 4), ((T, T, T, T), (T, T, T, T), (T, T, T, T), (T, T, T, T)) );
|
||||||
|
Loading…
Reference in New Issue
Block a user