CommonLibVR
hkpEntity.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/H/hkArray.h"
4 #include "RE/H/hkBaseTypes.h"
5 #include "RE/H/hkRefPtr.h"
6 #include "RE/H/hkSmallArray.h"
8 #include "RE/H/hkpMaterial.h"
9 #include "RE/H/hkpWorldObject.h"
10 
11 namespace RE
12 {
13  class hkpConstraintInstance;
14  class hkLocalFrame;
15  class hkSpuCollisionCallbackUtil;
16  class hkpAction;
17  class hkpBreakableBody;
18  class hkpContactListener;
19  class hkpEntityActivationListener;
20  class hkpEntityListener;
21  class hkpSimulationIsland;
22  struct hkConstraintInternal;
23 
24  class hkpEntity : public hkpWorldObject
25  {
26  public:
27  inline static constexpr auto RTTI = RTTI_hkpEntity;
28  inline static constexpr auto VTABLE = VTABLE_hkpEntity;
29 
31  {
32  kNone = 0,
33  kContactPointAdded = 1 << 0,
34  kContactPointProcess = 1 << 1,
35  kContactPointRemoved = 1 << 2,
37  };
38 
40  {
41  public:
42  // members
43  void* data; // 00
44  std::uint16_t size; // 08
45  std::uint16_t capacityAndFlags; // 0A
46  std::uint32_t pad0C; // 0C
47  };
48  static_assert(sizeof(SmallArraySerializeOverrideType) == 0x10);
49 
51  {
52  public:
53  // members
54  hkSpuCollisionCallbackUtil* util; // 00
55  std::uint16_t capacity; // 08
57  std::uint8_t userFilter; // 0B
58  std::uint32_t pad0C; // 0C
59  };
60  static_assert(sizeof(SpuCollisionCallback) == 0x10);
61 
63  {
64  public:
65  // members
68  };
69  static_assert(sizeof(ExtendedListeners) == 0x20);
70 
71  ~hkpEntity() override; // 00
72 
73  // override (hkpWorldObject)
74  void CalcContentStatistics(hkStatisticsCollector* a_collector, const hkClass* a_class) const override; // 02
75  hkMotionState* GetMotionState() override; // 05 - { return 0; }
76 
77  // add
78  virtual void DeallocateInternalArrays(); // 06
79 
81  {
82  using func_t = decltype(&hkpEntity::AddContactListener);
83  static REL::Relocation<func_t> func{ RELOCATION_ID(60094, 60844) };
84  return func(this, a_listener);
85  }
86 
88  {
89  using func_t = decltype(&hkpEntity::RemoveContactListener);
90  static REL::Relocation<func_t> func{ RELOCATION_ID(60095, 60845) };
91  return func(this, a_listener);
92  }
93 
94  // members
96  std::uint32_t pad00C; // 0DC
98  float damageMultiplier; // 0E8
99  std::uint32_t pad01C; // 0EC
100  hkpBreakableBody* breakableBody; // 0F0
101  std::uint32_t solverData; // 0F8
103  std::uint16_t contactPointCallbackDelay; // 0FE
108  std::int8_t autoRemoveLevel; // 138
110  std::uint8_t responseModifierFlags; // 13A
111  std::uint8_t pad13B; // 13B
112  std::uint32_t uid; // 13C
119  std::uint32_t npData; // 2C0
120  std::uint32_t pad2C4; // 2C4
121  std::uint64_t pad2C8; // 2C8
122 
123  protected:
124  // Activates the entity and its island.
125  void Activate()
126  {
127  using func_t = decltype(&hkpEntity::Activate);
128  static REL::Relocation<func_t> func{ RELOCATION_ID(60096, 60849) };
129  return func(this);
130  }
131 
132  private:
133  KEEP_FOR_RE()
134  };
135  static_assert(sizeof(hkpEntity) == 0x2D0);
136 }
#define KEEP_FOR_RE()
Definition: PCH.h:713
#define RELOCATION_ID(SE, AE)
Definition: PCH.h:702
Definition: Relocation.h:210
Definition: hkArray.h:190
Definition: hkMotionState.h:11
Definition: hkpContactListener.h:12
std::uint32_t pad0C
Definition: hkpEntity.h:46
void * data
Definition: hkpEntity.h:43
std::uint16_t capacityAndFlags
Definition: hkpEntity.h:45
std::uint16_t size
Definition: hkpEntity.h:44
Definition: hkpEntity.h:25
std::uint8_t responseModifierFlags
Definition: hkpEntity.h:110
hkArray< std::uint8_t > constraintRuntime
Definition: hkpEntity.h:106
static constexpr auto RTTI
Definition: hkpEntity.h:27
SpuCollisionCallback spuCollisionCallback
Definition: hkpEntity.h:113
void AddContactListener(hkpContactListener *a_listener)
Definition: hkpEntity.h:80
void * limitContactImpulseUtilAndFlag
Definition: hkpEntity.h:97
hkSmallArray< hkpAction * > actions
Definition: hkpEntity.h:116
float damageMultiplier
Definition: hkpEntity.h:98
std::uint32_t npData
Definition: hkpEntity.h:119
ExtendedListeners * extendedListeners
Definition: hkpEntity.h:118
hkObjectIndex storageIndex
Definition: hkpEntity.h:102
hkArray< hkpConstraintInstance * > constraintsSlave
Definition: hkpEntity.h:105
std::uint8_t pad13B
Definition: hkpEntity.h:111
std::int8_t autoRemoveLevel
Definition: hkpEntity.h:108
void CalcContentStatistics(hkStatisticsCollector *a_collector, const hkClass *a_class) const override
std::uint32_t uid
Definition: hkpEntity.h:112
SpuCollisionCallbackEventFilter
Definition: hkpEntity.h:31
hkSmallArray< hkConstraintInternal > constraintsMaster
Definition: hkpEntity.h:104
hkpBreakableBody * breakableBody
Definition: hkpEntity.h:100
std::uint16_t contactPointCallbackDelay
Definition: hkpEntity.h:103
hkpMaterial material
Definition: hkpEntity.h:95
~hkpEntity() override
std::uint32_t pad00C
Definition: hkpEntity.h:96
hkMotionState * GetMotionState() override
hkRefPtr< hkLocalFrame > localFrame
Definition: hkpEntity.h:117
std::uint32_t pad2C4
Definition: hkpEntity.h:120
void Activate()
Definition: hkpEntity.h:125
hkpSimulationIsland * simulationIsland
Definition: hkpEntity.h:107
static constexpr auto VTABLE
Definition: hkpEntity.h:28
std::uint64_t pad2C8
Definition: hkpEntity.h:121
hkSmallArray< hkpContactListener * > contactListeners
Definition: hkpEntity.h:115
std::uint32_t pad01C
Definition: hkpEntity.h:99
virtual void DeallocateInternalArrays()
void RemoveContactListener(hkpContactListener *a_listener)
Definition: hkpEntity.h:87
hkpMaxSizeMotion motion
Definition: hkpEntity.h:114
std::uint32_t solverData
Definition: hkpEntity.h:101
std::uint8_t numShapeKeysInContactPointProperties
Definition: hkpEntity.h:109
Definition: hkpMaterial.h:8
Definition: hkpKeyframedRigidMotion.h:50
Definition: hkpSimulationIsland.h:16
Definition: hkpWorldObject.h:28
Definition: AbsorbEffect.h:6
std::uint16_t hkObjectIndex
Definition: hkBaseTypes.h:5
constexpr REL::ID RTTI_hkpEntity(static_cast< std::uint64_t >(689851))
constexpr std::array< REL::ID, 1 > VTABLE_hkpEntity
Definition: Offsets_VTABLE.h:14233
Definition: hkpEntity.h:63
hkSmallArray< hkpEntityListener * > entityListeners
Definition: hkpEntity.h:67
hkSmallArray< hkpEntityActivationListener * > activationListeners
Definition: hkpEntity.h:66
Definition: hkpEntity.h:51
std::uint8_t userFilter
Definition: hkpEntity.h:57
std::uint16_t capacity
Definition: hkpEntity.h:55
std::uint32_t pad0C
Definition: hkpEntity.h:58
hkSpuCollisionCallbackUtil * util
Definition: hkpEntity.h:54
stl::enumeration< SpuCollisionCallbackEventFilter, std::uint8_t > eventFilter
Definition: hkpEntity.h:56