starting to look into collisions

This commit is contained in:
Clément Le Bihan
2021-06-07 18:01:19 +02:00
parent b4a3f3578d
commit b7d43fef6a
3 changed files with 18 additions and 16 deletions

View File

@@ -16,6 +16,8 @@ namespace BBM
auto *mov = entity.tryGetComponent<MovableComponent>();
if (!mov)
return;
mov->_velocity = BBM::Vector3f ();
return;
auto &pos = entity.getComponent<PositionComponent>();
const auto &wallPos = wall.getComponent<PositionComponent>();
auto diff = pos.position + mov->getVelocity() - wallPos.position;