You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
38 lines
1.1 KiB
C++
38 lines
1.1 KiB
C++
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "ComponentVisualizersPrivatePCH.h"
|
|
#include "SensingComponentVisualizer.h"
|
|
#include "Perception/PawnSensingComponent.h"
|
|
|
|
|
|
void FSensingComponentVisualizer::DrawVisualization(const UActorComponent* Component, const FSceneView* View, FPrimitiveDrawInterface* PDI)
|
|
{
|
|
if (View->Family->EngineShowFlags.VisualizeSenses)
|
|
{
|
|
const UPawnSensingComponent* Senses = Cast<const UPawnSensingComponent>(Component);
|
|
if (Senses != NULL)
|
|
{
|
|
const FTransform Transform = FTransform(Senses->GetSensorRotation(), Senses->GetSensorLocation());
|
|
|
|
//LOS hearing
|
|
if (Senses->LOSHearingThreshold > 0.0f)
|
|
{
|
|
DrawWireSphere(PDI, Transform, FColor::Yellow, Senses->LOSHearingThreshold, 16, SDPG_World);
|
|
}
|
|
|
|
//Hearing
|
|
if (Senses->HearingThreshold > 0.0f)
|
|
{
|
|
DrawWireSphere(PDI, Transform, FColor::Cyan, Senses->HearingThreshold, 16, SDPG_World);
|
|
}
|
|
|
|
// Sight
|
|
if (Senses->SightRadius > 0.0f)
|
|
{
|
|
TArray<FVector> Verts;
|
|
DrawWireCone(PDI, Verts, Transform, Senses->SightRadius, Senses->GetPeripheralVisionAngle(), 10, FColor::Green, SDPG_World);
|
|
}
|
|
}
|
|
}
|
|
}
|