CommonLibSSE NG
BShkbAnimationGraph.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/B/BSFixedString.h"
6 #include "RE/B/BSTArray.h"
7 #include "RE/B/BSTEvent.h"
8 #include "RE/B/BSTSmartPointer.h"
9 #include "RE/H/hkbCharacter.h"
10 
11 namespace RE
12 {
13  class bhkWorld;
14  class BSFadeNode;
15  class BShkFloatController;
16  class BSTransformDeltaEvent;
17  class hkbBehaviorGraph;
18  struct BSAnimationGraphEvent;
19  struct hkbGeneratorOutput;
20 
21  namespace BSResource
22  {
23  struct ID;
24  }
25 
27 
29  public BSIRagdollDriver, // 000
30  public BSIntrusiveRefCounted, // 008
31  public BSTEventSource<BSTransformDeltaEvent>, // 010
32  public BSTEventSource<BSAnimationGraphEvent> // 068
33  {
34  public:
35  inline static constexpr auto RTTI = RTTI_BShkbAnimationGraph;
36 
38  {
39  NiNode* node; // 00
40  uint32_t unk08;
41  uint32_t unk0C;
42  };
43 
44  ~BShkbAnimationGraph() override; // 00
45 
46  // override (BSIRagdollDriver)
47  bool HasRagdoll() override; // 01
48  bool AddRagdollToWorld() override; // 02
49  bool RemoveRagdollFromWorld() override; // 03
50  void SetWorld(bhkWorld* a_world) override; // 04 - { world = a_world; }
51  void ResetRagdoll(void) override; // 05
52  void Unk_06(void) override; // 06
54  void SetMotionType(hkpMotion::MotionType a_motionType) override; // 08
55  void Unk_09(void) override; // 09
56  void ToggleSyncOnUpdate(bool a_disable) override; // 0A
57  void Unk_0B(void) override; // 0B
58  void ToggleConstraints(bool a_disable) override; // 0C
59  void Unk_0D(void) override; // 0D
60 
61  template <class T>
62  [[nodiscard]] inline BSTEventSource<T>* GetEventSource()
63  {
64  return static_cast<BSTEventSource<T>*>(this);
65  }
66 
67  template <class T>
68  inline void AddEventSink(BSTEventSink<T>* a_eventSink)
69  {
70  GetEventSource<T>()->AddEventSink(a_eventSink);
71  }
72 
73  template <class T>
74  inline void RemoveEventSink(BSTEventSink<T>* a_eventSink)
75  {
76  GetEventSource<T>()->RemoveEventSink(a_eventSink);
77  }
78 
79  bool GetGraphVariableBool(const BSFixedString& a_variableName, bool& a_out) const
80  {
81  using func_t = decltype(&BShkbAnimationGraph::GetGraphVariableBool);
82  REL::Relocation<func_t> func{ RELOCATION_ID(62696, 63613) };
83  return func(this, a_variableName, a_out);
84  }
85 
86  bool GetGraphVariableFloat(const BSFixedString& a_variableName, float& a_out) const
87  {
88  using func_t = decltype(&BShkbAnimationGraph::GetGraphVariableFloat);
89  REL::Relocation<func_t> func{ RELOCATION_ID(62695, 63614) };
90  return func(this, a_variableName, a_out);
91  }
92 
93  bool GetGraphVariableInt(const BSFixedString& a_variableName, int& a_out) const
94  {
95  using func_t = decltype(&BShkbAnimationGraph::GetGraphVariableInt);
96  REL::Relocation<func_t> func{ RELOCATION_ID(62694, 63615) };
97  return func(this, a_variableName, a_out);
98  }
99 
100  bool SetGraphVariableBool(const BSFixedString& a_variableName, const bool a_in)
101  {
102  using func_t = decltype(&BShkbAnimationGraph::SetGraphVariableBool);
103  REL::Relocation<func_t> func{ RELOCATION_ID(63609, 62708) };
104  return func(this, a_variableName, a_in);
105  }
106 
107  bool SetGraphVariableFloat(const BSFixedString& a_variableName, const float a_in)
108  {
109  using func_t = decltype(&BShkbAnimationGraph::SetGraphVariableFloat);
110  REL::Relocation<func_t> func{ RELOCATION_ID(63608, 62709) };
111  return func(this, a_variableName, a_in);
112  }
113 
114  bool SetGraphVariableInt(const BSFixedString& a_variableName, const int a_in)
115  {
116  using func_t = decltype(&BShkbAnimationGraph::SetGraphVariableInt);
117  REL::Relocation<func_t> func{ RELOCATION_ID(63607, 62710) };
118  return func(this, a_variableName, a_in);
119  }
120 
121  // members
128  std::uint64_t unk1D8; // 1D8
129  std::uint64_t unk1E0; // 1E0
130  float interpolationTimeOffsets[2]; // 1E8
133  void* projectDBData; // 200 - BShkbHkxDB::ProjectDBData*
135  Actor* holder; // 210
137  hkbGeneratorOutput* generatorOutputs[2]; // 220
138  float interpolationAmounts[2]; // 230
140  std::uint16_t numAnimBones; // 240
141  std::uint8_t unk242; // 242
142  std::uint8_t unk243; // 243
143  std::uint16_t unk244; // 244
144  std::uint8_t unk246; // 246
145  std::uint8_t unk247; // 247
146  std::uint8_t unk248; // 248
147  std::uint8_t doFootIK; // 249
148  std::uint16_t unk24A; // 24A
149  std::uint32_t unk24C; // 24C
150  };
151  static_assert(sizeof(BShkbAnimationGraph) == 0x250);
152 }
#define RELOCATION_ID(a_se, a_ae)
Definition: PCH.h:724
Definition: Relocation.h:204
Definition: Actor.h:135
Definition: BSFadeNode.h:11
Definition: BSIRagdollDriver.h:10
Definition: BSTArray.h:377
Definition: BSTEvent.h:143
Definition: BSTEvent.h:19
Definition: BShkbAnimationGraph.h:33
void ToggleSyncOnUpdate(bool a_disable) override
BSFadeNode * rootNode
Definition: BShkbAnimationGraph.h:136
BSTSmallArray< std::uint8_t > unk1C0
Definition: BShkbAnimationGraph.h:127
std::uint8_t doFootIK
Definition: BShkbAnimationGraph.h:147
std::uint64_t unk1D8
Definition: BShkbAnimationGraph.h:128
void SetRagdollConstraintsFromBhkConstraints() override
hkbBehaviorGraph * behaviorGraph
Definition: BShkbAnimationGraph.h:134
void Unk_0B(void) override
std::uint16_t unk244
Definition: BShkbAnimationGraph.h:143
bool GetGraphVariableBool(const BSFixedString &a_variableName, bool &a_out) const
Definition: BShkbAnimationGraph.h:79
BSTArray< BoneNodeEntry > boneNodes
Definition: BShkbAnimationGraph.h:123
float interpolationAmounts[2]
Definition: BShkbAnimationGraph.h:138
void ResetRagdoll(void) override
std::uint8_t unk246
Definition: BShkbAnimationGraph.h:144
float interpolationTimeOffsets[2]
Definition: BShkbAnimationGraph.h:130
bool RemoveRagdollFromWorld() override
std::uint16_t unk24A
Definition: BShkbAnimationGraph.h:148
bool SetGraphVariableInt(const BSFixedString &a_variableName, const int a_in)
Definition: BShkbAnimationGraph.h:114
bool GetGraphVariableFloat(const BSFixedString &a_variableName, float &a_out) const
Definition: BShkbAnimationGraph.h:86
void * projectDBData
Definition: BShkbAnimationGraph.h:133
bhkWorld * physicsWorld
Definition: BShkbAnimationGraph.h:139
std::uint32_t unk24C
Definition: BShkbAnimationGraph.h:149
~BShkbAnimationGraph() override
std::uint16_t numAnimBones
Definition: BShkbAnimationGraph.h:140
BSTArray< BShkFloatController * > fadeControllers
Definition: BShkbAnimationGraph.h:124
std::uint8_t unk243
Definition: BShkbAnimationGraph.h:142
std::uint64_t unk1E0
Definition: BShkbAnimationGraph.h:129
void ToggleConstraints(bool a_disable) override
std::uint8_t unk247
Definition: BShkbAnimationGraph.h:145
BSTArray< void * > unk190
Definition: BShkbAnimationGraph.h:125
BSTSmallArray< void * > unk1A8
Definition: BShkbAnimationGraph.h:126
bool GetGraphVariableInt(const BSFixedString &a_variableName, int &a_out) const
Definition: BShkbAnimationGraph.h:93
void SetWorld(bhkWorld *a_world) override
BSFixedString projectName
Definition: BShkbAnimationGraph.h:131
bool SetGraphVariableBool(const BSFixedString &a_variableName, const bool a_in)
Definition: BShkbAnimationGraph.h:100
void Unk_09(void) override
void Unk_0D(void) override
void RemoveEventSink(BSTEventSink< T > *a_eventSink)
Definition: BShkbAnimationGraph.h:74
hkbGeneratorOutput * generatorOutputs[2]
Definition: BShkbAnimationGraph.h:137
static constexpr auto RTTI
Definition: BShkbAnimationGraph.h:35
Actor * holder
Definition: BShkbAnimationGraph.h:135
void AddEventSink(BSTEventSink< T > *a_eventSink)
Definition: BShkbAnimationGraph.h:68
BSTEventSource< T > * GetEventSource()
Definition: BShkbAnimationGraph.h:62
bool SetGraphVariableFloat(const BSFixedString &a_variableName, const float a_in)
Definition: BShkbAnimationGraph.h:107
std::uint8_t unk248
Definition: BShkbAnimationGraph.h:146
std::uint8_t unk242
Definition: BShkbAnimationGraph.h:141
bool HasRagdoll() override
void SetMotionType(hkpMotion::MotionType a_motionType) override
void Unk_06(void) override
BSResource::ID * unk1F8
Definition: BShkbAnimationGraph.h:132
bool AddRagdollToWorld() override
hkbCharacter characterInstance
Definition: BShkbAnimationGraph.h:122
Definition: NiNode.h:12
Definition: bhkWorld.h:14
Definition: hkbBehaviorGraph.h:12
Definition: hkbCharacter.h:16
MotionType
Definition: hkpMotion.h:27
Definition: AbsorbEffect.h:6
BSSmartPointer(BSAnimationGraphManager)
constexpr REL::VariantID RTTI_BShkbAnimationGraph(690023, 397882, 0x1f5baf0)
Definition: BSIntrusiveRefCounted.h:8
Definition: ID.h:10
Definition: BShkbAnimationGraph.h:38
NiNode * node
Definition: BShkbAnimationGraph.h:39
uint32_t unk08
Definition: BShkbAnimationGraph.h:40
uint32_t unk0C
Definition: BShkbAnimationGraph.h:41