Files
UnrealEngine/Engine/Source/Editor/ComponentVisualizers/Private/SpringArmComponentVisualizer.cpp
2025-05-18 13:04:45 +08:00

24 lines
832 B
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "SpringArmComponentVisualizer.h"
#include "Components/ActorComponent.h"
#include "Components/SceneComponent.h"
#include "Engine/EngineTypes.h"
#include "GameFramework/SpringArmComponent.h"
#include "HAL/Platform.h"
#include "Math/Color.h"
#include "Math/Transform.h"
#include "PrimitiveDrawingUtils.h"
#include "Templates/Casts.h"
static const FColor ArmColor(255,0,0);
void FSpringArmComponentVisualizer::DrawVisualization(const UActorComponent* Component, const FSceneView* View, FPrimitiveDrawInterface* PDI)
{
if (const USpringArmComponent* SpringArm = Cast<const USpringArmComponent>(Component))
{
PDI->DrawLine( SpringArm->GetComponentLocation(), SpringArm->GetSocketTransform(TEXT("SpringEndpoint"),RTS_World).GetTranslation(), ArmColor, SDPG_World );
}
}