-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsquirrelData.lua
More file actions
40 lines (30 loc) · 765 Bytes
/
squirrelData.lua
File metadata and controls
40 lines (30 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
module(..., package.seeall)
local unpack = unpack
local pairs = pairs
local ipairs = ipairs
function physicsData(scale)
local physics = { data =
{
["squirrel"] = {
{
density = 0.1, friction = 1.0, bounce = 0.5, name = "squirrel",
type = "bullet", rotation = 0,
filter = { categoryBits = 1, maskBits = 65535 },
shape = { -52.5, 27.5 , -54.5, -32.5 , 95.5, -32.5 , 96.5, 28.5 }
}
}
} }
-- 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