Jump to content

  • Log In with Google      Sign In   
  • Create Account

14 years ago on June 15th Gamedev.net was first launched! We want to thank all of you for being part of our community and hope the best years are ahead of us. Happy birthday Gamedev.net!

#ActualCosmic314

Posted 05 October 2012 - 01:31 PM

Use the radius of the circle and compare it to the distance the object is away from the center of the circle. You probably want to avoid using sqrt, so compare the distance squared to the radius squared. If the distance is <= radius then it is intersecting. To send it in exactly the opposite direction (as opposed to reflecting it) simply negate the entire direction vector.

#1Cosmic314

Posted 05 October 2012 - 01:23 PM

Use the radius of the circle and compare it to the distance the object is away from the circle. You probably want to avoid using sqrt, so compare the distance squared to the radius squared. If the distance is <= radius then it is intersecting. To send it in exactly the opposite direction (as opposed to reflecting it) simply negate the entire direction vector.

PARTNERS