CommonLibSSE (powerof3)
hkpBroadPhase.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/H/hkArray.h"
6 #include "RE/H/hkVector4.h"
7 
8 namespace RE
9 {
10  class hkAabb;
11  class hkCriticalSection;
12  class hkpBroadPhaseCastCollector;
13  class hkpBroadPhaseHandle;
14  class hkpBroadPhaseHandlePair;
15  class hkpCollidable;
16  struct hkAabbUint32;
17 
18  using hkpBroadPhaseAabbCache = char;
19 
21  {
22  public:
23  inline static constexpr auto RTTI = RTTI_hkpBroadPhase;
24  inline static constexpr auto VTABLE = VTABLE_hkpBroadPhase;
25 
26  enum class BroadPhaseType
27  {
28  k16Bit,
29  k32Bit,
30  kHybrid
31  };
32 
33  enum class Capabilities
34  {
35  kNone = 0,
36  kRayCast = 1 << 0,
37  kLinearCast = 1 << 1,
38  kAABBQuery = 1 << 2,
39  kClosestPoints = 1 << 3,
40  kCharProxyInt = 1 << 4,
41  kISASweepAndPrune = 1 << 12
42  };
43 
45  {
46  public:
47  // members
48  hkVector4 from; // 00
49  std::int32_t numCasts; // 10
50  std::uint32_t pad14; // 14
51  const hkVector4* toBase; // 18
52  std::int32_t toStriding; // 20
53  std::uint32_t pad24; // 24
55  };
56  static_assert(sizeof(hkpCastRayInput) == 0x30);
57 
59  {
60  public:
61  // members
62  hkVector4 from; // 00
63  hkVector4 to; // 10
66  std::uint64_t pad38; // 38
67  };
68  static_assert(sizeof(hkpCastAabbInput) == 0x40);
69 
70  ~hkpBroadPhase() override; // 00
71 
72  // add
73  virtual BroadPhaseType GetType() const = 0; // 03
74  virtual const hkpBroadPhase* GetCapabilityDelegate(Capabilities a_cap) const; // 04 - { return caps & a_cap ? this : 0; }
75  virtual void AddObject1(hkpBroadPhaseHandle* a_object, const hkAabbUint32& a_aabb, hkArray<hkpBroadPhaseHandlePair>& a_pairsOut) = 0; // 05
76  virtual void AddObject2(hkpBroadPhaseHandle* a_object, const hkAabb& a_aabb, hkArray<hkpBroadPhaseHandlePair>& a_pairsOut) = 0; // 06
77  virtual void AddObjectBatch(const hkArrayBase<hkpBroadPhaseHandle*>& a_addObjectList, const hkArrayBase<hkAabb>& a_addAabbList, hkArray<hkpBroadPhaseHandlePair>& a_newPairs) = 0; // 07
78  virtual void RemoveObject(hkpBroadPhaseHandle* a_object, hkArray<hkpBroadPhaseHandlePair>& a_pairsOut) = 0; // 08
79  virtual void RemoveObjectBatch(const hkArrayBase<hkpBroadPhaseHandle*>& a_removeObjectList, hkArray<hkpBroadPhaseHandlePair>& a_delPairsOut) = 0; // 09
80  virtual std::int32_t GetNumObjects() const = 0; // 0A
81  virtual void UpdateAabbs(hkpBroadPhaseHandle* a_objects[], const hkAabb* a_aabbs, std::int32_t a_numObjects, hkArray<hkpBroadPhaseHandlePair>& a_addedPairs, hkArray<hkpBroadPhaseHandlePair>& a_removedPairs) = 0; // 0B
82  virtual void UpdateAabbsUInt32(hkpBroadPhaseHandle* a_objects[], const hkAabbUint32* a_aabbs, std::int32_t a_numObjects, hkArray<hkpBroadPhaseHandlePair>& a_addedPairs, hkArray<hkpBroadPhaseHandlePair>& a_removedPairs) = 0; // 0C
83  virtual void Defragment() = 0; // 0D
84  virtual void CheckDeterminism(); // 0E - { return; }
85  virtual void GetAllAabbs(hkArray<hkAabb>& a_allAabbs) const = 0; // 0F
86  virtual void GetAabb(const hkpBroadPhaseHandle* a_object, hkAabb& a_aabb) const = 0; // 10
87  virtual void GetExtents(hkVector4& a_worldMinOut, hkVector4& a_worldMaxOut) const = 0; // 11
88  virtual void QuerySingleAabb(const hkAabb& a_aabb, hkArray<hkpBroadPhaseHandlePair>& a_pairsOut) const = 0; // 12
89  virtual void ReQuerySingleObject(const hkpBroadPhaseHandle* a_object, hkArray<hkpBroadPhaseHandlePair>& a_pairsOut) const = 0; // 13
90  virtual void QuerySingleAabbWithCollector(const hkAabb& a_aabb, hkpBroadPhaseCastCollector* a_collector) const = 0; // 14
91  virtual bool AreAabbsOverlapping(const hkpBroadPhaseHandle* a_bhA, const hkpBroadPhaseHandle* a_bhB) const = 0; // 15
92  virtual void ShiftAllObjects(const hkVector4& a_shiftDistance, hkVector4& a_effectiveShiftDistanceOut, hkArray<hkpBroadPhaseHandlePair>& a_newCollisionPairs) = 0; // 16
93  virtual void ShiftBroadPhase(const hkVector4& a_shiftDistance, hkVector4& a_effectiveShiftDistanceOut, hkArray<hkpBroadPhaseHandlePair>& a_newCollisionPairs) = 0; // 17
94  virtual void GetOffsetLowHigh32bit(hkVector4& a_offsetLow32bit, hkVector4& a_offsetHigh32bit) const = 0; // 18
95  virtual void CastRay(const hkpCastRayInput& a_input, hkpBroadPhaseCastCollector* a_collectorBase, std::int32_t a_collectorStriding) const = 0; // 19
96  virtual std::int32_t GetAabbCacheSize() const = 0; // 1A
97  virtual void CalcAabbCache1(const hkAabb& a_aabb, hkpBroadPhaseAabbCache* a_aabbCacheOut) const = 0; // 1B
98  virtual void CalcAabbCache2(const hkArrayBase<hkpCollidable*>& a_overlappingCollidables, hkpBroadPhaseAabbCache* a_aabbCacheOut) const = 0; // 1C
99  virtual void CastAabb(const hkpCastAabbInput& a_input, hkpBroadPhaseCastCollector& a_collector) const = 0; // 1D
100  virtual void Set32BitOffsetAndScale(const hkVector4& a_offsetLow, const hkVector4& a_offsetHigh, const hkVector4& a_scale) = 0; // 1E
101 
102  void AddObject(hkpBroadPhaseHandle* a_object, const hkAabbUint32& a_aabb, hkArray<hkpBroadPhaseHandlePair>& a_pairsOut);
103  void AddObject(hkpBroadPhaseHandle* a_object, const hkAabb& a_aabb, hkArray<hkpBroadPhaseHandlePair>& a_pairsOut);
104  void CalcAabbCache(const hkAabb& a_aabb, hkpBroadPhaseAabbCache* a_aabbCacheOut) const;
105  void CalcAabbCache(const hkArrayBase<hkpCollidable*>& a_overlappingCollidables, hkpBroadPhaseAabbCache* a_aabbCacheOut) const;
106 
107  // members
109  const std::uint16_t size{ 0 }; // 12
112  std::uint32_t pad24; // 24
113  hkCriticalSection* criticalSection; // 28
114  };
115  static_assert(sizeof(hkpBroadPhase) == 0x30);
116 }
Definition: hkAabb.h:8
Definition: hkArray.h:9
Definition: hkArray.h:190
Definition: hkMultiThreadCheck.h:6
Definition: hkReferencedObject.h:11
Definition: hkVector4.h:9
Definition: hkpBroadPhaseCastCollector.h:8
Definition: hkpBroadPhaseHandle.h:6
Definition: hkpBroadPhase.h:21
static constexpr auto VTABLE
Definition: hkpBroadPhase.h:24
virtual void GetOffsetLowHigh32bit(hkVector4 &a_offsetLow32bit, hkVector4 &a_offsetHigh32bit) const =0
virtual void GetAllAabbs(hkArray< hkAabb > &a_allAabbs) const =0
std::uint32_t pad24
Definition: hkpBroadPhase.h:112
virtual void QuerySingleAabbWithCollector(const hkAabb &a_aabb, hkpBroadPhaseCastCollector *a_collector) const =0
virtual void Defragment()=0
BroadPhaseType
Definition: hkpBroadPhase.h:27
virtual void AddObject1(hkpBroadPhaseHandle *a_object, const hkAabbUint32 &a_aabb, hkArray< hkpBroadPhaseHandlePair > &a_pairsOut)=0
const REX::EnumSet< Capabilities, std::uint32_t > caps
Definition: hkpBroadPhase.h:110
void CalcAabbCache(const hkArrayBase< hkpCollidable * > &a_overlappingCollidables, hkpBroadPhaseAabbCache *a_aabbCacheOut) const
hkCriticalSection * criticalSection
Definition: hkpBroadPhase.h:113
virtual void UpdateAabbs(hkpBroadPhaseHandle *a_objects[], const hkAabb *a_aabbs, std::int32_t a_numObjects, hkArray< hkpBroadPhaseHandlePair > &a_addedPairs, hkArray< hkpBroadPhaseHandlePair > &a_removedPairs)=0
virtual std::int32_t GetAabbCacheSize() const =0
virtual std::int32_t GetNumObjects() const =0
void CalcAabbCache(const hkAabb &a_aabb, hkpBroadPhaseAabbCache *a_aabbCacheOut) const
static constexpr auto RTTI
Definition: hkpBroadPhase.h:23
void AddObject(hkpBroadPhaseHandle *a_object, const hkAabbUint32 &a_aabb, hkArray< hkpBroadPhaseHandlePair > &a_pairsOut)
Capabilities
Definition: hkpBroadPhase.h:34
void AddObject(hkpBroadPhaseHandle *a_object, const hkAabb &a_aabb, hkArray< hkpBroadPhaseHandlePair > &a_pairsOut)
virtual void QuerySingleAabb(const hkAabb &a_aabb, hkArray< hkpBroadPhaseHandlePair > &a_pairsOut) const =0
virtual const hkpBroadPhase * GetCapabilityDelegate(Capabilities a_cap) const
virtual void RemoveObjectBatch(const hkArrayBase< hkpBroadPhaseHandle * > &a_removeObjectList, hkArray< hkpBroadPhaseHandlePair > &a_delPairsOut)=0
virtual void ReQuerySingleObject(const hkpBroadPhaseHandle *a_object, hkArray< hkpBroadPhaseHandlePair > &a_pairsOut) const =0
~hkpBroadPhase() override
virtual void RemoveObject(hkpBroadPhaseHandle *a_object, hkArray< hkpBroadPhaseHandlePair > &a_pairsOut)=0
const std::uint16_t size
Definition: hkpBroadPhase.h:109
virtual void ShiftAllObjects(const hkVector4 &a_shiftDistance, hkVector4 &a_effectiveShiftDistanceOut, hkArray< hkpBroadPhaseHandlePair > &a_newCollisionPairs)=0
virtual void CastAabb(const hkpCastAabbInput &a_input, hkpBroadPhaseCastCollector &a_collector) const =0
hkMultiThreadCheck multiThreadCheck
Definition: hkpBroadPhase.h:111
virtual void ShiftBroadPhase(const hkVector4 &a_shiftDistance, hkVector4 &a_effectiveShiftDistanceOut, hkArray< hkpBroadPhaseHandlePair > &a_newCollisionPairs)=0
virtual void CalcAabbCache2(const hkArrayBase< hkpCollidable * > &a_overlappingCollidables, hkpBroadPhaseAabbCache *a_aabbCacheOut) const =0
virtual bool AreAabbsOverlapping(const hkpBroadPhaseHandle *a_bhA, const hkpBroadPhaseHandle *a_bhB) const =0
virtual void Set32BitOffsetAndScale(const hkVector4 &a_offsetLow, const hkVector4 &a_offsetHigh, const hkVector4 &a_scale)=0
virtual void GetAabb(const hkpBroadPhaseHandle *a_object, hkAabb &a_aabb) const =0
virtual void CheckDeterminism()
virtual void UpdateAabbsUInt32(hkpBroadPhaseHandle *a_objects[], const hkAabbUint32 *a_aabbs, std::int32_t a_numObjects, hkArray< hkpBroadPhaseHandlePair > &a_addedPairs, hkArray< hkpBroadPhaseHandlePair > &a_removedPairs)=0
virtual void AddObject2(hkpBroadPhaseHandle *a_object, const hkAabb &a_aabb, hkArray< hkpBroadPhaseHandlePair > &a_pairsOut)=0
virtual BroadPhaseType GetType() const =0
virtual void GetExtents(hkVector4 &a_worldMinOut, hkVector4 &a_worldMaxOut) const =0
virtual void CastRay(const hkpCastRayInput &a_input, hkpBroadPhaseCastCollector *a_collectorBase, std::int32_t a_collectorStriding) const =0
virtual void CalcAabbCache1(const hkAabb &a_aabb, hkpBroadPhaseAabbCache *a_aabbCacheOut) const =0
virtual void AddObjectBatch(const hkArrayBase< hkpBroadPhaseHandle * > &a_addObjectList, const hkArrayBase< hkAabb > &a_addAabbList, hkArray< hkpBroadPhaseHandlePair > &a_newPairs)=0
const REX::EnumSet< BroadPhaseType, std::uint16_t > type
Definition: hkpBroadPhase.h:108
Definition: AbsorbEffect.h:6
constexpr std::array< REL::ID, 1 > VTABLE_hkpBroadPhase
Definition: Offsets_VTABLE.h:14152
char hkpBroadPhaseAabbCache
Definition: hkpBroadPhase.h:18
constexpr REL::ID RTTI_hkpBroadPhase(static_cast< std::uint64_t >(690079))
Definition: hkpBroadPhase.h:59
hkVector4 halfExtents
Definition: hkpBroadPhase.h:64
hkVector4 from
Definition: hkpBroadPhase.h:62
std::uint64_t pad38
Definition: hkpBroadPhase.h:66
hkVector4 to
Definition: hkpBroadPhase.h:63
const hkpBroadPhaseAabbCache * aabbCacheInfo
Definition: hkpBroadPhase.h:65
Definition: hkpBroadPhase.h:45
std::uint32_t pad24
Definition: hkpBroadPhase.h:53
const hkVector4 * toBase
Definition: hkpBroadPhase.h:51
std::int32_t numCasts
Definition: hkpBroadPhase.h:49
const hkpBroadPhaseAabbCache * aabbCacheInfo
Definition: hkpBroadPhase.h:54
std::uint32_t pad14
Definition: hkpBroadPhase.h:50
hkVector4 from
Definition: hkpBroadPhase.h:48
std::int32_t toStriding
Definition: hkpBroadPhase.h:52