more cleanup

This commit is contained in:
Clément Le Bihan
2021-06-08 00:55:32 +02:00
parent 3649c8247c
commit ca930db44d
2 changed files with 2 additions and 9 deletions

View File

@@ -15,17 +15,9 @@ namespace BBM
void MapGenerator::wallCollide(WAL::Entity &entity, const WAL::Entity &wall, int collidedAxis)
{
auto *mov = entity.tryGetComponent<MovableComponent>();
auto posspec = entity.getComponent<PositionComponent>();
auto posspecwall = wall.getComponent<PositionComponent>();
if (!mov)
return;
auto &pos = entity.getComponent<PositionComponent>();
const auto &wallPos = wall.getComponent<PositionComponent>();
auto diff = pos.position + mov->getVelocity() - wallPos.position;
//mov->_velocity = Vector3f();
//return;
if (collidedAxis & CollisionComponent::CollidedAxis::X)
mov->_velocity.x = 0;
if (collidedAxis & CollisionComponent::CollidedAxis::Y)