Sleeping Wombat Common Library  0.50.0
swCommonLibrary
RelativeTimeline.h
Go to the documentation of this file.
1 #pragma once
2 
8 #include "TimelineBase.h"
9 #include "TimelineTypes.h"
10 
11 
14 {
15 private:
16 protected:
17  TimeType m_offset;
18  TimeType m_duration;
19  float m_factor;
20  WrapMode m_preWrap;
21  WrapMode m_postWrap;
22 
23  bool m_isStarted;
24  bool m_isPaused;
25 
26 public:
27  explicit RelativeTimeline ();
28  explicit RelativeTimeline ( TimelineBasePtr parent );
29  virtual ~RelativeTimeline () = default;
30 
31  void SetPreWrap ( WrapMode mode );
32  void SetPostWrap ( WrapMode mode );
33  void SetDuration ( TimeType duration );
34 
35  WrapMode GetPreWrap () { return m_preWrap; }
36  WrapMode GetPostWrap () { return m_postWrap; }
37  TimeType GetDuration () { return m_duration; }
38 
39  // Inherited via TimelineBase
40  virtual void Update () override;
41  virtual void Start () override;
42  virtual void Stop () override;
43  virtual void Pause () override;
44 
45  virtual void SetTimeline ( TimelineBasePtr& parent ) override;
46  virtual bool IsPaused () override;
47 
48 protected:
49  TimeType EvalTime ( TimeType parentTime );
50  TimeType EvalElapsedTime ( TimeType parentTime );
51 };
52 
53 DEFINE_PTR_TYPE( RelativeTimeline );
54 DEFINE_WPTR_TYPE( RelativeTimeline );
55 
56 
Base class for timelines.
Definition: TimelineBase.h:26
Definition: RelativeTimeline.h:13
TimeType m_offset
Offset relative to parent.
Definition: RelativeTimeline.h:17
TimeType m_duration
Time after which timeline will be wrapped.
Definition: RelativeTimeline.h:18
float m_factor
Enables slow motion.
Definition: RelativeTimeline.h:19