CommonLibVR
TESObjectCELL.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/B/BSAtomic.h"
4 #include "RE/B/BSBitField.h"
5 #include "RE/B/BSContainer.h"
7 #include "RE/B/BSPointerHandle.h"
8 #include "RE/B/BSTArray.h"
9 #include "RE/B/BSTHashMap.h"
10 #include "RE/B/BSTList.h"
11 #include "RE/C/Color.h"
12 #include "RE/E/ExtraDataList.h"
13 #include "RE/F/FormTypes.h"
14 #include "RE/I/InteriorData.h"
15 #include "RE/N/NiSmartPointer.h"
16 #include "RE/N/NiTMap.h"
17 #include "RE/T/TESForm.h"
18 #include "RE/T/TESFullName.h"
19 #include "RE/T/TESObjectREFR.h"
20 
21 namespace RE
22 {
23  class TESRegionList;
24 
25  namespace BGSWaterCollisionManager
26  {
27  class BGSWaterUpdateI;
28  }
29 
31  class bhkWorld;
32  class BSPortalGraph;
33  class NavMesh;
34  class NiNode;
35 
37  {
38  public:
39  // members
41  private:
42  KEEP_FOR_RE()
43  };
44  static_assert(sizeof(BGSTerrainVisibilityData) == 0x8);
45 
46  struct EXTERIOR_DATA // XCLC
47  {
48  public:
49  enum class LandHideFlag
50  {
51  kNone = 0,
52  kQuad1 = 1 << 0,
53  kQuad2 = 1 << 1,
54  kQuad3 = 1 << 2,
55  kQuad4 = 1 << 3
56  };
57 
58  // members
59  std::int32_t cellX; // 00
60  std::int32_t cellY; // 04
61  char* maxHeightData; // 08
63  float worldX; // 18
64  float worldY; // 1C
66  std::uint8_t pad21; // 21
67  std::uint16_t pad22; // 22
68  std::uint32_t pad24; // 24
69  };
70  static_assert(sizeof(EXTERIOR_DATA) == 0x28);
71 
73  {
74  public:
75  // members
77  private:
78  KEEP_FOR_RE()
79  };
80  static_assert(sizeof(NavMeshArray) == 0x18);
81 
83  {
84  public:
85  // members
88  NiPointer<NiNode> lightMarkerNode; // 010 - smart ptr
89  NiPointer<NiNode> soundMarkerNode; // 018 - smart ptr
90  NiPointer<NiNode> multiBoundNode; // 020 - smart ptr
91  std::uint64_t unk028; // 028
92  std::uint64_t unk030; // 030
93  std::uint64_t unk038; // 038
102  std::uint64_t unk110; // 110
107  bool decalsQueued; // 168
108  volatile mutable std::int32_t criticalQueuedRefCount; // 16C
109  volatile mutable std::int32_t queuedRefCount; // 170
110  volatile mutable std::int32_t queuedDistantRefCount; // 174
111  std::int32_t unk178; // 178
112  bool refsFullyLoaded; // 17C
113  };
114  static_assert(sizeof(LOADED_CELL_DATA) == 0x180);
115 
117  public TESForm, // 000
118  public TESFullName // 020
119  {
120  public:
121  inline static constexpr auto RTTI = RTTI_TESObjectCELL;
122  inline static constexpr auto VTABLE = VTABLE_TESObjectCELL;
123  inline static constexpr auto FORMTYPE = FormType::Cell;
124 
125  enum class Flag // DATA
126  {
127  kNone = 0,
128  kIsInteriorCell = 1 << 0,
129  kHasWater = 1 << 1,
130  kCanTravelFromHere = 1 << 2,
131  kNoLODWater = 1 << 3,
132  kHasTempData = 1 << 4,
133  kPublicArea = 1 << 5,
134  kHandChanged = 1 << 6,
135  kShowSky = 1 << 7,
136  kUseSkyLighting = 1 << 8,
137  kWarnToLeave = 1 << 9
138  };
139 
140  enum class CellState
141  {
142  kAttached = 7
143  };
144 
145  struct ChangeFlags
146  {
147  enum ChangeFlag : std::uint32_t
148  {
149  kFlags = 1 << 1,
150  kFullName = 1 << 2,
151  kOwnership = 1 << 3,
152  kExteriorShort = 1 << 28,
153  kExteriorChar = 1 << 29,
154  kDetachTime = 1 << 30,
155  kSeendData = (std::uint32_t)1 << 31
156  };
157  };
158 
159  struct RecordFlags
160  {
161  enum RecordFlag : std::uint32_t
162  {
163  kDeleted = 1 << 5,
164  kPersistent = 1 << 10,
165  kIgnored = 1 << 12,
166  kOffLimits = 1 << 17,
167  kCompressed = 1 << 18,
168  kCantWait = 1 << 19
169  };
170  };
171 
172  union CellData
173  {
176  };
177  static_assert(sizeof(CellData) == 0x8);
178 
179  ~TESObjectCELL() override; // 00
180 
181  // override (TESForm)
182  void ClearData() override; // 05
183  bool Load(TESFile* a_mod) override; // 06
184  TESForm* CreateDuplicateForm(bool a_createEditorID, void* a_arg2) override; // 09 - { return 0; }
185  bool FindInFileFast(TESFile* a_mod) override; // 0C
186  void SaveGame(BGSSaveFormBuffer* a_buf) override; // 0E
187  void LoadGame(BGSLoadFormBuffer* a_buf) override; // 0F
188  void Revert(BGSLoadFormBuffer* a_buf) override; // 12
189  void InitItemImpl() override; // 13
190  void GetFormDetailedString(char* a_buf, std::uint32_t a_bufLen) override; // 16
191  void SetAltered(bool a_set) override; // 24
192  bool BelongsInGroup(FORM* a_form, bool a_allowParentGroups, bool a_currentOnly) override; // 30
193  void CreateGroupData(FORM* a_form, FORM_GROUP* a_group) override; // 31
194  const char* GetFormEditorID() const override; // 32
195  bool SetFormEditorID(const char* a_str) override; // 33
196  bool IsParentForm() override; // 34 - { return true; }
197  bool IsFormTypeChild(FormType a_type) override; // 36
198 
201  void ForEachReference(std::function<BSContainer::ForEachResult(TESObjectREFR*)> a_callback) const;
202  void ForEachReferenceInRange(const NiPoint3& a_origin, float a_radius, std::function<BSContainer::ForEachResult(TESObjectREFR*)> a_callback) const;
209  float GetExteriorWaterHeight() const;
210  TESRegionList* GetRegionList(bool a_createIfMissing);
211  bool GetWaterHeight(const NiPoint3& a_pos, float& a_waterHeight);
212  bool IsAttached() const;
213  bool IsExteriorCell() const;
214  bool IsInteriorCell() const;
215  void SetActorOwner(TESNPC* a_owner);
216  void SetFactionOwner(TESFaction* a_owner);
217  void SetFogColor(Color a_near, Color a_far);
218  void SetFogPlanes(float a_near, float a_far);
219  void SetFogPower(float a_power);
220  void SetHandChanged(bool a_changed);
221  void SetOwner(TESForm* a_owner);
222  void SetPublic(bool a_public);
223  bool UsesSkyLighting() const;
224 
225  // members
226  mutable BSSpinLock grassCreateLock; // 030
227  mutable BSSpinLock grassTaskLock; // 038
229  std::uint16_t cellGameFlags; // 042
231  bool autoWaterLoaded; // 045
232  bool cellDetached; // 046
233  std::uint8_t pad047; // 047
235  CellData cellData; // 060 - XCLL if interior, XCLC if exterior
237  float waterHeight; // 070 - XCLW
240  TESForm* unk0B0; // 0B0 - REFR owner of cell?
245  mutable BSSpinLock spinLock; // 118
249  std::uint64_t unk138; // 138
250  private:
251  KEEP_FOR_RE()
252  };
253 #ifndef SKYRIM_SUPPORT_AE
254  static_assert(sizeof(TESObjectCELL) == 0x140);
255 #else
256  static_assert(sizeof(TESObjectCELL) == 0x148);
257 #endif
258 }
#define KEEP_FOR_RE()
Definition: PCH.h:713
Definition: BGSEncounterZone.h:43
Definition: BGSLightingTemplate.h:11
Definition: BGSLoadFormBuffer.h:11
Definition: BGSLocation.h:68
Definition: BGSSaveFormBuffer.h:8
Definition: TESObjectCELL.h:37
BSBitField * visData
Definition: TESObjectCELL.h:40
Definition: BSBitField.h:17
Definition: BSPortalGraph.h:13
Definition: BSTList.h:10
Definition: BSAtomic.h:92
Definition: BSTArray.h:378
Definition: BSTHashMap.h:21
Definition: BSTempEffectParticle.h:19
Definition: ExtraDataList.h:51
Definition: TESObjectCELL.h:73
BSTArray< BSTSmartPointer< NavMesh > > navMeshes
Definition: TESObjectCELL.h:76
Definition: NavMesh.h:14
Definition: NiNode.h:12
Definition: NiPoint3.h:6
Definition: NiSmartPointer.h:9
Definition: NiTMap.h:10
Definition: TESFaction.h:120
Definition: TESFile.h:17
Definition: TESForm.h:40
Definition: TESFullName.h:9
Definition: TESNPC.h:36
Definition: TESObjectCELL.h:119
bool BelongsInGroup(FORM *a_form, bool a_allowParentGroups, bool a_currentOnly) override
BGSLightingTemplate * lightingTemplate
Definition: TESObjectCELL.h:248
bool IsExteriorCell() const
bool SetFormEditorID(const char *a_str) override
bool Load(TESFile *a_mod) override
void SetFogColor(Color a_near, Color a_far)
CellData cellData
Definition: TESObjectCELL.h:235
void SetOwner(TESForm *a_owner)
TESWorldSpace * worldSpace
Definition: TESObjectCELL.h:246
BSSpinLock grassCreateLock
Definition: TESObjectCELL.h:226
float GetNorthRotation()
TESForm * unk0B0
Definition: TESObjectCELL.h:240
bool cellDetached
Definition: TESObjectCELL.h:232
void LoadGame(BGSLoadFormBuffer *a_buf) override
void SetFogPower(float a_power)
void ForEachReferenceInRange(const NiPoint3 &a_origin, float a_radius, std::function< BSContainer::ForEachResult(TESObjectREFR *)> a_callback) const
void SetAltered(bool a_set) override
std::uint8_t pad047
Definition: TESObjectCELL.h:233
bool IsFormTypeChild(FormType a_type) override
TESForm * CreateDuplicateForm(bool a_createEditorID, void *a_arg2) override
TESForm * GetOwner()
void SetHandChanged(bool a_changed)
TESFaction * GetFactionOwner()
bool IsParentForm() override
stl::enumeration< Flag, std::uint16_t > cellFlags
Definition: TESObjectCELL.h:228
bool IsInteriorCell() const
CellState
Definition: TESObjectCELL.h:141
void InitItemImpl() override
std::uint64_t unk138
Definition: TESObjectCELL.h:249
NavMeshArray * navMeshes
Definition: TESObjectCELL.h:238
BSTSet< NiPointer< TESObjectREFR > > references
Definition: TESObjectCELL.h:239
BSSpinLock grassTaskLock
Definition: TESObjectCELL.h:227
void ClearData() override
float GetExteriorWaterHeight() const
BSSpinLock spinLock
Definition: TESObjectCELL.h:245
bhkWorld * GetbhkWorld() const
void SetActorOwner(TESNPC *a_owner)
INTERIOR_DATA * GetLighting()
bool GetWaterHeight(const NiPoint3 &a_pos, float &a_waterHeight)
Flag
Definition: TESObjectCELL.h:126
stl::enumeration< CellState, std::uint8_t > cellState
Definition: TESObjectCELL.h:230
LOADED_CELL_DATA * loadedData
Definition: TESObjectCELL.h:247
static constexpr auto RTTI
Definition: TESObjectCELL.h:121
BSTArray< void * > unk0D0
Definition: TESObjectCELL.h:242
static constexpr auto FORMTYPE
Definition: TESObjectCELL.h:123
TESNPC * GetActorOwner()
void ForEachReference(std::function< BSContainer::ForEachResult(TESObjectREFR *)> a_callback) const
std::uint16_t cellGameFlags
Definition: TESObjectCELL.h:229
bool IsAttached() const
void GetFormDetailedString(char *a_buf, std::uint32_t a_bufLen) override
void CreateGroupData(FORM *a_form, FORM_GROUP *a_group) override
~TESObjectCELL() override
void Revert(BGSLoadFormBuffer *a_buf) override
EXTERIOR_DATA * GetCoordinates()
void SaveGame(BGSSaveFormBuffer *a_buf) override
void SetFactionOwner(TESFaction *a_owner)
bool autoWaterLoaded
Definition: TESObjectCELL.h:231
BSTArray< TESObjectREFR * > objectList
Definition: TESObjectCELL.h:241
void SetPublic(bool a_public)
float waterHeight
Definition: TESObjectCELL.h:237
bool FindInFileFast(TESFile *a_mod) override
void SetFogPlanes(float a_near, float a_far)
TESObjectLAND * cellLand
Definition: TESObjectCELL.h:236
BSTArray< BGSWaterCollisionManager::BGSWaterUpdateI * > waterObjects
Definition: TESObjectCELL.h:243
static constexpr auto VTABLE
Definition: TESObjectCELL.h:122
BGSLocation * GetLocation() const
bool UsesSkyLighting() const
const char * GetFormEditorID() const override
BSTArray< void * > unk100
Definition: TESObjectCELL.h:244
ExtraDataList extraList
Definition: TESObjectCELL.h:234
TESRegionList * GetRegionList(bool a_createIfMissing)
Definition: TESObjectLAND.h:46
Definition: TESObjectREFR.h:113
Definition: TESRegionList.h:10
Definition: TESWorldSpace.h:120
Definition: bhkWorld.h:14
ForEachResult
Definition: BSContainer.h:6
Definition: AbsorbEffect.h:6
constexpr REL::ID RTTI_TESObjectCELL(static_cast< std::uint64_t >(513892))
constexpr std::array< REL::ID, 2 > VTABLE_TESObjectCELL
Definition: Offsets_VTABLE.h:12861
FormType
Definition: FormTypes.h:139
Definition: Color.h:8
Definition: TESObjectCELL.h:47
std::int32_t cellY
Definition: TESObjectCELL.h:60
BGSTerrainVisibilityData * lodVisData
Definition: TESObjectCELL.h:62
std::uint32_t pad24
Definition: TESObjectCELL.h:68
std::int32_t cellX
Definition: TESObjectCELL.h:59
LandHideFlag
Definition: TESObjectCELL.h:50
char * maxHeightData
Definition: TESObjectCELL.h:61
float worldY
Definition: TESObjectCELL.h:64
std::uint16_t pad22
Definition: TESObjectCELL.h:67
std::uint8_t pad21
Definition: TESObjectCELL.h:66
stl::enumeration< LandHideFlag, std::uint8_t > landHideFlags
Definition: TESObjectCELL.h:65
float worldX
Definition: TESObjectCELL.h:63
Definition: FORM.h:20
Definition: FORM.h:6
Definition: InteriorData.h:9
Definition: TESObjectCELL.h:83
BSTArray< ObjectRefHandle > unk040
Definition: TESObjectCELL.h:94
NiTMap< ObjectRefHandle, NiNode * > emittanceLightRefMap
Definition: TESObjectCELL.h:97
volatile std::int32_t queuedDistantRefCount
Definition: TESObjectCELL.h:110
NiPointer< NiNode > multiBoundNode
Definition: TESObjectCELL.h:90
NiTMap< TESForm *, ObjectRefHandle > emittanceSourceRefMap
Definition: TESObjectCELL.h:96
BSTArray< ObjectRefHandle > decalRefs
Definition: TESObjectCELL.h:104
NiPointer< NiNode > lightMarkerNode
Definition: TESObjectCELL.h:88
std::uint64_t unk028
Definition: TESObjectCELL.h:91
std::int32_t unk178
Definition: TESObjectCELL.h:111
BSSimpleList< ObjectRefHandle > unk100
Definition: TESObjectCELL.h:101
volatile std::int32_t queuedRefCount
Definition: TESObjectCELL.h:109
NiTMap< ObjectRefHandle, NiPointer< BSMultiBoundNode > > multiboundRefMap
Definition: TESObjectCELL.h:98
volatile std::int32_t criticalQueuedRefCount
Definition: TESObjectCELL.h:108
std::uint64_t unk038
Definition: TESObjectCELL.h:93
std::uint64_t unk030
Definition: TESObjectCELL.h:92
bool refsFullyLoaded
Definition: TESObjectCELL.h:112
BSTArray< void * > unk118
Definition: TESObjectCELL.h:103
NiTMap< BSMultiBoundNode *, ObjectRefHandle > refMultiboundMap
Definition: TESObjectCELL.h:99
NiPointer< BSPortalGraph > portalGraph
Definition: TESObjectCELL.h:86
NiPointer< NiNode > cell3D
Definition: TESObjectCELL.h:87
BSTArray< ObjectRefHandle > skyActors
Definition: TESObjectCELL.h:105
BGSEncounterZone * encounterZone
Definition: TESObjectCELL.h:106
NiPointer< NiNode > soundMarkerNode
Definition: TESObjectCELL.h:89
BSSimpleList< ObjectRefHandle > activatingRefs
Definition: TESObjectCELL.h:100
BSTArray< ObjectRefHandle > flickeringLights
Definition: TESObjectCELL.h:95
bool decalsQueued
Definition: TESObjectCELL.h:107
std::uint64_t unk110
Definition: TESObjectCELL.h:102
Definition: TESObjectCELL.h:146
ChangeFlag
Definition: TESObjectCELL.h:148
@ kFullName
Definition: TESObjectCELL.h:150
@ kExteriorShort
Definition: TESObjectCELL.h:152
@ kSeendData
Definition: TESObjectCELL.h:155
@ kFlags
Definition: TESObjectCELL.h:149
@ kDetachTime
Definition: TESObjectCELL.h:154
@ kExteriorChar
Definition: TESObjectCELL.h:153
@ kOwnership
Definition: TESObjectCELL.h:151
Definition: TESObjectCELL.h:160
RecordFlag
Definition: TESObjectCELL.h:162
@ kIgnored
Definition: TESObjectCELL.h:165
@ kOffLimits
Definition: TESObjectCELL.h:166
@ kPersistent
Definition: TESObjectCELL.h:164
@ kCompressed
Definition: TESObjectCELL.h:167
@ kDeleted
Definition: TESObjectCELL.h:163
@ kCantWait
Definition: TESObjectCELL.h:168
Definition: TESObjectCELL.h:173
EXTERIOR_DATA * exterior
Definition: TESObjectCELL.h:174
INTERIOR_DATA * interior
Definition: TESObjectCELL.h:175