Flutter Engine
The Flutter Engine
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
14
15namespace impeller {
16namespace scene {
17
18class Node;
19
20class AnimationPlayer final {
21 public:
24
27
28 AnimationClip* AddAnimation(const std::shared_ptr<Animation>& animation,
29 Node* bind_target);
30
31 AnimationClip* GetClip(const std::string& name) const;
32
33 /// @brief Advanced all clips and updates animated properties in the scene.
34 void Update();
35
36 private:
37 std::unordered_map<Node*, AnimationTransforms> target_transforms_;
38
39 std::map<std::string, AnimationClip> clips_;
40
41 std::optional<TimePoint> previous_time_;
42
43 AnimationPlayer(const AnimationPlayer&) = delete;
44
46};
47
48} // namespace scene
49} // namespace impeller
50
51#endif // FLUTTER_IMPELLER_SCENE_ANIMATION_ANIMATION_PLAYER_H_
AnimationPlayer & operator=(AnimationPlayer &&)
AnimationPlayer(AnimationPlayer &&)
void Update()
Advanced all clips and updates animated properties in the scene.
AnimationClip * GetClip(const std::string &name) const
AnimationClip * AddAnimation(const std::shared_ptr< Animation > &animation, Node *bind_target)
Definition: dart.idl:29
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32