[4.4.1+] 1.7.0
[!WARNING] This release contains a bug that can cause crashes when calling
draw_boxanddraw_capsuleinC#scripts. Please upgrade to 1.7.1.
Native API
The main change in this update is the addition of a native API and bindings for it! 🎉
The request to add this feature (#56) was made quite a while ago, but finally everything is ready for release!
Starting with this update, you can use DebugDraw3D from your C++ code by simply including one file addons/debug_draw_3d/native_api/cpp/dd3d_cpp_api.hpp in your project.
#include "dd3d_cpp_api.hpp"
void DD3DTestCppApiNode::_process(double p_delta) {
{
auto test = DebugDraw3DScopeConfig();
// DD3D GDExtension not loaded
if (!test)
return;
}
DebugDraw3D::draw_text(Vector3(1, 1, 1), String::utf8("Hello Привет こんにちは หวัดดี"));
DebugDraw3D::draw_sphere(Vector3(1, 1, 1), 2, Color(1, 1, 0), 0);
}
DebugDraw3D has also supported C# for quite some time, but this support was implemented based on GodotObject.Call, which made DD3D even slower than GDScript when used with C#. Now C# uses the same native API as C++, which makes C# several times faster than GDScript. For example, an array of 7,500 boxes is now sent for rendering in 1 ms instead of 4.2 ms. Roughly 4 times faster on my PC, and 15-28 times faster than the old C# bindings!
The API should have remained unchanged, unless I missed something, except that DebugDraw2D.SetText now requires value to be explicitly converted to a string.
So now, instead of:
DebugDraw2D.SetText("FPS", Engine.GetFramesPerSecond());
You need to write:
DebugDraw2D.SetText("FPS", Engine.GetFramesPerSecond().ToString());
Also, both binding files for C# and C++ now contain the original doxygen documentation, but without images 😅.
Other changes
Core
- Updated
godot-cppto4.4.1 - Added a dedicated
extension_api_double.jsonforgodot-cpp 4.4.1
New
- Added
draw_capsuleanddraw_capsule_ab. #92 -
- Added a check for the distance between points
aandbin*_abmethods to avoid console spam. - Added drawing of elements if a path of size 1 was passed to
*_path. -
- Now the "path" will be displayed even if only one element is passed. But only in the form of a square or sphere.
Optimizations
- Slightly optimized
draw_lines_canddraw_grid_xf. - Increased the performance of
draw_points_cby ~30+%. -
- In some places, raw memory is now used instead of initialized
C++arrays.
- In some places, raw memory is now used instead of initialized
- Reduced the number of initializations of new arrays.
- Added manual
AABBcalculation for instances. -
- Now it should be more accurate and processed faster.
~33ms->~24ms(27% faster) with 1M boxes.
- Now it should be more accurate and processed faster.
C#
- Added converter from
doxygentoC#documentation. - Added automatic removal of old bindings.
-
- Added notification about deleting old files.
- Warnings about non-cleared objects are hidden in non-verbose mode. This is because
C#clears objects after GDExtensions are unloaded. - Removed
Generate C# bindingsfrom the menu. - Updated
C#demo to support the newSetText.
Various fixes
- Fixed crash when passing a zero-sized array to the
draw_arrow_pathmethod. #93 - Fixed text flickering if it updates in the same frame when its time expires.
- Fixed the position of
Label3Dwhen the root of the world in which it is located changes its position. - Fixed the size of the allocated space for the array for vertices and normals of the sphere.
- Fixed interaction between
scoped.transformand object position fixing fordoublebuilds. -
- Now the correction of the position occurs in one place, instead of each
draw_*method.
- Now the correction of the position occurs in one place, instead of each
Demo
- Fixed the appearance of some demo scene elements when rotating the root node.
- Changed the default brightness.
- Replaced the pixel font.
Docs
- Added
NativeAPI.md. - Updated animations in the docs.
-
- Used the latest version of
ffmpeg. Removed some artifacts.
- Used the latest version of
- Added previews for
set_transform. -
Misc
- Redesigned
GeometryGeneratorto support more accurate alignment of volumetric segments. -
- Also added the ability to locally enable or disable bevels on volumetric meshes.
-
Full Changelog: https://github.com/DmitriySalnikov/godot_debug_draw_3d/compare/1.6.0...1.7.0