pub enum AnimatedPoint {
Constant {
value: Vec2,
},
Keyframes {
keyframes: Vec<PointKeyframe>,
before: Extrapolation,
after: Extrapolation,
},
Split {
channels: Vec<Animated<f32>>,
},
Path(Box<MotionPath>),
Data(Box<DataBinding>),
}Expand description
A position that can move along curves between its keyframes.
Its JSON is an Animated<Vec2> plus optional spatial tangents per keyframe. With them,
the value travels the cubic Bezier through this keyframe’s out_tangent and the next’s
in_tangent, at the speed its timing curve sets along the arc length. Without them it
moves in a straight line.
Variants§
Constant
A value without animation.
Keyframes
Values evaluated from their keyframe sequence.
Fields
keyframes: Vec<PointKeyframe>Strictly ascending keyframes.
before: ExtrapolationWhat the value does before the first keyframe. linear continues along the path’s
start tangent.
after: ExtrapolationWhat the value does after the last keyframe. linear continues along the path’s end
tangent.
Split
One animated number per axis, each with its own keyframes, curves and extrapolation, or its own data binding. The value has no spatial path of its own: it is wherever the two numbers put it.
Path(Box<MotionPath>)
A point a fraction of the way along a path.
Data(Box<DataBinding>)
A channel of a data set, followed at render time.
Implementations§
Source§impl AnimatedPoint
impl AnimatedPoint
Sourcepub fn is_valid(&self) -> bool
pub fn is_valid(&self) -> bool
Whether a project can hold this position: finite values and tangents, and keyframes that
ascend, stay within MAX_KEYFRAMES and have valid interpolations.
Sourcepub const fn keyed(keyframes: Vec<PointKeyframe>) -> Self
pub const fn keyed(keyframes: Vec<PointKeyframe>) -> Self
A position controlled by keyframes, holding before the first and after the last.
Sourcepub const fn is_animated(&self) -> bool
pub const fn is_animated(&self) -> bool
Whether the value changes over time: keyframes, split channels or data.
Sourcepub const fn data(&self) -> Option<&DataBinding>
pub const fn data(&self) -> Option<&DataBinding>
The data binding, when the whole value follows a data set. A split value’s channels
hold their own.
Trait Implementations§
Source§impl Clone for AnimatedPoint
impl Clone for AnimatedPoint
Source§impl Debug for AnimatedPoint
impl Debug for AnimatedPoint
Source§impl Default for AnimatedPoint
impl Default for AnimatedPoint
Source§impl<'de> Deserialize<'de> for AnimatedPoint
impl<'de> Deserialize<'de> for AnimatedPoint
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>,
Source§impl PartialEq for AnimatedPoint
impl PartialEq for AnimatedPoint
Source§impl Serialize for AnimatedPoint
impl Serialize for AnimatedPoint
impl StructuralPartialEq for AnimatedPoint
Source§impl TimelineValue for AnimatedPoint
impl TimelineValue for AnimatedPoint
Source§fn keep_window(&mut self, window: (i64, i64))
fn keep_window(&mut self, window: (i64, i64))
window (ticks, end exclusive): those
inside it and the nearest one on each side, or all of them when the window reaches past
an end the value does not hold at.Source§fn via_clips(&self, visit: &mut dyn FnMut(&ClipId))
fn via_clips(&self, visit: &mut dyn FnMut(&ClipId))
visit with each clip a data binding of the value reads through: the value’s own
binding, or those of its split channels.Source§fn via_clips_mut(&mut self, visit: &mut dyn FnMut(&mut ClipId))
fn via_clips_mut(&mut self, visit: &mut dyn FnMut(&mut ClipId))
Self::via_clips, to point them at other clips.