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
+3 -4
View File
@@ -2,14 +2,13 @@
#include "Collision/CollisionSystem.h"
#include "Core/AABB.h"
void CollisionSystem::UpdateComponent(World* world, ComponentWrapper& cAABB, double dt)
void CollisionSystem::UpdateComponent(World* world, EntityWrapper& entity, ComponentWrapper& component, double dt)
{
EntityID entity = cAABB.EntityID;
boost::optional<AABB> boundingBox = Collision::EntityAbsoluteAABB(world, entity);
boost::optional<AABB> boundingBox = Collision::EntityAbsoluteAABB(entity);
if (!boundingBox) {
return;
}
ComponentWrapper& cTransform = world->GetComponent(entity, "Transform");
ComponentWrapper& cTransform = entity["Transform"];
AABB& boxA = *boundingBox;
//Press 'Z' to enable/disable collision.