Debug Draw 3D 1.7.1
Draw 3D debug graphics and 2D overlays with this add-on.
Loading...
Searching...
No Matches
DebugDraw3DScopeConfig Class Reference

This class is used to override scope parameters for DebugDraw3D. More...

#include <config_scope_3d.h>

Inheritance diagram for DebugDraw3DScopeConfig:

Public Member Functions

Ref< DebugDraw3DScopeConfigset_thickness (const real_t &_value) const
NAPI real_t get_thickness () const
Ref< DebugDraw3DScopeConfigset_center_brightness (const real_t &_value) const
NAPI real_t get_center_brightness () const
Ref< DebugDraw3DScopeConfigset_hd_sphere (const bool &_value) const
NAPI bool is_hd_sphere () const
Ref< DebugDraw3DScopeConfigset_plane_size (const real_t &_value) const
NAPI real_t get_plane_size () const
Ref< DebugDraw3DScopeConfigset_transform (const godot::Transform3D &_value) const
NAPI godot::Transform3D get_transform () const
Ref< DebugDraw3DScopeConfigset_text_outline_color (const godot::Color &_value) const
NAPI godot::Color get_text_outline_color () const
Ref< DebugDraw3DScopeConfigset_text_outline_size (const int32_t &_value) const
NAPI int32_t get_text_outline_size () const
Ref< DebugDraw3DScopeConfigset_text_fixed_size (const bool &_value) const
NAPI bool get_text_fixed_size () const
Ref< DebugDraw3DScopeConfigset_text_font (const Ref< godot::Font > &_value) const
NAPI Ref< godot::Font > get_text_font () const
Ref< DebugDraw3DScopeConfigset_viewport (godot::Viewport *_value) const
NAPI godot::Viewport * get_viewport () const
Ref< DebugDraw3DScopeConfigset_no_depth_test (const bool &_value) const
NAPI bool is_no_depth_test () const

Detailed Description

This class is used to override scope parameters for DebugDraw3D.

Scope means that these overridden parameters will affect the drawn geometry until it exits the current scope.

To create it, use DebugDraw3D.new_scoped_config. Immediately after creation, you can change the values and save the reference in a variable.

Warning
But the main thing is not to save it outside the method or in other objects. After leaving the scope, this object should be deleted.

Warning
Also, you can't use scope config between awaits unless this object is freed before await. So, narrow the scope if you want to use await and DebugDraw3DScopeConfig in the same method. Or set the value of the variable to null so that the object is cleared due to lack of references.
# Bad example
var _s = DebugDraw3D.new_scoped_config().set_thickness(0.3)
DebugDraw3D.draw_box(Vector3.ZERO, Quaternion.IDENTITY, Vector3.ONE)
await get_tree().process_frame
# your code...
# Good example
if true:
var _s = DebugDraw3D.new_scoped_config().set_thickness(0.3)
DebugDraw3D.draw_box(Vector3.ZERO, Quaternion.IDENTITY, Vector3.ONE)
await get_tree().process_frame
# your code...
NAPI Ref< DebugDraw3DScopeConfig > new_scoped_config()
NAPI void draw_box(const godot::Vector3 &position, const godot::Quaternion &rotation, const godot::Vector3 &size, const godot::Color &color=Colors::empty_color, const bool &is_box_centered=false, const real_t &duration=0) FAKE_FUNC_IMPL

Examples:

var _s = DebugDraw3D.new_scoped_config().set_thickness(0.025).set_center_brightness(0.7)
DebugDraw3D.draw_grid_xf(%Grid.global_transform, Vector2i(10,10), Color.LIGHT_GRAY)
NAPI void draw_grid_xf(const godot::Transform3D &transform, const godot::Vector2i &p_subdivision, const godot::Color &color=Colors::empty_color, const bool &is_centered=true, const real_t &duration=0) FAKE_FUNC_IMPL
using (var s = DebugDraw3D.NewScopedConfig().SetThickness(0))
DebugDraw3D.DrawCameraFrustum(dCamera, Colors.DarkOrange);
Singleton class for calling debugging 3D methods.
Definition debug_draw_3d.h:121

Member Function Documentation

◆ set_thickness()

Ref< DebugDraw3DScopeConfig > DebugDraw3DScopeConfig::set_thickness ( const real_t & _value) const

Set the thickness of the volumetric lines. If the value is 0, the standard wireframe rendering will be used.

◆ set_center_brightness()

Ref< DebugDraw3DScopeConfig > DebugDraw3DScopeConfig::set_center_brightness ( const real_t & _value) const

Set the brightness of the central part of the volumetric lines.

◆ set_hd_sphere()

Ref< DebugDraw3DScopeConfig > DebugDraw3DScopeConfig::set_hd_sphere ( const bool & _value) const

Set the mesh density of the sphere

◆ set_plane_size()

Ref< DebugDraw3DScopeConfig > DebugDraw3DScopeConfig::set_plane_size ( const real_t & _value) const

Set the size of the Plane in DebugDraw3D.draw_plane. If set to INF, the Far parameter of the current camera will be used.

◆ set_transform()

Ref< DebugDraw3DScopeConfig > DebugDraw3DScopeConfig::set_transform ( const godot::Transform3D & _value) const

Set the base/local transform relative to which the shapes will be drawn.

◆ set_text_outline_color()

Ref< DebugDraw3DScopeConfig > DebugDraw3DScopeConfig::set_text_outline_color ( const godot::Color & _value) const

Set the outline color in DebugDraw3D.draw_text.

Warning
Frequent unsystematic changes to this property can lead to significant performance degradation.

◆ set_text_outline_size()

Ref< DebugDraw3DScopeConfig > DebugDraw3DScopeConfig::set_text_outline_size ( const int32_t & _value) const

Set the size of the outline in DebugDraw3D.draw_text.

Warning
Frequent unsystematic changes to this property can lead to significant performance degradation.

◆ set_text_fixed_size()

Ref< DebugDraw3DScopeConfig > DebugDraw3DScopeConfig::set_text_fixed_size ( const bool & _value) const

Makes the text in DebugDraw3D.draw_text the same size regardless of distance.

Warning
Frequent unsystematic changes to this property can lead to significant performance degradation.

◆ set_text_font()

Ref< DebugDraw3DScopeConfig > DebugDraw3DScopeConfig::set_text_font ( const Ref< godot::Font > & _value) const

Set the font of the text in DebugDraw3D.draw_text.

Warning
Frequent unsystematic changes to this property can lead to significant performance degradation.

◆ set_viewport()

Ref< DebugDraw3DScopeConfig > DebugDraw3DScopeConfig::set_viewport ( godot::Viewport * _value) const

Set which Viewport will be used to get World3D.

If the World3D of this Viewport has not been used before, then the owner of this World3D will be found in the current branch of the tree, and special observer nodes will be added to it.

Note
Objects created for a specific Viewport will use only one camera related to that Viewport for culling.

◆ set_no_depth_test()

Ref< DebugDraw3DScopeConfig > DebugDraw3DScopeConfig::set_no_depth_test ( const bool & _value) const

Set whether the depth_test_disabled flag is added or not in the shaders of the debug shapes.

Note
It may cause artifacts when drawing volumetric objects.

The documentation for this class was generated from the following file: