You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
30 lines
1.0 KiB
C++
30 lines
1.0 KiB
C++
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "RectLightComponentVisualizer.h"
|
|
#include "SceneManagement.h"
|
|
#include "Components/RectLightComponent.h"
|
|
|
|
|
|
void FRectLightComponentVisualizer::DrawVisualization( const UActorComponent* Component, const FSceneView* View, FPrimitiveDrawInterface* PDI )
|
|
{
|
|
if(View->Family->EngineShowFlags.LightRadius)
|
|
{
|
|
const URectLightComponent* RectLightComp = Cast<const URectLightComponent>(Component);
|
|
if(RectLightComp != NULL)
|
|
{
|
|
FTransform LightTM = RectLightComp->GetComponentTransform();
|
|
LightTM.RemoveScaling();
|
|
|
|
// Draw light radius
|
|
DrawWireSphereAutoSides(PDI, LightTM, FColor(200, 255, 255), RectLightComp->AttenuationRadius, SDPG_World);
|
|
|
|
FBox Box(
|
|
FVector( 0.0f, -0.5f * RectLightComp->SourceWidth, -0.5f * RectLightComp->SourceHeight ),
|
|
FVector( 0.0f, 0.5f * RectLightComp->SourceWidth, 0.5f * RectLightComp->SourceHeight )
|
|
);
|
|
|
|
DrawWireBox(PDI, LightTM.ToMatrixNoScale(), Box, FColor(231, 239, 0, 255), SDPG_World);
|
|
}
|
|
}
|
|
}
|