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 <Common/Rendering/RenderGraphBuilder.hpp>
6
7
#include <DebugDraw.h>
8
#include <RecastDebugDraw.h>
9
#include <EngineCore/Assets/AssetReference.hpp>
10
#include <EngineCore/Assets/PipelineSet/GraphicsPipelineAsset.hpp>
11
12
namespace
Grindstone::Ai
{
13
struct
NavMeshDebugRenderer
:
public
duDebugDraw {
14
struct
DebugVertex
{
15
float
x, y, z;
16
float
u, v;
17
uint32_t color;
18
};
19
20
struct
DrawCall
{
21
duDebugDrawPrimitives primitiveType;
22
float
pointOrLineSize;
23
bool
depthTest;
24
bool
textured;
25
uint32_t vertexOffset;
26
uint32_t vertexCount;
27
};
28
29
void
Initialize();
30
31
virtual
~NavMeshDebugRenderer
()
override
;
32
33
void
Clear();
34
void
BuildVertexBuffers();
35
36
virtual
Grindstone::Renderer::RenderGraphBuilderResourceRef
DrawRenderPass(
37
Grindstone::Renderer::RenderGraphBuilder
& rgBuilder,
38
Grindstone::Renderer::RenderGraphBuilderResourceRef
colorRef,
39
Grindstone::Renderer::RenderGraphBuilderResourceRef
depthRef
40
);
41
42
virtual
void
depthMask(
bool
state)
override
;
43
44
virtual
void
texture(
bool
state)
override
;
45
49
virtual
void
begin
(duDebugDrawPrimitives prim,
float
size = 1.0f)
override
;
50
54
virtual
void
vertex
(
const
float
* pos,
unsigned
int
color)
override
;
55
59
virtual
void
vertex
(
const
float
x,
const
float
y,
const
float
z,
unsigned
int
color)
override
;
60
65
virtual
void
vertex
(
const
float
* pos,
unsigned
int
color,
const
float
* uv)
override
;
66
71
virtual
void
vertex
(
const
float
x,
const
float
y,
const
float
z,
unsigned
int
color,
const
float
u,
const
float
v)
override
;
72
74
virtual
void
end
()
override
;
75
77
virtual
unsigned
int
areaToCol
(
unsigned
int
area)
override
;
78
79
protected
:
80
Grindstone::AssetReference<Grindstone::GraphicsPipelineAsset>
navmeshPipelineSet;
81
Grindstone::GraphicsAPI::DescriptorSet
* navmeshDescriptorSet =
nullptr
;
82
Grindstone::GraphicsAPI::Buffer
* vertexBuffer =
nullptr
;
83
Grindstone::GraphicsAPI::VertexInputLayout
vertexLayout;
84
std::vector<DebugVertex> vertices;
85
std::vector<DrawCall> drawCalls;
86
DrawCall
* currentCall =
nullptr
;
87
bool
isDepthTestEnabled =
true
;
88
bool
isTextured =
false
;
89
};
90
}
Grindstone::GraphicsAPI::Buffer
Definition
Buffer.hpp:49
Grindstone::GraphicsAPI::DescriptorSet
Definition
DescriptorSet.hpp:15
Grindstone::Renderer::RenderGraphBuilder
Definition
RenderGraphBuilder.hpp:12
Grindstone::Ai
Definition
NavAgentComponent.hpp:12
Grindstone::Ai::NavMeshDebugRenderer::DebugVertex
Definition
NavMeshDebugRenderer.hpp:14
Grindstone::Ai::NavMeshDebugRenderer::DrawCall
Definition
NavMeshDebugRenderer.hpp:20
Grindstone::Ai::NavMeshDebugRenderer
Definition
NavMeshDebugRenderer.hpp:13
Grindstone::Ai::NavMeshDebugRenderer::begin
virtual void begin(duDebugDrawPrimitives prim, float size=1.0f) override
Definition
NavMeshDebugRenderer.cpp:155
Grindstone::Ai::NavMeshDebugRenderer::end
virtual void end() override
End drawing primitives.
Definition
NavMeshDebugRenderer.cpp:193
Grindstone::Ai::NavMeshDebugRenderer::vertex
virtual void vertex(const float *pos, unsigned int color) override
Definition
NavMeshDebugRenderer.cpp:169
Grindstone::Ai::NavMeshDebugRenderer::areaToCol
virtual unsigned int areaToCol(unsigned int area) override
Compute a color for given area.
Definition
NavMeshDebugRenderer.cpp:198
Grindstone::AssetReference
Definition
AssetReference.hpp:45
Grindstone::GraphicsAPI::VertexInputLayout
Definition
Formats.hpp:894
Grindstone::Renderer::RenderGraphBuilderResourceRef
Definition
RenderGraphResourceRef.hpp:51
plugins
Grindstone.Ai.NavMesh
include
NavMeshDebugRenderer.hpp
Generated by
1.17.0