-
-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a real
type
#135
Comments
godot-cpp could also serve as an inspiration here. |
This is what godot-cpp does: This In our case, maybe we could even detect it from the Godot binary and generate the appropriate code? |
i couldn't really find a way to reliably detect it from the godot binary, but if you can find something that'd be useful! currently i've just added a feature called |
Regarding detection, I got this answer from Godot devs:
|
Currently a lot of struct and functions in rust are hard-coded to use
f32
s. Such asVector2
,Vector3
etc. But in godot these structs and functions may be eitherfloat
ordouble
depending on whether godot is compiled withprecision=double
or not.In godot the type used is called
real_t
and will be either afloat
ordouble
. We could do the same in our bindings. As it is, our bindings will likely break if we try to use it with a godot that is compiled withprecision=double
enabled.The
float
type in godot, and thus the one used by variant, is always adouble
, see: https://docs.godotengine.org/en/stable/classes/class_float.html.The text was updated successfully, but these errors were encountered: