I have one triangle ad one circle moving objects on plane.How will i know both of them are collide to each other. ?
Case 1: The side of the rectangle touches or intersects the circle. In order to check whether the shapes intersect, we need to find a point on or inside the rectangle that is closest to the center of the circle. If this point lies on or inside the circle, it is guaranteed that both the shapes intersect.
If both the horizontal and vertical edges overlap we have a collision. We check if the right side of the first object is greater than the left side of the second object and if the second object's right side is greater than the first object's left side; similarly for the vertical axis.
Collision Physics in Video Games In the context of rigid body simulations, a collision happens when the shapes of two rigid bodies are intersecting, or when the distance between these shapes falls below a small tolerance.
Circle - triangle interesction test is what you want
http://www.phatcode.net/articles.php?id=459
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With