CommonLibSSE (powerof3)
Loading...
Searching...
No Matches
NiAVObject.h
Go to the documentation of this file.
1#pragma once
2
6#include "RE/H/hkpMotion.h"
7#include "RE/N/NiBound.h"
8#include "RE/N/NiObjectNET.h"
10#include "RE/N/NiTransform.h"
11
12namespace RE
13{
14 class bhkCollisionObject;
15 class NiAlphaProperty;
16 class NiAVObject;
17 class NiCollisionObject;
18 class NiColor;
19 class NiColorA;
20 class NiCullingProcess;
21 class NiNode;
22 class NiPoint3;
23 class TESObjectREFR;
24
26 {
27 public:
28 enum class Flag
29 {
30 kNone = 0,
31 kDirty = 1 << 0,
32 kDisableCollision = 1 << 13
33 };
34
35 float time; // 0
37 };
38 static_assert(sizeof(NiUpdateData) == 0x8);
39
41 {
42 public:
43 virtual ~PerformOpFunc(); // 00
44
45 // add
46 virtual bool operator()(NiAVObject* a_object); // 01
47 };
48 static_assert(sizeof(PerformOpFunc) == 0x8);
49
50 class NiAVObject : public NiObjectNET
51 {
52 public:
53 inline static constexpr auto RTTI = RTTI_NiAVObject;
54 inline static constexpr auto Ni_RTTI = NiRTTI_NiAVObject;
55 inline static constexpr auto VTABLE = VTABLE_NiAVObject;
56
57 enum class Flag
58 {
59 kNone = 0,
60 kHidden = 1 << 0,
61 kSelectiveUpdate = 1 << 1,
64 kSelectiveUpdateRigid = 1 << 4,
65 kDisplayObject = 1 << 5,
66 kDisableSorting = 1 << 6,
69 kNoDecals = 1 << 10,
70 kAlwaysDraw = 1 << 11,
71 kMeshLOD = 1 << 12,
72 kFixedBound = 1 << 13,
73 kTopFadeNode = 1 << 14,
74 kIgnoreFade = 1 << 15,
75 kNoAnimSyncX = 1 << 16,
76 kNoAnimSyncY = 1 << 17,
77 kNoAnimSyncZ = 1 << 18,
78 kNoAnimSyncS = 1 << 19,
79 kNoDismember = 1 << 20,
80 kNoDismemberValidity = 1 << 21,
81 kRenderUse = 1 << 22,
82 kMaterialsApplied = 1 << 23,
83 kHighDetail = 1 << 24,
84 kForceUpdate = 1 << 25,
85 kPreProcessedNode = 1 << 26
86 };
87
88 ~NiAVObject() override; // 00
89
90 // override (NiObjectNET)
91 const NiRTTI* GetRTTI() const override; // 02
92 void LoadBinary(NiStream& a_stream) override; // 18
93 void LinkObject(NiStream& a_stream) override; // 19
94 bool RegisterStreamables(NiStream& a_stream) override; // 1A
95 void SaveBinary(NiStream& a_stream) override; // 1B
96 bool IsEqual(NiObject* a_object) override; // 1C
97 void ProcessClone(NiCloningProcess& a_cloning) override; // 1D
98
99 // add
100 virtual void UpdateControllers(NiUpdateData& a_data); // 25
101 virtual void PerformOp(PerformOpFunc& a_func); // 26
102 virtual void AttachProperty(NiAlphaProperty* a_property); // 27 - { return; }
103 virtual void SetMaterialNeedsUpdate(bool a_needsUpdate); // 28 - { return; }
104 virtual void SetDefaultMaterialNeedsUpdateFlag(bool a_flag); // 29 - { return; }
105 virtual NiAVObject* GetObjectByName(const BSFixedString& a_name); // 2A
106 virtual void SetSelectiveUpdateFlags(bool& a_selectiveUpdate, bool a_selectiveUpdateTransforms, bool& a_rigid); // 2B
107 virtual void UpdateDownwardPass(NiUpdateData& a_data, std::uint32_t a_arg2); // 2C
108 virtual void UpdateSelectedDownwardPass(NiUpdateData& a_data, std::uint32_t a_arg2); // 2D
109 virtual void UpdateRigidDownwardPass(NiUpdateData& a_data, std::uint32_t a_arg2); // 2E
110 virtual void UpdateWorldBound(); // 2F - { return; }
111 virtual void UpdateWorldData(NiUpdateData* a_data); // 30
112 virtual void UpdateTransformAndBounds(NiUpdateData& a_data); // 31
113 virtual void PreAttachUpdate(NiNode* a_parent, NiUpdateData& a_data); // 32
114 virtual void PostAttachUpdate(); // 33
115 virtual void OnVisible(NiCullingProcess& a_process); // 34 - { return; }
116
117 [[nodiscard]] NiAVObject* Clone();
118 void CullGeometry(bool a_cull);
119 void CullNode(bool a_cull);
120 [[nodiscard]] bool GetAppCulled() const;
122 [[nodiscard]] COL_LAYER GetCollisionLayer() const;
124 [[nodiscard]] float GetMass();
125 [[nodiscard]] TESObjectREFR* GetUserData() const;
126 [[nodiscard]] bool HasAnimation() const;
127 [[nodiscard]] bool HasShaderType(BSShaderMaterial::Feature a_type);
129 void SetAppCulled(bool a_cull);
130 void SetCollisionLayer(COL_LAYER a_collisionLayer);
131 void SetCollisionLayerAndGroup(COL_LAYER a_collisionLayer, std::uint32_t a_group);
132 bool SetMotionType(hkpMotion::MotionType a_motionType, bool a_recurse = true, bool a_force = false, bool a_allowActivate = true);
133 bool SetProjectedUVData(const NiColorA& a_projectedUVParams, const NiColor& a_projectedUVColor, bool a_isSnow);
134 void TintScenegraph(const NiColorA& a_color);
135 void Update(NiUpdateData& a_data);
136 void UpdateBodyTint(const NiColor& a_color);
137 void UpdateHairColor(const NiColor& a_color);
138 void UpdateMaterialAlpha(float a_alpha, bool a_doOnlySkin);
139 void UpdateRigidConstraints(bool a_enable, std::uint8_t a_arg2 = 1, std::uint32_t a_arg3 = 1);
140
141 // members
142 NiNode* parent; // 030
143 std::uint32_t parentIndex; // 038
144 std::uint32_t unk03C; // 03C
152 float fadeAmount; // 100
153 std::uint32_t lastUpdatedFrameCounter; // 104
154 std::uint8_t unk108; // 108
155 std::uint8_t flags02; // 109
156 std::uint16_t unk10A; // 10A
157 std::uint32_t pad10C; // 10C
158 };
159 static_assert(sizeof(NiAVObject) == 0x110);
160}
Definition EnumSet.h:9
Definition BSGeometry.h:15
Feature
Definition BSShaderMaterial.h:15
Definition NiAVObject.h:51
virtual void UpdateSelectedDownwardPass(NiUpdateData &a_data, std::uint32_t a_arg2)
BSGeometry * GetFirstGeometryOfShaderType(BSShaderMaterial::Feature a_type)
virtual void PerformOp(PerformOpFunc &a_func)
static constexpr auto Ni_RTTI
Definition NiAVObject.h:54
std::uint8_t unk108
Definition NiAVObject.h:154
void UpdateRigidConstraints(bool a_enable, std::uint8_t a_arg2=1, std::uint32_t a_arg3=1)
void UpdateHairColor(const NiColor &a_color)
static constexpr auto RTTI
Definition NiAVObject.h:53
virtual void UpdateRigidDownwardPass(NiUpdateData &a_data, std::uint32_t a_arg2)
NiNode * parent
Definition NiAVObject.h:142
COL_LAYER GetCollisionLayer() const
void SetCollisionLayer(COL_LAYER a_collisionLayer)
const NiRTTI * GetRTTI() const override
virtual void SetSelectiveUpdateFlags(bool &a_selectiveUpdate, bool a_selectiveUpdateTransforms, bool &a_rigid)
NiTransform previousWorld
Definition NiAVObject.h:148
virtual void PreAttachUpdate(NiNode *a_parent, NiUpdateData &a_data)
static constexpr auto VTABLE
Definition NiAVObject.h:55
void Update(NiUpdateData &a_data)
REX::EnumSet< Flag, std::uint32_t > flags
Definition NiAVObject.h:150
void UpdateBodyTint(const NiColor &a_color)
std::uint32_t parentIndex
Definition NiAVObject.h:143
bool SetProjectedUVData(const NiColorA &a_projectedUVParams, const NiColor &a_projectedUVColor, bool a_isSnow)
virtual NiAVObject * GetObjectByName(const BSFixedString &a_name)
NiTransform world
Definition NiAVObject.h:147
void LoadBinary(NiStream &a_stream) override
std::uint16_t unk10A
Definition NiAVObject.h:156
void LinkObject(NiStream &a_stream) override
~NiAVObject() override
bhkCollisionObject * GetCollisionObject() const
bool HasAnimation() const
virtual void PostAttachUpdate()
void ProcessClone(NiCloningProcess &a_cloning) override
bool HasShaderType(BSShaderMaterial::Feature a_type)
virtual void AttachProperty(NiAlphaProperty *a_property)
NiPointer< NiCollisionObject > collisionObject
Definition NiAVObject.h:145
virtual void SetMaterialNeedsUpdate(bool a_needsUpdate)
virtual void UpdateWorldData(NiUpdateData *a_data)
void SaveBinary(NiStream &a_stream) override
void CullNode(bool a_cull)
void SetCollisionLayerAndGroup(COL_LAYER a_collisionLayer, std::uint32_t a_group)
NiBound worldBound
Definition NiAVObject.h:149
bool SetMotionType(hkpMotion::MotionType a_motionType, bool a_recurse=true, bool a_force=false, bool a_allowActivate=true)
virtual void UpdateControllers(NiUpdateData &a_data)
virtual void UpdateWorldBound()
TESObjectREFR * userData
Definition NiAVObject.h:151
virtual void OnVisible(NiCullingProcess &a_process)
void SetAppCulled(bool a_cull)
virtual void SetDefaultMaterialNeedsUpdateFlag(bool a_flag)
float fadeAmount
Definition NiAVObject.h:152
std::uint32_t unk03C
Definition NiAVObject.h:144
TESObjectREFR * GetUserData() const
NiAVObject * Clone()
bool IsEqual(NiObject *a_object) override
void RemoveDecals()
std::uint8_t flags02
Definition NiAVObject.h:155
NiTransform local
Definition NiAVObject.h:146
void TintScenegraph(const NiColorA &a_color)
Flag
Definition NiAVObject.h:58
bool RegisterStreamables(NiStream &a_stream) override
std::uint32_t lastUpdatedFrameCounter
Definition NiAVObject.h:153
bool GetAppCulled() const
void CullGeometry(bool a_cull)
virtual void UpdateTransformAndBounds(NiUpdateData &a_data)
std::uint32_t pad10C
Definition NiAVObject.h:157
void UpdateMaterialAlpha(float a_alpha, bool a_doOnlySkin)
virtual void UpdateDownwardPass(NiUpdateData &a_data, std::uint32_t a_arg2)
Definition NiAlphaProperty.h:8
Definition NiBound.h:8
Definition NiCloningProcess.h:10
Definition NiColor.h:281
Definition NiColor.h:11
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:29
Definition NiTransform.h:9
Definition NiAVObject.h:26
float time
Definition NiAVObject.h:35
REX::EnumSet< Flag, std::uint32_t > flags
Definition NiAVObject.h:36
Flag
Definition NiAVObject.h:29
Definition NiAVObject.h:41
virtual ~PerformOpFunc()
virtual bool operator()(NiAVObject *a_object)
Definition TESObjectREFR.h:114
Definition bhkCollisionObject.h:8
MotionType
Definition hkpMotion.h:27
Definition AbsorbEffect.h:6
constexpr REL::ID RTTI_NiAVObject(static_cast< std::uint64_t >(684827))
constexpr REL::ID NiRTTI_NiAVObject(static_cast< std::uint64_t >(523895))
constexpr std::array< REL::ID, 1 > VTABLE_NiAVObject
Definition Offsets_VTABLE.h:12141
COL_LAYER
Definition CollisionLayers.h:6