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

Singleton class for calling debugging 3D methods. More...

#include <debug_draw_3d.h>

Inheritance diagram for DebugDraw3D:

Public Types

enum  PointType : uint32_t {
  POINT_TYPE_SQUARE ,
  POINT_TYPE_SPHERE
}

Public Member Functions

NAPI Ref< DebugDraw3DScopeConfignew_scoped_config ()
NAPI Ref< DebugDraw3DScopeConfigscoped_config () override
NAPI void set_config (Ref< DebugDraw3DConfig > cfg)
NAPI Ref< DebugDraw3DConfigget_config () const
Color get_empty_color () const
NAPI void set_debug_enabled (const bool &state)
NAPI bool is_debug_enabled () const
NAPI Ref< DebugDraw3DStatsget_render_stats ()
NAPI Ref< DebugDraw3DStatsget_render_stats_for_world (godot::Viewport *viewport)
NAPI void regenerate_geometry_meshes ()
NAPI void clear_all ()
NAPI void draw_sphere (const godot::Vector3 &position, const real_t &radius=0.5f, const godot::Color &color=Colors::empty_color, const real_t &duration=0) FAKE_FUNC_IMPL
NAPI void draw_sphere_xf (const godot::Transform3D &transform, const godot::Color &color=Colors::empty_color, const real_t &duration=0) FAKE_FUNC_IMPL
NAPI void draw_capsule (const godot::Vector3 &position, const godot::Quaternion &rotation, const real_t &radius, const real_t &height, const godot::Color &color=Colors::empty_color, const real_t &duration=0) FAKE_FUNC_IMPL
NAPI void draw_capsule_ab (const godot::Vector3 &a, const godot::Vector3 &b, const real_t &radius=0.5f, const godot::Color &color=Colors::empty_color, const real_t &duration=0) FAKE_FUNC_IMPL
NAPI void draw_cylinder (const godot::Transform3D &transform, const godot::Color &color=Colors::empty_color, const real_t &duration=0) FAKE_FUNC_IMPL
NAPI void draw_cylinder_ab (const godot::Vector3 &a, const godot::Vector3 &b, const real_t &radius=0.5f, const godot::Color &color=Colors::empty_color, const real_t &duration=0) FAKE_FUNC_IMPL
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
NAPI void draw_box_ab (const godot::Vector3 &a, const godot::Vector3 &b, const godot::Vector3 &up, const godot::Color &color=Colors::empty_color, const bool &is_ab_diagonal=true, const real_t &duration=0) FAKE_FUNC_IMPL
NAPI void draw_box_xf (const godot::Transform3D &transform, const godot::Color &color=Colors::empty_color, const bool &is_box_centered=true, const real_t &duration=0) FAKE_FUNC_IMPL
NAPI void draw_aabb (const godot::AABB &aabb, const godot::Color &color=Colors::empty_color, const real_t &duration=0) FAKE_FUNC_IMPL
NAPI void draw_aabb_ab (const godot::Vector3 &a, const godot::Vector3 &b, const godot::Color &color=Colors::empty_color, const real_t &duration=0) FAKE_FUNC_IMPL
NAPI void draw_line_hit (const godot::Vector3 &start, const godot::Vector3 &end, const godot::Vector3 &hit, const bool &is_hit, const real_t &hit_size=0.25f, const godot::Color &hit_color=Colors::empty_color, const godot::Color &after_hit_color=Colors::empty_color, const real_t &duration=0) FAKE_FUNC_IMPL
NAPI void draw_line_hit_offset (const godot::Vector3 &start, const godot::Vector3 &end, const bool &is_hit, const real_t &unit_offset_of_hit=0.5f, const real_t &hit_size=0.25f, const godot::Color &hit_color=Colors::empty_color, const godot::Color &after_hit_color=Colors::empty_color, const real_t &duration=0) FAKE_FUNC_IMPL
NAPI void draw_line (const godot::Vector3 &a, const godot::Vector3 &b, const godot::Color &color=Colors::empty_color, const real_t &duration=0) FAKE_FUNC_IMPL
NAPI void draw_ray (const godot::Vector3 &origin, const godot::Vector3 &direction, const real_t &length, const godot::Color &color=Colors::empty_color, const real_t &duration=0) FAKE_FUNC_IMPL
void draw_lines (const godot::PackedVector3Array &lines, const godot::Color &color=Colors::empty_color, const real_t &duration=0) FAKE_FUNC_IMPL
void draw_line_path (const godot::PackedVector3Array &path, const godot::Color &color=Colors::empty_color, const real_t &duration=0) FAKE_FUNC_IMPL
NAPI void draw_arrowhead (const godot::Transform3D &transform, const godot::Color &color=Colors::empty_color, const real_t &duration=0) FAKE_FUNC_IMPL
NAPI void draw_arrow (const godot::Vector3 &a, const godot::Vector3 &b, const godot::Color &color=Colors::empty_color, const real_t &arrow_size=0.5f, const bool &is_absolute_size=false, const real_t &duration=0) FAKE_FUNC_IMPL
NAPI void draw_arrow_ray (const godot::Vector3 &origin, const godot::Vector3 &direction, const real_t &length, const godot::Color &color=Colors::empty_color, const real_t &arrow_size=0.5f, const bool &is_absolute_size=false, const real_t &duration=0) FAKE_FUNC_IMPL
void draw_arrow_path (const godot::PackedVector3Array &path, const godot::Color &color=Colors::empty_color, const real_t &arrow_size=0.75f, const bool &is_absolute_size=true, const real_t &duration=0) FAKE_FUNC_IMPL
void draw_point_path (const godot::PackedVector3Array &path, const DebugDraw3D::PointType type=PointType::POINT_TYPE_SQUARE, const real_t &size=0.25f, const godot::Color &points_color=Colors::empty_color, const godot::Color &lines_color=Colors::empty_color, const real_t &duration=0) FAKE_FUNC_IMPL
void draw_points (const godot::PackedVector3Array &points, const DebugDraw3D::PointType type=DebugDraw3D::PointType::POINT_TYPE_SQUARE, const real_t &size=0.25f, const godot::Color &color=Colors::empty_color, const real_t &duration=0) FAKE_FUNC_IMPL
NAPI void draw_square (const godot::Vector3 &position, const real_t &size=0.2f, const godot::Color &color=Colors::empty_color, const real_t &duration=0) FAKE_FUNC_IMPL
NAPI void draw_plane (const godot::Plane &plane, const godot::Color &color=Colors::empty_color, const godot::Vector3 &anchor_point=godot::Vector3(INFINITY, INFINITY, INFINITY), const real_t &duration=0) FAKE_FUNC_IMPL
NAPI void draw_position (const godot::Transform3D &transform, const godot::Color &color=Colors::empty_color, const real_t &duration=0) FAKE_FUNC_IMPL
NAPI void draw_gizmo (const godot::Transform3D &transform, const godot::Color &color=Colors::empty_color, const bool &is_centered=false, const real_t &duration=0) FAKE_FUNC_IMPL
NAPI void draw_grid (const godot::Vector3 &origin, const godot::Vector3 &x_size, const godot::Vector3 &y_size, const godot::Vector2i &subdivision, const godot::Color &color=Colors::empty_color, const bool &is_centered=true, const real_t &duration=0) FAKE_FUNC_IMPL
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
NAPI void draw_camera_frustum (const class godot::Camera3D *camera, const godot::Color &color=Colors::empty_color, const real_t &duration=0) FAKE_FUNC_IMPL
void draw_camera_frustum_planes (const godot::Array &camera_frustum, const godot::Color &color=Colors::empty_color, const real_t &duration=0) FAKE_FUNC_IMPL
void draw_text (const godot::Vector3 &position, const godot::String text, const int size=32, const godot::Color &color=Colors::empty_color, const real_t &duration=0) FAKE_FUNC_IMPL

