Debug Draw 3D (and 2D) 1.3.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
5#include <functional>
6#include <memory>
7
8GODOT_WARNING_DISABLE()
9#include <godot_cpp/classes/ref_counted.hpp>
10GODOT_WARNING_RESTORE()
11using namespace godot;
12
56class DebugDraw3DScopeConfig : public RefCounted {
57 GDCLASS(DebugDraw3DScopeConfig, RefCounted)
58
59protected:
61 static void _bind_methods();
62
63private:
64 uint64_t thread_id;
65 uint64_t guard_id;
66
67 typedef std::function<void(const uint64_t &, const uint64_t &)> unregister_func;
68 unregister_func unregister_action;
69
70public:
72 struct Data {
73 // Update constructor!
74 real_t thickness;
75 real_t center_brightness;
76 bool hd_sphere;
77 real_t plane_size;
78
79 Data();
80 Data(const std::shared_ptr<Data> &parent);
81 };
83 std::shared_ptr<Data> data = nullptr;
84
86 // It can be used for example in C#
87 void _manual_unregister();
88
94 Ref<DebugDraw3DScopeConfig> set_thickness(real_t value);
95 real_t get_thickness();
96
102 Ref<DebugDraw3DScopeConfig> set_center_brightness(real_t value);
103 real_t get_center_brightness();
104
110 Ref<DebugDraw3DScopeConfig> set_hd_sphere(bool value);
111 bool is_hd_sphere();
112
118 Ref<DebugDraw3DScopeConfig> set_plane_size(real_t value);
119 real_t get_plane_size();
120
123
124 // `DDScopedConfig3D` is passed as Ref to avoid a random unreference
126 DebugDraw3DScopeConfig(const uint64_t &p_thread_id, const uint64_t &p_guard_id, const std::shared_ptr<DebugDraw3DScopeConfig::Data> &parent, const unregister_func p_unreg);
128};
This class is used to override scope parameters for DebugDraw3D.
Definition config_scope_3d.h:56
Ref< DebugDraw3DScopeConfig > set_hd_sphere(bool value)
Ref< DebugDraw3DScopeConfig > set_center_brightness(real_t value)
Ref< DebugDraw3DScopeConfig > set_plane_size(real_t value)
Ref< DebugDraw3DScopeConfig > set_thickness(real_t value)