Daniele Bartolini hace 10 años
padre
commit
cda0f18a61
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  1. 5 1
      src/core/math/math_utils.h

+ 5 - 1
src/core/math/math_utils.h

@@ -39,6 +39,11 @@ inline f32 fclamp(f32 min, f32 max, f32 val)
 	return fmin(fmax(min, val), max);
 }
 
+inline f32 ffract(f32 a)
+{
+	return a - floorf(a);
+}
+
 inline f32 to_rad(f32 deg)
 {
 	return deg * PI / 180.0f;
@@ -105,5 +110,4 @@ inline f32 catmull_rom(const f32 p0, const f32 p1, const f32 p2, const f32 p3, f
 }
 
 /// @}
-
 } // namespace crown