Static Public Member Functions

static DebugDraw3Dget_singleton ()

Detailed Description

Singleton class for calling debugging 3D methods.

You can use the project settings debug_draw_3d/settings/3d for additional customization.

For example, add_bevel_to_volumetric_geometry allows you to remove or add a bevel for volumetric lines.

use_icosphere and use_icosphere_for_hd allow you to change the sphere mesh.

Note
Wireframe shapes and volumetric wireframes do not support translucency to avoid overlap issues and for better performance. At this point, you can use translucency when drawing planes DebugDraw3D.draw_plane.

Note
Objects created in _physics_process are processed separately from those created in _process, so they will be deleted only in the first physics tick after rendering. This allows to display objects even if several frames passed between physics ticks.

Note
You can use this class anywhere, including in _physics_process and _process (and probably from other threads). It is worth mentioning that physics ticks may not be called every frame or may be called several times in one frame. So if you want to avoid multiple identical draw_ calls, you can call draw_ methods in _process or use such a check:
var physics_tick_processed := false
func _process(delta: float) -> void:
# Reset after rendering frame
physics_tick_processed = false
# some logic
func _physics_process(delta: float) -> void:
if not physics_tick_processed:
physics_tick_processed = true
# some DD3D logic

Note
Due to the way Godot registers this addon, it is not possible to use the draw_ methods in the first few frames immediately after the project is launched.

