18std::unique_ptr<TranslationTimelineResolver>
20 std::vector<Vector3>
values) {
22 auto result = std::unique_ptr<TranslationTimelineResolver>(
29std::unique_ptr<RotationTimelineResolver>
31 std::vector<Quaternion>
values) {
41 std::vector<Scalar>
times,
42 std::vector<Vector3>
values) {
57 return SecondsF::zero();
64 return {.
index = 0, .lerp = 1};
67 return {.index =
times_.size() - 1, .lerp = 1};
72 Scalar previous_time = *(it - 1);
74 return {.index = index,
75 .lerp = (
time.count() - previous_time) / (next_time - previous_time)};
78TranslationTimelineResolver::TranslationTimelineResolver() =
default;
85 if (values_.empty()) {
94 target.animated_pose.translation +=
98RotationTimelineResolver::RotationTimelineResolver() =
default;
105 if (values_.empty()) {
114 target.animated_pose.rotation =
115 target.animated_pose.rotation *
119ScaleTimelineResolver::ScaleTimelineResolver() =
default;
126 if (values_.empty()) {
135 target.animated_pose.scale *=
static SkISize times(const SkISize &size, float factor)
static std::unique_ptr< RotationTimelineResolver > MakeRotationTimeline(std::vector< Scalar > times, std::vector< Quaternion > values)
static std::unique_ptr< ScaleTimelineResolver > MakeScaleTimeline(std::vector< Scalar > times, std::vector< Vector3 > values)
static std::unique_ptr< TranslationTimelineResolver > MakeTranslationTimeline(std::vector< Scalar > times, std::vector< Vector3 > values)
virtual ~PropertyResolver()
void Apply(AnimationTransforms &target, SecondsF time, Scalar weight) override
Resolve and apply the property value to a target node. This operation is additive; a given node prope...
~RotationTimelineResolver()
void Apply(AnimationTransforms &target, SecondsF time, Scalar weight) override
Resolve and apply the property value to a target node. This operation is additive; a given node prope...
std::vector< Scalar > times_
virtual ~TimelineResolver()
TimelineKey GetTimelineKey(SecondsF time)
void Apply(AnimationTransforms &target, SecondsF time, Scalar weight) override
Resolve and apply the property value to a target node. This operation is additive; a given node prope...
~TranslationTimelineResolver()
#define FML_DCHECK(condition)
std::chrono::duration< float > SecondsF
static double time(int loops, Benchmark *bench, Target *target)
Quaternion Slerp(const Quaternion &to, double time) const
constexpr Vector3 Lerp(const Vector3 &v, Scalar t) const
size_t index
The index of the closest previous keyframe.