CommonLibSSE NG
NiLight.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/N/NiAVObject.h"
4 #include "RE/N/NiColor.h"
5 #include "RE/N/NiPoint3.h"
6 
7 namespace RE
8 {
9  class NiLight : public NiAVObject
10  {
11  public:
12  inline static constexpr auto RTTI = RTTI_NiLight;
13  inline static auto Ni_RTTI = NiRTTI_NiLight;
14 
16  {
17 #define RUNTIME_DATA_CONTENT \
18  NiColor ambient; /* 00 */ \
19  NiColor diffuse; /* 0C */ \
20  NiPoint3 radius; /* 018 */ \
21  float fade; /* 024 */ \
22  std::uint32_t unk138; /* 028 */
23 
25  };
26  static_assert(sizeof(LIGHT_RUNTIME_DATA) == 0x2C);
27 
28  ~NiLight() override; // 00
29 
30  // override (NiAVObject)
31  const NiRTTI* GetRTTI() const override; // 02
32  void LoadBinary(NiStream& a_stream) override; // 18
33  void SaveBinary(NiStream& a_stream) override; // 1B
34  bool IsEqual(NiObject* a_object) override; // 1C
35 
36  [[nodiscard]] inline LIGHT_RUNTIME_DATA& GetLightRuntimeData() noexcept
37  {
38  return REL::RelocateMember<LIGHT_RUNTIME_DATA>(this, 0x110, 0x138);
39  }
40 
41  [[nodiscard]] inline const LIGHT_RUNTIME_DATA& GetLightRuntimeData() const noexcept
42  {
43  return REL::RelocateMember<LIGHT_RUNTIME_DATA>(this, 0x110, 0x138);
44  }
45 
46  // members
47 #ifndef SKYRIM_CROSS_VR
48  RUNTIME_DATA_CONTENT // 110, 138
49 #endif
50  };
51 #ifndef ENABLE_SKYRIM_VR
52  static_assert(sizeof(NiLight) == 0x140);
53 #elif !defined(ENABLE_SKYRIM_AE) && !defined(ENABLE_SKYRIM_SE)
54  static_assert(sizeof(NiLight) == 0x168);
55 #endif
56 }
57 #undef RUNTIME_DATA_CONTENT
#define RUNTIME_DATA_CONTENT
Definition: NiLight.h:17
Definition: NiAVObject.h:50
Definition: NiLight.h:10
~NiLight() override
void LoadBinary(NiStream &a_stream) override
const LIGHT_RUNTIME_DATA & GetLightRuntimeData() const noexcept
Definition: NiLight.h:41
void SaveBinary(NiStream &a_stream) override
const NiRTTI * GetRTTI() const override
static constexpr auto RTTI
Definition: NiLight.h:12
static auto Ni_RTTI
Definition: NiLight.h:13
bool IsEqual(NiObject *a_object) override
LIGHT_RUNTIME_DATA & GetLightRuntimeData() noexcept
Definition: NiLight.h:36
Definition: NiObject.h:37
Definition: NiRTTI.h:6
Definition: NiStream.h:29
Definition: AbsorbEffect.h:6
constexpr REL::VariantID NiRTTI_NiLight(523923, 410503, 0x316ad68)
constexpr REL::VariantID RTTI_NiLight(690419, 398274, 0x1f61dc8)
Definition: NiLight.h:16