Struct comfy_core::Transform
source · 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) -> Self
pub fn rotation(self, rotation: f32) -> Self
pub fn scale(self, scale: f32) -> Self
pub fn distance(&self, other: &Transform) -> f32
pub fn parent(self, parent: Entity) -> Self
pub fn compose_with_parent(&self, parent_transform: &Transform) -> Transform
pub fn to_matrix(&self) -> Mat3
pub fn from_matrix(matrix: Mat3) -> Self
Trait Implementations§
Auto Trait Implementations§
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