7 rect->
x = (bounds->
x + (bounds->
w / 2)) - (rect->
w / 2);
8 rect->
y = (bounds->
y + (bounds->
h / 2)) - (rect->
h / 2);
12 rect->
x = (bounds->
x + (bounds->
w / 2.0f)) - (rect->
w / 2.0f);
13 rect->
y = (bounds->
y + (bounds->
h / 2.0f)) - (rect->
h / 2.0f);
27 .x = (int32_t)rect->
x,
28 .y = (int32_t)rect->
y,
29 .w = (int32_t)rect->
w,
30 .h = (int32_t)rect->
h,
35 if(rect1->
x <= rect2->
x + rect2->
w && rect1->
x + rect1->
w >= rect2->
x &&
36 rect1->
y <= rect2->
y + rect2->
h && rect1->
y + rect1->
h >= rect2->
y){
43 if(rect1->
x <= rect2->
x + rect2->
w && rect1->
x + rect1->
w >= rect2->
x &&
44 rect1->
y <= rect2->
y + rect2->
h && rect1->
y + rect1->
h >= rect2->
y){
51 if(rect->
x <= point->
x && rect->
x + rect->
w >= point->
x &&
52 rect->
y <= point->
y && rect->
y + rect->
h >= point->
y){
59 if(rect->
x <= point->
x && rect->
x + rect->
w >= point->
x &&
60 rect->
y <= point->
y && rect->
y + rect->
h >= point->
y){
76 .x = rect->
x + velocity->
x,
77 .y = rect->
y + velocity->
y,
87 nextRectPosition.
x = rect->
x + velocity->
x;
88 nextRectPosition.
y = rect->
y;
93 nextRectPosition.
x = rect->
x;
94 nextRectPosition.
y = rect->
y + velocity->
y;
int32_t ARC_Rect_Intersects(ARC_Rect *rect1, ARC_Rect *rect2)
checks if two ARC_Rects intersect
ARC_Rect ARC_FRect_CastToRect(ARC_FRect *rect)
casts FRect to Rect
void ARC_FRect_CollideAndSlide(ARC_FRect *rect, ARC_Vector2 *velocity, ARC_FRect *wall)
checks for a ARC_Rect on ARC_Rect collision and slides on collision
ARC_FRect ARC_Rect_CastToFRect(ARC_Rect *rect)
casts Rect to FRect
void ARC_Rect_CenterOn(ARC_Rect *rect, ARC_Rect *bounds)
centers rect on given bounds
int32_t ARC_FRect_IntersectsPoint(ARC_FRect *rect, ARC_Point *point)
checks if ARC_FRect intersects with point
int32_t ARC_FRect_Intersects(ARC_FRect *rect1, ARC_FRect *rect2)
checks if two ARC_FRects intersect
int32_t ARC_Rect_IntersectsPoint(ARC_Rect *rect, ARC_Point *point)
checks if ARC_Rect intersects with point
void ARC_FRect_CenterOn(ARC_FRect *rect, ARC_FRect *bounds)
centers rect on given bounds
int32_t ARC_Rect_LineIntersects(ARC_Rect *rect, int32_t *x1, int32_t *y1, int32_t *x2, int32_t *y2)
checks if ARC_Rect intersects a line