pub struct MoveTween {
pub target: Vec3,
pub duration: f32,
pub delay: f32,
pub ease: Ease,
pub mode: TweenMode,
pub playing: bool,
/* private fields */
}Expand description
Local-position tween from the first observed pose to a parent-local target. Runtime progress is omitted from serde; loaded/duplicated components start afresh.
Fields§
§target: Vec3Absolute target position in parent-local metres.
duration: f32Duration of one leg in simulation seconds. Zero snaps once, in any mode.
delay: f32Initial delay in simulation seconds; negative values behave as zero.
ease: EaseInterpolation curve for each leg.
mode: TweenModeCompletion/repetition policy.
playing: boolWhether the update system advances this component.
Implementations§
Source§impl MoveTween
impl MoveTween
Sourcepub fn to(target: Vec3, duration: f32) -> Option<Self>
pub fn to(target: Vec3, duration: f32) -> Option<Self>
Creates a one-shot tween; rejects invalid targets and negative/non-finite durations.
Sourcepub fn is_finished(&self) -> bool
pub fn is_finished(&self) -> bool
Whether a one-shot (including zero duration) has reached its target.
Sourcepub fn elapsed(&self) -> f64
pub fn elapsed(&self) -> f64
Total simulated seconds since the current start, including initial delay.
Sourcepub fn restart(&mut self)
pub fn restart(&mut self)
Restarts the clock and resumes, keeping the captured original position. The next update may jump back toward the original position.
Sourcepub fn restart_from_current(&mut self)
pub fn restart_from_current(&mut self)
Restarts from the position observed on the next update.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for MoveTween
impl<'de> Deserialize<'de> for MoveTween
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for MoveTween
impl RefUnwindSafe for MoveTween
impl Send for MoveTween
impl Sync for MoveTween
impl Unpin for MoveTween
impl UnsafeUnpin for MoveTween
impl UnwindSafe for MoveTween
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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> ⓘ
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> ⓘ
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 moreimpl<T> MaybeSync for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.