Made TriggerSystem make use of Octree

This commit is contained in:
2016-01-27 13:35:16 +01:00
parent 8bed5194d8
commit 5fcd26cd3e
20 changed files with 145 additions and 130 deletions
+6 -2
View File
@@ -283,7 +283,7 @@ bool attachAABBComponentFromModel(World* world, EntityID id)
return true;
}
boost::optional<AABB> EntityAbsoluteAABB(EntityWrapper& entity)
boost::optional<EntityAABB> EntityAbsoluteAABB(EntityWrapper& entity)
{
if (!entity.HasComponent("AABB")) {
return boost::none;
@@ -294,7 +294,11 @@ boost::optional<AABB> EntityAbsoluteAABB(EntityWrapper& entity)
glm::vec3 absScale = Transform::AbsoluteScale(entity.World, entity.ID);
glm::vec3 origin = absPosition + (glm::vec3)cAABB["Origin"];
glm::vec3 size = (glm::vec3)cAABB["Size"] * absScale;
return AABB::FromOriginSize(origin, size);
EntityAABB aabb = EntityAABB::FromOriginSize(origin, size);
aabb.Entity = entity;
return aabb;
}
}