pub struct DTransformation {
pub reflected: bool,
pub rotation: NotNan<f32>,
pub translation: (NotNan<f32>, NotNan<f32>),
}Expand description
A rigid transformation: optional reflection across the x-axis, then rotation, then translation. The reflection axis is in the transformation’s input coordinate system.
Fields§
§reflected: boolReflect across the x-axis before rotating (negate the local y coordinate).
rotation: NotNan<f32>The rotation in radians
translation: (NotNan<f32>, NotNan<f32>)The translation in the x and y-axis
Implementations§
Source§impl DTransformation
impl DTransformation
pub fn new(rotation: f32, translation: (f32, f32)) -> Self
pub const fn empty() -> Self
Sourcepub fn with_reflection(self, reflected: bool) -> Self
pub fn with_reflection(self, reflected: bool) -> Self
Sets the canonical x-axis reflection applied before rotation and translation.
pub fn rotation(&self) -> f32
pub fn translation(&self) -> (f32, f32)
pub fn compose(&self) -> Transformation
Trait Implementations§
Source§impl Clone for DTransformation
impl Clone for DTransformation
Source§fn clone(&self) -> DTransformation
fn clone(&self) -> DTransformation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for DTransformation
Source§impl Debug for DTransformation
impl Debug for DTransformation
Source§impl Default for DTransformation
impl Default for DTransformation
Source§fn default() -> DTransformation
fn default() -> DTransformation
Returns the “default value” for a type. Read more
Source§impl Display for DTransformation
impl Display for DTransformation
impl Eq for DTransformation
Source§impl From<DTransformation> for ExtTransformation
impl From<DTransformation> for ExtTransformation
Source§fn from(dt: DTransformation) -> Self
fn from(dt: DTransformation) -> Self
Converts to this type from the input type.
Source§impl From<ExtTransformation> for DTransformation
impl From<ExtTransformation> for DTransformation
Source§fn from(ext_dt: ExtTransformation) -> Self
fn from(ext_dt: ExtTransformation) -> Self
Converts to this type from the input type.
Source§impl<T> From<T> for DTransformationwhere
T: Borrow<Transformation>,
impl<T> From<T> for DTransformationwhere
T: Borrow<Transformation>,
Source§impl Hash for DTransformation
impl Hash for DTransformation
Source§impl PartialEq for DTransformation
impl PartialEq for DTransformation
Source§fn eq(&self, other: &DTransformation) -> bool
fn eq(&self, other: &DTransformation) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for DTransformation
Auto Trait Implementations§
impl Freeze for DTransformation
impl RefUnwindSafe for DTransformation
impl Send for DTransformation
impl Sync for DTransformation
impl Unpin for DTransformation
impl UnsafeUnpin for DTransformation
impl UnwindSafe for DTransformation
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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 more