Skip to content

Commit 391066a

Browse files
committed
bla
0 parents  commit 391066a

File tree

60 files changed

+3688
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+3688
-0
lines changed

.gitignore

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Godot 4+ specific ignores
2+
# https://github.com/github/gitignore/blob/main/Godot.gitignore
3+
.godot/
4+
5+
# Godot-specific ignores
6+
.import/
7+
export.cfg
8+
export_presets.cfg
9+
10+
# Imported translations (automatically generated from CSV files)
11+
*.translation
12+
13+
# Mono-specific ignores
14+
.mono/
15+
data_*/
16+
mono_crash.*.json
17+
18+
# Unity Gitignore
19+
20+
[Ll]ibrary/
21+
[Tt]emp/
22+
[Oo]bj/
23+
[Bb]uild/
24+
[Bb]uilds/
25+
[P]ackages/
26+
Log
27+
Logs
28+
Klak
29+
30+
.vs
31+
.vs/Forms/v15/Server/sqlite3/storage.ide-shm
32+
.vs/Forms/v15/Server/sqlite3/storage.ide-wal
33+
.vs/Forms/v15/sqlite3/storage.ide
34+
Assets/Plugins/
35+
Assets/GoogleVR/
36+
Assets/LeapMotion/
37+
SteamVR
38+
Oculus
39+
Assets/Oculus.meta
40+
Standard Assets
41+
Assets/SteamVR.meta
42+
PostProcessing
43+
44+
# Autogenerated VS/MD solution and project files
45+
ExportedObj/
46+
*.csproj
47+
*.unityproj
48+
*.sln
49+
*.suo
50+
*.tmp
51+
*.user
52+
*.userprefs
53+
*.pidb
54+
*.booproj
55+
*.svd
56+
*.ide
57+
58+
# Unity3D generated meta files
59+
*.pidb.meta
60+
61+
# Unity3D Generated File On Crash Reports
62+
sysinfo.txt
63+
64+
# Builds
65+
*.apk
66+
*.unitypackage

Examples/.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Normalize EOL for all files that Git considers text files.
2+
* text=auto eol=lf

Examples/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Godot 4+ specific ignores
2+
.godot/

