forked from flutter-team-archive/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanimation_player.h
More file actions
52 lines (37 loc) · 1.24 KB
/
Copy pathanimation_player.h
File metadata and controls
52 lines (37 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#pragma once
#include <memory>
#include <optional>
#include <unordered_map>
#include <vector>
#include "flutter/fml/hash_combine.h"
#include "flutter/fml/macros.h"
#include "flutter/fml/time/time_delta.h"
#include "impeller/base/timing.h"
#include "impeller/geometry/matrix.h"
#include "impeller/scene/animation/animation_clip.h"
namespace impeller {
namespace scene {
class Node;
class AnimationPlayer final {
public:
AnimationPlayer();
~AnimationPlayer();
AnimationPlayer(AnimationPlayer&&);
AnimationPlayer& operator=(AnimationPlayer&&);
AnimationClip& AddAnimation(std::shared_ptr<Animation> animation,
Node* bind_target);
/// @brief Advanced all clips and updates animated properties in the scene.
void Update();
/// @brief Reset all bound animation target transforms.
void Reset();
private:
std::unordered_map<Node*, Matrix> default_target_transforms_;
std::vector<AnimationClip> clips_;
std::optional<TimePoint> previous_time_;
FML_DISALLOW_COPY_AND_ASSIGN(AnimationPlayer);
};
} // namespace scene
} // namespace impeller