CollisionSystem loops over Collidable components.

This commit is contained in:
William Moberg
2016-01-18 13:29:10 +01:00
parent 942064c450
commit 0669d91767
2 changed files with 3 additions and 5 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ class CollisionSystem : public PureSystem
public:
CollisionSystem(EventBroker* eventBroker, Octree* octree)
: System(eventBroker)
, PureSystem("AABB")
, PureSystem("Collidable")
, m_Octree(octree)
, zPress(false)
{
+2 -4
View File
@@ -30,10 +30,8 @@ void CollisionSystem::UpdateComponent(World* world, EntityWrapper& entity, Compo
continue;
}
if (Collision::AABBVsAABB(boxA, boxB, resolutionVector)) {
if (entity.HasComponent("Physics")) {
(glm::vec3&)cTransform["Position"] += resolutionVector;
cPhysics["Velocity"] = glm::vec3(0, 0, 0);
}
(glm::vec3&)cTransform["Position"] += resolutionVector;
cPhysics["Velocity"] = glm::vec3(0, 0, 0);
}
}