Models/Collideables/etc. won't need a AABB component anymore, if it has a Model component. In addition, they should take rotation into account, i.e it doesn't have to be axis-aligned.

This commit is contained in:
William Moberg
2016-02-09 19:20:04 +01:00
parent eec59a40c8
commit 7140b740b5
6 changed files with 51 additions and 47 deletions
-5
View File
@@ -5,11 +5,6 @@
void TriggerSystem::UpdateComponent(EntityWrapper& triggerEntity, ComponentWrapper& cTrigger, double dt)
{
// The trigger *should* have a bounding box, or something, to test against so it can be triggered.
// If it doesn't, add one as big as the model for now, then size can be modified in editor if necessary.
if (!triggerEntity.HasComponent("AABB")) {
Collision::AttachAABBComponentFromModel(triggerEntity);
}
boost::optional<EntityAABB> triggerBox = Collision::EntityAbsoluteAABB(triggerEntity);
if (!triggerBox) {
return;