Skip to content

Support binding math constants#1937

Open
Repiteo wants to merge 1 commit intogodotengine:masterfrom
Repiteo:bind-math-constants
Open

Support binding math constants#1937
Repiteo wants to merge 1 commit intogodotengine:masterfrom
Repiteo:bind-math-constants

Conversation

@Repiteo
Copy link
Contributor

@Repiteo Repiteo commented Feb 26, 2026

Enables the ability to bind ±pi, ±tau, ±inf, and nan values. Previously the binding generator would try to pass these aliases directly to C++, causing build errors:

Error: /home/runner/work/godot/godot/godot-cpp/gen/include/godot_cpp/classes/tween.hpp:117:72: error: 'inf' was not declared in this scope; did you mean 'ynf'?
  117 |         Ref<Tween> set_trans_params(double p_param1, double p_param2 = inf);
      |                                                                        ^~~
      |                                                                        ynf

After these changes, this would result in:

Ref<Tween> set_trans_params(double p_param1, double p_param2 = Math_INF);

@Repiteo Repiteo added this to the 10.x milestone Feb 26, 2026
@Repiteo Repiteo requested a review from a team as a code owner February 26, 2026 15:50
@Repiteo Repiteo added bug This has been identified as a bug topic:buildsystem Related to the buildsystem or CI setup cherrypick:4.5 labels Feb 26, 2026
@dsnopek
Copy link
Collaborator

dsnopek commented Feb 26, 2026

Thanks!

Overall, this makes sense. However, on godotengine/godot#82155 it's only making it so that Godot can generate "inf" or "-inf" - Godot can't generate any of the others added in this PR. I think there should be a PR (that's likely to be merged) on the Godot side for all of these before we merge support for them into godot-cpp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug This has been identified as a bug cherrypick:4.5 topic:buildsystem Related to the buildsystem or CI setup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants