21 #include "../generic/managed.h"
22 #include "../meshes/mesh.h"
24 #include "stage_node.h"
30 S_DEFINE_STAGE_NODE_META(STAGE_NODE_TYPE_DEBUG,
"debug");
35 void draw_ray(
const Vec3& start,
const Vec3& dir,
36 const Color& color = Color::white(),
39 void draw_line(
const Vec3& start,
const Vec3& end,
40 const Color& color = Color::white(),
43 void draw_point(
const Vec3& position,
const Color& color = Color::white(),
46 bool on_init()
override;
48 void set_point_size(
float ps);
49 float point_size()
const;
51 void set_line_width(
float size);
52 float line_width()
const;
57 const DetailLevel detail_level,
Light** light,
58 const std::size_t light_count)
override;
61 void build_mesh(
const Camera* camera);
64 const Color& color,
const Vec3& camera_pos);
67 const Color& color,
float size,
const Vec3& up,
70 enum DebugElementType {
76 float time_since_created = 0.0;
77 DebugElementType type = DET_LINE;
78 Color color = Color::white();
79 bool depth_test =
true;
80 float duration = 0.0f;
86 std::vector<DebugElement> elements_;
88 SubMesh* without_depth_ =
nullptr;
91 MeshPtr mesh_ =
nullptr;
93 MaterialPtr material_;
94 MaterialPtr material_no_depth_;
96 float current_point_size_ = 0.01f;
97 float current_line_width_ = 0.01f;
101 bool on_create(
Params params)
override {