Added basic debug lines
This commit is contained in:
48
src/dawn/scene/debug/SceneDebugLine.hpp
Normal file
48
src/dawn/scene/debug/SceneDebugLine.hpp
Normal file
@ -0,0 +1,48 @@
|
||||
// Copyright (c) 2023 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "display/Color.hpp"
|
||||
#include "display/mesh/Mesh.hpp"
|
||||
#include "display/shader/Shader.hpp"
|
||||
|
||||
#define SCENE_DEBUG_LINE_VERTICE_COUNT 2
|
||||
#define SCENE_DEBUG_LINE_INDICE_COUNT 2
|
||||
#define SCENE_DEBUG_LINE_PRIORITY 100
|
||||
|
||||
namespace Dawn {
|
||||
class SimpleTexturedShader;
|
||||
class Camera;
|
||||
|
||||
struct SceneDebugCube {
|
||||
glm::vec3 min;
|
||||
glm::vec3 max;
|
||||
struct Color color = COLOR_RED;
|
||||
glm::mat4 translation = glm::mat4(1.0f);
|
||||
};
|
||||
|
||||
struct SceneDebugLine {
|
||||
glm::vec3 v0 = glm::vec3(0, 0, 0);
|
||||
glm::vec3 v1 = glm::vec3(1, 1, 1);
|
||||
struct Color color = COLOR_RED;
|
||||
glm::mat4 translation = glm::mat4(1.0f);
|
||||
|
||||
/**
|
||||
* Creates a renderable shader item for this debug line.
|
||||
*
|
||||
* @param mesh Mesh that this debug line will buffer its indices in to
|
||||
* @param lineIndex Currently iterated line index.
|
||||
* @param camera Camera for this line index to set the shader params for.
|
||||
* @param shader Shader that the params will be set for.
|
||||
* @return The queueable shader pass item.
|
||||
*/
|
||||
struct ShaderPassItem createShaderItem(
|
||||
Mesh *mesh,
|
||||
int32_t *lineIndex,
|
||||
Camera *camera,
|
||||
SimpleTexturedShader *shader
|
||||
);
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user