CommonLibSSE (powerof3)
NiTimeController.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/N/NiObject.h"
4 #include "RE/N/NiSmartPointer.h"
5 
6 namespace RE
7 {
8  class NiObjectNET;
9 
11 
12  class NiTimeController : public NiObject
13  {
14  public:
15  inline static constexpr auto RTTI = RTTI_NiTimeController;
16  inline static constexpr auto Ni_RTTI = NiRTTI_NiTimeController;
17 
18  enum class CycleType
19  {
20  kLoop,
21  kReverse,
22  kClamp,
23 
24  kTotal
25  };
26 
27  enum class Flag
28  {
29  kAnimType_AppTime = 0 << 0,
30  kAnimType_AppInit = 1 << 0,
31  kAnimType_Mask = 1,
32 
33  kCycleType_Loop = 0 << 1,
34  kCycleType_Reverse = 1 << 1,
35  kCycleType_Clamp = 2 << 1,
36  kCycleType_Mask = 6,
37 
38  kActive = 1 << 3,
39  kPlayBackwards = 1 << 4,
40  kManagerControlled = 1 << 5,
41  kComputeScaledTime = 1 << 6,
42  kForceUpdate = 1 << 7
43  };
44 
45  inline NiTimeController() { ctor(); }
46  ~NiTimeController() override { dtor(); } // 00
47 
48  // override (NiObject)
49  const NiRTTI* GetRTTI() const override; // 02
50  void LoadBinary(NiStream& a_stream) override; // 18
51  void LinkObject(NiStream& a_stream) override; // 19
52  bool RegisterStreamables(NiStream& a_stream) override; // 1A
53  void SaveBinary(NiStream& a_stream) override; // 1B
54  bool IsEqual(NiObject* a_object) override; // 1C
55  void ProcessClone(NiCloningProcess& a_cloning) override; // 1D
56 
57  // add
58  virtual void Start(float a_time); // 25
59  virtual void Stop(); // 26
60  virtual void Update(float a_time) = 0; // 27
61  virtual void SetTarget(NiObjectNET* a_target); // 28
62  [[nodiscard]] virtual bool IsTransformController() const { return false; } // 29
63  [[nodiscard]] virtual bool IsVertexController() const { return false; } // 2A
64  virtual float ComputeScaledTime(float a_time); // 2B
65  virtual void OnPreDisplay() { return; } // 2C
66  [[nodiscard]] virtual bool IsStreamable() const { return true; } // 2D
67  [[nodiscard]] virtual bool TargetIsRequiredType() const = 0; // 2E
68 
69  [[nodiscard]] constexpr NiTimeController* GetNext() const noexcept { return next.get(); }
70 
71  // members
73  std::uint16_t pad12; // 12
74  float frequency; // 14
75  float phase; // 18
76  float loKeyTime; // 1C
77  float hiKeyTime; // 20
78  float startTime; // 24
79  float lastTime; // 28
80  float weightedLastTime; // 2C
81  float scaledTime; // 30
82  std::uint32_t pad34; // 34
84  NiPointer<NiTimeController> next; // 40 - singly-linked list
85 
86  private:
87  NiTimeController* ctor();
88  void dtor();
89  };
90  static_assert(sizeof(NiTimeController) == 0x48);
91 }
Definition: NiObjectNET.h:13
Definition: NiObject.h:37
Definition: NiSmartPointer.h:9
Definition: NiRTTI.h:6
Definition: NiStream.h:6
Definition: NiTimeController.h:13
float hiKeyTime
Definition: NiTimeController.h:77
virtual bool TargetIsRequiredType() const =0
void SaveBinary(NiStream &a_stream) override
float weightedLastTime
Definition: NiTimeController.h:80
virtual void Stop()
const NiRTTI * GetRTTI() const override
virtual void SetTarget(NiObjectNET *a_target)
std::uint16_t pad12
Definition: NiTimeController.h:73
virtual float ComputeScaledTime(float a_time)
Flag
Definition: NiTimeController.h:28
virtual void OnPreDisplay()
Definition: NiTimeController.h:65
float phase
Definition: NiTimeController.h:75
float startTime
Definition: NiTimeController.h:78
virtual void Start(float a_time)
virtual bool IsTransformController() const
Definition: NiTimeController.h:62
float frequency
Definition: NiTimeController.h:74
float lastTime
Definition: NiTimeController.h:79
static constexpr auto RTTI
Definition: NiTimeController.h:15
void LinkObject(NiStream &a_stream) override
static constexpr auto Ni_RTTI
Definition: NiTimeController.h:16
CycleType
Definition: NiTimeController.h:19
std::uint32_t pad34
Definition: NiTimeController.h:82
void LoadBinary(NiStream &a_stream) override
NiTimeController()
Definition: NiTimeController.h:45
virtual bool IsStreamable() const
Definition: NiTimeController.h:66
stl::enumeration< Flag, std::uint16_t > flags
Definition: NiTimeController.h:72
float scaledTime
Definition: NiTimeController.h:81
float loKeyTime
Definition: NiTimeController.h:76
bool IsEqual(NiObject *a_object) override
void ProcessClone(NiCloningProcess &a_cloning) override
~NiTimeController() override
Definition: NiTimeController.h:46
NiObjectNET * target
Definition: NiTimeController.h:83
bool RegisterStreamables(NiStream &a_stream) override
virtual void Update(float a_time)=0
NiPointer< NiTimeController > next
Definition: NiTimeController.h:84
virtual bool IsVertexController() const
Definition: NiTimeController.h:63
constexpr NiTimeController * GetNext() const noexcept
Definition: NiTimeController.h:69
Definition: AbsorbEffect.h:6
constexpr REL::ID RTTI_NiTimeController
Definition: Offsets_RTTI.h:5627
NiSmartPointer(Actor)
constexpr REL::ID NiRTTI_NiTimeController
Definition: Offsets_NiRTTI.h:305