Grindstone Game Engine
v0.2.0
An open source game engine and toolkit.
Toggle main menu visibility
Loading...
Searching...
No Matches
NavMeshDebugRenderer.hpp
1
#pragma once
2
3
#include <vector>
4
5
#include <DebugDraw.h>
6
#include <RecastDebugDraw.h>
7
#include <EngineCore/Assets/AssetReference.hpp>
8
#include <EngineCore/Assets/PipelineSet/GraphicsPipelineAsset.hpp>
9
10
namespace
Grindstone::Ai
{
11
struct
NavMeshDebugRenderer
:
public
duDebugDraw {
12
struct
DebugVertex
{
13
float
x, y, z;
14
float
u, v;
15
uint32_t color;
16
};
17
18
struct
DrawCall
{
19
duDebugDrawPrimitives primitiveType;
20
float
pointOrLineSize;
21
bool
depthTest;
22
bool
textured;
23
uint32_t vertexOffset;
24
uint32_t vertexCount;
25
};
26
27
void
Initialize();
28
static
NavMeshDebugRenderer
* GetInstance();
29
30
void
Clear();
31
void
BuildVertexBuffers();
32
33
bool
ShouldRenderThisFrame()
const
;
34
void
DrawDebug(
Grindstone::GraphicsAPI::CommandBuffer
* commandBuffer,
Grindstone::GraphicsPipelineAsset
* pipelineAsset);
35
36
virtual
void
depthMask(
bool
state)
override
;
37
38
virtual
void
texture(
bool
state)
override
;
39
43
virtual
void
begin
(duDebugDrawPrimitives prim,
float
size = 1.0f)
override
;
44
48
virtual
void
vertex
(
const
float
* pos,
unsigned
int
color)
override
;
49
53
virtual
void
vertex
(
const
float
x,
const
float
y,
const
float
z,
unsigned
int
color)
override
;
54
59
virtual
void
vertex
(
const
float
* pos,
unsigned
int
color,
const
float
* uv)
override
;
60
65
virtual
void
vertex
(
const
float
x,
const
float
y,
const
float
z,
unsigned
int
color,
const
float
u,
const
float
v)
override
;
66
68
virtual
void
end
()
override
;
69
71
virtual
unsigned
int
areaToCol
(
unsigned
int
area)
override
;
72
73
protected
:
74
std::vector<DebugVertex> vertices;
75
std::vector<DrawCall> drawCalls;
76
DrawCall
* currentCall =
nullptr
;
77
bool
isDepthTestEnabled =
true
;
78
bool
isTextured =
false
;
79
Grindstone::GraphicsAPI::Buffer
* vertexBuffer =
nullptr
;
80
Grindstone::GraphicsAPI::VertexInputLayout
vertexLayout;
81
};
82
}
Grindstone::GraphicsAPI::Buffer
Definition
Buffer.hpp:49
Grindstone::GraphicsAPI::CommandBuffer
Definition
CommandBuffer.hpp:109
Grindstone::Ai
Definition
NavAgentComponent.hpp:12
Grindstone::Ai::NavMeshDebugRenderer::DebugVertex
Definition
NavMeshDebugRenderer.hpp:12
Grindstone::Ai::NavMeshDebugRenderer::DrawCall
Definition
NavMeshDebugRenderer.hpp:18
Grindstone::Ai::NavMeshDebugRenderer
Definition
NavMeshDebugRenderer.hpp:11
Grindstone::Ai::NavMeshDebugRenderer::begin
virtual void begin(duDebugDrawPrimitives prim, float size=1.0f) override
Definition
NavMeshDebugRenderer.cpp:111
Grindstone::Ai::NavMeshDebugRenderer::end
virtual void end() override
End drawing primitives.
Definition
NavMeshDebugRenderer.cpp:149
Grindstone::Ai::NavMeshDebugRenderer::vertex
virtual void vertex(const float *pos, unsigned int color) override
Definition
NavMeshDebugRenderer.cpp:125
Grindstone::Ai::NavMeshDebugRenderer::areaToCol
virtual unsigned int areaToCol(unsigned int area) override
Compute a color for given area.
Definition
NavMeshDebugRenderer.cpp:154
Grindstone::GraphicsAPI::VertexInputLayout
Definition
Formats.hpp:894
Grindstone::GraphicsPipelineAsset
Definition
GraphicsPipelineAsset.hpp:22
plugins
Grindstone.Ai.NavMesh
include
NavMeshDebugRenderer.hpp
Generated by
1.17.0