pub struct Transform2DOps;Expand description
Zero-sized type hosting Transform2D factory operations.
Implementations§
Source§impl Transform2DOps
impl Transform2DOps
Sourcepub fn new_default() -> FfiTransform2D
pub fn new_default() -> FfiTransform2D
Creates a default Transform2D (origin, no rotation, unit scale).
Sourcepub fn from_position(x: f32, y: f32) -> FfiTransform2D
pub fn from_position(x: f32, y: f32) -> FfiTransform2D
Creates a Transform2D at the specified position.
Sourcepub fn from_rotation(rotation: f32) -> FfiTransform2D
pub fn from_rotation(rotation: f32) -> FfiTransform2D
Creates a Transform2D with the specified rotation (radians).
Sourcepub fn from_rotation_degrees(degrees: f32) -> FfiTransform2D
pub fn from_rotation_degrees(degrees: f32) -> FfiTransform2D
Creates a Transform2D with the specified rotation (degrees).
Sourcepub fn from_scale(scale_x: f32, scale_y: f32) -> FfiTransform2D
pub fn from_scale(scale_x: f32, scale_y: f32) -> FfiTransform2D
Creates a Transform2D with the specified scale.
Sourcepub fn from_scale_uniform(scale: f32) -> FfiTransform2D
pub fn from_scale_uniform(scale: f32) -> FfiTransform2D
Creates a Transform2D with uniform scale.
Sourcepub fn from_position_rotation(x: f32, y: f32, rotation: f32) -> FfiTransform2D
pub fn from_position_rotation(x: f32, y: f32, rotation: f32) -> FfiTransform2D
Creates a Transform2D with position and rotation.
Sourcepub fn new_full(
pos_x: f32,
pos_y: f32,
rotation: f32,
scale_x: f32,
scale_y: f32,
) -> FfiTransform2D
pub fn new_full( pos_x: f32, pos_y: f32, rotation: f32, scale_x: f32, scale_y: f32, ) -> FfiTransform2D
Creates a fully specified Transform2D.
Sourcepub fn look_at(
pos_x: f32,
pos_y: f32,
target_x: f32,
target_y: f32,
) -> FfiTransform2D
pub fn look_at( pos_x: f32, pos_y: f32, target_x: f32, target_y: f32, ) -> FfiTransform2D
Creates a Transform2D looking at a target position.
Sourcepub fn lerp(from: FfiTransform2D, to: FfiTransform2D, t: f32) -> FfiTransform2D
pub fn lerp(from: FfiTransform2D, to: FfiTransform2D, t: f32) -> FfiTransform2D
Linearly interpolates between two transforms.
Sourcepub fn normalize_angle(angle: f32) -> f32
pub fn normalize_angle(angle: f32) -> f32
Normalizes an angle to [-PI, PI).
Auto Trait Implementations§
impl Freeze for Transform2DOps
impl RefUnwindSafe for Transform2DOps
impl Send for Transform2DOps
impl Sync for Transform2DOps
impl Unpin for Transform2DOps
impl UnsafeUnpin for Transform2DOps
impl UnwindSafe for Transform2DOps
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<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