-- This file is for use with Corona(R) SDK
--
-- This file is automatically generated with PhysicsEdtior (http://physicseditor.de). Do not edit
--
-- Usage example:
--			local scaleFactor = 1.0
--			local physicsData = (require "shapedefs").physicsData(scaleFactor)
--			local shape = display.newImage("objectname.png")
--			physics.addBody( shape, physicsData:get("objectname") )
--

-- copy needed functions to local scope
local unpack = unpack
local pairs = pairs
local ipairs = ipairs

local M = {}

function M.physicsData(scale)
	local physics = { data =
	{ 
		
		["pick-axe2"] = {
                    
                    
                    
                    
                    {
                    pe_fixture_id = "", density = 1, friction = 0.3, bounce = 1,  isSensor=true, 
                    filter = { categoryBits = 1, maskBits = 65535, groupIndex = 0 },
                    shape = {   62, -90  ,  62, -67  ,  -61, -67  ,  -64, -90  }
                    }
                    
                    
                    
		},
--		["pick-axe2"] = {
--                   
--                  
--                    
--                   {
--                    pe_fixture_id = "pick-axe", density = 1, friction = 0.3, bounce = 1, isSensor=true, 
--                   filter = { categoryBits = 1, maskBits = 65535, groupIndex = 0 },
--                    radius = 98.046
--                    }
--                    
--                    
--		},
		["Cart"] = {
                    
                    
                    
                    
                    {
                    pe_fixture_id = "", density = 1, friction = 0.3, bounce = 1, 
                    filter = { categoryBits = 1, maskBits = 65535, groupIndex = 0 },
                    shape = {   -116, -38  ,  118, -39  ,  106, -19  ,  -107, -18  }
                    }
                    
                    
                    
		},
		["blue_gem"] = {
                    
                    
                    
                    
                    {
                    pe_fixture_id = "blue_gem", density = 1, friction = 0.3, bounce = 1, 
                    filter = { categoryBits = 1, maskBits = 65535, groupIndex = 0 },
                    shape = {   30, -11  ,  12, 21  ,  -11, 21  ,  -32, -12  }
                    }
                    
                    
                    
		},
		["red_gem"] = {
                    
                    
                    
                    
                    {
                    pe_fixture_id = "red_gem", density = 1, friction = 0.3, bounce = 1, 
                    filter = { categoryBits = 1, maskBits = 65535, groupIndex = 0 },
                    shape = {   0, 20  ,  -25, -18  ,  25, -18  }
                    }
                    
                    
                    
		},
		["purple_gem"] = {
                    
                    
                    
                    
                    {
                    pe_fixture_id = "purple_gem", density = 1, friction = 0.3, bounce = 1, 
                    filter = { categoryBits = 1, maskBits = 65535, groupIndex = 0 },
                    shape = {   0, 17  ,  -18, -17  ,  19, -18  }
                    }
                    
                    
                    
		},
		["tri_gem"] = {
                    
                    
                    
                    
                    {
                    pe_fixture_id = "tri_gem", density = 1, friction = 0.3, bounce = 1, 
                    filter = { categoryBits = 1, maskBits = 65535, groupIndex = 0 },
                    shape = {   0, 9  ,  -16, -15  ,  14, -15  }
                    }
                    
                    
                    
		},
--		["rock"] = {
--                    
--                    
--                    
--                    
--                    {
--                    pe_fixture_id = "rock", density = 1, friction = 0.3, bounce = 1, 
--                    filter = { categoryBits = 1, maskBits = 65535, groupIndex = 0 },
--                    shape = {   61, -66.5  ,  91, 33.5  ,  -59, 62.5  ,  -76, -68.5  }
--                    }
--                    
--                    
--                    
--		}
		["rock"] = {
                    
                    
                    
                    
                    {
                    pe_fixture_id = "rock", density = 1, friction = 0.3, bounce = 1, 
                    filter = { categoryBits = 1, maskBits = 65535, groupIndex = 0 },
                    shape = {   40, -40  ,  64, -24  ,  47, 38  ,  -1, 44  ,  -41, 36  ,  -62, -42  }
                    }
                    
                    
                    
		}
		
	} }

        -- apply scale factor
        local s = scale or 1.0
        for bi,body in pairs(physics.data) do
                for fi,fixture in ipairs(body) do
                    if(fixture.shape) then
                        for ci,coordinate in ipairs(fixture.shape) do
                            fixture.shape[ci] = s * coordinate
                        end
                    else
                        fixture.radius = s * fixture.radius
                    end
                end
        end
	
	function physics:get(name)
		return unpack(self.data[name])
	end

	function physics:getFixtureId(name, index)
                return self.data[name][index].pe_fixture_id
	end
	
	return physics;
end

return M

