Debug Draw 3D 1.6.0
Draw 3D debug graphics and 2D overlays with this add-on.
Loading...
Searching...
No Matches
config_3d.h
1#pragma once
2
3#include "common/colors.h"
4#include "utils/compiler.h"
5
6GODOT_WARNING_DISABLE()
7#include <godot_cpp/classes/ref_counted.hpp>
8GODOT_WARNING_RESTORE()
9using namespace godot;
10
17class DebugDraw3DConfig : public RefCounted {
18 GDCLASS(DebugDraw3DConfig, RefCounted)
19
20public:
24 enum CullingMode : int {
25 FRUSTUM_DISABLED,
26 FRUSTUM_ROUGH,
27 FRUSTUM_PRECISE,
28 };
29
30private:
31 int32_t geometry_render_layers = 1;
32 bool freeze_3d_render = false;
33 bool visible_instance_bounds = false;
34 CullingMode frustum_culling_mode = CullingMode::FRUSTUM_PRECISE;
35 real_t frustum_length_scale = 0;
36 bool force_use_camera_from_scene = false;
37 Color line_hit_color = Colors::red;
38 Color line_after_hit_color = Colors::green;
39
40protected:
42 static void _bind_methods();
43
44public:
49 void set_freeze_3d_render(const bool &_state);
50 bool is_freeze_3d_render() const;
51
56 void set_visible_instance_bounds(const bool &_state);
57 bool is_visible_instance_bounds() const;
58
68 void set_use_frustum_culling(const bool &_state);
69 bool is_use_frustum_culling() const;
70
75 CullingMode get_frustum_culling_mode() const;
76
80 void set_frustum_length_scale(const real_t &_distance);
81 real_t get_frustum_length_scale() const;
82
86 void set_force_use_camera_from_scene(const bool &_state);
87 bool is_force_use_camera_from_scene() const;
88
93 void set_geometry_render_layers(const int32_t &_layers);
94 int32_t get_geometry_render_layers() const;
95
99 void set_line_hit_color(const Color &_new_color);
100 Color get_line_hit_color() const;
101
105 void set_line_after_hit_color(const Color &_new_color);
106 Color get_line_after_hit_color() const;
107};
108
109VARIANT_ENUM_CAST(DebugDraw3DConfig::CullingMode);
This is a class for storing part of the DebugDraw3D configuration.
Definition config_3d.h:17
void set_line_hit_color(const Color &_new_color)
void set_frustum_length_scale(const real_t &_distance)
CullingMode
Definition config_3d.h:24
void set_geometry_render_layers(const int32_t &_layers)
void set_force_use_camera_from_scene(const bool &_state)
void set_freeze_3d_render(const bool &_state)
void set_visible_instance_bounds(const bool &_state)
void set_line_after_hit_color(const Color &_new_color)
void set_frustum_culling_mode(const CullingMode _mode)
void set_use_frustum_culling(const bool &_state)