Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

71 lines (59 sloc) 2.43 kb
-- This file is for use with Corona Game Edition
--
-- 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
module(...)
function physicsData(scale)
local physics = { data =
{
["plane"] = {
{
isSensor = true,
shape = { -3.88835144042969, 27.6504859924316 , -6.41262054443359, 17.7475738525391 , -7.1893196105957, 5.1262149810791 , -6.41262054443359, -14.291259765625 , 8.15048599243164, 5.32038879394531 , 7.56795883178711, 19.1067962646484 , 4.84951400756836, 28.4271845817566 , 0.189319610595703, 34.8349515199661 }
} ,
{
isSensor = true,
shape = { 5.0436897277832, -26.1359214782715 , 7.17961120605469, -14.0970878601074 , 8.15048599243164, 5.32038879394531 , -6.41262054443359, -14.291259765625 , -4.08252334594727, -25.3592224121094 , 0.189319610595703, -29.4368896484375 }
} ,
{
isSensor = true,
shape = { 4.84951400756836, 28.4271845817566 , 7.56795883178711, 19.1067962646484 , 18.8300971984863, 25.3203887939453 , 18.8300971984863, 30.174756526947 }
} ,
{
isSensor = true,
shape = { -18.4514560699463, 24.5436897277832 , -6.41262054443359, 17.7475738525391 , -3.88835144042969, 27.6504859924316 , -18.4514560699463, 29.5922331809998 }
} ,
{
isSensor = true,
shape = { -6.41262054443359, -14.291259765625 , -7.1893196105957, 5.1262149810791 , -38.8398060798645, -9.24271774291992 , -38.8398060798645, -14.2912635803223 }
} ,
{
isSensor = true,
shape = { 7.17961120605469, -14.0970878601074 , 38.8300933837891, -13.9029121398926 , 39.2184448242188, -9.63106536865234 , 8.15048599243164, 5.32038879394531 }
}
}
} }
-- apply scale factor
local s = scale or 1.0
for bi,body in pairs(physics.data) do
for fi,fixture in ipairs(body) do
for ci,coordinate in ipairs(fixture.shape) do
fixture.shape[ci] = s * coordinate
end
end
end
function physics:get(name)
return unpack(self.data[name])
end
return physics;
end
Jump to Line
Something went wrong with that request. Please try again.