Frame.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_FRAME_HPP
12 #define CUBBYFLOW_FRAME_HPP
13 
14 namespace CubbyFlow
15 {
22 struct Frame final
23 {
25  Frame() = default;
26 
28  Frame(int newIndex, double newTimeIntervalInSeconds);
29 
31  [[nodiscard]] double TimeInSeconds() const;
32 
34  void Advance();
35 
38  void Advance(int delta);
39 
41  Frame& operator++();
42 
44  Frame operator++(int);
45 
47  int index = 0;
48 
50  double timeIntervalInSeconds = 1.0 / 60.0;
51 };
52 } // namespace CubbyFlow
53 
54 #endif
Frame & operator++()
Advances single frame (prefix).
int index
Frame index.
Definition: Frame.hpp:47
void Advance()
Advances single frame.
Definition: pybind11Utils.hpp:20
double TimeInSeconds() const
Returns the elapsed time in seconds.
double timeIntervalInSeconds
Time interval in seconds between two adjacent frames.
Definition: Frame.hpp:50
Representation of an animation frame.
Definition: Frame.hpp:22
Frame()=default
Default constructor: A Frame instance with 1/60 seconds time interval.