diff --git a/Source/Engine/Core/Math/Math.h b/Source/Engine/Core/Math/Math.h index 40a1fa835..46e85247f 100644 --- a/Source/Engine/Core/Math/Math.h +++ b/Source/Engine/Core/Math/Math.h @@ -435,6 +435,14 @@ namespace Math return amount <= 0 ? 0 : amount >= 1 ? 1 : amount * amount * amount * (amount * (amount * 6 - 15) + 10); } + // Determines whether the specified value is close to zero (0.0) + // @param a The integer value + // @returns True if the specified value is close to zero (0.0). otherwise false + inline int32 IsZero(int32 a) + { + return a == 0; + } + // Determines whether the specified value is close to zero (0.0f) // @param a The floating value // @returns True if the specified value is close to zero (0.0f). otherwise false @@ -443,6 +451,14 @@ namespace Math return Abs(a) < ZeroTolerance; } + // Determines whether the specified value is close to one (1.0) + // @param a The integer value + // @returns True if the specified value is close to one (1.0). otherwise false + inline bool IsOne(int32 a) + { + return a == 1; + } + // Determines whether the specified value is close to one (1.0f) // @param a The floating value // @returns True if the specified value is close to one (1.0f). otherwise false