Debug Draw 3D 1.7.1
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#include "utils/native_api_hooks.h"
6
7GODOT_WARNING_DISABLE()
8#include <godot_cpp/classes/ref_counted.hpp>
9GODOT_WARNING_RESTORE()
10using namespace godot;
11
18NAPI_CLASS_REF class DebugDraw3DConfig : public RefCounted {
19 GDCLASS(DebugDraw3DConfig, RefCounted)
20
21public:
25 NAPI_ENUM enum CullingMode : uint32_t {
26 FRUSTUM_DISABLED,
27 FRUSTUM_ROUGH,
28 FRUSTUM_PRECISE,
29 };
30
31private:
32 int32_t geometry_render_layers = 1;
33 bool freeze_3d_render = false;
34 bool visible_instance_bounds = false;
35 CullingMode frustum_culling_mode = CullingMode::FRUSTUM_PRECISE;
36 real_t frustum_length_scale = 1;
37 bool force_use_camera_from_scene = false;
38 Color line_hit_color = Colors::red;
39 Color line_after_hit_color = Colors::green;
40
41protected:
43 static void _bind_methods();
44
45public:
50 NAPI void set_freeze_3d_render(const bool &_state);
51 NAPI bool is_freeze_3d_render() const;
52
57 NAPI void set_visible_instance_bounds(const bool &_state);
58 NAPI bool is_visible_instance_bounds() const;
59
69 NAPI void set_use_frustum_culling(const bool &_state);
70 NAPI bool is_use_frustum_culling() const;
71
76 NAPI DebugDraw3DConfig::CullingMode get_frustum_culling_mode() const;
77
81 NAPI void set_frustum_length_scale(const real_t &_distance);
82 NAPI real_t get_frustum_length_scale() const;
83
87 NAPI void set_force_use_camera_from_scene(const bool &_state);
88 NAPI bool is_force_use_camera_from_scene() const;
89
94 NAPI void set_geometry_render_layers(const int32_t &_layers);
95 NAPI int32_t get_geometry_render_layers() const;
96
100 NAPI void set_line_hit_color(const godot::Color &_new_color);
101 NAPI godot::Color get_line_hit_color() const;
102
106 NAPI void set_line_after_hit_color(const godot::Color &_new_color);
107 NAPI godot::Color get_line_after_hit_color() const;
108};
109
110VARIANT_ENUM_CAST(DebugDraw3DConfig::CullingMode);
This is a class for storing part of the DebugDraw3D configuration.
Definition config_3d.h:18
NAPI void set_use_frustum_culling(const bool &_state)
NAPI void set_freeze_3d_render(const bool &_state)
NAPI void set_frustum_length_scale(const real_t &_distance)
NAPI void set_geometry_render_layers(const int32_t &_layers)
NAPI void set_visible_instance_bounds(const bool &_state)
CullingMode
Definition config_3d.h:25
NAPI void set_frustum_culling_mode(const DebugDraw3DConfig::CullingMode _mode)
NAPI void set_line_hit_color(const godot::Color &_new_color)
NAPI void set_force_use_camera_from_scene(const bool &_state)
NAPI void set_line_after_hit_color(const godot::Color &_new_color)