From efd6185f562e1775713f09d236fe1913ff5e3026 Mon Sep 17 00:00:00 2001 From: Lynix Date: Wed, 31 Jul 2013 14:18:47 +0200 Subject: [PATCH] Added Box::GetSquaredBoundingSphere Former-commit-id: 12ecb5d84f44e39ddacb96b83a897f618337c2e1 --- include/Nazara/Math/Box.hpp | 1 + include/Nazara/Math/Box.inl | 6 ++++++ 2 files changed, 7 insertions(+) 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 {