- inline kexBBox::Center and kexBBox::Extents as they are also time critical

This commit is contained in:
Magnus Norddahl 2018-11-04 23:20:33 +01:00
parent be5b3a79db
commit d3d7174c77
2 changed files with 18 additions and 20 deletions

View file

@ -87,26 +87,6 @@ void kexBBox::AddPoint(const kexVec3 &vec)
max.Set(hix, hiy, hiz);
}
//
// kexBBox::Center
//
kexVec3 kexBBox::Center() const
{
return kexVec3(
(max.x + min.x) * 0.5f,
(max.y + min.y) * 0.5f,
(max.z + min.z) * 0.5f);
}
kexVec3 kexBBox::Extents() const
{
return kexVec3(
(max.x - min.x) * 0.5f,
(max.y - min.y) * 0.5f,
(max.z - min.z) * 0.5f);
}
//
// kexBBox::Radius
//

View file

@ -1519,3 +1519,21 @@ inline float &kexVec4::operator[](int index)
{
return (&x)[index];
}
/////////////////////////////////////////////////////////////////////////////
inline kexVec3 kexBBox::Center() const
{
return kexVec3(
(max.x + min.x) * 0.5f,
(max.y + min.y) * 0.5f,
(max.z + min.z) * 0.5f);
}
inline kexVec3 kexBBox::Extents() const
{
return kexVec3(
(max.x - min.x) * 0.5f,
(max.y - min.y) * 0.5f,
(max.z - min.z) * 0.5f);
}