CommonLibSSE (powerof3)
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  virtual void PerformOp(PerformOpFunc& a_func); // 26
95  virtual void AttachProperty(NiAlphaProperty* a_property); // 27 - { return; }
96  virtual void SetMaterialNeedsUpdate(bool a_needsUpdate); // 28 - { return; }
97  virtual void SetDefaultMaterialNeedsUpdateFlag(bool a_flag); // 29 - { return; }
98  virtual NiAVObject* GetObjectByName(const BSFixedString& a_name); // 2A
99  virtual void SetSelectiveUpdateFlags(bool& a_selectiveUpdate, bool a_selectiveUpdateTransforms, bool& a_rigid); // 2B
100  virtual void UpdateDownwardPass(NiUpdateData& a_data, std::uint32_t a_arg2); // 2C
101  virtual void UpdateSelectedDownwardPass(NiUpdateData& a_data, std::uint32_t a_arg2); // 2D
102  virtual void UpdateRigidDownwardPass(NiUpdateData& a_data, std::uint32_t a_arg2); // 2E
103  virtual void UpdateWorldBound(); // 2F - { return; }
104  virtual void UpdateWorldData(NiUpdateData* a_data); // 30
105  virtual void UpdateTransformAndBounds(NiUpdateData& a_data); // 31
106  virtual void PreAttachUpdate(NiNode* a_parent, NiUpdateData& a_data); // 32
107  virtual void PostAttachUpdate(); // 33
108  virtual void OnVisible(NiCullingProcess& a_process); // 34 - { return; }
109 
110  [[nodiscard]] bool GetAppCulled() const;
111  bool SetMotionType(std::uint32_t a_motionType, bool a_arg2 = true, bool a_arg3 = false, bool a_allowActivate = true);
112  void TintScenegraph(const NiColorA& a_color);
113  void Update(NiUpdateData& a_data);
114  void UpdateBodyTint(const NiColor& a_color);
115  void UpdateHairColor(const NiColor& a_color);
116 
117  // members
118  NiNode* parent; // 030
119  std::uint32_t parentIndex; // 038
120  std::uint32_t unk03C; // 03C
128  float fadeAmount; // 100
129  std::uint32_t lastUpdatedFrameCounter; // 104
130  std::uint64_t unk108; // 108
131  };
132  static_assert(sizeof(NiAVObject) == 0x110);
133 }
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:118
const NiRTTI * GetRTTI() const override
virtual void SetSelectiveUpdateFlags(bool &a_selectiveUpdate, bool a_selectiveUpdateTransforms, bool &a_rigid)
NiTransform previousWorld
Definition: NiAVObject.h:124
virtual void PreAttachUpdate(NiNode *a_parent, NiUpdateData &a_data)
std::uint64_t unk108
Definition: NiAVObject.h:130
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:119
NiTransform world
Definition: NiAVObject.h:123
void LoadBinary(NiStream &a_stream) override
void LinkObject(NiStream &a_stream) override
~NiAVObject() override
stl::enumeration< Flag, std::uint32_t > flags
Definition: NiAVObject.h:126
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:121
virtual void SetMaterialNeedsUpdate(bool a_needsUpdate)
virtual void UpdateWorldData(NiUpdateData *a_data)
void SaveBinary(NiStream &a_stream) override
NiBound worldBound
Definition: NiAVObject.h:125
virtual void UpdateControllers(NiUpdateData &a_data)
virtual void UpdateWorldBound()
TESObjectREFR * userData
Definition: NiAVObject.h:127
virtual void OnVisible(NiCullingProcess &a_process)
virtual void SetDefaultMaterialNeedsUpdateFlag(bool a_flag)
float fadeAmount
Definition: NiAVObject.h:128
std::uint32_t unk03C
Definition: NiAVObject.h:120
bool IsEqual(NiObject *a_object) override
NiTransform local
Definition: NiAVObject.h:122
void TintScenegraph(const NiColorA &a_color)
Flag
Definition: NiAVObject.h:51
bool RegisterStreamables(NiStream &a_stream) override
std::uint32_t lastUpdatedFrameCounter
Definition: NiAVObject.h:129
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:103
Definition: AbsorbEffect.h:6
constexpr REL::ID RTTI_NiAVObject
Definition: Offsets_RTTI.h:5295
constexpr REL::ID NiRTTI_NiAVObject
Definition: Offsets_NiRTTI.h:138