From e83d472c002f5be617e87d37987f5bae4a355c07 Mon Sep 17 00:00:00 2001 From: Aaron Franke Date: Mon, 19 Sep 2022 18:15:04 -0500 Subject: Update Basis/Transform3D/Quaternion to match the engine --- include/godot_cpp/core/math.hpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'include/godot_cpp/core/math.hpp') diff --git a/include/godot_cpp/core/math.hpp b/include/godot_cpp/core/math.hpp index 6bc2344..78f90ca 100644 --- a/include/godot_cpp/core/math.hpp +++ b/include/godot_cpp/core/math.hpp @@ -537,6 +537,27 @@ inline bool is_zero_approx(double s) { return abs(s) < CMP_EPSILON; } +inline float absf(float g) { + union { + float f; + uint32_t i; + } u; + + u.f = g; + u.i &= 2147483647u; + return u.f; +} + +inline double absd(double g) { + union { + double d; + uint64_t i; + } u; + u.d = g; + u.i &= (uint64_t)9223372036854775807ull; + return u.d; +} + inline double smoothstep(double p_from, double p_to, double p_weight) { if (is_equal_approx(static_cast(p_from), static_cast(p_to))) { return p_from; -- cgit v1.2.3