Coder Social home page Coder Social logo

voxvos / godot_debug_draw_3d Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dmitriysalnikov/godot_debug_draw_3d

0.0 0.0 0.0 272.61 MB

Draw 3d debug graphics and 2d overlays with this add-on.

License: Other

C++ 81.35% Python 3.49% C 0.46% C# 6.26% GDScript 7.82% Batchfile 0.61%

godot_debug_draw_3d's Introduction

icon

Debug drawing utility for Godot

This is an add-on for debug drawing in 3D and for some 2D overlays, which is written in C++ and can be used with GDScript.

Based on my previous addon, which was developed only for C# https://github.com/DmitriySalnikov/godot_debug_draw_cs, and which was inspired by Zylann's GDScript addon https://github.com/Zylann/godot_debug_draw

Support me

Your support adds motivation to develop my public projects.

ko-fi

paypal

qiwi

Features

3D Primitives:

  • Arrow
  • Billboard opaque square
  • Box
  • Camera Frustum
  • Cylinder
  • Gizmo
  • Grid
  • Line
  • Line Path
  • Line with Arrow
  • Points
  • Position 3D (3 crossing axes)
  • Sphere

Overlay:

  • Text (with grouping and coloring)
  • FPS Graph
  • Custom Graphs

Precompiled for:

  • Windows
  • Linux
  • macOS
  • Android

Download

To download, use the Godot Asset Library or download the archive by clicking the button at the top of the main repository page: Code -> Download ZIP, then unzip it to your project folder. Or use one of the stable versions from the GitHub Releases page (just download one of the "Source Codes" in assets).

Usage

  1. Copy addons/debug_draw_3d to your addons folder, create it if the folder doesn't exist
  2. Restart the editor

Examples

More examples can be found in the examples_dd3d/ folder.

Simple test:

func _process(delta: float) -> void:
    var _time = Time.get_ticks_msec() / 1000.0
    var box_pos = Vector3(0, sin(_time * 4), 0)
    var line_begin = Vector3(-1, sin(_time * 4), 0)
    var line_end = Vector3(1, cos(_time * 4), 0)

    DebugDraw.draw_box(box_pos, Vector3(1, 2, 1), Color(0, 1, 0))
    DebugDraw.draw_line(line_begin, line_end, Color(1, 1, 0))
    DebugDraw.set_text("Time", _time)
    DebugDraw.set_text("Frames drawn", Engine.get_frames_drawn())
    DebugDraw.set_text("FPS", Engine.get_frames_per_second())
    DebugDraw.set_text("delta", delta)

screenshot_1

API

A list of all functions is available in the documentation inside the editor. screenshot_4

Besides DebugDraw, you can also use Dbg3.

    DebugDraw.draw_box_xf(Transform3D(), Color.GREEN)
    Dbg3.draw_box_xf(Transform3D(), Color.GREEN)

But unfortunately at the moment GDExtension does not support adding documentation.

Known issues and limitations

Enabling occlusion culing can lower fps instead of increasing it. At the moment I do not know how to speed up the calculation of the visibility of objects.

The text in the keys and values of a text group cannot contain multi-line strings.

The entire text overlay can only be placed in one corner, unlike DataGraphs.

Frustum of Camera3D does not take into account the window size from ProjectSettings.

The C# binding is not ready yet.

More screenshots

DebugDrawDemoScene.tscn in editor screenshot_2

DebugDrawDemoScene.tscn in play mode screenshot_3

godot_debug_draw_3d's People

Contributors

dmitriysalnikov avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.