Skip to content

Commit adc8582

Browse files
committed
feat: BipedAnim
1 parent 1700d0c commit adc8582

2 files changed

Lines changed: 106 additions & 41 deletions

File tree

CommonLibF4/include/RE/Bethesda/TESObjectREFRs.h

Lines changed: 105 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#include "RE/Bethesda/BGSInventoryItem.h"
44
#include "RE/Bethesda/BSFixedString.h"
5+
#include "RE/Bethesda/BSModelDB.h"
56
#include "RE/Bethesda/BSSoundHandle.h"
67
#include "RE/Bethesda/BSStringT.h"
78
#include "RE/Bethesda/BSTArray.h"
@@ -229,6 +230,26 @@ namespace RE
229230
};
230231
static_assert(sizeof(SimpleAnimationGraphManagerHolder) == 0x18);
231232

233+
class __declspec(novtable) WeaponAnimationGraphManagerHolder :
234+
public IAnimationGraphManagerHolder,
235+
public BSTEventSink<BSAnimationGraphEvent>,
236+
public BSIntrusiveRefCounted
237+
{
238+
public:
239+
static constexpr auto RTTI{ RTTI::WeaponAnimationGraphManagerHolder };
240+
static constexpr auto VTABLE{ VTABLE::WeaponAnimationGraphManagerHolder };
241+
242+
virtual ~WeaponAnimationGraphManagerHolder() = default; // 00
243+
244+
// override (BSTEventSink<BSAnimationGraphEvent>)
245+
BSEventNotifyControl ProcessEvent(const BSAnimationGraphEvent& a_event, BSTEventSource<BSAnimationGraphEvent>* a_eventSource) override;
246+
247+
// members
248+
BSTSmartPointer<BSAnimationGraphManager> animationGraphManager; // 08
249+
ObjectRefHandle owner; // 10
250+
};
251+
static_assert(sizeof(WeaponAnimationGraphManagerHolder) == 0x28);
252+
232253
class BGSEquipIndex
233254
{
234255
public:
@@ -387,49 +408,77 @@ namespace RE
387408
enum class BIPED_OBJECT
388409
{
389410
kNone = static_cast<std::underlying_type_t<BIPED_OBJECT>>(-1),
390-
391-
kEditorCount = 0x20,
392-
393-
kWeaponHand = kEditorCount,
394-
kWeaponSword = 0x21,
395-
kWeaponDagger = 0x22,
396-
kWeaponAxe = 0x23,
397-
kWeaponMace = 0x24,
398-
kWeaponTwoHandMelee = 0x25,
399-
kWeaponBow = 0x26,
400-
kWeaponStaff = 0x27,
401-
kQuiver = 0x28,
402-
kWeaponGun = 0x29,
403-
kWeaponGrenade = 0x2A,
404-
kWeaponMine = 0x2B,
405-
406-
kTotal = 0x2C
411+
kHairTop = 0,
412+
kHairLong = 1,
413+
kFaceGenHead = 2,
414+
kBody = 3,
415+
kLeftHand = 4,
416+
kRightHand = 5,
417+
kUnderTorso = 6,
418+
kUnderLeftArm = 7,
419+
kUnderRightArm = 8,
420+
kUnderLeftLeg = 9,
421+
kUnderRightLeg = 10,
422+
kAboveTorso = 11,
423+
kAboveLeftArm = 12,
424+
kAboveRightArm = 13,
425+
kAboveLeftLeg = 14,
426+
kAboveRightLeg = 15,
427+
kHeadband = 16,
428+
kEyes = 17,
429+
kBeard = 18,
430+
kMouth = 19,
431+
kNeck = 20,
432+
kRing = 21,
433+
kScalp = 22,
434+
kDecapitation = 23,
435+
kUnnamed1 = 24,
436+
kUnnamed2 = 25,
437+
kUnnamed3 = 26,
438+
kUnnamed4 = 27,
439+
kUnnamed5 = 28,
440+
kShield = 29,
441+
kPipboy = 30,
442+
kFX = 31,
443+
444+
kEditorTotal = 32,
445+
446+
kWeaponHand = kEditorTotal,
447+
kWeaponSword = 33,
448+
kWeaponDagger = 34,
449+
kWeaponAxe = 35,
450+
kWeaponMace = 36,
451+
kWeaponTwoHandMelee = 37,
452+
kWeaponBow = 38,
453+
kWeaponStaff = 39,
454+
kQuiver = 40,
455+
kWeaponGun = 41,
456+
kWeaponGrenade = 42,
457+
kWeaponMine = 43,
458+
459+
kTotal = 44
407460
};
408461

409462
struct BIPOBJECT
410463
{
411464
public:
412-
~BIPOBJECT();
465+
//~BIPOBJECT()
466+
//{
467+
// Dtor();
468+
// stl::memzero(this);
469+
//}
413470

414471
// members
415-
BGSObjectInstance parent; // 00
416-
BGSObjectInstanceExtra* modExtra; // 10
417-
TESObjectARMA* armorAddon; // 18
418-
TESModel* part; // 20
419-
BGSTextureSet* skinTexture; // 28
420-
NiPointer<NiAVObject> partClone; // 30
421-
void* handleList; // 38 - TODO: BSModelDB::HandleListHead
422-
union
423-
{
424-
std::byte spare40;
425-
BSTSmartPointer<WeaponAnimationGraphManagerHolder> objectGraphManager;
426-
}; // 40 - TODO
427-
union
428-
{
429-
std::byte spare48;
430-
NiPointer<ModelReferenceEffect> hitEffect;
431-
}; // 48 - TODO
432-
bool skinned; // 50
472+
BGSObjectInstance parent; // 00
473+
BGSObjectInstanceExtra* modExtra; // 10
474+
TESObjectARMA* armorAddon; // 18
475+
TESModel* part; // 20
476+
BGSTextureSet* skinTexture; // 28
477+
NiPointer<NiAVObject> partClone; // 30
478+
BSModelDB::HandelListHead handleList; // 38
479+
BSTSmartPointer<WeaponAnimationGraphManagerHolder> objectGraphManager; // 40
480+
NiPointer<ModelReferenceEffect> hitEffect; // 48
481+
bool skinned; // 50
433482

434483
private:
435484
void Dtor()
@@ -445,6 +494,26 @@ namespace RE
445494
public BSIntrusiveRefCounted // 0000
446495
{
447496
public:
497+
const BIPOBJECT* GetBipObject(const BIPED_OBJECT a_bipedObject) const
498+
{
499+
return std::addressof(object[std::to_underlying(a_bipedObject)]);
500+
}
501+
502+
BIPOBJECT* GetBipObject(const BIPED_OBJECT a_bipedObject)
503+
{
504+
return std::addressof(object[std::to_underlying(a_bipedObject)]);
505+
}
506+
507+
ObjectRefHandle GetRequester() const
508+
{
509+
return actorRef;
510+
}
511+
512+
NiNode* GetRoot() const
513+
{
514+
return root;
515+
}
516+
448517
// members
449518
NiNode* root; // 0008
450519
BIPOBJECT object[std::to_underlying(BIPED_OBJECT::kTotal)]; // 0010

CommonLibF4/src/RE/Bethesda/TESObjectREFRs.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,5 @@
44

55
namespace RE
66
{
7-
BIPOBJECT::~BIPOBJECT()
8-
{
9-
Dtor();
10-
stl::memzero(this);
11-
}
7+
128
}

0 commit comments

Comments
 (0)