This project has moved. For the latest updates, please go here.

Fixture to vertices?

Jan 12, 2011 at 8: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 10: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 12, 2011 at 11:26 PM

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().