Merge pull request 'Add stretch function to AABB' (#195) from misc2 into master

Reviewed-on: https://git.madvoxel.net/OpenVulkano/OpenVulkano/pulls/195
Reviewed-by: Georg Hagen <georg.hagen@madvoxel.com>
This commit is contained in:
Oleksii_Hyzha
2025-01-28 17:11:26 +01:00

View File

@@ -59,6 +59,16 @@ namespace OpenVulkano::Math
Range<T>::max = other.GetMax(); Range<T>::max = other.GetMax();
} }
void Stretch(T::value_type scalar)
{
if (IsEmpty()) [[unlikely]]
{
return;
}
Range<T>::min -= scalar;
Range<T>::max += scalar;
}
void Grow(const T& point) void Grow(const T& point)
{ {
Range<T>::min = Math::Utils::min(Range<T>::min, point); Range<T>::min = Math::Utils::min(Range<T>::min, point);