CommonLibSSE NG
Loading...
Searching...
No Matches
NiNode.h
Go to the documentation of this file.
1#pragma once
2
3#include "RE/N/NiAVObject.h"
5#include "RE/N/NiTArray.h"
6
7namespace RE
8{
9 class NiUpdateData;
10
11 class NiNode : public NiAVObject
12 {
13 public:
14 inline static constexpr auto RTTI = RTTI_NiNode;
15 inline static auto Ni_RTTI = NiRTTI_NiNode;
16
17 ~NiNode() override; // 00
18
19 // override (NiAVObject)
20 const NiRTTI* GetRTTI() const override; // 02
21 NiNode* AsNode() override; // 03 - { return this; }
22 NiObject* CreateClone(NiCloningProcess& a_cloning) override; // 17
23 void LoadBinary(NiStream& a_stream) override; // 18
24 void LinkObject(NiStream& a_stream) override; // 19
25 bool RegisterStreamables(NiStream& a_stream) override; // 1A
26 void SaveBinary(NiStream& a_stream) override; // 1B
27 bool IsEqual(NiObject* a_object) override; // 1C
28 void ProcessClone(NiCloningProcess& a_cloning) override; // 1D
29 void UpdateControllers(NiUpdateData& a_data) override; // 25
30#ifndef SKYRIM_CROSS_VR
31 // The following are virtual functions past the point where VR compatibility breaks.
32 void PerformOp(PerformOpFunc& a_func) override; // 26
33 void AttachProperty(NiAlphaProperty* a_property) override; // 27
34 NiAVObject* GetObjectByName(const BSFixedString& a_name) override; // 2A
35 void SetSelectiveUpdateFlags(bool& a_selectiveUpdate, bool a_selectiveUpdateTransforms, bool& a_rigid) override; // 2B
36 void UpdateDownwardPass(NiUpdateData& a_data, std::uint32_t a_arg2) override; // 2C
37 void UpdateSelectedDownwardPass(NiUpdateData& a_data, std::uint32_t a_arg2) override; // 2D
38 void UpdateRigidDownwardPass(NiUpdateData& a_data, std::uint32_t a_arg2) override; // 2E
39 void UpdateWorldBound() override; // 2F
40 void UpdateTransformAndBounds(NiUpdateData& a_data) override; // 31
41 void OnVisible(NiCullingProcess& a_process) override; // 34
42#endif
43
44 // add
45 SKYRIM_REL_VR_VIRTUAL void AttachChild(NiAVObject* a_child, bool a_firstAvail = false); // 35
46 SKYRIM_REL_VR_VIRTUAL void InsertChildAt(std::uint32_t a_idx, NiAVObject* a_child); // 36
49 SKYRIM_REL_VR_VIRTUAL void DetachChildAt1(std::uint32_t a_idx, NiPointer<NiAVObject>& a_childOut); // 39
50 SKYRIM_REL_VR_VIRTUAL void DetachChildAt2(std::uint32_t a_idx); // 3A
51 SKYRIM_REL_VR_VIRTUAL void SetAt1(std::uint32_t a_idx, NiAVObject* a_child, NiPointer<NiAVObject>& a_childOut); // 3B
52 SKYRIM_REL_VR_VIRTUAL void SetAt2(std::uint32_t a_idx, NiAVObject* a_child); // 3C
54
55 static NiNode* Create(std::uint16_t a_arrBufLen = 0);
56
57 [[nodiscard]] inline NiTObjectArray<NiPointer<NiAVObject>>& GetChildren() noexcept
58 {
59 return REL::RelocateMember<NiTObjectArray<NiPointer<NiAVObject>>>(this, 0x110, 0x138);
60 }
61
62 [[nodiscard]] inline const NiTObjectArray<NiPointer<NiAVObject>>& GetChildren() const noexcept
63 {
64 return REL::RelocateMember<NiTObjectArray<NiPointer<NiAVObject>>>(this, 0x110, 0x138);
65 }
66
67 void DetachChild(NiAVObject* a_child);
68 void DetachChild(NiAVObject* a_child, NiPointer<NiAVObject>& a_childOut);
69 void DetachChildAt(std::uint32_t a_idx);
70 void DetachChildAt(std::uint32_t a_idx, NiPointer<NiAVObject>& a_childOut);
71 void SetAt(std::uint32_t a_idx, NiAVObject* a_child);
72 void SetAt(std::uint32_t a_idx, NiAVObject* a_child, NiPointer<NiAVObject>& a_childOut);
73
74 // members
75#ifndef SKYRIM_CROSS_VR
77#endif
78
79 protected:
80 NiNode* Ctor(std::uint16_t a_arrBufLen);
81 };
82#ifndef ENABLE_SKYRIM_VR
83 static_assert(sizeof(NiNode) == 0x128);
84#elif !defined(ENABLE_SKYRIM_AE) && !defined(ENABLE_SKYRIM_SE)
85 static_assert(sizeof(NiNode) == 0x150);
86#endif
87}
#define SKYRIM_REL_VR_VIRTUAL
Definition Relocation.h:152
Definition NiAVObject.h:50
Definition NiAlphaProperty.h:8
Definition NiCloningProcess.h:10
Definition NiCullingProcess.h:34
Definition NiNode.h:12
void UpdateSelectedDownwardPass(NiUpdateData &a_data, std::uint32_t a_arg2) override
void SetSelectiveUpdateFlags(bool &a_selectiveUpdate, bool a_selectiveUpdateTransforms, bool &a_rigid) override
const NiRTTI * GetRTTI() const override
void DetachChildAt(std::uint32_t a_idx)
void SetAt(std::uint32_t a_idx, NiAVObject *a_child)
SKYRIM_REL_VR_VIRTUAL void AttachChild(NiAVObject *a_child, bool a_firstAvail=false)
void OnVisible(NiCullingProcess &a_process) override
SKYRIM_REL_VR_VIRTUAL void DetachChild2(NiAVObject *a_child)
void UpdateTransformAndBounds(NiUpdateData &a_data) override
static constexpr auto RTTI
Definition NiNode.h:14
SKYRIM_REL_VR_VIRTUAL void DetachChildAt2(std::uint32_t a_idx)
void UpdateControllers(NiUpdateData &a_data) override
void LinkObject(NiStream &a_stream) override
void UpdateDownwardPass(NiUpdateData &a_data, std::uint32_t a_arg2) override
void ProcessClone(NiCloningProcess &a_cloning) override
SKYRIM_REL_VR_VIRTUAL void SetAt2(std::uint32_t a_idx, NiAVObject *a_child)
void UpdateWorldBound() override
void PerformOp(PerformOpFunc &a_func) override
SKYRIM_REL_VR_VIRTUAL void SetAt1(std::uint32_t a_idx, NiAVObject *a_child, NiPointer< NiAVObject > &a_childOut)
static NiNode * Create(std::uint16_t a_arrBufLen=0)
NiNode * AsNode() override
void DetachChild(NiAVObject *a_child)
static auto Ni_RTTI
Definition NiNode.h:15
~NiNode() override
NiAVObject * GetObjectByName(const BSFixedString &a_name) override
SKYRIM_REL_VR_VIRTUAL void InsertChildAt(std::uint32_t a_idx, NiAVObject *a_child)
void DetachChild(NiAVObject *a_child, NiPointer< NiAVObject > &a_childOut)
void DetachChildAt(std::uint32_t a_idx, NiPointer< NiAVObject > &a_childOut)
bool IsEqual(NiObject *a_object) override
NiObject * CreateClone(NiCloningProcess &a_cloning) override
void AttachProperty(NiAlphaProperty *a_property) override
const NiTObjectArray< NiPointer< NiAVObject > > & GetChildren() const noexcept
Definition NiNode.h:62
void UpdateRigidDownwardPass(NiUpdateData &a_data, std::uint32_t a_arg2) override
SKYRIM_REL_VR_VIRTUAL void DetachChild1(NiAVObject *a_child, NiPointer< NiAVObject > &a_childOut)
void SetAt(std::uint32_t a_idx, NiAVObject *a_child, NiPointer< NiAVObject > &a_childOut)
void SaveBinary(NiStream &a_stream) override
NiTObjectArray< NiPointer< NiAVObject > > & GetChildren() noexcept
Definition NiNode.h:57
NiTObjectArray< NiPointer< NiAVObject > > children
Definition NiNode.h:76
SKYRIM_REL_VR_VIRTUAL void DetachChildAt1(std::uint32_t a_idx, NiPointer< NiAVObject > &a_childOut)
void LoadBinary(NiStream &a_stream) override
bool RegisterStreamables(NiStream &a_stream) override
NiNode * Ctor(std::uint16_t a_arrBufLen)
SKYRIM_REL_VR_VIRTUAL void UpdateUpwardPass(NiUpdateData &a_data)
Definition NiObject.h:37
Definition NiSmartPointer.h:9
Definition NiRTTI.h:6
Definition NiStream.h:27
Definition NiTArray.h:126
Definition NiAVObject.h:25
Definition NiAVObject.h:40
Definition AbsorbEffect.h:6
constexpr REL::VariantID RTTI_NiNode(684841, 392532, 0x1eda920)
constexpr REL::VariantID NiRTTI_NiNode(523900, 410481, 0x316ab78)