From c38b75ae9a41df7394e1a681e254ca3761d8fba4 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Fri, 24 Jun 2005 21:45:44 +0000 Subject: [PATCH] Allow for event driven rotation. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3623 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../threerings/jme/input/GodViewHandler.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/java/com/threerings/jme/input/GodViewHandler.java b/src/java/com/threerings/jme/input/GodViewHandler.java index 59c8c64c3..706b9ddd9 100644 --- a/src/java/com/threerings/jme/input/GodViewHandler.java +++ b/src/java/com/threerings/jme/input/GodViewHandler.java @@ -90,22 +90,40 @@ public class GodViewHandler extends InputHandler return (_camera.getLocation().z - _minZ) / (_maxZ - _minZ); } + /** + * Swings the camera around the point on the ground at which it is + * "looking", by the requested angle (in radians). + */ + public void rotateCamera (float deltaAngle) + { + rotateCamera(_groundNormal, deltaAngle); + } + protected void setKeyBindings (String api) { KeyBindingManager keyboard = KeyBindingManager.getKeyBindingManager(); InputSystem.createInputSystem(api); keyboard.setKeyInput(InputSystem.getKeyInput()); + + // the key bindings for the pan actions keyboard.set("forward", KeyInput.KEY_W); keyboard.set("backward", KeyInput.KEY_S); keyboard.set("left", KeyInput.KEY_A); keyboard.set("right", KeyInput.KEY_D); + + // the key bindings for the zoom actions keyboard.set("zoomIn", KeyInput.KEY_UP); keyboard.set("zoomOut", KeyInput.KEY_DOWN); + + // the key bindings for the orbit actions keyboard.set("turnRight", KeyInput.KEY_RIGHT); keyboard.set("turnLeft", KeyInput.KEY_LEFT); + + // the key bindings for the roll actions keyboard.set("rollForward", KeyInput.KEY_HOME); keyboard.set("rollBack", KeyInput.KEY_END); + keyboard.set("screenshot", KeyInput.KEY_F12); setKeyBindingManager(keyboard);