c++ Error

I got an error when im using this ? why?


this error :
Quote:
Asserion failed: s > 0.0f && "ERROR: Please ensure your polygon is conex and h
gonShape.cpp


Code:
   b2PolygonShape dynamicBox;
   int num = 4;

   b2Vec2 vertices[] = {b2Vec2(1.500,2.500),
                        b2Vec2(3.500,3.500),
                        b2Vec2(5.500,12.500),
                        b2Vec2(1.500,4.500),
                        b2Vec2(-1.500,2.500),
                        b2Vec2(-1.500,4.500),
                        b2Vec2(-3.500,3.500),
                        b2Vec2(-21.500,0.500),
                        b2Vec2(-13.500,0.500),
                        b2Vec2(5.500,12.500),
                        b2Vec2(-13.500,12.500),
                        b2Vec2(-21.500,4.500),
                        b2Vec2(21.500,0.500),
                        b2Vec2(21.500,4.500),
                        b2Vec2(13.500,12.500),
                        b2Vec2(5.500,12.500),
                        b2Vec2(12.500,0.500),
                        b2Vec2(-13.500,16.500),
                        b2Vec2(-13.500,12.500),
                        b2Vec2(-5.500,12.500),
                        b2Vec2(-5.500,16.500),
                        b2Vec2(5.500,16.500),
                        b2Vec2(5.500,12.500),
                        b2Vec2(13.500,12.500),
                        b2Vec2(13.500,16.500),
                        b2Vec2(13.500,-3.500),
                        b2Vec2(15.500,-3.500),
                        b2Vec2(17.500,-1.500),
                        b2Vec2(17.500,0.500),
                        b2Vec2(13.500,0.500),
                        b2Vec2(-17.500,11.500),
                        b2Vec2(-16.400,10.650),
                        b2Vec2(-13.500,12.500),
                        b2Vec2(-17.500,12.500),
                        b2Vec2(-5.500,-16.500),
                        b2Vec2(-3.500,-15.500),
                        b2Vec2(-3.500,3.500),
                        b2Vec2(-9.500,-3.500),
                        b2Vec2(-9.500,-12.500),
                        b2Vec2(-11.500,-3.500),
                        b2Vec2(-9.500,-3.500),
                        b2Vec2(-3.500,3.500),
                        b2Vec2(-12.500,0.500),
                        b2Vec2(-12.500,-2.500),
                        b2Vec2(-14.500,-3.500),
                        b2Vec2(-13.500,-2.500),
                        b2Vec2(-13.500,0.500),
                        b2Vec2(-17.500,0.500),
                        b2Vec2(-17.500,-1.500),
                        b2Vec2(-15.500,-3.500),
                        b2Vec2(17.500,11.500),
                        b2Vec2(17.500,12.500),
                        b2Vec2(13.500,12.500),
                        b2Vec2(16.500,10.500),
                        b2Vec2(11.500,-3.500),
                        b2Vec2(12.500,-2.500),
                        b2Vec2(12.500,0.500),
                        b2Vec2(5.500,12.500),
                        b2Vec2(3.500,3.500),
                        b2Vec2(9.500,-3.500),
                        b2Vec2(5.500,-16.500),
                        b2Vec2(9.500,-12.500),
                        b2Vec2(9.500,-3.500),
                        b2Vec2(3.500,3.500),
                        b2Vec2(3.500,-15.500),
                        b2Vec2(-16.400,10.650),
                        b2Vec2(-16.500,9.500),
                        b2Vec2(-13.500,12.500),
                        b2Vec2(16.500,10.500),
                        b2Vec2(13.500,12.500),
                        b2Vec2(16.500,9.500),
                        b2Vec2(1.500,4.500),
                        b2Vec2(5.500,12.500),
                        b2Vec2(-1.500,4.500),
                        b2Vec2(5.500,12.500),
                        b2Vec2(-13.500,0.500),
                        b2Vec2(-12.500,0.500),
                        b2Vec2(-3.500,3.500),
                        b2Vec2(-1.500,4.500)};




   dynamicBox.Set(vertices,num);
So... is the polygon convex? Can we assume that you have altered the default settings to allow polygons of more than 8 sides?
The latest version of Box2D in svn will create a polygon from the convex hull of the supplied points so you don't see this problem, maybe you could try that.
Yes i have Set the Maximum to 1000 and recompiled it its an other Error
Hm, I'm not sure what the problem is. Have you tried just having four vertices in the array (not 79) to create the polygon? If you haven't tried it, try making an array of just 4 vertices and use that to create the polygon to see if it still spits out an error.

Original thread: https://box2d.org/forum/viewtopic.php?t=8185