| Flutter Impeller |

Public Member Functions | List of all members
impeller::scene::TranslationTimelineResolver Class Referencefinal

`#include <property_resolver.h>`

Inheritance diagram for impeller::scene::TranslationTimelineResolver:

## Public Member Functions
| ~TranslationTimelineResolver ()
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 property may be amended by many different PropertyResolvers prior to rendering. For example, an AnimationPlayer may blend multiple Animations together by applying several AnimationClips. More...
Public Member Functions inherited from impeller::scene::TimelineResolver
virtual | ~TimelineResolver ()
SecondsF | GetEndTime ()
Public Member Functions inherited from impeller::scene::PropertyResolver
virtual | ~PropertyResolver ()

## Additional Inherited Members
Static Public Member Functions inherited from impeller::scene::PropertyResolver
static std::unique_ptr< TranslationTimelineResolver > | MakeTranslationTimeline (std::vector< Scalar > times, std::vector< Vector3 > values)
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)
Protected Member Functions inherited from impeller::scene::TimelineResolver
TimelineKey | GetTimelineKey (SecondsF time)
Protected Attributes inherited from impeller::scene::TimelineResolver
std::vector< Scalar > | times_

## Detailed Description

Definition at line 77 of file property_resolver.h.

## Constructor & Destructor Documentation

## ◆ ~TranslationTimelineResolver()

impeller::scene::TranslationTimelineResolver::~TranslationTimelineResolver | ( |  | ) |
| default

## Member Function Documentation

## ◆ Apply()

void impeller::scene::TranslationTimelineResolver::Apply | ( | AnimationTransforms & | target,
|  | SecondsF | time,
|  | Scalar | weight
| ) |  |
| override virtual

Resolve and apply the property value to a target node. This operation is additive; a given node property may be amended by many different PropertyResolvers prior to rendering. For example, an AnimationPlayer may blend multiple Animations together by applying several AnimationClips.

Implements impeller::scene::PropertyResolver.

Definition at line 82 of file property_resolver.cc.

84 {
85 if (values_.empty()) {
86 return;
87 }
88 auto key = GetTimelineKey(time);
89 auto value = values_[key.index];
90 if (key.lerp < 1) {
91 value = values_[key.index - 1].Lerp(value, key.lerp);
92 }
93
94 target.animated_pose.translation +=
95 (value - target.bind_pose.translation) * weight;
96 }

References impeller::scene::AnimationTransforms::animated_pose, impeller::scene::AnimationTransforms::bind_pose, impeller::scene::TimelineResolver::GetTimelineKey(), and impeller::MatrixDecomposition::translation.

The documentation for this class was generated from the following files:

- impeller/scene/animation/property_resolver.h
- impeller/scene/animation/property_resolver.cc

impeller::scene::TimelineResolver::GetTimelineKey
TimelineKey GetTimelineKey(SecondsF time)
Definition: property_resolver.cc:62