Debug Draw 3D 1.6.0
Draw 3D debug graphics and 2D overlays with this add-on.
Loading...
Searching...
No Matches
config_scope_3d.h
1#pragma once
2
3#include "utils/compiler.h"
4
5#include <functional>
6#include <memory>
7
8GODOT_WARNING_DISABLE()
9#include <godot_cpp/classes/font.hpp>
10#include <godot_cpp/classes/ref_counted.hpp>
11#include <godot_cpp/classes/viewport.hpp>
12GODOT_WARNING_RESTORE()
13using namespace godot;
14
59class DebugDraw3DScopeConfig : public RefCounted {
60 GDCLASS(DebugDraw3DScopeConfig, RefCounted)
61
62protected:
64 static void _bind_methods();
65
66private:
67 uint64_t thread_id;
68 uint64_t guard_id;
69
70 using unregister_func = std::function<void(const uint64_t &, const uint64_t &)>;
71 unregister_func unregister_action;
72
73public:
75 struct DebugContainerDependent {
76 Viewport *viewport = nullptr;
77 uint64_t viewport_id = 0;
78 bool no_depth_test = false;
79 };
80
82 struct Data {
83 // Update the constructor if changes are made!
84 real_t thickness;
85 real_t center_brightness;
86 real_t plane_size;
87 Transform3D transform;
88 Color text_outline_color;
89 uint32_t text_outline_color_hash;
90 int32_t text_outline_size;
91 bool text_fixed_size;
92 Ref<Font> text_font;
93 DebugContainerDependent dcd;
94 bool hd_sphere;
95 bool custom_xform;
96
97 Data();
98 Data(const Data *parent);
99 };
101 std::shared_ptr<Data> data = nullptr;
102
104 // It can be used for example in C#
105 void _manual_unregister();
106
112 Ref<DebugDraw3DScopeConfig> set_thickness(real_t _value) const;
113 real_t get_thickness() const;
114
120 Ref<DebugDraw3DScopeConfig> set_center_brightness(real_t _value) const;
121 real_t get_center_brightness() const;
122
128 Ref<DebugDraw3DScopeConfig> set_hd_sphere(bool _value) const;
129 bool is_hd_sphere() const;
130
136 Ref<DebugDraw3DScopeConfig> set_plane_size(real_t _value) const;
137 real_t get_plane_size() const;
138
142 Ref<DebugDraw3DScopeConfig> set_transform(Transform3D _value) const;
143 Transform3D get_transform() const;
144
153 Ref<DebugDraw3DScopeConfig> set_text_outline_color(Color _value) const;
154 Color get_text_outline_color() const;
155
164 Ref<DebugDraw3DScopeConfig> set_text_outline_size(int32_t _value) const;
165 int32_t get_text_outline_size() const;
166
175 Ref<DebugDraw3DScopeConfig> set_text_fixed_size(bool _value) const;
176 bool get_text_fixed_size() const;
177
186 Ref<DebugDraw3DScopeConfig> set_text_font(Ref<Font> _value) const;
187 Ref<Font> get_text_font() const;
188
199 Ref<DebugDraw3DScopeConfig> set_viewport(Viewport *_value) const;
200 Viewport *get_viewport() const;
201
210 Ref<DebugDraw3DScopeConfig> set_no_depth_test(bool _value) const;
211 bool is_no_depth_test() const;
212
214 DebugDraw3DScopeConfig();
215
216 // `DDScopedConfig3D` is passed as Ref to avoid a random unreference
218 DebugDraw3DScopeConfig(const uint64_t &p_thread_id, const uint64_t &p_guard_id, const DebugDraw3DScopeConfig::Data *p_parent, const unregister_func p_unreg);
219 ~DebugDraw3DScopeConfig();
220};
Ref< DebugDraw3DScopeConfig > set_thickness(real_t _value) const
Ref< DebugDraw3DScopeConfig > set_text_font(Ref< Font > _value) const
Ref< DebugDraw3DScopeConfig > set_hd_sphere(bool _value) const
Ref< DebugDraw3DScopeConfig > set_no_depth_test(bool _value) const
Ref< DebugDraw3DScopeConfig > set_center_brightness(real_t _value) const
Ref< DebugDraw3DScopeConfig > set_text_outline_color(Color _value) const
Ref< DebugDraw3DScopeConfig > set_text_outline_size(int32_t _value) const
Ref< DebugDraw3DScopeConfig > set_viewport(Viewport *_value) const
Ref< DebugDraw3DScopeConfig > set_plane_size(real_t _value) const
Ref< DebugDraw3DScopeConfig > set_transform(Transform3D _value) const
Ref< DebugDraw3DScopeConfig > set_text_fixed_size(bool _value) const