added support for hinge joints with anchor and axis

git-svn-id: svn://anubis/anaglym/trunk@238 99a6e188-d820-4881-8870-2d33a10e2619
This commit is contained in:
Josh Holtrop committed 2010-01-31 06:07:31 +00:00
1 parent d26bf27114
commit b2d131075a
6 files changed
+142 -14

No files matched your search

+13 -7
View File
@@ -39,12 +39,18 @@ function key_down_event(key)
ag.exit()
elseif (key == "r") then
-- creating a rotating cube
local box = ag.createBox(1, 1, 1)
init_obj(box)
ag.createAMotor(0, box,
{ x = 0, y = 0, z = 1, vel = 10, fmax = 10 })
local x, y, z = box:getPosition()
box:setPosition(x, y, 2)
box:setGravityMode(false)
local spinner = ag.createBox(10, 1, 0.5)
spinner:setPosition(0, 0, 1)
spinner:setColor(1, 0.7, 0.7)
spinner:setGravityMode(false)
ag.createAMotor(0, spinner,
{ x = 0, y = 0, z = 1, vel = 5, fmax = 50 })
ag.createHinge(0, spinner, {spinner:getPosition()}, {0, 0, 1})
-- local box = ag.createBox(1, 1, 1)
-- init_obj(box)
-- ag.createAMotor(0, box,
-- { x = 0, y = 0, z = 1, vel = 0, fmax = 0 })
-- local x, y, z = box:getPosition()
-- box:setPosition(x, y, 2)
end
end