Page 1 of 1

How to get body from space.

Posted: Thu Jan 01, 2015 6:24 am
by midhunadarvin
Is there any way i can get the reference to the bodies within the space using any function?

Re: How to get body from space.

Posted: Fri Jan 02, 2015 2:51 am
by LegoCylon
If you want to walk through all bodies in a space, you can use cpSpaceEachBody.

If you want to find bodies that are near an area or that intersect a line segment, use one of the Query functions.

That will give you access to the shapes, and from the shapes you can get access to their body using cpShapeGetBody.