You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
52 lines
1.8 KiB
C++
52 lines
1.8 KiB
C++
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|||
|
|
|
|||
|
|
#include "SmartObjectSubsystemRenderingActor.h"
|
|||
|
|
|
|||
|
|
#include "SmartObjectDebugSceneProxy.h"
|
|||
|
|
#include "SmartObjectSubsystem.h"
|
|||
|
|
#include "Debug/DebugDrawService.h"
|
|||
|
|
|
|||
|
|
//----------------------------------------------------------------------//
|
|||
|
|
// USmartObjectSubsystemRenderingComponent
|
|||
|
|
//----------------------------------------------------------------------//
|
|||
|
|
FBoxSphereBounds USmartObjectSubsystemRenderingComponent::CalcBounds(const FTransform& LocalToWorld) const
|
|||
|
|
{
|
|||
|
|
if (const USmartObjectSubsystem* Subsystem = UWorld::GetSubsystem<USmartObjectSubsystem>(GetWorld()))
|
|||
|
|
{
|
|||
|
|
if (const ASmartObjectCollection* MainCollection = Subsystem->GetMainCollection())
|
|||
|
|
{
|
|||
|
|
return MainCollection->GetBounds();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
return FBox(ForceInit);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#if UE_ENABLE_DEBUG_DRAWING
|
|||
|
|
void USmartObjectSubsystemRenderingComponent::DebugDraw(FDebugRenderSceneProxy* DebugProxy)
|
|||
|
|
{
|
|||
|
|
if (const USmartObjectSubsystem* Subsystem = UWorld::GetSubsystem<USmartObjectSubsystem>(GetWorld()))
|
|||
|
|
{
|
|||
|
|
Subsystem->DebugDraw(DebugProxy);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void USmartObjectSubsystemRenderingComponent::DebugDrawCanvas(UCanvas* Canvas, APlayerController* PlayerController)
|
|||
|
|
{
|
|||
|
|
if (const USmartObjectSubsystem* Subsystem = UWorld::GetSubsystem<USmartObjectSubsystem>(GetWorld()))
|
|||
|
|
{
|
|||
|
|
Subsystem->DebugDrawCanvas(Canvas, PlayerController);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
#endif // UE_ENABLE_DEBUG_DRAWING
|
|||
|
|
|
|||
|
|
|
|||
|
|
//----------------------------------------------------------------------//
|
|||
|
|
// ASmartObjectSubsystemRenderingActor
|
|||
|
|
//----------------------------------------------------------------------//
|
|||
|
|
ASmartObjectSubsystemRenderingActor::ASmartObjectSubsystemRenderingActor()
|
|||
|
|
{
|
|||
|
|
RenderingComponent = CreateDefaultSubobject<USmartObjectSubsystemRenderingComponent>(TEXT("RenderingComp"));
|
|||
|
|
RootComponent = RenderingComponent;
|
|||
|
|
}
|
|||
|
|
|