Add the conversion of an array of four elements to a quaternion.

This commit is contained in:
Crozet Sébastien 2020-10-25 11:23:51 +01:00
parent 3d82c4335e
commit a623e63d08
1 changed files with 9 additions and 0 deletions

View File

@ -265,6 +265,15 @@ impl<N: Scalar + SimdValue> From<Vector4<N>> for Quaternion<N> {
} }
} }
impl<N: Scalar + SimdValue> From<[N; 4]> for Quaternion<N> {
#[inline]
fn from(coords: [N; 4]) -> Self {
Self {
coords: coords.into(),
}
}
}
impl<N: Scalar + PrimitiveSimdValue> From<[Quaternion<N::Element>; 2]> for Quaternion<N> impl<N: Scalar + PrimitiveSimdValue> From<[Quaternion<N::Element>; 2]> for Quaternion<N>
where where
N: From<[<N as SimdValue>::Element; 2]>, N: From<[<N as SimdValue>::Element; 2]>,