Member Enumeration Documentation

◆ PointType

enum DebugDraw3D::PointType : uint32_t

Appearance of points on the path

Member Function Documentation

◆ get_singleton()

DebugDraw3D * DebugDraw3D::get_singleton ( )
inlinestatic

Get singleton. Not available in GDScript.

◆ new_scoped_config()

NAPI Ref< DebugDraw3DScopeConfig > DebugDraw3D::new_scoped_config ( )

Create a new DebugDraw3DScopeConfig instance and register it.

This class allows you to override some parameters within scope for the following draw_* calls.

Store this instance in a local variable inside the method.

◆ scoped_config()

NAPI Ref< DebugDraw3DScopeConfig > DebugDraw3D::scoped_config ( )
override

Returns the default scope settings that will be applied at the start of each new frame.

Default values can be overridden in the project settings debug_draw_3d/settings/3d/volumetric_defaults.

Note
When used in a managed language, this is not mandatory, but it is recommended to finish the scoped_config() configuration with a dispose. This will reduce the number of objects awaiting removal by the garbage collector.
DebugDraw3D.ScopedConfig().SetThickness(debug_thickness).Dispose();

◆ set_config()

NAPI void DebugDraw3D::set_config ( Ref< DebugDraw3DConfig > cfg)

Set the configuration global for everything in DebugDraw3D.

◆ get_config()

NAPI Ref< DebugDraw3DConfig > DebugDraw3D::get_config ( ) const

◆ get_empty_color()

Color DebugDraw3D::get_empty_color ( ) const

Get the color that is used as the default parameter for draw_* calls.

◆ set_debug_enabled()

NAPI void DebugDraw3D::set_debug_enabled ( const bool & state)

Set whether debug drawing works or not.

◆ get_render_stats()

NAPI Ref< DebugDraw3DStats > DebugDraw3D::get_render_stats ( )

Returns an instance of DebugDraw3DStats with the current statistics.

Some data can be delayed by 1 frame.

◆ get_render_stats_for_world()

NAPI Ref< DebugDraw3DStats > DebugDraw3D::get_render_stats_for_world ( godot::Viewport * viewport)

Returns an instance of DebugDraw3DStats with the current statistics for the World3D of the Viewport.

Some data can be delayed by 1 frame.

◆ regenerate_geometry_meshes()

NAPI void DebugDraw3D::regenerate_geometry_meshes ( )

Regenerate meshes.

Can be useful if you want to change some project settings and not restart the project.

◆ clear_all()

NAPI void DebugDraw3D::clear_all ( )

Clear all 3D geometry

◆ draw_sphere()

NAPI void DebugDraw3D::draw_sphere ( const godot::Vector3 & position,
const real_t & radius = 0.5f,
const godot::Color & color = Colors::empty_color,
const real_t & duration = 0 )

Draw a sphere

Parameters
positionCenter of the sphere
radiusSphere radius
colorPrimary color
durationThe duration of how long the object will be visible

◆ draw_sphere_xf()

NAPI void DebugDraw3D::draw_sphere_xf ( const godot::Transform3D & transform,
const godot::Color & color = Colors::empty_color,
const real_t & duration = 0 )

