pub struct Transform2D { /* private fields */ }Expand description
A 2D transform composed of position, rotation (in radians), and scale.
Implementations§
Source§impl Transform2D
Implements methods for Transform2D.
impl Transform2D
Implements methods for Transform2D.
Sourcepub fn identity() -> Transform2D
pub fn identity() -> Transform2D
Creates a new transform at the origin with no rotation and unit scale.
§Returns
Transform2D- The identity transform.
Source§impl Transform2D
impl Transform2D
pub fn get_position(&self) -> Vector2D
pub fn get_mut_position(&mut self) -> &mut Vector2D
pub fn set_position(&mut self, val: Vector2D) -> &mut Self
pub fn get_rotation(&self) -> f64
pub fn get_mut_rotation(&mut self) -> &mut f64
pub fn set_rotation(&mut self, val: f64) -> &mut Self
pub fn get_scale(&self) -> Vector2D
pub fn get_mut_scale(&mut self) -> &mut Vector2D
pub fn set_scale(&mut self, val: Vector2D) -> &mut Self
Trait Implementations§
Source§impl Clone for Transform2D
impl Clone for Transform2D
Source§fn clone(&self) -> Transform2D
fn clone(&self) -> Transform2D
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 Transform2D
Source§impl Debug for Transform2D
impl Debug for Transform2D
Source§impl Default for Transform2D
Implements Default for Transform2D as the identity transform.
impl Default for Transform2D
Implements Default for Transform2D as the identity transform.
Source§fn default() -> Transform2D
fn default() -> Transform2D
Returns the “default value” for a type. Read more
Source§impl PartialEq for Transform2D
impl PartialEq for Transform2D
Source§fn eq(&self, other: &Transform2D) -> bool
fn eq(&self, other: &Transform2D) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for Transform2D
impl PartialOrd for Transform2D
impl StructuralPartialEq for Transform2D
Auto Trait Implementations§
impl Freeze for Transform2D
impl RefUnwindSafe for Transform2D
impl Send for Transform2D
impl Sync for Transform2D
impl Unpin for Transform2D
impl UnsafeUnpin for Transform2D
impl UnwindSafe for Transform2D
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