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

using compound polygons in 3.0

Topics: User Forum
Nov 7, 2010 at 4:06 AM

Hi everyone.  After I create a compound polygon (by decomposing a concave polygon from a texture), I have it stored as a list of fixtures,  So, does Farseer see the fixtures in this list as if they are one solid polygon?  How should I be setting properties such as restitution, density, etc...?  Do I need to set these properties on each individual fixture in the list, or is it sufficient just to set them on the first fixture in the list.  If I set properties on the first fixture, will all the fixtures that make up the complex polygon act the same way?


Also, what are the default properties for newly created fixtures?  Or should I not rely on defaults, and always explicitly set all properties on each fixture I create?

Nov 7, 2010 at 10:07 AM

You need to set the properties for each fixture, as they all react differently. As for the default properties, I think they all = 0, although I'm not 100% sure.

Nov 9, 2010 at 2:19 AM

Ok, I've done some digging.  Its seems that when you create a compound polygon, you end up with multiple fixtures attached to a single body.  You don't need to set density for each fixture-- whatever density value you passed in gets applied to every fixture, and the mass of the body is updated accordingly.  But each fixture's restitution and friction are just set to the default value.  The default value for friction seems to be 0.2, while the default value for restitution is 0.