Added key binding from Lua possible

- Possible to add key bindings from Lua possible. This calls Lua scripts
  from key commands.

 - Temporary fixed a small bug for volume rendering
This commit is contained in:
Jonas Strandstedt
2014-11-17 17:02:40 +01:00
parent 8d2503b68e
commit 31c76f3e3c
10 changed files with 443 additions and 170 deletions

21
scripts/bind_keys.lua Normal file
View File

@@ -0,0 +1,21 @@
openspace.clearKeys()
function setEarthAsOrigin()
openspace.setOrigin('Earth')
end
interaction_speed = 2.75
-- Key Bindings
openspace.bindKey("f1", "setEarthAsOrigin()")
openspace.bindKey("f2", "openspace.setOrigin('Mercury')")
openspace.bindKey("f3", "openspace.setPropertyValue('Earth.renderable.enabled', true)")
openspace.bindKey("f4", "openspace.setPropertyValue('Earth.renderable.enabled', false)")
openspace.bindKey("f5", "loadKeyBindings()")
openspace.bindKey("U", "openspace.distance(-interaction_speed * openspace.dt(), 13.0)")
openspace.bindKey("J", "openspace.distance(interaction_speed * openspace.dt(), 13.0)")
openspace.bindKey("PRINT_SCREEN", "openspace.takeScreenshot()")