Add a real
type · Issue #135 · godot-rust/gdext (original) (raw)
Navigation Menu
- GitHub Copilot Write better code with AI
- GitHub Models New Manage and compare prompts
- GitHub Advanced Security Find and fix vulnerabilities
- Actions Automate any workflow
- Codespaces Instant dev environments
- Issues Plan and track work
- Code Review Manage code changes
- Discussions Collaborate outside of code
- Code Search Find more, search less
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Description
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.