From 939fa0dedf8f425a1e32ffb3d04ad61e1d9ac87b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matt=C3=A9o=20Delabre?= Date: Fri, 18 Mar 2016 18:26:49 +0100 Subject: [PATCH] =?UTF-8?q?Impl=C3=A9mentation=20de=20Block::getCollisionI?= =?UTF-8?q?nfo(Ball)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/block.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/block.cpp b/src/block.cpp index 7c43912..0c3aa44 100644 --- a/src/block.cpp +++ b/src/block.cpp @@ -46,8 +46,11 @@ bool Block::getCollisionInfo(Object& obj, sf::Vector2f& normal, float& depth) { } bool Block::getCollisionInfo(Ball& obj, sf::Vector2f& normal, float& depth) { - // TODO: coder cette fonction - return false; + // la collision Block -> Ball est la collision Ball -> Block + // 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) {