pub struct Transform2 { /* private fields */ }Expand description
A homogeneous 2D transform matrix.
Implementations§
Source§impl Transform2
impl Transform2
Sourcepub const fn new(matrix: [[f64; 3]; 3]) -> Transform2
pub const fn new(matrix: [[f64; 3]; 3]) -> Transform2
Creates a transform from a 3x3 homogeneous matrix.
Sourcepub const fn identity() -> Transform2
pub const fn identity() -> Transform2
Returns the identity transform.
Sourcepub const fn translation(translation: Translation) -> Transform2
pub const fn translation(translation: Translation) -> Transform2
Creates a 2D translation transform.
Sourcepub const fn scale(scale: Scale) -> Transform2
pub const fn scale(scale: Scale) -> Transform2
Creates a 2D scale transform.
Sourcepub fn rotation(rotation: Rotation) -> Transform2
pub fn rotation(rotation: Rotation) -> Transform2
Creates a 2D rotation transform.
Trait Implementations§
Source§impl Clone for Transform2
impl Clone for Transform2
Source§fn clone(&self) -> Transform2
fn clone(&self) -> Transform2
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 moreSource§impl Debug for Transform2
impl Debug for Transform2
Source§impl PartialEq for Transform2
impl PartialEq for Transform2
Source§fn eq(&self, other: &Transform2) -> bool
fn eq(&self, other: &Transform2) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for Transform2
impl StructuralPartialEq for Transform2
Auto Trait Implementations§
impl Freeze for Transform2
impl RefUnwindSafe for Transform2
impl Send for Transform2
impl Sync for Transform2
impl Unpin for Transform2
impl UnsafeUnpin for Transform2
impl UnwindSafe for Transform2
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