CommonLibVR
Loading...
Searching...
No Matches
BSGeometry.h
Go to the documentation of this file.
1#pragma once
2
4#include "RE/N/NiAVObject.h"
5#include "RE/N/NiRTTI.h"
8
9namespace RE
10{
11 class BSMultiIndexTriShape;
12 class BSSkinnedDecalTriShape;
13 class NiProperty;
14 class NiSkinInstance;
15
16 class BSGeometry : public NiAVObject
17 {
18 public:
19 inline static constexpr auto RTTI = RTTI_BSGeometry;
20 inline static constexpr auto Ni_RTTI = NiRTTI_BSGeometry;
21 inline static constexpr auto VTABLE = VTABLE_BSGeometry;
22
41
42 struct States
43 {
50 };
51
52 ~BSGeometry() override; // 00
53
54 // override (NiAVObject)
55 const NiRTTI* GetRTTI() const override; // 02
56 BSGeometry* AsGeometry() override; // 07 - { return this; }
57 void LoadBinary(NiStream& a_stream) override; // 18
58 void LinkObject(NiStream& a_stream) override; // 19
59 bool RegisterStreamables(NiStream& a_stream) override; // 1A
60 void SaveBinary(NiStream& a_stream) override; // 1B
61 bool IsEqual(NiObject* a_object) override; // 1C - { return false; }
62 void ProcessClone(NiCloningProcess& a_cloning) override; // 1D
63 void PostLinkObject(NiStream& a_stream) override; // 1E
64 void AttachProperty(NiAlphaProperty* a_property) override; // 27
65 void SetSelectiveUpdateFlags(bool& a_selectiveUpdate, bool a_selectiveUpdateTransforms, bool& a_rigid) override; // 2B
66 void UpdateDownwardPass(NiUpdateData& a_data, std::uint32_t a_arg2) override; // 2C
67 void UpdateSelectedDownwardPass(NiUpdateData& a_data, std::uint32_t a_arg2) override; // 2D
68 void UpdateRigidDownwardPass(NiUpdateData& a_data, std::uint32_t a_arg2) override; // 2E
69 void UpdateWorldBound() override; // 2F
70 void OnVisible(NiCullingProcess& a_process) override; // 34
71
72 // add
73 virtual BSMultiIndexTriShape* AsMultiIndexTriShape(); // 35 - { return 0; }
74 virtual BSSkinnedDecalTriShape* AsSkinnedDecalTriShape(); // 36 - { return 0; }
75 virtual void Unk_37(void); // 37 - { return 0; }
76
78 {
79 if (auto effect = properties[States::kEffect].get(); effect) {
80 if (auto rtti = effect->GetRTTI(); rtti) {
81 const std::string rttiStr(rtti->GetName());
82 if (rttiStr == "BSLightingShaderProperty") {
83 return static_cast<BSLightingShaderProperty*>(effect);
84 }
85 }
86 }
87 return nullptr;
88 }
89
90// members
91#ifndef SKYRIMVR
92 // members
97 void* unk140; // 140 - smart ptr
100 std::uint8_t pad151; // 151
101 std::uint16_t pad152; // 152
102 std::uint32_t pad154; // 154
103 private:
105 };
106 static_assert(sizeof(BSGeometry) == 0x158);
107#else
108 NiBound modelBound; // 138
109 NiPoint3 unk148; // 148
110 NiPoint3 unk154; // 154
111 NiPointer<NiProperty> properties[States::kTotal]; // 160
112 NiPointer<NiSkinInstance> skinInstance; // 170
113 BSGraphics::TriShape* rendererData; // 178
114 void* unk180; // 180
115 BSGraphics::VertexDesc vertexDesc; // 188
117 std::uint8_t pad191; // 191
118 std::uint16_t pad192; // 192
119 std::uint32_t pad194; // 194
120 private:
122 };
123 static_assert(sizeof(BSGeometry) == 0x198);
124#endif
125}
#define KEEP_FOR_RE()
Definition PCH.h:517
Definition EnumSet.h:9
Definition BSGeometry.h:17
Type
Definition BSGeometry.h:24
void SetSelectiveUpdateFlags(bool &a_selectiveUpdate, bool a_selectiveUpdateTransforms, bool &a_rigid) override
void UpdateRigidDownwardPass(NiUpdateData &a_data, std::uint32_t a_arg2) override
NiBound modelBound
Definition BSGeometry.h:93
REX::EnumSet< Type, std::uint8_t > type
Definition BSGeometry.h:99
BSGraphics::TriShape * rendererData
Definition BSGeometry.h:96
static constexpr auto VTABLE
Definition BSGeometry.h:21
virtual BSSkinnedDecalTriShape * AsSkinnedDecalTriShape()
void SaveBinary(NiStream &a_stream) override
void OnVisible(NiCullingProcess &a_process) override
bool IsEqual(NiObject *a_object) override
NiPointer< NiSkinInstance > skinInstance
Definition BSGeometry.h:95
static constexpr auto RTTI
Definition BSGeometry.h:19
void ProcessClone(NiCloningProcess &a_cloning) override
BSGeometry * AsGeometry() override
bool RegisterStreamables(NiStream &a_stream) override
std::uint8_t pad151
Definition BSGeometry.h:100
NiPointer< NiProperty > properties[States::kTotal]
Definition BSGeometry.h:94
const NiRTTI * GetRTTI() const override
virtual void Unk_37(void)
~BSGeometry() override
void LinkObject(NiStream &a_stream) override
void UpdateWorldBound() override
void UpdateSelectedDownwardPass(NiUpdateData &a_data, std::uint32_t a_arg2) override
void PostLinkObject(NiStream &a_stream) override
BSLightingShaderProperty * lightingShaderProp_cast()
Definition BSGeometry.h:77
virtual BSMultiIndexTriShape * AsMultiIndexTriShape()
void UpdateDownwardPass(NiUpdateData &a_data, std::uint32_t a_arg2) override
std::uint16_t pad152
Definition BSGeometry.h:101
void LoadBinary(NiStream &a_stream) override
void AttachProperty(NiAlphaProperty *a_property) override
BSGraphics::VertexDesc vertexDesc
Definition BSGeometry.h:98
void * unk140
Definition BSGeometry.h:97
static constexpr auto Ni_RTTI
Definition BSGeometry.h:20
std::uint32_t pad154
Definition BSGeometry.h:102
Definition VertexDesc.h:53
Definition BSLightingShaderProperty.h:13
Definition BSMultiIndexTriShape.h:19
Definition NiAVObject.h:57
Definition NiAlphaProperty.h:8
Definition NiBound.h:8
Definition NiCloningProcess.h:10
Definition NiCullingProcess.h:34
Definition NiObject.h:37
Definition NiPoint3.h:6
Definition NiSmartPointer.h:9
Definition NiRTTI.h:6
Definition NiStream.h:29
Definition NiAVObject.h:28
Definition AbsorbEffect.h:6
constexpr REL::ID NiRTTI_BSGeometry(static_cast< std::uint64_t >(523951))
constexpr REL::ID RTTI_BSGeometry(static_cast< std::uint64_t >(685043))
constexpr std::array< REL::ID, 1 > VTABLE_BSGeometry
Definition Offsets_VTABLE.h:9036
Definition BSGeometry.h:43
State
Definition BSGeometry.h:45
@ kProperty
Definition BSGeometry.h:46
@ kEffect
Definition BSGeometry.h:47
@ kTotal
Definition BSGeometry.h:48
Definition NiSkinPartition.h:15