forked from M-Labs/nalgebra
parent
81d2cbf96c
commit
343fb2f24f
@ -82,21 +82,23 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<N: Scalar + Copy, D: DimName + Copy, R: AbstractRotation<N, D> + Copy> Copy
|
impl<N: Scalar + Copy, D: DimName + Copy, R: Copy> Copy for Isometry<N, D, R>
|
||||||
for Isometry<N, D, R>
|
|
||||||
where
|
where
|
||||||
DefaultAllocator: Allocator<N, D>,
|
DefaultAllocator: Allocator<N, D>,
|
||||||
Owned<N, D>: Copy,
|
Owned<N, D>: Copy,
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<N: Scalar, D: DimName, R: AbstractRotation<N, D> + Clone> Clone for Isometry<N, D, R>
|
impl<N: Scalar, D: DimName, R: Clone> Clone for Isometry<N, D, R>
|
||||||
where
|
where
|
||||||
DefaultAllocator: Allocator<N, D>,
|
DefaultAllocator: Allocator<N, D>,
|
||||||
{
|
{
|
||||||
#[inline]
|
#[inline]
|
||||||
fn clone(&self) -> Self {
|
fn clone(&self) -> Self {
|
||||||
Self::from_parts(self.translation.clone(), self.rotation.clone())
|
Self {
|
||||||
|
rotation: self.rotation.clone(),
|
||||||
|
translation: self.translation.clone(),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,3 +13,15 @@ pub type IsometryMatrix2<N> = Isometry<N, U2, Rotation2<N>>;
|
|||||||
|
|
||||||
/// A 3-dimensional direct isometry using a rotation matrix for its rotational part. Also known as a rigid-body motion, or as an element of SE(3).
|
/// A 3-dimensional direct isometry using a rotation matrix for its rotational part. Also known as a rigid-body motion, or as an element of SE(3).
|
||||||
pub type IsometryMatrix3<N> = Isometry<N, U3, Rotation3<N>>;
|
pub type IsometryMatrix3<N> = Isometry<N, U3, Rotation3<N>>;
|
||||||
|
|
||||||
|
// This tests that the types correctly implement `Copy`, without having to run tests
|
||||||
|
// (when targeting no-std for example).
|
||||||
|
#[allow(dead_code)]
|
||||||
|
fn ensure_copy() {
|
||||||
|
fn is_copy<T: Copy>() {}
|
||||||
|
|
||||||
|
is_copy::<IsometryMatrix2<f32>>();
|
||||||
|
is_copy::<IsometryMatrix3<f32>>();
|
||||||
|
is_copy::<Isometry2<f32>>();
|
||||||
|
is_copy::<Isometry3<f32>>();
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user