Debug Draw 3D (and 2D) 1.4.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/ref_counted.hpp>
10#include <godot_cpp/classes/viewport.hpp>
11GODOT_WARNING_RESTORE()
12using namespace godot;
13
57class DebugDraw3DScopeConfig : public RefCounted {
58 GDCLASS(DebugDraw3DScopeConfig, RefCounted)
59
60protected:
62 static void _bind_methods();
63
64private:
65 uint64_t thread_id;
66 uint64_t guard_id;
67
68 typedef std::function<void(const uint64_t &, const uint64_t &)> unregister_func;
69 unregister_func unregister_action;
70
71public:
73 struct Data {
74 // Update the constructor if changes are made!
75 real_t thickness;
76 real_t center_brightness;
77 bool hd_sphere;
78 real_t plane_size;
79 Viewport *viewport;
80
81 Data();
82 Data(const std::shared_ptr<Data> &parent);
83 };
85 std::shared_ptr<Data> data = nullptr;
86
88 // It can be used for example in C#
89 void _manual_unregister();
90
96 Ref<DebugDraw3DScopeConfig> set_thickness(real_t _value);
97 real_t get_thickness() const;
98
104 Ref<DebugDraw3DScopeConfig> set_center_brightness(real_t _value);
105 real_t get_center_brightness() const;
106
112 Ref<DebugDraw3DScopeConfig> set_hd_sphere(bool _value);
113 bool is_hd_sphere() const;
114
120 Ref<DebugDraw3DScopeConfig> set_plane_size(real_t _value);
121 real_t get_plane_size() const;
122
133 Ref<DebugDraw3DScopeConfig> set_viewport(Viewport *_value);
134 Viewport *get_viewport() const;
135
138
139 // `DDScopedConfig3D` is passed as Ref to avoid a random unreference
141 DebugDraw3DScopeConfig(const uint64_t &p_thread_id, const uint64_t &p_guard_id, const std::shared_ptr<DebugDraw3DScopeConfig::Data> &p_parent, const unregister_func p_unreg);
143};
This class is used to override scope parameters for DebugDraw3D.
Definition config_scope_3d.h:57
Ref< DebugDraw3DScopeConfig > set_viewport(Viewport *_value)
Ref< DebugDraw3DScopeConfig > set_center_brightness(real_t _value)
Ref< DebugDraw3DScopeConfig > set_plane_size(real_t _value)
Ref< DebugDraw3DScopeConfig > set_thickness(real_t _value)
Ref< DebugDraw3DScopeConfig > set_hd_sphere(bool _value)