How to get body from space.

Official forum for the Chipmunk2D Physics Library.

How to get body from space.

Postby midhunadarvin » Thu Jan 01, 2015 6:24 am

Is there any way i can get the reference to the bodies within the space using any function?
Posts: 1
Joined: Thu Jan 01, 2015 6:12 am

Re: How to get body from space.

Postby LegoCylon » Fri Jan 02, 2015 2:51 am

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.
Posts: 29
Joined: Wed May 09, 2012 12:06 am

Return to Chipmunk2D Physics

Who is online

Users browsing this forum: No registered users and 4 guests