Implémentation de Block::getCollisionInfo(Ball)

This commit is contained in:
Mattéo Delabre 2016-03-18 18:26:49 +01:00
parent db18959575
commit 939fa0dedf
1 changed files with 5 additions and 2 deletions

View File

@ -46,8 +46,11 @@ bool Block::getCollisionInfo(Object& obj, sf::Vector2f& normal, float& depth) {
} }
bool Block::getCollisionInfo(Ball& obj, sf::Vector2f& normal, float& depth) { bool Block::getCollisionInfo(Ball& obj, sf::Vector2f& normal, float& depth) {
// TODO: coder cette fonction // la collision Block -> Ball est la collision Ball -> Block
return false; // avec une normale de collision retournée
bool result = obj.getCollisionInfo(*this, normal, depth);
normal *= -1.f;
return result;
} }
bool Block::getCollisionInfo(Block& obj, sf::Vector2f& normal, float& depth) { bool Block::getCollisionInfo(Block& obj, sf::Vector2f& normal, float& depth) {