Source/CoreExtensions/Private/BlueprintLibraries/CoreExtTraceBlueprintLibrary.cpp
/** Util for drawing result of single line trace  */
Util for drawing result of single line trace
Util for drawing result of single line trace
void UCoreExtTraceBlueprintLibrary::DrawDebugLineTraceSingle( const UWorld * World, const FVector & Start, const FVector & End, const EDrawDebugTrace::Type DrawDebugType, const bool bHit, const FHitResult & OutHit, const FLinearColor TraceColor, const FLinearColor TraceHitColor, const float DrawTime )
{
    if ( DrawDebugType != EDrawDebugTrace::None )
    {
        const auto is_persistent = DrawDebugType == EDrawDebugTrace::Persistent;
        const auto life_time = DrawDebugType == EDrawDebugTrace::ForDuration ? DrawTime : 0.f;
        if ( bHit && OutHit.bBlockingHit )
        {
            DrawDebugLine( World, Start, OutHit.ImpactPoint, TraceColor.ToFColor( true ), is_persistent, life_time );
            DrawDebugLine( World, OutHit.ImpactPoint, End, TraceHitColor.ToFColor( true ), is_persistent, life_time );
            DrawDebugPoint( World, OutHit.ImpactPoint, kismet_trace_debug_impact_point_size, TraceColor.ToFColor( true ), is_persistent, life_time );
        }
        else
        {
            DrawDebugLine( World, Start, End, TraceColor.ToFColor( true ), is_persistent, life_time );
        }
    }
}
void UCoreExtTraceBlueprintLibrary :: DrawDebugLineTraceSingle ( const UWorld * World , const FVector & Start , const FVector & End , const EDrawDebugTrace :: Type DrawDebugType , const bool bHit , const FHitResult & OutHit , const FLinearColor TraceColor , const FLinearColor TraceHitColor , const float DrawTime ) { if ( DrawDebugType != EDrawDebugTrace :: None ) { const auto is_persistent = DrawDebugType == EDrawDebugTrace :: Persistent ; const auto life_time = DrawDebugType == EDrawDebugTrace :: ForDuration ? DrawTime : 0.f ; if ( bHit && OutHit . bBlockingHit ) { DrawDebugLine ( World , Start , OutHit . ImpactPoint , TraceColor . ToFColor ( true ) , is_persistent , life_time ) ; DrawDebugLine ( World , OutHit . ImpactPoint , End , TraceHitColor . ToFColor ( true ) , is_persistent , life_time ) ; DrawDebugPoint ( World , OutHit . ImpactPoint , kismet_trace_debug_impact_point_size , TraceColor . ToFColor ( true ) , is_persistent , life_time ) ; } else { DrawDebugLine ( World , Start , End , TraceColor . ToFColor ( true ) , is_persistent , life_time ) ; } } }
Util for drawing result of single line trace
Util for drawing result of single line trace
// @fixme, draw line with thickness = 2.f?
 // Red up to the blocking hit, green thereafter
 // no hit means all red
