| Flutter Impeller |

animation_player.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #pragma once
6
7 #include <map>
8 #include <memory>
9 #include <optional>
10 #include <vector>
11
12 #include "flutter/fml/hash_combine.h"
13 #include "flutter/fml/macros.h"
14 #include "flutter/fml/time/time_delta.h"
15 #include "impeller/base/timing.h"
16 #include "impeller/geometry/matrix.h"
17 #include "impeller/geometry/matrix_decomposition.h"
18 #include "impeller/scene/animation/animation_clip.h"
19
20 namespace impeller {
21 namespace scene {
22
23 class Node;
24
25 class AnimationPlayer final {
26 public:
27 AnimationPlayer();
28 ~AnimationPlayer();
29
30 AnimationPlayer(AnimationPlayer&&);
31 AnimationPlayer& operator=(AnimationPlayer&&);
32
33 AnimationClip* AddAnimation(const std::shared_ptr<Animation>& animation,
34 Node* bind_target);
35
36 AnimationClip* GetClip(const std::string& name) const;
37
38 /// @brief Advanced all clips and updates animated properties in the scene.
39 void Update();
40
41 private:
42 std::unordered_map<Node*, AnimationTransforms> target_transforms_;
43
44 std::map<std::string, AnimationClip> clips_;
45
46 std::optional<TimePoint> previous_time_;
47
48 FML_DISALLOW_COPY_AND_ASSIGN(AnimationPlayer);
49 };
50
51 } // namespace scene
52 } // namespace impeller
timing.h
impeller::scene::AnimationPlayer::AddAnimation
AnimationClip * AddAnimation(const std::shared_ptr< Animation > &animation, Node *bind_target)
Definition: animation_player.cc:23
impeller::scene::AnimationPlayer::Update
void Update()
Advanced all clips and updates animated properties in the scene.
Definition: animation_player.cc:56
impeller::scene::AnimationPlayer::~AnimationPlayer
~AnimationPlayer()
impeller::scene::AnimationClip
Definition: animation_clip.h:21
matrix.h
animation_clip.h
impeller::scene::AnimationPlayer::AnimationPlayer
AnimationPlayer()
impeller::scene::AnimationPlayer
Definition: animation_player.h:25
impeller::scene::AnimationPlayer::GetClip
AnimationClip * GetClip(const std::string &name) const
Definition: animation_player.cc:48
impeller::scene::Node
Definition: node.h:29
matrix_decomposition.h
impeller::scene::AnimationPlayer::operator=
AnimationPlayer & operator=(AnimationPlayer &&)
impeller
Definition: aiks_context.cc:10