Home > other >  Using PE create Sprite irregular rigid body, and then added to the resource complains, for Daniel to
Using PE create Sprite irregular rigid body, and then added to the resource complains, for Daniel to

Time:09-25

If (FileUtils: : getInstance () - & gt; IsFileExist (temp))
{
Auto sp=(Sprite *) (node - & gt; GetChildByTag (I));
Auto body=PhysicsBody: : create ();
Auto polygons=Array (*) (the Dictionary: : createWithContentsOfFile (temp) - & gt; ObjectForKey (" polygons "));
for (int j=0; J & lt; Polygons - & gt; The count (); J++)
{
Auto polygon=Array (*) polygons - & gt; ObjectAtIndex (j);
STD: : vector Points;
For (int k=0; K{
The log (" KKKKKKKKKKKKKKKKKKKKKKKKK=% d ", polygon - & gt; The count ());
Auto STR=(String *) polygon - & gt; ObjectAtIndex (k);
Auto point=PointFromString (STR - & gt; GetCString ());
Points. The push_back (point);

}
Auto data=(https://bbs.csdn.net/topics/points.data);
Point * p=new Point [polygon - & gt; the count ()];
The log (" -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - % d ", p);
Memcpy (p, data, polygon - & gt; The count () * sizeof (Point));
body - & gt; AddShape (PhysicsShapePolygon: : create (p, polygon - & gt; The count ()));
The log ("======================================");


//the scarlet letter there will collapse error r6010 - abort () has had called

}
  • Related