/** Suppression des contrôles par défaut, puis nouveau mapping de contrôle plus adapter. */ public void setupControls() { // Removing some shortcut inputManager.deleteMapping("FLYCAM_Left"); inputManager.deleteMapping("FLYCAM_Right"); inputManager.deleteMapping("FLYCAM_Up"); inputManager.deleteMapping("FLYCAM_Down"); inputManager.deleteMapping("FLYCAM_StrafeLeft"); inputManager.deleteMapping("FLYCAM_StrafeRight"); inputManager.deleteMapping("FLYCAM_Forward"); inputManager.deleteMapping("FLYCAM_Backward"); inputManager.deleteMapping("FLYCAM_Rise"); inputManager.deleteMapping("FLYCAM_Lower"); inputManager.deleteMapping("FLYCAM_ZoomIn"); inputManager.deleteMapping("FLYCAM_ZoomOut"); // Keyboard // -- empty // Mouse inputManager.addMapping("RotateEnable", new MouseButtonTrigger(MouseInput.BUTTON_LEFT)); inputManager.addMapping("MoveEnable", new MouseButtonTrigger(MouseInput.BUTTON_RIGHT)); inputManager.addMapping("MoveX-L", new MouseAxisTrigger(MouseInput.AXIS_X, true)); inputManager.addMapping("MoveX-R", new MouseAxisTrigger(MouseInput.AXIS_X, false)); inputManager.addMapping("MoveY-U", new MouseAxisTrigger(MouseInput.AXIS_Y, false)); inputManager.addMapping("MoveY-D", new MouseAxisTrigger(MouseInput.AXIS_Y, true)); inputManager.addMapping("ZoomIn", new MouseAxisTrigger(MouseInput.AXIS_WHEEL, false)); inputManager.addMapping("ZoomOut", new MouseAxisTrigger(MouseInput.AXIS_WHEEL, true)); moveEnable = false; rotateEnable = false; inputManager.setCursorVisible(true); inputManager.addListener(actionListener, new String[] {"MoveEnable", "RotateEnable", "TEST"}); inputManager.addListener( analogListener, new String[] {"MoveX-L", "MoveX-R", "MoveY-U", "MoveY-D", "ZoomIn", "ZoomOut"}); }
public void cursor(boolean cursor) { inputManager.setCursorVisible(cursor); cameraManager.flyCamActive(cursor); }