You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
+ replaced all methods Describe by LexToString + unified naming from "*ID" to *Handle #preflight 61e85d121000e8c59a78c886 #rb mikko.mononen #ROBOMERGE-AUTHOR: yoan.stamant #ROBOMERGE-SOURCE: CL 18662203 in //UE5/Release-5.0/... via CL 18662234 via CL 18662264 #ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v900-18638592) [CL 18662291 by yoan stamant in ue5-main branch]
59 lines
1.9 KiB
C++
59 lines
1.9 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "SmartObjectOctree.h"
|
|
|
|
//----------------------------------------------------------------------//
|
|
// FSmartObjectOctreeElement
|
|
//----------------------------------------------------------------------//
|
|
FSmartObjectOctreeElement::FSmartObjectOctreeElement(const FBoxCenterAndExtent& InBounds, const FSmartObjectHandle& InSmartObjectHandle, const FSmartObjectOctreeIDSharedRef& InSharedOctreeID)
|
|
: Bounds(InBounds)
|
|
, SmartObjectHandle(InSmartObjectHandle)
|
|
, SharedOctreeID(InSharedOctreeID)
|
|
{
|
|
}
|
|
|
|
//----------------------------------------------------------------------//
|
|
// FSmartObjectOctree
|
|
//----------------------------------------------------------------------//
|
|
FSmartObjectOctree::FSmartObjectOctree()
|
|
: FSmartObjectOctree(FVector::ZeroVector, 0)
|
|
{
|
|
|
|
}
|
|
|
|
FSmartObjectOctree::FSmartObjectOctree(const FVector& Origin, float Radius)
|
|
: TOctree2<FSmartObjectOctreeElement, FSmartObjectOctreeSemantics>(Origin, Radius)
|
|
{
|
|
}
|
|
|
|
FSmartObjectOctree::~FSmartObjectOctree()
|
|
{
|
|
}
|
|
|
|
void FSmartObjectOctree::AddNode(const FBoxCenterAndExtent& Bounds, const FSmartObjectHandle& SmartObjectHandle, const FSmartObjectOctreeIDSharedRef& SharedOctreeID)
|
|
{
|
|
AddElement(FSmartObjectOctreeElement(Bounds, SmartObjectHandle, SharedOctreeID));
|
|
}
|
|
|
|
void FSmartObjectOctree::UpdateNode(const FOctreeElementId2& Id, const FBox& NewBounds)
|
|
{
|
|
FSmartObjectOctreeElement ElementCopy = GetElementById(Id);
|
|
RemoveElement(Id);
|
|
ElementCopy.Bounds = NewBounds;
|
|
AddElement(ElementCopy);
|
|
}
|
|
|
|
void FSmartObjectOctree::RemoveNode(const FOctreeElementId2& Id)
|
|
{
|
|
RemoveElement(Id);
|
|
}
|
|
|
|
//----------------------------------------------------------------------//
|
|
// FSmartObjectOctreeSemantics
|
|
//----------------------------------------------------------------------//
|
|
void FSmartObjectOctreeSemantics::SetElementId(const FSmartObjectOctreeElement& Element, FOctreeElementId2 Id)
|
|
{
|
|
Element.SharedOctreeID->ID = Id;
|
|
}
|
|
|