Draw a sphere with a radius of 0.5

Parameters
transformSphere transform
colorPrimary color
durationThe duration of how long the object will be visible

◆ draw_capsule()

NAPI void DebugDraw3D::draw_capsule ( const godot::Vector3 & position,
const godot::Quaternion & rotation,
const real_t & radius,
const real_t & height,
const godot::Color & color = Colors::empty_color,
const real_t & duration = 0 )

Draw a vertical capsule

Note
A capsule will not be displayed if the height or radius is approximately equal to or less than zero.

Note
If you need to apply additional transformations, you can use DebugDraw3DScopeConfig.set_transform.
Parameters
positionCapsule position
rotationCapsule rotation
radiusCapsule radius
heightCapsule height including caps. Based on this value, the actual radius of the capsule will be calculated.
colorPrimary color
durationThe duration of how long the object will be visible

◆ draw_capsule_ab()

NAPI void DebugDraw3D::draw_capsule_ab ( const godot::Vector3 & a,
const godot::Vector3 & b,
const real_t & radius = 0.5f,
const godot::Color & color = Colors::empty_color,
const real_t & duration = 0 )

Draw a capsule between points A and B with the desired radius.

Note
A capsule will not be displayed if the distance between points A and B or the radius is approximately equal to or less than zero.
Parameters
aFirst pole of the capsule
bSecond pole of the capsule
radiusCapsule radius
colorPrimary color
durationThe duration of how long the object will be visible

◆ draw_cylinder()

NAPI void DebugDraw3D::draw_cylinder ( const godot::Transform3D & transform,
const godot::Color & color = Colors::empty_color,
const real_t & duration = 0 )

Draw a vertical cylinder with radius 1.0 (x, z) and height 1.0 (y)

Parameters
transformCylinder transform
colorPrimary color
durationThe duration of how long the object will be visible

◆ draw_cylinder_ab()

NAPI void DebugDraw3D::draw_cylinder_ab ( const godot::Vector3 & a,
const godot::Vector3 & b,
const real_t & radius = 0.5f,
const godot::Color & color = Colors::empty_color,
const real_t & duration = 0 )

Draw a cylinder between points A and B with a certain radius.

Note
A cylinder will not be displayed if the distance between points A and B is approximately zero.
Parameters
aBottom point of the Cylinder
bTop point of the Cylinder
radiusCylinder radius
colorPrimary color
durationThe duration of how long the object will be visible

◆ draw_box()

NAPI void DebugDraw3D::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 )

Draw a box

is_box_centered = true
is_box_centered = false
Parameters
positionPosition of the Box
rotationRotation of the box
sizeSize of the Box
colorPrimary color
is_box_centeredSet where the center of the box will be. In the center or in the bottom corner
durationThe duration of how long the object will be visible

◆ draw_box_ab()

NAPI void DebugDraw3D::draw_box_ab ( const godot::Vector3 & a,
const godot::Vector3 & b,
const godot::Vector3 & up,
const godot::Color & color = Colors::empty_color,
const bool & is_ab_diagonal = true,
const real_t & duration = 0 )

Draw a box between points A and B by rotating and scaling based on the up vector

is_ab_diagonal = true
is_ab_diagonal = false
Note
A box will not be displayed if its dimensions are close to zero or if the up vector is approximately zero.
Parameters
aStart position
bEnd position
upVertical vector by which the box will be aligned
colorPrimary color
is_ab_diagonalSet uses the diagonal between the corners or the diagonal between the centers of two edges
durationThe duration of how long the object will be visible

◆ draw_box_xf()

NAPI void DebugDraw3D::draw_box_xf ( const godot::Transform3D & transform,
const godot::Color & color = Colors::empty_color,
const bool & is_box_centered = true,
const real_t & duration = 0 )

Draw a box as in DebugDraw3D.draw_box

Parameters
transformBox transform
colorPrimary color
is_box_centeredSet where the center of the box will be. In the center or in the bottom corner
durationThe duration of how long the object will be visible

◆ draw_aabb()

NAPI void DebugDraw3D::draw_aabb ( const godot::AABB & aabb,
const godot::Color & color = Colors::empty_color,
const real_t & duration = 0 )

