Page 1 of 1

Calculate distance between two bodies

Posted: Sat Jul 28, 2012 8:53 pm
by FelipeTavares
Is there any way to fast calculate the distance between the centre of two bodies ? If yes, how can I do this?

Re: Calculate distance between two bodies

Posted: Sat Jul 28, 2012 10:29 pm
by slembcke
You can get the center of a body using cpBodyGetPosition(), and calculate the distance between two points using cpvdist().

Re: Calculate distance between two bodies

Posted: Sun Jul 29, 2012 9:19 am
by FelipeTavares
Thanks!