diff --git a/include/Nazara/Math/Box.hpp b/include/Nazara/Math/Box.hpp index 4c13744e4..5a991d89c 100644 --- a/include/Nazara/Math/Box.hpp +++ b/include/Nazara/Math/Box.hpp @@ -47,6 +47,7 @@ class NzBox NzVector3 GetPosition() const; NzVector3 GetPositiveVertex(const NzVector3& normal) const; T GetRadius() const; + NzSphere GetSquaredBoundingSphere() const; T GetSquaredRadius() const; bool Intersect(const NzBox& box, NzBox* intersection = nullptr) const; diff --git a/include/Nazara/Math/Box.inl b/include/Nazara/Math/Box.inl index b324304e2..24e776b70 100644 --- a/include/Nazara/Math/Box.inl +++ b/include/Nazara/Math/Box.inl @@ -227,6 +227,12 @@ T NzBox::GetRadius() const return std::sqrt(GetSquaredRadius()); } +template +NzSphere NzBox::GetSquaredBoundingSphere() const +{ + return NzSphere(GetCenter(), GetSquaredRadius()); +} + template T NzBox::GetSquaredRadius() const {