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