anaglym/ag.lua
Josh Holtrop fd33b69d78 moved built-in Lua to ag.lua, converting to C with xxd
git-svn-id: svn://anubis/anaglym/trunk@232 99a6e188-d820-4881-8870-2d33a10e2619
2010-01-29 20:45:32 +00:00

53 lines
1.1 KiB
Lua

next = ag.next
type = ag.type
pairs = function(table)
return next, table, nil
end
ipairs = function(table)
local iter_func = function(t, i)
i = i + 1
if t[i] == nil then
return nil
else
return i, t[i]
end
end
return iter_func, table, 0
end
ag.createAMotor = function(obj1, obj2, axis0, axis1, axis2)
local function setAMotorAxis(amotor, anum, axis)
end
local o1 = obj1
local o2 = obj2
local num_axes = 1
if (type(obj1) == "number") then
if (obj1 == 0) then
o1 = { id = 0 }
end
end
if (type(obj2) == "number") then
if (obj2 == 0) then
o2 = { id = 0 }
end
end
local num_axes = 0
if (axis0 ~= nil) then
setAMotorAxis(0, axis0)
num_axes = 1
if (axis1 ~= nil) then
setAMotorAxis(1, axis1)
num_axes = 1
if (axis2 ~= nil) then
setAMotorAxis(2, axis2)
num_axes = 2
end
end
end
ag.setAMotorNumAxes(num_axes)
end