Create complex non-convex bodies

1243
Vote up!

This is a port to LUA and Corona SDK of the Convex Separator for Box2D class written by Antoon Angelov.
It converts complex, non-convex shapes into fully supported multi-bodies.
It works with the current physics.addBody functions. Parameters can be passed, together with the shape, to define bounce, friction and density, as well as body type. Any kind of display object can be passed to it as well.
It also should be compatible with any Corona build.

How to use it:

local bodySeparator = require "bodySeparator"
local shape = {0, 0, 200, -6, 253, 85, -12, 92, 36, 33};
local polygon = display.newPolygon(240, 160, shape);

ragdogLib.addNonConvexBody(polygon, {density = 1, friction = 1, bounce = 1, bodyType = "static", shape = shape})

Works with Corona build #: 
2013.2100
Category: 
Contributor: 
Ragdog Studios SRL