Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
#include "Collision.h"
#include "Collider.h"
bool Coliziune::AB(const SDL_Rect& rectA, SDL_Rect& rectB)
{
if (
rectA.x + rectA.w >= rectB.x &&
rectB.x + rectB.w >= rectA.x &&
rectA.y + rectA.h >= rectB.y &&
rectB.y + rectB.h >= rectA.y
)
{
return true;
}
return false;
}
bool Coliziune::AB(const ColiziuneComp& coliA, const ColiziuneComp& coliB)
{
if (AB(coliA.collider, coliB.collider))
{
std::cout << coliA.tag << " hit: " << coliB.tag << std::endl;
return true;
}
else
{
return false;
}
}