_vertices is public in Box2D.XNA.PolygonShape


Normally this wouldn't matter, but when upgrading from older versions of box2d it can cause problems, as normals will not be set this way. The old method was to set verts manually, and then call SetMassFromShapes, which did what it needed to do to initialize shapes. I converted trying to keep the code as similar as possible for the first pass, and it seemed to work, however collision responses were way off, and there were 'quirks'. It was a pretty hard bug to find as it seemed to be deeper in the collision area, or maybe the scale of things like restitution was having different effects, etc.
I guess the solution would be to make _vertices protected, or wrap it in a setter that also calculated normals. Or maybe even just a big comment above it : ).
Awesome work on this, really liking the speed and completeness : ).
Closed Mar 31, 2010 at 8:52 AM by nfurtwangler
_vertices is also public in the latest C++ version of Box2D which we are modeling our C# code after. We want to stay as close to the C++ version as possible.