Explosion effects should get a proper sized AABB.

This commit is contained in:
William Moberg
2016-02-10 15:00:13 +01:00
parent 86f4ff0b3c
commit f3a76eb13e
3 changed files with 34 additions and 9 deletions
@@ -7,15 +7,13 @@ void FillFrustumOctreeSystem::Update(double dt)
void FillFrustumOctreeSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& component, double dt)
{
boost::optional<EntityAABB> absoluteAABB;
if (entity.HasComponent("ExplosionEffect")) {
//TODO: Fix hack, get real box by using shader equation.
EntityAABB aabb = AABB(glm::vec3(-300), glm::vec3(300));
aabb.Entity = entity;
m_Octree->AddDynamicObject(aabb);
absoluteAABB = Collision::AbsoluteAABBExplosionEffect(entity);
} else {
boost::optional<EntityAABB> absoluteAABB = Collision::EntityAbsoluteAABB(entity);
if (absoluteAABB) {
m_Octree->AddDynamicObject(*absoluteAABB);
}
absoluteAABB = Collision::EntityAbsoluteAABB(entity);
}
}
if (absoluteAABB) {
m_Octree->AddDynamicObject(*absoluteAABB);
}
}