Closed blicksyne closed 5 years ago
Ah yes, that is because there is no ArgCast for doubles.
I'll add it soon
The problem is that doubles aren't supported in Variant, so it's not useful to use them whenever you interface with Godot. Not much we can do about it here in the bindings :(
Oh, turns out that there is a problem here actually. I'll look into this today.
Actually the problem aren't the doubles, the problem are floats. Godot ptrcall expects all floating point numbers to be passed via double *
, even in the case of floats.
This is fixed on the nativescript-1.1 branch, by the commit 2dbc73f.
If there's much demand then this is easy to cherry pick, but I hope to get the nativescript-1.1 branch into a stable state very soon anyway.
Seeing nativescript 1.1 has now been merged into master I'm closing this.
When trying to call functions that take doubles as arguments (double on the bindings side usually and float internally), the value received by the function in the bindings is correct, but the value received inside the actual function is incorrect. Some examples are: set_rotation_deg, set_rotation, set_rotation_in_degrees. The value received on the engine side is NaN for most functions affected by this. Another affected function is set_anchor. In this case a 0 is received when 1 is passed as the second argument.
My local godot, godot-cpp and godot_headers repositories are up-to-date and I'm on Ubuntu 17.06 using GCC. The issue was also present on Windows 10 using MSVC, before the linking issue on Windows appeared.