Collisions are still broke

This commit is contained in:
Zoe Roux
2021-06-07 11:37:16 +02:00
parent e624a2f7fe
commit f47dd669f1
3 changed files with 8 additions and 2 deletions

View File

@@ -19,7 +19,7 @@ namespace BBM
auto &pos = entity.getComponent<PositionComponent>();
const auto &wallPos = wall.getComponent<PositionComponent>();
auto diff = pos.position + mov->getVelocity() - wallPos.position;
std::cout << diff << std::endl;
// mov->_velocity = Vector3f();
if (diff.x <= 0 && mov->_velocity.x < 0)
mov->_velocity.x = 0;
if (diff.x >= 0 && mov->_velocity.x > 0)