Hi,
I'm trying to make a Rect (Non rotating) to Circle collision function but I'm having a bit of difficulty getting it to work properly.
I've got a Circle 2 Circle, Rect to Rect and Point to Circle working ok, but I just can't seem to figure out a good way of doing Rect to circle.
At the moment I have a function that checks all 4 four corners of the square and checks Point To Circle style with this against all 4 corners.
But this doesn't work properly at all with lengthy rectangles and small circles or very large circles and small rects.
Basically what I'm trying to achieve is something like this:-
Anyone want to help and put me out of my misery? ;)
I'm trying to make a Rect (Non rotating) to Circle collision function but I'm having a bit of difficulty getting it to work properly.
I've got a Circle 2 Circle, Rect to Rect and Point to Circle working ok, but I just can't seem to figure out a good way of doing Rect to circle.
At the moment I have a function that checks all 4 four corners of the square and checks Point To Circle style with this against all 4 corners.
But this doesn't work properly at all with lengthy rectangles and small circles or very large circles and small rects.
Basically what I'm trying to achieve is something like this:-
Circle2Rect(C_X, C_Y, C_RADIUS, R_X, R_Y, R_WIDTH, R_HEIGHT)
Anyone want to help and put me out of my misery? ;)