Draw a box as in DebugDraw3D.draw_box, but based on the AABB

Parameters
aabbAABB
colorPrimary color
durationThe duration of how long the object will be visible

◆ draw_aabb_ab()

NAPI void DebugDraw3D::draw_aabb_ab ( const godot::Vector3 & a,
const godot::Vector3 & b,
const godot::Color & color = Colors::empty_color,
const real_t & duration = 0 )

Draw the box as in DebugDraw3D.draw_aabb, but AABB is defined by the diagonal AB

Parameters
aStart position
bEnd position
colorPrimary color
durationThe duration of how long the object will be visible

◆ draw_line_hit()

NAPI void DebugDraw3D::draw_line_hit ( const godot::Vector3 & start,
const godot::Vector3 & end,
const godot::Vector3 & hit,
const bool & is_hit,
const real_t & hit_size = 0.25f,
const godot::Color & hit_color = Colors::empty_color,
const godot::Color & after_hit_color = Colors::empty_color,
const real_t & duration = 0 )

Draw line separated by hit point (billboard square) or not separated if is_hit = false.

Some of the default settings can be overridden in DebugDraw3DConfig.

Parameters
startStart point
endEnd point
hitHit point
is_hitWhether to draw the collision point
hit_sizeSize of the hit point
hit_colorColor of the hit point and line before hit
after_hit_colorColor of line after hit position
durationThe duration of how long the object will be visible

◆ draw_line_hit_offset()

NAPI void DebugDraw3D::draw_line_hit_offset ( const godot::Vector3 & start,
const godot::Vector3 & end,
const bool & is_hit,
const real_t & unit_offset_of_hit = 0.5f,
const real_t & hit_size = 0.25f,
const godot::Color & hit_color = Colors::empty_color,
const godot::Color & after_hit_color = Colors::empty_color,
const real_t & duration = 0 )

Draw line separated by hit point.

Similar to DebugDraw3D.draw_line_hit, but instead of a hit point, an offset from the start point is used.

Some of the default settings can be overridden in DebugDraw3DConfig.

Parameters
startStart point
endEnd point
is_hitWhether to draw the collision point
unit_offset_of_hitUnit offset on the line where the collision occurs
hit_sizeSize of the hit point
hit_colorColor of the hit point and line before hit
after_hit_colorColor of line after hit position
durationThe duration of how long the object will be visible

◆ draw_line()

NAPI void DebugDraw3D::draw_line ( const godot::Vector3 & a,
const godot::Vector3 & b,
const godot::Color & color = Colors::empty_color,
const real_t & duration = 0 )

Draw a single line

Parameters
aStart point
bEnd point
colorPrimary color
durationThe duration of how long the object will be visible

◆ draw_ray()

NAPI void DebugDraw3D::draw_ray ( const godot::Vector3 & origin,
const godot::Vector3 & direction,
const real_t & length,
const godot::Color & color = Colors::empty_color,
const real_t & duration = 0 )

Draw a ray.

Same as DebugDraw3D.draw_line, but uses origin, direction and length instead of A and B.

Parameters
originOrigin
directionDirection
lengthLength
colorPrimary color
durationThe duration of how long the object will be visible

◆ draw_lines()

void DebugDraw3D::draw_lines ( const godot::PackedVector3Array & lines,
const godot::Color & color = Colors::empty_color,
const real_t & duration = 0 )

Draw an array of lines. Each line is two points, so the array must be of even size.

Parameters
linesAn array of points of lines. 1 line = 2 vectors3. The array size must be even.
colorPrimary color
durationThe duration of how long the object will be visible

◆ draw_line_path()

void DebugDraw3D::draw_line_path ( const godot::PackedVector3Array & path,
const godot::Color & color = Colors::empty_color,
const real_t & duration = 0 )

Draw an array of lines.

Unlike DebugDraw3D.draw_lines, here lines are drawn between each point in the array.

The array can be of any size.

Note
If the path size is equal to 1, then DebugDraw3D.draw_square will be used instead of drawing a line.
Parameters
pathSequence of points
colorPrimary color
durationThe duration of how long the object will be visible

