AABB can also be created with center position and its size.

This commit is contained in:
William Moberg
2015-12-08 17:01:50 +01:00
parent b87e543420
commit 32d2aa6a93
2 changed files with 12 additions and 0 deletions
+8
View File
@@ -7,5 +7,13 @@ AABB::AABB(const glm::vec3& minPos, const glm::vec3& maxPos)
, m_HalfSize(0.5f * (maxPos - minPos))
{}
void AABB::CreateFromCenter(const glm::vec3& center, const glm::vec3& size)
{
m_Center = center;
m_HalfSize = 0.5f * size;
m_MinCorner = m_Center - m_HalfSize;
m_MaxCorner = m_Center + m_HalfSize;
}
AABB::~AABB()
{}