Math: Add M_SQRT3 constant, fix sphere radius calculations

Former-commit-id: 71ac4d3522f427fda60a0e71d76eca7558539187
This commit is contained in:
Lynix
2015-05-26 23:39:01 +02:00
parent b0f418c481
commit 2bba1be938
3 changed files with 6 additions and 2 deletions

View File

@@ -194,7 +194,7 @@ void NzLight::MakeBoundingVolume() const
case nzLightType_Point:
{
NzVector3f radius(m_radius); ///FIXME: Incorrect
NzVector3f radius(m_radius * M_SQRT3);
m_boundingVolume.Set(-radius, radius);
break;
}

View File

@@ -400,7 +400,7 @@ m_radius(radius)
NzBoxf NzSphereGeom::ComputeAABB(const NzMatrix4f& offsetMatrix, const NzVector3f& scale) const
{
NzVector3f size(m_radius * scale);
NzVector3f size(m_radius * M_SQRT3 * scale);
NzVector3f position(offsetMatrix.GetTranslation());
return NzBoxf(position - size, position + size);