CommonLibSSE (Parapets fork)
BSNavmesh.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include "RE/B/BSTHashMap.h"
5 #include "RE/B/BSTSmartPointer.h"
6 #include "RE/M/MemoryManager.h"
7 #include "RE/N/NiPoint3.h"
8 #include "RE/N/NiSmartPointer.h"
9 
10 namespace RE
11 {
12  class BSNavmeshObstacleData;
13  class BSNavmeshObstacleUndoData;
14  class BSPathingCell;
15  class BSPathingDoor;
16 
18  {
19  kInvalid = static_cast<std::underlying_type_t<EDGE_EXTRA_INFO_TYPE>>(-1),
20  kPortal = 0,
21  kLedgeUp = 1,
22  kLedgeDown = 2,
23  kEnableDisablePortal = 3
24  };
25 
27  {
28  public:
29  // members
31  };
32  static_assert(sizeof(BSNavmeshVertex) == 0xC);
33 
35  {
36  public:
37  // reference:
38  // edge 0-1 = 0
39  // edge 1-2 = 1
40  // edge 2-0 = 2
41  enum class TriangleFlag
42  {
43  kNone = 0,
44  kEdge0_Link = 1 << 0,
45  kEdge1_Link = 1 << 1,
46  kEdge2_Link = 1 << 2,
47  kDeleted = 1 << 3,
48  kNoLargeCreatures = 1 << 4,
49  kOverlapping = 1 << 5,
50  kPreferred = 1 << 6,
51  };
52 
53  // reference:
54  // quarter = 1/4
55  // half = 2/4
56  // tri = 3/4
57  // full = 4/4
58  enum class TraversalFlag
59  {
60  kNone = 0,
61  kEdge0_CoverValueQuarter = 1 << 0,
62  kEdge0_CoverValueHalf = 1 << 1,
63  kEdge0_CoverValueTri = 1 << 2,
64  kEdge0_CoverValueFull = 1 << 3,
65  kEdge0_Left = 1 << 4,
66  kEdge0_Right = 1 << 5,
67  kEdge1_CoverValueQuarter = 1 << 6,
68  kEdge1_CoverValueHalf = 1 << 7,
69  kEdge1_CoverValueTri = 1 << 8,
70  kEdge1_CoverValueFull = 1 << 9,
71  kEdge1_Left = 1 << 10,
72  kEdge1_Right = 1 << 11
73  };
74 
75  // members
76  std::uint16_t vertices[3]; // 00
77  std::uint16_t triangles[3]; // 06 - 0xFF == NONE
80  };
81  static_assert(sizeof(BSNavmeshTriangle) == 0x10);
82 
84  {
85  public:
86  // members
88  std::uint16_t triangle; // 4
89  std::int8_t edgeIndex; // 6
90  std::uint8_t pad7; // 7
91  };
92  static_assert(sizeof(BSNavmeshTriangleEdgePortal) == 0x8);
93 
95  {
96  public:
97  // members
100  };
101  static_assert(sizeof(BSNavmeshEdgeExtraInfo) == 0xC);
102 
104  {
105  public:
106  // members
108  std::uint16_t owningTriangleIndex; // 08
109  std::uint16_t pad0A; // 0A
110  std::uint32_t pad0C; // 0C
111  };
112  static_assert(sizeof(BSNavmeshTriangleDoorPortal) == 0x10);
113 
115  {
116  public:
117  // members
119  std::uint16_t triangleIndex; // 08
120  std::uint16_t pad0A; // 0A
121  std::uint32_t pad0C; // 0C
122  };
123  static_assert(sizeof(BSNavmeshClosedDoorInfo) == 0x10);
124 
126  {
127  public:
128  // members
129  std::uint16_t vertices[2]; // 00
130  std::uint32_t data; // 08
131  };
132  static_assert(sizeof(BSNavmeshCoverEdge) == 0x8);
133 
135  {
136  public:
137  // members
138  std::uint32_t gridSize; // 00
139  float columnSectionLen; // 04
140  float rowSectionLen; // 08
143  std::uint32_t pad24; // 14
145  };
146  static_assert(sizeof(BSNavmeshGrid) == 0x30);
147 
148  class BSNavmesh : public BSIntrusiveRefCounted // NVNM
149  {
150  public:
151  inline static constexpr auto RTTI = RTTI_BSNavmesh;
152 
153  virtual ~BSNavmesh(); // 00
154 
155  // add
156  virtual std::uint32_t QNavmeshID() = 0; // 01
157 
158  // members
159  std::uint32_t pad00C; // 00C
169  BSTArray<void*> unk0F0; // 0F0 - obstaclePOVs/disabledLinks?
171  void* unk110; // 110 - navmeshInfo?
172  };
173  static_assert(sizeof(BSNavmesh) == 0x118);
174 }
Definition: BSNavmesh.h:149
void * unk110
Definition: BSNavmesh.h:171
BSTArray< BSNavmeshTriangle > triangles
Definition: BSNavmesh.h:161
static constexpr auto RTTI
Definition: BSNavmesh.h:151
virtual ~BSNavmesh()
BSNavmeshGrid meshGrid
Definition: BSNavmesh.h:166
BSTArray< BSNavmeshVertex > vertices
Definition: BSNavmesh.h:160
BSTArray< BSNavmeshCoverEdge > coverArray
Definition: BSNavmesh.h:165
BSTSmartPointer< BSPathingCell > parentCell
Definition: BSNavmesh.h:170
BSTArray< BSNavmeshTriangleDoorPortal > doorPortals
Definition: BSNavmesh.h:163
BSTArray< NiPointer< BSNavmeshObstacleUndoData > > obstacles
Definition: BSNavmesh.h:167
std::uint32_t pad00C
Definition: BSNavmesh.h:159
BSTArray< BSNavmeshClosedDoorInfo > closedDoors
Definition: BSNavmesh.h:164
BSTHashMap< std::uint16_t, NiPointer< BSNavmeshObstacleData > > * triangleToObstacleMap
Definition: BSNavmesh.h:168
BSTArray< BSNavmeshEdgeExtraInfo > extraEdgeInfo
Definition: BSNavmesh.h:162
BSTArray< void * > unk0F0
Definition: BSNavmesh.h:169
virtual std::uint32_t QNavmeshID()=0
Definition: BSTArray.h:377
Definition: BSTHashMap.h:21
Definition: NiPoint3.h:6
Definition: MemoryManager.h:166
Definition: AbsorbEffect.h:6
EDGE_EXTRA_INFO_TYPE
Definition: BSNavmesh.h:18
constexpr REL::ID RTTI_BSNavmesh
Definition: Offsets_RTTI.h:1951
std::uint32_t FormID
Definition: BSCoreTypes.h:5
Definition: BSIntrusiveRefCounted.h:8
Definition: BSNavmesh.h:115
std::uint16_t pad0A
Definition: BSNavmesh.h:120
std::uint32_t pad0C
Definition: BSNavmesh.h:121
BSTSmartPointer< BSPathingDoor > door
Definition: BSNavmesh.h:118
std::uint16_t triangleIndex
Definition: BSNavmesh.h:119
Definition: BSNavmesh.h:126
std::uint16_t vertices[2]
Definition: BSNavmesh.h:129
std::uint32_t data
Definition: BSNavmesh.h:130
Definition: BSNavmesh.h:95
stl::enumeration< EDGE_EXTRA_INFO_TYPE, std::uint32_t > type
Definition: BSNavmesh.h:98
BSNavmeshTriangleEdgePortal portal
Definition: BSNavmesh.h:99
Definition: BSNavmesh.h:135
NiPoint3 gridBoundsMax
Definition: BSNavmesh.h:142
SimpleArray< BSTArray< std::uint16_t > > gridData
Definition: BSNavmesh.h:144
float columnSectionLen
Definition: BSNavmesh.h:139
std::uint32_t gridSize
Definition: BSNavmesh.h:138
std::uint32_t pad24
Definition: BSNavmesh.h:143
NiPoint3 gridBoundsMin
Definition: BSNavmesh.h:141
float rowSectionLen
Definition: BSNavmesh.h:140
Definition: BSNavmesh.h:104
std::uint16_t owningTriangleIndex
Definition: BSNavmesh.h:108
std::uint32_t pad0C
Definition: BSNavmesh.h:110
std::uint16_t pad0A
Definition: BSNavmesh.h:109
BSTSmartPointer< BSPathingDoor > door
Definition: BSNavmesh.h:107
Definition: BSNavmesh.h:84
std::uint16_t triangle
Definition: BSNavmesh.h:88
std::uint8_t pad7
Definition: BSNavmesh.h:90
FormID otherMeshID
Definition: BSNavmesh.h:87
std::int8_t edgeIndex
Definition: BSNavmesh.h:89
Definition: BSNavmesh.h:35
stl::enumeration< TraversalFlag, std::uint16_t > traversalFlags
Definition: BSNavmesh.h:79
TriangleFlag
Definition: BSNavmesh.h:42
stl::enumeration< TriangleFlag, std::uint16_t > triangleFlags
Definition: BSNavmesh.h:78
std::uint16_t triangles[3]
Definition: BSNavmesh.h:77
std::uint16_t vertices[3]
Definition: BSNavmesh.h:76
TraversalFlag
Definition: BSNavmesh.h:59
Definition: BSNavmesh.h:27
NiPoint3 location
Definition: BSNavmesh.h:30