Debug Draw 3D 1.7.1
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#include "utils/native_api_hooks.h"
5
6#include <functional>
7#include <memory>
8
9GODOT_WARNING_DISABLE()
10#include <godot_cpp/classes/font.hpp>
11#include <godot_cpp/classes/ref_counted.hpp>
12#include <godot_cpp/classes/viewport.hpp>
13GODOT_WARNING_RESTORE()
14using namespace godot;
15
60NAPI_CLASS_REF class DebugDraw3DScopeConfig : public RefCounted {
61 GDCLASS(DebugDraw3DScopeConfig, RefCounted)
62
63protected:
65 static void _bind_methods();
66
67private:
68 uint64_t thread_id;
69 uint64_t guard_id;
70
71 using unregister_func = std::function<void(const uint64_t &, const uint64_t &)>;
72 unregister_func unregister_action;
73
74public:
76 struct DebugContainerDependent {
77 Viewport *viewport = nullptr;
78 uint64_t viewport_id = 0;
79 bool no_depth_test = false;
80 };
81
83 struct Data {
84 // Update the constructor if changes are made!
85 real_t thickness;
86 real_t center_brightness;
87 real_t plane_size;
88 Transform3D transform;
89 Color text_outline_color;
90 uint32_t text_outline_color_hash;
91 int32_t text_outline_size;
92 bool text_fixed_size;
93 Ref<Font> text_font;
94 DebugContainerDependent dcd;
95 bool hd_sphere;
96 bool custom_xform;
97
98 Data();
99 Data(const Data *parent);
100 };
102 std::shared_ptr<Data> data = nullptr;
103
109 Ref<DebugDraw3DScopeConfig> set_thickness(const real_t &_value) const;
111 // #docs_func set_thickness
112 NAPI NSELF_RETURN set_thickness_selfreturn(const real_t &_value) const;
113 NAPI real_t get_thickness() const;
114
120 Ref<DebugDraw3DScopeConfig> set_center_brightness(const real_t &_value) const;
122 // #docs_func set_center_brightness
123 NAPI NSELF_RETURN set_center_brightness_selfreturn(const real_t &_value) const;
124 NAPI real_t get_center_brightness() const;
125
131 Ref<DebugDraw3DScopeConfig> set_hd_sphere(const bool &_value) const;
133 // #docs_func set_hd_sphere
134 NAPI NSELF_RETURN set_hd_sphere_selfreturn(const bool &_value) const;
135 NAPI bool is_hd_sphere() const;
136
142 Ref<DebugDraw3DScopeConfig> set_plane_size(const real_t &_value) const;
144 // #docs_func set_plane_size
145 NAPI NSELF_RETURN set_plane_size_selfreturn(const real_t &_value) const;
146 NAPI real_t get_plane_size() const;
147
153 Ref<DebugDraw3DScopeConfig> set_transform(const godot::Transform3D &_value) const;
155 // #docs_func set_transform
156 NAPI NSELF_RETURN set_transform_selfreturn(const godot::Transform3D &_value) const;
157 NAPI godot::Transform3D get_transform() const;
158
167 Ref<DebugDraw3DScopeConfig> set_text_outline_color(const godot::Color &_value) const;
169 // #docs_func set_text_outline_color
170 NAPI NSELF_RETURN set_text_outline_color_selfreturn(const godot::Color &_value) const;
171 NAPI godot::Color get_text_outline_color() const;
172
181 Ref<DebugDraw3DScopeConfig> set_text_outline_size(const int32_t &_value) const;
183 // #docs_func set_text_outline_size
184 NAPI NSELF_RETURN set_text_outline_size_selfreturn(const int32_t &_value) const;
185 NAPI int32_t get_text_outline_size() const;
186
195 Ref<DebugDraw3DScopeConfig> set_text_fixed_size(const bool &_value) const;
197 // #docs_func set_text_fixed_size
198 NAPI NSELF_RETURN set_text_fixed_size_selfreturn(const bool &_value) const;
199 NAPI bool get_text_fixed_size() const;
200
209 Ref<DebugDraw3DScopeConfig> set_text_font(const Ref<godot::Font> &_value) const;
211 // #docs_func set_text_font
212 NAPI NSELF_RETURN set_text_font_selfreturn(const Ref<godot::Font> &_value) const;
213 NAPI Ref<godot::Font> get_text_font() const;
214
225 Ref<DebugDraw3DScopeConfig> set_viewport(godot::Viewport *_value) const;
227 // #docs_func set_viewport
228 NAPI NSELF_RETURN set_viewport_selfreturn(godot::Viewport *_value) const;
229 NAPI godot::Viewport *get_viewport() const;
230
239 Ref<DebugDraw3DScopeConfig> set_no_depth_test(const bool &_value) const;
241 // #docs_func set_no_depth_test
242 NAPI NSELF_RETURN set_no_depth_test_selfreturn(const bool &_value) const;
243 NAPI bool is_no_depth_test() const;
244
246 DebugDraw3DScopeConfig();
247
249 DebugDraw3DScopeConfig(const uint64_t &p_thread_id, const uint64_t &p_guard_id, const DebugDraw3DScopeConfig::Data *p_parent, const unregister_func p_unreg);
250 ~DebugDraw3DScopeConfig();
251};
Ref< DebugDraw3DScopeConfig > set_transform(const godot::Transform3D &_value) const
Ref< DebugDraw3DScopeConfig > set_hd_sphere(const bool &_value) const
Ref< DebugDraw3DScopeConfig > set_text_outline_size(const int32_t &_value) const
Ref< DebugDraw3DScopeConfig > set_center_brightness(const real_t &_value) const
Ref< DebugDraw3DScopeConfig > set_text_fixed_size(const bool &_value) const
Ref< DebugDraw3DScopeConfig > set_viewport(godot::Viewport *_value) const
Ref< DebugDraw3DScopeConfig > set_text_font(const Ref< godot::Font > &_value) const
Ref< DebugDraw3DScopeConfig > set_no_depth_test(const bool &_value) const
Ref< DebugDraw3DScopeConfig > set_thickness(const real_t &_value) const
Ref< DebugDraw3DScopeConfig > set_text_outline_color(const godot::Color &_value) const
Ref< DebugDraw3DScopeConfig > set_plane_size(const real_t &_value) const