◆ draw_arrowhead()

NAPI void DebugDraw3D::draw_arrowhead ( const godot::Transform3D & transform,
const godot::Color & color = Colors::empty_color,
const real_t & duration = 0 )

Draw the arrowhead

Parameters
transformgodot::Transform3D of the Arrowhead
colorPrimary color
durationThe duration of how long the object will be visible

◆ draw_arrow()

NAPI void DebugDraw3D::draw_arrow ( const godot::Vector3 & a,
const godot::Vector3 & b,
const godot::Color & color = Colors::empty_color,
const real_t & arrow_size = 0.5f,
const bool & is_absolute_size = false,
const real_t & duration = 0 )

Draw line with arrowhead

Note
An arrow will not be displayed if the distance between points a and b is approximately zero.
Parameters
aStart point
bEnd point
colorPrimary color
arrow_sizeSize of the arrow
is_absolute_sizeIs arrow_size absolute or relative to the length of the string?
durationThe duration of how long the object will be visible

◆ draw_arrow_ray()

NAPI void DebugDraw3D::draw_arrow_ray ( const godot::Vector3 & origin,
const godot::Vector3 & direction,
const real_t & length,
const godot::Color & color = Colors::empty_color,
const real_t & arrow_size = 0.5f,
const bool & is_absolute_size = false,
const real_t & duration = 0 )

Same as DebugDraw3D.draw_arrow, but uses origin, direction and length instead of A and B.

Parameters
originOrigin
directionDirection
lengthLength
colorPrimary color
arrow_sizeSize of the arrow
is_absolute_sizeIs arrow_size absolute or relative to the line length?
durationThe duration of how long the object will be visible

◆ draw_arrow_path()

void DebugDraw3D::draw_arrow_path ( const godot::PackedVector3Array & path,
const godot::Color & color = Colors::empty_color,
const real_t & arrow_size = 0.75f,
const bool & is_absolute_size = true,
const real_t & duration = 0 )

Draw a sequence of points connected by lines with arrows like DebugDraw3D.draw_line_path.

Note
If the path size is equal to 1, then DebugDraw3D.draw_square will be used instead of drawing a line.
Parameters
pathSequence of points
colorPrimary color
arrow_sizeSize of the arrow
is_absolute_sizeIs the arrow_size absolute or relative to the length of the line?
durationThe duration of how long the object will be visible

◆ draw_point_path()

void DebugDraw3D::draw_point_path ( const godot::PackedVector3Array & path,
const DebugDraw3D::PointType type = PointType::POINT_TYPE_SQUARE,
const real_t & size = 0.25f,
const godot::Color & points_color = Colors::empty_color,
const godot::Color & lines_color = Colors::empty_color,
const real_t & duration = 0 )

Draw a sequence of points connected by lines using billboard squares or spheres like DebugDraw3D.draw_line_path.

type = DebugDraw3D.POINT_TYPE_SQUARE
type = DebugDraw3D.POINT_TYPE_SPHERE
Note
If the path size is equal to 1, then DebugDraw3D.draw_square or DebugDraw3D.draw_sphere will be used instead of drawing a line.
Parameters
pathSequence of points
typeType of points
points_colorColor of points
lines_colorColor of lines
sizeSize of squares
durationThe duration of how long the object will be visible

◆ draw_points()

void DebugDraw3D::draw_points ( const godot::PackedVector3Array & points,
const DebugDraw3D::PointType type = DebugDraw3D::PointType::POINT_TYPE_SQUARE,
const real_t & size = 0.25f,
const godot::Color & color = Colors::empty_color,
const real_t & duration = 0 )

Draw a sequence of points using billboard squares or spheres.

Parameters
pointsSequence of points
typeType of points
sizeSize of squares
colorPrimary color
durationThe duration of how long the object will be visible

◆ draw_square()

NAPI void DebugDraw3D::draw_square ( const godot::Vector3 & position,
const real_t & size = 0.2f,
const godot::Color & color = Colors::empty_color,
const real_t & duration = 0 )

Draw a square that will always be turned towards the camera

