testing gravity in tests/bowling.lua, updated ag.setGravity() documentation

git-svn-id: svn://anubis/anaglym/trunk@201 99a6e188-d820-4881-8870-2d33a10e2619
This commit is contained in:
Josh Holtrop 2009-12-09 00:14:17 +00:00
parent ea4346a55e
commit ca6aa317ce
2 changed files with 5 additions and 0 deletions

View File

@ -398,6 +398,7 @@ The default up vector is (0, 0, 1).
<p><tt>ag.setGravity(gx, gy, gz)</tt></p> <p><tt>ag.setGravity(gx, gy, gz)</tt></p>
<p> <p>
This function sets the gravity vector to (gx, gy, gz). This function sets the gravity vector to (gx, gy, gz).
The default gravity vector is (0, 0, -9.81).
</p> </p>
<a name="ag_startFrame" /> <a name="ag_startFrame" />

View File

@ -53,6 +53,10 @@ function key_down_event(key)
elseif (key == "c") then elseif (key == "c") then
local c = ag.loadModel("crate") local c = ag.loadModel("crate")
c:setPosition(-3, -3, 5) c:setPosition(-3, -3, 5)
elseif (key == "g") then
ag.setGravity(0, 0, 2)
elseif (key == "r") then
ag.setGravity(0, 0, -9.81)
end end
end end