In this recipe, we'll try to mimic the camera and controls that are common in RTS games. The camera will mostly look down on the scene, and aside from basic movement and rotation of the camera, there will also be automatic scrolling when the mouse reaches the edges of the screen.
We're going to set up the camera and camera handling in this recipe. Loading a scene to make sure the camera works as expected would be helpful.
To create an RTS camera
AppState object, perform the following steps:
ActionListenerinterfaces so that we can receive user input from the mouse and keyboard. We'll use these to control the camera ...