Add the conversion of an array of four elements to a quaternion.
This commit is contained in:
parent
3d82c4335e
commit
a623e63d08
|
@ -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]>,
|
||||||
|
|
Loading…
Reference in New Issue