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