You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Also changing the interface for better encapsulation by cutting the origial itterator concept and focusing on small subset of configurable itteration strategies instead. #RB Andrew.Scheidecker, Yoan.StAmant #ROBOMERGE-OWNER: arne.schober #ROBOMERGE-AUTHOR: arne.schober #ROBOMERGE-SOURCE: CL 12785392 via CL 12785681 via CL 12785682 #ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v681-12776863) [CL 12786795 by arne schober in Main branch]
57 lines
1.7 KiB
C++
57 lines
1.7 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "NavigationOctreeController.h"
|
|
#include "AI/Navigation/NavRelevantInterface.h"
|
|
#include "NavigationSystem.h"
|
|
|
|
|
|
//----------------------------------------------------------------------//
|
|
// FNavigationOctreeController
|
|
//----------------------------------------------------------------------//
|
|
void FNavigationOctreeController::Reset()
|
|
{
|
|
if (NavOctree.IsValid())
|
|
{
|
|
NavOctree->Destroy();
|
|
NavOctree = NULL;
|
|
}
|
|
PendingOctreeUpdates.Empty(32);
|
|
}
|
|
|
|
void FNavigationOctreeController::SetNavigableGeometryStoringMode(FNavigationOctree::ENavGeometryStoringMode NavGeometryMode)
|
|
{
|
|
check(NavOctree.IsValid());
|
|
NavOctree->SetNavigableGeometryStoringMode(NavGeometryMode);
|
|
}
|
|
|
|
bool FNavigationOctreeController::GetNavOctreeElementData(const UObject& NodeOwner, int32& DirtyFlags, FBox& DirtyBounds)
|
|
{
|
|
const FOctreeElementId* ElementId = GetObjectsNavOctreeId(NodeOwner);
|
|
if (ElementId != nullptr && IsValidElement(*ElementId))
|
|
{
|
|
// mark area occupied by given actor as dirty
|
|
const FNavigationOctreeElement& ElementData = NavOctree->GetElementById(*ElementId);
|
|
DirtyFlags = ElementData.Data->GetDirtyFlag();
|
|
DirtyBounds = ElementData.Bounds.GetBox();
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
const FNavigationRelevantData* FNavigationOctreeController::GetDataForObject(const UObject& Object) const
|
|
{
|
|
const FOctreeElementId* ElementId = GetObjectsNavOctreeId(Object);
|
|
|
|
if (ElementId != nullptr && IsValidElement(*ElementId))
|
|
{
|
|
return NavOctree->GetDataForID(*ElementId);
|
|
}
|
|
|
|
return nullptr;
|
|
}
|
|
|
|
FNavigationRelevantData* FNavigationOctreeController::GetMutableDataForObject(const UObject& Object)
|
|
{
|
|
return const_cast<FNavigationRelevantData*>(GetDataForObject(Object));
|
|
} |