Files
frillrun/src/engine/rectangle.c
2024-08-24 00:47:58 -04:00

25 lines
431 B
C

#include "rectangle.h"
bool
rectangle_collide_intersection(Rectangle* a, Rectangle* b, Rectangle* intersection)
{
return SDL_IntersectFRect(a, b, intersection);
}
bool
rectangle_collide(Rectangle* a, Rectangle* b)
{
return SDL_HasIntersectionF(a, b);
}
bool
rectangle_has_point(Rectangle* self, vec2 point)
{
SDL_FPoint sdlPoint;
sdlPoint.x = point[0];
sdlPoint.y = point[1];
return SDL_PointInFRect(&sdlPoint, self);
}