pub struct Transform {
pub position: Vec2,
pub rotation: f32,
pub scale: f32,
pub parent: Option<Entity>,
pub abs_position: Vec2,
pub abs_rotation: f32,
pub abs_scale: f32,
}Fields§
§position: Vec2§rotation: f32§scale: f32§parent: Option<Entity>§abs_position: Vec2§abs_rotation: f32§abs_scale: f32Implementations§
Source§impl Transform
impl Transform
pub fn position(position: Vec2) -> Transform
pub fn rotation(self, rotation: f32) -> Transform
pub fn scale(self, scale: f32) -> Transform
pub fn distance(&self, other: &Transform) -> f32
pub fn parent(self, parent: Entity) -> Transform
pub fn compose_with_parent(&self, parent_transform: &Transform) -> Transform
pub fn to_matrix(&self) -> Mat3
pub fn from_matrix(matrix: Mat3) -> Transform
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Transform
impl RefUnwindSafe for Transform
impl Send for Transform
impl Sync for Transform
impl Unpin for Transform
impl UnwindSafe for Transform
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<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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