/** SGX

The   sss    gggg x   x   
     s      g      x x    Engine
      sss   g  gg   x
         s  g   g  x x          Copyright 1995-2008.
     ssss    gggg x   x         Steven Goodwin. All Rights Reserved.
    
This version has been released under the GNU Public License v2.0.

Please see the license files for details.

File: src/domains/graphics/primitives/cuboid.cpp

*/

#include "sgx/core/core.hpp"
#include "domains/graphics/graphics.hpp"

void	sgxPrimitiveCuboid::getBoundingSphere(sgxVector3 &pos, tREAL32 &radius)  const {
	
	pos = sgxLerp(m_vMinpos, m_vMaxpos, 0.5f);
	
	radius = m_vMinpos.getDistance(pos);
	radius = sgxMax(radius, m_vMaxpos.getDistance(pos));
}

void	sgxPrimitiveCuboid::getBoundingBox(sgxVector3 &minpos, sgxVector3 &maxpos) const {
	minpos = m_vMinpos;
	maxpos = m_vMaxpos;
}

