You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Notable changes: - Added FNavigationOctreeController that wraps up what used to be NavigationSystemV1's navoctree-related logic - Added FNavigationDirtyAreasController that wraps up what used to be NavigationSystemV1's DirtyAreas-related logic - Added FNavigationDataHandler that is a helper struct that wraps up what used to be NavigationSystemV1's logic related to operation involving both navoctree and dirty areas - Deprecated both FNavDataConfig.NavigationDataClass and FNavDataConfig.NavigationDataClassName and replaced them with a single NavDataClass property - FNavigationOctree is not responsible for hashing element objects and storing their ElementId - NavOctree elements how know about the octree they belong to (via a member property). [at]Yoan.StAmant, [at]Maxime.Mercier, [at]Guillaume.Guay #rb Yoan.StAmant #ROBOMERGE-OWNER: ben.marsh #ROBOMERGE-AUTHOR: mieszko.zielinski #ROBOMERGE-SOURCE: CL 7249089 via CL 7262555 via CL 7262559 #ROBOMERGE-BOT: BUILD (Main -> Dev-Build) (v371-7306989) [CL 7334880 by mieszko zielinski in Dev-Build branch]
60 lines
1.8 KiB
C++
60 lines
1.8 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 != NULL)
|
|
{
|
|
if (NavOctree->IsValidElementId(*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* OctreeID = GetObjectsNavOctreeId(Object);
|
|
|
|
if (OctreeID != nullptr && ensure(NavOctree.IsValid()) && NavOctree->IsValidElementId(*OctreeID))
|
|
{
|
|
return NavOctree->GetDataForID(*OctreeID);
|
|
}
|
|
|
|
return nullptr;
|
|
}
|
|
|
|
FNavigationRelevantData* FNavigationOctreeController::GetMutableDataForObject(const UObject& Object)
|
|
{
|
|
return const_cast<FNavigationRelevantData*>(GetDataForObject(Object));
|
|
} |