Animation.hpp
Go to the documentation of this file.
1 // This code is based on Jet framework.
2 // Copyright (c) 2018 Doyub Kim
3 // CubbyFlow is voxel-based fluid simulation engine for computer games.
4 // Copyright (c) 2020 CubbyFlow Team
5 // Core Part: Chris Ohk, Junwoo Hwang, Jihong Sin, Seungwoo Yoo
6 // AI Part: Dongheon Cho, Minseo Kim
7 // We are making my contributions/submissions to this project solely in our
8 // personal capacity and are not conveying any rights to any intellectual
9 // property of any third parties.
10 
11 #ifndef CUBBYFLOW_ANIMATION_HPP
12 #define CUBBYFLOW_ANIMATION_HPP
13 
14 #include <Core/Animation/Frame.hpp>
15 
16 #include <memory>
17 
18 namespace CubbyFlow
19 {
28 class Animation
29 {
30  public:
32  Animation() = default;
33 
35  Animation(const Animation&) = default;
36 
38  Animation(Animation&&) noexcept = default;
39 
41  virtual ~Animation() = default;
42 
44  Animation& operator=(const Animation&) = default;
45 
47  Animation& operator=(Animation&&) noexcept = default;
48 
55  void Update(const Frame& frame);
56 
57  protected:
66  virtual void OnUpdate(const Frame& frame) = 0;
67 };
68 
70 using AnimationPtr = std::shared_ptr<Animation>;
71 } // namespace CubbyFlow
72 
73 #endif
virtual ~Animation()=default
Default virtual destructor.
void Update(const Frame &frame)
Updates animation state for given frame.
Definition: pybind11Utils.hpp:20
virtual void OnUpdate(const Frame &frame)=0
The implementation of this function should update the animation state for given Frame instance frame...
std::shared_ptr< Animation > AnimationPtr
Shared pointer for the Animation type.
Definition: Animation.hpp:70
Abstract base class for animation-related class.
Definition: Animation.hpp:28
Animation & operator=(const Animation &)=default
Default copy assignment operator.
Representation of an animation frame.
Definition: Frame.hpp:22
Animation()=default
Default constructor.