UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
NavigationOctreeController.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4#include "NavigationOctree.h"
6
7
8struct FNavigationDirtyElementKeyFunctions : BaseKeyFuncs<FNavigationDirtyElement, FNavigationElementHandle, /*bInAllowDuplicateKeys*/false>
9{
11 {
12 return Element.NavigationElement->GetHandle();
13 }
14
16 {
17 return A == B;
18 }
19
21 {
22 return GetTypeHash(Key);
23 }
24};
25
27{
29 {
30 OctreeUpdate_Default = 0, // regular update, mark dirty areas depending on exported content
31 OctreeUpdate_Geometry = 1, // full update, mark dirty areas for geometry rebuild
32 OctreeUpdate_Modifiers = 2, // quick update, mark dirty areas for modifier rebuild
33 OctreeUpdate_Refresh = 4, // update is used for refresh, don't invalidate pending queue
34 OctreeUpdate_ParentChain = 8, // update child nodes, don't remove anything
35 };
36
37 UE_DEPRECATED(5.5, "Use PendingUpdates instead.")
41
42 UE_DEPRECATED(5.5, "This container is no longer used. Use AddChild/RemoveChild/GetChildren methods instead.")
44
47
48 inline void SetNavigationOctreeLock(bool bLock);
49
51 UE_DEPRECATED(5.5, "Use HasPendingUpdateForElement instead.")
53
55
56 UE_DEPRECATED(5.5, "Use RemoveNode instead.")
58
60
62
63 inline const FNavigationOctree* GetOctree() const;
65
67 UE_DEPRECATED(5.5, "Use GetNavOctreeIdForElement instead.")
69
71 UE_DEPRECATED(5.5, "Use the version taking ENavigationDirtyFlag& and FNavigationElementHandle as parameter instead.")
73
75 UE_DEPRECATED(5.5, "Use GetDataForElement instead.")
77
79 UE_DEPRECATED(5.5, "Use GetMutableDataForElement instead.")
81
83 UE_DEPRECATED(5.5, "Use HasElementNavOctreeId instead.")
85
87
89 bool IsValid() const { return NavOctree.IsValid(); }
90
91 inline bool IsValidElement(const FOctreeElementId2* ElementId) const;
92 inline bool IsValidElement(const FOctreeElementId2& ElementId) const;
93
94 bool IsEmpty() const
95 {
96 return (IsValid() == false) || NavOctree->GetSizeBytes() == 0;
97 }
98
102
103private:
104 UE_DEPRECATED(5.5, "This method will no be longer be used by the navigation system.")
105 static uint32 HashObject(const UObject& Object);
106
108 TMultiMap<FNavigationElementHandle, const TSharedRef<const FNavigationElement>> OctreeParentChildNodesMap;
109};
110
111//----------------------------------------------------------------------//
112// inlines
113//----------------------------------------------------------------------//
114
115// deprecated
117{
121}
122
124{
125 return NavOctree.IsValid()
126 ? NavOctree->ElementToOctreeId.Find(Element)
127 : nullptr;
128}
129
131{
132 return NavOctree.IsValid() && (NavOctree->ElementToOctreeId.Find(Element) != nullptr);
133}
134
143
145{
146 return NavOctree.Get();
147}
148
153
158
160{
161 bNavOctreeLock = bLock;
162}
163
165{
166 return ElementId && IsValidElement(*ElementId);
167}
168
170{
171 return IsValid() && NavOctree->IsValidElementId(ElementId);
172}
173
178
183
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define PRAGMA_ENABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:12
#define PRAGMA_DISABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:8
ENavigationDirtyFlag
Definition NavigationDirtyArea.h:13
ESPMode
Definition SharedPointerFwd.h:12
uint8_t uint8
Definition binka_ue_file_header.h:8
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition NavigationOctree.h:173
TMap< FNavigationElementHandle, FOctreeElementId2 > ElementToOctreeId
Definition NavigationOctree.h:283
static FORCEINLINE uint32 HashObject(const UObject &Object)
Definition NavigationOctree.h:263
NAVIGATIONSYSTEM_API void RemoveNode(const FOctreeElementId2 &Id)
Definition NavigationOctree.cpp:333
Definition UnrealType.h:3087
Definition GenericOctreePublic.h:15
Definition Array.h:670
bool IsValidElementId(FOctreeElementId2 ElementId) const
Definition GenericOctree.h:916
SIZE_T GetSizeBytes() const
Definition GenericOctree.h:974
Definition SharedPointer.h:692
UE_FORCEINLINE_HINT ObjectType * Get() const
Definition SharedPointer.h:1065
UE_FORCEINLINE_HINT const bool IsValid() const
Definition SharedPointer.h:1085
Definition SharedPointer.h:153
Definition Object.h:95
@ false
Definition radaudio_common.h:23
Definition SetUtilities.h:23
TCallTraits< FNavigationDirtyElement >::ParamType ElementInitType
Definition SetUtilities.h:26
TCallTraits< FNavigationElementHandle >::ParamType KeyInitType
Definition SetUtilities.h:25
Definition NavigationOctreeController.h:9
static FNavigationElementHandle GetSetKey(ElementInitType Element)
Definition NavigationOctreeController.h:10
static bool Matches(KeyInitType A, KeyInitType B)
Definition NavigationOctreeController.h:15
static uint32 GetKeyHash(KeyInitType Key)
Definition NavigationOctreeController.h:20
Definition NavigationDirtyElement.h:13
Definition NavigationElement.h:36
Definition NavigationElement.h:94
Definition NavigationOctreeController.h:27
NAVIGATIONSYSTEM_API FNavigationRelevantData * GetMutableDataForObject(const UObject &Object)
Definition NavigationOctreeController.cpp:72
EOctreeUpdateMode
Definition NavigationOctreeController.h:29
@ OctreeUpdate_Geometry
Definition NavigationOctreeController.h:31
@ OctreeUpdate_Refresh
Definition NavigationOctreeController.h:33
@ OctreeUpdate_ParentChain
Definition NavigationOctreeController.h:34
@ OctreeUpdate_Modifiers
Definition NavigationOctreeController.h:32
@ OctreeUpdate_Default
Definition NavigationOctreeController.h:30
TSharedPtr< FNavigationOctree, ESPMode::ThreadSafe > NavOctree
Definition NavigationOctreeController.h:40
NAVIGATIONSYSTEM_API const FOctreeElementId2 * GetObjectsNavOctreeId(const UObject &Object) const
Definition NavigationOctreeController.cpp:106
void AddChild(FNavigationElementHandle Parent, const TSharedRef< const FNavigationElement > &Child)
Definition NavigationOctreeController.h:174
bool IsNavigationOctreeLocked() const
Definition NavigationOctreeController.h:154
NAVIGATIONSYSTEM_API FNavigationRelevantData * GetMutableDataForElement(FNavigationElementHandle Element)
Definition NavigationOctreeController.cpp:77
NAVIGATIONSYSTEM_API void RemoveObjectsNavOctreeId(const UObject &Object)
Definition NavigationOctreeController.cpp:112
NAVIGATIONSYSTEM_API bool HasPendingObjectNavOctreeId(UObject &Object) const
Definition NavigationOctreeController.cpp:94
void RemoveNode(FOctreeElementId2 ElementId, FNavigationElementHandle GetHandle)
Definition NavigationOctreeController.h:135
const FOctreeElementId2 * GetNavOctreeIdForElement(FNavigationElementHandle Element) const
Definition NavigationOctreeController.h:123
const FNavigationOctree * GetOctree() const
Definition NavigationOctreeController.h:144
TSet< FNavigationDirtyElement > PendingOctreeUpdates
Definition NavigationOctreeController.h:38
TSet< FNavigationDirtyElement, FNavigationDirtyElementKeyFunctions > PendingUpdates
Definition NavigationOctreeController.h:39
NAVIGATIONSYSTEM_API void SetNavigableGeometryStoringMode(FNavigationOctree::ENavGeometryStoringMode NavGeometryMode)
Definition NavigationOctreeController.cpp:25
bool HasElementNavOctreeId(const FNavigationElementHandle Element) const
Definition NavigationOctreeController.h:130
bool IsValid() const
Definition NavigationOctreeController.h:89
void SetNavigationOctreeLock(bool bLock)
Definition NavigationOctreeController.h:159
NAVIGATIONSYSTEM_API bool HasPendingUpdateForElement(FNavigationElementHandle Element) const
Definition NavigationOctreeController.cpp:20
NAVIGATIONSYSTEM_API bool HasObjectsNavOctreeId(const UObject &Object) const
Definition NavigationOctreeController.cpp:100
bool IsEmpty() const
Definition NavigationOctreeController.h:94
NAVIGATIONSYSTEM_API const FNavigationRelevantData * GetDataForElement(FNavigationElementHandle Element) const
Definition NavigationOctreeController.cpp:61
bool IsValidElement(const FOctreeElementId2 *ElementId) const
Definition NavigationOctreeController.h:164
TMultiMap< UObject *, FWeakObjectPtr > OctreeChildNodesMap
Definition NavigationOctreeController.h:43
uint8 bNavOctreeLock
Definition NavigationOctreeController.h:46
NAVIGATIONSYSTEM_API const FNavigationRelevantData * GetDataForObject(const UObject &Object) const
Definition NavigationOctreeController.cpp:56
void GetChildren(FNavigationElementHandle Parent, TArray< const TSharedRef< const FNavigationElement > > &OutChildren) const
Definition NavigationOctreeController.h:184
void RemoveChild(FNavigationElementHandle Parent, const TSharedRef< const FNavigationElement > &Child)
Definition NavigationOctreeController.h:179
NAVIGATIONSYSTEM_API bool GetNavOctreeElementData(FNavigationElementHandle Element, ENavigationDirtyFlag &DirtyFlags, FBox &DirtyBounds)
Definition NavigationOctreeController.cpp:31
NAVIGATIONSYSTEM_API void Reset()
Definition NavigationOctreeController.cpp:10
FNavigationOctree * GetMutableOctree()
Definition NavigationOctreeController.h:149
Definition NavigationRelevantData.h:40
Definition WeakObjectPtr.h:49