Files
UnrealEngineUWP/Engine/Source/Editor/ComponentVisualizers/Private/PointLightComponentVisualizer.cpp
Matthew Griffin bb70b349ce Merging CL 2804086 from //UE4/Release-4.11 to Dev-Main (//UE4/Dev-Main) to isolate copyright update
#lockdown Nick.Penwarden

[CL 2819020 by Matthew Griffin in Main branch]
2016-01-07 08:17:16 -05:00

29 lines
1.1 KiB
C++

// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
#include "ComponentVisualizersPrivatePCH.h"
#include "PointLightComponentVisualizer.h"
#include "Components/PointLightComponent.h"
void FPointLightComponentVisualizer::DrawVisualization( const UActorComponent* Component, const FSceneView* View, FPrimitiveDrawInterface* PDI )
{
if(View->Family->EngineShowFlags.LightRadius)
{
const UPointLightComponent* PointLightComp = Cast<const UPointLightComponent>(Component);
if(PointLightComp != NULL)
{
FTransform LightTM = PointLightComp->ComponentToWorld;
LightTM.RemoveScaling();
// Draw light radius
DrawWireSphereAutoSides(PDI, LightTM, FColor(200, 255, 255), PointLightComp->AttenuationRadius, SDPG_World);
// Draw point light source shape
DrawWireCapsule(PDI, LightTM.GetTranslation(), -LightTM.GetUnitAxis( EAxis::Z ), LightTM.GetUnitAxis( EAxis::Y ), LightTM.GetUnitAxis( EAxis::X ),
FColor(231, 239, 0, 255), PointLightComp->SourceRadius, 0.5f * PointLightComp->SourceLength + PointLightComp->SourceRadius, 25, SDPG_World);
}
}
}