Fixture to vertices?

Jan 12, 2011 at 8:47 PM

Hi!

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 =)

Developer
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.

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