This project has moved and is read-only. For the latest updates, please go here.

Fixture to vertices?

Jan 12, 2011 at 9:47 PM


Is there any way to easily convert a fixture to Vertices so you can use it for example for YuPengClipper.Difference(..) ?
I have been searching the forums and google but I wasn't able to find anything x.x

Have a nice evening =)

Jan 12, 2011 at 11:40 PM

No not as far as I am aware. You have to store the vertices somewhere else on fixture creation e.g. in Fixure.UserData.

Jan 13, 2011 at 12:26 AM

A fixture contains a body and a shape. The shape is what defines the outline of your body, and if it is a polygon, you can cast the shape to a PolygonShape and use the Vertices field. However, if the shape is a circle, then you can't get a vertices collection unless you gather the radius of the circle and approximate it using PolygonTools.CreateCircle().