collisions are working ok with user defined offsets

This commit is contained in:
Clément Le Bihan
2021-06-07 23:37:51 +02:00
parent 8203532d52
commit 65af11f3f9
7 changed files with 85 additions and 31 deletions

View File

@@ -14,9 +14,14 @@ namespace BBM
void MapGenerator::wallCollide(WAL::Entity &entity, const WAL::Entity &wall)
{
auto *mov = entity.tryGetComponent<MovableComponent>();
auto posspec = entity.getComponent<PositionComponent>();
auto posspecwall = wall.getComponent<PositionComponent>();
if (!mov)
return;
mov->_velocity = BBM::Vector3f ();
std::cout << "collided coords " << posspec.position << " cube " << posspecwall.position << std::endl;
//mov->_velocity = BBM::Vector3f ();
return;
auto &pos = entity.getComponent<PositionComponent>();
const auto &wallPos = wall.getComponent<PositionComponent>();