Parameters
positionCenter position of square
sizeSquare size
colorPrimary color
durationThe duration of how long the object will be visible

◆ draw_plane()

NAPI void DebugDraw3D::draw_plane ( const godot::Plane & plane,
const godot::Color & color = Colors::empty_color,
const godot::Vector3 & anchor_point = godot::Vector3(INFINITY, INFINITY, INFINITY),
const real_t & duration = 0 )

Draws a plane of non-infinite size relative to the position of the current camera.

The plane size is set based on the Far parameter of the current camera or with DebugDraw3DScopeConfig.set_plane_size.

Parameters
planePlane data
colorPrimary color
anchor_pointA point that is projected onto a Plane, and its projection is used as the center of the drawn plane
durationThe duration of how long the object will be visible

◆ draw_position()

NAPI void DebugDraw3D::draw_position ( const godot::Transform3D & transform,
const godot::Color & color = Colors::empty_color,
const real_t & duration = 0 )

Draw 3 intersecting lines with the given transformations

Parameters
transformgodot::Transform3D of lines
colorPrimary color
durationThe duration of how long the object will be visible

◆ draw_gizmo()

NAPI void DebugDraw3D::draw_gizmo ( const godot::Transform3D & transform,
const godot::Color & color = Colors::empty_color,
const bool & is_centered = false,
const real_t & duration = 0 )

Draw 3 lines with the given transformations and arrows at the ends

is_centered = false
is_centered = true
Parameters
transformgodot::Transform3D of lines
colorPrimary color
is_centeredIf true, then the lines will intersect in the center of the transform
durationThe duration of how long the object will be visible

◆ draw_grid()

NAPI void DebugDraw3D::draw_grid ( const godot::Vector3 & origin,
const godot::Vector3 & x_size,
const godot::Vector3 & y_size,
const godot::Vector2i & subdivision,
const godot::Color & color = Colors::empty_color,
const bool & is_centered = true,
const real_t & duration = 0 )

Draw simple grid with given size and subdivision

Parameters
originGrid origin
x_sizeDirection and size of the X side. As an axis in the Basis.
y_sizeDirection and size of the Y side. As an axis in the Basis.
subdivisionNumber of cells for the X and Y axes
colorPrimary color
is_centeredDraw lines relative to origin
durationThe duration of how long the object will be visible

◆ draw_grid_xf()

NAPI void DebugDraw3D::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 )

Draw a simple grid with a given transform and subdivision.

Like DebugDraw3D.draw_grid, but instead of origin, x_size and y_size, a single transform is used.

Parameters
transformgodot::Transform3D of the Grid
p_subdivisionNumber of cells for the X and Y axes
colorPrimary color
is_centeredDraw lines relative to origin
durationThe duration of how long the object will be visible

◆ draw_camera_frustum()

NAPI void DebugDraw3D::draw_camera_frustum ( const class godot::Camera3D * camera,
const godot::Color & color = Colors::empty_color,
const real_t & duration = 0 )

Draw camera frustum area.

Parameters
cameraCamera node
colorPrimary color
durationThe duration of how long the object will be visible

◆ draw_camera_frustum_planes()

void DebugDraw3D::draw_camera_frustum_planes ( const godot::Array & camera_frustum,
const godot::Color & color = Colors::empty_color,
const real_t & duration = 0 )

Draw the frustum area of the camera based on an array of 6 planes.

Parameters
camera_frustumArray of frustum planes
colorPrimary color
durationThe duration of how long the object will be visible

◆ draw_text()

void DebugDraw3D::draw_text ( const godot::Vector3 & position,
const godot::String text,
const int size = 32,
const godot::Color & color = Colors::empty_color,
const real_t & duration = 0 )

Draw text using Label3D.

Note
Outline can be changed using DebugDraw3DScopeConfig.set_text_outline_color and DebugDraw3DScopeConfig.set_text_outline_size. The font can be changed using DebugDraw3DScopeConfig.set_text_font. The text can be made to stay the same size regardless of distance using DebugDraw3DScopeConfig.set_text_fixed_size.
Parameters
positionCenter position of Label
textLabel's text
sizeFont size
colorPrimary color
durationThe duration of how long the object will be visible

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