CommonLibVR
hkbStateMachine.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/H/hkArray.h"
4 #include "RE/H/hkRefPtr.h"
6 #include "RE/H/hkbBindable.h"
7 #include "RE/H/hkbEvent.h"
8 #include "RE/H/hkbGenerator.h"
9 
10 namespace RE
11 {
12  class hkbStateChooser;
13 
15  {
16  public:
17  inline static constexpr auto RTTI = RTTI_hkbStateMachine;
18  inline static constexpr auto VTABLE = VTABLE_hkbStateMachine;
19 
20  enum class StartStateMode
21  {
22  kDefault = 0,
23  kSync = 1,
24  kRandom = 2,
25  kChooser = 3
26  };
27 
29  {
30  kNoTransition = 0,
33  };
34 
35  class StateInfo : public hkbBindable
36  {
37  public:
38  inline static constexpr auto RTTI = RTTI_hkbStateMachine__StateInfo;
39  inline static constexpr auto VTABLE = VTABLE_hkbStateMachine__StateInfo;
40 
41  ~StateInfo() override; // 00
42 
43  // members
44  std::uint64_t unk30; // 30
45  std::uint64_t unk38; // 38
46  std::uint64_t unk40; // 40
47  std::uint64_t unk48; // 48
48  std::uint64_t unk50; // 50
49  std::uint64_t unk58; // 58
50  std::uint64_t unk60; // 60
51  std::uint64_t unk68; // 68
52  std::uint64_t unk70; // 70
53  };
54  static_assert(sizeof(StateInfo) == 0x78);
55 
57  {
58  public:
59  inline static constexpr auto RTTI = RTTI_hkbStateMachine__TransitionInfoArray;
60  inline static constexpr auto VTABLE = VTABLE_hkbStateMachine__TransitionInfoArray;
61 
62  ~TransitionInfoArray() override; // 00
63 
64  // members
65  std::uint64_t unk10; // 10
66  std::uint64_t unk18; // 18
67  };
68  static_assert(sizeof(TransitionInfoArray) == 0x20);
69 
70  ~hkbStateMachine() override; // 00
71 
72  // override (hkbGenerator)
73  hkClass* GetClassType() const override; // 01
74  void CalcContentStatistics(hkStatisticsCollector* a_collector, const hkClass* a_class) const override; // 02
75  void Unk_03(void) override; // 03
76  void Activate(const hkbContext& a_context) override; // 04
77  void Update(const hkbContext& a_context, float a_timestep) override; // 05
78  void Unk_06(void) override; // 06
79  void Deactivate(const hkbContext& a_context) override; // 07
80  void Unk_08(void) override; // 08
81  void Unk_09(void) override; // 09
82  void Unk_0A(void) override; // 0A
83  void Unk_0C(void) override; // 0C
84  void Unk_0D(void) override; // 0D
85  void Unk_0E(void) override; // 0E
86  void Unk_0F(void) override; // 0F
87  void Unk_10(void) override; // 10
88  void Unk_11(void) override; // 11
89  void Unk_12(void) override; // 12
90  void Unk_14(void) override; // 14
91  void Generate(const hkbContext& a_context) override; // 17
92  void Unk_18(void) override; // 18 - { return 1; }
93  void UpdateSync(const hkbContext& a_context) override; // 19
94  void Unk_1B(void) override; // 1B - { echoNextUpdate = true; }
95 
96  // members
99  std::int32_t startStateID; // 068
100  std::int32_t returnToPreviousStateEventID; // 06C
101  std::int32_t randomTransitionEventID; // 070
104  std::int32_t syncVariableIndex; // 07C
105  std::int32_t currentStateID; // 080
106  bool wrapAroundStateID; // 084
107  std::int8_t maxSimultaneousTransitions; // 085
110  bool isActive; // 088
111  std::uint8_t pad41; // 089
112  std::uint16_t pad42; // 08A
113  std::uint32_t pad44; // 08C
121  float timeInState; // 0F0
122  float lastLocalTime; // 0F4
123  std::int32_t previousStateID; // 0F8
124  std::int32_t nextStartStateIndexOverride; // 0FC
126  bool echoNextUpdate; // 101
127  std::uint16_t currentStateIndexAndEntered; // 102
128  std::uint32_t pad0BC; // 104
129  private:
130  KEEP_FOR_RE()
131  };
132  static_assert(sizeof(hkbStateMachine) == 0x108);
133 }
#define KEEP_FOR_RE()
Definition: PCH.h:713
Definition: hkArray.h:190
Definition: hkRefVariant.h:9
Definition: hkReferencedObject.h:11
Definition: hkbBindable.h:13
Definition: hkbContext.h:13
Definition: hkbEvent.h:9
Definition: hkbGenerator.h:8
Definition: hkbStateMachine.h:36
std::uint64_t unk40
Definition: hkbStateMachine.h:46
std::uint64_t unk30
Definition: hkbStateMachine.h:44
std::uint64_t unk48
Definition: hkbStateMachine.h:47
static constexpr auto VTABLE
Definition: hkbStateMachine.h:39
std::uint64_t unk58
Definition: hkbStateMachine.h:49
std::uint64_t unk38
Definition: hkbStateMachine.h:45
static constexpr auto RTTI
Definition: hkbStateMachine.h:38
std::uint64_t unk60
Definition: hkbStateMachine.h:50
std::uint64_t unk50
Definition: hkbStateMachine.h:48
std::uint64_t unk68
Definition: hkbStateMachine.h:51
std::uint64_t unk70
Definition: hkbStateMachine.h:52
Definition: hkbStateMachine.h:57
std::uint64_t unk18
Definition: hkbStateMachine.h:66
std::uint64_t unk10
Definition: hkbStateMachine.h:65
static constexpr auto VTABLE
Definition: hkbStateMachine.h:60
static constexpr auto RTTI
Definition: hkbStateMachine.h:59
Definition: hkbStateMachine.h:15
stl::enumeration< StateMachineSelfTransitionMode, std::uint8_t > selfTransitionMode
Definition: hkbStateMachine.h:109
bool stateOrTransitionChanged
Definition: hkbStateMachine.h:125
void Unk_0E(void) override
~hkbStateMachine() override
hkbEvent eventToSendWhenStateOrTransitionChanges
Definition: hkbStateMachine.h:97
std::int32_t transitionToNextLowerStateEventID
Definition: hkbStateMachine.h:103
hkRefPtr< hkbStateChooser > startStateChooser
Definition: hkbStateMachine.h:98
void Unk_1B(void) override
void UpdateSync(const hkbContext &a_context) override
hkClass * GetClassType() const override
std::uint16_t pad42
Definition: hkbStateMachine.h:112
std::int8_t maxSimultaneousTransitions
Definition: hkbStateMachine.h:107
void Unk_06(void) override
void CalcContentStatistics(hkStatisticsCollector *a_collector, const hkClass *a_class) const override
void Generate(const hkbContext &a_context) override
std::int32_t syncVariableIndex
Definition: hkbStateMachine.h:104
static constexpr auto VTABLE
Definition: hkbStateMachine.h:18
hkRefVariant stateIDToIndexMap
Definition: hkbStateMachine.h:116
hkArray< hkRefVariant > wildcardTransitionFlags
Definition: hkbStateMachine.h:119
hkRefPtr< TransitionInfoArray > wildcardTransitions
Definition: hkbStateMachine.h:115
std::int32_t startStateID
Definition: hkbStateMachine.h:99
std::uint8_t pad41
Definition: hkbStateMachine.h:111
std::uint32_t pad0BC
Definition: hkbStateMachine.h:128
stl::enumeration< StartStateMode, std::uint8_t > startStateMode
Definition: hkbStateMachine.h:108
bool echoNextUpdate
Definition: hkbStateMachine.h:126
float timeInState
Definition: hkbStateMachine.h:121
bool isActive
Definition: hkbStateMachine.h:110
void Unk_08(void) override
void Unk_09(void) override
hkArray< hkRefVariant > activeTransitions
Definition: hkbStateMachine.h:117
StateMachineSelfTransitionMode
Definition: hkbStateMachine.h:29
void Unk_10(void) override
std::int32_t randomTransitionEventID
Definition: hkbStateMachine.h:101
void Unk_11(void) override
void Unk_03(void) override
float lastLocalTime
Definition: hkbStateMachine.h:122
hkArray< StateInfo * > states
Definition: hkbStateMachine.h:114
std::uint32_t pad44
Definition: hkbStateMachine.h:113
std::uint16_t currentStateIndexAndEntered
Definition: hkbStateMachine.h:127
void Unk_0C(void) override
hkArray< hkRefVariant > transitionFlags
Definition: hkbStateMachine.h:118
void Activate(const hkbContext &a_context) override
bool wrapAroundStateID
Definition: hkbStateMachine.h:106
std::int32_t transitionToNextHigherStateEventID
Definition: hkbStateMachine.h:102
void Unk_12(void) override
StartStateMode
Definition: hkbStateMachine.h:21
void Unk_14(void) override
void Unk_0D(void) override
void Unk_0A(void) override
hkArray< hkRefVariant > delayedTransitions
Definition: hkbStateMachine.h:120
std::int32_t nextStartStateIndexOverride
Definition: hkbStateMachine.h:124
void Deactivate(const hkbContext &a_context) override
std::int32_t currentStateID
Definition: hkbStateMachine.h:105
void Unk_18(void) override
void Update(const hkbContext &a_context, float a_timestep) override
std::int32_t returnToPreviousStateEventID
Definition: hkbStateMachine.h:100
static constexpr auto RTTI
Definition: hkbStateMachine.h:17
std::int32_t previousStateID
Definition: hkbStateMachine.h:123
void Unk_0F(void) override
Definition: AbsorbEffect.h:6
constexpr std::array< REL::ID, 1 > VTABLE_hkbStateMachine
Definition: Offsets_VTABLE.h:14095
constexpr REL::ID RTTI_hkbStateMachine__TransitionInfoArray(static_cast< std::uint64_t >(689757))
constexpr REL::ID RTTI_hkbStateMachine(static_cast< std::uint64_t >(689766))
constexpr std::array< REL::ID, 1 > VTABLE_hkbStateMachine__StateInfo
Definition: Offsets_VTABLE.h:14098
constexpr std::array< REL::ID, 1 > VTABLE_hkbStateMachine__TransitionInfoArray
Definition: Offsets_VTABLE.h:14099
constexpr REL::ID RTTI_hkbStateMachine__StateInfo(static_cast< std::uint64_t >(689759))