CommonLibSSE NG
ConeProjectile.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/B/BSTArray.h"
4 #include "RE/F/FormTypes.h"
5 #include "RE/H/hkRefPtr.h"
6 #include "RE/I/ImpactResults.h"
7 #include "RE/N/NiPoint3.h"
8 #include "RE/P/Projectile.h"
9 
10 namespace RE
11 {
12  class hkpSphereShape;
13 
14  class ConeProjectile : public Projectile
15  {
16  public:
17  inline static constexpr auto RTTI = RTTI_ConeProjectile;
18  inline static constexpr auto VTABLE = VTABLE_ConeProjectile;
19  inline static constexpr auto FORMTYPE = FormType::ProjectileCone;
20 
21  struct RecordFlags
22  {
23  enum RecordFlag : std::uint32_t
24  {
25  };
26  };
27 
28  ~ConeProjectile() override; // 00
29 
30  // override (Projectile)
31  void SaveGame(BGSSaveFormBuffer* a_buf) override; // 0E
32  void LoadGame(BGSLoadFormBuffer* a_buf) override; // 0F
33  void InitLoadGame(BGSLoadFormBuffer* a_buf) override; // 10
34  void FinishLoadGame(BGSLoadFormBuffer* a_buf) override; // 11
35  void Revert(BGSLoadFormBuffer* a_buf) override; // 12
36 #ifndef SKYRIM_CROSS_VR
37  void Process3D() override; // A9
38  void UpdateImpl(float a_delta) override; // AB
39  bool ProcessImpacts() override; // AC
40  bool GetKillOnCollision() override; // B8 - { return 0; }
41  bhkShape* GetCollisionShape() override; // BC
42  void AddImpact(TESObjectREFR* a_ref, const NiPoint3& a_targetLoc, const NiPoint3& a_velocity, hkpCollidable* a_collidable, std::int32_t a_arg6, std::uint32_t a_arg7) override; // BD
43  bool HandleHits(hkpCollidable* a_collidable) override; // BE
44  void Handle3DLoaded() override; // C0
45 #endif
46 
47  // add
48  SKYRIM_REL_VR_VIRTUAL void Unk_C2(void); // C2 - { return 1; }
49 
50  inline float GetHeight() const
51  {
52  return GetConeRuntimeData().initialCollisionSphereRadius * 2;
53  }
54 
56  {
57 #define CONE_RUNTIME_DATA_CONTENT \
58  ImpactResult impactResult; /* 1D8 */ \
59  float environmentTimer; /* 1DC */ \
60  float coneAngleTangent; /* 1E0 */ \
61  float initialCollisionSphereRadius; /* 1E4 */ \
62  NiPoint3 origin; /* 1E8 */ \
63  std::uint32_t pad1F4; /* 1F4 */ \
64  hkRefPtr<hkpSphereShape> collisionShape; /* 1F8 */ \
65  BSTArray<void*> collisions; /* 200 */
66 
68  };
69 
70  [[nodiscard]] inline CONE_RUNTIME_DATA& GetConeRuntimeData() noexcept
71  {
72  return REL::RelocateMemberIfNewer<CONE_RUNTIME_DATA>(SKSE::RUNTIME_SSE_1_6_629, this, 0x1D8, 0x1E0);
73  }
74 
75  [[nodiscard]] inline const CONE_RUNTIME_DATA& GetConeRuntimeData() const noexcept
76  {
77  return REL::RelocateMemberIfNewer<CONE_RUNTIME_DATA>(SKSE::RUNTIME_SSE_1_6_629, this, 0x1D8, 0x1E0);
78  }
79 
80  // members
81 #ifndef ENABLE_SKYRIM_AE
83 #endif
84  };
85 #ifndef ENABLE_SKYRIM_AE
86  static_assert(sizeof(ConeProjectile) == 0x218);
87 #endif
88 }
89 #undef CONE_RUNTIME_DATA_CONTENT
#define SKYRIM_REL_VR_VIRTUAL
Definition: Common.h:94
#define CONE_RUNTIME_DATA_CONTENT
Definition: ConeProjectile.h:57
Definition: BGSLoadFormBuffer.h:11
Definition: BGSSaveFormBuffer.h:8
Definition: ConeProjectile.h:15
void Handle3DLoaded() override
static constexpr auto VTABLE
Definition: ConeProjectile.h:18
bool GetKillOnCollision() override
CONE_RUNTIME_DATA & GetConeRuntimeData() noexcept
Definition: ConeProjectile.h:70
void UpdateImpl(float a_delta) override
void Revert(BGSLoadFormBuffer *a_buf) override
float GetHeight() const
Definition: ConeProjectile.h:50
static constexpr auto FORMTYPE
Definition: ConeProjectile.h:19
void AddImpact(TESObjectREFR *a_ref, const NiPoint3 &a_targetLoc, const NiPoint3 &a_velocity, hkpCollidable *a_collidable, std::int32_t a_arg6, std::uint32_t a_arg7) override
bhkShape * GetCollisionShape() override
bool HandleHits(hkpCollidable *a_collidable) override
void LoadGame(BGSLoadFormBuffer *a_buf) override
void SaveGame(BGSSaveFormBuffer *a_buf) override
void Process3D() override
const CONE_RUNTIME_DATA & GetConeRuntimeData() const noexcept
Definition: ConeProjectile.h:75
static constexpr auto RTTI
Definition: ConeProjectile.h:17
void InitLoadGame(BGSLoadFormBuffer *a_buf) override
~ConeProjectile() override
bool ProcessImpacts() override
void FinishLoadGame(BGSLoadFormBuffer *a_buf) override
SKYRIM_REL_VR_VIRTUAL void Unk_C2(void)
Definition: NiPoint3.h:6
Definition: Projectile.h:30
Definition: TESObjectREFR.h:113
Definition: bhkShape.h:10
Definition: hkpCollidable.h:13
Definition: AbsorbEffect.h:6
constexpr std::array< REL::VariantID, 4 > VTABLE_ConeProjectile
Definition: Offsets_VTABLE.h:2777
constexpr REL::VariantID RTTI_ConeProjectile(687502, 395352, 0x1f1b2c8)
constexpr REL::Version RUNTIME_SSE_1_6_629(1, 6, 629, 0)
Definition: ConeProjectile.h:56
Definition: ConeProjectile.h:22
RecordFlag
Definition: ConeProjectile.h:24