Merge pull request #539 from CyborgSquirrel/master
Implement IntoMint trait for Vectors, Points, Matrices, and Quaternions
This commit is contained in:
commit
78c082e944
4 changed files with 14 additions and 2 deletions
|
@ -22,7 +22,7 @@ swizzle = []
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
approx = "0.5"
|
approx = "0.5"
|
||||||
mint = { version = "0.5", optional = true }
|
mint = { version = "0.5.8", optional = true }
|
||||||
num-traits = "0.2"
|
num-traits = "0.2"
|
||||||
# small_rng used only for benchmarks
|
# small_rng used only for benchmarks
|
||||||
rand = { version = "0.8", features = ["small_rng"], optional = true }
|
rand = { version = "0.8", features = ["small_rng"], optional = true }
|
||||||
|
|
|
@ -373,6 +373,10 @@ macro_rules! impl_mint_conversions {
|
||||||
$ArrayN { $( $field: v.$field, )+ }
|
$ArrayN { $( $field: v.$field, )+ }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<S: Clone> mint::IntoMint for $ArrayN<S> {
|
||||||
|
type MintType = mint::$Mint<S>;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1558,7 +1558,10 @@ macro_rules! mint_conversions {
|
||||||
$MatrixN { $($field: m.$field.into()),+ }
|
$MatrixN { $($field: m.$field.into()),+ }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<S: Clone> mint::IntoMint for $MatrixN<S> {
|
||||||
|
type MintType = mint::$MintN<S>;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -685,6 +685,11 @@ impl<S: Clone> From<Quaternion<S>> for mint::Quaternion<S> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "mint")]
|
||||||
|
impl <S: Clone> mint::IntoMint for Quaternion<S> {
|
||||||
|
type MintType = mint::Quaternion<S>;
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use quaternion::*;
|
use quaternion::*;
|
||||||
|
|
Loading…
Reference in a new issue