Implémentation de Block::getCollisionInfo(Ball)
This commit is contained in:
parent
db18959575
commit
939fa0dedf
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue