Bugfix
This commit is contained in:
@@ -86,6 +86,16 @@ namespace OpenVulkano::Math
|
||||
return Range<T>::min + (GetDiagonal() * 0.5f);
|
||||
}
|
||||
|
||||
[[nodiscard]] bool Covers(const AABB_T& other) const
|
||||
{
|
||||
return other.IsCovered(*this);
|
||||
}
|
||||
|
||||
[[nodiscard]] bool IsCovered(const AABB_T& other) const
|
||||
{
|
||||
return Math::Utils::all(Math::Utils::greaterThanEqual(other.GetMax(), Range<T>::max)) && Math::Utils::all(Math::Utils::greaterThanEqual(Range<T>::min, other.GetMin()));
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Checks if the AABB overlaps with another AABB
|
||||
* \param other The other AABB that should be checked
|
||||
@@ -93,9 +103,7 @@ namespace OpenVulkano::Math
|
||||
*/
|
||||
[[nodiscard]] bool IsOverlapping(const AABB_T& other) const
|
||||
{
|
||||
//return !(other.min.x > max.x || other.max.x < min.x || other.min.y > max.y ||
|
||||
// other.max.y < min.y || other.min.z > max.z || other.max.z < min.z);
|
||||
return Math::Utils::any(Math::Utils::greaterThan(Range<T>::min, other.GetMin())) || Math::Utils::any(Math::Utils::lessThan(other.GetMax(), Range<T>::max));
|
||||
return Math::Utils::all(Math::Utils::lessThanEqual(Range<T>::min, other.GetMax())) && Math::Utils::all(Math::Utils::greaterThanEqual(Range<T>::max, other.GetMin()));
|
||||
}
|
||||
|
||||
[[nodiscard]] bool InBounds(const T& position) const
|
||||
|
||||
Reference in New Issue
Block a user