bbminy in _collision_circle_aabb is now calculated correctly using y
parent
d134df5847
commit
bd87bcf8af
|
@ -110,7 +110,7 @@ static inline
|
||||||
short _collision_circle_aabb(const object_t* circle, const object_t* aabb) {
|
short _collision_circle_aabb(const object_t* circle, const object_t* aabb) {
|
||||||
// generate a point on the edge of the rectangle that is closest to the circle
|
// generate a point on the edge of the rectangle that is closest to the circle
|
||||||
const float bbminx = aabb->collider.aabb.x + aabb->sprite.x, bbmaxx = bbminx + aabb->collider.aabb.w,
|
const float bbminx = aabb->collider.aabb.x + aabb->sprite.x, bbmaxx = bbminx + aabb->collider.aabb.w,
|
||||||
bbminy = aabb->collider.aabb.y + aabb->sprite.x, bbmaxy = bbminy + aabb->collider.aabb.h;
|
bbminy = aabb->collider.aabb.y + aabb->sprite.y, bbmaxy = bbminy + aabb->collider.aabb.h;
|
||||||
const float cx = circle->sprite.x + circle->collider.circle.x,
|
const float cx = circle->sprite.x + circle->collider.circle.x,
|
||||||
cy = circle->sprite.y + circle->collider.circle.y;
|
cy = circle->sprite.y + circle->collider.circle.y;
|
||||||
const float x = fclampf(cx, bbminx, bbmaxx),
|
const float x = fclampf(cx, bbminx, bbmaxx),
|
||||||
|
|
Loading…
Reference in New Issue