CommonLibSSE NG
hkpShape.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include "RE/H/hkSseMathTypes.h"
5 #include "RE/H/hkpShapeBuffer.h"
6 #include "RE/H/hkpShapeType.h"
7 
8 namespace RE
9 {
10  class bhkShape;
11  class hkAabb;
12  class hkSphere;
13  class hkTransform;
14  class hkpCdBody;
15  class hkpCdVertex;
16  class hkpConvexShape;
17  class hkpRayHitCollector;
18  class hkpShapeContainer;
19  class hkpShapeRayBundleCastInput;
20  class hkpShapeRayBundleCastOutput;
21  class hkVector4;
22  struct hkpShapeRayCastInput;
23  struct hkpShapeRayCastOutput;
24 
25  using hkpVertexID = std::uint16_t;
26  constexpr hkpVertexID HK_INVALID_VERTEX_ID = static_cast<hkpVertexID>(-1);
27 
28  using hkpShapeKey = std::uint32_t;
29  constexpr hkpShapeKey HK_INVALID_SHAPE_KEY = static_cast<hkpShapeKey>(-1);
30 
32  {
33  public:
34  inline static constexpr auto RTTI = RTTI_hkpShape;
35  inline static constexpr auto VTABLE = VTABLE_hkpShape;
36 
37  using GetSupportingVertexFunc = void(const void* a_this, const hkVector4& a_direction, hkpCdVertex& a_supportVertex);
38  using ConvertVertexIdsToVerticesFunc = void(const void* a_this, const hkpVertexID* a_ids, std::int32_t a_numIDs, class hkpCdVertex* a_verticesOut);
39  using WeldContactPointFunc = std::int32_t(const void* a_this, hkpVertexID* a_featurePoints, std::uint8_t& a_numFeaturePoints, hkVector4& a_contactPointWs, const hkTransform* a_thisTransform, const hkpConvexShape* a_collidingShape, const hkTransform* a_collidingTransform, hkVector4& a_separatingNormalInOut);
40  using GetCentreFunc = void(const void* a_this, hkVector4& a_centreOut);
41  using GetNumCollisionSpheresFunc = std::int32_t(const void* a_this);
42  using GetCollisionSpheresFunc = const hkSphere*(const void* a_this, hkSphere* a_sphereBuffer);
43  using GetAabbFunc = void(const void* a_this, const hkTransform& a_localToWorld, float a_tolerance, hkAabb& a_out);
44  using CastRayFunc = bool(const void* a_this, const hkpShapeRayCastInput& a_input, hkpShapeRayCastOutput& a_output);
45  using CastRayWithCollectorFunc = void(const void* a_this, const hkpShapeRayCastInput& a_input, const hkpCdBody& a_cdBody, hkpRayHitCollector& a_collector);
46  using CastRayBundleFunc = hkVector4Comparison(const void* a_this, const hkpShapeRayBundleCastInput& a_input, hkpShapeRayBundleCastOutput& a_output, const hkVector4Comparison& a_mask);
47  using GetChildShapeFunc = const hkpShape*(const void* a_this, hkpShapeKey a_key, hkpShapeBuffer& a_buffer);
48  using GetCollisionFilterInfoFunc = std::uint32_t(const void* a_this, hkpShapeKey a_key);
49 
51  {
52  public:
53  // members
55  bool isFixedOrKeyframed; // 1
57  };
58  static_assert(sizeof(CalcSizeForSpuInput) == 0x3);
59 
60  struct ShapeFuncs
61  {
62  public:
63  // members
76  };
77  static_assert(sizeof(ShapeFuncs) == 0x60);
78 
79  struct ShapeFuncs2
80  {
81  public:
82  // members
95  std::uint64_t pad60; // 60
96  std::uint64_t pad68; // 68
97  std::uint64_t pad70; // 70
98  std::uint64_t pad78; // 78
99  };
100  static_assert(sizeof(ShapeFuncs2) == 0x80);
101 
102  using RegsiterFunc = void(ShapeFuncs& a_sf);
103 
104  ~hkpShape() override; // 00
105 
106  // add
107  virtual float GetMaximumProjection(const hkVector4& a_direction) const; // 03
108  virtual const hkpShapeContainer* GetContainer() const; // 04 - { return 0; }
109  virtual bool IsConvex() const; // 05 - { return false; }
110  virtual std::int32_t CalcSizeForSpu(const CalcSizeForSpuInput& a_input, std::int32_t a_spuBufferSizeLeft) const; // 06 - { return -1; }
111  virtual void GetAabbImpl(const hkTransform& a_localToWorld, float a_tolerance, hkAabb& a_out) const = 0; // 07
112  virtual bool CastRayImpl(const hkpShapeRayCastInput& a_input, hkpShapeRayCastOutput& a_output) const = 0; // 08
113  virtual void CastRayWithCollectorImpl(const hkpShapeRayCastInput& a_input, const hkpCdBody& a_cdBody, hkpRayHitCollector& a_collector) const = 0; // 09
114  virtual hkVector4Comparison CastRayBundleImpl(const hkpShapeRayBundleCastInput& a_input, hkpShapeRayBundleCastOutput& a_output, const hkVector4Comparison& a_mask) const; // 0A
115 
116  // members
119  std::uint32_t pad1C; // 1C
120  };
121  static_assert(sizeof(hkpShape) == 0x20);
122 }
Definition: bhkShape.h:10
Definition: hkAabb.h:8
Definition: hkReferencedObject.h:11
Definition: hkTransform.h:9
Definition: hkSseMathTypes.h:11
Definition: hkVector4.h:9
Definition: hkpCdBody.h:8
Definition: hkpConvexShape.h:8
Definition: hkpRayHitCollector.h:10
Definition: hkpShapeContainer.h:6
Definition: hkpShape.h:32
void(const void *a_this, const hkpShapeRayCastInput &a_input, const hkpCdBody &a_cdBody, hkpRayHitCollector &a_collector) CastRayWithCollectorFunc
Definition: hkpShape.h:45
virtual float GetMaximumProjection(const hkVector4 &a_direction) const
virtual bool IsConvex() const
virtual void CastRayWithCollectorImpl(const hkpShapeRayCastInput &a_input, const hkpCdBody &a_cdBody, hkpRayHitCollector &a_collector) const =0
std::int32_t(const void *a_this, hkpVertexID *a_featurePoints, std::uint8_t &a_numFeaturePoints, hkVector4 &a_contactPointWs, const hkTransform *a_thisTransform, const hkpConvexShape *a_collidingShape, const hkTransform *a_collidingTransform, hkVector4 &a_separatingNormalInOut) WeldContactPointFunc
Definition: hkpShape.h:39
void(const void *a_this, const hkVector4 &a_direction, hkpCdVertex &a_supportVertex) GetSupportingVertexFunc
Definition: hkpShape.h:37
void(const void *a_this, const hkTransform &a_localToWorld, float a_tolerance, hkAabb &a_out) GetAabbFunc
Definition: hkpShape.h:43
const hkpShape *(const void *a_this, hkpShapeKey a_key, hkpShapeBuffer &a_buffer) GetChildShapeFunc
Definition: hkpShape.h:47
const hkSphere *(const void *a_this, hkSphere *a_sphereBuffer) GetCollisionSpheresFunc
Definition: hkpShape.h:42
void(const void *a_this, hkVector4 &a_centreOut) GetCentreFunc
Definition: hkpShape.h:40
bhkShape * userData
Definition: hkpShape.h:117
virtual void GetAabbImpl(const hkTransform &a_localToWorld, float a_tolerance, hkAabb &a_out) const =0
virtual bool CastRayImpl(const hkpShapeRayCastInput &a_input, hkpShapeRayCastOutput &a_output) const =0
~hkpShape() override
std::int32_t(const void *a_this) GetNumCollisionSpheresFunc
Definition: hkpShape.h:41
hkVector4Comparison(const void *a_this, const hkpShapeRayBundleCastInput &a_input, hkpShapeRayBundleCastOutput &a_output, const hkVector4Comparison &a_mask) CastRayBundleFunc
Definition: hkpShape.h:46
static constexpr auto VTABLE
Definition: hkpShape.h:35
virtual const hkpShapeContainer * GetContainer() const
bool(const void *a_this, const hkpShapeRayCastInput &a_input, hkpShapeRayCastOutput &a_output) CastRayFunc
Definition: hkpShape.h:44
std::uint32_t(const void *a_this, hkpShapeKey a_key) GetCollisionFilterInfoFunc
Definition: hkpShape.h:48
void(ShapeFuncs &a_sf) RegsiterFunc
Definition: hkpShape.h:102
std::uint32_t pad1C
Definition: hkpShape.h:119
virtual std::int32_t CalcSizeForSpu(const CalcSizeForSpuInput &a_input, std::int32_t a_spuBufferSizeLeft) const
static constexpr auto RTTI
Definition: hkpShape.h:34
virtual hkVector4Comparison CastRayBundleImpl(const hkpShapeRayBundleCastInput &a_input, hkpShapeRayBundleCastOutput &a_output, const hkVector4Comparison &a_mask) const
void(const void *a_this, const hkpVertexID *a_ids, std::int32_t a_numIDs, class hkpCdVertex *a_verticesOut) ConvertVertexIdsToVerticesFunc
Definition: hkpShape.h:38
hkpShapeType type
Definition: hkpShape.h:118
Definition: AbsorbEffect.h:6
constexpr hkpVertexID HK_INVALID_VERTEX_ID
Definition: hkpShape.h:26
constexpr std::array< REL::VariantID, 1 > VTABLE_hkpShape
Definition: Offsets_VTABLE.h:637
std::uint16_t hkpVertexID
Definition: hkpShape.h:25
constexpr REL::VariantID RTTI_hkpShape(685163, 392929, 0x1ee0de0)
constexpr hkpShapeKey HK_INVALID_SHAPE_KEY
Definition: hkpShape.h:29
hkpShapeType
Definition: hkpShapeType.h:6
std::uint32_t hkpShapeKey
Definition: hkpContactPointEvent.h:12
Definition: hkpShapeBuffer.h:6
Definition: hkpShapeRayCastOutput.h:9
Definition: hkpShape.h:51
bool hasDynamicMotionSaved
Definition: hkpShape.h:56
bool isFixedOrKeyframed
Definition: hkpShape.h:55
bool midphaseAgent3Registered
Definition: hkpShape.h:54
Definition: hkpShape.h:80
GetNumCollisionSpheresFunc * getNumCollisionSpheresFunc
Definition: hkpShape.h:87
GetChildShapeFunc * getChildShapeFunc
Definition: hkpShape.h:93
GetAabbFunc * getAabbFunc
Definition: hkpShape.h:89
GetSupportingVertexFunc * getSupportingVertexFunc
Definition: hkpShape.h:83
GetCollisionFilterInfoFunc * getCollisionFilterInfoFunc
Definition: hkpShape.h:94
GetCentreFunc * getCentreFunc
Definition: hkpShape.h:86
CastRayFunc * castRay
Definition: hkpShape.h:90
GetCollisionSpheresFunc * getCollisionSpheresFunc
Definition: hkpShape.h:88
ConvertVertexIdsToVerticesFunc * convertVertexIdsToVertices
Definition: hkpShape.h:84
CastRayWithCollectorFunc * castRayWithCollector
Definition: hkpShape.h:91
std::uint64_t pad78
Definition: hkpShape.h:98
std::uint64_t pad70
Definition: hkpShape.h:97
WeldContactPointFunc * weldContactPointFunc
Definition: hkpShape.h:85
CastRayBundleFunc * castRayBundle
Definition: hkpShape.h:92
std::uint64_t pad60
Definition: hkpShape.h:95
std::uint64_t pad68
Definition: hkpShape.h:96
Definition: hkpShape.h:61
GetCollisionFilterInfoFunc * getCollisionFilterInfoFunc
Definition: hkpShape.h:75
GetCollisionSpheresFunc * getCollisionSpheresFunc
Definition: hkpShape.h:69
ConvertVertexIdsToVerticesFunc * convertVertexIdsToVertices
Definition: hkpShape.h:65
WeldContactPointFunc * weldContactPointFunc
Definition: hkpShape.h:66
CastRayFunc * castRay
Definition: hkpShape.h:71
CastRayBundleFunc * castRayBundle
Definition: hkpShape.h:73
GetCentreFunc * getCentreFunc
Definition: hkpShape.h:67
CastRayWithCollectorFunc * castRayWithCollector
Definition: hkpShape.h:72
GetSupportingVertexFunc * getSupportingVertexFunc
Definition: hkpShape.h:64
GetNumCollisionSpheresFunc * getNumCollisionSpheresFunc
Definition: hkpShape.h:68
GetChildShapeFunc * getChildShapeFunc
Definition: hkpShape.h:74
GetAabbFunc * getAabbFunc
Definition: hkpShape.h:70