Are there details on preparing shape coordinates for physics bodies? Are the points based on a Centered reference point? Does it matter where the points start from? [import]uid: 4596 topic_id: 8464 reply_id: 308464[/import]
Physics Editor outputs multiple polygons. Is it possible to output one complex polygon?
shape = { -53,-122,-27,-116,4,-50,14,-48,10,-8,-22,16,34,4,122,-39,121,
-36,110,-30,111,-10,88,-6,32,32,33,47,9,49,8,50,13,77,29,79,31,142,7,155,
3,279,35, 313,33,321,-40,314,-105,319,-85,286,-89,148,-77,142,-75,133,
-75,132,-101,124,-55,12,-55,2,-113,-30,-114,-50,-118,-49,-113,-76,-121,
-72,-53,-122 } [import]uid: 4596 topic_id: 8464 reply_id: 30329[/import]
Even on simpler shapes, I’m getting behavior where other physics bodies stick to *parts* of the shape.
local shape = { -53,-227,-27,-221,4,-155,14,-153,10,-113,-22,-89,-53,-227 }
[import]uid: 4596 topic_id: 8464 reply_id: 30343[/import]
Found some helpful info here: http://developer.anscamobile.com/reference/index/physicsaddbody
I am using concave shapes, which are incompatible.
If a shape is specified, then the body boundaries will follow the polygon provided by the shape. Note that the maximum number of sides per shape is eight, and all angles must be convex. (Specifying a shape will override the radius property, if both radius and shape are specified in the same element.)
A body shape is simply a table of local (x,y) coordinates, relative to the center of the display object; see example below.
Finally, a more complex body may be constructed by specifying multiple body elements and shapes. In cases where the overall shape of the object is concave, or the shape has more than eight sides, you can use multiple body elements to construct it. [import]uid: 4596 topic_id: 8464 reply_id: 30344[/import]