| 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 #ifndef FLUTTER_IMPELLER_SCENE_ANIMATION_ANIMATION_PLAYER_H_
6 #define FLUTTER_IMPELLER_SCENE_ANIMATION_ANIMATION_PLAYER_H_
7
8 #include <map>
9 #include <memory>
10 #include <optional>
11 #include <vector>
12
13 #include "flutter/fml/hash_combine.h"
14 #include "flutter/fml/macros.h"
15 #include "flutter/fml/time/time_delta.h"
16 #include "impeller/base/timing.h"
17 #include "impeller/geometry/matrix.h"
18 #include "impeller/geometry/matrix_decomposition.h"
19 #include "impeller/scene/animation/animation_clip.h"
20
21 namespace impeller {
22 namespace scene {
23
24 class Node;
25
26 class AnimationPlayer final {
27 public:
28 AnimationPlayer();
29 ~AnimationPlayer();
30
31 AnimationPlayer(AnimationPlayer&&);
32 AnimationPlayer& operator=(AnimationPlayer&&);
33
34 AnimationClip* AddAnimation(const std::shared_ptr<Animation>& animation,
35 Node* bind_target);
36
37 AnimationClip* GetClip(const std::string& name) const;
38
39 /// @brief Advanced all clips and updates animated properties in the scene.
40 void Update();
41
42 private:
43 std::unordered_map<Node*, AnimationTransforms> target_transforms_;
44
45 std::map<std::string, AnimationClip> clips_;
46
47 std::optional<TimePoint> previous_time_;
48
49 AnimationPlayer(const AnimationPlayer&) = delete;
50
51 AnimationPlayer& operator=(const AnimationPlayer&) = delete;
52 };
53
54 } // namespace scene
55 } // namespace impeller
56
57 #endif // FLUTTER_IMPELLER_SCENE_ANIMATION_ANIMATION_PLAYER_H_
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:22
matrix.h
animation_clip.h
impeller::scene::AnimationPlayer::AnimationPlayer
AnimationPlayer()
impeller::scene::AnimationPlayer
Definition: animation_player.h:26
impeller::scene::AnimationPlayer::GetClip
AnimationClip * GetClip(const std::string &name) const
Definition: animation_player.cc:48
impeller::scene::Node
Definition: node.h:30
matrix_decomposition.h
impeller::scene::AnimationPlayer::operator=
AnimationPlayer & operator=(AnimationPlayer &&)
impeller
Definition: aiks_context.cc:10