You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#rnx [at]maxime.mercier,[at]mieszko.zielinski #rb mieszko.zielinski #ROBOMERGE-OWNER: mieszko.zielinski #ROBOMERGE-AUTHOR: yoan.stamant #ROBOMERGE-SOURCE: CL 7307208 via CL 7315100 #ROBOMERGE-BOT: (v371-7306989) [CL 7318580 by mieszko zielinski in Main branch]
57 lines
1.7 KiB
C++
57 lines
1.7 KiB
C++
// Copyright 1998-2019 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 && ensure(IsValidElement(*ElementId)))
|
|
{
|
|
// mark area occupied by given actor as dirty
|
|
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 && ensure(IsValidElement(*ElementId)))
|
|
{
|
|
return NavOctree->GetDataForID(*ElementId);
|
|
}
|
|
|
|
return nullptr;
|
|
}
|
|
|
|
FNavigationRelevantData* FNavigationOctreeController::GetMutableDataForObject(const UObject& Object)
|
|
{
|
|
return const_cast<FNavigationRelevantData*>(GetDataForObject(Object));
|
|
} |