FrustumOctree has its own system, won't cull away explosion effects.

This commit is contained in:
William Moberg
2016-02-10 10:53:25 +01:00
parent ecfacee587
commit d65ce805a5
4 changed files with 50 additions and 3 deletions
@@ -0,0 +1,21 @@
#include "Collision/FillFrustumOctreeSystem.h"
void FillFrustumOctreeSystem::Update(double dt)
{
m_Octree->ClearDynamicObjects();
}
void FillFrustumOctreeSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& component, double dt)
{
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);
} else {
boost::optional<EntityAABB> absoluteAABB = Collision::EntityAbsoluteAABB(entity);
if (absoluteAABB) {
m_Octree->AddDynamicObject(*absoluteAABB);
}
}
}