CollisionSystem loops over Collidable components.
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user