anaglym/tests/managed_objects.lua
Josh Holtrop 445a08d2e1 calling dInitODE() and dCloseODE() properly for ODE version 0.11.1;
cylinder-capsule and cylinder-cylinder collisions still not working (ODE problem);
need to stop calling dGeomGetPosition() for planes;
need to rework plane initialization to support creating planes with (a,b,c,d) parameters

git-svn-id: svn://anubis/anaglym/trunk@136 99a6e188-d820-4881-8870-2d33a10e2619
2009-10-28 15:50:45 +00:00

28 lines
746 B
Lua

--ground = ag.createStaticPlane(0, 0, 0, 0, 0, 0)
ground = ag.createStaticBox(1000, 1000, 1000)
ground:setPosition(0, 0, -500)
ground:setColor(0.2, 1.0, 0.2)
ag.setCamera(10, -10, 10, 0, 0, 0)
function init(obj)
obj:setColor(math.random(), math.random(), math.random())
obj:setPosition((math.random() - 0.5) * 10, (math.random() - 0.5) * 10, 10)
end
function key_down_event(key)
if (key == "b") then
box = ag.createBox(1, 1, 1)
init(box)
elseif (key == "c") then
cyl = ag.createCylinder(0.5, 1)
init(cyl)
elseif (key == "a") then
ccyl = ag.createCCylinder(0.5, 1)
init(ccyl)
elseif (key == "s") then
sphere = ag.createSphere(0.8)
init(sphere)
end
end