Files
UnrealEngineUWP/Engine/Source/Runtime/NavigationSystem/Public/NavigationDataHandler.h
frederic doll 29180598cb NavDataHandler improvement :
- move the NavOctree construction to be able to log the info
- reduce NavOctree radius to better fit the Navigation bounds. The NavOctree radius was based on the NavBound extent which can be sqrt(2) bigger than what is actually needed
- uniformize components logging to ease debugging

#rb mieszko.zielinski, aris.theophanidis
#preflight 63d943605428dc67b102489b

[CL 23941221 by frederic doll in ue5-main branch]
2023-01-31 18:34:11 -05:00

42 lines
2.5 KiB
C

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "NavigationOctreeController.h"
#include "NavigationDirtyAreasController.h"
struct FNavigationDirtyElement;
struct NAVIGATIONSYSTEM_API FNavigationDataHandler
{
FNavigationOctreeController& OctreeController;
FNavigationDirtyAreasController& DirtyAreasController;
FNavigationDataHandler(FNavigationOctreeController& InOctreeController, FNavigationDirtyAreasController& InDirtyAreasController);
void ConstructNavOctree(const FVector& Origin, const float Radius, const ENavDataGatheringModeConfig DataGatheringMode, const float GatheringNavModifiersWarningLimitTime);
void RemoveNavOctreeElementId(const FOctreeElementId2& ElementId, int32 UpdateFlags);
FSetElementId RegisterNavOctreeElement(UObject& ElementOwner, INavRelevantInterface& ElementInterface, int32 UpdateFlags);
void AddElementToNavOctree(const FNavigationDirtyElement& DirtyElement);
/** Removes associated NavOctreeElement and invalidates associated pending updates. Also removes object from the list of children
* of the NavigationParent, if any.
* @param ElementOwner Object for which we must remove associated NavOctreeElement
* @param ElementInterface Object associated NavRelevantInterface to access NavigationParent when registered as children
* @param UpdateFlags Flags indicating in which context the method is called to allow/forbid certain operations
*
* @return True if associated NavOctreeElement has been removed or pending update has been invalidated; false otherwise.
*/
bool UnregisterNavOctreeElement(UObject& ElementOwner, INavRelevantInterface& ElementInterface, int32 UpdateFlags);
void UpdateNavOctreeElement(UObject& ElementOwner, INavRelevantInterface& ElementInterface, int32 UpdateFlags);
void UpdateNavOctreeParentChain(UObject& ElementOwner, bool bSkipElementOwnerUpdate = false);
bool UpdateNavOctreeElementBounds(UActorComponent& Comp, const FBox& NewBounds, const FBox& DirtyArea);
void FindElementsInNavOctree(const FBox& QueryBox, const FNavigationOctreeFilter& Filter, TArray<FNavigationOctreeElement>& Elements);
bool ReplaceAreaInOctreeData(const UObject& Object, TSubclassOf<UNavArea> OldArea, TSubclassOf<UNavArea> NewArea, bool bReplaceChildClasses);
void AddLevelCollisionToOctree(ULevel& Level);
void RemoveLevelCollisionFromOctree(ULevel& Level);
void UpdateActorAndComponentsInNavOctree(AActor& Actor);
void ProcessPendingOctreeUpdates();
void DemandLazyDataGathering(FNavigationRelevantData& ElementData);
};