Really fixed AABBs

Former-commit-id: 003979537f2ea5362849df8a65611739aea6d298
This commit is contained in:
Lynix 2013-06-09 22:03:42 +02:00
parent a3f8d058ec
commit ca5fb44ecf
2 changed files with 3 additions and 2 deletions

View File

@ -10,7 +10,7 @@ NzBoxf NzComputeVerticesAABB(const T* vertices, unsigned int vertexCount)
NzBoxf aabb;
if (vertexCount > 0)
{
aabb.Set(vertices->position);
aabb.Set(vertices->position.x, vertices->position.y, vertices->position.z, 0.f, 0.f, 0.f);
vertices++;
for (unsigned int i = 1; i < vertexCount; ++i)

View File

@ -68,7 +68,8 @@ const NzBoxf& NzSkeleton::GetAABB() const
unsigned int jointCount = m_impl->joints.size();
if (jointCount > 0)
{
m_impl->aabb.Set(m_impl->joints[0].GetPosition());
NzVector3f pos = m_impl->joints[0].GetPosition();
m_impl->aabb.Set(pos.x, pos.y, pos.z, 0.f, 0.f, 0.f);
for (unsigned int i = 1; i < jointCount; ++i)
m_impl->aabb.ExtendTo(m_impl->joints[i].GetPosition());
}