&selfself on Copy types.

This commit is contained in:
Violeta Hernández 2021-06-18 12:53:38 -05:00
parent 0312981a4f
commit d659747fa4
6 changed files with 13 additions and 13 deletions

View File

@ -275,7 +275,7 @@ where
}
impl<T: RealField> DualQuaternion<T> {
fn to_vector(&self) -> OVector<T, U8> {
fn to_vector(self) -> OVector<T, U8> {
(*self.as_ref()).into()
}
}
@ -724,7 +724,7 @@ where
/// ```
#[inline]
#[must_use]
pub fn to_isometry(&self) -> Isometry3<T> {
pub fn to_isometry(self) -> Isometry3<T> {
Isometry3::from_parts(self.translation(), self.rotation())
}
@ -875,7 +875,7 @@ where
/// ```
#[inline]
#[must_use]
pub fn to_homogeneous(&self) -> Matrix4<T> {
pub fn to_homogeneous(self) -> Matrix4<T> {
self.to_isometry().to_homogeneous()
}
}

View File

@ -222,7 +222,7 @@ impl<T: RealField> Orthographic3<T> {
/// ```
#[inline]
#[must_use]
pub fn to_homogeneous(&self) -> Matrix4<T> {
pub fn to_homogeneous(self) -> Matrix4<T> {
self.matrix
}
@ -270,7 +270,7 @@ impl<T: RealField> Orthographic3<T> {
/// ```
#[inline]
#[must_use]
pub fn to_projective(&self) -> Projective3<T> {
pub fn to_projective(self) -> Projective3<T> {
Projective3::from_matrix_unchecked(self.matrix)
}

View File

@ -124,7 +124,7 @@ impl<T: RealField> Perspective3<T> {
/// Computes the corresponding homogeneous matrix.
#[inline]
#[must_use]
pub fn to_homogeneous(&self) -> Matrix4<T> {
pub fn to_homogeneous(self) -> Matrix4<T> {
self.matrix.clone_owned()
}
@ -145,7 +145,7 @@ impl<T: RealField> Perspective3<T> {
/// This transformation seen as a `Projective3`.
#[inline]
#[must_use]
pub fn to_projective(&self) -> Projective3<T> {
pub fn to_projective(self) -> Projective3<T> {
Projective3::from_matrix_unchecked(self.matrix)
}

View File

@ -1478,7 +1478,7 @@ where
/// ```
#[inline]
#[must_use]
pub fn to_rotation_matrix(&self) -> Rotation<T, 3> {
pub fn to_rotation_matrix(self) -> Rotation<T, 3> {
let i = self.as_ref()[0];
let j = self.as_ref()[1];
let k = self.as_ref()[2];
@ -1513,7 +1513,7 @@ where
/// The angles are produced in the form (roll, pitch, yaw).
#[inline]
#[deprecated(note = "This is renamed to use `.euler_angles()`.")]
pub fn to_euler_angles(&self) -> (T, T, T)
pub fn to_euler_angles(self) -> (T, T, T)
where
T: RealField,
{
@ -1561,7 +1561,7 @@ where
/// ```
#[inline]
#[must_use]
pub fn to_homogeneous(&self) -> Matrix4<T> {
pub fn to_homogeneous(self) -> Matrix4<T> {
self.to_rotation_matrix().to_homogeneous()
}

View File

@ -883,7 +883,7 @@ impl<T: SimdRealField> Rotation3<T> {
///
/// The angles are produced in the form (roll, pitch, yaw).
#[deprecated(note = "This is renamed to use `.euler_angles()`.")]
pub fn to_euler_angles(&self) -> (T, T, T)
pub fn to_euler_angles(self) -> (T, T, T)
where
T: RealField,
{

View File

@ -261,7 +261,7 @@ where
/// ```
#[inline]
#[must_use]
pub fn to_rotation_matrix(&self) -> Rotation2<T> {
pub fn to_rotation_matrix(self) -> Rotation2<T> {
let r = self.re;
let i = self.im;
@ -282,7 +282,7 @@ where
/// ```
#[inline]
#[must_use]
pub fn to_homogeneous(&self) -> Matrix3<T> {
pub fn to_homogeneous(self) -> Matrix3<T> {
self.to_rotation_matrix().to_homogeneous()
}
}