CommonLibVR
Loading...
Searching...
No Matches
NiPointLight.h
Go to the documentation of this file.
1#pragma once
2
3#include "RE/N/NiLight.h"
4
6
7namespace RE
8{
9 class NiPointLight : public NiLight
10 {
11 public:
12 inline static constexpr auto RTTI = RTTI_NiPointLight;
13 inline static constexpr auto Ni_RTTI = NiRTTI_NiPointLight;
14 inline static constexpr auto VTABLE = VTABLE_NiPointLight;
15
16 ~NiPointLight() override; // 00
17
18 // override (NiLight)
19 const NiRTTI* GetRTTI() const override; // 02
20 NiObject* CreateClone(NiCloningProcess& a_cloning) override; // 17
21 void LoadBinary(NiStream& a_stream) override; // 18
22 void SaveBinary(NiStream& a_stream) override; // 1B
23 bool IsEqual(NiObject* a_object) override; // 1C
24
26 {
27 auto light = malloc<NiPointLight>();
28 std::memset((void*)light, 0, sizeof(NiPointLight));
29 if (light) {
30 light->Ctor();
31 }
32 return light;
33 }
34
35 void SetLightAttenuation(float a_radius)
36 {
37 using func_t = decltype(&NiPointLight::SetLightAttenuation);
38 static REL::Relocation<func_t> func{ RELOCATION_ID(17224, 17626) };
39 return func(this, a_radius);
40 }
41
42 // members
43 float constAttenuation; // 140
44 float linearAttenuation; // 144
46
47 private:
48 NiPointLight* Ctor()
49 {
50 using func_t = decltype(&NiPointLight::Ctor);
51 static REL::Relocation<func_t> func{ RELOCATION_ID(69583, 70967) };
52 return func(this);
53 }
54
56 };
57#ifndef SKYRIMVR
58 static_assert(sizeof(NiPointLight) == 0x150);
59#else
60 static_assert(sizeof(NiPointLight) == 0x178);
61#endif
62}
#define KEEP_FOR_RE()
Definition PCH.h:517
#define RELOCATION_ID(SE, AE)
Definition PCH.h:506
Definition Relocation.h:210
Definition NiCloningProcess.h:10
Definition NiLight.h:10
Definition NiObject.h:37
Definition NiPointLight.h:10
void SetLightAttenuation(float a_radius)
Definition NiPointLight.h:35
bool IsEqual(NiObject *a_object) override
float constAttenuation
Definition NiPointLight.h:43
static constexpr auto RTTI
Definition NiPointLight.h:12
static constexpr auto Ni_RTTI
Definition NiPointLight.h:13
const NiRTTI * GetRTTI() const override
NiObject * CreateClone(NiCloningProcess &a_cloning) override
float linearAttenuation
Definition NiPointLight.h:44
~NiPointLight() override
float quadraticAttenuation
Definition NiPointLight.h:45
static constexpr auto VTABLE
Definition NiPointLight.h:14
void SaveBinary(NiStream &a_stream) override
static NiPointLight * Create()
Definition NiPointLight.h:25
void LoadBinary(NiStream &a_stream) override
Definition NiRTTI.h:6
Definition NiStream.h:29
Definition AbsorbEffect.h:6
constexpr std::array< REL::ID, 1 > VTABLE_NiPointLight
Definition Offsets_VTABLE.h:12307
constexpr REL::ID RTTI_NiPointLight(static_cast< std::uint64_t >(690433))
constexpr REL::ID NiRTTI_NiPointLight(static_cast< std::uint64_t >(523954))