Math/VectorI: Add Apply static method

This commit is contained in:
SirLynix
2023-09-09 20:54:39 +02:00
committed by Jérôme Leclercq
parent addbb98671
commit c826b537ab
6 changed files with 21 additions and 0 deletions

View File

@@ -644,6 +644,12 @@ namespace Nz
return w >= vec.w;
}
template<typename T>
constexpr Vector4<T> Vector4<T>::Apply(T(*func)(T), const Vector4& vec)
{
return Vector4(func(vec.x), func(vec.y), func(vec.z), func(vec.w));
}
template<typename T>
constexpr bool Vector4<T>::ApproxEqual(const Vector4& lhs, const Vector4& rhs, T maxDifference)
{