Allow for event driven rotation.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3623 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2005-06-24 21:45:44 +00:00
parent a940d490a8
commit c38b75ae9a
@@ -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);