You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Removed previous hack added in UEQSRenderingComponent and fixed some typos in method names. #rb mikko.mononen mieszko.zielinski #preflight 60c887272da7840001313475 #ROBOMERGE-SOURCE: CL 16672461 #ROBOMERGE-BOT: (v834-16658389) [CL 16672469 by yoan stamant in ue5-main branch]
141 lines
3.6 KiB
C++
141 lines
3.6 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "UObject/ObjectMacros.h"
|
|
#include "PrimitiveViewRelevance.h"
|
|
#include "Components/PrimitiveComponent.h"
|
|
#include "DynamicMeshBuilder.h"
|
|
#include "DebugRenderSceneProxy.h"
|
|
|
|
class ANavigationTestingActor;
|
|
class APlayerController;
|
|
class FMeshElementCollector;
|
|
class UCanvas;
|
|
class UNavTestRenderingComponent;
|
|
struct FNodeDebugData;
|
|
|
|
class FNavTestSceneProxy final : public FDebugRenderSceneProxy
|
|
{
|
|
friend class FNavTestDebugDrawDelegateHelper;
|
|
|
|
public:
|
|
SIZE_T GetTypeHash() const override;
|
|
|
|
struct FNodeDebugData
|
|
{
|
|
NavNodeRef PolyRef;
|
|
FVector Position;
|
|
FString Desc;
|
|
FSetElementId ParentId;
|
|
uint32 bClosedSet : 1;
|
|
uint32 bBestPath : 1;
|
|
uint32 bModified : 1;
|
|
uint32 bOffMeshLink : 1;
|
|
|
|
FORCEINLINE bool operator==(const FNodeDebugData& Other) const
|
|
{
|
|
return PolyRef == Other.PolyRef;
|
|
}
|
|
FORCEINLINE friend uint32 GetTypeHash(const FNodeDebugData& Other)
|
|
{
|
|
return Other.PolyRef;
|
|
}
|
|
};
|
|
|
|
FNavTestSceneProxy(const UNavTestRenderingComponent* InComponent);
|
|
|
|
~FNavTestSceneProxy() {}
|
|
|
|
virtual void GetDynamicMeshElements(const TArray<const FSceneView*>& Views, const FSceneViewFamily& ViewFamily, uint32 VisibilityMap, FMeshElementCollector& Collector) const override;
|
|
|
|
void GatherPathPoints();
|
|
|
|
void GatherPathStep();
|
|
|
|
FORCEINLINE static bool LocationInView(const FVector& Location, const FSceneView* View)
|
|
{
|
|
return View->ViewFrustum.IntersectBox(Location, FVector::ZeroVector);
|
|
}
|
|
|
|
virtual FPrimitiveViewRelevance GetViewRelevance(const FSceneView* View) const override;
|
|
|
|
virtual uint32 GetMemoryFootprint(void) const override { return sizeof(*this) + GetAllocatedSize(); }
|
|
|
|
uint32 GetAllocatedSize(void) const;
|
|
|
|
private:
|
|
FVector3f NavMeshDrawOffset;
|
|
|
|
uint32 bShowBestPath : 1;
|
|
uint32 bShowNodePool : 1;
|
|
uint32 bShowDiff : 1;
|
|
|
|
ANavigationTestingActor* NavTestActor;
|
|
FDebugDrawDelegate DebugTextDrawingDelegate;
|
|
FDelegateHandle DebugTextDrawingDelegateHandle;
|
|
TArray<FVector> PathPoints;
|
|
TArray<FString> PathPointFlags;
|
|
|
|
TArray<FDynamicMeshVertex> OpenSetVerts;
|
|
TArray<uint32> OpenSetIndices;
|
|
TArray<FDynamicMeshVertex> ClosedSetVerts;
|
|
TArray<uint32> ClosedSetIndices;
|
|
TSet<FNodeDebugData> NodeDebug;
|
|
FSetElementId BestNodeId;
|
|
|
|
FVector ClosestWallLocation;
|
|
};
|
|
|
|
#if WITH_RECAST && WITH_EDITOR
|
|
class FNavTestDebugDrawDelegateHelper : public FDebugDrawDelegateHelper
|
|
{
|
|
typedef FDebugDrawDelegateHelper Super;
|
|
|
|
public:
|
|
virtual void InitDelegateHelper(const FDebugRenderSceneProxy* InSceneProxy) override
|
|
{
|
|
check(0);
|
|
}
|
|
|
|
void InitDelegateHelper(const FNavTestSceneProxy* InSceneProxy);
|
|
|
|
virtual void RegisterDebugDrawDelegate() override;
|
|
virtual void UnregisterDebugDrawDelegate() override;
|
|
|
|
protected:
|
|
void DrawDebugLabels(UCanvas* Canvas, APlayerController*) override;
|
|
|
|
private:
|
|
TSet<FNavTestSceneProxy::FNodeDebugData> NodeDebug;
|
|
ANavigationTestingActor* NavTestActor;
|
|
TArray<FVector> PathPoints;
|
|
TArray<FString> PathPointFlags;
|
|
FSetElementId BestNodeId;
|
|
uint32 bShowBestPath : 1;
|
|
uint32 bShowDiff : 1;
|
|
};
|
|
#endif //WITH_RECAST && WITH_EDITOR
|
|
|
|
#include "NavTestRenderingComponent.generated.h"
|
|
|
|
class FPrimitiveSceneProxy;
|
|
struct FTransform;
|
|
|
|
UCLASS(hidecategories=Object)
|
|
class UNavTestRenderingComponent: public UPrimitiveComponent
|
|
{
|
|
GENERATED_UCLASS_BODY()
|
|
|
|
virtual FPrimitiveSceneProxy* CreateSceneProxy() override;
|
|
virtual FBoxSphereBounds CalcBounds(const FTransform &LocalToWorld) const override;
|
|
virtual void CreateRenderState_Concurrent(FRegisterComponentContext* Context) override;
|
|
virtual void DestroyRenderState_Concurrent() override;
|
|
|
|
private:
|
|
#if WITH_RECAST && WITH_EDITOR
|
|
FNavTestDebugDrawDelegateHelper NavTestDebugDrawDelegateHelper;
|
|
#endif
|
|
};
|