Add Mathf.Frac

This commit is contained in:
Wojtek Figat
2021-11-07 21:39:09 +01:00
parent 7955a6bc35
commit 24e5d4635d

View File

@@ -539,6 +539,16 @@ namespace FlaxEngine
return (float)Math.Sin(f);
}
/// <summary>
/// Returns signed fractional part of a float.
/// </summary>
/// <param name="value">Floating point value to convert.</param>
/// <returns>A float between [0 ; 1) for nonnegative input. A float between [-1; 0) for negative input.</returns>
public static float Frac(float value)
{
return value - (int)value;
}
/// <summary>
/// Gradually changes a value towards a desired goal over time with smoothing.
/// </summary>