pub struct TrackEntry {Show 25 fields
pub animation: AnimationId,
pub track_index: usize,
pub previous: Option<EntryId>,
pub next: Option<EntryId>,
pub mixing_from: Option<EntryId>,
pub mixing_to: Option<EntryId>,
pub looping: bool,
pub additive: bool,
pub reverse: bool,
pub shortest_rotation: bool,
pub event_threshold: f32,
pub mix_attachment_threshold: f32,
pub alpha_attachment_threshold: f32,
pub mix_draw_order_threshold: f32,
pub animation_start: f32,
pub animation_end: f32,
pub animation_last: f32,
pub delay: f32,
pub track_time: f32,
pub track_end: f32,
pub time_scale: f32,
pub alpha: f32,
pub mix_time: f32,
pub mix_duration: f32,
pub mix_interpolation: Interpolation,
/* private fields */
}Expand description
Playback of one animation on a track. Times are in seconds.
Get one from AnimationState::set_animation or
AnimationState::add_animation and adjust its fields through
AnimationState::entry_mut. The links (previous, next,
mixing_from, mixing_to) are maintained by the state; read them, don’t
write them.
Fields§
§animation: AnimationIdThe animation played, or EMPTY_ANIMATION_ID.
track_index: usize§previous: Option<EntryId>The entry this one is queued after. None once this entry is
current.
next: Option<EntryId>The entry queued to play after this one.
mixing_from: Option<EntryId>The entry this one is crossfading from.
mixing_to: Option<EntryId>The entry crossfading from this one.
looping: boolRepeats the animation between animation_start and animation_end.
additive: boolAdds this entry’s values to lower tracks instead of mixing toward
them, for timelines that support it
(Timeline::is_additive).
reverse: boolPlays the animation backward.
shortest_rotation: boolMixes rotation the shortest way every frame. Otherwise the direction chosen on the first frame of a mix is kept, so a bone doesn’t flip direction mid-mix. Always on for additive entries.
event_threshold: f32While this entry mixes out, its keyframe events fire only while the mix percentage is below this. 0 (the default) suppresses them.
mix_attachment_threshold: f32While this entry mixes out, the attachments it keys are kept only while the mix percentage is below this. Default 0.
alpha_attachment_threshold: f32The attachments this entry keys are kept only while the alpha it applies with is at least this. Default 0.
mix_draw_order_threshold: f32While this entry mixes out, its draw order keys apply only while the mix percentage is below this. Default 0.
animation_start: f32Animation time at which playback starts. Default 0.
animation_end: f32Animation time at which playback ends or loops. Defaults to the animation’s duration.
animation_last: f32Animation time last applied, or -1 before the first apply. Set it with
Self::set_animation_last; a direct write is overwritten by the next
AnimationState::update.
delay: f32Seconds before the entry starts. For a queued entry, the previous entry’s track time at which this one becomes current.
track_time: f32Seconds this entry has played, scaled by time_scale.
track_end: f32Track time at which the entry ends if nothing is queued after it.
Defaults to f32::MAX; empty animations end when their mix does.
time_scale: f32Multiplies the delta this entry advances by.
alpha: f32Weight of this entry over lower tracks, 0 to 1.
mix_time: f32Seconds into the crossfade from mixing_from.
mix_duration: f32Length of the crossfade from the previous entry. Taken from
AnimationStateData::mix when the entry is created; 0 switches
immediately.
mix_interpolation: InterpolationImplementations§
Source§impl TrackEntry
impl TrackEntry
Sourcepub fn animation_time(&self) -> f32
pub fn animation_time(&self) -> f32
Time within the animation: track time offset by animation_start,
wrapped when looping and clamped to animation_end otherwise.
Sourcepub fn set_animation_last(&mut self, value: f32)
pub fn set_animation_last(&mut self, value: f32)
Sets animation_last, the time events fire from on the next apply.
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Whether track time has reached one full play of the animation.
Sourcepub fn track_complete(&self) -> f32
pub fn track_complete(&self) -> f32
Track time when the current loop or the animation completes.
Sourcepub fn was_applied(&self) -> bool
pub fn was_applied(&self) -> bool
Whether the entry has been applied at least once.
pub fn is_empty_animation(&self) -> bool
Sourcepub fn reset_rotation_directions(&mut self)
pub fn reset_rotation_directions(&mut self)
Discards the rotation directions kept for mixing, so the next apply
picks the shortest way again. Useful when alpha changes or
animations start on other tracks, so bones don’t rotate the long way
around.