pub struct Pose2 {
pub rotation: Rot2,
pub translation: Vec2,
}Expand description
A 2D pose (rotation + translation), representing a rigid body transformation (f32 precision).
Fields§
§rotation: Rot2The rotational part of the pose.
translation: Vec2The translational part of the pose.
Implementations§
Source§impl Pose2
impl Pose2
Sourcepub fn from_translation(translation: Vec2) -> Pose2
pub fn from_translation(translation: Vec2) -> Pose2
Creates a pose from a translation vector.
Sourcepub fn translation(x: f32, y: f32) -> Pose2
pub fn translation(x: f32, y: f32) -> Pose2
Creates a pose from translation components.
Sourcepub fn from_rotation(rotation: Rot2) -> Pose2
pub fn from_rotation(rotation: Rot2) -> Pose2
Creates a pose from a rotation.
Sourcepub fn rotation(angle: f32) -> Pose2
pub fn rotation(angle: f32) -> Pose2
Creates a pose that is a pure rotation with the given angle (in radians).
Sourcepub fn from_parts(translation: Vec2, rotation: Rot2) -> Pose2
pub fn from_parts(translation: Vec2, rotation: Rot2) -> Pose2
Creates a pose from translation and rotation parts.
Sourcepub fn prepend_translation(self, translation: Vec2) -> Pose2
pub fn prepend_translation(self, translation: Vec2) -> Pose2
Prepends a translation to this pose (applies translation in local frame).
Sourcepub fn append_translation(self, translation: Vec2) -> Pose2
pub fn append_translation(self, translation: Vec2) -> Pose2
Appends a translation to this pose (applies translation in world frame).
Sourcepub fn transform_point(&self, p: Vec2) -> Vec2
pub fn transform_point(&self, p: Vec2) -> Vec2
Transforms a 2D point by this pose.
This applies both the rotation and translation.
Sourcepub fn transform_vector(&self, v: Vec2) -> Vec2
pub fn transform_vector(&self, v: Vec2) -> Vec2
Transforms a 2D vector by this pose.
This applies only the rotation (ignores translation).
Sourcepub fn inverse_transform_point(&self, p: Vec2) -> Vec2
pub fn inverse_transform_point(&self, p: Vec2) -> Vec2
Transforms a point by the inverse of this pose.
Sourcepub fn inverse_transform_vector(&self, v: Vec2) -> Vec2
pub fn inverse_transform_vector(&self, v: Vec2) -> Vec2
Transforms a vector by the inverse of this pose.
Trait Implementations§
Source§impl AbsDiffEq for Pose2
impl AbsDiffEq for Pose2
Source§fn default_epsilon() -> <Pose2 as AbsDiffEq>::Epsilon
fn default_epsilon() -> <Pose2 as AbsDiffEq>::Epsilon
Source§fn abs_diff_eq(
&self,
other: &Pose2,
epsilon: <Pose2 as AbsDiffEq>::Epsilon,
) -> bool
fn abs_diff_eq( &self, other: &Pose2, epsilon: <Pose2 as AbsDiffEq>::Epsilon, ) -> bool
Source§fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
AbsDiffEq::abs_diff_eq.Source§impl MulAssign<Rot2> for Pose2
impl MulAssign<Rot2> for Pose2
Source§fn mul_assign(&mut self, rhs: Rot2)
fn mul_assign(&mut self, rhs: Rot2)
*= operation. Read moreSource§impl MulAssign for Pose2
impl MulAssign for Pose2
Source§fn mul_assign(&mut self, rhs: Pose2)
fn mul_assign(&mut self, rhs: Pose2)
*= operation. Read moreSource§impl RelativeEq for Pose2
impl RelativeEq for Pose2
Source§fn default_max_relative() -> <Pose2 as AbsDiffEq>::Epsilon
fn default_max_relative() -> <Pose2 as AbsDiffEq>::Epsilon
Source§fn relative_eq(
&self,
other: &Pose2,
epsilon: <Pose2 as AbsDiffEq>::Epsilon,
max_relative: <Pose2 as AbsDiffEq>::Epsilon,
) -> bool
fn relative_eq( &self, other: &Pose2, epsilon: <Pose2 as AbsDiffEq>::Epsilon, max_relative: <Pose2 as AbsDiffEq>::Epsilon, ) -> bool
Source§fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon,
) -> bool
fn relative_ne( &self, other: &Rhs, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool
RelativeEq::relative_eq.impl Copy for Pose2
impl StructuralPartialEq for Pose2
Auto Trait Implementations§
impl Freeze for Pose2
impl RefUnwindSafe for Pose2
impl Send for Pose2
impl Sync for Pose2
impl Unpin for Pose2
impl UnwindSafe for Pose2
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.