Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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"
20
21namespace impeller {
22namespace scene {
23
24class Node;
25
26class AnimationPlayer final {
27 public:
30
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
52};
53
54} // namespace scene
55} // namespace impeller
56
57#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)
const char * name
Definition fuchsia.cc:50
Definition dart.idl:29