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