Added Box::GetSquaredBoundingSphere

Former-commit-id: 12ecb5d84f44e39ddacb96b83a897f618337c2e1
This commit is contained in:
Lynix 2013-07-31 14:18:47 +02:00
parent 84ebd6043c
commit efd6185f56
2 changed files with 7 additions and 0 deletions

View File

@ -47,6 +47,7 @@ class NzBox
NzVector3<T> GetPosition() const;
NzVector3<T> GetPositiveVertex(const NzVector3<T>& normal) const;
T GetRadius() const;
NzSphere<T> GetSquaredBoundingSphere() const;
T GetSquaredRadius() const;
bool Intersect(const NzBox& box, NzBox* intersection = nullptr) const;

View File

@ -227,6 +227,12 @@ T NzBox<T>::GetRadius() const
return std::sqrt(GetSquaredRadius());
}
template<typename T>
NzSphere<T> NzBox<T>::GetSquaredBoundingSphere() const
{
return NzSphere<T>(GetCenter(), GetSquaredRadius());
}
template<typename T>
T NzBox<T>::GetSquaredRadius() const
{