first commit
This commit is contained in:
24
src/engine/rectangle.c
Normal file
24
src/engine/rectangle.c
Normal file
@ -0,0 +1,24 @@
|
||||
#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);
|
||||
}
|
Reference in New Issue
Block a user