Repository navigation
Add missing AABB constructor with 6 real_t values - #124240
Conversation
Ivorforce
left a comment
There was a problem hiding this comment.
Is this needed for any other types? Since AABB is made up of two Vector3 i would expect it to be constructed from two Vector3 objects normally.
Good idea, I didn't check. But I just did. The
Perhaps, but that's not what the C++ and C# bindings generators generate. I think that would be a separate proposal. |
|
Thanks! |
This is the same as PR #104113, but for AABB instead of Projection.
What problem(s) does this PR solve?
When GDExtension generates bindings, it creates C++ code based on the API JSON. Values are serialized into literals constructed with numbers matching the value, for example,
Vector3(0, 1, 0). This includes default values for function parameters. AABB default values are serialized likeAABB(0, 0, 0, 1, 1, 1). However, Godot is missing a constructor for AABB, so the generated C++ code doesn't compile:I encountered this problem when the CI checks for godot-cpp failed to compile with my 4D module, because one of the bound methods includes an AABB default value, which cannot be constructed, as seen in the above image. This wasn't a problem in the engine before because the engine doesn't have any AABB default values in parameters.
Note: I believe to fix the exact problem, it only needs to be added to godot-cpp (see godotengine/godot-cpp#2063). However, we should make the same change in the engine for consistency.
Additional information
No AI was used at all, except to check that there are no other Variant types that need a
real_tconstructor.