Source/CoreExtensions/Private/BlueprintLibraries/CoreExtTraceBlueprintLibrary.cpp
/** Util for drawing result of multi line trace  */
Util for drawing result of multi line trace
Util for drawing result of multi line trace
void UCoreExtTraceBlueprintLibrary::DrawDebugLineTraceMulti( const UWorld * World, const FVector & Start, const FVector & End, const EDrawDebugTrace::Type DrawDebugType, const bool bHit, const TArray< FHitResult > & OutHits, 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 && OutHits.Last().bBlockingHit )
        {
            const auto blocking_hit_point = OutHits.Last().ImpactPoint;
            DrawDebugLine( World, Start, blocking_hit_point, TraceColor.ToFColor( true ), is_persistent, life_time );
            DrawDebugLine( World, blocking_hit_point, End, TraceHitColor.ToFColor( true ), is_persistent, life_time );
        }
        else
        {
            DrawDebugLine( World, Start, End, TraceColor.ToFColor( true ), is_persistent, life_time );
        }
        for ( auto hit_idx = 0; hit_idx < OutHits.Num(); ++hit_idx )
        {
            auto const & hit_result = OutHits[ hit_idx ];
            DrawDebugPoint( World, hit_result.ImpactPoint, kismet_trace_debug_impact_point_size, hit_result.bBlockingHit ? TraceColor.ToFColor( true ) : TraceHitColor.ToFColor( true ), is_persistent, life_time );
        }
    }
}
void UCoreExtTraceBlueprintLibrary :: DrawDebugLineTraceMulti ( const UWorld * World , const FVector & Start , const FVector & End , const EDrawDebugTrace :: Type DrawDebugType , const bool bHit , const TArray < FHitResult > & OutHits , 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 && OutHits . Last ( ) . bBlockingHit ) { const auto blocking_hit_point = OutHits . Last ( ) . ImpactPoint ; DrawDebugLine ( World , Start , blocking_hit_point , TraceColor . ToFColor ( true ) , is_persistent , life_time ) ; DrawDebugLine ( World , blocking_hit_point , End , TraceHitColor . ToFColor ( true ) , is_persistent , life_time ) ; } else { DrawDebugLine ( World , Start , End , TraceColor . ToFColor ( true ) , is_persistent , life_time ) ; } for ( auto hit_idx = 0 ; hit_idx < OutHits . Num ( ) ; ++ hit_idx ) { auto const & hit_result = OutHits [ hit_idx ] ; DrawDebugPoint ( World , hit_result . ImpactPoint , kismet_trace_debug_impact_point_size , hit_result . bBlockingHit ? TraceColor . ToFColor ( true ) : TraceHitColor . ToFColor ( true ) , is_persistent , life_time ) ; } } }
Util for drawing result of multi line trace
Util for drawing result of multi line trace
// @fixme, draw line with thickness = 2.f?
 // Red up to the blocking hit, green thereafter
 // no hit means all red
 // draw hits
