added ag::object::getMass() and ag::object::setMass()
git-svn-id: svn://anubis/anaglym/trunk@179 99a6e188-d820-4881-8870-2d33a10e2619
This commit is contained in:
1 parent
2ec38be58c
commit
dec24f3af5
4 files changed
+42
-4
No files matched your search
+4
-3
@@ -15,20 +15,21 @@ function init()
|
||||
local ground = ag.createPlane(0, 0, 1, 0)
|
||||
ground:setColor(0.8, 0.5, 0.0)
|
||||
ground:setPosition(0, 0, -10)
|
||||
ag.setCamera(0, -25, 10, 0, 0, 1, 0, 0, 1)
|
||||
ag.setCamera(0.3, -25, 10, 0, 0, 1, 0, 0, 1)
|
||||
camx, camy, camz, cx, cy, cz = ag.getCamera()
|
||||
|
||||
ball = ag.loadModel("checkerball", 0.5)
|
||||
ball:setPosition(2*camx - cx, 2*camy - cy, 2*camz - cz)
|
||||
ball:setMass(5)
|
||||
--ball = ag.createSphere(0.4)
|
||||
--ball:setColor(0.2, 0.2, 0.9)
|
||||
ball:setPosition(2*camx - cx, 2*camy - cy, 2*camz - cz)
|
||||
end
|
||||
|
||||
function mousebutton_down_event(button)
|
||||
local function button1()
|
||||
local newball = ball:clone()
|
||||
newball:setPosition(camx, camy, 1)
|
||||
force = 800
|
||||
force = 4000
|
||||
newball:addForce(force * (cx-camx),
|
||||
force * (cy-camy),
|
||||
force * (cz-camz))
|
||||
|
||||
Reference in new issue
Block a user