Box2D (Assertion fail with polygon meshes)
Posted: Sun Mar 04, 2012 12:37 am
When I try to create a triangle collider for my game it sometimes leads to an assertion fail. I use the physics engine that comes with love2d (Box2D). That's the error message that appears when the assertion fails:
Here's an example of a triangle that doesn't cause the error (represented by a table with 3 points): {{258,451},{740,767},{284,597}}
And this one leads to a crash: {{258,450},{222,569},{306,723}}
The bodies of both shapes lie at {0, 0} (upper-left corner of the screen)
Does anyone know a possible reason and/or solution for the problem?
Many thanks in advance!
Code: Select all
love: modules/physics/box2d/Source/Collision/Shapes/b2PolygonShape.cpp:85: b2Vec2 ComputeCentroid(const b2Vec2*, int32): Assertion `area > 1.19209289550781250000e-7F' failed.
And this one leads to a crash: {{258,450},{222,569},{306,723}}
The bodies of both shapes lie at {0, 0} (upper-left corner of the screen)
Does anyone know a possible reason and/or solution for the problem?
Many thanks in advance!