Files
UnrealEngineUWP/Engine/Source/Runtime/NavigationSystem/Public/NavRelevantComponent.h
yoan stamant b918f902d3 [UNavRelevantComponent] Fixed some calls to GetNavigationParent made before the cache initialization since this might result in improper registration in the NavOctree. Also added error reporting to detect those cases in the future.
[at]aris.theophanidis
#rb aris.theophanidis


#ROBOMERGE-SOURCE: CL 12368552 via CL 12368554
#ROBOMERGE-BOT: (v671-12333473)

[CL 12370944 by yoan stamant in Main branch]
2020-03-23 11:01:34 -04:00

54 lines
1.5 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "UObject/ObjectMacros.h"
#include "Components/ActorComponent.h"
#include "AI/Navigation/NavRelevantInterface.h"
#include "NavRelevantComponent.generated.h"
UCLASS()
class NAVIGATIONSYSTEM_API UNavRelevantComponent : public UActorComponent, public INavRelevantInterface
{
GENERATED_UCLASS_BODY()
//~ Begin UActorComponent Interface
virtual void OnRegister() override;
virtual void OnUnregister() override;
//~ End UActorComponent Interface
//~ Begin INavRelevantInterface Interface
virtual FBox GetNavigationBounds() const override;
virtual bool IsNavigationRelevant() const override;
virtual void UpdateNavigationBounds() override;
virtual UObject* GetNavigationParent() const override;
//~ End INavRelevantInterface Interface
virtual void CalcAndCacheBounds() const;
UFUNCTION(BlueprintCallable, Category="AI|Navigation")
void SetNavigationRelevancy(bool bRelevant);
/** force relevancy and skip attaching navigation data to owner's root entry */
void ForceNavigationRelevancy(bool bForce);
/** force refresh in navigation octree */
void RefreshNavigationModifiers();
protected:
/** bounds for navigation octree */
mutable FBox Bounds;
/** attach navigation data to entry for owner's root component (depends on its relevancy) */
UPROPERTY()
uint32 bAttachToOwnersRoot : 1;
mutable uint32 bBoundsInitialized : 1;
uint32 bNavParentCacheInitialized : 1;
UPROPERTY(transient)
UObject* CachedNavParent;
};