I am developing a game that requires the use of a flying camera, and all the controls are fine, but I need to use the mouse button, so, how can I map the input so that holding the middle mouse button rotates the camera?
I have tried several different ways and I am completely lost.
(Do this after simpleInitApp)
1 - Delete the current mapping for “FLYCAM_RotateDrag” // Delete current mapping
2 - Set flyCam.setDragToRotate (true); // Make sure that the trigger is pressed down to move around
3 - inputManager.addMapping(“FLYCAM_RotateDrag”, new MouseButtonTrigger(MouseInput.AXIS_WHEEL)); // Assign new mapping for the mousewheel
If you didn’t understand why I did this, then check the FlyByCamera.java source
Doing it in the update should work, I just tried it, I forgot to say, you need to readd it to the listener, and also it should be MouseInput.BUTTON_MIDDLE not MouseInput.AXIS_WHEEL (my bad)
Heres a quick test I made to show it working. This is not the recommended way to do it, It would be better to make your own “Initialization appstate” or something, else you will spend a lot of time with wasted conditional checking