You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Allow to display internal debug data at different navmesh generation steps for a selected tile Ignore height filtering while displaying the navmesh around camera position [REVIEW] [at]Mieszko.Zielinski [at]Mikko.Mononen #rb Mikko.Mononen #jira UE-86730 #ROBOMERGE-SOURCE: CL 11285125 via CL 11285129 via CL 11285132 #ROBOMERGE-BOT: (v647-11244347) [CL 11285135 by aris theophanidis in Main branch]
47 lines
1002 B
C++
47 lines
1002 B
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "NavMesh/RecastInternalDebugData.h"
|
|
#include "DebugUtils/DebugDraw.h"
|
|
|
|
void FRecastInternalDebugData::vertex(const float x, const float y, const float z, unsigned int color, const float u, const float v)
|
|
{
|
|
float pos[3] = { x,y,z };
|
|
Vertices.Push(Recast2UnrealPoint(pos));
|
|
VertexColors.Push(color);
|
|
}
|
|
|
|
void FRecastInternalDebugData::end()
|
|
{
|
|
if (ensure(Commands.Num() > 0))
|
|
{
|
|
Command& Cmd = Commands.Last();
|
|
const int FirstVertex = Cmd.Offset;
|
|
|
|
Cmd.Offset = Indices.Num();
|
|
|
|
// Turns quads to triangles
|
|
if (Cmd.Prim == DU_DRAW_QUADS)
|
|
{
|
|
Cmd.Prim = DU_DRAW_TRIS;
|
|
for (int i = FirstVertex; i < Vertices.Num(); i += 4)
|
|
{
|
|
ensure(i + 3 < Vertices.Num());
|
|
Indices.Push(i + 0);
|
|
Indices.Push(i + 1);
|
|
Indices.Push(i + 3);
|
|
|
|
Indices.Push(i + 3);
|
|
Indices.Push(i + 1);
|
|
Indices.Push(i + 2);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
for (int i = FirstVertex; i < Vertices.Num(); i++)
|
|
{
|
|
Indices.Push(i);
|
|
}
|
|
}
|
|
}
|
|
}
|