1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-11 13:10:58 +00:00

Float literals - fix math classes to allow 32 bit calculations

Converts float literals from double format (e.g. 0.0) to float format (e.g. 0.0f) where appropriate for 32 bit calculations, and cast to (real_t) or (float) as appropriate.

This ensures that appropriate calculations will be done at 32 bits when real_t is compiled as float, rather than promoted to 64 bits.
This commit is contained in:
lawnjelly
2022-02-24 08:41:35 +00:00
parent ae9fa90091
commit d24c715678
25 changed files with 264 additions and 264 deletions

View File

@@ -64,7 +64,7 @@ Quat TransformInterpolator::_basis_to_quat_unchecked(const Basis &p_basis) {
real_t trace = m.elements[0][0] + m.elements[1][1] + m.elements[2][2];
real_t temp[4];
if (trace > 0.0) {
if (trace > 0) {
real_t s = Math::sqrt(trace + 1.0f);
temp[3] = (s * 0.5f);
s = 0.5f / s;