CommonLibSSE (Parapets fork)
NiAVObject.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/B/BSFixedString.h"
4 #include "RE/N/NiBound.h"
5 #include "RE/N/NiObjectNET.h"
6 #include "RE/N/NiSmartPointer.h"
7 #include "RE/N/NiTransform.h"
8 
9 namespace RE
10 {
11  class NiAlphaProperty;
12  class NiAVObject;
13  class NiCollisionObject;
14  class NiColor;
15  class NiColorA;
16  class NiCullingProcess;
17  class NiNode;
18  class NiPoint3;
19  class TESObjectREFR;
20 
22  {
23  public:
24  enum class Flag
25  {
26  kDirty = 1 << 0,
27  };
28 
29  float time; // 0
31  };
32  static_assert(sizeof(NiUpdateData) == 0x8);
33 
35  {
36  public:
37  virtual ~PerformOpFunc(); // 00
38 
39  // add
40  virtual bool operator()(NiAVObject* a_object); // 01
41  };
42  static_assert(sizeof(PerformOpFunc) == 0x8);
43 
44  class NiAVObject : public NiObjectNET
45  {
46  public:
47  inline static constexpr auto RTTI = RTTI_NiAVObject;
48  inline static constexpr auto Ni_RTTI = NiRTTI_NiAVObject;
49 
50  enum class Flag
51  {
52  kNone = 0,
53  kHidden = 1 << 0,
54  kSelectiveUpdate = 1 << 1,
57  kSelectiveUpdateRigid = 1 << 4,
58  kDisplayObject = 1 << 5,
59  kDisableSorting = 1 << 6,
62  kNoDecals = 1 << 10,
63  kAlwaysDraw = 1 << 11,
64  kMeshLOD = 1 << 12,
65  kFixedBound = 1 << 13,
66  kTopFadeNode = 1 << 14,
67  kIgnoreFade = 1 << 15,
68  kNoAnimSyncX = 1 << 16,
69  kNoAnimSyncY = 1 << 17,
70  kNoAnimSyncZ = 1 << 18,
71  kNoAnimSyncS = 1 << 19,
72  kNoDismember = 1 << 20,
73  kNoDismemberValidity = 1 << 21,
74  kRenderUse = 1 << 22,
75  kMaterialsApplied = 1 << 23,
76  kHighDetail = 1 << 24,
77  kForceUpdate = 1 << 25,
78  kPreProcessedNode = 1 << 26
79  };
80 
81  ~NiAVObject() override; // 00
82 
83  // override (NiObjectNET)
84  const NiRTTI* GetRTTI() const override; // 02
85  void LoadBinary(NiStream& a_stream) override; // 18
86  void LinkObject(NiStream& a_stream) override; // 19
87  bool RegisterStreamables(NiStream& a_stream) override; // 1A
88  void SaveBinary(NiStream& a_stream) override; // 1B
89  bool IsEqual(NiObject* a_object) override; // 1C
90  void ProcessClone(NiCloningProcess& a_cloning) override; // 1D
91 
92  // add
93  virtual void UpdateControllers(NiUpdateData& a_data); // 25
94 #ifdef SKYRIMVR
95  virtual void UnkVR_26(void); // added in VR
96 #endif
97  virtual void PerformOp(PerformOpFunc& a_func); // 26
98  virtual void AttachProperty(NiAlphaProperty* a_property); // 27 - { return; }
99  virtual void SetMaterialNeedsUpdate(bool a_needsUpdate); // 28 - { return; }
100  virtual void SetDefaultMaterialNeedsUpdateFlag(bool a_flag); // 29 - { return; }
101  virtual NiAVObject* GetObjectByName(const BSFixedString& a_name); // 2A
102  virtual void SetSelectiveUpdateFlags(bool& a_selectiveUpdate, bool a_selectiveUpdateTransforms, bool& a_rigid); // 2B
103  virtual void UpdateDownwardPass(NiUpdateData& a_data, std::uint32_t a_arg2); // 2C
104  virtual void UpdateSelectedDownwardPass(NiUpdateData& a_data, std::uint32_t a_arg2); // 2D
105  virtual void UpdateRigidDownwardPass(NiUpdateData& a_data, std::uint32_t a_arg2); // 2E
106  virtual void UpdateWorldBound(); // 2F - { return; }
107  virtual void UpdateWorldData(NiUpdateData* a_data); // 30
108  virtual void UpdateTransformAndBounds(NiUpdateData& a_data); // 31
109  virtual void PreAttachUpdate(NiNode* a_parent, NiUpdateData& a_data); // 32
110  virtual void PostAttachUpdate(); // 33
111  virtual void OnVisible(NiCullingProcess& a_process); // 34 - { return; }
112 
113  [[nodiscard]] bool GetAppCulled() const;
114  bool SetMotionType(std::uint32_t a_motionType, bool a_arg2 = true, bool a_arg3 = false, bool a_allowActivate = true);
115  void TintScenegraph(const NiColorA& a_color);
116  void Update(NiUpdateData& a_data);
117  void UpdateBodyTint(const NiColor& a_color);
118  void UpdateHairColor(const NiColor& a_color);
119 
120  // members
121  NiNode* parent; // 030
122  std::uint32_t parentIndex; // 038
123  std::uint32_t unk03C; // 03C
129 #ifdef SKYRIMVR
130  std::uint32_t unkVR1; // VR offset moved by 0x18
131  std::uint32_t unkVR2;
132  std::uint32_t unkVR3;
133  std::uint32_t unkVR4;
134  std::uint32_t unkVR5;
135  std::uint32_t unkVR6;
136 #endif
139  float fadeAmount; // 100
140  std::uint32_t lastUpdatedFrameCounter; // 104
141  std::uint32_t unk108; // 108
142 #ifdef SKYRIMVR
143  std::uint64_t unkVR7;
144  std::uint64_t unkVR8;
145 #endif
146  };
147 #ifndef SKYRIMVR
148  static_assert(sizeof(NiAVObject) == 0x110);
149 #else
150  static_assert(sizeof(NiAVObject) == 0x138);
151 #endif
152 }
Definition: NiAVObject.h:45
virtual void UpdateSelectedDownwardPass(NiUpdateData &a_data, std::uint32_t a_arg2)
virtual void PerformOp(PerformOpFunc &a_func)
static constexpr auto Ni_RTTI
Definition: NiAVObject.h:48
void UpdateHairColor(const NiColor &a_color)
static constexpr auto RTTI
Definition: NiAVObject.h:47
virtual void UpdateRigidDownwardPass(NiUpdateData &a_data, std::uint32_t a_arg2)
NiNode * parent
Definition: NiAVObject.h:121
const NiRTTI * GetRTTI() const override
virtual void SetSelectiveUpdateFlags(bool &a_selectiveUpdate, bool a_selectiveUpdateTransforms, bool &a_rigid)
NiTransform previousWorld
Definition: NiAVObject.h:127
virtual void PreAttachUpdate(NiNode *a_parent, NiUpdateData &a_data)
void Update(NiUpdateData &a_data)
virtual NiAVObject * GetObjectByName(const BSFixedString &a_name)
void UpdateBodyTint(const NiColor &a_color)
std::uint32_t parentIndex
Definition: NiAVObject.h:122
NiTransform world
Definition: NiAVObject.h:126
void LoadBinary(NiStream &a_stream) override
void LinkObject(NiStream &a_stream) override
~NiAVObject() override
stl::enumeration< Flag, std::uint32_t > flags
Definition: NiAVObject.h:137
virtual void PostAttachUpdate()
bool SetMotionType(std::uint32_t a_motionType, bool a_arg2=true, bool a_arg3=false, bool a_allowActivate=true)
void ProcessClone(NiCloningProcess &a_cloning) override
virtual void AttachProperty(NiAlphaProperty *a_property)
NiPointer< NiCollisionObject > collisionObject
Definition: NiAVObject.h:124
virtual void SetMaterialNeedsUpdate(bool a_needsUpdate)
virtual void UpdateWorldData(NiUpdateData *a_data)
void SaveBinary(NiStream &a_stream) override
NiBound worldBound
Definition: NiAVObject.h:128
virtual void UpdateControllers(NiUpdateData &a_data)
virtual void UpdateWorldBound()
TESObjectREFR * userData
Definition: NiAVObject.h:138
virtual void OnVisible(NiCullingProcess &a_process)
std::uint32_t unk108
Definition: NiAVObject.h:141
virtual void SetDefaultMaterialNeedsUpdateFlag(bool a_flag)
float fadeAmount
Definition: NiAVObject.h:139
std::uint32_t unk03C
Definition: NiAVObject.h:123
bool IsEqual(NiObject *a_object) override
NiTransform local
Definition: NiAVObject.h:125
void TintScenegraph(const NiColorA &a_color)
Flag
Definition: NiAVObject.h:51
bool RegisterStreamables(NiStream &a_stream) override
std::uint32_t lastUpdatedFrameCounter
Definition: NiAVObject.h:140
bool GetAppCulled() const
virtual void UpdateTransformAndBounds(NiUpdateData &a_data)
virtual void UpdateDownwardPass(NiUpdateData &a_data, std::uint32_t a_arg2)
Definition: NiAlphaProperty.h:8
Definition: NiBound.h:8
Definition: NiColor.h:137
Definition: NiColor.h:9
Definition: NiCullingProcess.h:34
Definition: NiNode.h:12
Definition: NiObjectNET.h:13
Definition: NiObject.h:37
Definition: NiSmartPointer.h:9
Definition: NiRTTI.h:6
Definition: NiStream.h:6
Definition: NiTransform.h:9
Definition: NiAVObject.h:22
float time
Definition: NiAVObject.h:29
stl::enumeration< Flag, std::uint32_t > flags
Definition: NiAVObject.h:30
Flag
Definition: NiAVObject.h:25
Definition: NiAVObject.h:35
virtual ~PerformOpFunc()
virtual bool operator()(NiAVObject *a_object)
Definition: TESObjectREFR.h:105
Definition: AbsorbEffect.h:6
constexpr REL::ID RTTI_NiAVObject
Definition: Offsets_RTTI.h:5295
constexpr REL::ID NiRTTI_NiAVObject
Definition: Offsets_NiRTTI.h:138