Skip to content

Add missing AABB constructor with 6 real_t values - #124240

Merged
Repiteo merged 1 commit into
godotengine:masterfrom
aaronfranke:aabb-construct
Oct 7, 2026
Merged

Repiteo merged 1 commit into
godotengine:masterfrom
aaronfranke:aabb-construct

Conversation

@aaronfranke

@aaronfranke aaronfranke commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

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 like AABB(0, 0, 0, 1, 1, 1). However, Godot is missing a constructor for AABB, so the generated C++ code doesn't compile:

Screenshot 2026-10-06 142244

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_t constructor.

@Ivorforce Ivorforce left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@aaronfranke

Copy link
Copy Markdown
Member Author

Is this needed for any other types?

Good idea, I didn't check. But I just did. The real_t constructor is already present in Projection, Basis, Transform2D, Transform3D, Plane, Quaternion, Rect2 / Rect2i, Vector2/2i/3/3i/4/4i, and Color. The only missing Variant type is AABB. Also, all of them are already present in the C# code, including Aabb, so this PR does not need to touch the C# glue code.

Since AABB is made up of two Vector3 i would expect it to be constructed from two Vector3 objects normally.

Perhaps, but that's not what the C++ and C# bindings generators generate. I think that would be a separate proposal.

@Repiteo
Repiteo merged commit aec9d4d into godotengine:master Oct 7, 2026
20 checks passed
@Repiteo

Repiteo commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Thanks!

@aaronfranke
aaronfranke deleted the aabb-construct branch October 7, 2026 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants