Add a real
type (original) (raw)
Currently a lot of struct and functions in rust are hard-coded to use f32
s. Such as Vector2
, Vector3
etc. But in godot these structs and functions may be either float
or double
depending on whether godot is compiled with precision=double
or not.
In godot the type used is called real_t
and will be either a float
or double
. 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 with precision=double
enabled.
The float
type in godot, and thus the one used by variant, is always a double
, see: https://docs.godotengine.org/en/stable/classes/class_float.html.