point to rectangle distance

Posted by john smith on Game Development See other posts from Game Development or by john smith
Published on 2012-11-26T15:32:18Z Indexed on 2012/11/26 17:28 UTC
Read the original article Hit count: 250

Filed under:

I have a 2D rectangle with x, y position and it's height and width and a randomly positioned point nearby it.

Is there a way to check if this point might collide with the rectangle if closer than a certain distance? like imagine an invisible radius outside of that point colliding with said rectangle. I have problems with this simply because it is not a square, it would be so much easier this way! Any help?

Thanks in advance.

© Game Development or respective owner

Related posts about geometry