Implemented inline bool hitbox_intersect

This commit is contained in:
CobaltXII
2019-01-01 12:10:06 -05:00
parent 52eb737329
commit a9f0a786ce

View File

@@ -30,3 +30,15 @@ struct hitbox
zr = _zr;
}
};
// Check if two hitboxes intersect.
inline bool hitbox_intersect(hitbox a, hitbox b)
{
return
(
(a.x <= b.x + b.xr && a.x + a.xr >= b.x) &&
(a.y <= b.y + b.yr && a.y + a.yr >= b.y) &&
(a.z <= b.z + b.zr && a.z + a.zr >= b.z)
);
}