Hello
I have trouble with machine-generated shapes. When triangulating complex polygon, resulting triangles are sometimes very small or narrow. In such a case b2Body->CreateShape() dies miserably stumbling on one of the asserts. I've tried to find some simple rule of thumb for accepting/rejecting triangles, but found none.
I know that triangulation is planned for one of future versions, but maybe simple Validate() function in polygon def could be added, so I can check if generated triangle is edible by Box2D. Or, maybe there is some simple rule that let me validate shape my self.
Associated question: most annoying assert, the 'b2Assert(s < -b2_linearSlop);' in b2PolygonShape::b2PolygonShape(const b2ShapeDef* def) is inside _DEBUG section. Is it safe to disable this section?
I have trouble with machine-generated shapes. When triangulating complex polygon, resulting triangles are sometimes very small or narrow. In such a case b2Body->CreateShape() dies miserably stumbling on one of the asserts. I've tried to find some simple rule of thumb for accepting/rejecting triangles, but found none.
I know that triangulation is planned for one of future versions, but maybe simple Validate() function in polygon def could be added, so I can check if generated triangle is edible by Box2D. Or, maybe there is some simple rule that let me validate shape my self.
Associated question: most annoying assert, the 'b2Assert(s < -b2_linearSlop);' in b2PolygonShape::b2PolygonShape(const b2ShapeDef* def) is inside _DEBUG section. Is it safe to disable this section?