mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 13:59:19 +02:00
is_equal more precise type and code cleanup
This commit is contained in:
@@ -243,18 +243,13 @@ template <typename T> inline void SafeDeleteArray(T *&Pointer)
|
|||||||
Pointer = nullptr;
|
Pointer = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Type_> Type_ is_equal(Type_ const &Left, Type_ const &Right, Type_ const Epsilon = 1e-5)
|
template <typename T> bool is_equal(T const &Left, T const &Right, T const Epsilon = T(1e-5))
|
||||||
{
|
|
||||||
|
|
||||||
if (Epsilon != 0)
|
|
||||||
{
|
{
|
||||||
|
if (Epsilon != T(0))
|
||||||
return glm::epsilonEqual(Left, Right, Epsilon);
|
return glm::epsilonEqual(Left, Right, Epsilon);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return (Left == Right);
|
return (Left == Right);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
template <typename Type_> Type_ clamp(Type_ const Value, Type_ const Min, Type_ const Max)
|
template <typename Type_> Type_ clamp(Type_ const Value, Type_ const Min, Type_ const Max)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user