mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-06-26 19:34:47 +00:00
28 lines
538 B
C#
28 lines
538 B
C#
namespace SRF
|
|
{
|
|
using UnityEngine;
|
|
|
|
public static class SRFFloatExtensions
|
|
{
|
|
public static float Sqr(this float f)
|
|
{
|
|
return f*f;
|
|
}
|
|
|
|
public static float SqrRt(this float f)
|
|
{
|
|
return Mathf.Sqrt(f);
|
|
}
|
|
|
|
public static bool ApproxZero(this float f)
|
|
{
|
|
return Mathf.Approximately(0, f);
|
|
}
|
|
|
|
public static bool Approx(this float f, float f2)
|
|
{
|
|
return Mathf.Approximately(f, f2);
|
|
}
|
|
}
|
|
}
|