Files
UnrealEngineUWP/Engine/Source/Runtime/NavigationSystem/Public/NavMesh/RecastInternalDebugData.cpp
Bryan sefcik b4a6e947d8 Ran IWYU on Public headers under Engine/Source/Runtime/...
Headers are updated to contain any missing #includes needed to compile and #includes are sorted.  Nothing is removed.

#ushell-cherrypick of 21065896 by bryan.sefcik
#preflight 62d4b1a5a6141b6adfb0c892
#jira

#ROBOMERGE-OWNER: Bryan.sefcik
#ROBOMERGE-AUTHOR: bryan.sefcik
#ROBOMERGE-SOURCE: CL 21150156 via CL 21151754 via CL 21154719
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)
#ROBOMERGE-CONFLICT from-shelf

[CL 21181076 by Bryan sefcik in ue5-main branch]
2022-07-20 11:31:36 -04:00

60 lines
1.5 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "NavMesh/RecastInternalDebugData.h"
#include "DebugUtils/DebugDraw.h"
#include "HAL/PlatformCrt.h"
#include "Misc/AssertionMacros.h"
#include "NavMesh/RecastHelpers.h"
void FRecastInternalDebugData::vertex(const FVector::FReal x, const FVector::FReal y, const FVector::FReal z, unsigned int color, const FVector::FReal u, const FVector::FReal v)
{
FVector::FReal RecastPos[3] = { x,y,z };
const FVector Pos = Recast2UnrealPoint(RecastPos);
const FColor Color = Recast2UnrealColor(color);
switch(CurrentPrim)
{
case DU_DRAW_POINTS:
PointVertices.Push(Pos);
PointColors.Push(Color);
break;
case DU_DRAW_LINES:
LineVertices.Push(Pos);
LineColors.Push(Color);
break;
case DU_DRAW_TRIS:
// Fallthrough
case DU_DRAW_QUADS:
TriangleVertices.Push(Pos);
TriangleColors.Push(Color);
break;
}
}
void FRecastInternalDebugData::end()
{
if (CurrentPrim == DU_DRAW_QUADS)
{
// Turns quads to triangles
for (int32 i = FirstVertexIndex; i < TriangleVertices.Num(); i += 4)
{
ensure(i + 3 < TriangleVertices.Num());
TriangleIndices.Push(i + 0);
TriangleIndices.Push(i + 1);
TriangleIndices.Push(i + 3);
TriangleIndices.Push(i + 3);
TriangleIndices.Push(i + 1);
TriangleIndices.Push(i + 2);
}
}
else if (CurrentPrim == DU_DRAW_TRIS)
{
// Add indices for triangles.
for (int32 i = FirstVertexIndex; i < TriangleVertices.Num(); i++)
{
TriangleIndices.Push(i);
}
}
}