EntityWrapper to uniquely identify entities and make using them a little easier

This commit is contained in:
2016-01-14 15:43:19 +01:00
parent 28392def79
commit d34470256b
20 changed files with 106 additions and 72 deletions
@@ -5,16 +5,14 @@ void CollidableOctreeSystem::Update(World* world, double dt)
m_Octree->ClearDynamicObjects();
}
void CollidableOctreeSystem::UpdateComponent(World* world, ComponentWrapper& cCollidable, double dt)
void CollidableOctreeSystem::UpdateComponent(World* world, EntityWrapper& entity, ComponentWrapper& component, double dt)
{
EntityID entity = cCollidable.EntityID;
if (world->HasComponent(entity, "AABB")) {
boost::optional<AABB> absoluteAABB = Collision::EntityAbsoluteAABB(world, entity);
if (entity.HasComponent("AABB")) {
boost::optional<AABB> absoluteAABB = Collision::EntityAbsoluteAABB(entity);
if (absoluteAABB) {
m_Octree->AddDynamicObject(*absoluteAABB);
}
} else if (world->HasComponent(entity, "Model")) {
} else if (entity.HasComponent("Model")) {
// TODO: Derive AABB from model
}
}