Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
impeller::scene::RotationTimelineResolver Class Referencefinal

#include <property_resolver.h>

Inheritance diagram for impeller::scene::RotationTimelineResolver:
impeller::scene::TimelineResolver impeller::scene::PropertyResolver

Public Member Functions

 ~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 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 ()
 
virtual SecondsF GetEndTime ()=0
 
virtual void Apply (AnimationTransforms &target, SecondsF time, Scalar weight)=0
 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...
 

Additional Inherited Members

- Static Public Member Functions inherited from impeller::scene::PropertyResolver
static std::unique_ptr< TranslationTimelineResolverMakeTranslationTimeline (std::vector< Scalar > times, std::vector< Vector3 > values)
 
static std::unique_ptr< RotationTimelineResolverMakeRotationTimeline (std::vector< Scalar > times, std::vector< Quaternion > values)
 
static std::unique_ptr< ScaleTimelineResolverMakeScaleTimeline (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< Scalartimes_
 

Detailed Description

Definition at line 95 of file property_resolver.h.

Constructor & Destructor Documentation

◆ ~RotationTimelineResolver()

impeller::scene::RotationTimelineResolver::~RotationTimelineResolver ( )
default

Member Function Documentation

◆ Apply()

void impeller::scene::RotationTimelineResolver::Apply ( AnimationTransforms target,
SecondsF  time,
Scalar  weight 
)
overridevirtual

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 102 of file property_resolver.cc.

104 {
105 if (values_.empty()) {
106 return;
107 }
108 auto key = GetTimelineKey(time);
109 auto value = values_[key.index];
110 if (key.lerp < 1) {
111 value = values_[key.index - 1].Slerp(value, key.lerp);
112 }
113
114 target.animated_pose.rotation =
115 target.animated_pose.rotation *
116 Quaternion().Slerp(target.bind_pose.rotation.Invert() * value, weight);
117}
TimelineKey GetTimelineKey(SecondsF time)
uint8_t value
uint32_t * target
static double time(int loops, Benchmark *bench, Target *target)
Definition: nanobench.cpp:394

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