Calculate distance between two bodies
-
- Posts: 2
- Joined: Sat Jul 28, 2012 8:32 pm
- Location: On the front of a PC
- Contact:
Calculate distance between two bodies
Is there any way to fast calculate the distance between the centre of two bodies ? If yes, how can I do this?
- slembcke
- Site Admin
- Posts: 4166
- Joined: Tue Aug 14, 2007 7:13 pm
- Contact:
Re: Calculate distance between two bodies
You can get the center of a body using cpBodyGetPosition(), and calculate the distance between two points using cpvdist().
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
-
- Posts: 2
- Joined: Sat Jul 28, 2012 8:32 pm
- Location: On the front of a PC
- Contact:
Who is online
Users browsing this forum: No registered users and 6 guests