Examples/addons/debug_draw_3d/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 DmitriySalnikov
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the Software), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, andor sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
![icon](/images/icon_3d_128.png)
2+
3+
# Debug drawing utility for Godot
4+
5+
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` or `C#`.
6+
7+
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)
8+
9+
## [Documentation](https://dd3d.dmitriysalnikov.ru/docs/)
10+
11+
## [Godot 3 version](https://github.com/DmitriySalnikov/godot_debug_draw_3d/tree/godot_3)
12+
13+
## Support me
14+
15+
Your support adds motivation to develop my public projects.
16+
17+
<a href="https://boosty.to/dmitriysalnikov/donate"><img src="./docs/images/boosty.png" alt="Boosty" width=150px/></a>
18+
19+
<img src="./docs/images/USDT-TRC20.png" alt="USDT-TRC20" width=150px/>
20+
21+
<b>USDT-TRC20 TEw934PrsffHsAn5M63SoHYRuZo984EF6v</b>
22+
23+
## Features
24+
25+
3D:
26+
27+
* Arrow
28+
* Billboard opaque square
29+
* Box
30+
* Camera Frustum
31+
* Cylinder
32+
* Gizmo
33+
* Grid
34+
* Line
35+
* Line Path
36+
* Line with Arrow
37+
* Plane
38+
* Points
39+
* Position 3D (3 crossing axes)
40+
* Sphere
41+
42+
2D:
43+
44+
* **[Work in progress]**
45+
46+
Overlay:
47+
48+
* Text (with grouping and coloring)
49+
* FPS Graph
50+
* Custom Graphs
51+
52+
Precompiled for:
53+
54+
* Windows
55+
* Linux (built on Ubuntu 20.04)
56+
* macOS (10.14+)
57+
* Android (5.0+)
58+
* Web (Firefox not supported)
59+
60+
## [Interactive Web Demo](https://dd3d.dmitriysalnikov.ru/demo/)
61+
62+
[![screenshot_web](/images/screenshot_web.png)](https://dd3d.dmitriysalnikov.ru/demo/)
63+
64+
Thanks to Nick Maltbie ([nicholas-maltbie](https://github.com/nicholas-maltbie)) ([#24](https://github.com/DmitriySalnikov/godot_debug_draw_3d/pull/24))
65+
66+
> [!WARNING]
67+
>
68+
> * Firefox most likely can't run this demo
69+
70+
## Download
71+
72+
To download, use the [Godot Asset Library](https://godotengine.org/asset-library/asset/1766) 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](https://github.com/DmitriySalnikov/godot_debug_draw_3d/releases) page (just download one of the `Source Codes` in assets).
73+
74+
### Installation
75+
76+
* Close editor
77+
* Copy `addons/debug_draw_3d` to your `addons` folder, create it if the folder doesn't exist
78+
* Launch editor
79+
80+
## Examples
81+
82+
More examples can be found in the `examples_dd3d/` folder.
83+
84+
Simple test:
85+
86+
```gdscript
87+
func _process(delta: float) -> void:
88+
var _time = Time.get_ticks_msec() / 1000.0
89+
var box_pos = Vector3(0, sin(_time * 4), 0)
90+
var line_begin = Vector3(-1, sin(_time * 4), 0)
91+
var line_end = Vector3(1, cos(_time * 4), 0)
92+
93+
DebugDraw3D.draw_box(box_pos, Vector3(1, 2, 1), Color(0, 1, 0))
94+
DebugDraw3D.draw_line(line_begin, line_end, Color(1, 1, 0))
95+
DebugDraw2D.set_text("Time", _time)
96+
DebugDraw2D.set_text("Frames drawn", Engine.get_frames_drawn())
97+
DebugDraw2D.set_text("FPS", Engine.get_frames_per_second())
98+
DebugDraw2D.set_text("delta", delta)
99+
```
100+
101+
![screenshot_1](/images/screenshot_1.png)
102+
103+
## API
104+
105+
This project has a separate [documentation](https://dd3d.dmitriysalnikov.ru/docs/) page.
106+
107+
Also, a list of all functions is available in the documentation inside the editor (see `DebugDraw3D` and `DebugDraw2D`).
108+
109+
![screenshot_4](/images/screenshot_4.png)
110+
111+
## Known issues and limitations
112+
113+
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.
114+
115+
The text in the keys and values of a text group cannot contain multi-line strings.
116+
117+
The entire text overlay can only be placed in one corner, unlike `DataGraphs`.
118+
119+
[Frustum of Camera3D does not take into account the window size from ProjectSettings](https://github.com/godotengine/godot/issues/70362).
120+
121+
**The version for Godot 4.0 requires explicitly specifying the exact data types, otherwise errors may occur.**
122+
123+
## More screenshots
124+
125+
`DebugDrawDemoScene.tscn` in editor
126+
![screenshot_2](/images/screenshot_2.png)
127+
128+
`DebugDrawDemoScene.tscn` in play mode
129+
![screenshot_3](/images/screenshot_3.png)
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
[configuration]
2+
3+
entry_symbol = "debug_draw_3d_library_init"
4+
compatibility_minimum = "4.1.3"
5+
reloadable = false
6+
7+
[dependencies]
8+
9+
; example.x86_64 = { "relative or absolute path to the dependency" : "the path relative to the exported project", }
10+
; -------------------------------------
11+
; debug
12+
13+
macos = { }
14+
windows.x86_64 = { }
15+
linux.x86_64 = { }
16+
17+
web.wasm32 = {}
18+
19+
android.arm32 = { }
20+
android.arm64 = { }
21+
android.x86_32 = { }
22+
android.x86_64 = { }
23+
24+
; -------------------------------------
25+
; release no debug draw
26+
27+
macos.template_release = { }
28+
windows.template_release.x86_64 = { }
29+
linux.template_release.x86_64 = { }
30+
31+
web.template_release.wasm32 = { }
32+
33+
android.template_release.arm32 = { }
34+
android.template_release.arm64 = { }
35+
android.template_release.x86_32 = { }
36+
android.template_release.x86_64 = { }
37+
38+
; -------------------------------------
39+
; release forced debug draw
40+
41+
macos.template_release.forced_dd3d = { }
42+
windows.template_release.x86_64.forced_dd3d = { }
43+
linux.template_release.x86_64.forced_dd3d = { }
44+
45+
web.template_release.wasm32.forced_dd3d = { }
46+
47+
[libraries]
48+
49+
; -------------------------------------
50+
; debug
51+
52+
macos = "libs/libdd3d.macos.editor.universal.framework"
53+
windows.x86_64 = "libs/libdd3d.windows.editor.x86_64.dll"
54+
linux.x86_64 = "libs/libdd3d.linux.editor.x86_64.so"
55+
56+
web.wasm32 = "libs/libdd3d.web.template_debug.wasm32.wasm"
57+
58+
android.arm32 = "libs/libdd3d.android.template_debug.arm32.so"
59+
android.arm64 = "libs/libdd3d.android.template_debug.arm64.so"
60+
android.x86_32 = "libs/libdd3d.android.template_debug.x86_32.so"
61+
android.x86_64 = "libs/libdd3d.android.template_debug.x86_64.so"
62+
63+
; -------------------------------------
64+
; release no debug draw
65+
66+
macos.template_release = "libs/libdd3d.macos.template_release.universal.framework"
67+
windows.template_release.x86_64 = "libs/libdd3d.windows.template_release.x86_64.dll"
68+
linux.template_release.x86_64 = "libs/libdd3d.linux.template_release.x86_64.so"
69+
70+
web.template_release.wasm32 = "libs/libdd3d.web.template_release.wasm32.wasm"
71+
72+
android.template_release.arm32 = "libs/libdd3d.android.template_release.arm32.so"
73+
android.template_release.arm64 = "libs/libdd3d.android.template_release.arm64.so"
74+
android.template_release.x86_32 = "libs/libdd3d.android.template_release.x86_32.so"
75+
android.template_release.x86_64 = "libs/libdd3d.android.template_release.x86_64.so"
76+
77+
; -------------------------------------
78+
; release forced debug draw
79+
80+
macos.template_release.forced_dd3d = "libs/libdd3d.macos.template_release.universal.enabled.framework"
81+
windows.template_release.x86_64.forced_dd3d = "libs/libdd3d.windows.template_release.x86_64.enabled.dll"
82+
linux.template_release.x86_64.forced_dd3d = "libs/libdd3d.linux.template_release.x86_64.enabled.so"
83+
84+
web.template_release.wasm32.forced_dd3d = "libs/libdd3d.web.template_release.wasm32.enabled.wasm"

Examples/addons/debug_draw_3d/libs/.gdignore

Whitespace-only changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)