Closed Zuriel-Zurichi closed 8 months ago
You need to build the engine with double precision as well or it won't work, see the documentation
Op stated using a double-precision version of the engine
.
For context this is the code that calls set_map_data
Here is the definition of map_data, which is passed to that function.
PackedFloat32Array map_data = PackedFloat32Array();
https://github.com/TokisanGames/Terrain3D/blob/bc660a30aa4233234ae2c31b10cf44e60ddc4642/src/terrain_3d.cpp#L302
This works fine in 32-bit for hundreds of users. set_map_data
expects a Vector<real_t>
aka a PackedFloat32Array
.
https://github.com/godotengine/godot/blob/41564aaf7708b0bf594f745dd2448a54dd687cc5/scene/resources/height_map_shape_3d.h#L54
In double mode Vector<real_t>
changes to Vector<double>
. But the generated file the error refers to godot-cpp\gen\src\classes\height_map_shape3d.cpp:70
. Line 68, still looks like this:
void HeightMapShape3D::set_map_data(const PackedFloat32Array &data) {
This won't work with Godot expecting a Vector<double>
aka PackFloat64Array
. Thus the error message about being unable to bind the function and referring to this generated function.
Does it work if you generate the bindings from the double precision build?
We don't store bindings in the repo and I don't recall manually generating them since GDNative. We just run scons, which Op said he's specifying double precision.
Op, you can try manually creating bindings with the double precision engineer build and linking that json with your build. See if it changes the generated function header we've been looking at. You'll need to change our map_data type to match so it compiles, presumably packed64.
@AThousandShips It seems to have worked by making the bindings from the double precision executable, Thank you for your help
Godot version
https://github.com/godotengine/godot/commit/b09f793f564a6c95dc76acc654b390e68441bd01 b09f793f564a6c95dc76acc654b390e68441bd01
godot-cpp version
78ffea5b136f3178c31cddb28f6b963ceaa89420
System information
Windows 11, Ryzen 9 5950x, RTX 3060ti
Issue description
When using a double-precision version of the engine with godot-cpp, the following errors occur When trying to bind in functions
core\extension\gdextension_interface.cpp:1344 - Method 'HeightMapShape3D.set_map_data' has changed and no compatibility fallback has been provided. Please open an issue. godot-cpp\gen\src\classes\height_map_shape3d.cpp:70 - Method bind was not found. Likely the engine method changed to an incompatible version.
Steps to reproduce
Build Godot-cpp with Command Line scons precision=double target=template_release scons precision=double
godot-cpp\gen\src\classes\height_map_shape3d.cpp and godot-cpp\gen\include\godot_cpp\classes\height_map_shape3d.hpp
The set_map_data and get_map_data functions are always compiled with the PackedFloat32Array type
Minimal reproduction project
How to reproduce the error in the project
https://github.com/godotengine/godot-cpp/assets/21135068/b557b98c-1fc3-4d20-b205-d08762114708
Project: https://drive.google.com/file/d/13PswDNnduJU9KhlvOzVtJPoGt-FVa1V9/view?usp=sharing